public UpdateSendMailOnPagesNotificationTask() { super("Update sendMailOnPageChanges configuration", "Updates sendMailOnPageChanges listener configuration in order to use a freemarker template for sending an email.", new RemovePropertyTask("", "", RepositoryConstants.CONFIG, listenerParams, "from"), new RemovePropertyTask("", "", RepositoryConstants.CONFIG, listenerParams, "subject"), new RemovePropertyTask("", "", RepositoryConstants.CONFIG, listenerParams, "text"), new PropertyExistsDelegateTask("", "", RepositoryConstants.CONFIG, listenerParams, "type", new CheckAndModifyPropertyValueTask("", "", RepositoryConstants.CONFIG, listenerParams, "type", "text", "freemarker")), new PropertyExistsDelegateTask("", "", RepositoryConstants.CONFIG, listenerParams, "mailTemplate", new SetPropertyTask("", RepositoryConstants.CONFIG, listenerParams, "mailTemplate", "pageChangeNotification")), new PartialBootstrapTask("", "", "/mgnl-bootstrap/listenerConfigs/config.modules.observation.config.xml", "/config/listenerConfigurations/sendMailOnPageChanges/listener/params/model")); } }
new PropertyExistsDelegateTask("", "/modules/mail/config/smtp/", MailConstants.SMTP_PORT, new MovePropertyTask("", RepositoryConstants.CONFIG, "/modules/mail/config/smtp/smtpPort", "/modules/mail/config/smtpConfiguration/port", true) ), new PropertyExistsDelegateTask("", "/modules/mail/config/smtp/", MailConstants.SMTP_SERVER, new MovePropertyTask("", RepositoryConstants.CONFIG, "/modules/mail/config/smtp/smtpServer", "/modules/mail/config/smtpConfiguration/server", true) ), new PropertyExistsDelegateTask("", "/modules/mail/config/smtp/", MailConstants.SMTP_SECURITY, new MovePropertyTask("", RepositoryConstants.CONFIG, "/modules/mail/config/smtp/smtpSecurity", "/modules/mail/config/smtpConfiguration/security", true) ), new PropertyExistsDelegateTask("", "/modules/mail/config/smtp/", MailConstants.SMTP_USER, new MovePropertyTask("", RepositoryConstants.CONFIG, "/modules/mail/config/smtp/smtpUser", "/modules/mail/config/smtpConfiguration/authentication/user", true) ), new PropertyExistsDelegateTask("", "/modules/mail/config/smtp/", MailConstants.SMTP_PASSWORD, new PropertyValueDelegateTask("", "/modules/mail/config/smtp/", MailConstants.SMTP_PASSWORD, "", false, new RemovePropertyTask("", "/modules/mail/config/smtp/", MailConstants.SMTP_PASSWORD),
@Test public void testAutogeneratedDescription() throws Exception { // GIVEN PropertyExistsDelegateTask task; // WHEN task = new PropertyExistsDelegateTask("taskName", "/somePath/someNode", "someProperty", new BootstrapSingleModuleResource("/info/magnolia/test/website.newtestpages1.xml"), new BootstrapSingleModuleResource("/info/magnolia/test/website.newtestpages2.xml") ); // THEN assertEquals( "Execute task [Bootstraps module resource '/info/magnolia/test/website.newtestpages1.xml' from '/mgnl-bootstrap/' folder.] if property '/somePath/someNode/someProperty' exists " + "or [Bootstraps module resource '/info/magnolia/test/website.newtestpages2.xml' from '/mgnl-bootstrap/' folder.] if not.", task.getDescription()); } }
new BootstrapSingleResource("", "", "/mgnl-bootstrap/standard-templating-kit/dialogs/components/pur/config.modules.standard-templating-kit.dialogs.components.pur.stkPURLoginForm.xml", ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING))) .addTask(new PropertyExistsDelegateTask("Update template 'stkPURAuthSubmit'", "/modules/standard-templating-kit/templates/components/pur/stkPURAuthSubmit", "modelClass", new RemovePropertyTask("", "/modules/standard-templating-kit/templates/components/pur/stkPURAuthSubmit", "modelClass"))) .addTask(new PropertyExistsDelegateTask("Update template 'stkPURNotAuthSubmit'", "/modules/standard-templating-kit/templates/components/pur/stkPURNotAuthSubmit", "modelClass", new RemovePropertyTask("", "/modules/standard-templating-kit/templates/components/pur/stkPURNotAuthSubmit", "modelClass"))) .addTask(new PropertyExistsDelegateTask("Update template 'stkPURIntranet'", "/modules/standard-templating-kit/templates/components/pur/stkPURIntranet", "modelClass", new RemovePropertyTask("", "/modules/standard-templating-kit/templates/components/pur/stkPURIntranet", "modelClass"))) .addTask(new PropertyExistsDelegateTask("Update template 'stkPURLoginForm'", "/modules/standard-templating-kit/templates/components/pur/stkPURLoginForm", "modelClass", new RemovePropertyTask("", "/modules/standard-templating-kit/templates/components/pur/stkPURLoginForm", "modelClass")))
new PropertyExistsDelegateTask("Cleanup", "Config property /server/defaultMailServer was unused.", "config", "/server", "defaultMailServer", new RemovePropertyTask("", "", "config", "/server", "defaultMailServer")),
new NodeExistsDelegateTask("Delete activationMonitor App from activation apps", "", RepositoryConstants.CONFIG, "/modules/activation/apps/activationMonitor", new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/activation/apps/activationMonitor")), new PropertyExistsDelegateTask("Update appClass from 'info.magnolia.ui.framework.app.BaseApp' to 'info.magnolia.module.activation.app.ActivationBaseApp'", "", RepositoryConstants.CONFIG, "/modules/activation/apps/activation", "appClass", new CheckAndModifyPropertyValueTask("", "", RepositoryConstants.CONFIG, "/modules/activation/apps/activation", "appClass", BaseApp.class.getName(), ActivationBaseApp.class.getName())) ))
.addTask(new PropertyExistsDelegateTask("Remove label for delete action", "", RepositoryConstants.CONFIG, "/modules/contacts/apps/contacts/subApps/browser/actions/delete", "label", new RemovePropertyTask("", "", RepositoryConstants.CONFIG, "/modules/contacts/apps/contacts/subApps/browser/actions/delete", "label"))) .addTask(new PropertyExistsDelegateTask("Remove icon for delete action", "", RepositoryConstants.CONFIG, "/modules/contacts/apps/contacts/subApps/browser/actions/delete", "icon", new RemovePropertyTask("Remove icon for delete action", "", RepositoryConstants.CONFIG, "/modules/contacts/apps/contacts/subApps/browser/actions/delete", "icon")))
.addTask(new PropertyExistsDelegateTask("Remove label for deleteAsset action", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/browser/actions/deleteAsset", "label", new RemovePropertyTask("", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/browser/actions/deleteAsset", "label"))) .addTask(new PropertyExistsDelegateTask("Remove icon for deleteAsset action", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/browser/actions/deleteAsset", "icon", new RemovePropertyTask("", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/browser/actions/deleteAsset", "icon"))) .addTask(new PropertyExistsDelegateTask("Remove label for deleteFolder action", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/browser/actions/deleteFolder", "label", new RemovePropertyTask("Remove label for deleteFolder action", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/browser/actions/deleteFolder", "label"))) .addTask(new PropertyExistsDelegateTask("Remove icon for deleteFolder action", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/browser/actions/deleteFolder", "icon", new RemovePropertyTask("Remove icon for deleteFolder action", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/browser/actions/deleteFolder", "icon"))) .addTask(new PropertyExistsDelegateTask("Rename the metadataStandard field type ", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/detail/editor/form/tabs/asset/fields/metadataStandard", "class", new SetPropertyTask("", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/detail/editor/form/tabs/asset/fields/metadataStandard", "class", StaticFieldDefinition.class.getName()))) .addTask(new PropertyExistsDelegateTask("Remove default value of the metadataStandard field Definition ", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/detail/editor/form/tabs/asset/fields/metadataStandard", "defaultValue", new RemovePropertyTask("", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/detail/editor/form/tabs/asset/fields/metadataStandard", "defaultValue"))) .addTask(new PropertyExistsDelegateTask("Set value property of the static metadataStandard field ", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/detail/editor/form/tabs/asset/fields/metadataStandard", "defaultValue", new SetPropertyTask("Set value of the static metadataStandard field ", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/detail/editor/form/tabs/asset/fields/metadataStandard", "value", "Simple Dublin Core Metadata Element Set (DCMES)"))) .addTask(new PropertyExistsDelegateTask("Replace DetailSubApp by AssetDetailSubApp ", "", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/detail", "subAppClass", new SetPropertyTask("", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/subApps/detail", "subAppClass", AssetDetailSubApp.class.getName()))) .addTask(new PropertyExistsDelegateTask("Remove obsolete 'categoryName' if exists", "Remove '/modules/dam/apps/assets/categoryName' if exists.", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/", "categoryName", new RemovePropertyTask("Remove obsolete 'categoryName'", "Remove '/modules/dam/apps/assets/categoryName'", RepositoryConstants.CONFIG, "/modules/dam/apps/assets/", "categoryName"))) new PropertyExistsDelegateTask("", "/modules/dam/apps/assets/subApps/browser/workbench/nodeTypes/mainNodeType", "icon", new RemovePropertyTask("", "/modules/dam/apps/assets/subApps/browser/workbench/nodeTypes/mainNodeType", "icon")), new NodeExistsDelegateTask("", "/modules/dam/apps/assets/subApps/browser/workbench/contentViews/list/columns/asset", new CheckAndModifyPropertyValueTask("/modules/dam-app/apps/assets/subApps/browser/actions/restorePreviousVersion", "class", "info.magnolia.ui.contentapp.detail.action.RestorePreviousVersionActionDefinition", "info.magnolia.ui.contentapp.browser.action.RestoreItemPreviousVersionActionDefinition"),
.addTask(new PropertyExistsDelegateTask("Rename property", "", RepositoryConstants.CONFIG, "/modules/forum/dialogs/forumEdit/tabForum/allowsNestingMessages", "checked", new ArrayDelegateTask("", new RemovePropertyTask("", "", RepositoryConstants.CONFIG, "/modules/forum/dialogs/forumEdit/tabForum/allowsNestingMessages", "checked"),
new RemoveNodeTask("Remove rssaggregator from '/modules/data/config/importers/rssaggregator'", "/modules/data/config/importers/rssaggregator"))) .addTask(new ArrayDelegateTask("Set property fetcherClass according to /modules/rssaggregator/config/fetcher@class or to default value 'info.magnolia.module.rssaggregator.importhandler.FastRSSFeedFetcher' and remove /modules/rssaggregator/config/fetcher node.", new PropertyExistsDelegateTask("Set property fetcherClass according to /modules/rssaggregator/config/fetcher@class", "/modules/rssaggregator/config/fetcher", "class", new SetFetcherClassPropertyTask(), new SetPropertyTask(RepositoryConstants.CONFIG, "/modules/rssaggregator/config", "fetcherClass", "info.magnolia.module.rssaggregator.importhandler.FastRSSFeedFetcher")),
.addTask(new PropertyExistsDelegateTask("Remove label for delete action", "", RepositoryConstants.CONFIG, "/modules/categorization/apps/categories/subApps/browser/actions/delete", "label", new RemovePropertyTask("", "", RepositoryConstants.CONFIG, "/modules/categorization/apps/categories/subApps/browser/actions/delete", "label"))) .addTask(new PropertyExistsDelegateTask("Remove icon for delete action", "", RepositoryConstants.CONFIG, "/modules/categorization/apps/categories/subApps/browser/actions/delete", "icon", new RemovePropertyTask("", "", RepositoryConstants.CONFIG, "/modules/categorization/apps/categories/subApps/browser/actions/delete", "icon"))) .addTask(new PropertyExistsDelegateTask("Remove AutoGeneratedExtrasArea class", "/modules/standard-templating-kit/templates/pages/stkCategoryOverview/areas/extras/", "class", new RemovePropertyTask("Remove AutoGeneratedExtrasArea class, has been replaced by AreaElement.", "/modules/standard-templating-kit/templates/pages/stkCategoryOverview/areas/extras/", "class")))