%-- * Licensed Materials - Property of IBM * * 5724-U18 * * (C) COPYRIGHT IBM CORP. 2006, 2017 All Rights Reserved. * * US Government Users Restricted Rights - Use, duplication or * disclosure restricted by GSA ADP Schedule Contract with * IBM Corp. --%><%@ page buffer="128kb" import= "psdi.webclient.system.beans.*, psdi.webclient.controls.*,psdi.webclient.system.runtime.WebClientRuntime, psdi.webclient.system.runtime.WebClientConstants, psdi.webclient.system.session.WebClientSession, psdi.webclient.system.controller.*, psdi.util.MXFormat, psdi.mbo.*, java.util.*, java.io.*" %> <% String encoding = (String)session.getAttribute("_encoding"); if (encoding == null) encoding = "UTF-8"; String tableId = request.getParameter("_tbldnld"); WebClientRuntime wcr = WebClientRuntime.getWebClientRuntime(); WebClientSession wcs = wcr.getWebClientSession(request); synchronized (wcs) { AppInstance app = wcs.getCurrentApp(); Table tableControl = null; Hashtable passwordCols = new Hashtable(); if(!WebClientRuntime.isNull(tableId)) { tableControl=(Table)wcs.getControlInstance(tableId,true); } if(tableControl==null) { %> No Table found for download!<% } else { DataBean tableBean = tableControl.getDataBean(); TableBody tableBodyControl = tableControl.getBody(); int childCount = 0; Iterator cols = tableBodyControl.getChildren().iterator(); List dataAttributes = new ArrayList(); List titles = new ArrayList(); while (cols.hasNext()) { ControlInstance child = (ControlInstance)cols.next(); String columnEvent = child.getProperty("mxevent"); String propertyvalue = child.getProperty("dataattribute"); if(!child.getType().equalsIgnoreCase("tablecol") || "".equals(propertyvalue) || "toggleselectrow".equals(columnEvent) || "toggledetailstate".equals(columnEvent)) continue; if(child.getProperty("inputmode").toLowerCase().contains("password")) { propertyvalue = propertyvalue.toLowerCase(); passwordCols.put(propertyvalue, propertyvalue); } propertyvalue = propertyvalue.toLowerCase(); if(!WebClientRuntime.isNull(propertyvalue) && !dataAttributes.contains(propertyvalue)) { dataAttributes.add(propertyvalue); String title = null; String labelSrc = child.getProperty("labelsrcid"); if(!WebClientRuntime.isNull(labelSrc)) { String labelAttr = child.getProperty("labelattributes"); DataBean srcBean = wcs.getDataBean(labelSrc); if(srcBean != null) title = srcBean.getString(labelAttr); } if (WebClientRuntime.isNull(title)) { title = child.getProperty("label"); } titles.add(title == null ? "" : title); } } String[] arrDataAttributes = (String[])dataAttributes.toArray(new String[dataAttributes.size()]); %>
| <%=label%> | <% } %>|||||||||||
| <% } else if (mvd.isHidden() || passwordCols.get(arrDataAttributes[k].toLowerCase()) != null) { %> | XXXXXX | <% } else if (maxType==MXFormat.DURATION) { boolean textFormatDuration = WebClientRuntime.getWebClientSystemProperty(WebClientConstants.WEBCLIENT_DOWNLOADDURATIONASTEXT, "1").equals("1"); if (textFormatDuration) { %><%=mvd.getData()%> | <% } else { %><%=mvd.getDataAsDouble()%> | <% } } else if (maxType==MXFormat.DATE) { if (textFormat) { %><%=mvd.getData()%> | <% } else { %><%=mvd.getData()%> | <% } } else if (maxType==MXFormat.DATETIME) { if (textFormat) { %><%=mvd.getData()%> | <% } else { %><%=mvd.getData()%> | <% } } else if (maxType==MXFormat.INTEGER) { %><%=mvd.getDataAsInt()%> | <% } else if (mvd.isNumeric()) { %><%=mvd.getDataAsDouble()%> | <% } else { strData = WebClientRuntime.makesafevalue(strData); strData = WebClientRuntime.replaceString(strData,"\n", "<%=strData%> | <% } } else { %><% } } } catch (Exception dldex) { System.out.println("Error occurred when downloading a record for table: " + tableId); dldex.printStackTrace(); } finally { %> |