mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[DS-968] XML configurable workflow bugfixes
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6650 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -50,7 +50,8 @@ public class ClaimAction extends UserSelectionAction {
|
||||
|
||||
@Override
|
||||
public ActionResult execute(Context c, XmlWorkflowItem wfi, Step step, HttpServletRequest request) throws SQLException, AuthorizeException, IOException {
|
||||
if(request.getParameter("submit_take_task") != null){
|
||||
//Check if we are accept this task, or accepting multiple tasks
|
||||
if(request.getParameter("submit_take_task") != null || request.getParameter("submit_take_tasks") != null){
|
||||
//Add a claimed user to our task
|
||||
WorkflowRequirementsManager.addClaimedUser(c, wfi, step, c.getCurrentUser());
|
||||
|
||||
|
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.xmlworkflow;
|
||||
|
||||
import org.apache.avalon.framework.parameters.Parameters;
|
||||
import org.apache.cocoon.acting.AbstractAction;
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Redirector;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
import org.apache.cocoon.environment.SourceResolver;
|
||||
import org.dspace.app.util.Util;
|
||||
import org.dspace.app.xmlui.utils.ContextUtil;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.xmlworkflow.WorkflowFactory;
|
||||
import org.dspace.xmlworkflow.XmlWorkflowManager;
|
||||
import org.dspace.xmlworkflow.state.Workflow;
|
||||
import org.dspace.xmlworkflow.state.actions.WorkflowActionConfig;
|
||||
import org.dspace.xmlworkflow.storedcomponents.PoolTask;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* User: kevin (kevin at atmire.com)
|
||||
* Date: 7-sep-2011
|
||||
* Time: 14:23:34
|
||||
*/
|
||||
public class ClaimTasksAction extends AbstractAction {
|
||||
@Override
|
||||
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception {
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
Context context = ContextUtil.obtainContext(objectModel);
|
||||
|
||||
// Or the user selected a checkbox full of workflow IDs
|
||||
int[] workflowIDs = Util.getIntParameters(request, "workflowID");
|
||||
if (workflowIDs != null)
|
||||
{
|
||||
for (int workflowID : workflowIDs)
|
||||
{
|
||||
PoolTask poolTask = PoolTask.findByWorkflowIdAndEPerson(context, workflowID, context.getCurrentUser().getID());
|
||||
XmlWorkflowItem workflowItem = XmlWorkflowItem.find(context, workflowID);
|
||||
Workflow workflow = WorkflowFactory.getWorkflow(workflowItem.getCollection());
|
||||
|
||||
WorkflowActionConfig currentAction = workflow.getStep(poolTask.getStepID()).getActionConfig(poolTask.getActionID());
|
||||
XmlWorkflowManager.doState(context, context.getCurrentUser(), request, workflowID, workflow, currentAction);
|
||||
}
|
||||
context.commit();
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -247,7 +247,7 @@ public class Submissions extends AbstractDSpaceTransformer
|
||||
table.setHead(T_w_head3);
|
||||
|
||||
header = table.addRow(Row.ROLE_HEADER);
|
||||
// header.addCellContent(T_w_column1);
|
||||
header.addCellContent(T_w_column1);
|
||||
header.addCellContent(T_w_column2);
|
||||
header.addCellContent(T_w_column3);
|
||||
header.addCellContent(T_w_column4);
|
||||
@@ -265,7 +265,6 @@ public class Submissions extends AbstractDSpaceTransformer
|
||||
try {
|
||||
item = XmlWorkflowItem.find(context, workflowItemID);
|
||||
Workflow wf = WorkflowFactory.getWorkflow(item.getCollection());
|
||||
Step step = wf.getStep(step_id);
|
||||
String url = contextPath+"/handle/"+item.getCollection().getHandle()+"/xmlworkflow?workflowID="+workflowItemID+"&stepID="+step_id+"&actionID="+action_id;
|
||||
DCValue[] titles = item.getItem().getDC("title", null, Item.ANY);
|
||||
String collectionName = item.getCollection().getMetadata("name");
|
||||
@@ -278,9 +277,9 @@ public class Submissions extends AbstractDSpaceTransformer
|
||||
|
||||
Row row = table.addRow();
|
||||
|
||||
// CheckBox remove = row.addCell().addCheckBox("workflowID");
|
||||
// remove.setLabel("selected");
|
||||
// remove.addOption(workflowItemID);
|
||||
CheckBox claimTask = row.addCell().addCheckBox("workflowID");
|
||||
claimTask.setLabel("selected");
|
||||
claimTask.addOption(workflowItemID);
|
||||
|
||||
// The task description
|
||||
// row.addCell().addXref(url,message("xmlui.Submission.Submissions.claimAction"));
|
||||
@@ -313,8 +312,8 @@ public class Submissions extends AbstractDSpaceTransformer
|
||||
log.error(LogManager.getHeader(context, "Error while adding pooled tasks on the submissions page", ""), e);
|
||||
}
|
||||
}
|
||||
// Row row = table.addRow();
|
||||
// row.addCell(0,5).addButton("submit_take_tasks").setValue(T_w_submit_take);
|
||||
Row row = table.addRow();
|
||||
row.addCell(0,5).addButton("submit_take_tasks").setValue(T_w_submit_take);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -441,7 +441,7 @@ function doNextPage(collectionHandle, workspaceID, stepConfig, stepAndPage, resp
|
||||
//-------------------------------------
|
||||
//perform step processing (this returns null if no errors, otherwise an error string)
|
||||
response_flag = processPage(workspaceID, stepConfig, page);
|
||||
|
||||
|
||||
return response_flag;
|
||||
}
|
||||
|
||||
@@ -504,13 +504,7 @@ function processPage(workspaceID, stepConfig, page)
|
||||
stepClass.setCurrentPage(getHttpRequest(), page);
|
||||
|
||||
//call the step's doProcessing() method
|
||||
try {
|
||||
response_flag = stepClass.doProcessing(getDSContext(), getHttpRequest(), getHttpResponse(), submissionInfo);
|
||||
} catch(exception) {
|
||||
sendPage("handle/" + handle + "/xmlworkflow/workflowexception", {"error":exception.toString()});
|
||||
cocoon.exit();
|
||||
|
||||
}
|
||||
response_flag = stepClass.doProcessing(getDSContext(), getHttpRequest(), getHttpResponse(), submissionInfo);
|
||||
|
||||
//if this is a non-interactive step,
|
||||
//we cannot do much with errors/responses other than logging them!
|
||||
|
@@ -75,6 +75,7 @@
|
||||
</map:matchers>
|
||||
|
||||
<map:actions>
|
||||
<map:action name="ClaimTasksAction" src="org.dspace.app.xmlui.aspect.xmlworkflow.ClaimTasksAction"/>
|
||||
<map:action name="UnclaimTasksAction" src="org.dspace.app.xmlui.aspect.xmlworkflow.UnclaimTasksAction"/>
|
||||
<map:action name="ReturnToSubmitterAction" src="org.dspace.app.xmlui.aspect.xmlworkflow.admin.ReturnToSubmitterAction"/>
|
||||
<map:action name="DeleteWorkflowItemsAction" src="org.dspace.app.xmlui.aspect.xmlworkflow.admin.DeleteWorkflowItemsAction"/>
|
||||
@@ -133,6 +134,10 @@
|
||||
reviewing those submissions.
|
||||
-->
|
||||
<map:match pattern="submissions">
|
||||
<map:match type="request" pattern="submit_take_tasks">
|
||||
<map:act type="ClaimTasksAction" />
|
||||
</map:match>
|
||||
|
||||
<map:match type="request" pattern="submit_return_tasks">
|
||||
<map:act type="UnclaimTasksAction"/>
|
||||
</map:match>
|
||||
@@ -159,6 +164,12 @@
|
||||
</map:transform>
|
||||
</map:match>
|
||||
|
||||
<map:match pattern="handle/*/*/workflow/workflowexception">
|
||||
<map:transform type="WorkflowExceptionTransformer">
|
||||
<map:parameter name="error" value="{flow-attribute:error}"/>
|
||||
</map:transform>
|
||||
</map:match>
|
||||
|
||||
<map:match type="WildcardParameterMatcher" pattern="true">
|
||||
<map:parameter name="parameter-name" value="flow"/>
|
||||
<map:parameter name="flow" value="{flow-attribute:flow}"/>
|
||||
|
Reference in New Issue
Block a user