View Javadoc
1   /**
2    * This file Copyright (c) 2012-2017 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.module.googlesitemap.setup;
35  
36  import info.magnolia.cms.security.Permission;
37  import info.magnolia.jcr.util.NodeTypes;
38  import info.magnolia.jcr.util.NodeUtil;
39  import info.magnolia.jcr.util.PropertyUtil;
40  import info.magnolia.module.DefaultModuleVersionHandler;
41  import info.magnolia.module.InstallContext;
42  import info.magnolia.module.delta.AddPermissionTask;
43  import info.magnolia.module.delta.ArrayDelegateTask;
44  import info.magnolia.module.delta.BootstrapSingleModuleResource;
45  import info.magnolia.module.delta.BootstrapSingleResourceAndOrderBefore;
46  import info.magnolia.module.delta.CheckAndModifyPartOfPropertyValueTask;
47  import info.magnolia.module.delta.CheckAndModifyPropertyValueTask;
48  import info.magnolia.module.delta.CheckOrCreatePropertyTask;
49  import info.magnolia.module.delta.DeltaBuilder;
50  import info.magnolia.module.delta.NewPropertyTask;
51  import info.magnolia.module.delta.NodeExistsDelegateTask;
52  import info.magnolia.module.delta.NodeVisitorTask;
53  import info.magnolia.module.delta.OrderNodeAfterTask;
54  import info.magnolia.module.delta.OrderNodeBeforeTask;
55  import info.magnolia.module.delta.PartialBootstrapTask;
56  import info.magnolia.module.delta.PropertyExistsDelegateTask;
57  import info.magnolia.module.delta.RemoveNodeTask;
58  import info.magnolia.module.delta.RemovePropertiesTask;
59  import info.magnolia.module.delta.RemovePropertyTask;
60  import info.magnolia.module.delta.SetPropertyTask;
61  import info.magnolia.module.delta.SetupModuleRepositoriesTask;
62  import info.magnolia.module.delta.Task;
63  import info.magnolia.module.googlesitemap.GoogleSiteMapConfiguration;
64  import info.magnolia.module.googlesitemap.app.field.transformer.SiteMapTransformer;
65  import info.magnolia.module.googlesitemap.app.subapp.sitemapdetail.contentviews.formatter.FolderNameColumnFormatter;
66  import info.magnolia.module.googlesitemap.setup.for2_1.Register21NodeTypeTask;
67  import info.magnolia.module.googlesitemap.setup.for2_1.RenameSiteMapeSitePagesPropertyName;
68  import info.magnolia.module.googlesitemap.setup.for2_1.UpdatePropertyNamesAndNodeStructure;
69  import info.magnolia.module.googlesitemap.setup.migration.Removei18nKeysInSiteMapMigrationTask;
70  import info.magnolia.module.googlesitemap.setup.migration.SiteMapDefinitionMigrationTask;
71  import info.magnolia.module.googlesitemap.setup.migration.SiteMapDialogMigrationTask;
72  import info.magnolia.repository.RepositoryConstants;
73  import info.magnolia.ui.contentapp.ContentApp;
74  import info.magnolia.ui.contentapp.setup.for5_3.ContentAppMigrationTask;
75  import info.magnolia.ui.framework.setup.AddIsPublishedRuleToAllDeactivateActionsTask;
76  import info.magnolia.ui.framework.setup.SetWritePermissionForActionsTask;
77  
78  import java.util.ArrayList;
79  import java.util.Arrays;
80  import java.util.List;
81  
82  import javax.jcr.Node;
83  import javax.jcr.RepositoryException;
84  
85  import org.apache.commons.lang3.StringUtils;
86  
87  /**
88   * Default version handler.
89   */
90  public class GoogleSiteMapVersionHandler extends DefaultModuleVersionHandler {
91  
92      protected static final String GOOGLESITEMAP_APP_BROWSER_ACTIONS = "/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/";
93      protected static final String GOOGLESITEMAP_APP_PAGES_ACTIONS = "/modules/google-sitemap/apps/siteMaps/subApps/pages/actions/";
94      protected static final String GOOGLESITEMAP_APP_VIRTUALURI_ACTIONS = "/modules/google-sitemap/apps/siteMaps/subApps/virtualURI/actions/";
95  
96      public GoogleSiteMapVersionHandler() {
97          register(DeltaBuilder.update("1.2.1", "")
98                  .addTask(new RemoveNodeTask("Obsolete folder: templates", "Templates folder has to be removed", "config", "/modules/google-sitemap/templates"))
99                  .addTask(new RemoveNodeTask("Obsolete folder: dialog", "Dialogs folder has to be removed", "config", "/modules/google-sitemap/dialogs"))
100                 .addTask(new RemoveNodeTask("Obsolete SiteMap site sample definition", "", "website", "google-sitemap"))
101                 .addTask(new BootstrapSingleModuleResource("SiteMap new Config", "Setup Config", "config.modules.google-sitemap.config.xml"))
102                 .addTask(new BootstrapSingleModuleResource("SiteMap new Template", "Setup Template", "config.modules.google-sitemap.templates.xml")));
103 
104         register(DeltaBuilder.update("2.0", "")
105                 .addTask(new SiteMapDefinitionMigrationTask("Migrate M4.5 site map definition into the new App", "", RepositoryConstants.WEBSITE, "/"))
106                 .addTask(new SiteMapDialogMigrationTask("Migrate M4.5 dialog definition", "Create the new M5 dialog definition. Add actions, tabs and fields definition", "google-sitemap"))
107                 .addTask(new BootstrapSingleResourceAndOrderBefore("Bootstrap tab", "Bootstrap  site map properties tab",
108                         "/mgnl-bootstrap/google-sitemap/dialogs/config.modules.google-sitemap.dialogs.components.content.siteComponentTab.form.tabs.siteMap.xml", "tabSites"))
109                 .addTask(new BootstrapSingleModuleResource("SiteMap app", "Add SiteMap app", "app/config.modules.google-sitemap.apps.xml"))
110                 .addTask(new BootstrapSingleModuleResource("SiteMap app App Launcher", "Add SiteMap app to App Launcher", "app/config.modules.ui-admincentral.config.appLauncherLayout.groups.manage.apps.siteMaps.xml"))
111                 .addTask(new BootstrapSingleModuleResource("Field Types", "Install new field types", "fieldtypes/config.modules.google-sitemap.fieldTypes.xml"))
112                 .addTask(new BootstrapSingleModuleResource("Repository Mapping", "Add Google SiteMap worksapce mapping", "config/config.server.URI2RepositoryMapping.mappings.sitemaps.xml"))
113                 .addTask(new BootstrapSingleModuleResource("Virtual URI Mapping", "Add Google SiteMap virtual URI mapping", "virtualurimappings/config.modules.google-sitemap.virtualURIMapping.xml"))
114                 .addTask(new SetupModuleRepositoriesTask())
115                 .addTask(new AddPermissionTask("Anonymous permissions for the new workspace", "", "anonymous", "googleSitemaps", "/", Permission.READ, true))
116 
117                 .addTask(new NewPropertyTask("Add default value transformer", "Set a transformer that display the default field value in case the stored value is null", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/generic/controls/googleSiteMapTab/form/tabs/tabGoogleSitemapProps/fields/googleSitemapPriority", "transformerClass", SiteMapTransformer.class.getName()))
118                 .addTask(new NewPropertyTask("Add default value transformer", "Set a transformer that display the default field value in case the stored value is null", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/generic/controls/googleSiteMapTab/form/tabs/tabGoogleSitemapProps/fields/googleSitemapChangefreq", "transformerClass", SiteMapTransformer.class.getName()))
119                 .addTask(new NewPropertyTask("Add default value transformer", "Set a transformer that display the default field value in case the stored value is null", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/generic/controls/googleVirtualUriMapTab/form/tabs/tabGoogleSitemapProps/fields/googleSitemapPriority", "transformerClass", SiteMapTransformer.class.getName()))
120                 .addTask(new NewPropertyTask("Add default value transformer", "Set a transformer that display the default field value in case the stored value is null", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/generic/controls/googleVirtualUriMapTab/form/tabs/tabGoogleSitemapProps/fields/googleSitemapChangefreq", "transformerClass", SiteMapTransformer.class.getName()))
121 
122                 .addTask(new NodeExistsDelegateTask("Remove area definition from the pages templates", "Remove areas definition in /modules/google-sitemap/templates/pages/siteMapsConfiguration/areas", RepositoryConstants.CONFIG, "/modules/google-sitemap/templates/pages/siteMapsConfiguration/areas",
123                         new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/templates/pages/siteMapsConfiguration/areas")))
124                 .addTask(new NodeExistsDelegateTask("Remove components definition from templates", "Remove areas definition in /modules/google-sitemap/templates/components", RepositoryConstants.CONFIG, "/modules/google-sitemap/templates/components",
125                         new RemoveNodeTask("", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/templates/components")))
126 
127                 .addTask(new Removei18nKeysInSiteMapMigrationTask("google-sitemap", "Remove M4.5 i18n support"))
128                 .addTask(new NodeExistsDelegateTask("Reorder Sitemaps in MANAGE group", "This reorders the Sitemaps app before Configuration in the Manage group of the applauncher.", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps/configuration",
129                         new OrderNodeBeforeTask("", "", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps/siteMaps", "configuration")))
130                 .addTask(new CheckAndModifyPropertyValueTask("Set Page template not visible", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/templates/pages/siteMapsConfiguration", "visible", "true", "false")));
131 
132         register(DeltaBuilder.update("2.0.1", "")
133                 .addTask(new RemoveNodeTask("Remove dialog", "Remove obsolete dialog.", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/pages"))
134                 .addTask(new ArrayDelegateTask("Rename property", "Rename property [workspace] to [targetWorkspace].",
135                         new RemovePropertyTask("", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabSites/fields/sites/field", "workspace"),
136                         new SetPropertyTask("", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabSites/fields/sites/field", "targetWorkspace", RepositoryConstants.WEBSITE)))
137                 .addTask(new RemovePropertyTask("Remove unused property", "Remove unused property called identifier.", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabSites/fields/sites/field", "identifier"))
138                 .addTask(new RemovePropertyTask("Remove unused property", "Remove unused property called dialog.", RepositoryConstants.CONFIG, "/modules/google-sitemap/templates/pages/siteMapsConfiguration", "dialog"))
139                 .addTask(new RemovePropertyTask("Remove unused property", "Remove unused property called sitemapType.", RepositoryConstants.CONFIG, "/modules/google-sitemap/templates/pages/siteMapsConfiguration", "sitemapType"))
140                 );
141         register(DeltaBuilder.update("2.1", "")
142                 .addTask(new ContentAppMigrationTask("/modules/google-sitemap")));
143 
144         register(DeltaBuilder.update("2.2", "")
145                 .addTask(new Register21NodeTypeTask("Register new nodeType definition", "", GoogleSiteMapConfiguration.WORKSPACE, Arrays.asList(NodeTypes.Page.NAME)))
146                 .addTask(new RenameSiteMapeSitePagesPropertyName("Rename Sitemap Website properties", "", RepositoryConstants.WEBSITE))
147                 .addTask(new UpdatePropertyNamesAndNodeStructure("Rename Sitemap properties", ""))
148                 .addTask(new NodeExistsDelegateTask("Bootstrap new siteMap dialogs definition", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/siteMap",
149                         new ArrayDelegateTask("",
150                                 new RemoveNodeTask("", "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/siteMap"),
151                                 new BootstrapSingleModuleResource("", "", "dialogs/config.modules.google-sitemap.dialogs.components.content.siteComponentTab.form.tabs.siteMap.xml")
152                                 )))
153                 .addTask(new NodeExistsDelegateTask("Bootstrap new tabSites dialogs definition", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabSites",
154                         new ArrayDelegateTask("",
155                                 new RemoveNodeTask("", "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabSites"),
156                                 new BootstrapSingleModuleResource("", "", "dialogs/config.modules.google-sitemap.dialogs.components.content.siteComponentTab.form.tabs.tabSites.xml")
157                                 )))
158                 .addTask(new NodeExistsDelegateTask("Bootstrap new generic dialogs definition", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/generic",
159                         new ArrayDelegateTask("",
160                                 new RemoveNodeTask("", "/modules/google-sitemap/dialogs/generic"),
161                                 new BootstrapSingleModuleResource("", "", "dialogs/config.modules.google-sitemap.dialogs.generic.xml")
162                                 )))
163                 .addTask(new BootstrapSingleModuleResource("Bootstrap new tabDefaultValue dialogs definition", "", "dialogs/config.modules.google-sitemap.dialogs.components.content.siteComponentTab.form.tabs.tabDefaultValue.xml"))
164                 .addTask(new OrderNodeAfterTask("order tabs", "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabSites", "siteMap"))
165                 .addTask(new OrderNodeAfterTask("order tabs", "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabDefaultValue", "tabSites"))
166                 .addTask(new CheckAndModifyPropertyValueTask("/modules/google-sitemap/apps/siteMaps/subApps/browser/workbench/contentViews/list/columns/name", "propertyName", "displayName", "mgnl:googleSiteMapDisplayName"))
167                 .addTask(new CheckAndModifyPropertyValueTask("/modules/google-sitemap/apps/siteMaps/subApps/browser/workbench/contentViews/list/columns/name", "formatterClass", "info.magnolia.module.googlesitemap.app.subapp.sitemapdetail.formatter.FolderNameColumnFormatter", FolderNameColumnFormatter.class.getName()))
168                 .addTask(new CheckAndModifyPropertyValueTask("/modules/google-sitemap/apps/siteMaps", "appClass", "info.magnolia.module.googlesitemap.app.GoogleSiteMapApp", ContentApp.class.getName()))
169 
170                 .addTask(new NodeExistsDelegateTask("Bootstrap new sub app Pages definition", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/apps/siteMaps/subApps/pages",
171                         new ArrayDelegateTask("",
172                                 new RemoveNodeTask("", "/modules/google-sitemap/apps/siteMaps/subApps/pages"),
173                                 new PartialBootstrapTask("", "/mgnl-bootstrap/google-sitemap/app/config.modules.google-sitemap.apps.xml", "/apps/siteMaps/subApps/pages"),
174                                 new OrderNodeAfterTask("order tabs", "/modules/google-sitemap/apps/siteMaps/subApps/pages", "browser")
175                                 )))
176 
177                 .addTask(new NodeExistsDelegateTask("Bootstrap new sub app VirtualUri definition", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/apps/siteMaps/subApps/virtualURI",
178                         new ArrayDelegateTask("",
179                                 new RemoveNodeTask("", "/modules/google-sitemap/apps/siteMaps/subApps/virtualURI"),
180                                 new PartialBootstrapTask("", "/mgnl-bootstrap/google-sitemap/app/config.modules.google-sitemap.apps.xml", "/apps/siteMaps/subApps/virtualURI"),
181                                 new OrderNodeAfterTask("order tabs", "/modules/google-sitemap/apps/siteMaps/subApps/virtualURI", "pages")
182                                 )))
183                 .addTask(new SetWritePermissionForActionsTask(GOOGLESITEMAP_APP_BROWSER_ACTIONS, new String[]{"addFolder", "editFolder", "addSiteMap", "delete", "editSiteMap", "import", "restorePreviousVersion", "confirmDeleteSiteMap", "editSiteEntries", "editVirtualUris", "activate", "deactivate", "activateDeleted"}))
184                 .addTask(new SetWritePermissionForActionsTask(GOOGLESITEMAP_APP_PAGES_ACTIONS, new String[]{"editSitemapEntry"}))
185                 .addTask(new SetWritePermissionForActionsTask(GOOGLESITEMAP_APP_VIRTUALURI_ACTIONS, new String[]{"editSitemapEntry"}))
186                 .addTask(new BootstrapSingleModuleResource("Bootstrap new config values", "", "config.modules.google-sitemap.config.xml"))
187                 .addTask(new PartialBootstrapTask("", "/mgnl-bootstrap/google-sitemap/fieldtypes/config.modules.google-sitemap.fieldTypes.xml", "/fieldTypes/siteMapSelect")));
188 
189         register(DeltaBuilder.update("2.2.2", "")
190                 .addTask(new AddIsPublishedRuleToAllDeactivateActionsTask("", "/modules/google-sitemap/apps/"))
191                 );
192 
193         register(DeltaBuilder.update("2.2.3", "")
194                 .addTask(new PropertyExistsDelegateTask("Add property catalog to deactivate action if not existing", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/deactivate", "catalog", null,
195                         new NewPropertyTask("", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/deactivate", "catalog", "website")))
196                 );
197 
198         register(DeltaBuilder.update("2.3.3", "")
199                 .addTask(new RemovePropertyTask("Remove unnecessary 'hidden' property", "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/siteMap/fields/template", "hidden"))
200                 .addTask(new NodeVisitorTask("Update all broken 'mgnl:template' properties",
201                         "Sitemaps with property 'mgnl:template' set to 'GoogleSiteMap' will be updated to 'google-sitemap:pages/siteMapsConfiguration'",
202                         GoogleSiteMapConfiguration.WORKSPACE, "/") {
203                     @Override
204                     protected boolean nodeMatches(Node node) {
205                         return !StringUtils.startsWith(NodeUtil.getPathIfPossible(node), "/jcr:system") &&
206                                 StringUtils.equals(PropertyUtil.getString(node, NodeTypes.Renderable.TEMPLATE), "GoogleSiteMap");
207                     }
208 
209                     @Override
210                     protected void operateOnNode(InstallContext installContext, Node node) {
211                         try {
212                             node.setProperty(NodeTypes.Renderable.TEMPLATE, "google-sitemap:pages/siteMapsConfiguration");
213                         } catch (RepositoryException e) {
214                             installContext.error(String.format("Error updating '%s' property of node '%s'", NodeTypes.Renderable.TEMPLATE, NodeUtil.getPathIfPossible(node)), e);
215                         }
216                     }
217                 })
218                 );
219 
220         register(DeltaBuilder.update("2.3.4", "")
221                 .addTask(new BootstrapSingleModuleResource("Sitemap dialog main tab", "Make 'standard' the default sitemap type",
222                         "dialogs/config.modules.google-sitemap.dialogs.components.content.siteComponentTab.form.tabs.siteMap.xml"))
223                 .addTask(new BootstrapSingleModuleResource("Add sitemap renderer", "This one sets the correct content type 'application/xml'", "config.modules.google-sitemap.renderers.sitemap.xml"))
224                 .addTask(new CheckAndModifyPropertyValueTask("Update siteMap template to use sitemap renderer", "This will make sure the correct content type is set", "config", "/modules/google-sitemap/templates/pages/siteMapsConfiguration", "renderType", "freemarker", "sitemap"))
225                 );
226 
227         register(DeltaBuilder.update("2.4.1", "")
228                 .addTask(new ArrayDelegateTask("Remove legacy properties",
229                         new RemovePropertiesTask("", RepositoryConstants.CONFIG, Arrays.asList(
230                                 "/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/export/extends",
231                                 "/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/editSiteMap/nodeType",
232                                 "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabSites/fields/mgnl:googleSiteMapPages/chooseOnClick"), false),
233                         new CheckOrCreatePropertyTask("", "/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/export", "icon", "icon-export"),
234                         // replace colons with dashes in fields' node names and add new name property instead.
235                         new NodeVisitorTask("", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs") {
236                     @Override
237                     protected boolean nodeMatches(Node node) {
238                         return StringUtils.startsWith(NodeUtil.getName(node), "mgnl:");
239                     }
240 
241                     @Override
242                     protected void operateOnNode(InstallContext installContext, Node node) {
243                         try {
244                             node.setProperty("name", node.getName());
245                             NodeUtil.renameNode(node, node.getName().replaceAll(":", "-"));
246                         } catch (RepositoryException e) {
247                             installContext.error(String.format("Error updating '%s' property of node '%s'", NodeTypes.Renderable.TEMPLATE, NodeUtil.getPathIfPossible(node)), e);
248                         }
249                     }
250                 }))
251                 );
252         register(DeltaBuilder.update("2.4.2", "")
253                 .addTask(new NodeExistsDelegateTask("Change URI to repository mapping to end with slash", "", RepositoryConstants.CONFIG, "/server/URI2RepositoryMapping/mappings/sitemaps",
254                         new CheckAndModifyPartOfPropertyValueTask("", "", RepositoryConstants.CONFIG, "/server/URI2RepositoryMapping/mappings/sitemaps", "URIPrefix", "/sitemaps", "/sitemaps/"))));
255         register(DeltaBuilder.update("2.4.3", "")
256                 .addTask(new NodeExistsDelegateTask("Show edit icon on tab of pages sub app", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/apps/siteMaps/subApps/pages",
257                         new SetPropertyTask("Set icon for pages sub app", RepositoryConstants.CONFIG, "/modules/google-sitemap/apps/siteMaps/subApps/pages", "icon", "icon-edit")))
258                 .addTask(new NodeExistsDelegateTask("Show edit icon on tab of virtual uri sub app", "", RepositoryConstants.CONFIG, "/modules/google-sitemap/apps/siteMaps/subApps/virtualURI",
259                         new SetPropertyTask("Set icon for virtual uri sub app", RepositoryConstants.CONFIG, "/modules/google-sitemap/apps/siteMaps/subApps/virtualURI", "icon", "icon-edit"))));
260     }
261 
262     /**
263      * Export the FTL to the Resource folder menu from the Admin central.
264      */
265     @Override
266     protected List<Task> getExtraInstallTasks(InstallContext ctx) {
267         final List<Task> tasks = new ArrayList<Task>();
268         tasks.add(new AddPermissionTask("Anonymous permissions for the new workspace", "", "anonymous", "googleSitemaps", "/", Permission.READ, true));
269         tasks.add(new NodeExistsDelegateTask("Reorder Sitemaps in MANAGE group", "This reorders the Sitemaps app before Configuration in the Manage group of the applauncher.", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps/configuration",
270                 new OrderNodeBeforeTask("", "", RepositoryConstants.CONFIG, "/modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps/siteMaps", "configuration")));
271         tasks.add(new Register21NodeTypeTask("Register new nodeType definition", "", GoogleSiteMapConfiguration.WORKSPACE, Arrays.asList(NodeTypes.Page.NAME)));
272         return tasks;
273     }
274 }