public abstract class AbstractResource extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HST_MOUNT_REL_PREFIX |
static String |
HST_REST_RELATIONS_BASE_URI |
static String |
MOUNT_ALIAS_ASSETS |
static String |
MOUNT_ALIAS_GALLERY |
static String |
MOUNT_ALIAS_REST |
static String |
MOUNT_ALIAS_SITE |
Constructor and Description |
---|
AbstractResource() |
Modifier and Type | Method and Description |
---|---|
protected String |
deleteHippoBean(javax.servlet.http.HttpServletRequest servletRequest,
HippoBean hippoBean) |
List<Class<? extends HippoBean>> |
getAnnotatedClasses(HstRequestContext requestContext)
Deprecated.
since 2.28.00 not used any more. If custom annotated classes are needed, inject a
custom object converter in the HstRequestContext through ContentBeansTool. This method does not do
anything any more
|
String |
getAnnotatedClassesResourcePath()
Deprecated.
since 2.28.00 not used any more. If custom annotated classes are needed, inject a
custom object converter in the HstRequestContext through ContentBeansTool
|
protected HippoBean |
getChildBeanByRelPathOrPrimaryNodeType(HippoBean hippoBean,
String relPath,
String primaryNodeType) |
ContentRewriter<String> |
getContentRewriter() |
protected String |
getHstQualifiedLinkRel(String simpleRel) |
HstQueryManager |
getHstQueryManager(HstRequestContext requestContext) |
HstQueryManager |
getHstQueryManager(javax.jcr.Session session,
HstRequestContext requestContext) |
protected String |
getLinkMountRelation(String mountName) |
HippoFolderBean |
getMountContentBaseBean(HstRequestContext requestContext) |
protected Link |
getMountLink(HstRequestContext requestContext,
HippoBean hippoBean,
String mountAliasName,
String subPath) |
protected Link |
getNodeLink(HstRequestContext requestContext,
HippoBean hippoBean) |
ObjectConverter |
getObjectConverter(HstRequestContext requestContext) |
protected javax.jcr.Session |
getPersistableSession(HstRequestContext requestContext)
Creates a persistable JCR session with the default credentials
|
protected javax.jcr.Session |
getPersistableSession(HstRequestContext requestContext,
javax.jcr.Credentials credentials)
Creates a persistable JCR session with provided credentials.
|
protected ObjectBeanPersistenceManager |
getPersistenceManager(HstRequestContext requestContext)
Creates and returns a persistence manager with the default session of the requestContext.
|
protected ObjectBeanPersistenceManager |
getPersistenceManager(HstRequestContext requestContext,
javax.jcr.Session persistableSession)
Creates and returns a persistence manager with the specified session.
|
protected String |
getQualifiedLinkRel(String simpleRel) |
protected String |
getQualifiedLinkRel(String iri,
String simpleRel) |
protected HippoBean |
getRequestContentBean(HstRequestContext requestContext)
Returns the content HippoBean for the current request.
|
protected <T extends HippoBean> |
getRequestContentBean(HstRequestContext requestContext,
Class<T> beanMappingClass)
Returns the content HippoBean of type T for the current request.
|
protected HstRequestContext |
getRequestContext(javax.servlet.http.HttpServletRequest servletRequest) |
protected Link |
getRestLink(HstRequestContext requestContext,
HippoBean hippoBean,
String subPath) |
String |
getRestRelationsBaseUri() |
protected Link |
getSiteLink(HstRequestContext requestContext,
HippoBean hippoBean) |
boolean |
isPageLinksExternal() |
void |
setAnnotatedClasses(List<Class<? extends HippoBean>> annotatedClasses) |
void |
setAnnotatedClassesResourcePath(String annotatedClassesResourcePath)
Deprecated.
since 2.28.00 not used any more. If custom annotated classes are needed, inject a
custom object converter in the HstRequestContext through ContentBeansTool
|
void |
setContentRewriter(ContentRewriter<String> contentRewriter) |
void |
setHstQueryManagerFactory(HstQueryManagerFactory hstQueryManagerFactory)
Deprecated.
since 2.28.00 not used any more. If custom object converter is needed, inject a
custom hst query manager in the HstRequestContext. This method does not do
anything any more
|
void |
setObjectConverter(ObjectConverter objectConverter)
Deprecated.
since 2.28.00 not used any more. If custom object converter is needed, inject a
custom object converter in the HstRequestContext through ContentBeansTool. This method does not do
anything any more
|
void |
setPageLinksExternal(boolean pageLinksExternal) |
void |
setRestRelationsBaseUri(String restRelationsBaseUri) |
public static final String MOUNT_ALIAS_REST
public static final String MOUNT_ALIAS_SITE
public static final String MOUNT_ALIAS_GALLERY
public static final String MOUNT_ALIAS_ASSETS
public static final String HST_REST_RELATIONS_BASE_URI
public static final String HST_MOUNT_REL_PREFIX
@Deprecated public String getAnnotatedClassesResourcePath()
@Deprecated public void setAnnotatedClassesResourcePath(String annotatedClassesResourcePath)
@Deprecated public List<Class<? extends HippoBean>> getAnnotatedClasses(HstRequestContext requestContext)
public void setAnnotatedClasses(List<Class<? extends HippoBean>> annotatedClasses)
public ObjectConverter getObjectConverter(HstRequestContext requestContext)
@Deprecated public void setObjectConverter(ObjectConverter objectConverter)
public HstQueryManager getHstQueryManager(HstRequestContext requestContext)
requestContext
- public HstQueryManager getHstQueryManager(javax.jcr.Session session, HstRequestContext requestContext)
@Deprecated public void setHstQueryManagerFactory(HstQueryManagerFactory hstQueryManagerFactory)
public String getRestRelationsBaseUri()
public void setRestRelationsBaseUri(String restRelationsBaseUri)
public boolean isPageLinksExternal()
public void setPageLinksExternal(boolean pageLinksExternal)
public ContentRewriter<String> getContentRewriter()
public void setContentRewriter(ContentRewriter<String> contentRewriter)
protected ObjectBeanPersistenceManager getPersistenceManager(HstRequestContext requestContext) throws javax.jcr.RepositoryException
Note: when the operation is annotated with Persistable
, the default session of the requestContext
should already be a persistable (writable) session.
requestContext
- javax.jcr.RepositoryException
protected ObjectBeanPersistenceManager getPersistenceManager(HstRequestContext requestContext, javax.jcr.Session persistableSession) throws javax.jcr.RepositoryException
requestContext
- persistableSession
- javax.jcr.RepositoryException
protected HstRequestContext getRequestContext(javax.servlet.http.HttpServletRequest servletRequest)
protected <T extends HippoBean> T getRequestContentBean(HstRequestContext requestContext, Class<T> beanMappingClass) throws ObjectBeanManagerException
beanMappingClass for the relative content path of the
resolved sitemap item a ObjectBeanManagerException is thrown
If there is no resolved sitemap item, null
is returned.
T
- requestContext
- beanMappingClass
- ObjectBeanManagerException
- when there cannot be returned a beanprotected HippoBean getRequestContentBean(HstRequestContext requestContext) throws ObjectBeanManagerException
requestContext
- ObjectBeanManagerException
- when there cannot be returned a beanpublic HippoFolderBean getMountContentBaseBean(HstRequestContext requestContext) throws ObjectBeanManagerException
requestContext
- ObjectBeanManagerException
- when there cannot be returned a site content base beanprotected String deleteHippoBean(javax.servlet.http.HttpServletRequest servletRequest, HippoBean hippoBean) throws javax.jcr.RepositoryException, ObjectBeanPersistenceException
javax.jcr.RepositoryException
ObjectBeanPersistenceException
protected HippoBean getChildBeanByRelPathOrPrimaryNodeType(HippoBean hippoBean, String relPath, String primaryNodeType)
protected Link getNodeLink(HstRequestContext requestContext, HippoBean hippoBean)
protected Link getRestLink(HstRequestContext requestContext, HippoBean hippoBean, String subPath)
protected Link getSiteLink(HstRequestContext requestContext, HippoBean hippoBean)
protected Link getMountLink(HstRequestContext requestContext, HippoBean hippoBean, String mountAliasName, String subPath)
protected javax.jcr.Session getPersistableSession(HstRequestContext requestContext) throws javax.jcr.RepositoryException
Note: The client should invoke logout()
method on the session after use.
Internally, Session.impersonate(Credentials)
method will be used to create a
persistable JCR session. The method is invoked on the session from the session pooling repository.
requestContext
- javax.jcr.RepositoryException
protected javax.jcr.Session getPersistableSession(HstRequestContext requestContext, javax.jcr.Credentials credentials) throws javax.jcr.RepositoryException
Note: The client should invoke logout()
method on the session after use.
Internally, Session.impersonate(Credentials)
method will be used to create a
persistable JCR session. The method is invoked on the session from the session pooling repository.
requestContext
- javax.jcr.RepositoryException
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.