<%/****************************************************************************** * 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="java.util.ArrayList" %> <%@ page import="java.util.Vector" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.AttachmentBean"%> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.FrontlineException" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.helper.GraphVizHelper" %> <%@ page import="com.edeal.frontline.helper.custom.WorkflowHelper" %> <%@ page import="org.apache.axis.encoding.Base64" %> <%@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 workflowGraph = (String)flRequest.getAttribute("WkfGraph"); workflowGraph = workflowGraph.substring(0, workflowGraph.trim().length()-1); StringBuilder graphSource = new StringBuilder(); graphSource.append(workflowGraph); GraphVizHelper gv = new GraphVizHelper(); gv.setDotSource(graphSource); String field = flRequest.getRequestParameterOrAttribute("field"); Vector statusCodes = (Vector)flRequest.getAttribute("statusCodes"); int i = 1; for(Hashtable codeHash : statusCodes){ String codeDisp = ""; String code = (String)codeHash.get("Ref.RefVal"); try { String codeID = dico.getRefIdByCode(field, code); codeDisp = (String) dico.getRefDisp(field, codeID); } catch (FrontlineException e1) { logger.error(e1); } gv.addln("\""+codeDisp+"\\n("+code+")\\n\\n\\n\\n\" [shape=none, color=\"#55B1F1\", fontsize=8, fontcolor=\"#444444\", fontname=\"Arial, Verdana, sans-serif\", fillcolor=\"#BBEAFF\", image=\"__selected_status_icon__\"];"); if(i==statusCodes.size()){ gv.addln("\""+codeDisp+"\\n("+code+")\\n\\n\\n\\n\" [shape=none, color=\"#55B1F1\", fontsize=8, fontcolor=\"#444444\", fontname=\"Arial, Verdana, sans-serif\", fillcolor=\"#BBEAFF\", image=\"__current_status_icon__\"];"); } i++; } gv.addln(gv.end_graph()); AttachmentBean img = new AttachmentBean(context); String serviceError = ""; String img64 = ""; try{ img = WorkflowHelper.getGraphAsAnImg(context, gv.getDotSource(), "png"); Base64 base64 = new Base64(); img64 = base64.encode(img.getAttFile()); }catch(FrontlineException e){ serviceError = e.getMessage(); } %>