Creating custom maintenance task that is configurable
Hey all,
I have created a custom maintenance task by using the following class. I can add the task in the maintenance page, but the "configure" icon is missing. It only shows the start icon. Any clue on what I am missing?
Thanks!
Roy
@Component( property = { MaintenanceConstants.PROPERTY_TASK_NAME + "=" + "FullIndexerTask", MaintenanceConstants.PROPERTY_TASK_TITLE + "=" + "Full Indexer", JobExecutor.PROPERTY_TOPICS + "=" + MaintenanceConstants.TASK_TOPIC_PREFIX + "FullIndexerTask" } ) @Designate(ocd = FullIndexer.Config.class) public class FullIndexer implements JobExecutor { private static final Logger LOG = LoggerFactory.getLogger(FullIndexer.class); private static final String SUBSERVICE_NAME = "fullindexer"; @ObjectClassDefinition(name = "Full Indexer Task", description = "Full indexer that will reindex all pages for the included site names") @interface Config { @AttributeDefinition(description = "Site names that should be reindexed") String[] site_names(); } private List<String> siteNames = new ArrayList<>(); @Activate protected void activate(Config config) { if (config.site_names() != null) { this.siteNames = Arrays.asList(config.site_names()); } } @Override public JobExecutionResult process(Job job, JobExecutionContext context) { ... } }