<%-- * 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 import="java.net.URLEncoder" %><%@page import="com.ibm.json.java.JSONArray" %><%@page import="com.ibm.json.java.JSONObject" %><%@page import="psdi.webclient.system.dojo.Dojo" %><%@include file="../common/simpleheader.jsp" %><%@include file="../common/reportrunner.jsp" %><% boolean debugHiddenFrame = (debug && Boolean.parseBoolean(WebClientRuntime.getWebClientProperty("debughiddenframe", "false"))); boolean allowInSubFrame = Boolean.parseBoolean(WebClientRuntime.getWebClientProperty("webclient.allowinsubframe", "false")); boolean mobileDatePicker = ismobile; String sessionid = wcs.getUISessionID(); String sessionUrlParam = wcs.getUISessionUrlParameter() + wcs.getCSRFTokenParameter(); String presentationid = app.getId(); boolean everyplace = WebClientRuntime.getWebClientRuntime().hasLicenseAccess("EVERYPLACE"); String userLocale = s.getUserInfo().getLocale().getLanguage(); String viewportSize = app.getProperty("viewport"); String viewportWidth = "0"; String viewportHeight = "0"; java.util.Locale locale = new java.util.Locale(userLocale); String datePattern=MXFormat.getDatePattern(locale); String timePattern=MXFormat.getTimePattern(locale); Boolean simpledomainDownload = WebClientRuntime.getWebClientSystemProperty(WebClientConstants.WEBCLIENT_SIMPLEDOMAINDOWNLOAD, "1").equals("1"); Boolean clientDataValidation = app.isAsyncEnabled() && WebClientRuntime.getWebClientSystemProperty(WebClientConstants.WEBCLIENT_CLIENTDATAVALIDATION, "0").equals("1"); Boolean systemNavBar = wcs.showSystemNavBar(currentPage); String bodyRole = WebClientRuntime.getWebClientSystemProperty(WebClientConstants.WEBCLIENT_BODY_ARIAROLE, "main"); String maximoJSDirectory = Dojo.getMaximoJavascriptDirectory(request); boolean newApplinking = app.inAppLinkMode(); int applinkDivs = 0; int xIndex = viewportSize.indexOf('x'); String filePromptText = WebClientRuntime.getWebClientSystemProperty("mxe.doclink.usefileprompt", "0"); boolean vertLabels = wcs.useVerticalLabels(); if(xIndex!=-1) { viewportWidth = viewportSize.substring(0,xIndex); viewportHeight = viewportSize.substring(xIndex+1); } if(ismobile) { //Mobile apps will always use the mobile skin. app.setSkin("mobile"); } else { //Otherwise if a skin is defined for the presentation that will be used. app.setSkin(app.getProperty("skin")); } wcs.applySkin(); skin = wcs.getSkin(); String skinName = wcs.getSkinName(); String maximoJSSkinDirectory = (skinName.equals("") || skinName.equals("classic"))?"/javascript/"+maximoJSDirectory:"/"+skin+"css/../js/"; IMAGE_PATH = ""; CSS_PATH = wcs.getCssURL(); boolean debugDojo = "1".equals(WebClientRuntime.getWebClientSystemProperty(WebClientConstants.WEBCLIENT_DOJO_DEBUG, "false")) || "1".equals(request.getParameter("debugDojo")); String cssFile = component.getProperty("cssfile"); if(rtl) { cssFile = "RTL"+cssFile; } app.getHotkeys().reset(); request.setAttribute(WebClientSessionManager.UISESSIONID, sessionid); boolean rerender = (designmode && component.needsRender() && hiddenFrame); Stack appStack = control.getWebClientSession().getAppStack(); if(component.needsRender()) { String apptitle = control.getWebClientSession().getCurrentApp().getAppTitle(); if(!rerender) { if(BidiUtils.isBidiEnabled()) { String[] bidiTagAttributes = {"","",""}; bidiTagAttributes = BidiClientUtils.getTagAttributes(null,null,apptitle,false); if(bidiTagAttributes[2] != null && bidiTagAttributes[2].length() > 0) { apptitle = BidiUtils.enforceBidiDirection(apptitle,bidiTagAttributes[2]); } } //HTML 5 doctype %> <% if(rtl) //viewport not well supported for bidi settings by mobile browsers { if(wcs.getUserAgent()!=WebClientSession.AGENT_SAFARI) { //rtl on safari ios6 is having issues when yo ufocus on a field. (scrolls to incorrect location) // We have decided to not set a viewpport in ios at this time to solve this problem until ios fixes it. %> <% } } else { %> <% } %> " target="_self"/> <% boolean useabsimgpath = Boolean.parseBoolean(WebClientRuntime.getWebClientProperty("webclient.useabsoluteimagepath")); if(useabsimgpath==true) { %> <% } %> <%=apptitle %> <% if(mobileDatePicker) { %> <% } %> "/> "/> <%@ include file="../common/imagepreload.jsp" %> <% if(BidiUtils.isBidiEnabled()) { %> <% } %> <% if(mobileDatePicker) { %> <% } %> <% if(!designmode) { %> <% } %> <% String dojoTextDirection = ""; String dojoLocale; // Handle a few special cases where the Maximo language code needs a little massage to // be the correct dojo locale. if ("ZHT".equalsIgnoreCase(langcode)) dojoLocale = "zh-tw"; else if ("NO".equalsIgnoreCase(langcode)) dojoLocale = "nb"; else dojoLocale = langcode.toLowerCase().replace('_', '-'); if(rtl) { dojoTextDirection = "dir=\"rtl\""; } %> <% if (debugDojo) { // If we're in debug mode, load the uncompressed layers %> <% for (String layer : Dojo.getDojoLayers("/webclient/javascript/" + dojoDirectory + "/layers/", request.getSession().getServletContext())) { %> <% } } else { %> <% } // We need to load window.js as it is used in the showwait() function in library.js. %> <% // In portal mode and designmode, don't put in the iframe busting code as we need to run in an iframe. if (!wcs.getPortalMode() && !allowInSubFrame && !designmode) { %> <% } //Allows support of internal srolling in apps with navbar String scroll = component.getProperty("scroll"); if(ismobile){ scroll="true"; } else if(systemNavBar) { scroll="false"; } String overflow = ""; if(scroll.equals("false") && !designmode) { scroll = " scroll='no' "; overflow = "overflow:hidden;"; } else { scroll = " "; } %> role="document"<%}%> <%=scroll%> class="tundra<%if(app.getId().equals("startcntr")){%> scBody<%}%><%if(accessibilityMode){%> screenReader<%}%>" <%=dojoTextDirection%> style="<%=overflow%>cursor:wait;padding:0px;margin:0px;height:100%;width:100%" aria-labelledby="titlebar-tb_appname" onkeydown="bodyEvent(event)" onclick="bodyEvent(event)" <% if(designmode || app.getId().equals("designer")){%>oncontextmenu="return false;"<%}%>> role="<%=bodyRole%>"<%}%> id="psuedoForm" aria-label="<%=wcs.getMessage("ui","mainform")%>" role="presentation" action="<%=servletBase%>/maximo.jsp" method="post" onsubmit="return false" onkeypress="if(event.keyCode=='13' && getSourceElement(event).tagName!='TEXTAREA' && getSourceElement(event).tagName!='A'){if(event.preventDefault){ event.preventDefault(); }else{ event.returnValue = false;}}"> <%! /** If we are using the new style app linking, then return enough div's to close the apps, otherwise just an empty string */ public String getClosingDivs(boolean newApplinking, int applinkDivs) { String rtnDivs=""; if(newApplinking) { rtnDivs=""; for(int i=0;i <% if(newApplinking) { Iterator appIterator = appStack.iterator(); int appCount = 1; %>
<% if(appIterator.hasNext()) { AppInstance stackApp = (AppInstance) appIterator.next(); while(appIterator.hasNext()) { String readonlyflag = (String) stackApp.get("returninputR/O"); boolean isReadOnly = ((readonlyflag != null) && ("true".equals(readonlyflag))); stackApp = (AppInstance) appIterator.next(); boolean last = !appIterator.hasNext(); String[] appName = {stackApp.getAppTitle()}; appCount++; %>
<% if (last) { %>
<% if (!isReadOnly) { %><% } %>
<% }%> <% applinkDivs++; } %><% } %>
<% } if(designmode) { %>
<% } } else // else for if (!rerender) block { // gets executed when viewport is changed in designer (DesignerAppBean.setValue calls setRerenderFlags) // or when toggle viewport button is clicked if (designmode) { holderId = "body_double"; %><%@ include file="../common/componentholder_start.jsp" %> <% } // end else for if (!rerender) block %> <%-- used to remove select of text when item cannot take select DO NOT REMOVE --%>tabindex="-1" <%}%>style="position:absolute;top:-1000px"/> height="100%"<%}%> style="vertical-align:top;" role="presentation"> <%} // end if(component.needsRender() block boolean longOpRunning = wcs.hasLongOpStarted() && !wcs.hasLongOpCompleted(); if ( !component.skipRender() && !longOpRunning) { component.renderChildComponents(); } %><%@ include file="../common/webreplay.jsp" %><% if(component.needsRender()) { %>
<% // Bidi_BDL: PMR 54898,003,756: place the dialogholder element in viewport coordinates with left position defined, since dojo constrainedMoveable always operates as though a moveable is LTR String position = rtl ? "fixed" : "absolute"; %> <%if (longOpRunning) { //long op is in progress so only want to render the the longop dialog PageInstance longOpWait = app.getCurrentPage(); if (longOpWait.get("_longopPage") != null) { %><% } } else { for (int pageidx = 1; pageidx < app.getPageStack().size(); pageidx++) { %> <% } } %> <% if(!designmode) { int timeOutWarning = Integer.parseInt(WebClientRuntime.getWebClientProperty("webclient.sessiontimeoutwarningtime","0")); if(timeOutWarning !=0 ) { %><%@ include file="timeoutwarning.jsp" %><% } } %>
 
