use of org.alfresco.web.bean.workflow.WorkflowBean in project acs-community-packaging by Alfresco.
the class ManageTaskDialogCommand method execute.
/**
* @see org.alfresco.web.app.servlet.command.Command#execute(org.alfresco.service.ServiceRegistry, java.util.Map)
*/
public Object execute(ServiceRegistry serviceRegistry, Map<String, Object> properties) {
ServletContext sc = (ServletContext) properties.get(PROP_SERVLETCONTEXT);
ServletRequest req = (ServletRequest) properties.get(PROP_REQUEST);
ServletResponse res = (ServletResponse) properties.get(PROP_RESPONSE);
FacesContext fc = FacesHelper.getFacesContext(req, res, sc, "/jsp/close.jsp");
WorkflowBean wfBean = (WorkflowBean) FacesHelper.getManagedBean(fc, WorkflowBean.BEAN_NAME);
// setup dialog context from url args in properties map
String taskId = (String) properties.get(PROP_TASKID);
ParameterCheck.mandatoryString(PROP_TASKID, taskId);
String taskType = (String) properties.get(PROP_TASKTYPE);
ParameterCheck.mandatoryString(PROP_TASKTYPE, taskType);
wfBean.setupTaskDialog(taskId, taskType);
NavigationHandler navigationHandler = fc.getApplication().getNavigationHandler();
navigationHandler.handleNavigation(fc, null, "dialog:manageTask");
String viewId = fc.getViewRoot().getViewId();
try {
sc.getRequestDispatcher(BaseServlet.FACES_SERVLET + viewId).forward(req, res);
} catch (Exception e) {
throw new AlfrescoRuntimeException("Unable to forward to viewId: " + viewId, e);
}
return null;
}
Aggregations