. 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 8cc57fe41e
commit 6027f1c17d
44 changed files with 323 additions and 222 deletions

View File

@@ -16,7 +16,7 @@
*/
package org.alfresco.web.forms;
import org.alfresco.model.WCMModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.avm.AVMRemote;
import org.alfresco.repo.avm.AVMRemoteInputStream;
import org.alfresco.repo.domain.PropertyValue;
@@ -102,7 +102,7 @@ public class FormDataFunctions
PropertyValue pv =
this.avmRemote.getNodeProperty(-1,
avmPath + '/' + entryName,
WCMModel.PROP_PARENT_FORM_NAME);
WCMAppModel.PROP_PARENT_FORM_NAME);
if (pv == null ||
pv.getStringValue() == null ||
!((String)pv.getStringValue()).equals(formName))
@@ -113,7 +113,7 @@ public class FormDataFunctions
pv = this.avmRemote.getNodeProperty(-1,
avmPath + '/' + entryName,
WCMModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE);
WCMAppModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE);
if (pv != null)
{

View File

@@ -29,7 +29,7 @@ import java.io.Serializable;
import java.util.*;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
@@ -94,14 +94,14 @@ class FormImpl
{
final NodeService nodeService = this.getServiceRegistry().getNodeService();
return (String)nodeService.getProperty(this.folderNodeRef,
WCMModel.PROP_OUTPUT_PATH_PATTERN_FOR_FORM_INSTANCE_DATA);
WCMAppModel.PROP_OUTPUT_PATH_PATTERN_FORM_INSTANCE_DATA);
}
public WorkflowDefinition getDefaultWorkflow()
{
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final String defaultWorkflowName = (String)nodeService.getProperty(this.folderNodeRef,
WCMModel.PROP_DEFAULT_WORKFLOW_NAME);
WCMAppModel.PROP_DEFAULT_WORKFLOW_NAME);
final WorkflowService workflowService = this.getServiceRegistry().getWorkflowService();
return (defaultWorkflowName != null
? workflowService.getDefinitionByName("jbpm$" + defaultWorkflowName)
@@ -133,7 +133,7 @@ class FormImpl
{
final NodeService nodeService = this.getServiceRegistry().getNodeService();
return (String)nodeService.getProperty(folderNodeRef,
WCMModel.PROP_XML_SCHEMA_ROOT_ELEMENT_NAME);
WCMAppModel.PROP_XML_SCHEMA_ROOT_ELEMENT_NAME);
}
public Document getSchema()
@@ -143,7 +143,7 @@ class FormImpl
final FormsService ts = FormsService.getInstance();
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final NodeRef schemaNodeRef = (NodeRef)nodeService.getProperty(folderNodeRef,
WCMModel.PROP_XML_SCHEMA);
WCMAppModel.PROP_XML_SCHEMA);
return ts.parseXML(schemaNodeRef);
}
@@ -162,13 +162,13 @@ class FormImpl
{
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final List<AssociationRef> refs = nodeService.getTargetAssocs(this.folderNodeRef,
WCMModel.ASSOC_RENDERING_ENGINE_TEMPLATES);
WCMAppModel.ASSOC_RENDERING_ENGINE_TEMPLATES);
final List<RenderingEngineTemplate> result = new ArrayList<RenderingEngineTemplate>(refs.size());
for (AssociationRef assoc : refs)
{
final NodeRef retNodeRef = assoc.getTargetRef();
for (ChildAssociationRef assoc2 : nodeService.getChildAssocs(retNodeRef,
WCMModel.ASSOC_RENDITION_PROPERTIES,
WCMAppModel.ASSOC_RENDITION_PROPERTIES,
RegexQNamePattern.MATCH_ALL))
{
final NodeRef renditionPropertiesNodeRef = assoc2.getChildRef();
@@ -186,9 +186,9 @@ class FormImpl
{
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final Map<QName, Serializable> props = new HashMap<QName, Serializable>(2, 1.0f);
props.put(WCMModel.PROP_PARENT_FORM, this.folderNodeRef);
props.put(WCMModel.PROP_PARENT_FORM_NAME, this.getName());
nodeService.addAspect(formInstanceDataNodeRef, WCMModel.ASPECT_FORM_INSTANCE_DATA, props);
props.put(WCMAppModel.PROP_PARENT_FORM, this.folderNodeRef);
props.put(WCMAppModel.PROP_PARENT_FORM_NAME, this.getName());
nodeService.addAspect(formInstanceDataNodeRef, WCMAppModel.ASPECT_FORM_INSTANCE_DATA, props);
}
public int hashCode()

View File

@@ -20,7 +20,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.service.ServiceRegistry;
@@ -77,7 +77,7 @@ public class FormInstanceDataImpl
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final NodeRef formNodeRef = (NodeRef)
nodeService.getProperty(this.nodeRef,
WCMModel.PROP_PARENT_FORM);
WCMAppModel.PROP_PARENT_FORM);
return new FormImpl(formNodeRef);
}

View File

@@ -46,7 +46,7 @@ import javax.xml.transform.stream.StreamResult;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.service.cmr.avm.AVMNotFoundException;
import org.alfresco.service.cmr.avm.AVMService;
@@ -207,7 +207,7 @@ public final class FormsService
final SearchParameters sp = new SearchParameters();
sp.addStore(Repository.getStoreRef());
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
sp.setQuery("ASPECT:\"" + WCMModel.ASPECT_FORM + "\"");
sp.setQuery("ASPECT:\"" + WCMAppModel.ASPECT_FORM + "\"");
if (LOGGER.isDebugEnabled())
LOGGER.debug("running query [" + sp.getQuery() + "]");
final ResultSet rs = this.searchService.query(sp);
@@ -232,7 +232,7 @@ public final class FormsService
final SearchParameters sp = new SearchParameters();
sp.addStore(Repository.getStoreRef());
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
sp.setQuery("ASPECT:\"" + WCMModel.ASPECT_FORM +
sp.setQuery("ASPECT:\"" + WCMAppModel.ASPECT_FORM +
"\" AND @" + Repository.escapeQName(ContentModel.PROP_NAME) +
":\"" + name + "\"");
if (LOGGER.isDebugEnabled())
@@ -282,7 +282,7 @@ public final class FormsService
{
final Form form =
this.getForm((NodeRef)this.nodeService.getProperty(formInstanceDataNodeRef,
WCMModel.PROP_PARENT_FORM));
WCMAppModel.PROP_PARENT_FORM));
final Document formInstanceData = this.parseXML(formInstanceDataNodeRef);
final String formInstanceDataFileName = (String)
@@ -337,7 +337,7 @@ public final class FormsService
RenderingEngine.RenderingException
{
final NodeRef formNodeRef = (NodeRef)
nodeService.getProperty(formInstanceDataNodeRef, WCMModel.PROP_PARENT_FORM);
nodeService.getProperty(formInstanceDataNodeRef, WCMAppModel.PROP_PARENT_FORM);
final Form form = this.getForm(formNodeRef);

View File

@@ -31,7 +31,7 @@ import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.ContentReader;
@@ -90,7 +90,7 @@ public class RenderingEngineTemplateImpl
{
final NodeService nodeService = this.getServiceRegistry().getNodeService();
return (String)nodeService.getProperty(this.renditionPropertiesNodeRef,
WCMModel.PROP_OUTPUT_PATH_PATTERN_FOR_RENDITION);
WCMAppModel.PROP_OUTPUT_PATH_PATTERN_RENDITION);
}
public NodeRef getNodeRef()
@@ -122,7 +122,7 @@ public class RenderingEngineTemplateImpl
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final String renderingEngineName = (String)
nodeService.getProperty(this.nodeRef,
WCMModel.PROP_PARENT_RENDERING_ENGINE_NAME);
WCMAppModel.PROP_PARENT_RENDERING_ENGINE_NAME);
final FormsService fs = FormsService.getInstance();
return fs.getRenderingEngine(renderingEngineName);
}
@@ -138,7 +138,7 @@ public class RenderingEngineTemplateImpl
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final String outputPathPattern = (String)
nodeService.getProperty(this.renditionPropertiesNodeRef,
WCMModel.PROP_OUTPUT_PATH_PATTERN_FOR_RENDITION);
WCMAppModel.PROP_OUTPUT_PATH_PATTERN_RENDITION);
final String formInstanceDataAVMPath =
AVMNodeConverter.ToAVMVersionPath(formInstanceDataNodeRef).getSecond();
@@ -183,7 +183,7 @@ public class RenderingEngineTemplateImpl
{
final NodeService nodeService = this.getServiceRegistry().getNodeService();
return (String)nodeService.getProperty(this.renditionPropertiesNodeRef,
WCMModel.PROP_MIMETYPE_FOR_RENDITION);
WCMAppModel.PROP_MIMETYPE_FOR_RENDITION);
}
public void registerRendition(final NodeRef renditionNodeRef,
@@ -191,9 +191,9 @@ public class RenderingEngineTemplateImpl
{
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final Map<QName, Serializable> props = new HashMap<QName, Serializable>(2, 1.0f);
props.put(WCMModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE, this.nodeRef);
props.put(WCMModel.PROP_PRIMARY_FORM_INSTANCE_DATA, primaryFormInstanceDataNodeRef);
nodeService.addAspect(renditionNodeRef, WCMModel.ASPECT_RENDITION, props);
props.put(WCMAppModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE, this.nodeRef);
props.put(WCMAppModel.PROP_PRIMARY_FORM_INSTANCE_DATA, primaryFormInstanceDataNodeRef);
nodeService.addAspect(renditionNodeRef, WCMAppModel.ASPECT_RENDITION, props);
}
private ServiceRegistry getServiceRegistry()

View File

@@ -20,7 +20,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.service.ServiceRegistry;
@@ -77,7 +77,7 @@ public class RenditionImpl
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final NodeRef fidNodeRef = (NodeRef)
nodeService.getProperty(this.nodeRef,
WCMModel.PROP_PRIMARY_FORM_INSTANCE_DATA);
WCMAppModel.PROP_PRIMARY_FORM_INSTANCE_DATA);
return new FormInstanceDataImpl(fidNodeRef);
}
@@ -87,10 +87,10 @@ public class RenditionImpl
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final NodeRef retNodeRef = (NodeRef)
nodeService.getProperty(this.nodeRef,
WCMModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE);
WCMAppModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE);
final NodeRef rpNodeRef = (NodeRef)
nodeService.getProperty(this.nodeRef,
WCMModel.PROP_PARENT_RENDITION_PROPERTIES);
WCMAppModel.PROP_PARENT_RENDITION_PROPERTIES);
return new RenderingEngineTemplateImpl(retNodeRef, rpNodeRef);
}