Tobias Jeger pushed to branch master at cms-community / hippo-cms
Commits: 24b05bf0 by Tobias Jeger at 2017-06-07T14:16:32+02:00 CMS-10362 Remove obsolete Groovy script - - - - - 2 changed files: - scripts/src/main/resources/hippoecm-extension.xml - − scripts/src/main/resources/update-plugin-config.xml Changes: ===================================== scripts/src/main/resources/hippoecm-extension.xml ===================================== --- a/scripts/src/main/resources/hippoecm-extension.xml +++ b/scripts/src/main/resources/hippoecm-extension.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright 2015 Hippo B.V. (http://www.onehippo.com) + Copyright 2015-2017 Hippo B.V. (http://www.onehippo.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,21 +19,15 @@ <sv:value>hippo:initializefolder</sv:value> </sv:property> - <sv:node sv:name="hippo-repository-update-plugin-config-script"> + <sv:node sv:name="hippo-repository-update-plugin-config-script-delete"> <sv:property sv:name="jcr:primaryType" sv:type="Name"> <sv:value>hippo:initializeitem</sv:value> </sv:property> - <sv:property sv:name="hippo:contentresource" sv:type="String"> - <sv:value>update-plugin-config.xml</sv:value> - </sv:property> - <sv:property sv:name="hippo:contentroot" sv:type="String"> - <sv:value>/hippo:configuration/hippo:update/hippo:registry</sv:value> + <sv:property sv:name="hippo:contentdelete" sv:type="String"> + <sv:value>/hippo:configuration/hippo:update/hippo:registry/UpdatePluginConfig</sv:value> </sv:property> <sv:property sv:name="hippo:sequence" sv:type="Double"> - <sv:value>11.1</sv:value> - </sv:property> - <sv:property sv:name="hippo:version" sv:type="String"> - <sv:value>2.28.00</sv:value> + <sv:value>15</sv:value> </sv:property> </sv:node> ===================================== scripts/src/main/resources/update-plugin-config.xml deleted ===================================== --- a/scripts/src/main/resources/update-plugin-config.xml +++ /dev/null @@ -1,96 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Copyright 2015 Hippo B.V. (http://www.onehippo.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" - BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<sv:node sv:name="UpdatePluginConfig" xmlns:sv="http://www.jcp.org/jcr/sv/1.0"> - <sv:property sv:name="jcr:primaryType" sv:type="Name"> - <sv:value>hipposys:updaterinfo</sv:value> - </sv:property> - <sv:property sv:name="hipposys:batchsize" sv:type="Long"> - <sv:value>100</sv:value> - </sv:property> - <sv:property sv:name="hipposys:description" sv:type="String"> - <sv:value>Updates frontend:pluginconfig nodes and converts some comma separated string properties to multi value string properties.</sv:value> - </sv:property> - <sv:property sv:name="hipposys:dryrun" sv:type="Boolean"> - <sv:value>true</sv:value> - </sv:property> - <sv:property sv:name="hipposys:parameters" sv:type="String"> - <sv:value>{ "names" : [ "nodetypes", "linkpicker.nodetypes", "imagepicker.nodetypes", "included.image.variants", "excluded.image.variants", "last.visited.nodetypes" ] }</sv:value> - </sv:property> - <sv:property sv:name="hipposys:query" sv:type="String"> - <sv:value>//element(cluster.options,frontend:pluginconfig)</sv:value> - </sv:property> - <sv:property sv:name="hipposys:script" sv:type="String"> - <sv:value>package org.hippoecm.frontend.plugins.cms.admin.updater -import org.onehippo.repository.update.BaseNodeUpdateVisitor - -import javax.jcr.Node -import javax.jcr.PropertyType -import javax.jcr.Session - -class UpdaterTemplate extends BaseNodeUpdateVisitor { - - def names = [] - - void initialize(Session session) { - names = parametersMap.get("names", []) - } - - boolean doUpdate(Node node) { - log.debug "Checking node ${node.path}" - - def updated = false - for (name in names) { - if (node.hasProperty(name)) { - updated |= updateProperty(node, name) - } - } - - return updated - } - - boolean updateProperty(Node node, String name) { - def property = node.getProperty(name) - if (property.type != PropertyType.STRING) { - log.debug "Wrong type of property ${name}, expected String" - return false - } - if (property.multiple) { - return false - } - - def value = property.string - property.remove() - def values = [] as String[] - if (value != null) { - values = value.split(",").collect({it.trim()}) as String[] - } - node.setProperty(name, values) - log.debug "Converted property ${name} from ${value} to ${values}" - - return true - } - - boolean undoUpdate(Node node) { - throw new UnsupportedOperationException('Updater does not implement undoUpdate method') - } - -}</sv:value> - </sv:property> - <sv:property sv:name="hipposys:throttle" sv:type="Long"> - <sv:value>1000</sv:value> - </sv:property> -</sv:node> View it on GitLab: https://code.onehippo.org/cms-community/hippo-cms/commit/24b05bf0f44357aefa0eb1f68cbe459d707f33d5
_______________________________________________ Hippocms-svn mailing list [email protected] https://lists.onehippo.org/mailman/listinfo/hippocms-svn
