public abstract class AbstractContentResource extends AbstractResource
HST_MOUNT_REL_PREFIX, HST_REST_RELATIONS_BASE_URI, MOUNT_ALIAS_ASSETS, MOUNT_ALIAS_GALLERY, MOUNT_ALIAS_REST, MOUNT_ALIAS_SITE
Constructor and Description |
---|
AbstractContentResource() |
Modifier and Type | Method and Description |
---|---|
protected String |
deleteContentResource(javax.servlet.http.HttpServletRequest servletRequest,
HippoBean baseBean,
String relPath)
Deletes the content node mapped to the child bean identified by
relPath . |
protected String |
getHippoHtmlContent(javax.servlet.http.HttpServletRequest servletRequest,
String relPath,
String targetMountAlias)
Creates a string for the content of a
HippoHtml child bean of the current request's content
bean. |
protected HippoHtmlRepresentation |
getHippoHtmlRepresentation(javax.servlet.http.HttpServletRequest servletRequest,
String relPath,
String targetMountAlias)
Creates a
HippoHtmlRepresentation for a HippoHtml child bean of the current request's content
bean. |
protected String |
getRequestContentPath(HstRequestContext requestContext) |
protected ContentRewriter<String> |
getResolvedContentRewriter() |
protected String |
updateHippoHtmlContent(javax.servlet.http.HttpServletRequest servletRequest,
String relPath,
String htmlContent)
Updates the content of a
HippoHtml child bean of the current request's content bean. |
protected HippoHtmlRepresentation |
updateHippoHtmlRepresentation(javax.servlet.http.HttpServletRequest servletRequest,
String relPath,
HippoHtmlRepresentation htmlRepresentation)
Updates the content of a
HippoHtml child bean of the current request's content bean. |
deleteHippoBean, getAnnotatedClasses, getAnnotatedClassesResourcePath, getChildBeanByRelPathOrPrimaryNodeType, getContentRewriter, getHstQualifiedLinkRel, getHstQueryManager, getHstQueryManager, getLinkMountRelation, getMountContentBaseBean, getMountLink, getNodeLink, getObjectConverter, getPersistableSession, getPersistableSession, getPersistenceManager, getPersistenceManager, getQualifiedLinkRel, getQualifiedLinkRel, getRequestContentBean, getRequestContentBean, getRequestContext, getRestLink, getRestRelationsBaseUri, getSiteLink, isPageLinksExternal, setAnnotatedClasses, setAnnotatedClassesResourcePath, setContentRewriter, setHstQueryManagerFactory, setObjectConverter, setPageLinksExternal, setRestRelationsBaseUri
protected String getRequestContentPath(HstRequestContext requestContext)
protected ContentRewriter<String> getResolvedContentRewriter()
protected String deleteContentResource(javax.servlet.http.HttpServletRequest servletRequest, HippoBean baseBean, String relPath) throws javax.jcr.RepositoryException, ObjectBeanPersistenceException
relPath
.servletRequest
- baseBean
- relPath
- the path identifying the child bean, see also HippoBean.getBean(String)
javax.jcr.RepositoryException
ObjectBeanPersistenceException
IllegalArgumentException
- when the provided relPath
could not be mapped to a child beanprotected HippoHtmlRepresentation getHippoHtmlRepresentation(javax.servlet.http.HttpServletRequest servletRequest, String relPath, String targetMountAlias)
HippoHtmlRepresentation
for a HippoHtml
child bean of the current request's content
bean. The child bean can be identified by providing relPath
; if relPath
is
null
or empty, the first child bean of type hippostd:html
is used. All links in the
content are rewritten as if the content was served over targetMountAlias
; if
targetMountAlias
is null
or empty, the alias site
is used.servletRequest
- relPath
- the path identifying the child bean, see also HippoBean.getBean(String)
targetMountAlias
- protected HippoHtmlRepresentation updateHippoHtmlRepresentation(javax.servlet.http.HttpServletRequest servletRequest, String relPath, HippoHtmlRepresentation htmlRepresentation)
HippoHtml
child bean of the current request's content bean. The child bean can
be identified by providing relPath
; if relPath
is null
or empty, the
first child bean of type hippostd:html
is updated. Note that saving content in a live
document variant will update the preview
variant and the original live
content will be
returned.servletRequest
- relPath
- the path identifying the child bean, see also HippoBean.getBean(String)
htmlRepresentation
- the HippoHtmlRepresentation
containing the new contentlive
document variant will update the preview
variant and the original live
content will be
returned.protected String getHippoHtmlContent(javax.servlet.http.HttpServletRequest servletRequest, String relPath, String targetMountAlias)
HippoHtml
child bean of the current request's content
bean. The child bean can be identified by providing relPath
; if relPath
is
null
or empty, the first child bean of type hippostd:html
is used. All links in the
content are rewritten as if the content was served over targetMountAlias
; if
targetMountAlias
is null
or empty, the alias site
is used.servletRequest
- relPath
- the path identifying the child bean, see also HippoBean.getBean(String)
targetMountAlias
- protected String updateHippoHtmlContent(javax.servlet.http.HttpServletRequest servletRequest, String relPath, String htmlContent)
HippoHtml
child bean of the current request's content bean. The child bean can
be identified by providing relPath
; if relPath
is null
or empty, the
first child bean of type hippostd:html
is updated. Note that saving content in a live
document variant will update the preview
variant and the original live
content will be
returned.servletRequest
- relPath
- the path identifying the child bean, see also HippoBean.getBean(String)
htmlContent
- the String
containing the new contentlive
document variant will update the preview
variant and the original live
content will be
returned.Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.