From 69039bc6c9f4d25f41e83db6b113e6178eb7fcb0 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Thu, 30 Mar 2006 14:09:08 +0000 Subject: [PATCH] . Workflow Command Servlet implementation . Refactored common simple workflow code into a util class. . Example template that demonstrates both querying for workflow information on a document (useful anyway) and executes the servlet to perform both the Approve and Reject actions if appropriate for the document. . TemplateNode template API object now exposes the browse navigation servlet URL for a Space as the "url" API call . Fix long standing bug in UIRichList (since PR1!) - subtle behaviour issue where under very high server loads, the richlist component would render the wrong number of items per row. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2590 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../service/cmr/repository/TemplateNode.java | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/source/java/org/alfresco/service/cmr/repository/TemplateNode.java b/source/java/org/alfresco/service/cmr/repository/TemplateNode.java index fd2f2c4ec4..f764f6b761 100644 --- a/source/java/org/alfresco/service/cmr/repository/TemplateNode.java +++ b/source/java/org/alfresco/service/cmr/repository/TemplateNode.java @@ -66,6 +66,7 @@ public final class TemplateNode implements Serializable private final static String NAMESPACE_BEGIN = "" + QName.NAMESPACE_BEGIN; private final static String CONTENT_DEFAULT_URL = "/download/direct/{0}/{1}/{2}/{3}"; private final static String CONTENT_PROP_URL = "/download/direct/{0}/{1}/{2}/{3}?property={4}"; + private final static String FOLDER_BROWSE_URL = "/navigate/browse/{0}/{1}/{2}"; /** The children of this node */ private List children = null; @@ -502,22 +503,34 @@ public final class TemplateNode implements Serializable } /** - * @return url to the content stream for this node for the default content property - * (@see ContentModel.PROP_CONTENT) + * @return For a content document, this method returns the URL to the content stream for + * the default content property (@see ContentModel.PROP_CONTENT) + *

+ * For a container node, this method return the URL to browse to the folder in the web-client */ public String getUrl() { - try + if (getIsDocument() == true) { - return MessageFormat.format(CONTENT_DEFAULT_URL, new Object[] { - nodeRef.getStoreRef().getProtocol(), - nodeRef.getStoreRef().getIdentifier(), - nodeRef.getId(), - StringUtils.replace(URLEncoder.encode(getName(), "UTF-8"), "+", "%20") } ); + try + { + return MessageFormat.format(CONTENT_DEFAULT_URL, new Object[] { + nodeRef.getStoreRef().getProtocol(), + nodeRef.getStoreRef().getIdentifier(), + nodeRef.getId(), + StringUtils.replace(URLEncoder.encode(getName(), "UTF-8"), "+", "%20") } ); + } + catch (UnsupportedEncodingException err) + { + throw new TemplateException("Failed to encode content URL for node: " + nodeRef, err); + } } - catch (UnsupportedEncodingException err) + else { - throw new TemplateException("Failed to encode content URL for node: " + nodeRef, err); + return MessageFormat.format(FOLDER_BROWSE_URL, new Object[] { + nodeRef.getStoreRef().getProtocol(), + nodeRef.getStoreRef().getIdentifier(), + nodeRef.getId() } ); } }