public class ReportUtil extends java.lang.Object implements ReportConstants
Modifier and Type | Class and Description |
---|---|
static class |
ReportUtil.WhereData |
ReportConstants.EmailFileTypes, ReportConstants.EmailType, ReportConstants.ReportTypes, ReportConstants.ScheduleType
Modifier and Type | Field and Description |
---|---|
static MXLogger |
REPORT_LOGGER |
APPHIERARCHY, ATTR_BOUNDARY_CHARS_PATTERN, ATTRIBUTE_BOUNDARY_CHARS, ATTRIBUTENAME, BIRTCTRLTYPE_TEXTBOX, BIRTDATATYPE_DATETIME, BIRTDATATYPE_STRING, DATA_TYPE_DATE_BIRT, DATA_TYPE_DATETIME_BIRT, DATA_TYPE_DECIMAL_BIRT, DATA_TYPE_FLOAT_BIRT, DATA_TYPE_INTEGER_BIRT, DATA_TYPE_STRING_BIRT, DATA_TYPE_TIME_BIRT, DEFAULTVALUE, DISPLAYWHERE, EXPORT_ACTION, EXPORT_ACTION_ALL_REPORTS, EXPORT_ACTION_LIBRARY, EXPORT_ACTION_REPORT, EXPORT_APPNAME, EXPORT_FILENAME, FILTER, GROUP, HIDDEN, INVALID_CHARS, INVALID_CHARS_PATTERN, JDBC_DATE, JDBC_DATETIME, JOIN_RELATION, LABELOVERRIDE, LINK_RELATION, LOOKUP_DATELOOKUP, LOOKUP_YORNLOOKUPLIST, LOOKUPNAME, MULTILOOKUP, OVERLOADED, PARAMDELIMITER, PARAMETERNAME, RELATION_NOT_USED, REPORT_APP_LOGGER, REPORT_CONTEXT_USER_STOPLIMIT, REQUIRED, RPT_STATUS_CANCELLED, RPT_STATUS_FAILED, RPT_STATUS_OK, RPT_STATUS_RECLIMIT, SEQUENCE, SORT, SUPPORTED_EXP_TYPES, THREAD_AVAILABLE, ZERO_CONCURRENT_RUN
Constructor and Description |
---|
ReportUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addParamstring(java.lang.String key,
java.lang.String value,
java.util.Hashtable reportParams) |
static void |
addReportProcSchedulableRecord(MboRemote reportProcSched,
java.lang.String appname,
java.lang.String reportname,
java.lang.String day,
java.util.Date startSchedulable,
java.util.Date endSchedulable,
java.lang.String timezone)
This Method adds a new record to the ReportProcSchedulable Mbo.
|
static java.lang.String |
addToReportAttachDocs(java.lang.String userId,
java.lang.String url) |
static void |
addToReportBrosParam(java.util.Hashtable paramHashtable,
boolean isSessionParam,
long brosUniqueID,
UserInfo userInfo)
Add all parameters of paramHashtable to REPORTBROSPARAM.
|
static void |
addToReportBrosParam(java.lang.String paramName,
java.lang.String ParamValue,
boolean isSessionParam,
long brosUniqueID,
UserInfo userInfo) |
static void |
addToReportBrosUrl(java.util.Vector<java.lang.String> reporUrlParam,
java.util.Vector<java.lang.Boolean> securedAttachFlags,
boolean isQpixUrl,
long brosUniqueID,
UserInfo userInfo) |
static java.lang.String |
calculateTotalReservedHours(java.util.Calendar startReserve,
java.util.Calendar endReserve)
Take the beginning and ending reserve times from the calendars, compute
and save the time difference in hours and minutes into a new calendar
and then return it in a String value.
|
static void |
checkReserveTimeOverlaps(MboSetRemote reportProcReserveSet,
java.lang.String appname,
java.lang.String reportname,
java.util.Calendar startReserve,
java.util.Calendar endReserve,
java.lang.String day,
long currentMboUniqueIDValue)
Using the beginning and ending reserve times from the current
Mbo record, determine if these times conflict with any reserved
time periods already entered.
|
static java.util.Date |
convertDateToClientTimezone(java.util.Locale clientLocale,
java.lang.String clientTimezone,
java.util.Date date)
This Method converts a TIME or DATE value from the MX Server's
timezone to the client's specified timezone and returns the result.
|
static java.util.Date |
convertDateToMXServer(java.util.Locale clientLocale,
java.lang.String clientTimezone,
java.util.Date date)
This Method converts a TIME or DATE value from the client's specified
timezone to the MX Server's timezone and returns the result.
|
static java.lang.String |
convertOnceToSchedule(java.util.Date date,
java.util.Locale locale,
java.util.TimeZone clientTimeZone)
Convert a one-time schedule from the UI input to a cron task schedule
pattern
|
static java.lang.String |
createReportName(java.lang.String appName,
java.lang.String userName)
Construct a unique file name in the format
|
static java.lang.String |
decrypt(java.lang.String source)
Decrypts the passed string using an algorithm determined by the mxe.report.sec.useDESede property.
|
static java.lang.String |
encrypt(java.lang.String source)
Encrypts the passed string using an algorithm determined by the mxe.report.sec.useDESede property.
|
static void |
finishReportProcSchedulableRecord(MboSetRemote reportProcSchedSet,
MboRemote reportProcSched,
java.lang.String appname,
java.lang.String reportname,
java.lang.String day,
java.lang.Integer dayNum,
java.util.Date startSchedulable,
boolean needsEndingTime,
boolean setFullDayAvailability,
java.lang.String timezone)
This Method is used to do any final additions to the ReportProcSchedulable Mbo
when either the next row of ReportProcReserve data read in is a for a different
report or when the last row of ReportProcReserve data has been processed but
the ReportProcSchedulable Mbo is still incomplete for the last report.
|
static java.lang.String |
formatWhere(java.lang.String whereClause,
java.lang.String baseTable,
UserInfo ui)
Qualifies the passed where clause and formats using the passed UserInfo to convert db object
names to lower case.
|
static java.lang.String |
getColumnName(MboValueInfo mvi)
Returns the name of the database column for the specified MboValueInfo.
|
static java.lang.String |
getCurrentDateFunction()
Returns sysdate, current timestamp, or getdate() depending on the database platform.
|
static ReportSecAttKeyRecord |
getcurrentSecAttKeyRecord(UserInfo userInfo)
Returns the key generated in last 24 hours.
|
static java.lang.String |
getCurrentTimestampFunction()
Returns trunc(sysdate), current date, or convert(date, getdate())
depending on the database.
|
static java.lang.String |
getDayName(java.lang.String dayNum,
UserInfo userInfo)
This Method finds the DAY name stored in the DAYNAME domain for the
dayNum value passed in.
|
static java.lang.String |
getDBType() |
static java.lang.String |
getEmailAddress(java.lang.String userId)
Returns the email address of the user with the passed in user ID.
|
static java.lang.String |
getEntityName(java.lang.String objectName)
Returns the name of the database object for the specified object name.
|
static java.lang.String[] |
getExportReportList() |
static byte[] |
getKey(java.lang.String seqNumberString) |
static MosDetailInfo |
getMosDetailInfo(java.lang.String intObjectName,
int objectID)
Returns the MosDetailInfo from the cache for the specified objectID in the specified object structure.
|
static java.lang.String |
getRandomString() |
static java.lang.String |
getRandomString(int len) |
static java.lang.String |
getReportAttachDocsUrl(java.lang.String userId,
java.lang.String key) |
static java.lang.String |
getUserFolderName(java.lang.String userName)
Returns a string that uniquely identifies the user, which is used in creating a folder path for
transient QBRs and file name for all QBRs.
|
static java.lang.String |
getUserFolderName(UserInfo userInfo)
Returns a string that uniquely identifies the user, which is used in creating a folder path for
transient QBRs and file name for all QBRs.
|
static java.util.Set<java.lang.String> |
getValidAttributes(MosDetailInfo detailInfo)
Returns a set of valid attributes for the specified object structure detail.
|
static java.util.Set<java.lang.String> |
getValidAttributes(java.lang.String objectName)
Returns a set of valid attributes for the specified object, exluding nonpersistent attributes.
|
static java.lang.String |
getViewerURL(java.lang.String contextPath,
java.lang.String sessionId,
UserInfo userInfo,
java.util.Hashtable reportParams)
This method returns the URL used to access BIRT reports.
|
static java.lang.String |
getViewerURL(java.lang.String contextPath,
java.lang.String sessionId,
UserInfo userInfo,
java.util.Hashtable reportParams,
boolean isDirectPrint)
This method returns the URL used to access BIRT reports.
|
static ReportUtil.WhereData |
getWhereData(java.lang.String where,
java.lang.String baseTable) |
static boolean |
hasAttribute(Node expression,
java.lang.String objectName,
java.util.Set<java.lang.String> validAttributes) |
static boolean |
hasAttribute(java.lang.String expression,
java.lang.String objectName,
java.util.Set<java.lang.String> validAttributes)
Takes an expression and splits on a string exp to determine if the attribute exists
Returns true if an attribute exists
|
static boolean |
hasParameters(MboRemote reportRemote)
Check if the report has parameters
|
static boolean |
hasSubSelects(java.lang.String whereClause)
This method determines whether or not the passed where clause
contains one or more subqueries.
|
static boolean |
isMultiLang()
Determines if the system is configured for multiple languages, as determined by the enabled
flag in the Language object.
|
static java.lang.String |
makeSafeForXML(java.lang.String value)
Escape characters from the passed string value that are not safe in presentation XML.
|
static Node |
parseExpression(java.lang.String expression,
com.ibm.icu.util.ULocale icuLocale)
Returns a parse tree of the provided expression that uses the decimal separator for the given locale.
|
static java.lang.String |
qualifyWhere(java.lang.String where,
java.lang.String baseTable) |
static java.lang.String |
replaceString(java.lang.String str,
java.lang.String pattern,
java.lang.String replacement)
Replace all occurrences of a pattern string with a replacement string.
|
static void |
resetScheduleAvailability(java.lang.String currAppname,
java.lang.String currReportname,
UserInfo userInfo)
This method must determine all the mirror images for a set of reserved times set for an
appname/reportname combination.
|
static void |
scheduleEndTime(int reserveStartMin,
java.util.Calendar endSchedulableTime,
java.util.Calendar startReserve)
This method figures the ending avail time based on the current reserve record start time.
|
static void |
scheduleStartTime(int reserveEndMin,
java.util.Calendar startSchedulableTime,
java.util.Calendar endReserve)
This method figures the starting avail time based on the current reserve record start time.
|
static void |
setLabelSyncFlag()
Updates the SYNCREPORTLABELS maxvar to indicate that the labels for some languages might be outdated
or missing.
|
static java.lang.String |
toHourMinSecFromMiliSec(long runTimeMilliSeconds)
Take the beginning and ending reserve times from the calendars, compute
and save the time difference in hours and minutes into a new calendar
and then return it in a String value.
|
static void |
updateReportLabelsAllLangs(UserInfo ui)
For each enabled language, retrieve the values used in the replibrary
presentation labels.
|
static boolean |
validateAvailSchedulingTime(java.lang.String appname,
java.lang.String reportname,
java.util.Date date,
java.lang.String scheduleType,
UserInfo userInfo)
Check that the schedule time chosen to run the report falls within the times the report is
allowed to run as shown in the Schedule Availability section on the request page.
|
static void |
validateExpression(Node parsedExpr,
java.lang.String objectName,
java.util.Set<java.lang.String> validAttributes,
java.lang.String category)
Validates the expression represented by the passed parse tree against the set of valid
attributes and the contents of the report expression library.
|
static void |
verifySchedule(MboRemote reportSched)
Deprecated.
|
static void |
writeFullDayAvailability(MboSetRemote reportProcSchedSet,
MboRemote reportProcSched,
java.lang.String appname,
java.lang.String reportname,
java.lang.Integer dayNum,
UserInfo userInfo,
java.lang.String timezone)
This Method is used to write one entire day of availability so the available
time to schedule the report is any time on this day.
|
public static final MXLogger REPORT_LOGGER
public static java.lang.String convertOnceToSchedule(java.util.Date date, java.util.Locale locale, java.util.TimeZone clientTimeZone) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
@Deprecated public static void verifySchedule(MboRemote reportSched) throws MXException
MXException
public static java.lang.String qualifyWhere(java.lang.String where, java.lang.String baseTable) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static ReportUtil.WhereData getWhereData(java.lang.String where, java.lang.String baseTable) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static java.lang.String getDBType() throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException
public static boolean hasParameters(MboRemote reportRemote) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException
public static java.lang.String calculateTotalReservedHours(java.util.Calendar startReserve, java.util.Calendar endReserve) throws java.rmi.RemoteException, MXException
Calendar
- startReserveCalendar
- endReservejava.rmi.RemoteException
MXException
public static void checkReserveTimeOverlaps(MboSetRemote reportProcReserveSet, java.lang.String appname, java.lang.String reportname, java.util.Calendar startReserve, java.util.Calendar endReserve, java.lang.String day, long currentMboUniqueIDValue) throws java.rmi.RemoteException, MXException
MboSetRemote
- reportProcReserveSetString
- appnameString
- reportnameCalendar
- startReserveCalendar
- endReserveString
- daynumlong
- currentMboUniqueIDValuejava.rmi.RemoteException
MXException
public static boolean validateAvailSchedulingTime(java.lang.String appname, java.lang.String reportname, java.util.Date date, java.lang.String scheduleType, UserInfo userInfo) throws java.rmi.RemoteException, MXException
String
- appnameString
- reportnameCalendar
- scheduleTimeString
- scheduleTypeUserInfo
- userInfojava.rmi.RemoteException
MXException
public static java.lang.String toHourMinSecFromMiliSec(long runTimeMilliSeconds) throws java.rmi.RemoteException, MXException
Integer
- runTimeMilliSecondsjava.rmi.RemoteException
MXException
public static void resetScheduleAvailability(java.lang.String currAppname, java.lang.String currReportname, UserInfo userInfo) throws MXException, java.rmi.RemoteException
String
- currAppnameString
- currReportnameUserInfo
- userInfojava.rmi.RemoteException
MXException
public static void addReportProcSchedulableRecord(MboRemote reportProcSched, java.lang.String appname, java.lang.String reportname, java.lang.String day, java.util.Date startSchedulable, java.util.Date endSchedulable, java.lang.String timezone) throws MXException, java.rmi.RemoteException
MboRemote
- reportProcSchedulableString
- appnameString
- reportnameString
- dayDate
- startSchedulableDate
- endSchedulableMXException
java.rmi.RemoteException
public static void finishReportProcSchedulableRecord(MboSetRemote reportProcSchedSet, MboRemote reportProcSched, java.lang.String appname, java.lang.String reportname, java.lang.String day, java.lang.Integer dayNum, java.util.Date startSchedulable, boolean needsEndingTime, boolean setFullDayAvailability, java.lang.String timezone) throws MXException, java.rmi.RemoteException
MboSetRemote
- reportProcSchedulableSetMboRemote
- reportProcSchedulableString
- appnameString
- reportnameString
- dayINteger
- dayNumDate
- startSchedulableboolean
- needsEndingTimeboolean
- setFullDayAvailabilityMXException
java.rmi.RemoteException
public static void writeFullDayAvailability(MboSetRemote reportProcSchedSet, MboRemote reportProcSched, java.lang.String appname, java.lang.String reportname, java.lang.Integer dayNum, UserInfo userInfo, java.lang.String timezone) throws MXException, java.rmi.RemoteException
MboSetRemote
- reportProcSchedulableSetMboRemote
- reportProcSchedulableString
- appnameString
- reportnameInteger
- dayNumUserInfo
- userInfoMXException
java.rmi.RemoteException
public static void scheduleEndTime(int reserveStartMin, java.util.Calendar endSchedulableTime, java.util.Calendar startReserve) throws MXException, java.rmi.RemoteException
int
- reserveStartMinCalendar
- endSchedulableTimeCalendar
- startReserveMXException
java.rmi.RemoteException
public static void scheduleStartTime(int reserveEndMin, java.util.Calendar startSchedulableTime, java.util.Calendar endReserve) throws MXException, java.rmi.RemoteException
reserveEndMin
- startSchedulableTime
- endReserve
- MXException
java.rmi.RemoteException
public static java.lang.String getDayName(java.lang.String dayNum, UserInfo userInfo) throws MXException, java.rmi.RemoteException
String
- dayNumUserInfo
- userInfoMXException
java.rmi.RemoteException
public static java.util.Date convertDateToMXServer(java.util.Locale clientLocale, java.lang.String clientTimezone, java.util.Date date) throws MXException, java.rmi.RemoteException
Locale
- clientLocaleString
- clientTimezoneDate
- dateMXException
java.rmi.RemoteException
public static java.util.Date convertDateToClientTimezone(java.util.Locale clientLocale, java.lang.String clientTimezone, java.util.Date date) throws MXException, java.rmi.RemoteException
Locale
- clientLocaleString
- clientTimezoneDate
- dateMXException
java.rmi.RemoteException
public static boolean hasSubSelects(java.lang.String whereClause)
String
- whereClausepublic static java.lang.String getViewerURL(java.lang.String contextPath, java.lang.String sessionId, UserInfo userInfo, java.util.Hashtable reportParams) throws MXException, java.rmi.RemoteException
WebClientSession
- clientSessionString
- contextPathHashtable
- reportParamsMXException
java.rmi.RemoteException
public static java.lang.String getViewerURL(java.lang.String contextPath, java.lang.String sessionId, UserInfo userInfo, java.util.Hashtable reportParams, boolean isDirectPrint) throws MXException, java.rmi.RemoteException
WebClientSession
- clientSessionString
- contextPathHashtable
- reportParamsboolean
- isDirectPrintMXException
java.rmi.RemoteException
public static java.lang.String createReportName(java.lang.String appName, java.lang.String userName) throws MXException, java.rmi.RemoteException
UserInfo
- userInfo the userInfo for the current userString
- appName the home application for the reportMXException,
- RemoteExceptionMXException
java.rmi.RemoteException
public static java.lang.String getUserFolderName(UserInfo userInfo) throws MXException, java.rmi.RemoteException
userInfo
- MXException
java.rmi.RemoteException
public static java.lang.String getUserFolderName(java.lang.String userName) throws MXException, java.rmi.RemoteException
userName
- MXException
java.rmi.RemoteException
public static void addParamstring(java.lang.String key, java.lang.String value, java.util.Hashtable reportParams)
public static void updateReportLabelsAllLangs(UserInfo ui) throws MXException, java.rmi.RemoteException
userInfo
- UserInfo that determines the current languageMXException
java.rmi.RemoteException
public static java.lang.String makeSafeForXML(java.lang.String value)
value
- the string to be escapedpublic static java.lang.String replaceString(java.lang.String str, java.lang.String pattern, java.lang.String replacement)
str
- String target string to searchpattern
- String to locate in the targetreplacement
- String to replace pattern withpublic static ReportSecAttKeyRecord getcurrentSecAttKeyRecord(UserInfo userInfo) throws MXException, java.rmi.RemoteException
userInfo
- MXException
java.rmi.RemoteException
public static byte[] getKey(java.lang.String seqNumberString)
public static java.lang.String addToReportAttachDocs(java.lang.String userId, java.lang.String url)
public static java.lang.String getReportAttachDocsUrl(java.lang.String userId, java.lang.String key)
public static java.lang.String getRandomString(int len)
public static java.lang.String getRandomString()
public static java.lang.String formatWhere(java.lang.String whereClause, java.lang.String baseTable, UserInfo ui) throws MXException, java.rmi.RemoteException
whereClause
- the where clause to be formattedbaseTable
- the table used for qualificationuserInfo
- the UserInfo for the formatMXException
java.rmi.RemoteException
public static void addToReportBrosParam(java.util.Hashtable paramHashtable, boolean isSessionParam, long brosUniqueID, UserInfo userInfo) throws MXException, java.rmi.RemoteException
paramHashtable
- the list of parametersisSessionParam
- whether this list has to be stored as session parameterbrosUniqueID
- uniqueid of REPORTBROS tableuserInfo
- User InfoMXException
java.rmi.RemoteException
public static void addToReportBrosParam(java.lang.String paramName, java.lang.String ParamValue, boolean isSessionParam, long brosUniqueID, UserInfo userInfo) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static void addToReportBrosUrl(java.util.Vector<java.lang.String> reporUrlParam, java.util.Vector<java.lang.Boolean> securedAttachFlags, boolean isQpixUrl, long brosUniqueID, UserInfo userInfo) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static java.lang.String getEmailAddress(java.lang.String userId) throws MXException, java.rmi.RemoteException
userID
- the useridMXException
java.rmi.RemoteException
public static boolean hasAttribute(java.lang.String expression, java.lang.String objectName, java.util.Set<java.lang.String> validAttributes) throws MXException, java.rmi.RemoteException
expression
- the string to testobjectName
- the string representation of the mbo objectvalidAttributes
- optional set of valid attributes to validate againstMXException
java.rmi.RemoteException
public static boolean hasAttribute(Node expression, java.lang.String objectName, java.util.Set<java.lang.String> validAttributes) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static java.util.Set<java.lang.String> getValidAttributes(MosDetailInfo detailInfo)
MosDetailInfo
- detailInfo the MosDetailInfo that includes the valid columnspublic static java.util.Set<java.lang.String> getValidAttributes(java.lang.String objectName) throws java.rmi.RemoteException
String
- objectName the name of the objectMXException,
- RemoteExceptionjava.rmi.RemoteException
public static MosDetailInfo getMosDetailInfo(java.lang.String intObjectName, int objectID) throws MXException, java.rmi.RemoteException
String
- intObjectName the name of the object structureint
- objectID the object ID that identifies an object in the object structureMXException,
- RemoteExceptionMXException
java.rmi.RemoteException
public static java.lang.String getColumnName(MboValueInfo mvi)
String
- objectName the name of the objectMXException,
- RemoteExceptionpublic static java.lang.String getEntityName(java.lang.String objectName) throws MXException, java.rmi.RemoteException
String
- objectName the name of the objectMXException,
- RemoteExceptionMXException
java.rmi.RemoteException
public static java.lang.String getCurrentDateFunction() throws java.rmi.RemoteException
java.rmi.RemoteException
public static java.lang.String getCurrentTimestampFunction() throws java.rmi.RemoteException
java.rmi.RemoteException
public static Node parseExpression(java.lang.String expression, com.ibm.icu.util.ULocale icuLocale) throws MXException
expression
- icuLocale
- MXException
public static void validateExpression(Node parsedExpr, java.lang.String objectName, java.util.Set<java.lang.String> validAttributes, java.lang.String category) throws MXException, java.rmi.RemoteException
parsedExp
- the parse tree that represents the expression to be testedobjectName
- the string representation of the mbo objectvalidAttributes
- set of valid attributes to validate againstMXException
java.rmi.RemoteException
public static java.lang.String[] getExportReportList()
public static boolean isMultiLang() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static void setLabelSyncFlag() throws MXException, java.rmi.RemoteException
MXException,
- RemoteExceptionMXException
java.rmi.RemoteException
public static java.lang.String encrypt(java.lang.String source) throws java.lang.Exception
source
- the string to encryptjava.lang.Exception
public static java.lang.String decrypt(java.lang.String source) throws java.lang.Exception
source
- the string to decryptjava.lang.Exception