<%/****************************************************************************** * Copyright (c) 2000-2004 e-Deal * * e-Deal S.A. * 55 rue Brillat Savarin * 75013 Paris * France * * T: +33 (0)1 53 80 80 30 * F: +33 (0)1 73 01 69 77 * http://www.e-deal.com * * La diffusion de ce code source sous quelque forme que ce soit sans * l'autorisation de E-DEAL est interdite. * * Vous êtes autorisés à modifier ce code source uniquement pour votre usage * propre et sous réserve que les mentions de copyright demeurent intactes. * * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour * responsable des dommages pouvant résulter de l'utilisation de ce code * source. * ******************************************************************************/%><%@page session="true"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="java.util.Date" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.FrontlineException" %> <%@ page import="java.util.Vector" %> <%@ page import="com.edeal.frontline.helper.custom.WorkflowHelper" %> <%@ page import="com.edeal.frontline.AttachmentBean"%> <%@ page import="com.edeal.frontline.helper.GraphVizHelper" %> <%@ page import="com.edeal.frontline.helper.custom.WorkflowHelper" %> <%@ page import="com.edeal.frontline.helper.XMLHelper" %> <%@ page import="org.apache.axis.encoding.Base64" %> <%@ page import="com.edeal.frontline.services.FlServiceException"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String id = null; try { id = Workflow.getID(); } catch (FieldNotInitializedException e) { } String wkfContent = null; try{ wkfContent = Workflow.getWkfContent(); }catch(FieldNotInitializedException e){ } boolean hasGraphVizService; try{ context.getServiceManager().getServiceClient("GraphViz"); hasGraphVizService = true; }catch(FlServiceException e){ hasGraphVizService = false; } WorkflowHelper workflowHelper = new WorkflowHelper(Workflow); wkfContent = XMLHelper.formatToColoredXML(wkfContent); boolean isValid = false; String errorMsg = workflowHelper.isXMLValid(); isValid = Utils.isEmpty(errorMsg); String workflowGraph = flRequest.getRequestParameterOrAttribute("WkfGraph"); StringBuilder graphSource = new StringBuilder(); graphSource.append(workflowGraph); GraphVizHelper gv = new GraphVizHelper(); gv.setDotSource(graphSource); AttachmentBean img = new AttachmentBean(context); boolean gotImg = false; String serviceError = ""; String img64 = ""; if(hasGraphVizService){ try{ img = WorkflowHelper.getGraphAsAnImg(context, gv.getDotSource(), "png"); gotImg = true; Base64 base64 = new Base64(); img64 = base64.encode(img.getAttFile()); }catch(FrontlineException e){ serviceError = e.getMessage(); } } %> " ou="<%= \"/read_workflow.fl\" + (id != null ? \"?id=\" + id : \"\") %>">
" nbPix="30">
 
<%if(gotImg){ %> <%}else{ %> <%} %>
<%=wkfContent %>
<%if(!Utils.isEmpty(errorMsg)){ %> ">
			<%=errorMsg%>
			
<%} %>