Merged 1.4 to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4229 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4230 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4232 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4233 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4234 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4235 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4239 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4240 .
   svn resolved root\projects\web-client\source\java\org\alfresco\web\app\AlfrescoNavigationHandler.java
   svn resolved root\projects\web-client\source\web\WEB-INF\faces-config-beans.xml
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4241 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4242 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4243 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4244 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4244 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4245 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4245 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4246 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4247 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4248 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4248 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4249 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4250 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4251 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4251 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4252 .


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4633 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-12-18 13:18:44 +00:00
parent 549ce68112
commit 3627699e04
15 changed files with 2258 additions and 41 deletions

View File

@@ -17,9 +17,10 @@
<label-id>manage_task</label-id> <label-id>manage_task</label-id>
<image>/images/icons/manage_workflow_task.gif</image> <image>/images/icons/manage_workflow_task.gif</image>
<action>dialog:manageTask</action> <action>dialog:manageTask</action>
<action-listener>#{DialogManager.setupParameters}</action-listener> <action-listener>#{WorkflowBean.setupTaskDialog}</action-listener>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
<param name="type">#{actionContext.type}</param>
</params> </params>
</action> </action>
@@ -27,9 +28,10 @@
<label-id>view_completed_task_title</label-id> <label-id>view_completed_task_title</label-id>
<image>/images/icons/view_workflow_task.gif</image> <image>/images/icons/view_workflow_task.gif</image>
<action>dialog:viewCompletedTask</action> <action>dialog:viewCompletedTask</action>
<action-listener>#{DialogManager.setupParameters}</action-listener> <action-listener>#{WorkflowBean.setupTaskDialog}</action-listener>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
<param name="type">#{actionContext.type}</param>
</params> </params>
</action> </action>
@@ -37,9 +39,10 @@
<label-id>reassign</label-id> <label-id>reassign</label-id>
<image>/images/icons/reassign_task.gif</image> <image>/images/icons/reassign_task.gif</image>
<action>dialog:reassignTask</action> <action>dialog:reassignTask</action>
<action-listener>#{DialogManager.setupParameters}</action-listener> <action-listener>#{WorkflowBean.setupTaskDialog}</action-listener>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
<param name="type">#{actionContext.type}</param>
</params> </params>
</action> </action>

View File

