mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.0 to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5146 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5147 . - WCM-225 svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5149 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5151 . - WCM-339 - 2 revisions git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5170 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -129,3 +129,6 @@ patch.systemRegistryBootstrap.description=Bootstraps the node that will hold sys
|
|||||||
|
|
||||||
patch.userAndPersonUserNamesAsIdentifiers.description=Reindex user:user and cm:person uids as identifiers
|
patch.userAndPersonUserNamesAsIdentifiers.description=Reindex user:user and cm:person uids as identifiers
|
||||||
patch.userAndPersonUserNamesAsIdentifiers.result=Reindexed user:user and cm:person uids as identifiers
|
patch.userAndPersonUserNamesAsIdentifiers.result=Reindexed user:user and cm:person uids as identifiers
|
||||||
|
|
||||||
|
patch.contentFormFolderType.description=Update WCM Content Form folder type.
|
||||||
|
patch.contentFormFolderType.result=Updated {0} WCM Content Form objects to 'wcm:formfolder' type.
|
@@ -177,6 +177,10 @@
|
|||||||
</mandatory-aspects>
|
</mandatory-aspects>
|
||||||
</type>
|
</type>
|
||||||
|
|
||||||
|
<type name="wca:formfolder">
|
||||||
|
<title>XForms Capture Form Folder</title>
|
||||||
|
<parent>cm:folder</parent>
|
||||||
|
</type>
|
||||||
</types>
|
</types>
|
||||||
|
|
||||||
<aspects>
|
<aspects>
|
||||||
|
@@ -602,12 +602,24 @@
|
|||||||
<property name="userImporterBootstrap">
|
<property name="userImporterBootstrap">
|
||||||
<ref bean="userBootstrap" />
|
<ref bean="userBootstrap" />
|
||||||
</property>
|
</property>
|
||||||
<property name="spacesImporterBootstrap">
|
<property name="spacesImporterBootstrap">
|
||||||
<ref bean="spacesBootstrap" />
|
<ref bean="spacesBootstrap" />
|
||||||
</property>
|
</property>
|
||||||
<property name="indexerAndSearcher">
|
<property name="indexerAndSearcher">
|
||||||
<ref bean="indexerAndSearcherFactory" />
|
<ref bean="indexerAndSearcherFactory" />
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="patch.contentFormFolderType" class="org.alfresco.repo.admin.patch.impl.ContentFormTypePatch" parent="basePatch" >
|
||||||
|
<property name="id"><value>patch.contentFormFolderType</value></property>
|
||||||
|
<property name="description"><value>patch.contentFormFolderType.description</value></property>
|
||||||
|
<property name="fixesFromSchema"><value>0</value></property>
|
||||||
|
<property name="fixesToSchema"><value>36</value></property>
|
||||||
|
<property name="targetSchema"><value>37</value></property>
|
||||||
|
<!-- helper beans for execution -->
|
||||||
|
<property name="importerBootstrap">
|
||||||
|
<ref bean="spacesBootstrap" />
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
@@ -19,4 +19,4 @@ version.build=@build-number@
|
|||||||
|
|
||||||
# Schema number
|
# Schema number
|
||||||
|
|
||||||
version.schema=36
|
version.schema=37
|
||||||
|
@@ -75,6 +75,7 @@ public interface WCMAppModel
|
|||||||
static final QName PROP_OUTPUT_PATH_PATTERN = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "outputpathpattern");
|
static final QName PROP_OUTPUT_PATH_PATTERN = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "outputpathpattern");
|
||||||
|
|
||||||
// The XForms data capture form aspect.
|
// The XForms data capture form aspect.
|
||||||
|
static final QName TYPE_FORMFOLDER = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "formfolder");
|
||||||
static final QName ASPECT_FORM = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "form");
|
static final QName ASPECT_FORM = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "form");
|
||||||
static final QName PROP_XML_SCHEMA = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "schema");
|
static final QName PROP_XML_SCHEMA = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "schema");
|
||||||
static final QName PROP_XML_SCHEMA_ROOT_ELEMENT_NAME = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "xmlschemarootelementname");
|
static final QName PROP_XML_SCHEMA_ROOT_ELEMENT_NAME = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "xmlschemarootelementname");
|
||||||
|
@@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005 Alfresco, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Mozilla Public License version 1.1
|
||||||
|
* with a permitted attribution clause. You may obtain a
|
||||||
|
* copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.alfresco.org/legal/license.txt
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
package org.alfresco.repo.admin.patch.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import org.alfresco.i18n.I18NUtil;
|
||||||
|
import org.alfresco.model.WCMAppModel;
|
||||||
|
import org.alfresco.repo.admin.patch.AbstractPatch;
|
||||||
|
import org.alfresco.repo.importer.ImporterBootstrap;
|
||||||
|
import org.alfresco.service.cmr.admin.PatchException;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.service.cmr.search.ResultSet;
|
||||||
|
import org.alfresco.service.cmr.search.ResultSetRow;
|
||||||
|
import org.alfresco.service.cmr.search.SearchParameters;
|
||||||
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch to update the type of all WCM content form folders to 'wca:formfolder'.
|
||||||
|
*
|
||||||
|
* @author Kevin Roast
|
||||||
|
*/
|
||||||
|
public class ContentFormTypePatch extends AbstractPatch
|
||||||
|
{
|
||||||
|
private final static String MSG_RESULT = "patch.contentFormFolderType.result";
|
||||||
|
|
||||||
|
private ImporterBootstrap importerBootstrap;
|
||||||
|
|
||||||
|
public void setImporterBootstrap(ImporterBootstrap importerBootstrap)
|
||||||
|
{
|
||||||
|
this.importerBootstrap = importerBootstrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ensure that required common properties have been set
|
||||||
|
*/
|
||||||
|
protected void checkCommonProperties() throws Exception
|
||||||
|
{
|
||||||
|
if (searchService == null)
|
||||||
|
{
|
||||||
|
throw new PatchException("'searchService' property has not been set");
|
||||||
|
}
|
||||||
|
if (nodeService == null)
|
||||||
|
{
|
||||||
|
throw new PatchException("'nodeService' property has not been set");
|
||||||
|
}
|
||||||
|
if (importerBootstrap == null)
|
||||||
|
{
|
||||||
|
throw new PatchException("'importerBootstrap' property has not been set");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.alfresco.repo.admin.patch.AbstractPatch#applyInternal()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected String applyInternal() throws Exception
|
||||||
|
{
|
||||||
|
checkCommonProperties();
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
for (NodeRef formRef : getForms())
|
||||||
|
{
|
||||||
|
// update folder type to 'wcm:formfolder'
|
||||||
|
this.nodeService.setType(formRef, WCMAppModel.TYPE_FORMFOLDER);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return I18NUtil.getMessage(MSG_RESULT, new Object[] {Integer.toString(count)});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return all existing web form folders - marked with the 'wcm:form' aspect.
|
||||||
|
*/
|
||||||
|
private Collection<NodeRef> getForms()
|
||||||
|
{
|
||||||
|
SearchParameters sp = new SearchParameters();
|
||||||
|
sp.addStore(this.importerBootstrap.getStoreRef());
|
||||||
|
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
|
||||||
|
sp.setQuery("ASPECT:\"" + WCMAppModel.ASPECT_FORM + "\"");
|
||||||
|
ResultSet rs = this.searchService.query(sp);
|
||||||
|
Collection<NodeRef> result = new ArrayList<NodeRef>(rs.length());
|
||||||
|
for (ResultSetRow row : rs)
|
||||||
|
{
|
||||||
|
result.add(row.getNodeRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user