|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.endeca.portlet.util.EndecaPortletUtil
public class EndecaPortletUtil
EndecaPortlet
.Constructor Summary | |
---|---|
EndecaPortletUtil()
|
Method Summary | |
---|---|
static java.lang.String |
getApplicationContextPath(javax.portlet.PortletRequest request)
Get the context path for the specified application |
static java.lang.String |
getApplicationDataSourceId(javax.servlet.http.HttpServletRequest request)
Retrieves the value of the data source for the current application |
static DataSource |
getDataSource(javax.portlet.PortletRequest request)
Retrieve the DataSource that this portlet listens to. |
static java.util.Map<java.lang.String,java.lang.String> |
getDataSourceDisplayNameMap(java.util.Map<java.lang.String,MDEXState> originalDataSourceMap)
Function to resolve duplicate DataSource names for display. |
static java.lang.String |
getDataSourceId(javax.portlet.PortletRequest request)
Retrieve the dataSourceId of the data source that this portlet listens to. |
static java.lang.String |
getDefaultDataSourceId()
Retrieves the value of the default data source |
static java.lang.String |
getDefaultLocale(Container container)
Returns the default locale for the container. |
static java.lang.String |
getDisplayName(DataSource dataSource,
java.lang.String key)
Retrieves the global display name for the specified attribute |
static java.lang.String |
getDisplayName(DataSource dataSource,
java.lang.String key,
java.util.Locale locale)
Retrieves the locale display name for the specified attribute |
static java.lang.String |
getDisplayName(javax.portlet.PortletRequest request,
java.lang.String key)
Retrieves the global display name for the specified attribute |
static java.lang.String |
getDisplayName(javax.portlet.PortletRequest request,
java.lang.String key,
java.util.Locale locale)
Retrieves the locale display name for the specified attribute |
static java.lang.String |
getFullyQualifiedTransitionContext(javax.portlet.PortletRequest request,
java.lang.String viewTransitionPageContext)
Returns a fully-qualified target page context path. |
static java.lang.String |
getRequestLocale(javax.portlet.PortletRequest request,
Container container)
Returns the locale to be used for the current request. |
static java.util.List<com.endeca.mdex.sconfig._2010.types.SemanticEntity> |
getSemanticEntities(DataSource dataSource)
Get Semantic entities (Data views). |
static java.util.List<com.endeca.mdex.sconfig._2010.types.SemanticEntity> |
getSemanticEntities(DataSource dataSource,
boolean forceUncached)
Get Semantic entities (Data views). |
static boolean |
hasPrivilege(javax.portlet.PortletRequest request,
Container container,
java.lang.String privilege)
|
static boolean |
hasUpdatePrivileges(javax.portlet.PortletRequest request,
Container container)
|
static boolean |
hasViewPrivileges(javax.portlet.PortletRequest request,
Container container)
|
static boolean |
isLiferay(Container container)
|
static void |
writeErrorMessageResponse(java.lang.String message,
javax.portlet.RenderResponse response)
Convenience method for outputting a message directly to a render response. |
static void |
writeErrorMessageResponse(java.lang.String message,
javax.portlet.ResourceResponse response)
|
static void |
writeErrorObjectResponse(java.lang.Object obj,
javax.portlet.ResourceResponse response)
Sets the HTTP status code of a response to 500 and logs an error message |
static void |
writeJSONArrayResponse(org.json.JSONArray jsonArr,
javax.portlet.ResourceResponse response)
Convenience method for outputting a JSONArray to a resource response. |
static void |
writeJSONResponse(org.json.JSONObject jsonObj,
javax.portlet.RenderResponse response)
Deprecated. Should use writeObjectResponse |
static void |
writeJSONResponse(org.json.JSONObject jsonObj,
javax.portlet.RenderResponse response,
java.lang.String callback)
Deprecated. Should use writeObjectResponse |
static void |
writeJSONResponse(org.json.JSONObject jsonObj,
javax.portlet.ResourceResponse response)
Deprecated. Should use writeObjectResponse |
static void |
writeJSONResponse(org.json.JSONObject jsonObj,
javax.portlet.ResourceResponse response,
java.lang.String callback)
Deprecated. Should use writeObjectResponse |
static void |
writeMessageResponse(java.lang.String message,
javax.portlet.RenderResponse response)
Convenience method for outputting a message directly to a render response. |
static void |
writeMessageResponse(java.lang.String message,
javax.portlet.ResourceResponse response)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.RenderResponse response)
Convenience method for outputting an Object to a render response. |
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.RenderResponse response,
java.lang.Class<?> view)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.RenderResponse response,
java.lang.Class<?> view,
org.codehaus.jackson.map.ObjectMapper mapper)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.RenderResponse response,
java.lang.Class<?> view,
java.lang.String callback)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.RenderResponse response,
java.lang.Class<?> view,
java.lang.String callback,
org.codehaus.jackson.map.ObjectMapper mapper)
Convenience method for outputting an Object to a render response, with the name of a JavaScript callback function to be appended to the response. |
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.RenderResponse response,
org.codehaus.jackson.map.ObjectMapper mapper)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.RenderResponse response,
java.lang.String callback)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.RenderResponse response,
java.lang.String callback,
org.codehaus.jackson.map.ObjectMapper mapper)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.ResourceResponse response)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.ResourceResponse response,
java.lang.Class<?> view)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.ResourceResponse response,
java.lang.Class<?> view,
org.codehaus.jackson.map.ObjectMapper mapper)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.ResourceResponse response,
java.lang.Class<?> view,
java.lang.String callback)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.ResourceResponse response,
java.lang.Class<?> view,
java.lang.String callback,
org.codehaus.jackson.map.ObjectMapper mapper)
Convenience method for outputting an Object to a resource response, with the name of a JavaScript callback function to be appended to the response. |
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.ResourceResponse response,
org.codehaus.jackson.map.ObjectMapper mapper)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.ResourceResponse response,
java.lang.String callback)
|
static void |
writeObjectResponse(java.lang.Object obj,
javax.portlet.ResourceResponse response,
java.lang.String callback,
org.codehaus.jackson.map.ObjectMapper mapper)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EndecaPortletUtil()
Method Detail |
---|
public static boolean hasPrivilege(javax.portlet.PortletRequest request, Container container, java.lang.String privilege)
public static boolean hasUpdatePrivileges(javax.portlet.PortletRequest request, Container container)
public static boolean hasViewPrivileges(javax.portlet.PortletRequest request, Container container)
public static boolean isLiferay(Container container)
public static DataSource getDataSource(javax.portlet.PortletRequest request)
request
- the current request
public static java.lang.String getDataSourceId(javax.portlet.PortletRequest request)
request
- the current request
public static java.lang.String getDisplayName(javax.portlet.PortletRequest request, java.lang.String key)
request
- key
-
public static java.lang.String getDisplayName(javax.portlet.PortletRequest request, java.lang.String key, java.util.Locale locale)
request
- the current requestkey
- the attribute for which to fetch a display namelocale
- the locale key
public static java.lang.String getDisplayName(DataSource dataSource, java.lang.String key)
dataSource
- key
-
public static java.lang.String getDisplayName(DataSource dataSource, java.lang.String key, java.util.Locale locale)
dataSource
- the current datasourcekey
- the attribute for which to fetch a display namelocale
- the locale parameter
public static java.lang.String getDefaultLocale(Container container)
container
- the current container
public static java.lang.String getRequestLocale(javax.portlet.PortletRequest request, Container container)
request
- the requestcontainer
- the current container
public static java.lang.String getApplicationDataSourceId(javax.servlet.http.HttpServletRequest request)
public static java.lang.String getApplicationContextPath(javax.portlet.PortletRequest request)
request
-
public static java.lang.String getDefaultDataSourceId()
public static java.lang.String getFullyQualifiedTransitionContext(javax.portlet.PortletRequest request, java.lang.String viewTransitionPageContext)
public static void writeJSONResponse(org.json.JSONObject jsonObj, javax.portlet.RenderResponse response) throws java.io.IOException
jsonObj
- the JSON Objectresponse
- the resource response
java.io.IOException
public static void writeJSONResponse(org.json.JSONObject jsonObj, javax.portlet.ResourceResponse response) throws java.io.IOException
jsonObj
- the JSON Objectresponse
- the resource response
java.io.IOException
public static void writeJSONResponse(org.json.JSONObject jsonObj, javax.portlet.RenderResponse response, java.lang.String callback) throws java.io.IOException
jsonObj
- the JSON Objectresponse
- the render responsecallback
- the name of the JavaScript callback function
java.io.IOException
public static void writeJSONResponse(org.json.JSONObject jsonObj, javax.portlet.ResourceResponse response, java.lang.String callback) throws java.io.IOException
jsonObj
- the JSON Objectresponse
- the resource responsecallback
- the name of the JavaScript callback function
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.RenderResponse response) throws java.io.IOException
obj
- the Objectresponse
- the resource response
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.ResourceResponse response) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.RenderResponse response, java.lang.Class<?> view) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.ResourceResponse response, java.lang.Class<?> view) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.RenderResponse response, java.lang.String callback) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.ResourceResponse response, java.lang.String callback) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.RenderResponse response, org.codehaus.jackson.map.ObjectMapper mapper) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.ResourceResponse response, org.codehaus.jackson.map.ObjectMapper mapper) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.RenderResponse response, java.lang.Class<?> view, java.lang.String callback) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.ResourceResponse response, java.lang.Class<?> view, java.lang.String callback) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.RenderResponse response, java.lang.Class<?> view, org.codehaus.jackson.map.ObjectMapper mapper) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.ResourceResponse response, java.lang.Class<?> view, org.codehaus.jackson.map.ObjectMapper mapper) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.RenderResponse response, java.lang.String callback, org.codehaus.jackson.map.ObjectMapper mapper) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.ResourceResponse response, java.lang.String callback, org.codehaus.jackson.map.ObjectMapper mapper) throws java.io.IOException
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.RenderResponse response, java.lang.Class<?> view, java.lang.String callback, org.codehaus.jackson.map.ObjectMapper mapper) throws java.io.IOException
obj
- the Objectresponse
- the render responsecallback
- the name of the JavaScript callback functionmapper
- the ObjectMapper for the object. If null, a generic object mapper is used.
java.io.IOException
public static void writeObjectResponse(java.lang.Object obj, javax.portlet.ResourceResponse response, java.lang.Class<?> view, java.lang.String callback, org.codehaus.jackson.map.ObjectMapper mapper) throws java.io.IOException
obj
- the Objectresponse
- the resource responsecallback
- the name of the JavaScript callback functionmapper
- the ObjectMapper for the object. If null, a generic object mapper is used.
java.io.IOException
public static void writeMessageResponse(java.lang.String message, javax.portlet.RenderResponse response) throws java.io.IOException
obj
- the Objectresponse
- the resource response
java.io.IOException
public static void writeMessageResponse(java.lang.String message, javax.portlet.ResourceResponse response) throws java.io.IOException
java.io.IOException
public static void writeErrorObjectResponse(java.lang.Object obj, javax.portlet.ResourceResponse response) throws java.io.IOException, javax.portlet.PortletException
javax.portlet.PortletException
java.io.IOException
public static void writeErrorMessageResponse(java.lang.String message, javax.portlet.RenderResponse response) throws java.io.IOException
obj
- the Objectresponse
- the resource response
java.io.IOException
public static void writeErrorMessageResponse(java.lang.String message, javax.portlet.ResourceResponse response) throws java.io.IOException
java.io.IOException
public static void writeJSONArrayResponse(org.json.JSONArray jsonArr, javax.portlet.ResourceResponse response) throws java.io.IOException
jsonArr
- the JSON Arrayresponse
- the resource response
java.io.IOException
public static java.util.Map<java.lang.String,java.lang.String> getDataSourceDisplayNameMap(java.util.Map<java.lang.String,MDEXState> originalDataSourceMap)
originalDataSourceMap
- Map having dataSource Id/MDEXState pairs.
public static java.util.List<com.endeca.mdex.sconfig._2010.types.SemanticEntity> getSemanticEntities(DataSource dataSource) throws javax.portlet.PortletException
dataSource
-
javax.portlet.PortletException
public static java.util.List<com.endeca.mdex.sconfig._2010.types.SemanticEntity> getSemanticEntities(DataSource dataSource, boolean forceUncached) throws javax.portlet.PortletException
dataSource
- forceUncached
-
javax.portlet.PortletException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |