mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merge V1.4 to HEAD
- Ignored Enterprise-specific changes svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3701 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3703 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3704 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3705 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3707 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3876 . svn revert root\projects\web-client\source\web\jsp\admin\admin-console.jsp git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3879 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -26,6 +26,7 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.bean.repository.MapNode;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
@@ -105,16 +106,7 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
this.workflowInstance = this.task.path.instance;
|
||||
|
||||
// setup the workflow package for the task
|
||||
Serializable obj = this.task.properties.get(WorkflowModel.ASSOC_PACKAGE);
|
||||
// TODO: remove this workaroud where JBPM may return a String and not the NodeRef
|
||||
if (obj instanceof NodeRef)
|
||||
{
|
||||
this.workflowPackage = (NodeRef)obj;
|
||||
}
|
||||
else if (obj instanceof String)
|
||||
{
|
||||
this.workflowPackage = new NodeRef((String)obj);
|
||||
}
|
||||
this.workflowPackage = (NodeRef)this.task.properties.get(WorkflowModel.ASSOC_PACKAGE);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
@@ -208,7 +200,7 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "save");
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "save_changes");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -218,7 +210,7 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle()
|
||||
public String getContainerTitle()
|
||||
{
|
||||
String titleStart = Application.getMessage(FacesContext.getCurrentInstance(), "manage_task_title");
|
||||
|
||||
@@ -226,7 +218,7 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription()
|
||||
public String getContainerDescription()
|
||||
{
|
||||
return this.task.description;
|
||||
}
|
||||
@@ -251,7 +243,7 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
String selectedTransition = null;
|
||||
for (WorkflowTransition trans : this.transitions)
|
||||
{
|
||||
Object result = reqParams.get(CLIENT_ID_PREFIX + trans.title);
|
||||
Object result = reqParams.get(CLIENT_ID_PREFIX + FacesHelper.makeLegalId(trans.title));
|
||||
if (result != null)
|
||||
{
|
||||
// this was the button that was pressed
|
||||
@@ -635,7 +627,10 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
node.addPropertyResolver("displayPath", this.browseBean.resolverDisplayPath);
|
||||
|
||||
// add a property resolver to indicate whether the item has been completed or not
|
||||
// node.addPropertyResolver("completed", this.completeResolver);
|
||||
// node.addPropertyResolver("completed", this.completeResolver);
|
||||
|
||||
// add the id of the task being managed
|
||||
node.getProperties().put("taskId", this.task.id);
|
||||
|
||||
this.resources.add(node);
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ public class ReassignTaskDialog extends BaseDialogBean
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
this.taskId = this.parameters.get("task-id");
|
||||
this.taskId = this.parameters.get("id");
|
||||
if (this.taskId == null || this.taskId.length() == 0)
|
||||
{
|
||||
throw new IllegalArgumentException("Reassign task dialog called without task id");
|
||||
|
@@ -46,6 +46,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
public class StartWorkflowWizard extends BaseWizardBean
|
||||
{
|
||||
protected String selectedWorkflow;
|
||||
protected String previouslySelectedWorkflow;
|
||||
protected List<SelectItem> availableWorkflows;
|
||||
protected Map<String, WorkflowDefinition> workflows;
|
||||
protected WorkflowService workflowService;
|
||||
@@ -77,18 +78,13 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
this.selectedWorkflow = null;
|
||||
}
|
||||
|
||||
this.previouslySelectedWorkflow = null;
|
||||
this.startTaskNode = null;
|
||||
this.resources = null;
|
||||
this.itemsToAdd = null;
|
||||
this.packageItemsToAdd = new ArrayList<String>();
|
||||
this.isItemBeingAdded = false;
|
||||
if (this.packageItemsRichList != null)
|
||||
{
|
||||
this.packageItemsRichList.setValue(null);
|
||||
this.packageItemsRichList = null;
|
||||
}
|
||||
|
||||
// TODO: Does this need to be in a read-only transaction??
|
||||
resetRichList();
|
||||
|
||||
// add the item the workflow wizard was started on to the list of resources
|
||||
String itemToWorkflowId = this.parameters.get("item-to-workflow");
|
||||
@@ -110,11 +106,7 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
public void restored()
|
||||
{
|
||||
// reset the workflow package rich list so everything gets re-evaluated
|
||||
if (this.packageItemsRichList != null)
|
||||
{
|
||||
this.packageItemsRichList.setValue(null);
|
||||
this.packageItemsRichList = null;
|
||||
}
|
||||
resetRichList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -190,13 +182,14 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
{
|
||||
String stepName = Application.getWizardManager().getCurrentStepName();
|
||||
|
||||
if ("options".equals(stepName) && this.startTaskNode == null)
|
||||
if ("options".equals(stepName) &&
|
||||
(this.selectedWorkflow.equals(this.previouslySelectedWorkflow) == false))
|
||||
{
|
||||
// retrieve the start task for the selected workflow, get the task
|
||||
// definition and create a transient node to allow the property
|
||||
// sheet to collect the required data.
|
||||
|
||||
WorkflowDefinition flowDef = this.workflows.get(this.selectedWorkflow);
|
||||
WorkflowDefinition flowDef = this.workflows.get(this.selectedWorkflow);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Selected workflow: "+ flowDef);
|
||||
@@ -211,11 +204,29 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
this.startTaskNode = new TransientNode(taskDef.metadata.getName(),
|
||||
"task_" + System.currentTimeMillis(), null);
|
||||
}
|
||||
|
||||
// we also need to reset the resources list so that the actions get re-evaluated
|
||||
resetRichList();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String back()
|
||||
{
|
||||
String stepName = Application.getWizardManager().getCurrentStepName();
|
||||
|
||||
// if we have come back to the "choose-workflow" step remember
|
||||
// the current workflow selection
|
||||
if ("choose-workflow".equals(stepName))
|
||||
{
|
||||
this.previouslySelectedWorkflow = this.selectedWorkflow;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getNextButtonDisabled()
|
||||
{
|
||||
@@ -293,7 +304,7 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
// reset the rich list so it re-renders
|
||||
this.packageItemsRichList.setValue(null);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean Getters and Setters
|
||||
|
||||
@@ -465,33 +476,34 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
*/
|
||||
public List<SelectItem> getStartableWorkflows()
|
||||
{
|
||||
if (this.availableWorkflows == null)
|
||||
// NOTE: we don't cache the list of startable workflows as they could get
|
||||
// updated, in which case we need the latest instance id, they could
|
||||
// theoretically also get removed.
|
||||
|
||||
this.availableWorkflows = new ArrayList<SelectItem>(4);
|
||||
this.workflows = new HashMap<String, WorkflowDefinition>(4);
|
||||
|
||||
List<WorkflowDefinition> workflowDefs = this.workflowService.getDefinitions();
|
||||
for (WorkflowDefinition workflowDef : workflowDefs)
|
||||
{
|
||||
this.availableWorkflows = new ArrayList<SelectItem>(4);
|
||||
this.workflows = new HashMap<String, WorkflowDefinition>(4);
|
||||
|
||||
List<WorkflowDefinition> workflowDefs = this.workflowService.getDefinitions();
|
||||
for (WorkflowDefinition workflowDef : workflowDefs)
|
||||
String label = workflowDef.title;
|
||||
if (workflowDef.description != null && workflowDef.description.length() > 0)
|
||||
{
|
||||
String label = workflowDef.title;
|
||||
if (workflowDef.description != null && workflowDef.description.length() > 0)
|
||||
{
|
||||
label = label + " (" + workflowDef.description + ")";
|
||||
}
|
||||
this.availableWorkflows.add(new SelectItem(workflowDef.id, label));
|
||||
this.workflows.put(workflowDef.id, workflowDef);
|
||||
}
|
||||
|
||||
// set the initial selected workflow to the first in the list, unless there are no
|
||||
// workflows, in which disable the next button
|
||||
if (this.availableWorkflows.size() > 0)
|
||||
{
|
||||
this.selectedWorkflow = (String)this.availableWorkflows.get(0).getValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.nextButtonDisabled = true;
|
||||
label = label + " (" + workflowDef.description + ")";
|
||||
}
|
||||
this.availableWorkflows.add(new SelectItem(workflowDef.id, label));
|
||||
this.workflows.put(workflowDef.id, workflowDef);
|
||||
}
|
||||
|
||||
// set the initial selected workflow to the first in the list, unless there are no
|
||||
// workflows, in which disable the next button
|
||||
if (this.availableWorkflows.size() > 0)
|
||||
{
|
||||
this.selectedWorkflow = (String)this.availableWorkflows.get(0).getValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.nextButtonDisabled = true;
|
||||
}
|
||||
|
||||
return availableWorkflows;
|
||||
@@ -559,4 +571,19 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
{
|
||||
this.workflowService = workflowService;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Helper methods
|
||||
|
||||
/**
|
||||
* Resets the rich list
|
||||
*/
|
||||
protected void resetRichList()
|
||||
{
|
||||
if (this.packageItemsRichList != null)
|
||||
{
|
||||
this.packageItemsRichList.setValue(null);
|
||||
this.packageItemsRichList = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ public class ViewCompletedTaskDialog extends ManageTaskDialog
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle()
|
||||
public String getContainerTitle()
|
||||
{
|
||||
String titleStart = Application.getMessage(FacesContext.getCurrentInstance(), "view_completed_task_title");
|
||||
|
||||
|
@@ -196,7 +196,10 @@ public class WorkflowBean
|
||||
}
|
||||
|
||||
// add the targets for this particular association
|
||||
params.put(assocQName, (Serializable)targets);
|
||||
if (targets.size() > 0)
|
||||
{
|
||||
params.put(assocQName, (Serializable)targets);
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
@@ -223,19 +226,8 @@ public class WorkflowBean
|
||||
node.getProperties().put("id", task.id);
|
||||
|
||||
// add the name of the source space (if there is one)
|
||||
// TODO: remove this workaroud where JBPM may return a String and not the NodeRef
|
||||
Serializable obj = task.properties.get(WorkflowModel.PROP_CONTEXT);
|
||||
NodeRef context = null;
|
||||
if (obj instanceof NodeRef)
|
||||
{
|
||||
context = (NodeRef)obj;
|
||||
}
|
||||
else if (obj instanceof String)
|
||||
{
|
||||
context = new NodeRef((String)obj);
|
||||
}
|
||||
|
||||
if (context != null)
|
||||
NodeRef context = (NodeRef)task.properties.get(WorkflowModel.PROP_CONTEXT);
|
||||
if (context != null && this.nodeService.exists(context))
|
||||
{
|
||||
String name = Repository.getNameForNode(this.nodeService, context);
|
||||
node.getProperties().put("sourceSpaceName", name);
|
||||
|
Reference in New Issue
Block a user