jet.web.dhtml
Class DHTMLUtil

java.lang.Object
  extended by jet.web.dhtml.DHTMLUtil

public class DHTMLUtil
extends java.lang.Object

This is a utility class which can be directly invoked in JSPs.

Support the running of multiple report sets in one session, and a report set can include one or more reports.

Descriptions of some key terms:

sessionId: the key for the session in the server (generated by the server automatically when you log in), and users can invoke DHTMLUtil.getSessionID(HttpServletRequest request) to get the key.

rptSetId: the key for a report set in DHTML (generated automatically after the report set has been run), and users can invoke DHTMLUtil.getRptSetId(HttpServletRequest request) to get the key.

rptName: the key for a report in DHTML (retrieved from the report set after the report set has been run), and users can invoke DHTMLUtil.getRptName(HttpServletRequest request) to get the key.


Field Summary
static boolean BuildInVersion
           
static java.lang.String ReportNameIfCannotGet
           
 
Constructor Summary
DHTMLUtil()
           
 
Method Summary
static VersionRecord addResource(java.lang.String userId, java.lang.String folderPath, byte nodetype, java.lang.String catalogname, java.lang.String nodename, java.lang.String versionPath, boolean enableLinkCatalogMode, boolean isLinkCatalogMode, java.lang.String decs)
          Adds a resource in the specified folder.
static VersionRecord addResultInReport(java.lang.String userId, java.lang.String rptName, java.util.Hashtable htRst, java.lang.String sessionId, java.lang.String rptSetId)
          Adds a result in an existing report.
static VersionRecord addResultInReport(java.lang.String userId, java.lang.String rptName, java.lang.String rstName, java.lang.String versionPath, java.lang.String sessionId, java.lang.String rptSetId, java.lang.String rptId)
          Adds a result in an existing report.
static java.util.Hashtable buildDisplayNameList(java.util.Hashtable displayName)
           
static java.lang.String[][] buildDisplayNameListArray(java.lang.String[][] list)
           
static java.lang.String buildRuntimeID(java.lang.String SessionID, java.lang.String RptSetId, java.lang.String RptName)
          Builds runtimeID for backwards compatibility.
static java.lang.String checkPDFDigitalIDFile(DHTMLClientService service, java.lang.String sessionId, java.lang.String dRptSetId, java.lang.String dRptName, byte[] byteArrayContent, java.io.InputStream is, java.lang.String password, boolean isNoFrame)
          Deprecated. WebActLogic.checkPdfDigitalID since V9.1. Check PDF digital ID file.
static java.lang.String clearHtml(java.lang.String str)
          Deprecated. WebActLogic.parseOpenRptParams.
static java.lang.String convertArrayToJSArray(java.lang.String[] array)
          Gets the Script string of the specified array.
static java.lang.String convertArrayToJSArray(java.lang.String[][] array)
          Gets the Script string of the specified two-dimensional array.
static int convertInchToPt(double size)
           
static java.util.List ConvertItemIdToIndex(java.util.List aList, java.util.List aAvailist)
           
static void copyFile(java.lang.String oldPathFile, java.lang.String newPathFile)
           
static void copyFolder(java.lang.String oldPath, java.lang.String newPath, java.lang.String except)
           
static byte[] copyOctet(java.io.File file)
           
static byte[] copyOctet(java.lang.String filePath)
           
static char[] copyText(java.io.File file)
           
static char[] copyText(java.lang.String filePath)
           
static java.lang.String decode(java.lang.String str)
          Decodes an ecmascript format string.
static java.lang.String escape(java.lang.String str)
          Translates a string using the ecmascript format.
static java.lang.String escapeQuotation(java.lang.String src)
           