@@ -21,6 +21,7 @@ import javax.faces.context.FacesContext;
import org.alfresco.model.ApplicationModel; import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.action.ActionEvaluator; import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
@@ -50,6 +51,7 @@ public class EditDocCIFSEvaluator implements ActionEvaluator
"cifs".equals(Application.getClientConfig(fc).getEditLinkType())) "cifs".equals(Application.getClientConfig(fc).getEditLinkType()))
{ {
if (node.isWorkingCopyOwner() == true || if (node.isWorkingCopyOwner() == true ||
(node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && node.hasPermission(PermissionService.WRITE)) ||
(node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false)) (node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false))
{ {
result = true; result = true;

View File

@@ -21,6 +21,7 @@ import javax.faces.context.FacesContext;
import org.alfresco.model.ApplicationModel; import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.action.ActionEvaluator; import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
@@ -51,6 +52,7 @@ public class EditDocHttpEvaluator implements ActionEvaluator
"http".equals(Application.getClientConfig(fc).getEditLinkType())) "http".equals(Application.getClientConfig(fc).getEditLinkType()))
{ {
if (node.isWorkingCopyOwner() == true || if (node.isWorkingCopyOwner() == true ||
(node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && node.hasPermission(PermissionService.WRITE)) ||
(node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false)) (node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false))
{ {
result = true; result = true;

View File

@@ -21,6 +21,7 @@ import javax.faces.context.FacesContext;
import org.alfresco.model.ApplicationModel; import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.action.ActionEvaluator; import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
@@ -50,6 +51,7 @@ public class EditDocWebDavEvaluator implements ActionEvaluator
"webdav".equals(Application.getClientConfig(fc).getEditLinkType())) "webdav".equals(Application.getClientConfig(fc).getEditLinkType()))
{ {
if (node.isWorkingCopyOwner() == true || if (node.isWorkingCopyOwner() == true ||
(node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && node.hasPermission(PermissionService.WRITE)) ||
(node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false)) (node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false))
{ {
result = true; result = true;

View File

@@ -26,7 +26,7 @@ import javax.faces.context.FacesContext;
import org.alfresco.config.Config; import org.alfresco.config.Config;
import org.alfresco.config.ConfigService; import org.alfresco.config.ConfigService;
import org.alfresco.web.app.servlet.ExternalAccessServlet; import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.NavigationBean; import org.alfresco.web.bean.NavigationBean;
import org.alfresco.web.bean.dialog.DialogManager; import org.alfresco.web.bean.dialog.DialogManager;
import org.alfresco.web.bean.dialog.DialogState; import org.alfresco.web.bean.dialog.DialogState;
@@ -121,6 +121,13 @@ public class AlfrescoNavigationHandler extends NavigationHandler
} }
} }
// reset the dispatch context
Object bean = FacesHelper.getManagedBean(context, CONFIG_NAV_BEAN);
if (bean instanceof NavigationBean)
{
((NavigationBean)bean).resetDispatchContext();
}
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("view stack: " + getViewStack(context)); logger.debug("view stack: " + getViewStack(context));
} }
@@ -658,29 +665,15 @@ public class AlfrescoNavigationHandler extends NavigationHandler
} }
} }
else else
{
// the details pages can be loaded via the external access servlet,
// if this is the case the details page would not have been loaded as
// a dialog, in this scenario just use the global "browse" outcome.
String referer = (String)context.getExternalContext().
getRequestHeaderMap().get("referer");
if ((referer != null) &&
((referer.indexOf(ExternalAccessServlet.OUTCOME_DOCDETAILS) != -1) ||
(referer.indexOf(ExternalAccessServlet.OUTCOME_SPACEDETAILS) != -1)))
{
navigate(context, fromAction, "browse");
}
else
{ {
// we are trying to close a dialog when one hasn't been opened! // we are trying to close a dialog when one hasn't been opened!
// log a warning and return a null outcome to stay on the same page // return to the main page of the app (print warning if debug is enabled)
if (logger.isWarnEnabled()) if (logger.isDebugEnabled())
{ {
logger.warn("Attempting to close a " + closingItem + " with an empty view stack, returning null outcome"); logger.debug("Attempting to close a " + closingItem + " with an empty view stack, returning 'browse' outcome");
} }
navigate(context, fromAction, null); navigate(context, fromAction, "browse");
}
} }
} }

View File

@@ -251,7 +251,7 @@ public class TransientNode extends Node
TypeDefinition typeDef = ddService.getType(this.type); TypeDefinition typeDef = ddService.getType(this.type);
if (typeDef == null) if (typeDef == null)
{ {
throw new AlfrescoRuntimeException("Failed to find type definition for start task: " + this.type); throw new AlfrescoRuntimeException("Failed to find type definition: " + this.type);
} }
this.aspects = new HashSet<QName>(); this.aspects = new HashSet<QName>();

View File

@@ -229,7 +229,7 @@ public final class User
Map<QName, Serializable> props = nodeService.getProperties(user); Map<QName, Serializable> props = nodeService.getProperties(user);
String firstName = (String)props.get(ContentModel.PROP_FIRSTNAME); String firstName = (String)props.get(ContentModel.PROP_FIRSTNAME);
String lastName = (String)props.get(ContentModel.PROP_LASTNAME); String lastName = (String)props.get(ContentModel.PROP_LASTNAME);
String fullName = firstName + " " + (lastName != null ? lastName : ""); String fullName = firstName + ((lastName != null && lastName.length() > 0) ? " " + lastName : "");
return fullName; return fullName;
} }

View File

