diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 08cc445d1f..3641f99700 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -1197,6 +1197,7 @@ reassign_task_desc=This dialog allows you to reassign a task. reassign_select_user=Select the user to assign the task to, then press OK. error_reassign_task=Unable to reassign the task due to system error: part_of_workflow=Part of Workflow +workflow_outline=Workflow Outline initiated_by=Initiated by started_on=Started on add_resource=Add Resource diff --git a/source/java/org/alfresco/web/app/servlet/JBPMProcessImageServlet.java b/source/java/org/alfresco/web/app/servlet/JBPMProcessImageServlet.java deleted file mode 100644 index fd4e895f5e..0000000000 --- a/source/java/org/alfresco/web/app/servlet/JBPMProcessImageServlet.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.alfresco.web.app.servlet; - -import java.io.IOException; -import java.io.OutputStream; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.jbpm.JbpmContext; -import org.jbpm.graph.def.ProcessDefinition; - - -// -// -// TODO: DC: Tidy up -// -// - - - - -public class JBPMProcessImageServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - long processDefinitionId = Long.parseLong( request.getParameter( "definitionId" ) ); - JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext(); - ProcessDefinition processDefinition = jbpmContext.getGraphSession().loadProcessDefinition(processDefinitionId); - byte[] bytes = processDefinition.getFileDefinition().getBytes("processimage.jpg"); - OutputStream out = response.getOutputStream(); - out.write(bytes); - out.flush(); - - // leave this in. it is in case we want to set the mime type later. - // get the mime type - // String contentType = URLConnection.getFileNameMap().getContentTypeFor( fileName ); - // set the content type (=mime type) - // response.setContentType( contentType ); - } -} diff --git a/source/java/org/alfresco/web/app/servlet/WorkflowDefinitionImageServlet.java b/source/java/org/alfresco/web/app/servlet/WorkflowDefinitionImageServlet.java new file mode 100644 index 0000000000..731e89d673 --- /dev/null +++ b/source/java/org/alfresco/web/app/servlet/WorkflowDefinitionImageServlet.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.web.app.servlet; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.StringTokenizer; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.cmr.workflow.WorkflowException; +import org.alfresco.service.cmr.workflow.WorkflowService; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + + +/* + * Render Workflow Definition Image + */ +public class WorkflowDefinitionImageServlet extends HttpServlet +{ + private static final long serialVersionUID = 1L; + + /* (non-Javadoc) + * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException + { + // retrieve workflow definition id + String uri = request.getRequestURI(); + uri = uri.substring(request.getContextPath().length()); + StringTokenizer t = new StringTokenizer(uri, "/"); + if (t.countTokens() != 2) + { + throw new WorkflowException("Workflow Definition Image servlet does not contain workflow definition id : " + uri); + } + t.nextToken(); // skip servlet name + String workflowDefinitionId = t.nextToken(); + + // retrieve workflow definition image + WebApplicationContext wc = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()); + WorkflowService workflowService = (WorkflowService)wc.getBean(ServiceRegistry.WORKFLOW_SERVICE.getLocalName()); + byte[] definitionImage = workflowService.getDefinitionImage(workflowDefinitionId); + + // stream out through response + OutputStream out = response.getOutputStream(); + out.write(definitionImage); + out.flush(); + } + +} diff --git a/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java b/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java index 8026546b5f..f73afefd87 100644 --- a/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java +++ b/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java @@ -471,6 +471,16 @@ public class ManageTaskDialog extends BaseDialogBean public WorkflowInstance getWorkflowInstance() { return this.workflowInstance; + } + + /** + * Returns the URL to the Workflow Definition Image of the current task + * + * @return the url + */ + public String getWorkflowDefinitionImageUrl() + { + return "/workflowdefinitionimage/" + this.workflowInstance.definition.id; } /** diff --git a/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java b/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java index 6b0b1006e7..c65487c76e 100644 --- a/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java +++ b/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java @@ -390,7 +390,7 @@ public class StartWorkflowWizard extends BaseWizardBean { return selectedWorkflow; } - + /** * Sets the selected workflow * diff --git a/source/web/WEB-INF/web.xml b/source/web/WEB-INF/web.xml index cb908365ba..e95a3d85d8 100644 --- a/source/web/WEB-INF/web.xml +++ b/source/web/WEB-INF/web.xml @@ -230,6 +230,11 @@ 5 + + workflowDefinitionImageServlet + org.alfresco.web.app.servlet.WorkflowDefinitionImageServlet + + JBPMDeployProcessServlet org.alfresco.web.app.servlet.JBPMDeployProcessServlet @@ -300,6 +305,11 @@ /jbpm/deployprocess + + workflowDefinitionImageServlet + /workflowdefinitionimage/* + + 60 diff --git a/source/web/jsp/workflow/manage-task-dialog.jsp b/source/web/jsp/workflow/manage-task-dialog.jsp index 68f8ff50db..e8170a429b 100644 --- a/source/web/jsp/workflow/manage-task-dialog.jsp +++ b/source/web/jsp/workflow/manage-task-dialog.jsp @@ -113,7 +113,7 @@ - + @@ -123,4 +123,13 @@ - \ No newline at end of file + + + + + + + + + diff --git a/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp b/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp index 08bd4b827c..9f36d82e5b 100644 --- a/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp +++ b/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp @@ -128,9 +128,15 @@ - + + + + + + \ No newline at end of file