<%-- * Licensed Materials - Property of IBM * * 5724-U18 * * (C) COPYRIGHT IBM CORP. 2006,2015 All Rights Reserved. * * US Government Users Restricted Rights - Use, duplication or * disclosure restricted by GSA ADP Schedule Contract with * IBM Corp. --%><%-- This JSP is the handler for Inbox Portlet component. It provides the user interface for the portlet. Main Events fired by this component are - Open Assignment Record - Update Inbox - Route Assignment CREATED ON: April 18, 2006 --%> <%@ include file="../common/simpleheader.jsp" %><% String layoutId = component.getProperty("layoutid"); InboxPortlet portletControl = (InboxPortlet)control; PortletStateImpl portletStateManager = portletControl.getStateManager(); //intially when the portlet has not been loaded //if the portlet has not been loaded ever call this. //once its loaded we do not clear the flag if(portletStateManager.isPortletNotLoaded(component)) { %><%@ include file="portletloader.jsp" %><% } else { synchronized (portletControl.getAppBean().getPortletLoadingSync()) { String sortLabel = wcs.getMessage("startcntr","sortlbl"); Vector inboxColumns = null; ArrayList inboxNonPersistentColumns = null; String arrColumn[] = null; MboValueData assignments[][] = null; MboValueData keyAttributeData[][] = null; MboSetInfo[] mboSets = null; int noOfRecords = 0; int iStart = 0; int iEnd = 0; int rowsToDisplay = 5; String latestDate = ""; String descTitle = ""; String sortType = ""; String sortAttribute = ""; String nextSort = ""; String labels[] = portletControl.getLabels(); int noOfCols = 0 ; //Take off labels 1,2,3,8 boolean changed = control.hasChanged(); boolean stateChanged = portletStateManager.isPortletStateChanged(); String statusEvents = "onmouseout=\"return noStatus();\" "+ "onfocus=\"return noStatus();\" "+ "onmouseover=\"return noStatus();\" "+ "onkeypress=\"if(hasKeyCode(event,'KEYCODE_ENTER')) {sendEvent('refreshdata','"+control.getId()+"','refresh');}\" "; //if just porlet was minimised then don't re render as there is no need to redraw //but this flag had to be turned on when these events were fired so that jsp could be hit if(stateChanged) portletControl.setChangedFlag(false); boolean load = false; if((portletStateManager.wasPortletLoadCalled()) || (portletStateManager.isPortletLoaded() && component.hasChanged() && !stateChanged)) { load = true; try { inboxColumns = portletControl.getInboxColumns(); noOfCols = inboxColumns.size(); //If portlet is not configured with columns, then just get count if(noOfCols > 0) { mboSets = portletControl.getSetsInfo(); //bidi-hcg-SC assignments = portletControl.getAssignments(); noOfRecords = portletControl.getNoOfAssignments(); descTitle = portletControl.getDescTitle(); if (BidiUtils.isBidiEnabled() && mboSets[1] != null) //bidi-hcg-SC descTitle = BidiUtils.applyBidiAttributes(mboSets[1], "", descTitle, s); keyAttributeData = portletControl.getKeyAttributeData(); latestDate = portletControl.getLatestDate(); inboxNonPersistentColumns = portletControl.getNonPersistentColumns(); } sortType = component.getProperty("sorttype"); sortAttribute = component.getProperty("sortattribute"); iStart = Integer.parseInt(component.getProperty("start")); rowsToDisplay = Integer.parseInt(component.getProperty("rowstodisplay")); if(rowsToDisplay == 0) rowsToDisplay = 10; iEnd = iStart+rowsToDisplay; } catch(Throwable e ) { if(wcs.getDebugLevel() > 0) { e.printStackTrace(); } load = false; } holderId="portletbody_"+layoutId; %> " summary="<%=component.getProperty("arialabel")%>"width="100%" cellspacing="0" cellpadding="0" align="<%=defaultAlign%>" class="plinner"> <% String headingsString = ""; if(noOfCols > 0) { %> <% //Display all column heading, both dynamic and fixed String headingId = ""; for(int i = 0;i < noOfCols; i++) { headingId = colId+i; boolean setSort = true; String hdrClass = textcss+" khtc"; String sortField = ""; headingsString += headingId+" "; int sortIndex = i; if(i==0)///first columns always description { sortField = "DESCRIPTION"; sortIndex = -1; if(inboxNonPersistentColumns.contains(sortField)) { setSort = false; } %> <% setSort = true; sortIndex = i; } //if( ((String[])inboxColumns.elementAt(i))[0].equalsIgnoreCase("description") ) // continue; arrColumn = (String[])inboxColumns.elementAt(i); if(inboxNonPersistentColumns.contains(arrColumn[0]) || arrColumn[0].indexOf(".") > 0) { setSort = false; } sortField = arrColumn[0]; String currentTitle = arrColumn[1]; if (BidiUtils.isBidiEnabled() && mboSets[0] != null) //bidi-hcg-SC currentTitle = BidiUtils.applyBidiAttributes(mboSets[0], sortField, currentTitle, s); if (setSort) { %> <% } else { %> <% } }//end for %> <% //Display data fo each column for(int i = 0;i < assignments.length; i++) { %> <% for(int j = 0;j < noOfCols; j++) { MboValueData data = assignments[i][j]; //Get the four key attributes that will be used to route the inbox String sDesc = (keyAttributeData[i][0]).getData(); String sApp = (keyAttributeData[i][1]).getData(); long sAssignId = (keyAttributeData[i][2]).getDataAsLong(); long sOwnerId = (keyAttributeData[i][3]).getDataAsLong(); boolean isOwnerLocked = (keyAttributeData[i][4]).getDataAsBoolean(); String ownerLockedBy = (keyAttributeData[i][5]).getData(); String[] param = { ownerLockedBy }; String lockedbyuser = wcs.getMessage("jspmessages","lockedby",param); String currentData = data.getData(); if(j==0) { if (BidiUtils.isBidiEnabled() && mboSets[1] != null) //bidi-hcg-SC sDesc = BidiUtils.applyBidiAttributes(mboSets[1], "DESCRIPTION", sDesc, s); if(isOwnerLocked) { %> <% } else { %> <% } } //if( ((String[])inboxColumns.elementAt(j))[0].equalsIgnoreCase("description") ) // continue; if (BidiUtils.isBidiEnabled() && mboSets[1] != null) //bidi-hcg-SC currentData = BidiUtils.applyBidiAttributes(mboSets[1], ((String[])inboxColumns.elementAt(i))[0], currentData, s); %> <% if(j == noOfCols-1) { if(isOwnerLocked) { %> <% } else { %> <% } // end ownerlocked }//end if }//end for %> <% if((i+1) < assignments.length) { %> <% } }//end for //If There are more records to display, display scrolling links if(noOfRecords > 0 ) { %> <% } }//if columsne exists if(noOfCols==0) { %> <%@ include file="portletnotsetupmsg.jsp" %> <% } else if(noOfRecords ==0) { %> <% } %>
<% if(noOfRecords > 0 ) { %> <% } %>
<% if(!latestDate.equals("")) { %> <%= labels[7] %>: <%= latestDate %> <% }else { %>   <% } %> <%@ include file="portletlistscroll.jsp" %> href="javascript:sendEvent('refreshdata','<%=control.getId() %>','refresh')"> <%= labels[6] %>
  0) { %>tabindex="0" title="<%= WebClientRuntime.makesafevalue(descTitle) %>" class='text pl ibhc' onkeypress="if(hasKeyCode(event,'KEYCODE_ENTER')) {sendEvent('sort','<%= id %>','<%=sortIndex%>');}" href="javascript:sendEvent('sort','<%= id %>','<%=sortIndex%>')" <% } else {%>href="Javascript: void"<%}%>> <%= descTitle %> <% if(sortAttribute.equalsIgnoreCase(sortField)){%> <%@ include file="portletsort.jsp" %> <% } %>   0 ) { %>title="<%= WebClientRuntime.makesafevalue(currentTitle) %>" tabindex="0" class='text pl ibhc' onkeypress="if(hasKeyCode(event,'KEYCODE_ENTER')) {sendEvent('sort','<%= id %>','<%=sortIndex%>');}" href="javascript:sendEvent('sort','<%= id %>','<%=sortIndex%>')"<%} else {%>href="Javascript: void"<%}%>><%= WebClientRuntime.makesafevalue(currentTitle) %> <% if(sortAttribute.equalsIgnoreCase(sortField)){%> <%@ include file="portletsort.jsp" %> <% } %>    <%=WebClientRuntime.makesafevalue(currentTitle)%><%= labels[5] %>
  <%= WebClientRuntime.makesafevalue(sDesc) %>   <%= sDesc %>    <%= currentData %> <%= lockedbyuser %> <%= labels[5] %>
<%= labels[0] %> <%= HTML.encodeTolerant(portletControl.getUserName()) %>
<%}else{%><%}%>]]>
<% portletStateManager.setStateLoaded(); if(portletControl.hasChanged()) { control.setChangedFlag(false); } } //end if render ///If the portlet state is changed then fire the javascript to toggle its state if(portletControl.isPortletStateChanged()) { %>> var portletContent = document.getElementById("portletbody_<%= component.getProperty("layoutid") %>_outer"); hideShowElement("portletbody_<%=component.getProperty("layoutid")%>_outer",(portletContent.style.display =='none')); ]]> <% portletStateManager.setPortletStateChanged(false); } } } %><%@ include file="../common/componentfooter.jsp" %>