<%@ page import="com.progress.lang.Character" %> <%@ page import="com.progress.lang.LongChar" %> <%@ page import="com.savvion.common.appinfo.*" %> <%@ page import="com.savvion.sbm.bizmanage.api.*" %> <%@ page import="com.savvion.sbm.bizmanage.util.BizLogicConnection" %> <%@ page import="com.savvion.sbm.bizlogic.server.svo.*" %> <%@ page import="java.util.*" %> <%@ page import="com.savvion.sbm.bpmportal.bizsite.util.*"%> <%@ page import="com.savvion.sbm.bpmportal.util.ServletUtilities" %> <%@ page import="com.savvion.sbm.bizmanage.aim.AimUtil"%> <%@ page import="com.savvion.sbm.bpmportal.util.*"%> <%@ page import="com.savvion.sbm.bpmportal.bizsite.doclets.DocReceiver"%> <%@ page import="com.savvion.sbm.bizmanage.api.Dataslot"%> <%@ page import="com.savvion.sbm.bizmanage.util.ReportType"%> <%@ page errorPage="psv_error.jsp" %> <%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %> <%@ taglib uri="/bpmportal/tld/bpmportal.tld" prefix="sbm" %> <%@ include file="../common/include_tag.jspf" %> <% bizManage.setRequest(request); bizManage.setResponse(response); if(ServletUtil.hasSpecialCharsInRequest4(request)) throw new Exception("Request contains special characters"); String currPiStatus=null; String ptid = request.getParameter("PTID"); if (ptid == null) ptid = bizManage.getDefaultPTID(); String piid = request.getParameter("PIID"); if (piid == null) piid = bizManage.PI_ALL; String piname = request.getParameter("piName"); if (piname == null) piname = ""; else piname = bizManage.hexDecode(piname); String ptname = bizManage.getPTNameFromPTID(ptid); String linkfrom = request.getParameter("link"); if(linkfrom == null){ linkfrom = "report"; } if(linkfrom.equals(PortalConstants.BEANALYSIS)){ linkfrom=linkfrom + PortalConstants.NOMENUS_NOBREADCRUM; } if (request.getParameter("saveparameter") != null) { Enumeration names = request.getParameterNames(); Map dataslots = new HashMap(request.getParameterMap().size()-5); while(names.hasMoreElements()) { String name = (String) names.nextElement(); /**** Modified for BUSINESS EXPERT CODE INTEGRATION ****/ if ((ReportType.EXTERNAL.equalsIgnoreCase(name))||(name.equals("saveparameter"))||(name.equals("PTID"))||(name.equals("PIID"))||(name.equals("piName"))||(name.equals("action")) || (name.equals("link")) ||(name.equals("NoBreadcrumbs"))|| (name.equals("NoMenus"))|| (name.equals("requestUrl"))|| ("ptName".equals(name))||(name.startsWith("doccheck_mandatory_"))||(name.startsWith("bizsite_dataslot_")) || ("reportappName".equals(name)) || (name.startsWith("xmlcheck_mandatory_"))) continue; Map mapValue = (Map)session.getAttribute(name); if(mapValue == null) { String value = bizManage.getUTFString(name); if( name != null && name.trim().length() > 0 && value != null ) { Object docDS = DocReceiver.getDocumentValue(PortalUtil.getSessionId(session), name); // If Document DS then get the value from DocReceiver if(docDS != null) { dataslots.put(name, docDS); } else { AppInfo appInfo = AppInfoKeeper.getAppInfo(ptname); String dataslotType = appInfo.getDataslotType(name); if(Dataslot.LONG.equals(dataslotType) || Dataslot.ABL_INT64.equals(dataslotType)) { try{ dataslots.put(name, String.valueOf(PortalNumberFormatUtil.parseLocalizedLong(value, bizManage.getLocale()))); } catch (Exception ex){dataslots.put(name, null);} } else if(Dataslot.ABL_INTEGER.equals(dataslotType)) { try{ dataslots.put(name, String.valueOf(Integer.parseInt(value))); } catch (Exception ex){dataslots.put(name, null);} } else if(Dataslot.DOUBLE.equals(dataslotType)) { dataslots.put(name, String.valueOf(PortalNumberFormatUtil.parseLocalizedDouble(value, bizManage.getLocale()))); } else if(Dataslot.DECIMAL.equals(dataslotType) || Dataslot.ABL_DECIMAL.equals(dataslotType)) { try{ dataslots.put(name, PortalNumberFormatUtil.parseLocalizedBigDecimal(value, bizManage.getLocale()).toPlainString()); } catch (Exception ex){dataslots.put(name, null);} } else { dataslots.put(name, value); } } } } else { String[] values = bizManage.getUTFValues(name); Map newValues = new HashMap(); Iterator iter = mapValue.keySet().iterator(); while(iter != null && iter.hasNext()) { String key = (String)iter.next(); newValues.put(key,null); } //Remove the ds data from session session.removeAttribute(name); if(values != null && values.length > 0) { for(int i=0;i < values.length;i++) { String value = values[i]; if(value != null && !"update".equals(value)) newValues.put(value, Boolean.TRUE.toString()); } } dataslots.put(name, newValues); } } bizManage.setInstanceDataslotValue(piid,dataslots); //redirect to confirmation page. StringBuffer dataslotsConfirmURL = new StringBuffer(bizManage.encode("../myhome/dataslots_cnf.jsp")); dataslotsConfirmURL.append("?piName=").append(request.getParameter("piName")); dataslotsConfirmURL.append("&PTID=").append(ptid); dataslotsConfirmURL.append("&PIID=").append(piid); dataslotsConfirmURL.append("&link=").append(linkfrom); response.sendRedirect(dataslotsConfirmURL.toString()); } StringBuffer psvURL = new StringBuffer(bizManage.encode("../myhome/psv_chart_view.jsp")); psvURL.append("?piName=").append(request.getParameter("piName")); psvURL.append("&PTID=").append(ptid); psvURL.append("&PIID=").append(piid); psvURL.append("&link=").append(linkfrom); StringBuffer tabularViewURL = new StringBuffer(bizManage.encode("../myhome/psv_table_view.jsp")); tabularViewURL.append("?piName=").append(request.getParameter("piName")); tabularViewURL.append("&PTID=").append(ptid); tabularViewURL.append("&PIID=").append(piid); tabularViewURL.append("&link=").append(linkfrom); StringBuffer auditURL = new StringBuffer(bizManage.encode("../myhome/audit_history.portal")); auditURL.append("?").append(PortalConstants.VIEW).append("=").append(PortalConstants.TASK); auditURL.append("&").append(PortalConstants.PINAME).append("=").append(bizManage.hexEncode(piname)); auditURL.append("&").append(PortalConstants.PIID).append("=").append(piid); auditURL.append("&").append(PortalConstants.PTID).append("=").append(ptid); %> <sbm:message key="ViewDataSlotsImgAlt" /> - <sbm:message key="SBM" /> <%@ include file="../common/include_css_static.jsp" %> <%@ include file="../common/include_top.jsp" %>
');">
<% String menu1 = "1"; String submenu1 = "0"; LinkedHashMap menu = null; if ("status".equals(linkfrom)) { menu1 = "0"; submenu1 = "1"; } else if ("report".equals(linkfrom)) { menu1 = "1"; submenu1 = "2"; } %> <%@ include file="../common/include_menu_static.jsp" %>
<% if(ServletUtil.isBreadcrumbEnabled(request)) {%> <% } %>
" />
<% ArrayList dataslots = bizManage.getInstanceDataslots(ptid,piid,piname); boolean dontUpdate = true; boolean enableButtons = false; StringBuffer dateConvert = new StringBuffer(""); StringBuffer textAreaCheck = new StringBuffer(""); StringBuffer dateFix = new StringBuffer(""); for (int i=0;i <% } %> <% if (dataslot.hasChoices()) { ArrayList allchoices = dataslot.getChoices(); HashMap choiceLabels = dataslot.getChoiceLabels(); %> <% } else if (dataslot.isDocument() || dataslot.isObject() || dataslot.isSet() || dataslot.isList()) { %> <%= ((dataslot.isDocument())?"":"") %> <% } //end dataslot.isDocument() || dataslot.isObject() || dataslot.isSet() || dataslot.isList() else if (dataslot.isABLLongChar()) { String dsValue = ""; LongChar charValue = null; if (dataslot.getValue() instanceof LongChar) { charValue = (LongChar) dataslot.getValue(); dsValue = charValue.getValue(); } else dsValue = (null == dataslot.getValue()) ? "" : dataslot.getValue().toString(); if (dsValue != null) { final String tempVal = dsValue; dsValue = PortalUtil.getShortString(tempVal); } else dsValue = ""; %> <% } //end dataslot.isABLLongChar() else if (dataslot.isMultiLine()) { %> <% textAreaCheck.append("var textarea").append(i).append(" = document.getElementById('ta").append(i).append("');\n"); textAreaCheck.append("if (textarea").append(i).append(".value.length > ").append(dataslot.getSize()-1).append(")\n"); textAreaCheck.append("{\n"); textAreaCheck.append("\talert('").append(bizManage.getResourceString("textAreaAlert1")).append(" ").append(dataslot.getLabel()); textAreaCheck.append(" ").append(bizManage.getResourceString("textAreaAlert2")).append(" ").append(dataslot.getSize()-1); textAreaCheck.append(" ").append(bizManage.getResourceString("textAreaAlert3")).append("');\n"); textAreaCheck.append("\treturn false;\n"); textAreaCheck.append("}\n"); } //end dataslot.isMultiLine() else if (dataslot.isBoolean() || dataslot.isABLLogical()) { %> <% } //end datslot.isBoolean() else if (dataslot.isString() || dataslot.isURL() || dataslot.isABLCharacter()) { String type = "text"; if(dataslot.isPassword()){ type = "password"; } String dsValue = ""; if ((dataslot.isABLCharacter()) && dataslot.getValue() instanceof Character) { Character charValue = (Character) dataslot.getValue(); dsValue = charValue.getValue(); dsValue = (dsValue == null) ? "" : AimUtil.getHtmlSafeString(dsValue); } else dsValue = AimUtil.getHtmlSafeString(dataslot.getValue().toString()); %> <% }// end dataslot.isString() || dataslot.isURL else if ( dataslot.isLong() || dataslot.isDouble() || dataslot.isABLInteger() || dataslot.isABLInt64()) { String type = "text"; String finalValue = ""; Number nValue = null; try{ if(dataslot.isLong()) nValue = Long.parseLong(dataslot.getValue().toString()); else if(dataslot.isDouble()) nValue = Double.parseDouble(dataslot.getValue().toString()); else if(dataslot.isABLInteger()){ com.progress.lang.Integer intt = (com.progress.lang.Integer)dataslot.getValue(); if(intt.getValue() != null){ nValue = Integer.parseInt(dataslot.getValue().toString()); } } else if(dataslot.isABLInt64()){ com.progress.lang.Int64 int64 = (com.progress.lang.Int64)dataslot.getValue(); if(int64.getValue() != null){ nValue = Long.parseLong(dataslot.getValue().toString()); } } }catch(Exception ex){} if( ! ( nValue == null && (dataslot.isABLInteger() || dataslot.isABLInt64())) ) finalValue = PortalNumberFormatUtil.prepareLocalizedNumber(nValue, bizManage.getLocale()); %> <% }// end dataslot.isLong() || dataslot.isDouble() else if (dataslot.isDecimal()) { Decimal decimal = (Decimal) dataslot.getValue(); Locale locale = bizManage.getLocale(); String dsValue = PortalNumberFormatUtil.prepareLocalizedNumber(decimal.getValue(), locale); %> <% }// end dataslot.isDecimal() else if (dataslot.isABLDecimal()) { String dsValue; Locale locale = bizManage.getLocale(); java.math.BigDecimal bigdecimal = (java.math.BigDecimal) (((com.progress.lang.Decimal)(dataslot.getValue())).getValue()); if(bigdecimal != null) dsValue = PortalNumberFormatUtil.prepareLocalizedNumber(bigdecimal, bizManage.getLocale()); else dsValue = ""; %> <% }// end dataslot.isABLDecimal() else if (dataslot.isDateTime() || dataslot.isABLDateTime()) { String datetimeValue = ""; if(dataslot.isABLDateTime()){ com.progress.lang.DateTimeTZ dateTimeTZ = (com.progress.lang.DateTimeTZ) dataslot.getValue(); java.util.GregorianCalendar gc = (java.util.GregorianCalendar) dateTimeTZ.getValue(); datetimeValue = gc == null ? "" : bizManage.getDate(gc.getTime().getTime(), ptname, dataslot.getName()); }else{ DateTime datetime = (DateTime) dataslot.getValue(); datetimeValue = ( (datetime == null) ? "": ( (datetime.getValue() == null) ? "" : bizManage.getDate(datetime.getValue().getTime(), ptname, dataslot.getName()))); } dateConvert.append("\tdocument.dataslot.").append(dataslot.getName()); dateConvert.append(".value = date2Long(document.dataslot.").append(dataslot.getName()); dateConvert.append(".value);\n"); dateFix.append("\tlong2Date(document.dataslot.").append(dataslot.getName()).append(");\n"); %> <% }// end dataslot.isDateTime() else if (dataslot.isXML()) { %> <% }// end dataslot.isXML() else if (dataslot.isMap()) { %> <% }// end dataslot.isMap() %> <% } %> <%-- This is the end of the dataslot table. --%>
" width="20%">: <% if(dataslot.isRequired()){ %> * <% } %> " > <% if(BizLogicConnection.STATUS_UC.equals(dataslot.getName())) { currPiStatus = dataslot.getValue().toString(); } %> " width="50%"><%= dataslot.getValue().toString() %> <% if(dataslot.isDocument()) { %> <% } %> " width="80%">
<%= dsValue%>
" width="50%"> " width="50%">
<%= ((dataslot.getValue().toString().equalsIgnoreCase("true"))?" checked=\"checked\"":"") %> name="<%= dataslot.getName() %>" value="true" />        <%= ((dataslot.getValue().toString().equalsIgnoreCase("false"))?" checked=\"checked\"":"") %> name="<%= dataslot.getName() %>" value="false" />
" width="50%"> name="<%= dataslot.getName() %>" value="<%= dsValue %>" <%= ((dataslot.isString())?"maxlength=\""+dataslot.getSize()+"\"":"") %> <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %> size="<%= ((dontUpdate && AimUtil.getHtmlSafeString(dataslot.getValue().toString()).length() > 40) ? String.valueOf(AimUtil.getHtmlSafeString(dataslot.getValue().toString()).length()+3) : "40")%>" /> " width="50%"> name="<%= dataslot.getName() %>" value="<%= finalValue %>" <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %> size="<%= ((dontUpdate && AimUtil.getHtmlSafeString(dataslot.getValue().toString()).length() > 40) ? String.valueOf(AimUtil.getHtmlSafeString(dataslot.getValue().toString()).length()+3) : "40")%>" /> " width="50%">
<%= DataUtil.self().getDecimalPresentation(ptname,dataslot,bizManage) %>
" width="50%">
id="<%= dataslot.getName() %>" name="<%= dataslot.getName() %>" value="<%= dsValue %>" <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %> />
" width="50%"> <% String dateFmt = DateTimeUtils.getJSCalendarDateFormat(ptname, dataslot.getName(), bizManage.getLocale(), bizManage.getName()); %>
id="<%= dataslot.getName() %>" name="<%= dataslot.getName() %>" value="<%= datetimeValue %>" <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %>/> <%= ((dontUpdate)?"":"")%>Select Date/images/calender.gif" width="16" height="16" border="0" vspace="2" hspace="2" /><%= ((dontUpdate)?"":"") %>
" width="50%"> <%= (String)dataslot.getValue() %> " width="50%"> <% Map mapValue = (Map)dataslot.getValue(); if(mapValue != null && mapValue.size() > 0 ) { Set keys = mapValue.keySet(); Iterator iter = keys.iterator(); while (iter != null && iter.hasNext()) { String key = (String)iter.next(); Object oval = mapValue.get(key); String val = "FALSE"; if (oval != null) val = oval.toString(); %> <% } } session.setAttribute(dataslot.getName(),mapValue); %>
<%= ((dontUpdate)?" disabled=\"disabled\"":"") %> ><%=key%>
" class="ScrnButton" onmouseover="this.className='ScrnButtonHover';" onmouseout="this.className='ScrnButton';" onclick="window.open('../myhome/pop_task_det_pi_notes.jsp?piId=<%= piid %>&fiid=<%=request.getParameter("fiid")%>','Notes','scrollbars=yes,width=900,height=600');" /> " class="ScrnButton" onmouseover="this.className='ScrnButtonHover';" onmouseout="this.className='ScrnButton';" onclick="return checkPISuspended();" /> " class="ScrnButton" onmouseover="this.className='ScrnButtonHover';" onmouseout="this.className='ScrnButton';" onclick="fixDatesOnReset();" /> <% if(linkfrom.equals("report")){ %> " class="ScrnButton" onmouseover="this.className='ScrnButtonHover';" onmouseout="this.className='ScrnButton';" onclick="javascript:goToViewReports('<%=(bizManage.getCurrentReportName() == null ? "" : bizManage.getCurrentReportName())%>','<%= bizManage.hexEncode(bizManage.getCurrentReportPTID())%>','false','<%=bizManage.getNextPage()%>')" /> <% } else if(linkfrom.equals(PortalConstants.LINKFROM_OVERVIEW_TASKS)){ %> " class="ScrnButton" onmouseover="this.className='ScrnButtonHover';" onmouseout="this.className='ScrnButton';" onclick="javascript:goToTaskList()" /> <% } else if(linkfrom.equals(PortalConstants.STATUS)) { %> " class="ScrnButton" onmouseover="this.className='ScrnButtonHover';" onmouseout="this.className='ScrnButton';" onclick="javascript:goToStatus();" /> <% } else if(request.getParameter(PortalConstants.LINK).equals(PortalConstants.BEANALYSIS)){ %> " class="ScrnButton" onmouseover="this.className='ScrnButtonHover';" onmouseout="this.className='ScrnButton';" onclick="parent.Ext.getCmp('drillThruWnd').close();" /> <%} else{ %> " class="ScrnButton" onmouseover="this.className='ScrnButtonHover';" onmouseout="this.className='ScrnButton';" onclick="goToInstanceList();"/> <% }%>
<%@ include file="../common/include_copyright_static.jsp" %>
<%@ include file="../common/include_bottom.jsp" %>