<%@page contentType="text/html;charset=UTF-8" pageEncoding="ISO-8859-1" session="true"
%><%@page errorPage="AdminException.jsp"
%><%@page import="com.fujitsu.iflow.model.wfcore.WFAdminSessionImpl"
%><%@page import="com.fujitsu.iflow.model.util.URLEncoder"
%><%@page import="com.fujitsu.iflow.model.bpm.BPMAdmin"
%><%@page import="com.fujitsu.iflow.model.bpm.BPMSession"
%><%@page import="com.fujitsu.iflow.model.bpmcore.BPMAdminImpl"
%><%
    request.setCharacterEncoding("UTF-8");request.getParameterNames(); //Need dummy call for WL9.1
    BPMSession bps = (BPMSession) session.getAttribute("BPMSession");
    if (bps == null) {
        %><jsp:include page="PasswordPanel.jsp" flush="true"/><%
        return;
    }

    BPMAdmin bpas = bps.getAdmin();
    WFAdminSessionImpl wfSession = ((BPMAdminImpl)bpas)._wfas;

    String selectedPlanID = (String)request.getParameter("planId");
    String editMode = (String) request.getParameter("editMode");

    boolean isEditMode = false;
    if(editMode!=null && editMode.equalsIgnoreCase("true")) isEditMode = true;

    String xpdlURL = "XPDLGenerator.jsp?planId="+selectedPlanID + "&fromConsole=true";
    String bpelURL = "BPELGenerator.jsp?planId="+selectedPlanID;
    String graphicalURL = "PDGraphic.jsp?planId="+selectedPlanID;
    String graphicalEditorURL = "ProcessEditor.jsp?AppletCommand=EditTemplate&TemplateID="+selectedPlanID;
    String commandURL = "EditPDMode.jsp?pdId="+selectedPlanID+"&mode=";
%>

<table cellpadding=2 cellspacing=1 class="tableclass" align="center" width="100%">
  <tr>
    <td style="filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr='#CCCCCC', endColorStr='#FFFFFF', gradientType='1')" align="right">
      <div align="right">
        <% if (!isEditMode) { %>
    <a href="<%=bpelURL %>"><img src="images/icons/bpel.gif" border="0"></a>&nbsp;
        <a href="<%=xpdlURL %>"><img src="images/icons/xpdl.gif" border="0"></a>&nbsp;
        <a href="<%= graphicalURL %>"><img src="images/graphical_view.gif" border="0"></a>&nbsp;
        &nbsp;&nbsp;<a href="<%=graphicalEditorURL%>"><img src="images/edit_sm.gif" width="13" height="13" border="0">
        Graphical Edit </a>&nbsp;&nbsp;<a href="<%=commandURL+"Edit"%>"><img src="images/edit_sm.gif" width="13" height="13" border="0">
        Text Edit </a> &nbsp;&nbsp;<a href="<%=commandURL+"Delete"%>"><img src="images/edit_sm.gif" width="13" height="13" border="0">
        Delete </a> &nbsp;&nbsp;<a href="<%=commandURL+"Copy"%>"><img src="images/edit_sm.gif" width="13" height="13" border="0">
        Copy </a>
        <% } else { %>
        &nbsp;&nbsp;<a href="<%=commandURL+"Save"%>"><img src="images/edit_sm.gif" width="13" height="13" border="0">
        Save </a>&nbsp;&nbsp;<a href="<%=commandURL+"Cancel"%>"><img src="images/edit_sm.gif" width="13" height="13" border="0">
        Cancel Edit </a>
        <% } %>
      </div>
    </td>
  </tr>
</table>

<%!
    public WFAdminSessionImpl getiFlowSession(Object modelObject)
    {
            return (WFAdminSessionImpl)(modelObject);
    }

%>