static boolean forTestSession(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String generateJsMsg()
          Gets all the error messages in a string array which can be used in HTML page.
static java.lang.String get_filter_StringValue_fromeUI(java.lang.String str, boolean isUserInput)
           
static java.lang.String getActionOpName(int op)
           
static java.lang.Throwable[] getAllDHTMLExceptions(javax.servlet.http.HttpServletRequest request)
          Gets all exceptions.
static java.util.ArrayList getAllDirectory(java.lang.String userName, java.lang.String rootpath)
          Deprecated. DHTMLUtil.IdentifyDirArrayList.
static java.util.ArrayList getAllReports(java.lang.String userName, java.lang.String rootpath)
          Gets all reports (including sub folders, sub sub folders, ...) in the specified resource node.
static java.util.Vector getAllReportsOnlyInRootPath(java.lang.String userName, java.lang.String rootpath)
           
static long getBackgroundTimeOut(javax.servlet.http.HttpServletRequest request)
           
static int getBrowserType(javax.servlet.http.HttpServletRequest request)
          Gets the browser type.
static int GetBrowserType(java.lang.String userAgent)
           
static java.lang.String getCatalogName(java.lang.String userName, java.lang.String resourcePath)
          Gets the real path of the catalog.
static java.lang.String getContentFromUrl(java.lang.String url)
           
static com.jinfonet.web.util.json.JSONObject getDateSymbols(javax.servlet.http.HttpServletRequest request)
          Get date symbols for client date format.
static java.lang.String getDefaultCompStyle(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String getDefaultToolbarItems(DHTMLConfig dhtmlConfig, java.lang.String SessionID, java.lang.String RptSetId)
          Gets the default toolbar items for the specified report set, which can be used into JavaScript.
static boolean getDirWritePermission(java.lang.String userName, java.lang.String rootpath)
          Gets whether the user has the permission of saving reports to the specified folder.
static java.lang.String getErrorMsg(int checkCode, java.lang.String language)
          Gets the error message according to the specified check code.
static HttpRptServer getHttpRptServer(javax.servlet.http.HttpServletRequest request)
           
static int getMapFunctionValue(java.lang.String name)
           
static jet.JException getOriginalJException(jet.JException jrex)
          Gets the cause of this exception
static double getPageHeight(int pageType, int orientation)
          Gets the page height.
static double getPageWidth(int pageType, int orientation)
          Gets the page width.
static java.util.Hashtable getParameters(javax.servlet.http.HttpServletRequest request)
          Deprecated. WebActLogic.parseRequest(HttpServletRequest request); Gets the parameters for running a report according to the request.
static java.lang.String GetPID(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String getPreferenceValue(javax.servlet.http.HttpServletRequest request, java.lang.String preferenceKey)
           
static java.lang.String getReportRealPath(java.lang.String userId, java.lang.String fileName)
          Deprecated. ResourceKit.getReportRealPath.
static jet.server.intf.jrs.ExResourceManager getResourceManager()
          Gets the server resource manager.
static java.lang.String getRptName(javax.servlet.http.HttpServletRequest request)
          Gets the report name from the request.
static java.lang.String getRptSetId(javax.servlet.http.HttpServletRequest request)
          Gets the report set id from the request.
static java.util.Vector getRunningReportsInfo(javax.servlet.http.HttpServletRequest request)
           
static boolean getSaveToPubDirPermission(java.lang.String userName, java.lang.String rootpath)
          Deprecated. DHTMLUtil.getDirWritePermission. Gets whether the user has the permission of saving reports to the specified folder.
static java.lang.String getSessionID(javax.servlet.http.HttpServletRequest request)
          Gets the session id from the request.
static java.lang.String getStyleFilePath(java.lang.String styleName)
           
static java.lang.String[][] getStyleList()
           
static java.lang.String getURLForCatalogReferedFile(java.lang.String sessionID, jet.server.intf.jrs.ExResourceManager manager, java.lang.String uid, java.lang.String catalogName, java.lang.String catalogReferName, int versionNumber)
          Deprecated.  
static java.lang.String getUserName(javax.servlet.http.HttpServletRequest request)
          Gets the current session user name.
static UserSession getUserSession(javax.servlet.http.HttpServletRequest request)
          Gets a UserSession instance from the request.
static java.lang.String getVersionFile(java.lang.String userId, java.lang.String fileName)
           
static java.lang.String getWebAppUrl(javax.servlet.http.HttpServletRequest request, java.lang.String webAppName)
          Gets web application URL.
static java.lang.String getWebContextPath(java.lang.String dhtmlCtxPath)
          Gets the DHTML context path (not including "/").
static java.lang.String getWebPath(java.lang.String oriPath)
           
static java.util.ArrayList[] IdentifyDirArrayList(java.lang.String userName, java.lang.String rootpath)
          Gets the sorted folders of the specified resource.
static int indexOf(int[] list, int target)
           
static int indexOf(java.lang.String[] list, java.lang.String target)
           
static boolean isChrome(javax.servlet.http.HttpServletRequest request)
          Gets whether the browser is chrome.
static boolean isResourceNode(java.lang.String userName, java.lang.String path)
          Whether the specified path is resource node.
static boolean isRMIEnv(javax.servlet.http.HttpServlet servlet)
          Gets whether the environment is RMI.
static java.lang.String msg(int key)
          Gets the error message according to the specified id.
It is for NLS support, the id and the message can be seen in %serverhome%/resources/server/languages/en/properties/dhtml.properties.
static java.lang.String msg(int key, java.lang.Object arg)
          Gets the error message according to the specified id.
It is for NLS support, the id and the message can be seen in %serverhome%/resources/server/languages/en/properties/dhtml.properties.
static java.lang.String msg(int key, java.lang.Object[] args)
          Gets the error message according to the specified id.
It is for NLS support, the id and the message can be seen in %serverhome%/resources/server/languages/en/properties/dhtml.properties.
static java.util.Vector parseWord(java.lang.String sentence, char separator, char escape)
          Deprecated. jet.util.expression.ExpressionUtil.parseStringValue. From V9. Parses the specified sentence to words.

An example of the method:

sentence is "name1,name2,name3,na\,\\me4",
separator is ',',
escape is '\',
the words are: ["name1","name2","name3","na,\me4"].

An example of the method:

%serverhome%/public_html/dhtmljsp/actionjsp/ getdisplayandrealvaluebyinput.jsp.

static java.lang.String removePathInfo(java.lang.String name)
           
static java.lang.String replaceAllString(java.lang.String src, java.lang.String patten, java.lang.String replacement)
          Replaces every subsequence of the input sequence that matches the pattern with the given replacement string.
static java.util.Map runReport(javax.servlet.http.HttpServletRequest request, java.util.Map runParams)
          Runs a report set.
static java.lang.String scriptBegin(boolean isNoFrame_ConnectPage)
          Gets the script start string.
static java.lang.String scriptEnd(boolean isNoFrame_ConnectPage)
          Gets the script end string.
static void SendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String fileName)
           
static void sendToErrorpage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Throwable t, boolean needOpen, boolean needClear)
          Deprecated. WebActionLogic.sendToErrorpage.
static void setCurrentLanguage(javax.servlet.http.HttpServletRequest request)
           
static void setForTestLoadRunner(java.lang.String sessionId)
           
static void setRptSetIdForTest(java.lang.String sessionId, java.lang.String rptSetId)
           
static java.lang.String setTempParamter(javax.servlet.http.HttpSession session, java.lang.Object obj)
           
static java.lang.String[][] sortArray(java.lang.String[][] array, int sortType)
          Sorts a two-dimensional string array according to the specified sort order.
static java.lang.String[] sortArray(java.lang.String[] array, int sortType)
          Sorts a string array according to the specified sort order.
static java.lang.String toHtmlString(java.lang.String src)
          Gets the HTML string of the specified string.
Such as '\"' to """, '<' to "<".
static java.lang.String toHtmlString(java.lang.String src, boolean noSingleQuotes)
          Gets the HTML string of the specified string.
Such as '\"' to """, '<' to "<".
static java.lang.String toJSON(java.util.Hashtable ht)
          Gets the Script string of the specified parameters.
static java.lang.String toJSON(java.lang.String[] array)
          Gets the Script string of the specified parameters.
static java.lang.String toScriptString(java.lang.String oriStr)
          Gets the Script string of the specified string.
Such as '\'' to "\\\\'", "'" to "\\\\'".
static java.lang.String toString(int[] arr)
           
static java.lang.String toString(int[][] arr)
           
static java.lang.String unescape(java.lang.String str)
           
static java.lang.StringBuffer writeCommonCSS(java.lang.String strDivID)
           
static java.lang.String writeToolBarBtnHTML(java.lang.String[] item, java.lang.String strEvent)
          Gets the HTML string of the button in the toolbar.
static boolean zip(java.lang.String zipfilename, java.util.Vector filesList)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BuildInVersion

public static boolean BuildInVersion

ReportNameIfCannotGet

public static java.lang.String ReportNameIfCannotGet
Constructor Detail

DHTMLUtil

public DHTMLUtil()
Method Detail

getDateSymbols

public static com.jinfonet.web.util.json.JSONObject getDateSymbols(javax.servlet.http.HttpServletRequest request)
Get date symbols for client date format.

Parameters:
request -
Returns:

buildRuntimeID

public static java.lang.String buildRuntimeID(java.lang.String SessionID,
                                              java.lang.String RptSetId,
                                              java.lang.String RptName)
Builds runtimeID for backwards compatibility.

Parameters:
sessionId - the user session id.
rptSetId - the report set id.
rptName - the report name.
Returns:
the runtime id.

getErrorMsg

public static java.lang.String getErrorMsg(int checkCode,
                                           java.lang.String language)
Gets the error message according to the specified check code.

Parameters:
checkCode - the key of the information code generated after the report set has been run.
Defined checkCode in DHTMLConstant:
DHTMLConstant.CHECK_WRONG_CATALOG;
DHTMLConstant.CHECK_EXCEED_USER;
DHTMLConstant.CHECK_EXCEED_REPORT_SESSION;
DHTMLConstant.CHECK_EXCEED_REPORT_LICENSE;
DHTMLConstant.CHECK_EXTRA_CHANNEL;
DHTMLConstant.CHECK_OVER_MAXOPEN.
language - the language.
Returns:
the error message; null means the checkCode is undefined.

getReportRealPath

public static java.lang.String getReportRealPath(java.lang.String userId,
                                                 java.lang.String fileName)
Deprecated. ResourceKit.getReportRealPath.

Parameters:
userId - the user name.
fileName - the relative path and name of the report set.
Returns:
the real path and name of the report set.

getRptSetId

public static java.lang.String getRptSetId(javax.servlet.http.HttpServletRequest request)
Gets the report set id from the request.

Parameters:
request - HttpServletRequest.
Returns:
the report set id.

getRptName

public static java.lang.String getRptName(javax.servlet.http.HttpServletRequest request)
Gets the report name from the request.

Parameters:
request - HttpServletRequest.
Returns:
the report name.

GetPID

public static java.lang.String GetPID(javax.servlet.http.HttpServletRequest request)

getSessionID

public static java.lang.String getSessionID(javax.servlet.http.HttpServletRequest request)
Gets the session id from the request.

Parameters:
request - HttpServletRequest.
Returns:
String the session id.

getUserSession

public static UserSession getUserSession(javax.servlet.http.HttpServletRequest request)
Gets a UserSession instance from the request.

Parameters:
request - HttpServletRequest.
Returns:
UserSession.
See Also:
jet.server.api.UserSession.

runReport

public static java.util.Map runReport(javax.servlet.http.HttpServletRequest request,
                                      java.util.Map runParams)
                               throws jet.JDException
Runs a report set.

Parameters:
request - HttpServletRequest.
runParams - the additional information for running the report set.
Returns:
the information about a report set.
Throws:
jet.JDException
See Also:
jet.web.dhtml.WebActLogic.runReport.

getParameters

public static java.util.Hashtable getParameters(javax.servlet.http.HttpServletRequest request)
Deprecated. WebActLogic.parseRequest(HttpServletRequest request); Gets the parameters for running a report according to the request.

Parameters:
request - HttpServletRequest.
Returns:
Hashtable, key is the parameter name, value is the parameter value if value can be String[] when there are multiple values belong to this parameter name.

forTestSession

public static boolean forTestSession(javax.servlet.http.HttpServletRequest request)

setRptSetIdForTest

public static void setRptSetIdForTest(java.lang.String sessionId,
                                      java.lang.String rptSetId)
Parameters:
sessionId - the user session id.
rptSetId - the report set id.

setForTestLoadRunner

public static void setForTestLoadRunner(java.lang.String sessionId)
Parameters:
sessionId - the user session id.

isChrome

public static boolean isChrome(javax.servlet.http.HttpServletRequest request)
Gets whether the browser is chrome.

Parameters:
request - HttpServletRequest.
Returns:
true means the browser is chrome; otherwise, not chrome.

GetBrowserType

public static int GetBrowserType(java.lang.String userAgent)

getBrowserType

public static int getBrowserType(javax.servlet.http.HttpServletRequest request)
Gets the browser type.

Parameters:
request - HttpServletRequest.
Returns:
the browser type which is defined in DHTMLConstant:
DHTMLConstant.BROWSER_OPERA;
DHTMLConstant.BROWSER_CHROME;
DHTMLConstant.BROWSER_NETSCAPE;
DHTMLConstant.BROWSER_FIREFOX;
DHTMLConstant.BROWSER_IE;
DHTMLConstant.BROWSER_MOZILLA.

isRMIEnv

public static boolean isRMIEnv(javax.servlet.http.HttpServlet servlet)
Gets whether the environment is RMI.

Parameters:
servlet - HttpServlet.
Returns:
true means RMI environment; otherwise not RMI.

sortArray

public static java.lang.String[] sortArray(java.lang.String[] array,
                                           int sortType)
Sorts a string array according to the specified sort order.

Parameters:
array - a string array.
sortType - the sort order type which is defined in DHTMLConstant:
DHTMLConstant.SORT_ASCENDING;
DHTMLConstant.SORT_DESCENDING.
Returns:
the sorted string array.

sortArray

public static java.lang.String[][] sortArray(java.lang.String[][] array,
                                             int sortType)
Sorts a two-dimensional string array according to the specified sort order.

Parameters:
array - a two-dimensional string array.
sortType - the sort order type which is defined in DHTMLConstant:
DHTMLConstant.SORT_ASCENDING;
DHTMLConstant.SORT_DESCENDING.
Returns:
the sorted two-dimensional string array.

getWebAppUrl

public static java.lang.String getWebAppUrl(javax.servlet.http.HttpServletRequest request,
                                            java.lang.String webAppName)
Gets web application URL.

Parameters:
request - HttpServletRequest.
webAppName - the web application name.
Returns:
the web application URL.
See Also:
jet.server.api.http.HttpUtil.getWebAppUrl.

scriptBegin

public static java.lang.String scriptBegin(boolean isNoFrame_ConnectPage)
Gets the script start string.

An example of the method:

%serverhome%/public_html/dhtmljsp/index.jsp.

Parameters:
isNoFrame_ConnectPage - whether the current page is the connecting page.
Returns:
the script start string.

scriptEnd

public static java.lang.String scriptEnd(boolean isNoFrame_ConnectPage)
Gets the script end string.

An example of the method:

%serverhome%/public_html/dhtmljsp/index.jsp.

Parameters:
isNoFrame_ConnectPage - whether the current page is the connecting page.
Returns:
the script end string.

clearHtml

public static java.lang.String clearHtml(java.lang.String str)
Deprecated. WebActLogic.parseOpenRptParams.

DELETE This Method For [Refactor] j$vm_pid

Parameters:
request - HttpServletRequest.
runParams - the report parameters.
Returns:
the report parameters.
Throws:
jet.JDException - public static Hashtable parseOpenRptParams(HttpServletRequest request, Map runParams) throws JDException { Hashtable params = new Hashtable(); try { String RptSetId = null; String reportName = null; String catalogFile = null; String hasStyle = null; String styleGroup = null; String recordNumstr = "-1"; hasStyle = request.getParameter(APIConst.TAG_HAS_STYLE); styleGroup = request.getParameter(APIConst.TAG_STYLE_GROUP); // recordNumstr = request.getParameter(APIConst.); DHTMLClientService service = DHTMLServiceFactory .getDHTMLClientService(request); // if(JDLog.isAd()) JDLog.print("hasStyle=[" + hasStyle + "]"); // if(JDLog.isAd()) JDLog.print("styleGroup=[" + styleGroup + "]"); if (hasStyle != null && hasStyle.equalsIgnoreCase("true")) { params.put(EngineConstant.STYLE_GROUP, styleGroup); } // else{ // params.put(EngineConstant.STYLE_GROUP, "None"); // } if (runParams != null) { RptSetId = (String) runParams.get(DHTMLConstant.RPTSET_ID); reportName = (String) runParams.get(APIConst.TAG_REPORT); catalogFile = (String) runParams .get(DHTMLConstant.CATALOG_NAME); if (catalogFile == null) { catalogFile = (String) runParams.get(APIConst.TAG_CATALOG); } } if (RptSetId == null) { RptSetId = request.getParameter(DHTMLConstant.RPTSET_ID); } if (RptSetId == null) { RptSetId = (String) request .getAttribute(DHTMLConstant.RPTSET_ID); } if (reportName == null) { reportName = request.getParameter(APIConst.TAG_REPORT); } if (catalogFile == null) { catalogFile = request.getParameter(APIConst.TAG_CATALOG); } String translate = request.getQueryString(); if (translate != null && reportName == null && catalogFile == null && translate.indexOf(".cat") > 0 && translate.indexOf(".cls") > 0) { int catindex = translate.indexOf(".cat"); int clsindex = translate.indexOf(".cls"); if (catindex > 0 && catindex < clsindex) { catalogFile = translate.substring(0, catindex + 4); int tmpindex = catalogFile.lastIndexOf("/"); if (tmpindex > 0 && tmpindex < catindex) { reportName = catalogFile.substring(0, tmpindex + 1); reportName += translate.substring(catindex + 5, clsindex + 4); } } else if (clsindex > 0 && catindex > clsindex) { reportName = translate.substring(0, clsindex + 4); int tmpindex = reportName.lastIndexOf("/"); if (tmpindex > 0 && tmpindex < clsindex) { catalogFile = reportName.substring(0, tmpindex + 1); catalogFile += translate.substring(clsindex + 5, catindex + 4); } } } if (reportName == null || catalogFile == null) { translate = request.getPathInfo(); if (translate != null && translate.indexOf(".cls") != -1 && translate.indexOf(".cat") != -1) { String folderName = ""; String catName = ""; String rptName = ""; String paramString = translate; int point = paramString.length() - 1; char temp; while ((temp = paramString.charAt(point)) != '/') { point--; rptName = String.valueOf(temp) + rptName; } point--; while ((temp = paramString.charAt(point)) != '/') { point--; catName = String.valueOf(temp) + catName; } folderName = paramString.substring(0, point); catalogFile = folderName + "/" + catName; reportName = folderName + "/" + rptName; } } // Comment: if the report is rsd, reportName is null, JReport shouldn't // throw Exception // if(reportName == null){ // throw new JDException(910080); // } // else if(catalogFile == null) // { // if(reportName.indexOf(".clx") == -1) // { // throw new JDException(910080); // } // } UserSession us = DHTMLUtil.getUserSession(request); String rptPath = request.getParameter(APIConst.TAG_PATH); String sessionId = us.getID(); String userName = us.getUserID(); // String catVersion = // request.getParameter(APIConst.TAG_CAT_VERSION); // String rptVersion = // request.getParameter(APIConst.TAG_RPT_VERSION); String rptSheet = request.getParameter(DHTMLConstant.RPTSHEET); String runSheet = request.getParameter(APIConst.TAG_REPORT_SHEET + "$" + rptSheet); String useDefaultDBUser = request .getParameter("default_use_default_ds_user"); String dbuser = request.getParameter("default_user"); String dbpsw = request.getParameter("default_pswd"); String encodeing = request .getParameter(APIConst.TAG_REPORT_ENCODING); String enableConvertEncode = request .getParameter(APIConst.TAG_HAS_CONVERT_ENC); String fromEncode = request .getParameter(APIConst.TAG_FROM_ENCODING); String toEncode = request.getParameter(APIConst.TAG_TO_ENCODING); if (encodeing != null) params.put(EngineConstant.ENCODING, encodeing); if (enableConvertEncode != null && enableConvertEncode.equalsIgnoreCase("true")) { if (fromEncode != null) params .put(EngineConstant.CONVERT_FROM_ENCODING, fromEncode); if (toEncode != null) params.put(EngineConstant.CONVERT_TO_ENCODING, toEncode); } if (useDefaultDBUser != null && useDefaultDBUser.equalsIgnoreCase("false")) { Hashtable dsUser = new Hashtable(); dsUser.put("default", new String[] { dbuser, dbpsw }); params.put(EngineConstant.USER_PASSWORD, dsUser); } int recordNum = service.getDHTMLConfig().getRecordNumber(sessionId, RptSetId); recordNumstr = String.valueOf(recordNum); params.put(EngineConstant.LIMITED_RECORDS, recordNumstr); String fromDesigner = request .getParameter(DHTMLConstant.FROM_DESIGNER); if (fromDesigner != null) params.put(DHTMLConstant.FROM_DESIGNER, fromDesigner); if (runSheet != null && runSheet.equalsIgnoreCase("true")) params.put(APIConst.TAG_REPORT_SHEET, rptSheet); if (runParams != null && runParams.size() > 0) { Set keys = runParams.keySet(); Iterator ikeys = keys.iterator(); while (ikeys.hasNext()) { Object key = ikeys.next(); params.put(key, runParams.get(key)); } // parse report parameters Properties p = new Properties(); String rptParams = (String) runParams .get(DHTMLConstant.RUNRPTPARAMS); if (rptParams != null) { rptParams = rptParams.trim(); rptParams += "&"; int startindex = 0; int index = rptParams.indexOf("&", startindex); String tmp, key, value; while (index != -1) { tmp = rptParams.substring(startindex, index); startindex = index + 1; index = rptParams.indexOf("&", startindex); if (tmp != null && tmp.indexOf("=") != -1) { key = tmp.substring(0, tmp.indexOf("=")); value = tmp.substring(tmp.indexOf("=") + 1); p.setProperty(key, value); } } } params.put(DHTMLConstant.PARAM_PROPERTIES, p); } else { // is used by dhtml.jsp // parse the report parameters Properties p = new Properties(); for (Enumeration e = request.getParameterNames(); e .hasMoreElements();) { String temp = (String) e.nextElement(); if (temp.startsWith(APIConst.TAG_PARAM_PREFIX)) { p.setProperty(temp.substring(APIConst.TAG_PARAM_PREFIX .length()), request.getParameter(temp)); } } params.put(DHTMLConstant.PARAM_PROPERTIES, p); // comment by // lyy for // compiler // error } HttpRptServer httpRptServer = DHTMLHttpUtil .getHttpRptServer(request); ExResourceManager rmgr = (ExResourceManager) DHTMLHttpUtil .getHttpRptServer(request).getResourceManager(); // is RSD File String rst_version = request.getParameter(APIConst.TAG_RST_VERSION); if (rst_version != null) { ResultVersionRecord rstVer; int verNumber = Integer.parseInt(rst_version); ResultFiles files; // if(reportName != null){ // rstVer = rmgr.getResultVersion(userName, reportName, // verNumber); // }else{ // rstVer = rmgr.getResultDocVersion(userName, rptPath, // verNumber); // } // zhoubenkun: modify it based on hou yongkang's Bug23092 and // Bug23405 String versionId = request .getParameter(APIConst.TAG_VERSION_ID); if (versionId != null) { rstVer = rmgr.getResultVersionByNodeID(versionId); } else if (reportName != null) { rstVer = rmgr.getResultVersion(userName, reportName, verNumber); DHTMLUtil.BuildInVersion = true; } else { reportName = request.getParameter(APIConst.TAG_RESULT); rstVer = rmgr.getResultDocVersion(userName, reportName, verNumber); DHTMLUtil.ReportNameIfCannotGet = reportName; DHTMLUtil.BuildInVersion = false; } if (rstVer == null) throw new JDException(910077); Hashtable verHt = rstVer.getAllReportResultFiles(); files = (ResultFiles) verHt.get(APIConst.TAG_RSD_RESULT); if (files == null) { files = (ResultFiles) verHt.get("jrs.report_result"); } String RSDFileName = rmgr.getHistDir() + files.getRsdFileName(); params.put(EngineConstant.RSD_FILE_NAME, RSDFileName); } else { // RSD enhancement String jrs_resource_path = request .getParameter(DHTMLConstant.JRS_RESOURCE_PATH); String jrs_file = request.getParameter(DHTMLConstant.JRS_FILE); if (jrs_resource_path != null && jrs_file != null) { String realPath = null; if (!jrs_resource_path.startsWith("/")) { throw new Exception("resouce path " + jrs_resource_path + " must begin with '/'."); } realPath = rmgr.getRealPath(userName, jrs_resource_path); if (realPath == null || realPath.trim().length() == 0) { String inDir = jrs_resource_path; String fDir = ServerEnv.getResourceRoot(); if (fDir.endsWith(File.separator)) { fDir = fDir.substring(0, fDir.length() - 1); } fDir = fDir + inDir.replace('/', File.separator.charAt(0)); if (!fDir.endsWith(File.separator)) { fDir += File.separator; } File rstFold = new File(fDir); if (!rstFold.exists()) { throw new Exception("path " + jrs_resource_path + " does not exist."); } } else { if (!realPath.endsWith(File.separator)) { realPath += File.separator; } } // System.err.println("RSD file::"+realPath + jrs_file); params.put(EngineConstant.RSD_FILE_NAME, realPath + jrs_file); } else { PathInfo pathinfo = null; String catPath = null; if (catalogFile != null) { String vernumstr = request .getParameter(APIConst.TAG_CAT_VERSION); // String pathinfostr = ""; int vernum = -1; if (vernumstr == null || vernumstr.trim().equals("") || APIUtil.parseInt(vernumstr, -1) == -1) { pathinfo = rmgr.getPathInfo(userName, catalogFile); catPath = pathinfo.getPath(); } else { vernum = Integer.parseInt(vernumstr); catPath = rmgr.getPathInfo(userName, catalogFile) .getPath();// .getPathInfo(userName, // catalogFile); } // bug 26618 // if(catPath != null){ // params.put(EngineConstant.CAT_NAME, catPath); // } // params.put(DHTMLConstant.CATALOG_NAME, catalogFile); // //majx if (reportName != null && !reportName.trim().toLowerCase().endsWith( ".clx") && catPath != null) { params.put(DHTMLConstant.CATALOG_NAME, catalogFile); // majx // params.put(EngineConstant.CAT_NAME, catPath); // TODO feature 44915 if (RptSetId == null) { RptSetId = service.createReportSetId(); } ResourceKit.putOpenRptDependentInfo(catPath, vernum, userName, false, RptSetId, params); } } String reportPath = null; if (reportName != null) { pathinfo = rmgr.getPathInfo(userName, reportName); if (pathinfo != null) { reportPath = pathinfo.getRealPath(); // ZhangShiwei's request for handling old path if (service.isOldReport(reportPath)) reportPath = service.convertingOldReport( catPath, reportPath); params.put(EngineConstant.RPT_SET_NAME, reportPath); } } } } String serverHost = request.getServerName(); String serverPort = String.valueOf(request.getServerPort()); String serverScheme = request.getScheme(); params.put(DHTMLConstant.SERVERHOST, serverHost); params.put(DHTMLConstant.SERVERPORT, serverPort); params.put(DHTMLConstant.SERVERSCHEME, serverScheme); // params.put(EngineConstant.STYLE_GROUP, ""); params.put(EngineConstant.SINGLE_THREAD, ServerEnv .getEngineSingleThread() + ""); if (reportName != null) { params.put(DHTMLConstant.REPORT_NAME, reportName); } else { params.put(DHTMLConstant.REPORT_NAME, rptPath);// JINYUKUN 23111 } params.put(DHTMLConstant.SESSION_ID, sessionId); params.put(DHTMLConstant.USER_NAME, userName); params.put(DHTMLConstant.BROWSER_TYPE, String.valueOf(DHTMLUtil .getBrowserType(request))); params.put(DHTMLConstant.ISEXTRA_CHANNEL, String .valueOf(httpRptServer.getHttpUserSessionManager() .isExtraChannel(request))); // is used by taglib or runreportlet if (RptSetId == null) { RptSetId = service.createReportSetId(); } if (Boolean.valueOf(request.getParameter("forTestLoadRunner")) .booleanValue()) { DHTMLUtil.setForTestLoadRunner(sessionId); DHTMLUtil.setRptSetIdForTest(sessionId, RptSetId); } params.put(EngineConstant.REPORT_ID, RptSetId); Locale locale = request.getLocale(); if (locale == null) { String langStr = request.getHeader("Accept-Language"); if (langStr != null) { String[] temp = langStr.split(",")[0].split("-"); if (temp.length == 2) { locale = new Locale(temp[0], temp[1]); } else { locale = new Locale(temp[0]); } } else { locale = Locale.getDefault(); } } params.put(DHTMLConstant.BROWSER_LOCALE, locale); Vector vRptSheetNames = new Vector(); // add all parameters which start with "jrs.", not including // APIConst.TAG_PARAM_PREFIX Enumeration names = request.getParameterNames(); while (names.hasMoreElements()) { String name = (String) names.nextElement(); if (name != null && name.startsWith("jrs.") && !name.startsWith(APIConst.TAG_PARAM_PREFIX)) { params.put(name, request.getParameter(name)); } if (name != null && name.startsWith(APIConst.TAG_REPORT_SHEET + "$") && Boolean.valueOf(request.getParameter(name)) .booleanValue()) { rptSheet = name.substring(name .indexOf(APIConst.TAG_REPORT_SHEET + "$") + (APIConst.TAG_REPORT_SHEET + "$").length()); // params.put(DHTMLConstant.RPTSHEET, rptSheet); vRptSheetNames.add(rptSheet); } } if (vRptSheetNames.size() > 0) { params.put(APIConst.TAG_REPORT_SHEET, vRptSheetNames); } return params; } catch (Exception ex) { // ex.printStackTrace(System.err); throw new JDException(ex); // Hashtable returnMap = new Hashtable(); // returnMap.put(DHTMLConstant.DHTML_EXCEPTION, ex); // return returnMap; } }
See Also:
Gets the parameters needed for running a report by request.

writeCommonCSS

public static java.lang.StringBuffer writeCommonCSS(java.lang.String strDivID)
                                             throws java.io.IOException
Throws:
java.io.IOException

buildDisplayNameListArray

public static java.lang.String[][] buildDisplayNameListArray(java.lang.String[][] list)

buildDisplayNameList

public static java.util.Hashtable buildDisplayNameList(java.util.Hashtable displayName)

getPageWidth

public static double getPageWidth(int pageType,
                                  int orientation)
Gets the page width.

An example of the method:

%serverhome%/public_html/dhtmljsp/dialog/pageproperty.jsp.

Parameters:
pageType - the page type.
orientation - the page orientation:
0 is landscape;
1 is portrait.
Returns:
the page width in inches.

getPageHeight

public static double getPageHeight(int pageType,
                                   int orientation)
Gets the page height.

An example of the method:

%serverhome%/public_html/dhtmljsp/dialog/pageproperty.jsp.

Parameters:
pageType - the page type.
orientation - the page orientation:
0 is landscape;
1 is portrait.
Returns:
the page height in inches.

checkPDFDigitalIDFile

public static java.lang.String checkPDFDigitalIDFile(DHTMLClientService service,
                                                     java.lang.String sessionId,
                                                     java.lang.String dRptSetId,
                                                     java.lang.String dRptName,
                                                     byte[] byteArrayContent,
                                                     java.io.InputStream is,
                                                     java.lang.String password,
                                                     boolean isNoFrame)
Deprecated. WebActLogic.checkPdfDigitalID since V9.1. Check PDF digital ID file.

Parameters:
service -
sessionId -
dRptSetId -
dRptName -
byteArrayContent -
is -
password -
isNoFrame -
Returns:

getResourceManager

public static jet.server.intf.jrs.ExResourceManager getResourceManager()
Gets the server resource manager.

An example of the method:

%serverhome%/public_html/dhtmljsp/save_as.jsp.

Returns:
@see jet.server.intf.jrs.ExResourceManager.

isResourceNode

public static boolean isResourceNode(java.lang.String userName,
                                     java.lang.String path)
Whether the specified path is resource node.

An example of the method:

%serverhome%/public_html/dhtmljsp/index.jsp.

Parameters:
userName - the user name.
path - the resource path.
Returns:
whether the specified path is resource node.

addResource

public static VersionRecord addResource(java.lang.String userId,
                                        java.lang.String folderPath,
                                        byte nodetype,
                                        java.lang.String catalogname,
                                        java.lang.String nodename,
                                        java.lang.String versionPath,
                                        boolean enableLinkCatalogMode,
                                        boolean isLinkCatalogMode,
                                        java.lang.String decs)
                                 throws NoPrivilegeException,
                                        NodeExistsException,
                                        UnknownResource
Adds a resource in the specified folder.

Parameters:
userId - the user name.
folderPath - the folder resource path.
nodetype - the node type.
catalogname - the catalog name.
nodename - the node name.
versionPath - the version path.
enableLinkCatalogMode - whether to enable linked catalog.
isLinkCatalogMode - whether it is linked catalog.
desc - the description.
Returns:
@see jet.server.api.VersionRecord.
Throws:
UnknownResource
NodeExistsException
NoPrivilegeException

addResultInReport

public static VersionRecord addResultInReport(java.lang.String userId,
                                              java.lang.String rptName,
                                              java.lang.String rstName,
                                              java.lang.String versionPath,
                                              java.lang.String sessionId,
                                              java.lang.String rptSetId,
                                              java.lang.String rptId)
                                       throws NoPrivilegeException,
                                              UnknownResource
Adds a result in an existing report.

Parameters:
userId - the user name.
rptName - the logical path of the report.
rstName - the result node name.
resultPath - the real path of result file.
sessionId - the user session id.
rptSetId - the report set id.
rptId - the report id.
Returns:
@see jet.server.api.VersionRecord.
Throws:
NoPrivilegeException
UnknownResource

addResultInReport

public static VersionRecord addResultInReport(java.lang.String userId,
                                              java.lang.String rptName,
                                              java.util.Hashtable htRst,
                                              java.lang.String sessionId,
                                              java.lang.String rptSetId)
                                       throws UnknownResource,
                                              NoPrivilegeException
Adds a result in an existing report.

Parameters:
userId - the user name.
rptName - the logical path of the report.
htRst - the necessary parameters.
sessionId - the user session id.
rptSetId - the report set id.
Returns:
@see jet.server.api.VersionRecord.
Throws:
UnknownResource
NoPrivilegeException

getAllDirectory

public static java.util.ArrayList getAllDirectory(java.lang.String userName,
                                                  java.lang.String rootpath)
                                           throws jet.JDException
Deprecated. DHTMLUtil.IdentifyDirArrayList.

Parameters:
userName - the user name.
rootpath - the resource path root.
Returns:
all directories.
Throws:
jet.JDException

IdentifyDirArrayList

public static java.util.ArrayList[] IdentifyDirArrayList(java.lang.String userName,
                                                         java.lang.String rootpath)
                                                  throws jet.JDException
Gets the sorted folders of the specified resource.

An example of the method:

%serverhome%/public_html/dhtmljsp/save_as.jsp.

Parameters:
userName - the user name.
rootpath - the resource path.
Returns:
the sorted folders.
Throws:
jet.JDException

getSaveToPubDirPermission

public static boolean getSaveToPubDirPermission(java.lang.String userName,
                                                java.lang.String rootpath)
                                         throws jet.JDException
Deprecated. DHTMLUtil.getDirWritePermission. Gets whether the user has the permission of saving reports to the specified folder.

Parameters:
userName - the user name.
rootpath - the resource path.
Returns:
whether the user has the permission.
Throws:
jet.JDException

getDirWritePermission

public static boolean getDirWritePermission(java.lang.String userName,
                                            java.lang.String rootpath)
                                     throws jet.JDException
Gets whether the user has the permission of saving reports to the specified folder.

An example of the method:

%serverhome%/public_html/dhtmljsp/save_as.jsp.

Parameters:
userName - the user name.
rootpath - the resource path.
Returns:
whether the user has the permission.
Throws:
jet.JDException

getAllReports

public static java.util.ArrayList getAllReports(java.lang.String userName,
                                                java.lang.String rootpath)
                                         throws jet.JDException
Gets all reports (including sub folders, sub sub folders, ...) in the specified resource node.

An example of the method:

%serverhome%/public_html/dhtmljsp/save_as.jsp.

Parameters:
userName - the user name.
rootpath - the resource path.
Returns:
all reports in the specified resource node.
Throws:
jet.JDException

getAllReportsOnlyInRootPath

public static java.util.Vector getAllReportsOnlyInRootPath(java.lang.String userName,
                                                           java.lang.String rootpath)
                                                    throws jet.JDException
Parameters:
userName - the user name.
rootpath - the resource path.
Returns:
all reports in the specified resource node.
Throws:
jet.JDException

getVersionFile

public static java.lang.String getVersionFile(java.lang.String userId,
                                              java.lang.String fileName)
Parameters:
userId - the user name.
fileName - the report version file name passed to
Returns:
the abstract adhoc report version file name.

removePathInfo

public static java.lang.String removePathInfo(java.lang.String name)

getURLForCatalogReferedFile

public static java.lang.String getURLForCatalogReferedFile(java.lang.String sessionID,
                                                           jet.server.intf.jrs.ExResourceManager manager,
                                                           java.lang.String uid,
                                                           java.lang.String catalogName,
                                                           java.lang.String catalogReferName,
                                                           int versionNumber)
                                                    throws jet.JDException
Deprecated. 

Parameters:
sessionID -
manager -
uid -
catalogName -
catalogReferName -
versionNumber -
Returns:
Throws:
jet.JDException

escapeQuotation

public static java.lang.String escapeQuotation(java.lang.String src)

toHtmlString

public static java.lang.String toHtmlString(java.lang.String src)
Gets the HTML string of the specified string.
Such as '\"' to """, '<' to "<".

Parameters:
src - the original string.
Returns:
the HTML string.

toHtmlString

public static java.lang.String toHtmlString(java.lang.String src,
                                            boolean noSingleQuotes)
Gets the HTML string of the specified string.
Such as '\"' to """, '<' to "<".

An example of the method:

%serverhome%/public_html/dhtmljsp/selectvalues.jsp.

Parameters:
src - the original string.
noSingleQuotes - whether to convert the single quote. If false, '\'' will be "'", otherwise, no change.
Returns:
the HTML string.

toScriptString

public static java.lang.String toScriptString(java.lang.String oriStr)
Gets the Script string of the specified string.
Such as '\'' to "\\\\'", "'" to "\\\\'".

An example of the method:

%serverhome%/public_html/dhtmljsp/run_report.jsp.

Parameters:
oriStr - the original string.
Returns:
the Script string.

parseWord

public static java.util.Vector parseWord(java.lang.String sentence,
                                         char separator,
                                         char escape)
                                  throws java.text.ParseException
Deprecated. jet.util.expression.ExpressionUtil.parseStringValue. From V9. Parses the specified sentence to words.

An example of the method:

sentence is "name1,name2,name3,na\,\\me4",
separator is ',',
escape is '\',
the words are: ["name1","name2","name3","na,\me4"].

An example of the method:

%serverhome%/public_html/dhtmljsp/actionjsp/ getdisplayandrealvaluebyinput.jsp.

Parameters:
sentence - the specified sentence.
separator - the separator char.
escape - the escape char.
Returns:
the words.
Throws:
java.text.ParseException

ConvertItemIdToIndex

public static java.util.List ConvertItemIdToIndex(java.util.List aList,
                                                  java.util.List aAvailist)

zip

public static boolean zip(java.lang.String zipfilename,
                          java.util.Vector filesList)

writeToolBarBtnHTML

public static java.lang.String writeToolBarBtnHTML(java.lang.String[] item,
                                                   java.lang.String strEvent)
Gets the HTML string of the button in the toolbar.

An example of the method:

%serverhome%/public_html/dhtmljsp/tool_button.jsp.

Parameters:
item - the button item information:
[0] the button id which is defined in DHTMLConstant.SIMPLE_VIEW_TOOLBAR or DHTMLConstant.PAGE_CONTROL_TOOLBAR.
[1] if true, strEvent is not used; otherwise, used.
[2] if true, when mouse over the button there is no change; otherwise, change the button style when mouse over or out.
strEvent - the button event string, such as "onclick=clickAct();".
Returns:
the HTML string of the button in the toolbar.

getUserName

public static java.lang.String getUserName(javax.servlet.http.HttpServletRequest request)
Gets the current session user name.

An example of the method:

%serverhome%/public_html/dhtmljsp/index.jsp.

Parameters:
request - HttpServletRequest.
Returns:
the user name.

msg

public static java.lang.String msg(int key,
                                   java.lang.Object[] args)
Gets the error message according to the specified id.
It is for NLS support, the id and the message can be seen in %serverhome%/resources/server/languages/en/properties/dhtml.properties.

Parameters:
key - the error id.
args - the values you replace the error message necessary parameter such as {0},{1}... 31012887=Input the value of {0} should be following the format {1}.
Returns:
the error message.

msg

public static java.lang.String msg(int key,
                                   java.lang.Object arg)
Gets the error message according to the specified id.
It is for NLS support, the id and the message can be seen in %serverhome%/resources/server/languages/en/properties/dhtml.properties.

Parameters:
key - the error id.
arg - the value you replace the error message necessary parameter such as \\"{0}\\", 1000114=Page report \\"{0}\\" already exists. Create a new version of this page report?
Returns:
the error message.

msg

public static java.lang.String msg(int key)
Gets the error message according to the specified id.
It is for NLS support, the id and the message can be seen in %serverhome%/resources/server/languages/en/properties/dhtml.properties.

An example of the method:

%serverhome%/public_html/dhtmljsp/closeWindow.jsp.

Parameters:
key - the error id.
Returns:
the error message.

generateJsMsg

public static java.lang.String generateJsMsg()
Gets all the error messages in a string array which can be used in HTML page.

An example of the method:

%serverhome%/public_html/dhtmljsp/dialogjsp/dialogheader.jsp.

Returns:
all the error messages.

unescape

public static java.lang.String unescape(java.lang.String str)
See Also:

An example of the method:

%serverhome%/public_html/dhtmljsp/searchdialog.jsp.


escape

public static java.lang.String escape(java.lang.String str)
Translates a string using the ecmascript format.

An example of the method:

%serverhome%/public_html/dhtmljsp/searchdialog.jsp.

Parameters:
str - String to be translated.
Returns:
the translated String.

get_filter_StringValue_fromeUI

public static java.lang.String get_filter_StringValue_fromeUI(java.lang.String str,
                                                              boolean isUserInput)
                                                       throws java.io.UnsupportedEncodingException
Parameters:
str -
isUserInput - whether the current value is input by user -- not used.
Returns:
Throws:
java.io.UnsupportedEncodingException
See Also:
DHTMLUtil.unescape.

decode

public static java.lang.String decode(java.lang.String str)
Decodes an ecmascript format string.

An example of the method:

%serverhome%/public_html/dhtmljsp/selectvalues.jsp.

Parameters:
str - the String to decode.
Returns:
the newly decoded String.

getContentFromUrl

public static java.lang.String getContentFromUrl(java.lang.String url)

getOriginalJException

public static jet.JException getOriginalJException(jet.JException jrex)
Gets the cause of this exception

An example of the method:

%serverhome%/public_html/dhtmljsp/errorpage.jsp.

Parameters:
jrex - the exception.
Returns:
the cause.

setTempParamter

public static java.lang.String setTempParamter(javax.servlet.http.HttpSession session,
                                               java.lang.Object obj)

copyText

public static char[] copyText(java.lang.String filePath)
                       throws java.io.IOException
Throws:
java.io.IOException

copyText

public static char[] copyText(java.io.File file)
                       throws java.io.IOException
Throws:
java.io.IOException

copyOctet

public static byte[] copyOctet(java.lang.String filePath)
                        throws java.io.IOException
Throws:
java.io.IOException

copyOctet

public static byte[] copyOctet(java.io.File file)
                        throws java.io.IOException
Throws:
java.io.IOException

copyFolder

public static void copyFolder(java.lang.String oldPath,
                              java.lang.String newPath,
                              java.lang.String except)
Parameters:
oldPath - the source folder.
newPath - the target folder.
except - the except file.

copyFile

public static void copyFile(java.lang.String oldPathFile,
                            java.lang.String newPathFile)
Parameters:
oldPathFile - the source file.
newPathFile - the destination file path.

sendToErrorpage

public static void sendToErrorpage(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response,
                                   java.lang.Throwable t,
                                   boolean needOpen,
                                   boolean needClear)
Deprecated. WebActionLogic.sendToErrorpage.

Parameters:
request -
response -
t -
needOpen -
needClear -

getAllDHTMLExceptions

public static java.lang.Throwable[] getAllDHTMLExceptions(javax.servlet.http.HttpServletRequest request)
Gets all exceptions.

An example of the method:

%serverhome%/public_html/dhtmljsp/errorpage.jsp.

Parameters:
request - HttpServletRequest.
Returns:
all exceptions.

getMapFunctionValue

public static int getMapFunctionValue(java.lang.String name)

replaceAllString

public static java.lang.String replaceAllString(java.lang.String src,
                                                java.lang.String patten,
                                                java.lang.String replacement)
Replaces every subsequence of the input sequence that matches the pattern with the given replacement string.

Parameters:
src - the input sequence.
patten - the expression to be compiled.
replacement - the replacement string.
Returns:
the string constructed by replacing each matching subsequence by the replacement string.

getCatalogName

public static java.lang.String getCatalogName(java.lang.String userName,
                                              java.lang.String resourcePath)
Gets the real path of the catalog.

Parameters:
userName - the user name.
resourcePath - the relative path of the catalog resources.
Returns:
the real path of the catalog.

getWebPath

public static java.lang.String getWebPath(java.lang.String oriPath)

getWebContextPath

public static java.lang.String getWebContextPath(java.lang.String dhtmlCtxPath)
Gets the DHTML context path (not including "/").

Parameters:
dhtmlCtxPath - the original DHTML context path.
Returns:
the DHTML context path.

toString

public static java.lang.String toString(int[] arr)

toString

public static java.lang.String toString(int[][] arr)

setCurrentLanguage

public static void setCurrentLanguage(javax.servlet.http.HttpServletRequest request)

getRunningReportsInfo

public static java.util.Vector getRunningReportsInfo(javax.servlet.http.HttpServletRequest request)

convertArrayToJSArray

public static java.lang.String convertArrayToJSArray(java.lang.String[] array)
Gets the Script string of the specified array.

An example of the method:

%serverhome%/public_html/dhtmljsp/change_style.jsp.

Parameters:
array - the specified string array.
Returns:
the string.

convertArrayToJSArray

public static java.lang.String convertArrayToJSArray(java.lang.String[][] array)
Gets the Script string of the specified two-dimensional array.

An example of the method:

%serverhome%/public_html/dhtmljsp/change_style.jsp.

Parameters:
array - the specified two-dimensional string array.
Returns:
the string.

getActionOpName

public static java.lang.String getActionOpName(int op)
Parameters:
op - the specified int.
Returns:
the action name.

getBackgroundTimeOut

public static long getBackgroundTimeOut(javax.servlet.http.HttpServletRequest request)
Parameters:
request - HttpServletRequest.
Returns:

convertInchToPt

public static int convertInchToPt(double size)
Parameters:
size -
Returns:
the pt.

getPreferenceValue

public static java.lang.String getPreferenceValue(javax.servlet.http.HttpServletRequest request,
                                                  java.lang.String preferenceKey)
Parameters:
request - HttpServletRequest.
preferenceKey - the preference key.
Returns:
the preference value.

getStyleFilePath

public static java.lang.String getStyleFilePath(java.lang.String styleName)
Parameters:
styleName - the style name.
Returns:
the style file path.

getDefaultToolbarItems

public static java.lang.String getDefaultToolbarItems(DHTMLConfig dhtmlConfig,
                                                      java.lang.String SessionID,
                                                      java.lang.String RptSetId)
Gets the default toolbar items for the specified report set, which can be used into JavaScript.

An example of the method:

%serverhome%/public_html/dhtmljsp/option_customize.jsp.

Parameters:
dhtmlConfig -
SessionID - the user session id.
RptSetId - the report set id.
Returns:
the default toolbar items, such as [["ToolbarsName","ItemID|ItemID|..." ],...["ToolbarsName","ItemID|ItemID|..."]].
ToolbarsName is defined in DHTMLConstant:
DHTMLConstant.TOOLBAR_STANDARD_NAME;
DHTMLConstant.TOOLBAR_ANALYSIS_NAME;
DHTMLConstant.TOOLBAR_VIEW_NAME.
See Also:
DHTMLConfig.

getDefaultCompStyle

public static java.lang.String getDefaultCompStyle(javax.servlet.http.HttpServletRequest request)
Parameters:
request - HttpServletRequest.
Returns:
the style.

toJSON

public static java.lang.String toJSON(java.util.Hashtable ht)
Gets the Script string of the specified parameters.

An example of the method:

%serverhome%/public_html/dhtmljsp/index.jsp.

Parameters:
ht - the specified parameters.
Returns:
the Script string.

toJSON

public static java.lang.String toJSON(java.lang.String[] array)
Gets the Script string of the specified parameters.

Parameters:
array - the specified parameters.
Returns:
the Script string.

indexOf

public static int indexOf(java.lang.String[] list,
                          java.lang.String target)
Parameters:
list - the specified array.
target - the specified string.
Returns:
the index if the list contains the target; else return -1.

indexOf

public static int indexOf(int[] list,
                          int target)
Parameters:
list - the specified array.
target - the specified int.
Returns:
the index if the list contains the target; else return -1.

getStyleList

public static java.lang.String[][] getStyleList()

SendRedirect

public static void SendRedirect(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                java.lang.String fileName)
                         throws java.io.IOException
Throws:
java.io.IOException

getHttpRptServer

public static HttpRptServer getHttpRptServer(javax.servlet.http.HttpServletRequest request)