@@ -461,16 +461,18 @@ public class CreateSpaceWizard extends BaseWizardBean
String xpath = Application.getRootPath(context) + "/" + Application.getGlossaryFolderName(context) + String xpath = Application.getRootPath(context) + "/" + Application.getGlossaryFolderName(context) +
"/" + Application.getSpaceTemplatesFolderName(context) + "/*"; "/" + Application.getSpaceTemplatesFolderName(context) + "/*";
NodeRef rootNodeRef = this.nodeService.getRootNode(Repository.getStoreRef()); NodeRef rootNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
NamespaceService resolver = Repository.getServiceRegistry(context).getNamespaceService(); List<NodeRef> results = this.searchService.selectNodes(rootNodeRef, xpath, null, this.namespaceService, false);
List<NodeRef> results = this.searchService.selectNodes(rootNodeRef, xpath, null, resolver, false);
if (results.size() > 0) if (results.size() > 0)
{ {
for (NodeRef assocRef : results) for (NodeRef assocRef : results)
{ {
Node childNode = new Node(assocRef); Node childNode = new Node(assocRef);
if (this.dictionaryService.isSubClass(childNode.getType(), ContentModel.TYPE_FOLDER))
{
this.templates.add(new SelectItem(childNode.getId(), childNode.getName())); this.templates.add(new SelectItem(childNode.getId(), childNode.getName()));
} }
}
// make sure the list is sorted by the label // make sure the list is sorted by the label
QuickSort sorter = new QuickSort(this.templates, "label", true, IDataContainer.SORT_CASEINSENSITIVE); QuickSort sorter = new QuickSort(this.templates, "label", true, IDataContainer.SORT_CASEINSENSITIVE);

View File

@@ -532,6 +532,22 @@ public class StartWorkflowWizard extends BaseWizardBean
return availableWorkflows; return availableWorkflows;
} }
/**
* Returns the URL to the Workflow Definition Image of the current task
*
* @return the url
*/
public String getWorkflowDefinitionImageUrl()
{
String url = null;
if (selectedWorkflow != null)
{
WorkflowDefinition def = workflows.get(selectedWorkflow);
url = "/workflowdefinitionimage/" + def.id;
}
return url;
}
/** /**
* Returns a list of resources associated with this task * Returns a list of resources associated with this task
* i.e. the children of the workflow package * i.e. the children of the workflow package

View File

@@ -2,8 +2,10 @@ package org.alfresco.web.bean.workflow;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.transaction.UserTransaction; import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
@@ -14,13 +16,17 @@ import org.alfresco.service.cmr.workflow.WorkflowTask;
import org.alfresco.service.cmr.workflow.WorkflowTaskDefinition; import org.alfresco.service.cmr.workflow.WorkflowTaskDefinition;
import org.alfresco.service.cmr.workflow.WorkflowTaskState; import org.alfresco.service.cmr.workflow.WorkflowTaskState;
import org.alfresco.service.cmr.workflow.WorkflowTransition; import org.alfresco.service.cmr.workflow.WorkflowTransition;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ISO9075; import org.alfresco.util.ISO9075;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.bean.NavigationBean;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.repository.TransientMapNode; import org.alfresco.web.bean.repository.TransientMapNode;
import org.alfresco.web.bean.repository.TransientNode;
import org.alfresco.web.bean.repository.User; import org.alfresco.web.bean.repository.User;
import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIActionLink;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@@ -31,6 +37,7 @@ import org.apache.commons.logging.LogFactory;
*/ */
public class WorkflowBean public class WorkflowBean
{ {
protected NavigationBean navigationBean;
protected NodeService nodeService; protected NodeService nodeService;
protected WorkflowService workflowService; protected WorkflowService workflowService;
protected List<Node> tasks; protected List<Node> tasks;
@@ -141,6 +148,16 @@ public class WorkflowBean
return this.completedTasks; return this.completedTasks;
} }
/**
* Sets the navigation bean to use
*
* @param navigationBean The NavigationBean to set.
*/
public void setNavigationBean(NavigationBean navigationBean)
{
this.navigationBean = navigationBean;
}
/** /**
* Sets the workflow service to use * Sets the workflow service to use
* *
@@ -161,6 +178,24 @@ public class WorkflowBean
this.nodeService = nodeService; this.nodeService = nodeService;
} }
// ------------------------------------------------------------------------------
// Navigation handlers
public void setupTaskDialog(ActionEvent event)
{
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
String type = params.get("type");
// setup the dispatch context with the task we're opening a dialog for
TransientNode node = new TransientNode(QName.createQName(type), id, null);
this.navigationBean.setupDispatchContext(node);
// pass on parameters for the dialog
Application.getDialogManager().setupParameters(event);
}
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Helper methods // Helper methods
@@ -181,7 +216,7 @@ public class WorkflowBean
// add properties for the other useful metadata // add properties for the other useful metadata
node.getProperties().put(ContentModel.PROP_NAME.toString(), task.title); node.getProperties().put(ContentModel.PROP_NAME.toString(), task.title);
node.getProperties().put("type", taskDef.metadata.getTitle()); node.getProperties().put("type", node.getType().toString());
node.getProperties().put("id", task.id); node.getProperties().put("id", task.id);
// add extra properties for completed tasks // add extra properties for completed tasks

File diff suppressed because it is too large Load Diff

View File

@@ -150,7 +150,7 @@
<a:richList id="rulesList" viewMode="details" value="#{RulesBean.rules}" var="r" <a:richList id="rulesList" viewMode="details" value="#{RulesBean.rules}" var="r"
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow"
altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10" altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10"
initialSortColumn="title" initialSortDescending="true" initialSortColumn="createdDate" initialSortDescending="false"
binding="#{RulesBean.richList}"> binding="#{RulesBean.richList}">
<%-- Primary column for details view mode --%> <%-- Primary column for details view mode --%>

View File

@@ -136,7 +136,7 @@
<a:panel rendered="false" id="workflow-outline" label="#{msg.workflow_outline}" progressive="true" expanded="false" <a:panel rendered="false" id="workflow-outline" label="#{msg.workflow_outline}" progressive="true" expanded="false"
border="white" bgcolor="white" titleBorder="blue" titleBgcolor="#D3E6FE" styleClass="mainSubTitle"> border="white" bgcolor="white" titleBorder="blue" titleBgcolor="#D3E6FE" styleClass="mainSubTitle">
<h:graphicImage value="#{DialogManager.bean.workflowDefinitionImageUrl}"/> <h:graphicImage value="#{WizardManager.bean.workflowDefinitionImageUrl}"/>
</a:panel> </a:panel>

View File

@@ -18,13 +18,15 @@
</f:facet> </f:facet>
<f:facet name="small-icon"> <f:facet name="small-icon">
<a:actionLink id="col1-act1" value="#{r['bpm:description']}" image="/images/icons/completed_workflow_task.gif" showLink="false" <a:actionLink id="col1-act1" value="#{r['bpm:description']}" image="/images/icons/completed_workflow_task.gif" showLink="false"
actionListener="#{DialogManager.setupParameters}" action="dialog:viewCompletedTask"> actionListener="#{WorkflowBean.setupTaskDialog}" action="dialog:viewCompletedTask">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
<f:param name="type" value="#{r.type}" />
</a:actionLink> </a:actionLink>
</f:facet> </f:facet>
<a:actionLink id="col1-act2" value="#{r['bpm:description']}" actionListener="#{DialogManager.setupParameters}" <a:actionLink id="col1-act2" value="#{r['bpm:description']}" actionListener="#{WorkflowBean.setupTaskDialog}"
action="dialog:viewCompletedTask"> action="dialog:viewCompletedTask">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
<f:param name="type" value="#{r.type}" />
</a:actionLink> </a:actionLink>
</a:column> </a:column>

View File

@@ -18,13 +18,15 @@
</f:facet> </f:facet>
<f:facet name="small-icon"> <f:facet name="small-icon">
<a:actionLink id="col1-act1" value="#{r['bpm:description']}" image="/images/icons/workflow_task.gif" showLink="false" <a:actionLink id="col1-act1" value="#{r['bpm:description']}" image="/images/icons/workflow_task.gif" showLink="false"
actionListener="#{DialogManager.setupParameters}" action="dialog:manageTask"> actionListener="#{WorkflowBean.setupTaskDialog}" action="dialog:manageTask">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
<f:param name="type" value="#{r.type}" />
</a:actionLink> </a:actionLink>
</f:facet> </f:facet>
<a:actionLink id="col1-act2" value="#{r['bpm:description']}" actionListener="#{DialogManager.setupParameters}" <a:actionLink id="col1-act2" value="#{r['bpm:description']}" actionListener="#{WorkflowBean.setupTaskDialog}"
action="dialog:manageTask"> action="dialog:manageTask">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
<f:param name="type" value="#{r.type}" />
</a:actionLink> </a:actionLink>
</a:column> </a:column>