public class AssemblerTools extends GenericService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
static java.lang.String |
CONTENT_ITEM_TO_RENDERER_PATH_MAPPER
Mapper from ContentItem to a rendering path to include to (typically a JSP).
|
static java.lang.String |
CONTENT_PREFIX
Custom content prefix "contentPrefix" request parameter name.
|
static java.lang.String |
CONTENT_RENDERER
The default contentRenderer path to fall back on, specified
by an init parameter in the web-app.
|
static java.lang.String |
JSON_FORMAT
JSON output serialization format ("json").
|
static java.lang.String |
XML_FORMAT
XML output serialization format ("xml").
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
AssemblerTools() |
Modifier and Type | Method and Description |
---|---|
void |
doStartService()
Makes a VariableArgumentApplicationLogging component available as a static property
for use by other classes that do not have their own logging support.
|
static VariableArgumentApplicationLogging |
getApplicationLogging() |
AssemblerFactory |
getAssemblerFactory() |
AssemblerSettings |
getAssemblerSettings() |
atg.service.filter.bean.BeanFilterService |
getBeanFilterService()
Returns the BeanFilterService component used for filtering content items.
|
InvokeAssemblerCallback[] |
getCallbacks() |
ContentItemToRendererPath |
getContentItemToRendererPathForRequest(javax.servlet.ServletContext pServletContext)
Return the CatridgerRenderingMapper to use for the specified
request.
|
java.lang.String |
getContentPath(DynamoHttpServletRequest pRequest)
Returns the full path used to query for content in the Java Content
Repository.
|
java.lang.String |
getContentPathPrefix()
Firstly check the request for a "contentPath" parameter, if its not set
return the default prefix for either Experience Manager or Guided Search.
|
ContentItemToRendererPath |
getDefaultContentItemToRendererPath()
Returns property defaultContentItemToRendererPath.
|
java.lang.String |
getDefaultContentRenderer() |
java.lang.String |
getRendererPathForContentItem(DynamoHttpServletRequest pRequest,
ContentItem pContentItem)
Get the renderer path (typically a path to a JSP file) that can
render the specified ContentItem.
|
atg.service.response.output.ResponseGenerator |
getResponseGenerator() |
ContentItem |
invokeAssembler(ContentItem pContentItem)
Query the Endeca Java Content Repository for content using the assembler
API.
|
ContentItem |
invokeAssembler(java.lang.String pContentItem)
Invokes the handler belonging to the passed in content item type.
|
boolean |
isExperienceManager()
Returns the value of NucleusAssemblerSettings.isExperienceManager.
|
boolean |
isOptimizeWriteResponse()
If false, uses the old way to write response (generateResponse converts to a string and then write the string).
|
boolean |
isRemoveContextRoot() |
boolean |
isRemoveSiteBaseURL() |
boolean |
isUseMapper()
Returns property useMapper.
|
protected boolean |
removeContextRoot(java.lang.StringBuilder pResourceBuilder)
Removes the context root
|
protected boolean |
removeSiteBaseURL(java.lang.StringBuilder pResourceBuilder)
Removes the site base url.
|
void |
serializeContentItemToResponse(java.lang.Object pContentItem,
DynamoHttpServletResponse pResponse,
java.io.Writer pWriter,
java.lang.String pFormat)
Serialize pContentItem to the format specified by pFormat (
("xml" or "json").
|
static void |
setApplicationLogging(VariableArgumentApplicationLogging pApplicationLogging)
Set a component that can be used for logging by related classes.
|
void |
setAssemblerFactory(AssemblerFactory pAssemblerFactory) |
void |
setAssemblerSettings(AssemblerSettings pAssemblerSettings) |
void |
setBeanFilterService(atg.service.filter.bean.BeanFilterService pBeanFilterService)
Sets the BeanFilterService component used for filtering content items.
|
void |
setCallbacks(InvokeAssemblerCallback[] pCallbacks) |
void |
setDefaultContentItemToRendererPath(ContentItemToRendererPath pDefaultContentItemToRendererPath)
Sets property defaultContentItemToRendererPath.
|
void |
setDefaultContentRenderer(java.lang.String pDefaultContentRenderer)
Set the location of a JSP that knows how to handle the rendering
of returned content items.
|
void |
setOptimizeWriteResponse(boolean pOptimizeWriteResponse)
If false, uses the old way to write response (generateResponse converts to a string and then write the string).
|
void |
setRemoveContextRoot(boolean pRemoveContextRoot) |
void |
setRemoveSiteBaseURL(boolean pRemoveSiteBaseURL) |
void |
setResponseGenerator(atg.service.response.output.ResponseGenerator pResponseGenerator) |
void |
setUseMapper(boolean pUseMapper)
Sets property useMapper.
|
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
public static final java.lang.String CONTENT_PREFIX
public static final java.lang.String CONTENT_ITEM_TO_RENDERER_PATH_MAPPER
public static final java.lang.String CONTENT_RENDERER
public static final java.lang.String JSON_FORMAT
public static final java.lang.String XML_FORMAT
public AssemblerSettings getAssemblerSettings()
public void setAssemblerSettings(AssemblerSettings pAssemblerSettings)
pAssemblerSettings
- Set a new AssemblerSettings bean.public AssemblerFactory getAssemblerFactory()
public void setAssemblerFactory(AssemblerFactory pAssemblerFactory)
pAssemblerFactory
- Set a new assemblerFactorypublic boolean isRemoveSiteBaseURL()
public void setRemoveSiteBaseURL(boolean pRemoveSiteBaseURL)
pRemoveSiteBaseURL
- Set a new removeSiteBaseURL propertypublic boolean isRemoveContextRoot()
public void setRemoveContextRoot(boolean pRemoveContextRoot)
pRemoveContextRoot
- Set a new removeContextRoot property.public void setDefaultContentItemToRendererPath(ContentItemToRendererPath pDefaultContentItemToRendererPath)
public ContentItemToRendererPath getDefaultContentItemToRendererPath()
public java.lang.String getDefaultContentRenderer()
public void setDefaultContentRenderer(java.lang.String pDefaultContentRenderer)
pDefaultContentRenderer
- public static VariableArgumentApplicationLogging getApplicationLogging()
public static void setApplicationLogging(VariableArgumentApplicationLogging pApplicationLogging)
pApplicationLogging
- a logging componentpublic void setUseMapper(boolean pUseMapper)
public boolean isUseMapper()
public void setBeanFilterService(atg.service.filter.bean.BeanFilterService pBeanFilterService)
pBeanFilterService
- The BeanFilterService component used for filtering content items.public atg.service.filter.bean.BeanFilterService getBeanFilterService()
public InvokeAssemblerCallback[] getCallbacks()
atg.endeca.assembler.InvokeAssemblerCallback
,
invokeAssembler(ContentItem)
public void setCallbacks(InvokeAssemblerCallback[] pCallbacks)
atg.endeca.assembler.InvokeAssemblerCallback
,
invokeAssembler(ContentItem)
public atg.service.response.output.ResponseGenerator getResponseGenerator()
ResponseGenerator
public void setResponseGenerator(atg.service.response.output.ResponseGenerator pResponseGenerator)
ResponseGenerator
public boolean isOptimizeWriteResponse()
public void setOptimizeWriteResponse(boolean pOptimizeWriteResponse)
public ContentItem invokeAssembler(java.lang.String pContentItem) throws AssemblerException
pContentItem
- A content item typeAssemblerException
public ContentItem invokeAssembler(ContentItem pContentItem) throws AssemblerException
pContentItem
- The ContentItem used in the assembler invocation.AssemblerException
- If an error occurs invoking the assembler.public java.lang.String getContentPath(DynamoHttpServletRequest pRequest)
public java.lang.String getContentPathPrefix()
public boolean isExperienceManager()
protected boolean removeSiteBaseURL(java.lang.StringBuilder pResourceBuilder)
pResourceBuilder
- protected boolean removeContextRoot(java.lang.StringBuilder pResourceBuilder)
pResourceBuilder
- public ContentItemToRendererPath getContentItemToRendererPathForRequest(javax.servlet.ServletContext pServletContext)
public java.lang.String getRendererPathForContentItem(DynamoHttpServletRequest pRequest, ContentItem pContentItem)
pRequest
- the current requestpContentItem
- the content item to return apublic void serializeContentItemToResponse(java.lang.Object pContentItem, DynamoHttpServletResponse pResponse, java.io.Writer pWriter, java.lang.String pFormat) throws java.io.IOException, javax.servlet.ServletException
pContentItem
- the ContentItem to serializepResponse
- the current response (may be null if pWriter is
non-null). If pResponse is not null, will set the content type
of the response appropriately.pWriter
- the write to write the serialized form to. If null
will write the response to pResponse.pFormat
- the format to serialize pContentItem as. Currently
must be "xml" or "json".java.io.IOException
javax.servlet.ServletException
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting up