From 6027f1c17d45d86e945b72c98c531af7db469e93 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Mon, 27 Nov 2006 15:03:12 +0000 Subject: [PATCH] . 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 --- config/alfresco/web-client-config-dialogs.xml | 2 +- .../alfresco/web-client-config-navigation.xml | 2 +- .../alfresco/web-client-config-properties.xml | 6 +- .../evaluator/EditDocCIFSEvaluator.java | 3 +- .../evaluator/EditDocHttpEvaluator.java | 3 +- .../evaluator/EditDocWebDavEvaluator.java | 3 +- .../alfresco/web/bean/BaseDetailsBean.java | 41 ++++++------ .../org/alfresco/web/bean/BrowseBean.java | 13 ++-- .../web/bean/CheckinCheckoutBean.java | 7 +- .../web/bean/DocumentDetailsBean.java | 9 +-- .../alfresco/web/bean/SpaceDetailsBean.java | 21 +++--- .../web/bean/clipboard/ClipboardBean.java | 9 +-- .../web/bean/content/BaseContentWizard.java | 5 +- .../bean/forums/CreateDiscussionDialog.java | 8 ++- .../web/bean/forums/CreateTopicDialog.java | 5 +- .../alfresco/web/bean/repository/User.java | 3 +- .../web/bean/spaces/CreateSpaceWizard.java | 9 +-- .../web/bean/spaces/EditSpaceDialog.java | 5 +- .../alfresco/web/bean/wcm/AVMBrowseBean.java | 19 +++--- .../alfresco/web/bean/wcm/AVMConstants.java | 66 +++++++++++++++++++ .../alfresco/web/bean/wcm/AVMEditBean.java | 12 ++-- .../web/bean/wcm/CreateFolderDialog.java | 3 +- .../web/bean/wcm/CreateFormWizard.java | 30 ++++----- .../web/bean/wcm/CreateWebContentWizard.java | 17 ++--- .../web/bean/wcm/CreateWebsiteWizard.java | 56 ++++++++-------- .../web/bean/wcm/DeleteSandboxDialog.java | 10 +-- .../web/bean/wcm/DeleteWebsiteDialog.java | 8 +-- .../bean/wcm/EditFolderPropertiesDialog.java | 5 +- .../web/bean/wcm/FormDetailsDialog.java | 2 +- .../web/bean/wcm/ImportWebsiteDialog.java | 8 ++- .../bean/wcm/InviteWebsiteUsersWizard.java | 22 +++---- .../web/bean/wizard/NewUserWizard.java | 5 +- .../web/bean/workflow/ManageTaskDialog.java | 3 +- .../bean/workflow/StartWorkflowWizard.java | 3 +- .../web/bean/workflow/WorkflowUtil.java | 19 +++--- .../alfresco/web/forms/FormDataFunctions.java | 6 +- .../java/org/alfresco/web/forms/FormImpl.java | 20 +++--- .../web/forms/FormInstanceDataImpl.java | 4 +- .../org/alfresco/web/forms/FormsService.java | 10 +-- .../forms/RenderingEngineTemplateImpl.java | 16 ++--- .../org/alfresco/web/forms/RenditionImpl.java | 8 +-- .../ui/repo/component/UINodeWorkflowInfo.java | 15 +++-- .../ui/repo/component/UISpaceSelector.java | 3 +- .../web/ui/wcm/component/UIUserSandboxes.java | 21 +++--- 44 files changed, 323 insertions(+), 222 deletions(-) diff --git a/config/alfresco/web-client-config-dialogs.xml b/config/alfresco/web-client-config-dialogs.xml index a843b4f4e4..8690544659 100644 --- a/config/alfresco/web-client-config-dialogs.xml +++ b/config/alfresco/web-client-config-dialogs.xml @@ -200,7 +200,7 @@ - + - + diff --git a/config/alfresco/web-client-config-properties.xml b/config/alfresco/web-client-config-properties.xml index e1c25403bb..1a7d39a8c1 100644 --- a/config/alfresco/web-client-config-properties.xml +++ b/config/alfresco/web-client-config-properties.xml @@ -314,10 +314,10 @@ - + - - + + diff --git a/source/java/org/alfresco/web/action/evaluator/EditDocCIFSEvaluator.java b/source/java/org/alfresco/web/action/evaluator/EditDocCIFSEvaluator.java index 8f6a10352c..947c030572 100644 --- a/source/java/org/alfresco/web/action/evaluator/EditDocCIFSEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/EditDocCIFSEvaluator.java @@ -18,6 +18,7 @@ package org.alfresco.web.action.evaluator; import javax.faces.context.FacesContext; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.web.action.ActionEvaluator; @@ -45,7 +46,7 @@ public class EditDocCIFSEvaluator implements ActionEvaluator // if the node is inline editable, the default http behaviour should always be used if (dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT)) { - if (node.hasAspect(ContentModel.ASPECT_INLINEEDITABLE) == false && + if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == false && "cifs".equals(Application.getClientConfig(fc).getEditLinkType())) { if (node.isWorkingCopyOwner() == true || diff --git a/source/java/org/alfresco/web/action/evaluator/EditDocHttpEvaluator.java b/source/java/org/alfresco/web/action/evaluator/EditDocHttpEvaluator.java index 3ed3d935e6..f56704814a 100644 --- a/source/java/org/alfresco/web/action/evaluator/EditDocHttpEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/EditDocHttpEvaluator.java @@ -18,6 +18,7 @@ package org.alfresco.web.action.evaluator; import javax.faces.context.FacesContext; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.web.action.ActionEvaluator; @@ -46,7 +47,7 @@ public class EditDocHttpEvaluator implements ActionEvaluator // always be used otherwise the configured approach is used if (dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT)) { - if (node.hasAspect(ContentModel.ASPECT_INLINEEDITABLE) == true || + if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == true || "http".equals(Application.getClientConfig(fc).getEditLinkType())) { if (node.isWorkingCopyOwner() == true || diff --git a/source/java/org/alfresco/web/action/evaluator/EditDocWebDavEvaluator.java b/source/java/org/alfresco/web/action/evaluator/EditDocWebDavEvaluator.java index 82ffa55282..1f15de1c84 100644 --- a/source/java/org/alfresco/web/action/evaluator/EditDocWebDavEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/EditDocWebDavEvaluator.java @@ -18,6 +18,7 @@ package org.alfresco.web.action.evaluator; import javax.faces.context.FacesContext; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.web.action.ActionEvaluator; @@ -45,7 +46,7 @@ public class EditDocWebDavEvaluator implements ActionEvaluator // if the node is inline editable, the default http behaviour should always be used if (dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT)) { - if (node.hasAspect(ContentModel.ASPECT_INLINEEDITABLE) == false && + if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == false && "webdav".equals(Application.getClientConfig(fc).getEditLinkType())) { if (node.isWorkingCopyOwner() == true || diff --git a/source/java/org/alfresco/web/bean/BaseDetailsBean.java b/source/java/org/alfresco/web/bean/BaseDetailsBean.java index c235d4aa2c..a006528ed7 100644 --- a/source/java/org/alfresco/web/bean/BaseDetailsBean.java +++ b/source/java/org/alfresco/web/bean/BaseDetailsBean.java @@ -27,6 +27,7 @@ import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.repository.CopyService; import org.alfresco.service.cmr.repository.NodeRef; @@ -291,25 +292,25 @@ public abstract class BaseDetailsBean public Map getWorkflowProperties() { if (this.workflowProperties == null && - getNode().hasAspect(ContentModel.ASPECT_SIMPLE_WORKFLOW)) + getNode().hasAspect(ApplicationModel.ASPECT_SIMPLE_WORKFLOW)) { // get the exisiting properties for the document Map props = getNode().getProperties(); String approveStepName = (String)props.get( - ContentModel.PROP_APPROVE_STEP.toString()); + ApplicationModel.PROP_APPROVE_STEP.toString()); String rejectStepName = (String)props.get( - ContentModel.PROP_REJECT_STEP.toString()); + ApplicationModel.PROP_REJECT_STEP.toString()); Boolean approveMove = (Boolean)props.get( - ContentModel.PROP_APPROVE_MOVE.toString()); + ApplicationModel.PROP_APPROVE_MOVE.toString()); Boolean rejectMove = (Boolean)props.get( - ContentModel.PROP_REJECT_MOVE.toString()); + ApplicationModel.PROP_REJECT_MOVE.toString()); NodeRef approveFolder = (NodeRef)props.get( - ContentModel.PROP_APPROVE_FOLDER.toString()); + ApplicationModel.PROP_APPROVE_FOLDER.toString()); NodeRef rejectFolder = (NodeRef)props.get( - ContentModel.PROP_REJECT_FOLDER.toString()); + ApplicationModel.PROP_REJECT_FOLDER.toString()); // put the workflow properties in a separate map for use by the JSP this.workflowProperties = new HashMap(7); @@ -375,7 +376,7 @@ public abstract class BaseDetailsBean // update the simple workflow properties // set the approve step name - updateProps.put(ContentModel.PROP_APPROVE_STEP, + updateProps.put(ApplicationModel.PROP_APPROVE_STEP, this.workflowProperties.get(SimpleWorkflowHandler.PROP_APPROVE_STEP_NAME)); // specify whether the approve step will copy or move the content @@ -385,10 +386,10 @@ public abstract class BaseDetailsBean { approveMove = false; } - updateProps.put(ContentModel.PROP_APPROVE_MOVE, Boolean.valueOf(approveMove)); + updateProps.put(ApplicationModel.PROP_APPROVE_MOVE, Boolean.valueOf(approveMove)); // create node ref representation of the destination folder - updateProps.put(ContentModel.PROP_APPROVE_FOLDER, + updateProps.put(ApplicationModel.PROP_APPROVE_FOLDER, this.workflowProperties.get(SimpleWorkflowHandler.PROP_APPROVE_FOLDER)); // determine whether there should be a reject step @@ -403,7 +404,7 @@ public abstract class BaseDetailsBean if (requireReject) { // set the reject step name - updateProps.put(ContentModel.PROP_REJECT_STEP, + updateProps.put(ApplicationModel.PROP_REJECT_STEP, this.workflowProperties.get(SimpleWorkflowHandler.PROP_REJECT_STEP_NAME)); // specify whether the reject step will copy or move the content @@ -414,19 +415,19 @@ public abstract class BaseDetailsBean { rejectMove = false; } - updateProps.put(ContentModel.PROP_REJECT_MOVE, Boolean.valueOf(rejectMove)); + updateProps.put(ApplicationModel.PROP_REJECT_MOVE, Boolean.valueOf(rejectMove)); // create node ref representation of the destination folder - updateProps.put(ContentModel.PROP_REJECT_FOLDER, + updateProps.put(ApplicationModel.PROP_REJECT_FOLDER, this.workflowProperties.get(SimpleWorkflowHandler.PROP_REJECT_FOLDER)); } else { // set all the reject properties to null to signify there should // be no reject step - updateProps.put(ContentModel.PROP_REJECT_STEP, null); - updateProps.put(ContentModel.PROP_REJECT_MOVE, null); - updateProps.put(ContentModel.PROP_REJECT_FOLDER, null); + updateProps.put(ApplicationModel.PROP_REJECT_STEP, null); + updateProps.put(ApplicationModel.PROP_REJECT_MOVE, null); + updateProps.put(ApplicationModel.PROP_REJECT_FOLDER, null); } // set the properties on the node @@ -459,10 +460,10 @@ public abstract class BaseDetailsBean { String approveStepName = null; - if (getNode().hasAspect(ContentModel.ASPECT_SIMPLE_WORKFLOW)) + if (getNode().hasAspect(ApplicationModel.ASPECT_SIMPLE_WORKFLOW)) { approveStepName = (String)getNode().getProperties().get( - ContentModel.PROP_APPROVE_STEP.toString()); + ApplicationModel.PROP_APPROVE_STEP.toString()); } return approveStepName; @@ -524,10 +525,10 @@ public abstract class BaseDetailsBean { String approveStepName = null; - if (getNode().hasAspect(ContentModel.ASPECT_SIMPLE_WORKFLOW)) + if (getNode().hasAspect(ApplicationModel.ASPECT_SIMPLE_WORKFLOW)) { approveStepName = (String)getNode().getProperties().get( - ContentModel.PROP_REJECT_STEP.toString()); + ApplicationModel.PROP_REJECT_STEP.toString()); } return approveStepName; diff --git a/source/java/org/alfresco/web/bean/BrowseBean.java b/source/java/org/alfresco/web/bean/BrowseBean.java index d230258b44..f81011a164 100644 --- a/source/java/org/alfresco/web/bean/BrowseBean.java +++ b/source/java/org/alfresco/web/bean/BrowseBean.java @@ -33,6 +33,7 @@ import javax.transaction.UserTransaction; import org.alfresco.config.Config; import org.alfresco.config.ConfigElement; import org.alfresco.config.ConfigService; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.TypeDefinition; @@ -623,7 +624,7 @@ public class BrowseBean implements IContextListener this.contentNodes.add(node); } // look for File Link object node - else if (ContentModel.TYPE_FILELINK.equals(type)) + else if (ApplicationModel.TYPE_FILELINK.equals(type)) { // create our File Link Node representation node = new MapNode(nodeRef, this.nodeService, true); @@ -636,7 +637,7 @@ public class BrowseBean implements IContextListener this.contentNodes.add(node); } - else if (ContentModel.TYPE_FOLDERLINK.equals(type)) + else if (ApplicationModel.TYPE_FOLDERLINK.equals(type)) { // create our Folder Link Node representation node = new MapNode(nodeRef, this.nodeService, true); @@ -787,7 +788,7 @@ public class BrowseBean implements IContextListener this.contentNodes.add(node); } // look for File Link object node - else if (ContentModel.TYPE_FILELINK.equals(type)) + else if (ApplicationModel.TYPE_FILELINK.equals(type)) { // create our File Link Node representation node = new MapNode(nodeRef, this.nodeService, false); @@ -802,7 +803,7 @@ public class BrowseBean implements IContextListener this.contentNodes.add(node); } - else if (ContentModel.TYPE_FOLDERLINK.equals(type)) + else if (ApplicationModel.TYPE_FOLDERLINK.equals(type)) { // create our Folder Link Node representation node = new MapNode(nodeRef, this.nodeService, false); @@ -1109,7 +1110,7 @@ public class BrowseBean implements IContextListener NodeRef ref = new NodeRef(Repository.getStoreRef(), id); // handle special folder link node case - if (ContentModel.TYPE_FOLDERLINK.equals(this.nodeService.getType(ref))) + if (ApplicationModel.TYPE_FOLDERLINK.equals(this.nodeService.getType(ref))) { ref = (NodeRef)this.nodeService.getProperty(ref, ContentModel.PROP_LINK_DESTINATION); } @@ -1320,7 +1321,7 @@ public class BrowseBean implements IContextListener Node node = new Node(ref); // store the URL to for downloading the content - if (ContentModel.TYPE_FILELINK.equals(node.getType())) + if (ApplicationModel.TYPE_FILELINK.equals(node.getType())) { node.addPropertyResolver("url", this.resolverLinkDownload); } diff --git a/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java b/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java index f58e734bf9..85554f5a1d 100644 --- a/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java +++ b/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java @@ -26,6 +26,7 @@ import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.version.VersionModel; @@ -607,9 +608,9 @@ public class CheckinCheckoutBean Node node = setupContentDocument(id); // detect the inline editing aspect to see which edit mode to use - if (node.hasAspect(ContentModel.ASPECT_INLINEEDITABLE) && - node.getProperties().get(ContentModel.PROP_EDITINLINE) != null && - ((Boolean)node.getProperties().get(ContentModel.PROP_EDITINLINE)).booleanValue() == true) + if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) && + node.getProperties().get(ApplicationModel.PROP_EDITINLINE) != null && + ((Boolean)node.getProperties().get(ApplicationModel.PROP_EDITINLINE)).booleanValue() == true) { // retrieve the content reader for this node ContentReader reader = getContentService().getReader(node.getNodeRef(), ContentModel.PROP_CONTENT); diff --git a/source/java/org/alfresco/web/bean/DocumentDetailsBean.java b/source/java/org/alfresco/web/bean/DocumentDetailsBean.java index 2659a3009c..02e68a8ad9 100644 --- a/source/java/org/alfresco/web/bean/DocumentDetailsBean.java +++ b/source/java/org/alfresco/web/bean/DocumentDetailsBean.java @@ -29,6 +29,7 @@ import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.content.MimetypeMap; import org.alfresco.service.cmr.coci.CheckOutCheckInService; @@ -145,7 +146,7 @@ public class DocumentDetailsBean extends BaseDetailsBean protected Node getLinkResolvedNode() { Node document = getDocument(); - if (ContentModel.TYPE_FILELINK.equals(document.getType())) + if (ApplicationModel.TYPE_FILELINK.equals(document.getType())) { NodeRef destRef = (NodeRef)document.getProperties().get(ContentModel.PROP_LINK_DESTINATION); if (nodeService.exists(destRef)) @@ -171,7 +172,7 @@ public class DocumentDetailsBean extends BaseDetailsBean */ public boolean isInlineEditable() { - return getDocument().hasAspect(ContentModel.ASPECT_INLINEEDITABLE); + return getDocument().hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE); } /** @@ -484,10 +485,10 @@ public class DocumentDetailsBean extends BaseDetailsBean MimetypeMap.MIMETYPE_TEXT_CSS.equals(contentType) || MimetypeMap.MIMETYPE_JAVASCRIPT.equals(contentType)) { - props.put(ContentModel.PROP_EDITINLINE, true); + props.put(ApplicationModel.PROP_EDITINLINE, true); } } - this.nodeService.addAspect(getDocument().getNodeRef(), ContentModel.ASPECT_INLINEEDITABLE, props); + this.nodeService.addAspect(getDocument().getNodeRef(), ApplicationModel.ASPECT_INLINEEDITABLE, props); // commit the transaction tx.commit(); diff --git a/source/java/org/alfresco/web/bean/SpaceDetailsBean.java b/source/java/org/alfresco/web/bean/SpaceDetailsBean.java index 5e3bc342a0..a22d873297 100644 --- a/source/java/org/alfresco/web/bean/SpaceDetailsBean.java +++ b/source/java/org/alfresco/web/bean/SpaceDetailsBean.java @@ -27,6 +27,7 @@ import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.TemplateNode; @@ -119,7 +120,7 @@ public class SpaceDetailsBean extends BaseDetailsBean protected Node getLinkResolvedNode() { Node space = getSpace(); - if (ContentModel.TYPE_FOLDERLINK.equals(space.getType())) + if (ApplicationModel.TYPE_FOLDERLINK.equals(space.getType())) { NodeRef destRef = (NodeRef)space.getProperties().get(ContentModel.PROP_LINK_DESTINATION); if (nodeService.exists(destRef)) @@ -483,8 +484,8 @@ public class SpaceDetailsBean extends BaseDetailsBean */ public static boolean hasRSSFeed(Node space) { - return (space.hasAspect(ContentModel.ASPECT_FEEDSOURCE) && - space.getProperties().get(ContentModel.PROP_FEEDTEMPLATE) != null); + return (space.hasAspect(ApplicationModel.ASPECT_FEEDSOURCE) && + space.getProperties().get(ApplicationModel.PROP_FEEDTEMPLATE) != null); } /** @@ -508,7 +509,7 @@ public class SpaceDetailsBean extends BaseDetailsBean // add the guest=true URL parameter - this is required for no login access and // add the mimetype=text/xml URL parameter - required to return correct stream type return GuestTemplateContentServlet.generateURL(space.getNodeRef(), - (NodeRef)space.getProperties().get(ContentModel.PROP_FEEDTEMPLATE)) + (NodeRef)space.getProperties().get(ApplicationModel.PROP_FEEDTEMPLATE)) + "/rss.xml?mimetype=text%2Fxml"; } @@ -518,7 +519,7 @@ public class SpaceDetailsBean extends BaseDetailsBean public String getRSSTemplate() { // return current template if it exists - NodeRef ref = (NodeRef)getNode().getProperties().get(ContentModel.PROP_FEEDTEMPLATE); + NodeRef ref = (NodeRef)getNode().getProperties().get(ApplicationModel.PROP_FEEDTEMPLATE); return ref != null ? ref.getId() : this.rssTemplate; } @@ -540,16 +541,16 @@ public class SpaceDetailsBean extends BaseDetailsBean try { // apply the feedsource aspect if required - if (getNode().hasAspect(ContentModel.ASPECT_FEEDSOURCE) == false) + if (getNode().hasAspect(ApplicationModel.ASPECT_FEEDSOURCE) == false) { - this.nodeService.addAspect(getNode().getNodeRef(), ContentModel.ASPECT_FEEDSOURCE, null); + this.nodeService.addAspect(getNode().getNodeRef(), ApplicationModel.ASPECT_FEEDSOURCE, null); } // get the selected template Id from the Template Picker NodeRef templateRef = new NodeRef(Repository.getStoreRef(), this.rssTemplate); // set the template NodeRef into the templatable aspect property - this.nodeService.setProperty(getNode().getNodeRef(), ContentModel.PROP_FEEDTEMPLATE, templateRef); + this.nodeService.setProperty(getNode().getNodeRef(), ApplicationModel.PROP_FEEDTEMPLATE, templateRef); // reset node details for next refresh of details page getNode().reset(); @@ -570,8 +571,8 @@ public class SpaceDetailsBean extends BaseDetailsBean try { // clear template property - this.nodeService.setProperty(getNode().getNodeRef(), ContentModel.PROP_FEEDTEMPLATE, null); - this.nodeService.removeAspect(getNode().getNodeRef(), ContentModel.ASPECT_FEEDSOURCE); + this.nodeService.setProperty(getNode().getNodeRef(), ApplicationModel.PROP_FEEDTEMPLATE, null); + this.nodeService.removeAspect(getNode().getNodeRef(), ApplicationModel.ASPECT_FEEDSOURCE); // reset node details for next refresh of details page getNode().reset(); diff --git a/source/java/org/alfresco/web/bean/clipboard/ClipboardBean.java b/source/java/org/alfresco/web/bean/clipboard/ClipboardBean.java index a707d316c7..a491670828 100644 --- a/source/java/org/alfresco/web/bean/clipboard/ClipboardBean.java +++ b/source/java/org/alfresco/web/bean/clipboard/ClipboardBean.java @@ -27,6 +27,7 @@ import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.search.QueryParameterDefImpl; import org.alfresco.service.ServiceRegistry; @@ -284,7 +285,7 @@ public class ClipboardBean destRef, ContentModel.ASSOC_CONTAINS, assocRef.getQName(), - ContentModel.TYPE_FILELINK, + ApplicationModel.TYPE_FILELINK, props); // apply the titled aspect - title and description @@ -300,15 +301,15 @@ public class ClipboardBean destRef, ContentModel.ASSOC_CONTAINS, assocRef.getQName(), - ContentModel.TYPE_FOLDERLINK, + ApplicationModel.TYPE_FOLDERLINK, props); // apply the uifacets aspect - icon, title and description props Map uiFacetsProps = new HashMap(4, 1.0f); - uiFacetsProps.put(ContentModel.PROP_ICON, "space-icon-link"); + uiFacetsProps.put(ApplicationModel.PROP_ICON, "space-icon-link"); uiFacetsProps.put(ContentModel.PROP_TITLE, name); uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, name); - this.nodeService.addAspect(childRef.getChildRef(), ContentModel.ASPECT_UIFACETS, uiFacetsProps); + this.nodeService.addAspect(childRef.getChildRef(), ApplicationModel.ASPECT_UIFACETS, uiFacetsProps); } // if we get here without an exception, the clipboard link operation was successful diff --git a/source/java/org/alfresco/web/bean/content/BaseContentWizard.java b/source/java/org/alfresco/web/bean/content/BaseContentWizard.java index 8d25ea414f..60f138b79a 100644 --- a/source/java/org/alfresco/web/bean/content/BaseContentWizard.java +++ b/source/java/org/alfresco/web/bean/content/BaseContentWizard.java @@ -13,6 +13,7 @@ import javax.faces.model.SelectItem; import org.alfresco.config.Config; import org.alfresco.config.ConfigElement; import org.alfresco.config.ConfigService; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.ServiceRegistry; import org.alfresco.service.cmr.dictionary.TypeDefinition; @@ -371,8 +372,8 @@ public abstract class BaseContentWizard extends BaseWizardBean if (this.inlineEdit == true) { Map editProps = new HashMap(1, 1.0f); - editProps.put(ContentModel.PROP_EDITINLINE, this.inlineEdit); - this.nodeService.addAspect(fileNodeRef, ContentModel.ASPECT_INLINEEDITABLE, editProps); + editProps.put(ApplicationModel.PROP_EDITINLINE, this.inlineEdit); + this.nodeService.addAspect(fileNodeRef, ApplicationModel.ASPECT_INLINEEDITABLE, editProps); if (logger.isDebugEnabled()) logger.debug("Added inlineeditable aspect with properties: " + editProps); diff --git a/source/java/org/alfresco/web/bean/forums/CreateDiscussionDialog.java b/source/java/org/alfresco/web/bean/forums/CreateDiscussionDialog.java index 6bf649df91..3cace0c870 100644 --- a/source/java/org/alfresco/web/bean/forums/CreateDiscussionDialog.java +++ b/source/java/org/alfresco/web/bean/forums/CreateDiscussionDialog.java @@ -9,10 +9,12 @@ import javax.faces.context.FacesContext; import javax.transaction.UserTransaction; import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.model.ForumModel; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.QName; import org.alfresco.web.app.AlfrescoNavigationHandler; import org.alfresco.web.app.Application; @@ -107,15 +109,15 @@ public class CreateDiscussionDialog extends CreateTopicDialog forumProps.put(ContentModel.PROP_NAME, forumName); ChildAssociationRef childRef = this.nodeService.createNode(this.discussingNodeRef, ForumModel.ASSOC_DISCUSSION, - QName.createQName(ForumModel.FORUMS_MODEL_URI, "discussion"), + QName.createQName(NamespaceService.FORUMS_MODEL_1_0_URI, "discussion"), ForumModel.TYPE_FORUM, forumProps); forumNodeRef = childRef.getChildRef(); // apply the uifacets aspect Map uiFacetsProps = new HashMap(5); - uiFacetsProps.put(ContentModel.PROP_ICON, "forum"); - this.nodeService.addAspect(forumNodeRef, ContentModel.ASPECT_UIFACETS, uiFacetsProps); + uiFacetsProps.put(ApplicationModel.PROP_ICON, "forum"); + this.nodeService.addAspect(forumNodeRef, ApplicationModel.ASPECT_UIFACETS, uiFacetsProps); if (logger.isDebugEnabled()) logger.debug("created forum for content: " + this.discussingNodeRef.toString()); diff --git a/source/java/org/alfresco/web/bean/forums/CreateTopicDialog.java b/source/java/org/alfresco/web/bean/forums/CreateTopicDialog.java index 5e3529d038..29608ed9ae 100644 --- a/source/java/org/alfresco/web/bean/forums/CreateTopicDialog.java +++ b/source/java/org/alfresco/web/bean/forums/CreateTopicDialog.java @@ -6,6 +6,7 @@ import java.util.Map; import javax.faces.context.FacesContext; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.model.ForumModel; import org.alfresco.service.cmr.model.FileInfo; @@ -74,8 +75,8 @@ public class CreateTopicDialog extends CreateSpaceDialog logger.debug("Added titled aspect with properties: " + titledProps); Map editProps = new HashMap(1, 1.0f); - editProps.put(ContentModel.PROP_EDITINLINE, true); - this.nodeService.addAspect(postNodeRef, ContentModel.ASPECT_INLINEEDITABLE, editProps); + editProps.put(ApplicationModel.PROP_EDITINLINE, true); + this.nodeService.addAspect(postNodeRef, ApplicationModel.ASPECT_INLINEEDITABLE, editProps); if (logger.isDebugEnabled()) logger.debug("Added inlineeditable aspect with properties: " + editProps); diff --git a/source/java/org/alfresco/web/bean/repository/User.java b/source/java/org/alfresco/web/bean/repository/User.java index 027ded644d..1a3b4d38ec 100644 --- a/source/java/org/alfresco/web/bean/repository/User.java +++ b/source/java/org/alfresco/web/bean/repository/User.java @@ -22,6 +22,7 @@ import java.util.Map; import javax.faces.context.FacesContext; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.configuration.ConfigurableService; import org.alfresco.service.ServiceRegistry; @@ -175,7 +176,7 @@ public final class User ConfigurableService configurableService = Repository.getConfigurableService(fc); NodeRef person = Application.getCurrentUser(fc).getPerson(); - if (nodeService.hasAspect(person, ContentModel.ASPECT_CONFIGURABLE) == false) + if (nodeService.hasAspect(person, ApplicationModel.ASPECT_CONFIGURABLE) == false) { // create the configuration folder for this Person node configurableService.makeConfigurable(person); diff --git a/source/java/org/alfresco/web/bean/spaces/CreateSpaceWizard.java b/source/java/org/alfresco/web/bean/spaces/CreateSpaceWizard.java index dfcfbd75f1..15e857f0b4 100644 --- a/source/java/org/alfresco/web/bean/spaces/CreateSpaceWizard.java +++ b/source/java/org/alfresco/web/bean/spaces/CreateSpaceWizard.java @@ -13,6 +13,7 @@ import javax.faces.model.SelectItem; import org.alfresco.config.Config; import org.alfresco.config.ConfigElement; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.dictionary.TypeDefinition; import org.alfresco.service.cmr.model.FileExistsException; @@ -144,10 +145,10 @@ public class CreateSpaceWizard extends BaseWizardBean // apply the uifacets aspect - icon, title and description props Map uiFacetsProps = new HashMap(5); - uiFacetsProps.put(ContentModel.PROP_ICON, this.icon); + uiFacetsProps.put(ApplicationModel.PROP_ICON, this.icon); uiFacetsProps.put(ContentModel.PROP_TITLE, this.title); uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, this.description); - this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, uiFacetsProps); + this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, uiFacetsProps); if (logger.isDebugEnabled()) logger.debug("Added uifacets aspect with properties: " + uiFacetsProps); @@ -167,7 +168,7 @@ public class CreateSpaceWizard extends BaseWizardBean // also need to set the new title, description and icon properties this.nodeService.setProperty(copiedNode, ContentModel.PROP_TITLE, this.title); this.nodeService.setProperty(copiedNode, ContentModel.PROP_DESCRIPTION, this.description); - this.nodeService.setProperty(copiedNode, ContentModel.PROP_ICON, this.icon); + this.nodeService.setProperty(copiedNode, ApplicationModel.PROP_ICON, this.icon); newSpaceId = copiedNode.getId(); @@ -187,7 +188,7 @@ public class CreateSpaceWizard extends BaseWizardBean // also need to set the new title, description and icon properties this.nodeService.setProperty(copiedNode, ContentModel.PROP_TITLE, this.title); this.nodeService.setProperty(copiedNode, ContentModel.PROP_DESCRIPTION, this.description); - this.nodeService.setProperty(copiedNode, ContentModel.PROP_ICON, this.icon); + this.nodeService.setProperty(copiedNode, ApplicationModel.PROP_ICON, this.icon); newSpaceId = copiedNode.getId(); diff --git a/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java b/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java index 73664eaeda..48693b05af 100644 --- a/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java +++ b/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java @@ -6,6 +6,7 @@ import java.util.Map; import javax.faces.context.FacesContext; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.PropertyDefinition; @@ -73,9 +74,9 @@ public class EditSpaceDialog extends CreateSpaceDialog Map repoProps = this.nodeService.getProperties(nodeRef); // add the "uifacets" aspect if required, properties will get set below - if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_UIFACETS) == false) + if (this.nodeService.hasAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS) == false) { - this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, null); + this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null); } // overwrite the current properties with the edited ones diff --git a/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java b/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java index 82d5f45962..ca1f3d9a72 100644 --- a/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java +++ b/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java @@ -31,7 +31,7 @@ import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; -import org.alfresco.model.ContentModel; +import org.alfresco.model.WCMAppModel; import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.avm.actions.AVMRevertStoreAction; import org.alfresco.repo.avm.actions.AVMUndoSandboxListAction; @@ -290,7 +290,7 @@ public class AVMBrowseBean implements IContextListener FacesContext fc = FacesContext.getCurrentInstance(); ResourceBundle msg = Application.getBundle(fc); Node websiteNode = this.navigator.getCurrentNode(); - String storeRoot = (String)websiteNode.getProperties().get(ContentModel.PROP_AVMSTORE); + String storeRoot = (String)websiteNode.getProperties().get(WCMAppModel.PROP_AVMSTORE); String stagingStore = getStagingStore(); AVMStoreDescriptor store = this.avmService.getAVMStore(stagingStore); if (store != null) @@ -319,7 +319,7 @@ public class AVMBrowseBean implements IContextListener public String getStagingStore() { Node websiteNode = this.navigator.getCurrentNode(); - String storeRoot = (String)websiteNode.getProperties().get(ContentModel.PROP_AVMSTORE); + String storeRoot = (String)websiteNode.getProperties().get(WCMAppModel.PROP_AVMSTORE); return AVMConstants.buildAVMStagingStoreName(storeRoot); } @@ -511,7 +511,7 @@ public class AVMBrowseBean implements IContextListener { if (this.currentPath == null) { - String webapp = (String)getWebsite().getProperties().get(ContentModel.PROP_DEFAULTWEBAPP); + String webapp = (String)getWebsite().getProperties().get(WCMAppModel.PROP_DEFAULTWEBAPP); this.currentPath = AVMConstants.buildAVMStoreWebappPath(getSandbox(), webapp); } return this.currentPath; @@ -582,12 +582,12 @@ public class AVMBrowseBean implements IContextListener String currentUser = user.getUserName(); Node websiteNode = this.navigator.getCurrentNode(); List userInfoRefs = this.nodeService.getChildAssocs( - websiteNode.getNodeRef(), ContentModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); + websiteNode.getNodeRef(), WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); for (ChildAssociationRef ref : userInfoRefs) { NodeRef userInfoRef = ref.getChildRef(); - String username = (String)nodeService.getProperty(userInfoRef, ContentModel.PROP_WEBUSERNAME); - String userrole = (String)nodeService.getProperty(userInfoRef, ContentModel.PROP_WEBUSERROLE); + String username = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME); + String userrole = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE); if (currentUser.equals(username) && ROLE_CONTENT_MANAGER.equals(userrole)) { isManager = true; @@ -732,7 +732,7 @@ public class AVMBrowseBean implements IContextListener { // get the staging store from the current website node setSandbox(AVMConstants.buildAVMStagingStoreName( - (String)getWebsite().getProperties().get(ContentModel.PROP_AVMSTORE))); + (String)getWebsite().getProperties().get(WCMAppModel.PROP_AVMSTORE))); } this.sandboxTitle = null; @@ -1087,6 +1087,9 @@ public class AVMBrowseBean implements IContextListener Map params = link.getParameterMap(); String id = params.get(UIUserSandboxes.PARAM_FORM_ID); + // setup the correct sandbox for the create action + setupSandboxAction(event); + // pass form ID to the wizard - to be picked up in init() FacesContext fc = FacesContext.getCurrentInstance(); WizardManager manager = (WizardManager)FacesHelper.getManagedBean(fc, "WizardManager"); diff --git a/source/java/org/alfresco/web/bean/wcm/AVMConstants.java b/source/java/org/alfresco/web/bean/wcm/AVMConstants.java index ac0ba807fc..7797458cdd 100644 --- a/source/java/org/alfresco/web/bean/wcm/AVMConstants.java +++ b/source/java/org/alfresco/web/bean/wcm/AVMConstants.java @@ -26,6 +26,7 @@ import javax.faces.context.FacesContext; import org.alfresco.repo.domain.PropertyValue; import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.namespace.QName; +import org.alfresco.util.ParameterCheck; import org.alfresco.web.app.Application; import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.config.ClientConfigElement; @@ -44,36 +45,76 @@ public final class AVMConstants public static String buildAVMStagingStoreName(String store) { + if (store == null || store.length() == 0) + { + throw new IllegalArgumentException("Store name is mandatory."); + } return store + AVMConstants.STORE_STAGING; } public static String buildAVMStagingPreviewStoreName(String store) { + if (store == null || store.length() == 0) + { + throw new IllegalArgumentException("Store name is mandatory."); + } return store + AVMConstants.STORE_PREVIEW; } public static String buildAVMUserMainStoreName(String store, String username) { + if (store == null || store.length() == 0) + { + throw new IllegalArgumentException("Store name is mandatory."); + } + if (username == null || username.length() == 0) + { + throw new IllegalArgumentException("Username is mandatory."); + } return store + '-' + username + AVMConstants.STORE_MAIN; } public static String buildAVMUserPreviewStoreName(String store, String username) { + if (store == null || store.length() == 0) + { + throw new IllegalArgumentException("Store name is mandatory."); + } + if (username == null || username.length() == 0) + { + throw new IllegalArgumentException("Username is mandatory."); + } return store + '-' + username + AVMConstants.STORE_PREVIEW; } public static String buildAVMStoreRootPath(String store) { + if (store == null || store.length() == 0) + { + throw new IllegalArgumentException("Store name is mandatory."); + } return store + ":/" + DIR_APPBASE + '/' + DIR_WEBAPPS; } public static String buildAVMStoreWebappPath(String store, String webapp) { + if (store == null || store.length() == 0) + { + throw new IllegalArgumentException("Store name is mandatory."); + } + if (webapp == null || webapp.length() == 0) + { + throw new IllegalArgumentException("Webapp name is mandatory."); + } return store + ":/" + DIR_APPBASE + '/' + DIR_WEBAPPS + '/' + webapp; } public static String buildAVMStoreUrl(String store) { + if (store == null || store.length() == 0) + { + throw new IllegalArgumentException("Store name is mandatory."); + } if (store.indexOf(':') != -1) { store = store.substring(0, store.indexOf(':')); @@ -84,6 +125,10 @@ public final class AVMConstants public static String buildAVMAssetUrl(final String avmPath) { + if (avmPath == null || avmPath.length() == 0) + { + throw new IllegalArgumentException("AVM path is mandatory."); + } final String[] s = avmPath.split(":"); if (s.length != 2) { @@ -94,12 +139,28 @@ public final class AVMConstants public static String buildAVMAssetUrl(String store, String assetPath) { + if (store == null || store.length() == 0) + { + throw new IllegalArgumentException("Store name is mandatory."); + } + if (assetPath == null || assetPath.length() == 0) + { + throw new IllegalArgumentException("Asset path is mandatory."); + } ClientConfigElement config = Application.getClientConfig(FacesContext.getCurrentInstance()); return buildAVMAssetUrl(assetPath, config.getWCMDomain(), config.getWCMPort(), lookupStoreDNS(store)); } public static String buildAVMAssetUrl(String assetPath, String domain, String port, String dns) { + if (domain == null || port == null || dns == null) + { + throw new IllegalArgumentException("Domain, port and dns name are mandatory."); + } + if (assetPath == null || assetPath.length() == 0) + { + throw new IllegalArgumentException("Asset path is mandatory."); + } if (assetPath.startsWith('/' + DIR_APPBASE + '/' + DIR_WEBAPPS)) { assetPath = assetPath.substring(('/' + DIR_APPBASE + '/' + DIR_WEBAPPS).length()); @@ -118,6 +179,11 @@ public final class AVMConstants public static String lookupStoreDNS(String store) { + if (store == null || store.length() == 0) + { + throw new IllegalArgumentException("Store name is mandatory."); + } + String dns = null; AVMService avmService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAVMService(); diff --git a/source/java/org/alfresco/web/bean/wcm/AVMEditBean.java b/source/java/org/alfresco/web/bean/wcm/AVMEditBean.java index f6ff1db0c1..9e62d54931 100644 --- a/source/java/org/alfresco/web/bean/wcm/AVMEditBean.java +++ b/source/java/org/alfresco/web/bean/wcm/AVMEditBean.java @@ -24,7 +24,7 @@ import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; import org.alfresco.model.ContentModel; -import org.alfresco.model.WCMModel; +import org.alfresco.model.WCMAppModel; import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.content.MimetypeMap; import org.alfresco.service.cmr.avm.AVMService; @@ -214,7 +214,7 @@ public class AVMEditBean { final NodeRef ttNodeRef = (NodeRef) this.nodeService.getProperty(this.getAvmNode().getNodeRef(), - WCMModel.PROP_PARENT_FORM); + WCMAppModel.PROP_PARENT_FORM); final FormsService ts = FormsService.getInstance(); return ts.getForm(ttNodeRef); } @@ -265,11 +265,11 @@ public class AVMEditBean // retrieve the content reader for this node NodeRef avmRef = AVMNodeConverter.ToNodeRef(-1, getAvmNode().getPath()); - if (this.nodeService.hasAspect(avmRef, WCMModel.ASPECT_RENDITION)) + if (this.nodeService.hasAspect(avmRef, WCMAppModel.ASPECT_RENDITION)) { if (LOGGER.isDebugEnabled()) LOGGER.debug(avmRef + " is a rendition, editing primary rendition instead"); - avmRef = (NodeRef)this.nodeService.getProperty(avmRef, WCMModel.PROP_PRIMARY_FORM_INSTANCE_DATA); + avmRef = (NodeRef)this.nodeService.getProperty(avmRef, WCMAppModel.PROP_PRIMARY_FORM_INSTANCE_DATA); final Pair p = AVMNodeConverter.ToAVMVersionPath(avmRef); if (LOGGER.isDebugEnabled()) @@ -295,7 +295,7 @@ public class AVMEditBean // navigate to appropriate screen outcome = ((MimetypeMap.MIMETYPE_XML.equals(mimetype) && - this.nodeService.hasAspect(avmRef, WCMModel.ASPECT_FORM_INSTANCE_DATA)) + this.nodeService.hasAspect(avmRef, WCMAppModel.ASPECT_FORM_INSTANCE_DATA)) ? "dialog:editAvmXmlInline" : "dialog:editAvmTextInline"); } @@ -363,7 +363,7 @@ public class AVMEditBean tx.commit(); // regenerate form content - if (nodeService.hasAspect(avmRef, WCMModel.ASPECT_FORM_INSTANCE_DATA)) + if (nodeService.hasAspect(avmRef, WCMAppModel.ASPECT_FORM_INSTANCE_DATA)) { final FormsService fs = FormsService.getInstance(); fs.regenerateRenditions(avmRef); diff --git a/source/java/org/alfresco/web/bean/wcm/CreateFolderDialog.java b/source/java/org/alfresco/web/bean/wcm/CreateFolderDialog.java index 9818fe20d0..da549a834c 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateFolderDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateFolderDialog.java @@ -20,6 +20,7 @@ import java.util.Map; import javax.faces.context.FacesContext; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.service.cmr.avm.AVMService; @@ -119,7 +120,7 @@ public class CreateFolderDialog extends BaseDialogBean String path = parent + '/' + this.name; NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, path); - this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, null); + this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null); if (this.description != null && this.description.length() != 0) { this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, this.description); diff --git a/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java index c5e6e10ef1..d7ba4f3e06 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java @@ -33,7 +33,7 @@ import javax.faces.model.ListDataModel; import javax.faces.model.SelectItem; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.model.ContentModel; -import org.alfresco.model.WCMModel; +import org.alfresco.model.WCMAppModel; import org.alfresco.repo.content.MimetypeMap; import org.alfresco.service.cmr.model.FileInfo; import org.alfresco.service.cmr.model.FileExistsException; @@ -194,16 +194,16 @@ public class CreateFormWizard this.nodeService.addAspect(folderInfo.getNodeRef(), ContentModel.ASPECT_TITLED, props); props = new HashMap(3, 1.0f); - props.put(WCMModel.PROP_XML_SCHEMA, fileInfo.getNodeRef()); - props.put(WCMModel.PROP_XML_SCHEMA_ROOT_ELEMENT_NAME, + props.put(WCMAppModel.PROP_XML_SCHEMA, fileInfo.getNodeRef()); + props.put(WCMAppModel.PROP_XML_SCHEMA_ROOT_ELEMENT_NAME, this.getSchemaRootElementName()); - props.put(WCMModel.PROP_OUTPUT_PATH_PATTERN_FOR_FORM_INSTANCE_DATA, + props.put(WCMAppModel.PROP_OUTPUT_PATH_PATTERN_FORM_INSTANCE_DATA, this.getOutputPathPatternForFormInstanceData()); if (this.defaultWorkflowName != null) { - props.put(WCMModel.PROP_DEFAULT_WORKFLOW_NAME, this.defaultWorkflowName); + props.put(WCMAppModel.PROP_DEFAULT_WORKFLOW_NAME, this.defaultWorkflowName); } - this.nodeService.addAspect(folderInfo.getNodeRef(), WCMModel.ASPECT_FORM, props); + this.nodeService.addAspect(folderInfo.getNodeRef(), WCMAppModel.ASPECT_FORM, props); for (RenderingEngineTemplateData retd : this.renderingEngineTemplates) { @@ -242,26 +242,26 @@ public class CreateFormWizard this.nodeService.createAssociation(folderInfo.getNodeRef(), renderingEngineTemplateNodeRef, - WCMModel.ASSOC_RENDERING_ENGINE_TEMPLATES); + WCMAppModel.ASSOC_RENDERING_ENGINE_TEMPLATES); props = new HashMap(2, 1.0f); - props.put(WCMModel.PROP_PARENT_RENDERING_ENGINE_NAME, + props.put(WCMAppModel.PROP_PARENT_RENDERING_ENGINE_NAME, retd.getRenderingEngine().getName()); - props.put(WCMModel.PROP_FORM_SOURCE, folderInfo.getNodeRef()); + props.put(WCMAppModel.PROP_FORM_SOURCE, folderInfo.getNodeRef()); this.nodeService.addAspect(renderingEngineTemplateNodeRef, - WCMModel.ASPECT_RENDERING_ENGINE_TEMPLATE, + WCMAppModel.ASPECT_RENDERING_ENGINE_TEMPLATE, props); } LOGGER.debug("adding rendition properties to " + renderingEngineTemplateNodeRef); props = new HashMap(2, 1.0f); - props.put(WCMModel.PROP_OUTPUT_PATH_PATTERN_FOR_RENDITION, + props.put(WCMAppModel.PROP_OUTPUT_PATH_PATTERN_RENDITION, retd.getOutputPathPatternForRendition()); - props.put(WCMModel.PROP_MIMETYPE_FOR_RENDITION, + props.put(WCMAppModel.PROP_MIMETYPE_FOR_RENDITION, retd.getMimetypeForRendition()); this.nodeService.createNode(renderingEngineTemplateNodeRef, - WCMModel.ASSOC_RENDITION_PROPERTIES, - WCMModel.ASSOC_RENDITION_PROPERTIES, - WCMModel.TYPE_RENDITION_PROPERTIES, + WCMAppModel.ASSOC_RENDITION_PROPERTIES, + WCMAppModel.ASSOC_RENDITION_PROPERTIES, + WCMAppModel.TYPE_RENDITION_PROPERTIES, props); } // return the default outcome diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java index 95546821d8..2b98c336c0 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java @@ -31,6 +31,7 @@ import org.alfresco.config.Config; import org.alfresco.config.ConfigElement; import org.alfresco.config.ConfigService; import org.alfresco.model.ContentModel; +import org.alfresco.model.WCMAppModel; import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.workflow.WorkflowModel; @@ -143,7 +144,7 @@ public class CreateWebContentWizard extends BaseContentWizard // it is used to init the dialog to a specific template String webFormId = parameters.get(UIUserSandboxes.PARAM_FORM_ID); NodeRef webFormRef = new NodeRef(Repository.getStoreRef(), webFormId); - String formName = (String)this.nodeService.getProperty(webFormRef, ContentModel.PROP_FORMNAME); + String formName = (String)this.nodeService.getProperty(webFormRef, WCMAppModel.PROP_FORMNAME); Form form = FormsService.getInstance().getForm(formName); if (form != null) { @@ -181,17 +182,17 @@ public class CreateWebContentWizard extends BaseContentWizard { final Node website = this.avmBrowseBean.getWebsite(); final List webFormRefs = this.nodeService.getChildAssocs( - website.getNodeRef(), ContentModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL); + website.getNodeRef(), WCMAppModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL); for (ChildAssociationRef ref : webFormRefs) { final String formName = (String) - this.nodeService.getProperty(ref.getChildRef(), ContentModel.PROP_FORMNAME); + this.nodeService.getProperty(ref.getChildRef(), WCMAppModel.PROP_FORMNAME); if (formName.equals(this.getForm().getName())) { System.err.println("loading workflowRefs for " + formName); final List workflowRefs = this.nodeService.getChildAssocs(ref.getChildRef(), - ContentModel.ASSOC_WORKFLOWDEFAULTS, + WCMAppModel.ASSOC_WORKFLOWDEFAULTS, RegexQNamePattern.MATCH_ALL); if (workflowRefs.size() == 0) { @@ -203,7 +204,7 @@ public class CreateWebContentWizard extends BaseContentWizard } final NodeRef workflowRef = workflowRefs.get(0).getChildRef(); - final String workflowName = (String)this.nodeService.getProperty(workflowRef, ContentModel.PROP_WORKFLOW_NAME); + final String workflowName = (String)this.nodeService.getProperty(workflowRef, WCMAppModel.PROP_WORKFLOW_NAME); if (workflowName == null) { throw new RuntimeException("no workflow found for form " + formName); @@ -212,7 +213,7 @@ public class CreateWebContentWizard extends BaseContentWizard wd = this.workflowService.getDefinitionByName("jbpm$" + workflowName); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - final ContentReader cr = this.contentService.getReader(workflowRef, ContentModel.PROP_WORKFLOWDEFAULTS); + final ContentReader cr = this.contentService.getReader(workflowRef, WCMAppModel.PROP_WORKFLOWDEFAULTS); if (cr == null) { parameters = new HashMap(); @@ -381,12 +382,12 @@ public class CreateWebContentWizard extends BaseContentWizard throw new IllegalStateException("CreateWebContentWizard must be called within a Web Project context!"); } final List webFormRefs = this.nodeService.getChildAssocs( - website.getNodeRef(), ContentModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL); + website.getNodeRef(), WCMAppModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL); final List items = new ArrayList(webFormRefs.size()); for (ChildAssociationRef ref : webFormRefs) { final String formName = (String) - this.nodeService.getProperty(ref.getChildRef(), ContentModel.PROP_FORMNAME); + this.nodeService.getProperty(ref.getChildRef(), WCMAppModel.PROP_FORMNAME); final Form form = FormsService.getInstance().getForm(formName); if (form != null) { diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java index 973d8776bc..13cb658080 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java @@ -35,7 +35,9 @@ import javax.faces.model.DataModel; import javax.faces.model.ListDataModel; import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; +import org.alfresco.model.WCMAppModel; import org.alfresco.repo.content.MimetypeMap; import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.model.FileInfo; @@ -152,7 +154,7 @@ public class CreateWebsiteWizard extends BaseWizardBean FileInfo fileInfo = this.fileFolderService.create( new NodeRef(Repository.getStoreRef(), websiteParentId), this.name, - ContentModel.TYPE_AVMWEBFOLDER); + WCMAppModel.TYPE_AVMWEBFOLDER); NodeRef nodeRef = fileInfo.getNodeRef(); if (logger.isDebugEnabled()) @@ -162,14 +164,14 @@ public class CreateWebsiteWizard extends BaseWizardBean // apply the uifacets aspect - icon, title and description props Map uiFacetsProps = new HashMap(4); - uiFacetsProps.put(ContentModel.PROP_ICON, AVMConstants.SPACE_ICON_WEBSITE); + uiFacetsProps.put(ApplicationModel.PROP_ICON, AVMConstants.SPACE_ICON_WEBSITE); uiFacetsProps.put(ContentModel.PROP_TITLE, this.title); uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, this.description); - this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, uiFacetsProps); + this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, uiFacetsProps); // set the default webapp name for the project String webapp = (this.webapp != null && this.webapp.length() != 0) ? this.webapp : WEBAPP_DEFAULT; - this.nodeService.setProperty(nodeRef, ContentModel.PROP_DEFAULTWEBAPP, webapp); + this.nodeService.setProperty(nodeRef, WCMAppModel.PROP_DEFAULTWEBAPP, webapp); // call a delegate wizard bean to provide invite user functionality InviteWebsiteUsersWizard wiz = getInviteUsersWizard(); @@ -189,7 +191,7 @@ public class CreateWebsiteWizard extends BaseWizardBean this.avmService.createDirectory(AVMConstants.buildAVMStoreRootPath(stagingStore), webapp); // set the property on the node to reference the root AVM store - this.nodeService.setProperty(nodeRef, ContentModel.PROP_AVMSTORE, avmStore); + this.nodeService.setProperty(nodeRef, WCMAppModel.PROP_AVMSTORE, avmStore); // persist the forms, templates, workflows and workflow defaults to the model for this web project saveWebProjectModel(nodeRef); @@ -215,11 +217,11 @@ public class CreateWebsiteWizard extends BaseWizardBean for (FormWrapper form : this.forms) { // create web form with name as per the name of the form object in the DD - props.put(ContentModel.PROP_FORMNAME, form.getName()); + props.put(WCMAppModel.PROP_FORMNAME, form.getName()); NodeRef formRef = this.nodeService.createNode(nodeRef, - ContentModel.ASSOC_WEBFORM, - ContentModel.ASSOC_WEBFORM, - ContentModel.TYPE_WEBFORM, + WCMAppModel.ASSOC_WEBFORM, + WCMAppModel.ASSOC_WEBFORM, + WCMAppModel.TYPE_WEBFORM, props).getChildRef(); // add title aspect for user defined title and description labels @@ -232,8 +234,8 @@ public class CreateWebsiteWizard extends BaseWizardBean if (form.getFilenamePattern() != null) { props.clear(); - props.put(ContentModel.PROP_FILENAMEPATTERN, form.getFilenamePattern()); - this.nodeService.addAspect(formRef, ContentModel.ASPECT_FILENAMEPATTERN, props); + props.put(WCMAppModel.PROP_FILENAMEPATTERN, form.getFilenamePattern()); + this.nodeService.addAspect(formRef, WCMAppModel.ASPECT_FILENAMEPATTERN, props); } // associate to workflow defaults if any are present @@ -241,11 +243,11 @@ public class CreateWebsiteWizard extends BaseWizardBean { WorkflowWrapper workflow = form.getWorkflow(); props.clear(); - props.put(ContentModel.PROP_WORKFLOW_NAME, workflow.getName()); + props.put(WCMAppModel.PROP_WORKFLOW_NAME, workflow.getName()); NodeRef workflowRef = this.nodeService.createNode(formRef, - ContentModel.ASSOC_WORKFLOWDEFAULTS, - ContentModel.ASSOC_WORKFLOWDEFAULTS, - ContentModel.TYPE_WORKFLOWDEFAULTS, + WCMAppModel.ASSOC_WORKFLOWDEFAULTS, + WCMAppModel.ASSOC_WORKFLOWDEFAULTS, + WCMAppModel.TYPE_WORKFLOWDEFAULTS, props).getChildRef(); // persist workflow default params @@ -259,19 +261,19 @@ public class CreateWebsiteWizard extends BaseWizardBean for (PresentationTemplate template : form.getTemplates()) { props.clear(); - props.put(ContentModel.PROP_ENGINE, template.getRenderingEngineTemplate().getNodeRef()); + props.put(WCMAppModel.PROP_ENGINE, template.getRenderingEngineTemplate().getNodeRef()); NodeRef templateRef = this.nodeService.createNode(formRef, - ContentModel.ASSOC_WEBFORMTEMPLATE, - ContentModel.ASSOC_WEBFORMTEMPLATE, - ContentModel.TYPE_WEBFORMTEMPLATE, + WCMAppModel.ASSOC_WEBFORMTEMPLATE, + WCMAppModel.ASSOC_WEBFORMTEMPLATE, + WCMAppModel.TYPE_WEBFORMTEMPLATE, props).getChildRef(); // add filename pattern aspect if a filename pattern has been applied if (template.getFilenamePattern() != null) { props.clear(); - props.put(ContentModel.PROP_FILENAMEPATTERN, template.getFilenamePattern()); - this.nodeService.addAspect(templateRef, ContentModel.ASPECT_FILENAMEPATTERN, props); + props.put(WCMAppModel.PROP_FILENAMEPATTERN, template.getFilenamePattern()); + this.nodeService.addAspect(templateRef, WCMAppModel.ASPECT_FILENAMEPATTERN, props); } } } @@ -282,9 +284,9 @@ public class CreateWebsiteWizard extends BaseWizardBean props.clear(); props.put(ContentModel.PROP_NAME, workflow.getName()); NodeRef workflowRef = this.nodeService.createNode(nodeRef, - ContentModel.ASSOC_WEBWORKFLOWDEFAULTS, - ContentModel.ASSOC_WEBWORKFLOWDEFAULTS, - ContentModel.TYPE_WEBWORKFLOWDEFAULTS, + WCMAppModel.ASSOC_WEBWORKFLOWDEFAULTS, + WCMAppModel.ASSOC_WEBWORKFLOWDEFAULTS, + WCMAppModel.TYPE_WEBWORKFLOWDEFAULTS, props).getChildRef(); // persist workflow default params @@ -297,8 +299,8 @@ public class CreateWebsiteWizard extends BaseWizardBean if (workflow.getFilenamePattern() != null) { props.clear(); - props.put(ContentModel.PROP_FILENAMEPATTERN, workflow.getFilenamePattern()); - this.nodeService.addAspect(workflowRef, ContentModel.ASPECT_FILENAMEPATTERN, props); + props.put(WCMAppModel.PROP_FILENAMEPATTERN, workflow.getFilenamePattern()); + this.nodeService.addAspect(workflowRef, WCMAppModel.ASPECT_FILENAMEPATTERN, props); } } } @@ -319,7 +321,7 @@ public class CreateWebsiteWizard extends BaseWizardBean oos.close(); // write the serialized Map as a binary content stream - like database blob! ContentService cs = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getContentService(); - ContentWriter writer = cs.getWriter(workflowRef, ContentModel.PROP_WORKFLOWDEFAULTS, true); + ContentWriter writer = cs.getWriter(workflowRef, WCMAppModel.PROP_WORKFLOWDEFAULTS, true); writer.setMimetype(MimetypeMap.MIMETYPE_BINARY); writer.putContent(new ByteArrayInputStream(baos.toByteArray())); } diff --git a/source/java/org/alfresco/web/bean/wcm/DeleteSandboxDialog.java b/source/java/org/alfresco/web/bean/wcm/DeleteSandboxDialog.java index 8b96d8470a..fc9e998bc0 100644 --- a/source/java/org/alfresco/web/bean/wcm/DeleteSandboxDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/DeleteSandboxDialog.java @@ -5,7 +5,7 @@ import java.util.List; import javax.faces.context.FacesContext; -import org.alfresco.model.ContentModel; +import org.alfresco.model.WCMAppModel; import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; @@ -63,17 +63,17 @@ public class DeleteSandboxDialog extends BaseDialogBean // remove the store reference from the website folder meta-data List userInfoRefs = this.nodeService.getChildAssocs( website.getNodeRef(), - ContentModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); + WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); for (ChildAssociationRef ref : userInfoRefs) { NodeRef userInfoRef = ref.getChildRef(); - String user = (String)nodeService.getProperty(userInfoRef, ContentModel.PROP_WEBUSERNAME); - String role = (String)nodeService.getProperty(userInfoRef, ContentModel.PROP_WEBUSERROLE); + String user = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME); + String role = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE); if (username.equals(user)) { // found the sandbox to remove - String storeRoot = (String)website.getProperties().get(ContentModel.PROP_AVMSTORE); + String storeRoot = (String)website.getProperties().get(WCMAppModel.PROP_AVMSTORE); // TODO: would it be better to use the .sandbox-id. property to delete all sandboxes? diff --git a/source/java/org/alfresco/web/bean/wcm/DeleteWebsiteDialog.java b/source/java/org/alfresco/web/bean/wcm/DeleteWebsiteDialog.java index 4f602dd6a5..4332c8b73a 100644 --- a/source/java/org/alfresco/web/bean/wcm/DeleteWebsiteDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/DeleteWebsiteDialog.java @@ -5,7 +5,7 @@ import java.util.List; import javax.faces.context.FacesContext; -import org.alfresco.model.ContentModel; +import org.alfresco.model.WCMAppModel; import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.namespace.RegexQNamePattern; @@ -47,14 +47,14 @@ public class DeleteWebsiteDialog extends DeleteSpaceDialog Node websiteNode = this.browseBean.getActionSpace(); // delete all attached website sandboxes in reverse order to the layering - String storeRoot = (String)websiteNode.getProperties().get(ContentModel.PROP_AVMSTORE); + String storeRoot = (String)websiteNode.getProperties().get(WCMAppModel.PROP_AVMSTORE); // get the list of users who have a sandbox in the website List userInfoRefs = nodeService.getChildAssocs( - websiteNode.getNodeRef(), ContentModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); + websiteNode.getNodeRef(), WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); for (ChildAssociationRef ref : userInfoRefs) { - String username = (String)nodeService.getProperty(ref.getChildRef(), ContentModel.PROP_WEBUSERNAME); + String username = (String)nodeService.getProperty(ref.getChildRef(), WCMAppModel.PROP_WEBUSERNAME); // delete the preview store for this user deleteStore(AVMConstants.buildAVMUserPreviewStoreName(storeRoot, username)); diff --git a/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java b/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java index e613da4de2..cd08348cad 100644 --- a/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java @@ -26,6 +26,7 @@ import java.util.Map; import javax.faces.context.FacesContext; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.service.cmr.avm.AVMService; @@ -98,9 +99,9 @@ public class EditFolderPropertiesDialog extends EditSpaceDialog Map repoProps = this.nodeService.getProperties(nodeRef); // add the "uifacets" aspect if required, properties will get set below - if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_UIFACETS) == false) + if (this.nodeService.hasAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS) == false) { - this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, null); + this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null); } // overwrite the current properties with the edited ones diff --git a/source/java/org/alfresco/web/bean/wcm/FormDetailsDialog.java b/source/java/org/alfresco/web/bean/wcm/FormDetailsDialog.java index 171a77024c..390b938620 100644 --- a/source/java/org/alfresco/web/bean/wcm/FormDetailsDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/FormDetailsDialog.java @@ -195,7 +195,7 @@ public class FormDetailsDialog extends BaseDialogBean for (WorkflowDefinition workflowDef : workflowDefs) { UIListItem item = new UIListItem(); - item.setValue(workflowDef.getId()); + item.setValue(workflowDef.getName()); item.setLabel(workflowDef.getTitle()); item.setDescription(workflowDef.getDescription()); item.setImage(WebResources.IMAGE_WORKFLOW_32); diff --git a/source/java/org/alfresco/web/bean/wcm/ImportWebsiteDialog.java b/source/java/org/alfresco/web/bean/wcm/ImportWebsiteDialog.java index ab9114c6b4..e42213d9e4 100644 --- a/source/java/org/alfresco/web/bean/wcm/ImportWebsiteDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/ImportWebsiteDialog.java @@ -35,7 +35,9 @@ import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; +import org.alfresco.model.WCMAppModel; import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.domain.PropertyValue; import org.alfresco.service.ServiceRegistry; @@ -200,8 +202,8 @@ public class ImportWebsiteDialog // import the content into the appropriate store for the website Node website = this.navigationBean.getCurrentNode(); - String storeRoot = (String)website.getProperties().get(ContentModel.PROP_AVMSTORE); - String webapp = (String)website.getProperties().get(ContentModel.PROP_DEFAULTWEBAPP); + String storeRoot = (String)website.getProperties().get(WCMAppModel.PROP_AVMSTORE); + String webapp = (String)website.getProperties().get(WCMAppModel.PROP_DEFAULTWEBAPP); if (storeRoot != null && webapp != null) { String store = AVMConstants.buildAVMStagingStoreName(storeRoot); @@ -452,7 +454,7 @@ public class ImportWebsiteDialog // this.nodeService.addAspect(folderRef, ContentModel.ASPECT_UIFACETS, null); // for now use the AVM service directly - this.avmService.addAspect(folderPath, ContentModel.ASPECT_UIFACETS); + this.avmService.addAspect(folderPath, ApplicationModel.ASPECT_UIFACETS); } } catch (FileNotFoundException e) diff --git a/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java b/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java index bcb951b4da..a60a2e6671 100644 --- a/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java @@ -10,7 +10,7 @@ import java.util.Set; import javax.faces.context.FacesContext; -import org.alfresco.model.ContentModel; +import org.alfresco.model.WCMAppModel; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; @@ -105,12 +105,12 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard } } List userInfoRefs = this.nodeService.getChildAssocs( - getNode().getNodeRef(), ContentModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); + getNode().getNodeRef(), WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); for (ChildAssociationRef ref : userInfoRefs) { NodeRef userInfoRef = ref.getChildRef(); - String username = (String)nodeService.getProperty(userInfoRef, ContentModel.PROP_WEBUSERNAME); - String userrole = (String)nodeService.getProperty(userInfoRef, ContentModel.PROP_WEBUSERROLE); + String username = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME); + String userrole = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE); if (SandboxFactory.ROLE_CONTENT_MANAGER.equals(userrole) && this.managers.contains(username) == false) { @@ -140,12 +140,12 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard { // create an app:webuser instance for each authority and assoc to the website node Map props = new HashMap(2, 1.0f); - props.put(ContentModel.PROP_WEBUSERNAME, authority); - props.put(ContentModel.PROP_WEBUSERROLE, userRole.getRole()); + props.put(WCMAppModel.PROP_WEBUSERNAME, authority); + props.put(WCMAppModel.PROP_WEBUSERROLE, userRole.getRole()); this.nodeService.createNode(getNode().getNodeRef(), - ContentModel.ASSOC_WEBUSER, - ContentModel.ASSOC_WEBUSER, - ContentModel.TYPE_WEBUSER, + WCMAppModel.ASSOC_WEBUSER, + WCMAppModel.ASSOC_WEBUSER, + WCMAppModel.TYPE_WEBUSER, props); } } @@ -189,7 +189,7 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard if (this.folderPermissions == null) { // get permissions and roles for a website folder type - this.folderPermissions = this.permissionService.getSettablePermissions(ContentModel.TYPE_AVMWEBFOLDER); + this.folderPermissions = this.permissionService.getSettablePermissions(WCMAppModel.TYPE_AVMWEBFOLDER); } return this.folderPermissions; @@ -228,7 +228,7 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard { if (this.avmStore == null) { - this.avmStore = (String)getNode().getProperties().get(ContentModel.PROP_AVMSTORE); + this.avmStore = (String)getNode().getProperties().get(WCMAppModel.PROP_AVMSTORE); } return this.avmStore; } diff --git a/source/java/org/alfresco/web/bean/wizard/NewUserWizard.java b/source/java/org/alfresco/web/bean/wizard/NewUserWizard.java index 0100a7fff6..f425b42ad6 100644 --- a/source/java/org/alfresco/web/bean/wizard/NewUserWizard.java +++ b/source/java/org/alfresco/web/bean/wizard/NewUserWizard.java @@ -31,6 +31,7 @@ import javax.faces.validator.ValidatorException; import javax.transaction.UserTransaction; import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.InvalidNodeRefException; @@ -899,9 +900,9 @@ public class NewUserWizard extends AbstractWizardBean // apply the uifacets aspect - icon, title and description props Map uiFacetsProps = new HashMap(3); - uiFacetsProps.put(ContentModel.PROP_ICON, CreateSpaceWizard.DEFAULT_SPACE_ICON_NAME); + uiFacetsProps.put(ApplicationModel.PROP_ICON, CreateSpaceWizard.DEFAULT_SPACE_ICON_NAME); uiFacetsProps.put(ContentModel.PROP_TITLE, spaceName); - this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, uiFacetsProps); + this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, uiFacetsProps); setupHomeSpacePermissions(nodeRef); diff --git a/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java b/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java index 04ba84f892..ab00b650cc 100644 --- a/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java +++ b/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java @@ -11,6 +11,7 @@ import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.workflow.WorkflowModel; import org.alfresco.service.cmr.dictionary.TypeDefinition; @@ -539,7 +540,7 @@ public class ManageTaskDialog extends BaseDialogBean // look for content nodes or links to content // NOTE: folders within workflow packages are ignored for now if (this.dictionaryService.isSubClass(type, ContentModel.TYPE_CONTENT) || - ContentModel.TYPE_FILELINK.equals(type)) + ApplicationModel.TYPE_FILELINK.equals(type)) { // if the node is not in the removed list then add create the // client side representation and add to the list diff --git a/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java b/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java index 5616f95813..5cfa7a719b 100644 --- a/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java +++ b/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java @@ -14,6 +14,7 @@ import javax.faces.event.ActionEvent; import javax.faces.model.SelectItem; import javax.transaction.UserTransaction; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.workflow.WorkflowModel; import org.alfresco.service.cmr.dictionary.PropertyDefinition; @@ -95,7 +96,7 @@ public class StartWorkflowWizard extends BaseWizardBean QName type = this.nodeService.getType(itemToWorkflow); if (this.dictionaryService.isSubClass(type, ContentModel.TYPE_CONTENT) || - this.dictionaryService.isSubClass(type, ContentModel.TYPE_FILELINK)) + this.dictionaryService.isSubClass(type, ApplicationModel.TYPE_FILELINK)) { this.packageItemsToAdd.add(itemToWorkflow.toString()); } diff --git a/source/java/org/alfresco/web/bean/workflow/WorkflowUtil.java b/source/java/org/alfresco/web/bean/workflow/WorkflowUtil.java index 2f6412f4e9..dc91913f9d 100644 --- a/source/java/org/alfresco/web/bean/workflow/WorkflowUtil.java +++ b/source/java/org/alfresco/web/bean/workflow/WorkflowUtil.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.repository.AssociationRef; import org.alfresco.service.cmr.repository.CopyService; @@ -60,7 +61,7 @@ public class WorkflowUtil { Node docNode = new Node(ref); - if (docNode.hasAspect(ContentModel.ASPECT_SIMPLE_WORKFLOW) == false) + if (docNode.hasAspect(ApplicationModel.ASPECT_SIMPLE_WORKFLOW) == false) { throw new AlfrescoRuntimeException("Cannot approve a node that is not part of a workflow."); } @@ -68,11 +69,11 @@ public class WorkflowUtil // get the simple workflow aspect properties Map props = docNode.getProperties(); - Boolean approveMove = (Boolean)props.get(ContentModel.PROP_APPROVE_MOVE.toString()); - NodeRef approveFolder = (NodeRef)props.get(ContentModel.PROP_APPROVE_FOLDER.toString()); + Boolean approveMove = (Boolean)props.get(ApplicationModel.PROP_APPROVE_MOVE.toString()); + NodeRef approveFolder = (NodeRef)props.get(ApplicationModel.PROP_APPROVE_FOLDER.toString()); // first we need to take off the simpleworkflow aspect - nodeService.removeAspect(ref, ContentModel.ASPECT_SIMPLE_WORKFLOW); + nodeService.removeAspect(ref, ApplicationModel.ASPECT_SIMPLE_WORKFLOW); if (approveMove.booleanValue()) { @@ -116,7 +117,7 @@ public class WorkflowUtil { Node docNode = new Node(ref); - if (docNode.hasAspect(ContentModel.ASPECT_SIMPLE_WORKFLOW) == false) + if (docNode.hasAspect(ApplicationModel.ASPECT_SIMPLE_WORKFLOW) == false) { throw new AlfrescoRuntimeException("Cannot reject a node that is not part of a workflow."); } @@ -124,9 +125,9 @@ public class WorkflowUtil // get the simple workflow aspect properties Map props = docNode.getProperties(); - String rejectStep = (String)props.get(ContentModel.PROP_REJECT_STEP.toString()); - Boolean rejectMove = (Boolean)props.get(ContentModel.PROP_REJECT_MOVE.toString()); - NodeRef rejectFolder = (NodeRef)props.get(ContentModel.PROP_REJECT_FOLDER.toString()); + String rejectStep = (String)props.get(ApplicationModel.PROP_REJECT_STEP.toString()); + Boolean rejectMove = (Boolean)props.get(ApplicationModel.PROP_REJECT_MOVE.toString()); + NodeRef rejectFolder = (NodeRef)props.get(ApplicationModel.PROP_REJECT_FOLDER.toString()); if (rejectStep == null && rejectMove == null && rejectFolder == null) { @@ -134,7 +135,7 @@ public class WorkflowUtil } // first we need to take off the simpleworkflow aspect - nodeService.removeAspect(ref, ContentModel.ASPECT_SIMPLE_WORKFLOW); + nodeService.removeAspect(ref, ApplicationModel.ASPECT_SIMPLE_WORKFLOW); if (rejectMove != null && rejectMove.booleanValue()) { diff --git a/source/java/org/alfresco/web/forms/FormDataFunctions.java b/source/java/org/alfresco/web/forms/FormDataFunctions.java index 6ee11bb196..a6a7e3cbcc 100644 --- a/source/java/org/alfresco/web/forms/FormDataFunctions.java +++ b/source/java/org/alfresco/web/forms/FormDataFunctions.java @@ -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) { diff --git a/source/java/org/alfresco/web/forms/FormImpl.java b/source/java/org/alfresco/web/forms/FormImpl.java index bc28ce2d33..dbb18867e9 100644 --- a/source/java/org/alfresco/web/forms/FormImpl.java +++ b/source/java/org/alfresco/web/forms/FormImpl.java @@ -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 refs = nodeService.getTargetAssocs(this.folderNodeRef, - WCMModel.ASSOC_RENDERING_ENGINE_TEMPLATES); + WCMAppModel.ASSOC_RENDERING_ENGINE_TEMPLATES); final List result = new ArrayList(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 props = new HashMap(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() diff --git a/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java b/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java index a541c7122e..971b449bfc 100644 --- a/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java +++ b/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java @@ -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); } diff --git a/source/java/org/alfresco/web/forms/FormsService.java b/source/java/org/alfresco/web/forms/FormsService.java index 05704ab2b0..ed024c676e 100644 --- a/source/java/org/alfresco/web/forms/FormsService.java +++ b/source/java/org/alfresco/web/forms/FormsService.java @@ -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); diff --git a/source/java/org/alfresco/web/forms/RenderingEngineTemplateImpl.java b/source/java/org/alfresco/web/forms/RenderingEngineTemplateImpl.java index dcfd414c4b..abe9d86947 100644 --- a/source/java/org/alfresco/web/forms/RenderingEngineTemplateImpl.java +++ b/source/java/org/alfresco/web/forms/RenderingEngineTemplateImpl.java @@ -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 props = new HashMap(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() diff --git a/source/java/org/alfresco/web/forms/RenditionImpl.java b/source/java/org/alfresco/web/forms/RenditionImpl.java index a717a559a1..9129c59a06 100644 --- a/source/java/org/alfresco/web/forms/RenditionImpl.java +++ b/source/java/org/alfresco/web/forms/RenditionImpl.java @@ -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); } diff --git a/source/java/org/alfresco/web/ui/repo/component/UINodeWorkflowInfo.java b/source/java/org/alfresco/web/ui/repo/component/UINodeWorkflowInfo.java index 34323c25ed..e2afc50513 100644 --- a/source/java/org/alfresco/web/ui/repo/component/UINodeWorkflowInfo.java +++ b/source/java/org/alfresco/web/ui/repo/component/UINodeWorkflowInfo.java @@ -11,6 +11,7 @@ import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; import javax.faces.el.ValueBinding; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.repository.NodeRef; @@ -161,25 +162,25 @@ public class UINodeWorkflowInfo extends SelfRenderingComponent } out.write("
"); - if (node.hasAspect(ContentModel.ASPECT_SIMPLE_WORKFLOW)) + if (node.hasAspect(ApplicationModel.ASPECT_SIMPLE_WORKFLOW)) { // get the simple workflow aspect properties Map props = node.getProperties(); String approveStepName = (String)props.get( - ContentModel.PROP_APPROVE_STEP.toString()); + ApplicationModel.PROP_APPROVE_STEP.toString()); String rejectStepName = (String)props.get( - ContentModel.PROP_REJECT_STEP.toString()); + ApplicationModel.PROP_REJECT_STEP.toString()); Boolean approveMove = (Boolean)props.get( - ContentModel.PROP_APPROVE_MOVE.toString()); + ApplicationModel.PROP_APPROVE_MOVE.toString()); Boolean rejectMove = (Boolean)props.get( - ContentModel.PROP_REJECT_MOVE.toString()); + ApplicationModel.PROP_REJECT_MOVE.toString()); NodeRef approveFolder = (NodeRef)props.get( - ContentModel.PROP_APPROVE_FOLDER.toString()); + ApplicationModel.PROP_APPROVE_FOLDER.toString()); NodeRef rejectFolder = (NodeRef)props.get( - ContentModel.PROP_REJECT_FOLDER.toString()); + ApplicationModel.PROP_REJECT_FOLDER.toString()); String approveFolderName = null; String rejectFolderName = null; diff --git a/source/java/org/alfresco/web/ui/repo/component/UISpaceSelector.java b/source/java/org/alfresco/web/ui/repo/component/UISpaceSelector.java index 5179316dbf..ea415d0dc6 100644 --- a/source/java/org/alfresco/web/ui/repo/component/UISpaceSelector.java +++ b/source/java/org/alfresco/web/ui/repo/component/UISpaceSelector.java @@ -22,6 +22,7 @@ import java.util.List; import javax.faces.context.FacesContext; +import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.security.permissions.AccessDeniedException; import org.alfresco.service.cmr.dictionary.DictionaryService; @@ -143,7 +144,7 @@ public class UISpaceSelector extends AbstractItemSelector */ public String getItemIcon(FacesContext context, NodeRef ref) { - String icon = (String)getNodeService(context).getProperty(ref, ContentModel.PROP_ICON); + String icon = (String)getNodeService(context).getProperty(ref, ApplicationModel.PROP_ICON); if (icon != null) { icon = "/images/icons/" + icon + "-16.gif"; diff --git a/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java b/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java index 2e1ee6f11f..b2730ca991 100644 --- a/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java +++ b/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java @@ -35,6 +35,7 @@ import javax.faces.el.ValueBinding; import javax.transaction.UserTransaction; import org.alfresco.model.ContentModel; +import org.alfresco.model.WCMAppModel; import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.service.cmr.avm.AVMNodeDescriptor; import org.alfresco.service.cmr.avm.AVMService; @@ -267,7 +268,7 @@ public class UIUserSandboxes extends SelfRenderingComponent { throw new IllegalArgumentException("Website NodeRef must be specified."); } - String storeRoot = (String)nodeService.getProperty(websiteRef, ContentModel.PROP_AVMSTORE); + String storeRoot = (String)nodeService.getProperty(websiteRef, WCMAppModel.PROP_AVMSTORE); // find out if this user is a Content Manager boolean isManager = isManagerRole(context, nodeService, websiteRef); @@ -275,12 +276,12 @@ public class UIUserSandboxes extends SelfRenderingComponent // get the list of users who have a sandbox in the website int index = 0; List userInfoRefs = nodeService.getChildAssocs( - websiteRef, ContentModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); + websiteRef, WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); for (ChildAssociationRef ref : userInfoRefs) { NodeRef userInfoRef = ref.getChildRef(); - String username = (String)nodeService.getProperty(userInfoRef, ContentModel.PROP_WEBUSERNAME); - String userrole = (String)nodeService.getProperty(userInfoRef, ContentModel.PROP_WEBUSERROLE); + String username = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME); + String userrole = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE); // create the lookup value of sandbox index to username this.userToRowLookup.put(index, username); @@ -433,12 +434,12 @@ public class UIUserSandboxes extends SelfRenderingComponent { String currentUser = user.getUserName(); List userInfoRefs = nodeService.getChildAssocs( - websiteRef, ContentModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); + websiteRef, WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); for (ChildAssociationRef ref : userInfoRefs) { NodeRef userInfoRef = ref.getChildRef(); - String username = (String)nodeService.getProperty(userInfoRef, ContentModel.PROP_WEBUSERNAME); - String userrole = (String)nodeService.getProperty(userInfoRef, ContentModel.PROP_WEBUSERROLE); + String username = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME); + String userrole = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE); if (currentUser.equals(username) && ROLE_CONTENT_MANAGER.equals(userrole)) { isManager = true; @@ -699,7 +700,7 @@ public class UIUserSandboxes extends SelfRenderingComponent if (this.forms == null) { List webFormRefs = nodeService.getChildAssocs( - websiteRef, ContentModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL); + websiteRef, WCMAppModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL); this.forms = new ArrayList(webFormRefs.size()); for (ChildAssociationRef ref : webFormRefs) { @@ -737,9 +738,11 @@ public class UIUserSandboxes extends SelfRenderingComponent if (action == null) { // create content action passes the ID of the Form to uses - Map params = new HashMap(1, 1.0f); + Map params = new HashMap(3, 1.0f); // setup a data-binding param for the Form ID params.put(PARAM_FORM_ID, "#{" + REQUEST_FORM_REF + ".id}"); + params.put("username", username); + params.put("store", userStorePrefix); action = createAction(fc, userStorePrefix, username, ACT_CREATE_FORM_CONTENT, "/images/icons/new_content.gif", "#{AVMBrowseBean.createFormContent}", null, null, params); }