|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.nurelm.util.NuPlatformUtil
Contains special items related to the NuRelm development platform. For example, the siteId for all sites is obtained by reading the path in which the site is located. The method to obtain the siteId is located in this class.
| Field Summary | |
|---|---|
static java.lang.String |
chkErrorMsg
Logs Exception and Error Message with more information like site ID |
static java.lang.String |
LOGGING_DEBUG_PREFIX
|
static java.lang.String |
LOGGING_ERROR_PREFIX
Prefix used for all error logs. |
static java.lang.String |
LOGGING_INFO_PREFIX
Prefix used for all info logs. |
static java.lang.String |
UNIX_STYLE_PREFIX
Represent the absolute path prefix that indicates where the virtual domains live on the host machine. |
static java.lang.String |
WINDOWS_STYLE_PREFIX
Represent the absolute path prefix that indicates where the virtual domains live on the host machine. |
| Constructor Summary | |
|---|---|
NuPlatformUtil()
Creates a new NuPlatformUtil object. |
|
| Method Summary | |
|---|---|
static java.lang.String |
createActionForwardPath(java.lang.String basePath,
java.lang.String pageId,
boolean isRepeatContent,
java.lang.String startItem,
java.lang.String restrictids,
java.lang.String restrictvalues,
java.lang.String searchids,
java.lang.String searchvalues,
java.lang.String sortbyids,
java.lang.String sortbydirections,
java.lang.String repeatItemId)
Creates a path for an ActionForward instantiation that
includes the common NuRelm parameters that need to be passed around. |
static java.lang.String |
getEmailDomain(javax.servlet.ServletContext sc,
javax.servlet.http.HttpServletRequest request)
Returns the site's e-mail domain name. |
static java.lang.String |
getFilteredHtml(javax.servlet.ServletContext sc,
java.lang.String content)
Runs the NuRelm HTML filter based on the init parameters htmlFilterAllowedAttributes, htmlFilterAllowedTags, and htmlFilterDropEmptyParas. |
static java.lang.String |
getHtmlFilterAllowedAttributes(javax.servlet.ServletContext sc)
Gets htmlFilterAllowedAttributes init parameter (set in web.xml). |
static java.lang.String |
getHtmlFilterAllowedTags(javax.servlet.ServletContext sc)
Gets htmlFilterAllowedTags init parameter (set in web.xml). |
static boolean |
getHtmlFilterDropEmptyParas(javax.servlet.ServletContext sc)
Gets htmlFilterDropEmptyParas init parameter (set in web.xml). |
static java.lang.String |
getLockingURL(java.lang.String originatingPageURL,
Site site)
Makes sure that the URL passed in specifies a Locking pageId, rather than the ID of a working page. |
static Node |
getNodeDoNotLock(javax.servlet.http.HttpServletRequest request)
Returns the requested Node, but never locks it first. |
static Node |
getNodeDoNotLock(javax.servlet.http.HttpServletRequest request,
java.lang.String pageId)
|
static Node |
getNodeLockIfNeeded(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext,
java.lang.String pageURI)
Returns the requested Node, but locks it and returns the
working copy instead if necessary. |
static Node |
getNodeLockIfNeeded(java.lang.String id,
javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext,
java.lang.String pageURI)
Returns the requested Node, but locks it and returns the
working copy instead if necessary. |
static Page |
getPage(javax.servlet.http.HttpServletRequest request)
Returns the requested page, does not lock it ever. |
static Page |
getPageLockIfNeeded(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext,
java.lang.String pageURI)
Returns the requested Page, but locks it and returns the
working copy instead if necessary. |
static boolean |
getRequireLocking(javax.servlet.ServletContext sc)
Gets requireLocking init parameter (set in web.xml). |
static java.lang.String |
getReviewType(javax.servlet.ServletContext sc)
Gets reviewType init parameter (set in web.xml). |
static java.lang.String |
getSiteId(javax.servlet.ServletContext sc)
Gets siteId init parameter (set in web.xml). |
static java.lang.String |
getSiteInfoString(javax.servlet.http.HttpServletRequest request)
Gets a string with the current site's ID and logged in user. |
static java.lang.String |
getStackTraceAsString(java.lang.Throwable e)
Returns Exception stack trace as String. |
static java.lang.String[] |
getUsersHavingReviewAccess(javax.servlet.http.HttpServletRequest request)
Gets Users who has Review Permisson as String Array. |
static UserValueObject |
getUserVO(javax.servlet.http.HttpServletRequest request)
|
static boolean |
IsPageHasReviewersfromReviewGroup(Site site,
Page page)
Checks the page in this site has reviewers from reviewer group return true if page has. |
static boolean |
isReviewTypeAdminExtTurnedOn(javax.servlet.ServletContext sc)
Returns true if review type extension turn on (set in web.xml). |
static boolean |
isUserExistsInGroup(javax.servlet.http.HttpServletRequest request,
java.lang.String username,
java.lang.String groupName)
Checks the user exisats in the group in the site return true if page has. |
static boolean |
isUserExistsInGroup(Site site,
java.lang.String username,
java.lang.String groupName)
Checks the user exisats in the group in the site return true if page has. |
static boolean |
isUserHasReviewPermissionOnPage(Page page,
java.lang.String userName)
Checks the page in this site has reviewers from reviewer group return true if page has. |
static void |
logAndThrowDataAccessException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
javax.servlet.http.HttpServletRequest request,
java.lang.String errorMsg)
Logs Data Access Exception And throw is with more ingformation like site ID |
static void |
logAndThrowDataAccessException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.String errorMsg)
Logs Data Access Exception And throw is with more ingformation like site ID |
static void |
logAndThrowException(java.util.logging.Logger LOG,
java.lang.String error)
Logs an error message to a logger, then throws a DataAccessException with the same error. |
static void |
logAndThrowRuntimeException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.Throwable exception,
java.lang.String errorMsg)
Log exception and throw Runtime Exception with more ingformation like site ID |
static void |
logAndThrowSystemException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.Throwable error,
javax.servlet.http.HttpServletRequest request,
java.lang.String errorMsg)
Logs Exception And throw System Exception with more ingformation like site ID |
static void |
logAndThrowSystemException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.Throwable exception,
java.lang.String errorMsg)
Log exception and throw System Exception with more ingformation like site ID |
static void |
logDebug(org.apache.log4j.Logger LOG,
java.lang.String debugMsg)
Logs debug message. |
static void |
logErrorMsg(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
javax.servlet.http.HttpServletRequest request,
java.lang.String errorMsg)
Logs Error Message with more information like site ID |
static void |
logErrorMsg(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.String errorMsg)
Logs Error Message with more ingformation like site ID |
static void |
logException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.Throwable exp,
javax.servlet.http.HttpServletRequest request,
java.lang.String errorMsg)
|
static void |
logException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.Throwable exp,
java.lang.String errorMsg)
Logs Exception and Error Message with more information like site ID |
static void |
removeFile(javax.servlet.ServletContext sc,
File file)
|
static void |
removeImageFile(javax.servlet.ServletContext sc,
Image image)
|
static boolean |
theFileExists(java.lang.String filename)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String LOGGING_INFO_PREFIX
public static final java.lang.String LOGGING_ERROR_PREFIX
public static final java.lang.String LOGGING_DEBUG_PREFIX
public static final java.lang.String WINDOWS_STYLE_PREFIX
public static final java.lang.String UNIX_STYLE_PREFIX
public static java.lang.String chkErrorMsg
| Constructor Detail |
public NuPlatformUtil()
| Method Detail |
public static java.lang.String getLockingURL(java.lang.String originatingPageURL,
Site site)
public static void logAndThrowException(java.util.logging.Logger LOG,
java.lang.String error)
throws DataAccessException
error - The error message to log and include with the exception
DataAccessException - Thrown by this method no matter what.
public static java.lang.String getFilteredHtml(javax.servlet.ServletContext sc,
java.lang.String content)
sc - The current context.content - The content to be filtered.
public static java.lang.String getHtmlFilterAllowedAttributes(javax.servlet.ServletContext sc)
sc - The current context.
public static java.lang.String getHtmlFilterAllowedTags(javax.servlet.ServletContext sc)
sc - The current context.
public static boolean getHtmlFilterDropEmptyParas(javax.servlet.ServletContext sc)
sc - The current context.
public static boolean getRequireLocking(javax.servlet.ServletContext sc)
sc - The current context.
falsepublic static java.lang.String getReviewType(javax.servlet.ServletContext sc)
sc - The current context.
public static boolean isReviewTypeAdminExtTurnedOn(javax.servlet.ServletContext sc)
sc - The current context.
public static java.lang.String getSiteInfoString(javax.servlet.http.HttpServletRequest request)
request - The current HttpServletRequest
public static java.lang.String getSiteId(javax.servlet.ServletContext sc)
throws NuPlatformException
sc - The current context.
NuPlatformException - Thrown if siteId was not set.
public static java.lang.String[] getUsersHavingReviewAccess(javax.servlet.http.HttpServletRequest request)
throws DataAccessException
request - (HttpServlet Request).
Data - Access Exception .
DataAccessExceptionpublic static UserValueObject getUserVO(javax.servlet.http.HttpServletRequest request)
public static Page getPage(javax.servlet.http.HttpServletRequest request)
request - The current request.
public static Page getPageLockIfNeeded(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext,
java.lang.String pageURI)
Page, but locks it and returns the
working copy instead if necessary.
request - The current request.servletContext - The current servlet context.
public static Node getNodeLockIfNeeded(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext,
java.lang.String pageURI)
Node, but locks it and returns the
working copy instead if necessary.
request - The current request, which should contain the required
pageId.servletContext - The current servlet context.
public static Node getNodeLockIfNeeded(java.lang.String id,
javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext,
java.lang.String pageURI)
Node, but locks it and returns the
working copy instead if necessary.
id - The id of the node to be returned.request - The current request.servletContext - The current servlet context.
public static Node getNodeDoNotLock(javax.servlet.http.HttpServletRequest request)
Node, but never locks it first.
request - The current request, which should contain the required
pageId.
Node specified, never a locked version
(unless a locked one was specified).
public static Node getNodeDoNotLock(javax.servlet.http.HttpServletRequest request,
java.lang.String pageId)
public static boolean theFileExists(java.lang.String filename)
public static java.lang.String getEmailDomain(javax.servlet.ServletContext sc,
javax.servlet.http.HttpServletRequest request)
throws NuPlatformException
sc - Current site context.request - Current request.
NuPlatformException
public static java.lang.String createActionForwardPath(java.lang.String basePath,
java.lang.String pageId,
boolean isRepeatContent,
java.lang.String startItem,
java.lang.String restrictids,
java.lang.String restrictvalues,
java.lang.String searchids,
java.lang.String searchvalues,
java.lang.String sortbyids,
java.lang.String sortbydirections,
java.lang.String repeatItemId)
ActionForward instantiation that
includes the common NuRelm parameters that need to be passed around.
These include restrictids, restrictvalues, sortbyids, sortbydirections,
startItem, and an anchor to a specific repeatItem's id.
basePath - The path to which parameter values will be added.pageId - The ID of the destination pageisRepeatContent - true if path is being created for content in a
repeat block.startItem - If repeat content, the start itemm for the current
"chunk"restrictids - From the current repeat block parametersrestrictvalues - From the current repeat block parameterssearchids - From the current repeat block parameterssearchvalues - From the current repeat block parameterssortbyids - From the current repeat block parametersrepeatItemId - From the current repeat block parameters
ActionForward constructions.public static java.lang.String getStackTraceAsString(java.lang.Throwable e)
public static void logAndThrowDataAccessException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.String errorMsg)
throws DataAccessException
LOG - Logger object of the class.logLevel - Logging Level like INFO,WARNerrorMsg - String error message to log
DataAcessException
DataAccessException
public static void logAndThrowSystemException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.Throwable exception,
java.lang.String errorMsg)
throws NuContentSystemException
LOG - Logger object of the class.logLevel - Logging Level like INFO,WARNexception - The Exception object to be logged.errorMsg - String error message to log
NuContentSystemException
public static void logAndThrowRuntimeException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.Throwable exception,
java.lang.String errorMsg)
throws java.lang.RuntimeException
LOG - Logger object of the class.logLevel - Logging Level like INFO,WARNexception - The Exception object to be logged.errorMsg - String error message to log
java.lang.RuntimeException
public static void logErrorMsg(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.String errorMsg)
LOG - Logger object of the class.logLevel - Logging Level like INFO,WARNerrorMsg - String error message to log
public static void logException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.Throwable exp,
java.lang.String errorMsg)
LOG - Logger object of the class.logLevel - Logging Level like INFO,WARNerrorMsg - String error message to log
public static void logDebug(org.apache.log4j.Logger LOG,
java.lang.String debugMsg)
LOG - Logger object of the class.debugMsg - String error message to log
public static void logAndThrowDataAccessException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
javax.servlet.http.HttpServletRequest request,
java.lang.String errorMsg)
throws DataAccessException
LOG - Logger object of the class.request - current request object to get site IdlogLevel - Logging Level like INFO,WARNerrorMsg - String error message to log
DataAcessException
DataAccessException
public static void logAndThrowSystemException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.Throwable error,
javax.servlet.http.HttpServletRequest request,
java.lang.String errorMsg)
throws NuContentSystemException
LOG - Logger object of the class.logLevel - Logging Level like INFO,WARNrequest - current request object to get site IderrorMsg - String error message to log
NuContentSystemException
public static void logErrorMsg(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
javax.servlet.http.HttpServletRequest request,
java.lang.String errorMsg)
LOG - Logger object of the class.logLevel - Logging Level like INFO,WARNrequest - current request object to get site IderrorMsg - String error message to log
public static void logException(org.apache.log4j.Logger LOG,
org.apache.log4j.Level logLevel,
java.lang.Throwable exp,
javax.servlet.http.HttpServletRequest request,
java.lang.String errorMsg)
public static boolean IsPageHasReviewersfromReviewGroup(Site site,
Page page)
throws DataAccessException
site - object of Site class.page - object of Page class
DataAcessException
DataAccessException
public static boolean isUserHasReviewPermissionOnPage(Page page,
java.lang.String userName)
throws DataAccessException
page - object of Page class
DataAcessException
DataAccessException
public static boolean isUserExistsInGroup(Site site,
java.lang.String username,
java.lang.String groupName)
throws DataAccessException
site - object of Site class.
DataAcessException
DataAccessException
public static boolean isUserExistsInGroup(javax.servlet.http.HttpServletRequest request,
java.lang.String username,
java.lang.String groupName)
throws DataAccessException
DataAcessException
DataAccessException
public static void removeImageFile(javax.servlet.ServletContext sc,
Image image)
public static void removeFile(javax.servlet.ServletContext sc,
File file)
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||