View Javadoc
1   /**
2    * This file Copyright (c) 2003-2018 Magnolia International
3    * Ltd.  (http://www.magnolia-cms.com). All rights reserved.
4    *
5    *
6    * This file is dual-licensed under both the Magnolia
7    * Network Agreement and the GNU General Public License.
8    * You may elect to use one or the other of these licenses.
9    *
10   * This file is distributed in the hope that it will be
11   * useful, but AS-IS and WITHOUT ANY WARRANTY; without even the
12   * implied warranty of MERCHANTABILITY or FITNESS FOR A
13   * PARTICULAR PURPOSE, TITLE, or NONINFRINGEMENT.
14   * Redistribution, except as permitted by whichever of the GPL
15   * or MNA you select, is prohibited.
16   *
17   * 1. For the GPL license (GPL), you can redistribute and/or
18   * modify this file under the terms of the GNU General
19   * Public License, Version 3, as published by the Free Software
20   * Foundation.  You should have received a copy of the GNU
21   * General Public License, Version 3 along with this program;
22   * if not, write to the Free Software Foundation, Inc., 51
23   * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24   *
25   * 2. For the Magnolia Network Agreement (MNA), this file
26   * and the accompanying materials are made available under the
27   * terms of the MNA which accompanies this distribution, and
28   * is available at http://www.magnolia-cms.com/mna.html
29   *
30   * Any modifications to this file must keep this entire header
31   * intact.
32   *
33   */
34  package info.magnolia.setup;
35  
36  import info.magnolia.cms.security.Permission;
37  import info.magnolia.commands.impl.MarkNodeAsDeletedCommand;
38  import info.magnolia.jcr.util.NodeNameHelper;
39  import info.magnolia.jcr.util.NodeTypes;
40  import info.magnolia.module.AbstractModuleVersionHandler;
41  import info.magnolia.module.InstallContext;
42  import info.magnolia.module.delta.AddURIPermissionTask;
43  import info.magnolia.module.delta.AddUsersPermissionTask;
44  import info.magnolia.module.delta.ArrayDelegateTask;
45  import info.magnolia.module.delta.BootstrapConditionally;
46  import info.magnolia.module.delta.BootstrapSingleModuleResource;
47  import info.magnolia.module.delta.BootstrapSingleResource;
48  import info.magnolia.module.delta.CheckAndModifyPropertyValueTask;
49  import info.magnolia.module.delta.Condition;
50  import info.magnolia.module.delta.DeltaBuilder;
51  import info.magnolia.module.delta.FindAndChangeTemplateIdTask;
52  import info.magnolia.module.delta.FixUserRolePermissionsPropertyTask;
53  import info.magnolia.module.delta.HasPropertyDelegateTask;
54  import info.magnolia.module.delta.MoveAndRenamePropertyTask;
55  import info.magnolia.module.delta.NoSameNameSiblingsCondition;
56  import info.magnolia.module.delta.NodeExistsDelegateTask;
57  import info.magnolia.module.delta.OrderFilterBeforeTask;
58  import info.magnolia.module.delta.OrderNodeBeforeTask;
59  import info.magnolia.module.delta.PartialBootstrapTask;
60  import info.magnolia.module.delta.PathExistenceDelegateTask;
61  import info.magnolia.module.delta.PropertyValueDelegateTask;
62  import info.magnolia.module.delta.QueryElementsAndDisplayWarningTask;
63  import info.magnolia.module.delta.RemoveInstallFilesTask;
64  import info.magnolia.module.delta.RemoveNodeTask;
65  import info.magnolia.module.delta.RemovePermissionTask;
66  import info.magnolia.module.delta.RemovePropertyTask;
67  import info.magnolia.module.delta.SetPropertyTask;
68  import info.magnolia.module.delta.Task;
69  import info.magnolia.module.delta.ValueOfPropertyDelegateTask;
70  import info.magnolia.module.delta.WarnTask;
71  import info.magnolia.module.delta.WebXmlConditionsUtil;
72  import info.magnolia.module.delta.WorkspaceXmlConditionsUtil;
73  import info.magnolia.objectfactory.Components;
74  import info.magnolia.repository.RepositoryConstants;
75  import info.magnolia.repository.RepositoryManager;
76  import info.magnolia.setup.for5_0.CheckOrCreateLastActivatedPropertyTask;
77  import info.magnolia.setup.for5_0.ConvertMetaDataUpdateTask;
78  import info.magnolia.setup.for5_0.Register50NodeTypeTask;
79  import info.magnolia.setup.for5_0.RemoveMetaDataInNodeTypeDefinitionTask;
80  import info.magnolia.setup.for5_2.AddActivatableMixinForContentNodeTask;
81  import info.magnolia.setup.for5_2.GrantReadPermissionToRolesTask;
82  import info.magnolia.setup.for5_2.IsNotAProblematicEnvironmentCondition;
83  import info.magnolia.setup.for5_2.RemoveOpenWFEPermissionsTask;
84  import info.magnolia.setup.for6_0.RemoveMIMEIconsTask;
85  import info.magnolia.setup.initial.GenericTasks;
86  
87  import java.util.ArrayList;
88  import java.util.Arrays;
89  import java.util.List;
90  
91  import javax.inject.Inject;
92  import javax.jcr.ImportUUIDBehavior;
93  
94  import com.google.common.collect.Lists;
95  
96  /**
97   * Special VersionHandler for the core module. As it does not extend {@link info.magnolia.module.DefaultModuleVersionHandler} it has a special getBasicInstallTasks(InstallContext) that
98   * e.g. will not automatically bootstrap xml-files placed in mgnl-bootstrap/core.
99   */
100 public class CoreModuleVersionHandler extends AbstractModuleVersionHandler {
101     public static final String BOOTSTRAP_AUTHOR_INSTANCE_PROPERTY = "magnolia.bootstrap.authorInstance";
102     public static final String SECURITY_BASE_ROLE = "security-base";
103 
104     // TODO : why is this a BootstrapConditionally and not a BootstrapSingleResource ?
105     private final BootstrapConditionally auditTrailManagerTask = new BootstrapConditionally("New auditory log configuration", "Install new configuration for auditory log manager.", "/mgnl-bootstrap/core/config.server.auditLogging.xml");
106     private final BootstrapSingleResource bootstrapWebContainerResources = new BootstrapSingleResource("Web container resources configuration", "Global configuration which resources are not meant to be handled by Magnolia. For instance JSP files.", "/mgnl-bootstrap/core/config.server.webContainerResources.xml");
107     private final BootstrapSingleModuleResource bootstrapChannelManagement = new BootstrapSingleModuleResource("ChannelManagement configuration", "", "config.server.rendering.channelManagement.xml");
108 
109     private final BootstrapSingleModuleResource bootstrapChannelFilter = new BootstrapSingleModuleResource("ChannelFilter configuration", "", "config.server.filters.channel.xml");
110     private final Task placeChannelBeforeLogout = new OrderFilterBeforeTask("channel", new String[]{"logout"});
111 
112     private final Task removeObsoleteInstallFiles = new RemoveInstallFilesTask("Remove obsolete dms templates install files", "templates/dms");
113 
114     private final RepositoryManager repositoryManager;
115 
116     /**
117      * Cleans up security-base role from no longer valid URis (basically legacy adminInterface pages not yet ported to M5). Also allows basic access to AdminCentral.
118      */
119     protected static List<String> PERMISSIONS_FOR_LEGACY_PAGES = Arrays.asList(
120             "/.magnolia/pages/messages*",
121             "/.magnolia/pages/installedModulesList*",
122             "/.magnolia/pages/jcrUtils*",
123             "/.magnolia/pages/configuration*",
124             "/.magnolia/pages/logViewer*",
125             "/.magnolia/pages/sendMail*",
126             "/.magnolia/pages/users*",
127             "/.magnolia/pages/activationTools*",
128             "/.magnolia/pages/activationMonitor*",
129             "/.magnolia/pages/groovyInteractiveConsole*",
130             "/.magnolia/pages/migrationReport*",
131             "/.magnolia/pages/backup*",
132             "/.magnolia/pages/allModulesList*",
133             "/.magnolia/pages/cacheTools*",
134             "/.magnolia/pages/flows*",
135             "/.magnolia/pages/import*",
136             "/.magnolia/pages/export*",
137             "/.magnolia/pages/permission*",
138             "/.magnolia/pages/developmentUtils*"
139     );
140 
141     protected Task updateSecurityBaseRolePermissions() {
142         ArrayDelegateTask permissionsTask = new ArrayDelegateTask("Update security-base role", "Disallows access to some sensitive URIs and grants basic access to AdminCentral.");
143         for (String path : PERMISSIONS_FOR_LEGACY_PAGES) {
144             permissionsTask.addTask(new RemovePermissionTask("", SECURITY_BASE_ROLE, "uri", path, AddURIPermissionTask.DENY));
145         }
146         permissionsTask.addTask(new RemovePermissionTask("", SECURITY_BASE_ROLE, RepositoryConstants.USER_ROLES, "/" + SECURITY_BASE_ROLE, Permission.READ));
147         return permissionsTask;
148     }
149 
150     @Inject
151     public CoreModuleVersionHandler(RepositoryManager repositoryManager, NodeNameHelper nodeNameHelper) {
152         super();
153         this.repositoryManager = repositoryManager;
154 
155         register(DeltaBuilder.checkPrecondition("4.5", "5.0"));
156 
157         register(DeltaBuilder.update("4.5.2", "")
158                 .addTask(new HasPropertyDelegateTask("Fix property name", "", RepositoryConstants.CONFIG, "/server/security/userManagers/system", "realName", new MoveAndRenamePropertyTask("Fix propertyName", "/server/security/userManagers/system", "realName", "/server/security/userManagers/system", "realmName")))
159                 .addTask(new HasPropertyDelegateTask("Fix property name", "", RepositoryConstants.CONFIG, "/server/security/userManagers/admin", "realName", new MoveAndRenamePropertyTask("Fix propertyName", "/server/security/userManagers/admin", "realName", "/server/security/userManagers/admin", "realmName"))));
160 
161         register((DeltaBuilder.update("4.5.9", ""))
162                 .addTask(new NodeExistsDelegateTask("AuditLogging configurations", "Add auditLogging configurations for delete action", "config", "/server/auditLogging/logConfigurations/delete", null, new PartialBootstrapTask("", "", "/mgnl-bootstrap/core/config.server.auditLogging.xml", "/auditLogging/logConfigurations/delete", ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW)))
163                 .addTask(new CheckAndModifyPropertyValueTask("AuditLogging configurations", "Change auditLogging class", "config", "/server/auditLogging", "class", "info.magnolia.logging.AuditLoggingManager", "info.magnolia.audit.AuditLoggingManager")));
164 
165         register(DeltaBuilder.update("5.0", "")
166                 .addTask(new Register50NodeTypeTask("Register the new M5 node Type", "", RepositoryConstants.CONFIG))
167                 .addTask(new RemoveMetaDataInNodeTypeDefinitionTask("Un register the metaData child node", "", RepositoryConstants.CONFIG))
168                 .addTask(new ConvertMetaDataUpdateTask("Convert MetaData Task", "Remove the metaData sub node and replace them with mixIn when appropriate"))
169                 .addTask(new RemoveNodeTask("Remove PageEditorServlet", "Remove obsolete PageEditorServlet configuration.", RepositoryConstants.CONFIG, "/server/filters/servlets/PageEditorServlet"))
170                 .addTask(new RemoveNodeTask("Remove obsolete 'templating-editor' configuration", "", RepositoryConstants.CONFIG, "/modules/magnolia-templating-editor"))
171                 .addTask(new BootstrapSingleModuleResource("Bootstrap link transformers", "Bootstrap 'server/rendering/linkManagement/transformers", "config.server.rendering.linkManagement.xml", "/linkManagement/transformers")));
172         register((DeltaBuilder.update("5.0.1", ""))
173                 .addTask(new CheckAndModifyPropertyValueTask("MIMEMapping", "Change xsl extension mime-type from text/xml to application/xml", RepositoryConstants.CONFIG, "/server/MIMEMapping/xsl", "mime-type", "text/xml", "application/xml"))
174                 .addTask(new CheckAndModifyPropertyValueTask("MIMEMapping", "Change xml extension mime-type from text/xml to application/xml", RepositoryConstants.CONFIG, "/server/MIMEMapping/xml", "mime-type", "text/xml", "application/xml")));
175         register((DeltaBuilder.update("5.0.3", ""))
176                 .addTask(new BootstrapSingleModuleResource("JSON", "Add JSON mime-type", "config.server.MIMEMapping.xml", "/MIMEMapping/json")));
177         register((DeltaBuilder.update("5.1", ""))
178                 .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."))
179                 .addTask(new RemoveNodeTask("Remove intercept filter", "Removes no longer used intercept filter.", RepositoryConstants.CONFIG, "/server/filters/cms/intercept")));
180         register((DeltaBuilder.update("5.1.1", ""))
181                 .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",
182                         new CheckOrCreateLastActivatedPropertyTask("", "", RepositoryConstants.USERS, "/system/superuser")))
183                 .addTask(new NodeExistsDelegateTask("Set mgnl:lastActivated date of the user anonymous", "Set mgnl:lastActivated date of the user anonymous (if not set yet)", RepositoryConstants.USERS, "/system/anonymous",
184                         new CheckOrCreateLastActivatedPropertyTask("", "", RepositoryConstants.USERS, "/system/anonymous")))
185                 .addTask(new NodeExistsDelegateTask("Set mgnl:lastActivated date of the superuser role", "Set mgnl:lastActivated date of the superuser role (if not set yet)", RepositoryConstants.USER_ROLES, "/superuser",
186                         new CheckOrCreateLastActivatedPropertyTask("", "", RepositoryConstants.USER_ROLES, "/superuser")))
187                 .addTask(new NodeExistsDelegateTask("Set mgnl:lastActivated date of the anonymous role", "Set mgnl:lastActivated date of the anonymous role (if not set yet)", RepositoryConstants.USER_ROLES, "/anonymous",
188                         new CheckOrCreateLastActivatedPropertyTask("", "", RepositoryConstants.USER_ROLES, "/anonymous")))
189                 .addTask(new NodeExistsDelegateTask("Set mgnl:lastActivated date of the security-base role", "Set mgnl:lastActivated date of the security-base role (if not set yet)", RepositoryConstants.USER_ROLES, "/security-base",
190                         new CheckOrCreateLastActivatedPropertyTask("", "", RepositoryConstants.USER_ROLES, "/security-base")))
191                 .addTask(new FindAndChangeTemplateIdTask("Change template id mgnlDelete", "Change template id mgnlDeleted to ui-admincentral:deleted for all content marked as deleted in website repository", RepositoryConstants.WEBSITE, "mgnlDeleted", MarkNodeAsDeletedCommand.DELETED_NODE_TEMPLATE))
192                 .addTask(new FindAndChangeTemplateIdTask("Change template id adminInterface:mgnlDeleted", "Change template id adminInterface:mgnlDeleted to ui-admincentral:deleted for all content marked as deleted in website repository", RepositoryConstants.WEBSITE, "adminInterface:mgnlDeleted", MarkNodeAsDeletedCommand.DELETED_NODE_TEMPLATE)));
193         register((DeltaBuilder.update("5.1.2", ""))
194                 .addTask(new ChangeNodeTypeOfSubAppsTask("Change primary node type of subapps", "If primary node type of subapps node is set to " + NodeTypes.Content.NAME + " then change it to " + NodeTypes.ContentNode.NAME))
195                 .addTask(new BootstrapSingleModuleResource("Anonymous user", "Change anonymous user permission. He can't have write access to himself.", "users.system.anonymous.xml", "/anonymous/acl_users")));
196 
197         register((DeltaBuilder.update("5.2.1", ""))
198                 .addTask(new RemoveOpenWFEPermissionsTask("Find and remove all openWFE permissions from the userroles workspace", ""))
199                 .addTask(new GrantReadPermissionToRolesTask("Set read-permission to role itself", "If a role do not have a read permission to itself, add it")));
200         register((DeltaBuilder.update("5.2.2", ""))
201                 .addTask(removeObsoleteInstallFiles)
202                 .addTask(new AddActivatableMixinForContentNodeTask("Add the mixIn '" + NodeTypes.Activatable.NAME + "' to the '" + NodeTypes.ContentNode.NAME + "' node type definition", "", RepositoryConstants.CONFIG)));
203         register((DeltaBuilder.update("5.2.3", ""))
204                 .addTask(new RemovePermissionTask("Remove 'anonymous' role permission", "anonymous", RepositoryConstants.USER_ROLES, "/anonymous", Permission.READ)));
205 
206         register((DeltaBuilder.update("5.3.2", ""))
207                 .addTask(new NodeExistsDelegateTask("Add csrfSecurity Filter", "/server/filters/csrfSecurity",
208                         /* Partially bootstrap new bypass for Vaadin requests if filter already exists */
209                         new PathExistenceDelegateTask("Add csrfSecurity Filter", "", new String[]{"/server/filters/csrfSecurity/bypasses/BypassWhenVaadinRequest"}, new String[]{"/server/filters/csrfSecurity/bypasses/BypassWhenNotInAdminCentral", "/server/filters/csrfSecurity/bypasses/BypassWhenNotAuthenticated", "/server/filters/csrfSecurity/bypasses/BypassWhenNoQueryParameters"},
210                                 new PartialBootstrapTask("Add csrfSecurity Filter", "", "/mgnl-bootstrap/core/config.server.filters.xml", "/filters/csrfSecurity/bypasses/BypassWhenVaadinRequest", ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW)),
211                         /* Partially bootstrap whole csrf filter if it doesn't exists */
212                         new PartialBootstrapTask("Add csrfSecurity Filter", "", "/mgnl-bootstrap/core/config.server.filters.xml", "/filters/csrfSecurity", ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW)))
213                 .addTask(new NodeExistsDelegateTask("Order csrfSecurity Filter", "Put csrfSecurity before uriSecurity Filter.", RepositoryConstants.CONFIG, "/server/filters/uriSecurity",
214                         new OrderNodeBeforeTask("Order csrfSecurity Filter", "Put csrfSecurity before uriSecurity Filter.", RepositoryConstants.CONFIG, "/server/filters/csrfSecurity", "uriSecurity"),
215                         new WarnTask("CSRF Security Filter is inactive.", "CSRF Security Filter inactive. The installed csrfFilter would normally be ordered before the uriSecurity filter, but could not be moved there as a uriFilter node does not exist in the /server/filters node. The installed csrfFilter must be moved up the filters list manually.")))
216                 .addTask(new NodeExistsDelegateTask("Add csrfSecurity Filter", "/server/auditLogging/logConfigurations/security", null,
217                         new PartialBootstrapTask("Add 'security' AuditLogging logConfiguration.", "", "/mgnl-bootstrap/core/config.server.auditLogging.xml", "/auditLogging/logConfigurations/security", ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW))));
218 
219         register((DeltaBuilder.update("5.3.5", ""))
220 
221                 .addTask(new FixUserRolePermissionsPropertyTask("/superuser")));
222 
223         register((DeltaBuilder.update("5.4.1", ""))
224                 .addTask(updateSecurityBaseRolePermissions()));
225 
226         register((DeltaBuilder.update("5.4.3", ""))
227                 .addTask(new PropertyValueDelegateTask("Change MIME mapping of Javascript resources", "/server/MIMEMapping/js", "mime-type", "application/x-javascript", true,
228                         new SetPropertyTask("config", "/server/MIMEMapping/js", "mime-type", "application/javascript"))));
229 
230         register((DeltaBuilder.update("5.4.5", ""))
231                 .addTask(new BootstrapSingleModuleResource("Add mime mapping for .map", "Add mime mapping for .map", "config.server.MIMEMapping.xml", "/MIMEMapping/map")));
232 
233         register((DeltaBuilder.update("5.4.6", ""))
234                 .addTask(new QueryElementsAndDisplayWarningTask("Check SimpleUrlPatterns in user roles",
235                         "SimpleUrlPattern no longer misinterprets dots as regular expression wildcard characters. User roles will be checked whether they are affected.",
236                         RepositoryConstants.USER_ROLES, "SELECT * FROM [nt:base] WHERE path LIKE '%.%'", NodeTypes.Role.NAME,
237                         "SimpleUrlPattern no longer misinterprets dots as regular expression wildcard characters. As a result, the following roles might need your attention:\n%s" +
238                                 "\nRead more at http://documentation.magnolia-cms.com/display/DOCS/Release+notes+for+Magnolia+5.4.6.",
239                         Lists.newArrayList("/rest", "/security-base", "/anonymous", "/forum_ALL-moderator", "/forum_ALL-user", "/forum_ALL-admin", "/public-user-registration-base"))));
240 
241         register((DeltaBuilder.update("5.4.7", ""))
242                 .addTask(new AddUsersPermissionTask("Allow users to edit their timezone setting", "/admin", RepositoryConstants.USERS, AddUsersPermissionTask.USER_PATH_REPLACEMENT + "/timezone", Permission.ALL, nodeNameHelper)));
243 
244         register(DeltaBuilder.update("5.4.8", "")
245                 .addTask(new NodeExistsDelegateTask("If exists, remove legacy log4j servlet", "/server/filters/servlets/log4j", new RemoveNodeTask("", "/server/filters/servlets/log4j"))));
246 
247         register(DeltaBuilder.update("5.4.9", "")
248                 .addTask(new AddActivatableMixinForMgnlResourceTask("Update mgnl:resource node type", "Add mgnl:activatable mixin to the mgnl:resource node type", RepositoryConstants.WEBSITE))
249         );
250 
251         register(DeltaBuilder.update("5.5", "")
252                 .addTask(new MigrateVersionWorkspacesToNewStructureTask(repositoryManager))
253                 .addTasks(getLockableMixinAdditionTasksForAllWorkspaces())
254                 .addTask(new NodeExistsDelegateTask("Add korean language into system languages", "/server/i18n/system/ko", null,
255                         new BootstrapSingleModuleResource("", "", "config.server.i18n.system.xml", "/system/languages/ko")))
256         );
257 
258         register(DeltaBuilder.update("5.5.4", "")
259                 .addTask(new BootstrapSingleModuleResource("Add mime mapping for YAML", "Add mime mapping for YAML", "config.server.MIMEMapping.xml", "/MIMEMapping/x-yaml"))
260                 .addTask(new RenameVersionNodesTask(repositoryManager))
261         );
262 
263         register(DeltaBuilder.update("6.0", "")
264                 .addTask(new NodeExistsDelegateTask("Enable csrfTokenSecurity filter", "Adds or enables csrfTokenSecurity filter.", "config", "/server/filters/csrfTokenSecurity",
265                         new ValueOfPropertyDelegateTask("Enable csrfTokenSecurity filter", "/server/filters/csrfTokenSecurity", "enabled", "false", false,
266                             new RemovePropertyTask("", "/server/filters/csrfTokenSecurity", "enabled")),
267                         new ArrayDelegateTask("Add csrfTokenSecurity filter", "",
268                             new BootstrapSingleModuleResource("", "", "config.server.filters.xml", "/filters/csrfTokenSecurity"),
269                             new NodeExistsDelegateTask("", "/server/filters/login",
270                                 new OrderNodeBeforeTask("Order csrfTokenSecurity Filter", "Put csrfTokenSecurity before login filter.", RepositoryConstants.CONFIG, "/server/filters/csrfTokenSecurity", "login"),
271                                 new WarnTask("CSRF Token Security Filter is inactive.", "CSRF Token Security Filter inactive. The installed csrfTokenSecurity filter must be moved up in the filters list and enabled manually.")))))
272                 .addTask(new RemoveMIMEIconsTask("Find and remove all legacy 'icon' properties", "", RepositoryConstants.CONFIG, "/server/MIMEMapping"))
273                 .addTask(new BootstrapSingleModuleResource("Add WOFF2 MIME type", "", "config.server.MIMEMapping.xml", "/MIMEMapping/woff2"))
274         );
275     }
276 
277     /**
278      * @deprecated since 5.6, use {@link #CoreModuleVersionHandler(RepositoryManager, NodeNameHelper)} instead.
279      */
280     @Deprecated
281     public CoreModuleVersionHandler(RepositoryManager repositoryManager) {
282         this(repositoryManager, Components.getComponent(NodeNameHelper.class));
283     }
284 
285     private List<Task> getLockableMixinAdditionTasksForAllWorkspaces() {
286         List<Task> tasks = Lists.newArrayList();
287         for (String workspaceName : repositoryManager.getWorkspaceNames()) {
288             tasks.add(new AddLockableMixinToVersionableMixinTask("",
289                     "Adding lockable mixing as supertype to versionable mixin for workspace '{" + workspaceName + "}'", workspaceName));
290             tasks.add(new AddLockableMixinToActivatableMixinTask("",
291                     "Adding lockable mixing as supertype to activatable mixin for workspace '{" + workspaceName + "}'", workspaceName));
292         }
293         return tasks;
294     }
295 
296     @Override
297     protected List<Task> getBasicInstallTasks(InstallContext ctx) {
298         final List<Task> tasks = new ArrayList<>();
299         tasks.addAll(GenericTasks.genericTasksForNewInstallation());
300         tasks.add(auditTrailManagerTask);
301         tasks.add(bootstrapWebContainerResources);
302         tasks.add(new BootstrapConditionally("Security", "Bootstraps security-base role.", "/mgnl-bootstrap/core/userroles.security-base.xml"));
303         // always hash passwords. Task will not re-hash so it is safe to run this op at any time, multiple times.
304         tasks.add(new HashUsersPasswords());
305         tasks.add(bootstrapChannelManagement);
306         tasks.add(bootstrapChannelFilter);
307         tasks.add(placeChannelBeforeLogout);
308 
309         return tasks;
310     }
311 
312     @Override
313     protected List<Condition> getInstallConditions() {
314         final List<Condition> conditions = new ArrayList<>();
315 
316         conditions.add(new IsNotAProblematicEnvironmentCondition());
317 
318         final WebXmlConditionsUtil u = new WebXmlConditionsUtil(conditions);
319         u.servletIsNowWrapped("ActivationHandler");
320         u.servletIsNowWrapped("AdminTreeServlet");
321         u.servletIsNowWrapped("classpathspool");
322         u.servletIsNowWrapped("DialogServlet");
323         u.servletIsNowWrapped("PageServlet");
324         u.servletIsNowWrapped("log4j");
325         u.servletIsNowWrapped("FCKEditorSimpleUploadServlet");
326         u.servletIsDeprecated("uuidRequestDispatcher");
327         u.filterIsDeprecated("info.magnolia.cms.filters.MagnoliaManagedFilter", "info.magnolia.cms.filters.MgnlMainFilter");
328         u.filterMustBeRegisteredWithCorrectDispatchers("info.magnolia.cms.filters.MgnlMainFilter");
329         u.listenerIsDeprecated("info.magnolia.cms.servlets.MgnlServletContextListener", "info.magnolia.init.MagnoliaServletContextListener");
330         final WorkspaceXmlConditionsUtil u2 = new WorkspaceXmlConditionsUtil(conditions);
331         u2.textFilterClassesAreNotSet();
332 
333         conditions.add(new SystemTmpDirCondition());
334         conditions.add(new NoSameNameSiblingsCondition(repositoryManager));
335 
336         return conditions;
337     }
338 }
339