. Big and juicy application/WCM model refactoring

- WARNING: this change requires a new DB as the WCM model has changed significantly, yes I have probably broken a few WCM things :)

Previously the following statements were true:
 - Most of the model constants were defined in the ContentModel class - including web-client Application specific model items
 - WCMModel class was a mix of WCM repository and WCM application model constants
 - The applicationModel.xml definition file contained both web-client Application and WCM application model definitions
 - The wcmModel.xml definition file contained both WCM repository and WCM application model definitions

The following statements are now true:
 - All web-client application specific model constants have been moved from ContentModel to a new model constants class ApplicationModel
 - A new WCM application model has been defined with the prefix "wca" and URI: http://www.alfresco.org/model/wcmappmodel/1.0
 - All WCM application specific model constants have been renamed/moved from ContentModel/WCMModel to a new model constants class WCMAppModel
 - The mix of WCM application specific model definitions in contentModel.xml and applicationModel.xml has been moved to a new definition file wcmAppModel.xml
 - A patch is not required for standard Alfresco as only WCM definitions have actually changed

. Fix to issue created during workflow id/name refactor
. Fix to allow forms in the Available Content Forms panel to have correct sandbox/username context for action dialog

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4448 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-11-27 15:03:12 +00:00
parent ef669bec2a
commit 4003f0e36f
26 changed files with 599 additions and 501 deletions

View File

@@ -23,6 +23,7 @@ import java.util.Map;
import java.util.Properties;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.importer.ImporterBootstrap;
@@ -220,7 +221,7 @@ public class EmailTemplatesFolderPatch extends AbstractPatch
properties.put(ContentModel.PROP_NAME, emailTemplatesName);
properties.put(ContentModel.PROP_TITLE, emailTemplatesName);
properties.put(ContentModel.PROP_DESCRIPTION, emailTemplatesDescription);
properties.put(ContentModel.PROP_ICON, PROPERTY_ICON);
properties.put(ApplicationModel.PROP_ICON, PROPERTY_ICON);
// create the node
ChildAssociationRef childAssocRef = nodeService.createNode(
@@ -232,6 +233,6 @@ public class EmailTemplatesFolderPatch extends AbstractPatch
emailTemplatesFolderNodeRef = childAssocRef.getChildRef();
// add the required aspects
nodeService.addAspect(emailTemplatesFolderNodeRef, ContentModel.ASPECT_UIFACETS, null);
nodeService.addAspect(emailTemplatesFolderNodeRef, ApplicationModel.ASPECT_UIFACETS, null);
}
}

View File

@@ -3,7 +3,7 @@ package org.alfresco.repo.admin.patch.impl;
import java.io.Serializable;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.model.ContentModel;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ForumModel;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.importer.ImporterBootstrap;
@@ -71,14 +71,14 @@ public class ForumsIconsPatch extends AbstractPatch
{
if (this.nodeService.exists(node))
{
String icon = (String)this.nodeService.getProperty(node, ContentModel.PROP_ICON);
String icon = (String)this.nodeService.getProperty(node, ApplicationModel.PROP_ICON);
if (icon != null && icon.length() > 0)
{
int idx = icon.indexOf("_large");
if (idx != -1)
{
String newIcon = icon.substring(0, idx);
this.nodeService.setProperty(node, ContentModel.PROP_ICON, (Serializable)newIcon);
this.nodeService.setProperty(node, ApplicationModel.PROP_ICON, (Serializable)newIcon);
changed++;
}
}

View File

@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Properties;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.importer.ImporterBootstrap;
@@ -206,14 +207,14 @@ public class GuestUserPatch extends AbstractPatch
properties.put(ContentModel.PROP_NAME, guestHomeName);
properties.put(ContentModel.PROP_TITLE, guestHomeName);
properties.put(ContentModel.PROP_DESCRIPTION, guestHomeDescription);
properties.put(ContentModel.PROP_ICON, "space-icon-default");
properties.put(ApplicationModel.PROP_ICON, "space-icon-default");
ChildAssociationRef childAssocRef = nodeService.createNode(companyHomeRef, ContentModel.ASSOC_CONTAINS,
QName.createQName(guestHomeChildName, namespaceService), ContentModel.TYPE_FOLDER, properties);
NodeRef nodeRef = childAssocRef.getChildRef();
// add the required aspects
nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, null);
nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null);
setGuestHomePermissions(nodeRef);

View File

@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Properties;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.importer.ACPImportPackageHandler;
@@ -280,7 +281,7 @@ public class RSSTemplatesFolderPatch extends AbstractPatch
properties.put(ContentModel.PROP_NAME, folderName);
properties.put(ContentModel.PROP_TITLE, folderName);
properties.put(ContentModel.PROP_DESCRIPTION, folderDescription);
properties.put(ContentModel.PROP_ICON, PROPERTY_ICON);
properties.put(ApplicationModel.PROP_ICON, PROPERTY_ICON);
// create the node
ChildAssociationRef childAssocRef = nodeService.createNode(
@@ -292,7 +293,7 @@ public class RSSTemplatesFolderPatch extends AbstractPatch
this.rssFolderNodeRef = childAssocRef.getChildRef();
// finally add the required aspects
nodeService.addAspect(rssFolderNodeRef, ContentModel.ASPECT_UIFACETS, null);
nodeService.addAspect(rssFolderNodeRef, ApplicationModel.ASPECT_UIFACETS, null);
}
private void importContent() throws IOException

View File

@@ -23,6 +23,7 @@ import java.util.Map;
import java.util.Properties;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.importer.ImporterBootstrap;
@@ -234,7 +235,7 @@ public class SavedSearchFolderPatch extends AbstractPatch
properties.put(ContentModel.PROP_NAME, savedSearchesName);
properties.put(ContentModel.PROP_TITLE, savedSearchesName);
properties.put(ContentModel.PROP_DESCRIPTION, savedSearchesDescription);
properties.put(ContentModel.PROP_ICON, PROPERTY_ICON);
properties.put(ApplicationModel.PROP_ICON, PROPERTY_ICON);
// create the node
ChildAssociationRef childAssocRef = nodeService.createNode(
dictionaryNodeRef,
@@ -244,7 +245,7 @@ public class SavedSearchFolderPatch extends AbstractPatch
properties);
savedSearchesFolderNodeRef = childAssocRef.getChildRef();
// add the required aspects
nodeService.addAspect(savedSearchesFolderNodeRef, ContentModel.ASPECT_UIFACETS, null);
nodeService.addAspect(savedSearchesFolderNodeRef, ApplicationModel.ASPECT_UIFACETS, null);
// done
}

View File

@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Properties;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.importer.ACPImportPackageHandler;
@@ -266,7 +267,7 @@ public class ScriptsFolderPatch extends AbstractPatch
properties.put(ContentModel.PROP_NAME, folderName);
properties.put(ContentModel.PROP_TITLE, folderName);
properties.put(ContentModel.PROP_DESCRIPTION, folderDescription);
properties.put(ContentModel.PROP_ICON, PROPERTY_ICON);
properties.put(ApplicationModel.PROP_ICON, PROPERTY_ICON);
// create the node
ChildAssociationRef childAssocRef = nodeService.createNode(
@@ -278,7 +279,7 @@ public class ScriptsFolderPatch extends AbstractPatch
scriptsFolderNodeRef = childAssocRef.getChildRef();
// finally add the required aspects
nodeService.addAspect(scriptsFolderNodeRef, ContentModel.ASPECT_UIFACETS, null);
nodeService.addAspect(scriptsFolderNodeRef, ApplicationModel.ASPECT_UIFACETS, null);
}
private void importContent() throws IOException

View File

@@ -21,7 +21,7 @@ import java.util.List;
import java.util.Properties;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.model.ContentModel;
import org.alfresco.model.ApplicationModel;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.importer.ACPImportPackageHandler;
import org.alfresco.repo.importer.ImporterBootstrap;
@@ -124,10 +124,10 @@ public class UIFacetsAspectRemovalPatch extends AbstractPatch
for (NodeRef ref : nodeRefs)
{
// if the content has the uifacets aspect, then remove it and meaningless icon reference
if (nodeService.hasAspect(ref, ContentModel.ASPECT_UIFACETS))
if (nodeService.hasAspect(ref, ApplicationModel.ASPECT_UIFACETS))
{
nodeService.removeAspect(ref, ContentModel.ASPECT_UIFACETS);
nodeService.setProperty(ref, ContentModel.PROP_ICON, null);
nodeService.removeAspect(ref, ApplicationModel.ASPECT_UIFACETS);
nodeService.setProperty(ref, ApplicationModel.PROP_ICON, null);
updated++;
}
}