public ReplaceInplaceTemplatingLegacyAppTask() { super("Replace legacy Templates app", "Replaces legacy UI pages tree, dialogs and app launcher configuration with a Magnolia 5 app.", new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/inplace-templating/pages"), new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/inplace-templating/trees"), new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/inplace-templating/dialogs/templatesEdit"), new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/ui-admincentral/apps/templatesApp"), new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/stk/apps/templatesApp"), new BootstrapSingleResource("", "", "/mgnl-bootstrap/inplace-templating/config.modules.inplace-templating.apps.xml"), new BootstrapSingleResource("", "", "/mgnl-bootstrap/inplace-templating/config.modules.inplace-templating.dialogs.renameTemplate.xml")); }
@Override protected List<Task> getBasicInstallTasks(InstallContext installContext) { final List<Task> installTasks = new ArrayList<Task>(); // Remove RelatedCategories if needed. This will be bootstrap later on. installTasks.add(new NodeExistsDelegateTask("STK RelatedCategories Link List removal", "Remove the STK Related Categories Link List if it exists. The new definition will then be bootstrapped.", RepositoryConstants.CONFIG, "/modules/standard-templating-kit/dialogs/paragraphs/features/stkRelatedCategoriesLinkList", new RemoveNodeTask("Remove RelatedCategories", "", RepositoryConstants.CONFIG, "/modules/standard-templating-kit/dialogs/paragraphs/features/stkRelatedCategoriesLinkList"), null)); installTasks.addAll(super.getBasicInstallTasks(installContext)); return installTasks; }
public SamplesVersionHandler() { register(DeltaBuilder.update("5.4.1", "") .addTask(new ArrayDelegateTask("Remove samples configuration from JCR", new NodeExistsDelegateTask("", "/modules/samples/dialogs", new RemoveNodeTask("", "/modules/samples/dialogs")), new NodeExistsDelegateTask("", "/modules/samples/templates", new RemoveNodeTask("", "/modules/samples/templates")), new NodeExistsDelegateTask("", "/modules/samples/virtualURIMapping", new RemoveNodeTask("", "/modules/samples/virtualURIMapping")))) .addTasks(getCommonTasks())); register(DeltaBuilder.update("6.0", "") .addTask(new RemoveNodeTask("Remove JSP sample site", "Magnolia Templating JSP is deprecated as of 6.0.", WEBSITE, "/jsp-sample-site"))); }
public ReplaceIfExistsTask(String name, String description, String warningMessageIfNotExisting, String workspaceName, String pathToCheck, String bootstrapFile) { super(name, description, workspaceName, pathToCheck, new ArrayDelegateTask("", new RemoveNodeTask("", "", workspaceName, pathToCheck), new BootstrapSingleResource(name, description, bootstrapFile) ), new WarnTask(name, warningMessageIfNotExisting)); } }
new RemoveNodeTask("", "/" + OLD_RENDERING_LISTENERS_LOCATION));
private Task getRemoveLegacyAppsTask(String name, String description) { ArrayDelegateTask removeLegacyAppsTask = new ArrayDelegateTask(name, description); try { Node appsNode = SessionUtil.getNode(RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/data/apps"); if (appsNode != null) { NodeIterator nodeIterator = appsNode.getNodes(); while (nodeIterator.hasNext()) { String appName = ((Node) nodeIterator.next()).getName(); removeLegacyAppsTask.addTask(new RemoveNodeTask("Remove data legacy app " + appName, "This removes configuration for the data legacy app " + appName, RepositoryConstants.CONFIG, "/modules/ui-admincentral/apps/" + appName)); removeLegacyAppsTask.addTask(new RemoveNodeTask("Remove " + appName + " launcher", "This task removes the applauncher configuration for the data legacy app " + appName, RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/data/apps/" + appName)); } } } catch (RepositoryException e) { log.warn("Couldn't fetch data app configuration in appLauncherLayout", e); } return removeLegacyAppsTask; }
public DamTemplatingVersionHandler() { register(DeltaBuilder.update("2.0", "") .addTask(new NodeExistsDelegateTask("Remove AssetMapModel declaration from freemarker modelFactory. With DAM 2.0 this is replaced by a normal Map", "/server/rendering/freemarker/modelFactories/damModelFactory", new RemoveNodeTask("", "/server/rendering/freemarker/modelFactories/damModelFactory")))); register(DeltaBuilder.update("2.1", "") .addTask(new InstallRendererContextAttributeTask("rendering", "freemarker", "damfn", DamTemplatingFunctions.class.getName()))); }
@Test public void testAutogeneratedDescription() throws Exception { // GIVEN Task task; // WHEN task = new RemoveNodeTask("name", "/pathToRemove1"); // THEN assertEquals("Remove node 'config:/pathToRemove1'.", task.getDescription()); } }
public SiteModuleVersionHandler() { register(DeltaBuilder.update("1.0.1", "") .addTask(updateI18nContentSupport)); register(DeltaBuilder.update("1.0.3", "") .addTask(new NodeExistsDelegateTask("Create empty site definition node if it does not exist", "/modules/site/config/site", null, new BootstrapSingleModuleResource("config.modules.site.config.site.xml")))); register(DeltaBuilder.update("1.0.5", "") .addTask(new BootstrapConditionally("Add site-aware JSP renderer if it does not exist", "/mgnl-bootstrap/site/config.modules.site.renderers.site-jsp.xml")) .addTask(new PropertyValueDelegateTask("Reconfigure site renderer to delegate to freemarker renderer", "/modules/site/renderers/site", "class", SiteAwareFreemarkerRenderer.class.getName(), true, new ArrayDelegateTask("", new SetPropertyTask(RepositoryConstants.CONFIG, "/modules/site/renderers/site", "wrappedRendererType", "freemarker"), new SetPropertyTask(RepositoryConstants.CONFIG, "/modules/site/renderers/site", "class", SiteAwareRendererWrapper.class.getName()), new RemoveNodeTask("", "/modules/site/renderers/site/contextAttributes"), new RemovePropertyTask("", "/modules/site/renderers/site/", "type")))) .addTask(orderSiteMergeFilter) //fix incorrect order of siteMerge filter after update from M5.3 which is before multiSite filter ); register(DeltaBuilder.update("1.1", "") .addTask(new NodeExistsDelegateTask("Remove themes folder if empty", "Location /modules/site/config/themes is deprecated but still supported", RepositoryConstants.CONFIG, "/modules/site/config/themes", new RemoveNodeWithoutChildren("/modules/site/config/themes")))); }
new PartialBootstrapTask("Bootstrap app", "Bootstrap activation monitor app", "/mgnl-bootstrap/activation/config.modules.activation.apps.xml", "/apps/activationMonitor"), new NodeExistsDelegateTask("Remove Activation tools from dev group of appLauncher", "", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/dev/apps/activation", new RemoveNodeTask("Remove Activation tools from dev group of appLauncher", "", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/dev/apps/activation")) ), new BootstrapSingleModuleResource("Bootstrap app", "Bootstrap activation apps.", "config.modules.activation.apps.xml") new MoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/activation/apps/activationMonitor/subApps/main", "/modules/activation/apps/activation/subApps/monitor", false)), new NodeExistsDelegateTask("Delete activationMonitor App from tools", "", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/tools/apps/activationMonitor", new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/tools/apps/activationMonitor")), new NodeExistsDelegateTask("Delete activationMonitor App from tools", "", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/tools/apps/activationMonitor", new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/tools/apps/activationMonitor")),
public TemplatingModuleVersionHandler() { .addTask(new RemoveNodeTask("Remove backwards compatibility filter", "", RepositoryConstants.CONFIG, "/server/filters/cms/backwardCompatibility")) .addTask(new RemoveNodeTask("Remove template-renderers", "", RepositoryConstants.CONFIG, "/modules/templating/template-renderers")) .addTask(new RemoveNodeTask("Remove paragraph-renderers", "", RepositoryConstants.CONFIG, "/modules/templating/paragraph-renderers")) .addTask(new RenamePropertyAllModulesNodeTask("Templates configuration", "templatePath is now templateScript.", "templates", "templatePath", "templateScript")) .addTask(new RenamePropertyAllModulesNodeTask("Paragraphs configuration", "templatePath is now templateScript.", "paragraphs", "templatePath", "templateScript"))
@Test public void testExecute() throws RepositoryException, TaskExecutionException { // GIVEN RemoveNodeTask task = new RemoveNodeTask("name", "description", RepositoryConstants.WEBSITE, valideNodePath1); // WHEN task.execute(ctx); // THEN assertFalse("Node should have been removed", websiteSession.nodeExists(valideNodePath1)); assertTrue("Parent node should exist", websiteSession.nodeExists("/demo-project/about/subsection-articles")); }
public RenderingModuleVersionHandler() { register(DeltaBuilder.update("4.5", "") .addTask(new BootstrapSingleResource( "Register FTL Context Attribute", "Add cms and cmsfn context Attribute", "/mgnl-bootstrap/rendering/config.modules.rendering.renderers.freemarker.contextAttributes.xml"))); register(DeltaBuilder.update("4.5.3", "") .addTask(transformSubTemplatesToVariations)); register(DeltaBuilder.update("4.5.4", "") .addTask(correctVariations)); register(DeltaBuilder.update("5.4", "") .addTask(new MigrateRenderingListenersTask()) ); register(DeltaBuilder.update("5.5.1", "") .addTask(new RemovePropertiesTask("Remove obsolete type property from renderers", RepositoryConstants.CONFIG, Arrays.asList("/modules/rendering/renderers/freemarker/type", "/modules/rendering/renderers/jsp/type"), false)) ); register(DeltaBuilder.update("6.0", "") .addTask(new RemoveNodeTask("Remove JSP renderer configuration.", "/modules/rendering/renderers/jsp")) ); } }
new LoginFormPropertyMovedToFilter(), new MoveAndRenamePropertyTask("unsecuredPath is now handled by the bypass mechanism.", "/server/login", "UnsecuredPath", "/server/filters/uriSecurity/bypasses/login", "pattern"), new RemoveNodeTask("Login configuration changed", "Removes /server/login as it is not used anymore.", "config", "/server/login") )),
new RemoveNodeTask("Remove obsolete compressible configuration.", "/" + OBSOLETE_COMPRESSIBLE_CONFIGURATION_PATH), new MoveNodeTask("", OBSOLETE_DEFAULT_CONFIGURATION_PATH + "cachePolicy/voters", OBSOLETE_DEFAULT_CONFIGURATION_PATH + "cachePolicy/shouldBypassVoters", false), new RemoveNodesTask("Remove deprecated cacheable voters", new RemoveNodeTask("", "/modules/ui-admincentral/apps/cacheTools"))) .addTask(new NodeExistsDelegateTask("Remove cache tools page", "/modules/cache/pages/cachePage", new RemoveNodeTask("", "/modules/cache/pages/cachePage"))) .addTask(new RemoveNodeWoChildren("Remove pages node if there are no pages registered.", "/modules/cache/pages")) .addTask(new RemoveVirtualUriMappingTask()) register(DeltaBuilder.update("5.5.2", "") .addTask(new ArrayDelegateTask("Disable browser cache only when magnolia.develop=true", new RemoveNodeTask("", "/modules/cache/config/contentCaching/defaultPageCache/browserCachePolicy/policies/never"), new PartialBootstrapTask("", "/mgnl-bootstrap/cache/config.modules.cache.config.contentCaching.defaultPageCache.xml", "/defaultPageCache/browserCachePolicy/policies/disableBrowserCacheInDevelopMode"), new OrderNodeToFirstPositionTask("", "modules/cache/config/contentCaching/defaultPageCache/browserCachePolicy/policies/disableBrowserCacheInDevelopMode")
new RemoveNodeTask("Remove dialog links Node", "Remove dialog definition in contacts/dialogs/links", RepositoryConstants.CONFIG, "/modules/contacts/dialogs/link"))) .addTask(new NodeExistsDelegateTask("Remove dialog folder Node", "Remove dialog definition in contacts/dialogs/folder", RepositoryConstants.CONFIG, "/modules/contacts/dialogs/folder", new RemoveNodeTask("Remove dialog folder Node", "Remove dialog definition in contacts/dialogs/folder", RepositoryConstants.CONFIG, "/modules/contacts/dialogs/folder"))) .addTask(new NodeExistsDelegateTask("Change folder action to reference ui-framework", "", RepositoryConstants.CONFIG, "/modules/contacts/apps/contacts/subApps/browser/actions/editFolder", new CheckAndModifyPartOfPropertyValueTask("Change rename-folder dialog reference", "Change rename-folder action to reference 'ui-framework:folder'", RepositoryConstants.CONFIG, "/modules/contacts/apps/contacts/subApps/browser/actions/editFolder", "dialogName", "contacts:folder", "ui-framework:folder"))) new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/contacts/apps/contacts/subApps/browser/actions/deleteFolder"))) new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/contacts/apps/contacts/subApps/browser/actions/delete/availability"))) .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 BootstrapConditionally("Samples user", "Adds user if does not exist", "/mgnl-bootstrap-samples/samples/users.admin.patrick.xml")) .addTask(new RemoveNodeTask("Remove menu items", "Removes the samples menu config item sample templates.", ContentRepository.CONFIG, "/modules/adminInterface/config/menu/config/sample-templates")) .addTask(new RemoveNodeTask("Remove menu items", "Removes the samples menu config item sample paragraphs.", ContentRepository.CONFIG, "/modules/adminInterface/config/menu/config/sample-paragraphs")) .addTask(new RemoveNodeTask("Remove menu items", "Removes the samples menu config item sample dialogs.", ContentRepository.CONFIG, "/modules/adminInterface/config/menu/config/sample-dialogs"))
.addTask(new RemoveNodeTask("Remove template", "Removes mail template test-magnolia-no-parameters.", RepositoryConstants.CONFIG, "/modules/mail/config/templatesConfiguration/test-magnolia-no-parameters")) .addTask(new RemoveNodeTask("Remove template", "Removes mail template test-magnolia-with-parameters.", RepositoryConstants.CONFIG, "/modules/mail/config/templatesConfiguration/test-magnolia-with-parameters"))); new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/mail/config/templatesConfiguration/testVelocity"), new RemovePropertyTask("", "", RepositoryConstants.CONFIG, "/modules/mail/config/factory/renderers/", "velocity"))) .addTask(new RemoveNodeTask("Remove legacy ui page", "Removes old legacy adminInterface page.", RepositoryConstants.CONFIG, "/modules/mail/pages")) .addTask(new BootstrapSingleModuleResource("Bootstrap field types", "Bootstraps new field types used by mail tools app.", "config.modules.mail.fieldTypes.xml")) .addTask(new BootstrapSingleModuleResource("Bootstrap app", "Bootstraps mail app.", "config.modules.mail.apps.xml"))
.addTask(new ConvertAclToAppPermissionTask("Convert permissions for 'templatesApp'", "Convert ACL permissions for old 'Templating-kit/templates' menu to new 'inplace-templating' app permission", "/modules/adminInterface/config/menu/templating-kit/templates", "/modules/inplace-templating/apps/inplace-templating", false)) .addTask(new RemoveNodeTask("Remove version command", "Removes version command.", RepositoryConstants.CONFIG, "/modules/inplace-templating/commands/templating/versionTemplate/version")) .addTask(new NodeExistsDelegateTask("Rename observation configuration", "Renames observation configuration from versionResourceOnChange to versionTemplatesOnChange.", RepositoryConstants.CONFIG, "/modules/observation/config/listenerConfigurations/versionResourceOnChange",
.addTask(new RemoveMetaDataInNodeTypeDefinitionTask("Un register the metaData child node", "", RepositoryConstants.CONFIG)) .addTask(new ConvertMetaDataUpdateTask("Convert MetaData Task", "Remove the metaData sub node and replace them with mixIn when appropriate")) .addTask(new RemoveNodeTask("Remove PageEditorServlet", "Remove obsolete PageEditorServlet configuration.", RepositoryConstants.CONFIG, "/server/filters/servlets/PageEditorServlet")) .addTask(new RemoveNodeTask("Remove obsolete 'templating-editor' configuration", "", RepositoryConstants.CONFIG, "/modules/magnolia-templating-editor")) .addTask(new BootstrapSingleModuleResource("Bootstrap link transformers", "Bootstrap 'server/rendering/linkManagement/transformers", "config.server.rendering.linkManagement.xml", "/linkManagement/transformers"))); register((DeltaBuilder.update("5.0.1", "")) register((DeltaBuilder.update("5.1", "")) .addTask(new WarnTask("respectOrderDocument parameter", "As of Magnolia 5.1, the respectOrderDocument parameter has been reintroduced in repo config files and set to true by default. You will need to set it manually for each workspace in your installation. Please, refer to the release notes for more details.")) .addTask(new RemoveNodeTask("Remove intercept filter", "Removes no longer used intercept filter.", RepositoryConstants.CONFIG, "/server/filters/cms/intercept"))); register((DeltaBuilder.update("5.1.1", "")) .addTask(new NodeExistsDelegateTask("Set mgnl:lastActivated date of the user superuser", "Set mgnl:lastActivated date of the user superuser (if not set yet)", RepositoryConstants.USERS, "/system/superuser", .addTask(new NodeExistsDelegateTask("If exists, remove legacy log4j servlet", "/server/filters/servlets/log4j", new RemoveNodeTask("", "/server/filters/servlets/log4j"))));