|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjet.web.dhtml.DHTMLUtil
public class DHTMLUtil
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.lang.String |
buildRuntimeID(java.lang.String SessionID,
java.lang.String RptSetId,
java.lang.String RptName)
Builds runtimeID for backwards compatibility. |
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 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 |
generateJsMsg()
Gets all the error messages in a string array which can be used in HTML page. |
static java.lang.Throwable[] |
getAllDHTMLExceptions(HttpServletRequest request)
Gets all exceptions. |
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 int |
getBrowserType(HttpServletRequest request)
Gets the browser type. |
static java.lang.String |
getCatalogName(java.lang.String userName,
java.lang.String resourcePath)
Gets the real path of the catalog. |
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 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.lang.String |
getReportRealPath(java.lang.String userId,
java.lang.String fileName)
Deprecated. ResourceKit.getReportRealPath. Gets the real path and name of the report set. |
static jet.server.intf.jrs.ExResourceManager |
getResourceManager()
Gets the server resource manager. |
static java.lang.String |
getRptName(HttpServletRequest request)
Gets the report name from the request. |
static java.lang.String |
getRptSetId(HttpServletRequest request)
Gets the report set id from the request. |
static java.lang.String |
getSessionID(HttpServletRequest request)
Gets the session id from the request. |
static java.lang.String |
getUserName(HttpServletRequest request)
Gets the current session user name. |
static UserSession |
getUserSession(HttpServletRequest request)
Gets a UserSession instance from the request. |
static java.lang.String |
getWebAppUrl(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.util.ArrayList[] |
IdentifyDirArrayList(java.lang.String userName,
java.lang.String rootpath)
Gets the sorted folders of the specified resource. |
static boolean |
isChrome(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(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.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(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 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 |
unescape(java.lang.String str)
|
static java.lang.String |
writeToolBarBtnHTML(java.lang.String[] item,
java.lang.String strEvent)
Gets the HTML string of the button in the toolbar. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean BuildInVersion
public static java.lang.String ReportNameIfCannotGet
| Constructor Detail |
|---|
public DHTMLUtil()
| Method Detail |
|---|
public static java.lang.String buildRuntimeID(java.lang.String SessionID,
java.lang.String RptSetId,
java.lang.String RptName)
sessionId - the user session id.rptSetId - the report set id.rptName - the report name.
public static java.lang.String getErrorMsg(int checkCode,
java.lang.String language)
checkCode - the key of the information code generated
after the report set has been run.language - the language.
public static java.lang.String getReportRealPath(java.lang.String userId,
java.lang.String fileName)
userId - the user name.fileName - the relative path and name of the report set.
public static java.lang.String getRptSetId(HttpServletRequest request)
request - HttpServletRequest.
public static java.lang.String getRptName(HttpServletRequest request)
request - HttpServletRequest.
public static java.lang.String getSessionID(HttpServletRequest request)
request - HttpServletRequest.
public static UserSession getUserSession(HttpServletRequest request)
request - HttpServletRequest.
jet.server.api.UserSession.
public static java.util.Map runReport(HttpServletRequest request,
java.util.Map runParams)
throws jet.JDException
request - HttpServletRequest.runParams - the additional information for running the report set.
jet.JDExceptionjet.web.dhtml.WebActLogic.runReport.public static boolean isChrome(HttpServletRequest request)
request - HttpServletRequest.
public static int getBrowserType(HttpServletRequest request)
request - HttpServletRequest.
public static boolean isRMIEnv(HttpServlet servlet)
servlet - HttpServlet.
public static java.lang.String[] sortArray(java.lang.String[] array,
int sortType)
array - a string array.sortType - the sort order type which is defined in DHTMLConstant:
public static java.lang.String[][] sortArray(java.lang.String[][] array,
int sortType)
array - a two-dimensional string array.sortType - the sort order type which is defined in DHTMLConstant:
public static java.lang.String getWebAppUrl(HttpServletRequest request,
java.lang.String webAppName)
request - HttpServletRequest.webAppName - the web application name.
jet.server.api.http.HttpUtil.getWebAppUrl.public static java.lang.String scriptBegin(boolean isNoFrame_ConnectPage)
An example of the method:
isNoFrame_ConnectPage - whether the current page is the connecting page.
public static java.lang.String scriptEnd(boolean isNoFrame_ConnectPage)
An example of the method:
isNoFrame_ConnectPage - whether the current page is the connecting page.
public static double getPageWidth(int pageType,
int orientation)
An example of the method:
pageType - the page type.orientation - the page orientation:
public static double getPageHeight(int pageType,
int orientation)
An example of the method:
pageType - the page type.orientation - the page orientation:public static jet.server.intf.jrs.ExResourceManager getResourceManager()
An example of the method:
public static boolean isResourceNode(java.lang.String userName,
java.lang.String path)
An example of the method:
userName - the user name.path - the resource path.
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
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.
UnknownResource
NodeExistsException
NoPrivilegeException
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
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.
NoPrivilegeException
UnknownResource
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
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.
UnknownResource
NoPrivilegeException
public static java.util.ArrayList[] IdentifyDirArrayList(java.lang.String userName,
java.lang.String rootpath)
throws jet.JDException
An example of the method:
userName - the user name.rootpath - the resource path.
jet.JDException
public static boolean getDirWritePermission(java.lang.String userName,
java.lang.String rootpath)
throws jet.JDException
An example of the method:
userName - the user name.rootpath - the resource path.
jet.JDException
public static java.util.ArrayList getAllReports(java.lang.String userName,
java.lang.String rootpath)
throws jet.JDException
An example of the method:
userName - the user name.rootpath - the resource path.
jet.JDExceptionpublic static java.lang.String toHtmlString(java.lang.String src)
src - the original string.
public static java.lang.String toHtmlString(java.lang.String src,
boolean noSingleQuotes)
An example of the method:
src - the original string.noSingleQuotes - whether to convert the single quote.
If false, '\'' will be "'", otherwise, no change.
public static java.lang.String toScriptString(java.lang.String oriStr)
An example of the method:
oriStr - the original string.
public static java.lang.String writeToolBarBtnHTML(java.lang.String[] item,
java.lang.String strEvent)
An example of the method:
item - the button item information:strEvent - the button event string, such as "onclick=clickAct();".
public static java.lang.String getUserName(HttpServletRequest request)
An example of the method:
request - HttpServletRequest.
public static java.lang.String msg(int key,
java.lang.Object[] args)
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}.
public static java.lang.String msg(int key,
java.lang.Object arg)
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?
public static java.lang.String msg(int key)
An example of the method:
key - the error id.
public static java.lang.String generateJsMsg()
An example of the method:
public static java.lang.String unescape(java.lang.String str)
An example of the method:
- %serverhome%/public_html/dhtmljsp/searchdialog.jsp.
public static java.lang.String escape(java.lang.String str)
An example of the method:
str - String to be translated.
public static java.lang.String decode(java.lang.String str)
An example of the method:
str - the String to decode.
public static jet.JException getOriginalJException(jet.JException jrex)
An example of the method:
jrex - the exception.
public static java.lang.Throwable[] getAllDHTMLExceptions(HttpServletRequest request)
An example of the method:
request - HttpServletRequest.
public static java.lang.String replaceAllString(java.lang.String src,
java.lang.String patten,
java.lang.String replacement)
src - the input sequence.patten - the expression to be compiled.replacement - the replacement string.
public static java.lang.String getCatalogName(java.lang.String userName,
java.lang.String resourcePath)
userName - the user name.resourcePath - the relative path of the catalog resources.
public static java.lang.String getWebContextPath(java.lang.String dhtmlCtxPath)
dhtmlCtxPath - the original DHTML context path.
public static java.lang.String convertArrayToJSArray(java.lang.String[] array)
An example of the method:
array - the specified string array.
public static java.lang.String convertArrayToJSArray(java.lang.String[][] array)
An example of the method:
array - the specified two-dimensional string array.
public static java.lang.String getDefaultToolbarItems(DHTMLConfig dhtmlConfig,
java.lang.String SessionID,
java.lang.String RptSetId)
An example of the method:
dhtmlConfig - @see DHTMLConfig.SessionID - the user session id.RptSetId - the report set id.
public static java.lang.String toJSON(java.util.Hashtable ht)
An example of the method:
ht - the specified parameters.
public static java.lang.String toJSON(java.lang.String[] array)
array - the specified parameters.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||