<% if(designmode) { %>
<% } %> <% } // end if(component.needsRender()) block JSONObject autoFillInfo = ((PageInstance)control).getAutoFillInfo(); if(!rerender) { if(component.needsRender()) { if(designmode) { // if in designmode and rendering for the first time... whether it's shown or not, set the viewport // and ismobile values on maxapps. event is handled by DesignerAppBean %> <% if(currentPage.showViewport()) { %>
<% } // end if(currentPage.showViewport()) } // end if(designmode) Map changedErrorContainers = currentPage.getChangedErrorContainers(); if(changedErrorContainers != null) { changedErrorContainers.clear(); } %> <% if(mobileDatePicker) { %><%@ include file="../common/datepicker.jsp" %><% } %><%@ include file="asyncerrortooltipdialog.jsp" %> <%=getClosingDivs(newApplinking, applinkDivs)%> <%@ include file="hiddenframe.jsp" %> <% } else // else block for if(component.needsRender()) { ((PageComponent)component).renderDialogs(false); // Check if we've been instructed to open a URL in a new window List listurls = (List)app.remove("openMultipleUrls"); if(listurls != null) { for (int i = 0; i < listurls.size(); i++) { Map urlprop = (Map)listurls.get(i); String url = urlprop.get("url"); // Double escape special chars since the url goes into a quoted string inside another quoted strings in javascript StringBuilder builder = new StringBuilder(); int length = url.length(); for(int j = 0; j < length; j++) { char ch = url.charAt(j); if(ch == '\\') { builder.append("\\\\\\"); } else if(ch == '\"') { builder.append("\\\\"); } else if(ch == '\'') { builder.append('\\'); } builder.append(ch); } url = builder.toString(); String windowId = urlprop.get("windowId"); if(windowId != null) { %> ", "<%=windowId%>" <% String options = urlprop.get("windowOptions"); if(options != null && !options.isEmpty()) { %>, "<%=options%>"<% } %>);'); ]]> <% } else { %> "; ]]> <% } } } String external = (String)app.get("launchexternal"); if (!WebClientRuntime.isNull(external)) { app.remove("launchexternal"); %> "; WshShell.Run(external,10,false) ]]> <% } if(clientDataValidation) { List createdDataStores = control.getPage().getDialogDataStores(); if (createdDataStores != null) { JSONArray domainList = new JSONArray(); for(DataStoreInfo dataStoreInfo : createdDataStores) { if (simpledomainDownload || !dataStoreInfo.isSimpleDomain()) { domainList.add(dataStoreInfo.getAsJSONForDownload()); } } %> ); ]]> <% } } if(autoFillInfo != null) { %> ",<%=autoFillInfo.serialize()%>); ]]> <% } } // end else block for if(component.needsRender()) control.getPage().remove("controlrenderhash"); } else // else block for if(!rerender) { %> <%@ include file="../common/componentholder_end.jsp" %> <%} // end else block for if(!rerender) %><%@ include file="../common/componentfooter.jsp" %>