Package nl.gx.webmanager.foundation
Interface Session
-
- All Superinterfaces:
AutoCloseable
public interface Session extends AutoCloseable
Session interface One of the tasks of a Session object is to provide access to wrapper objects which represent nodes stored in the WebManager repository.
-
-
Field Summary
Fields Modifier and Type Field Description static String
WEBMANAGER_SESSION_KEY
WebManager session key under which it is stored in a request attribute.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearWrapperCacheForMediaitemVersion(int contentid)
Removes the cached wrapper object for the given mediaitem id.void
close()
Closes the current session.ContentItem<?>
getContentItem(ContentItemId contentItemId)
Returns the content item wrapper with the specified content item id.ContentItemVersion<?>
getContentItemVersion(ContentItemVersionId contentItemVersionId)
Returns the content item version wrapper with the specified content item id.SessionContext
getContext()
Return this session's context.ElementManagementService
getElementManagementService()
Returns a reference to the element service.EntityCache
getEntityCache()
Returns the entity cache for use by the EntityManager.javax.jcr.Session
getJcrSession()
Returns the session to the content repository.LinkManagementService
getLinkManagementService()
Returns a reference to the link management service.MediaRepositoryManagementService
getMediaRepositoryManagementService()
Returns a reference to the media repository service.Object
getNewInstance(String targetClassname)
Returns a new object of the given class.Map<String,String>
getOriginIdMap()
Origin IDs are stored here until the session has been committed to permanent storage, to allow for lookups.PageManagementService
getPageManagementService()
Returns a reference to the page service.PersonalizationManagementService
getPersonalizationManagementService()
Returns a reference to the personalization management service.WebManagerApplication
getWebManagerApplication()
Returns the WebManagerApplication object.Object
getWrapper(int id, Class<?> targetClass)
Returns a wrapper object for the given Siteworks ID.Object
getWrapper(String uuid, Class<?> targetClass)
Returns a wrapper object for the node with the given UUID.void
save()
Saves the current session.
-
-
-
Field Detail
-
WEBMANAGER_SESSION_KEY
static final String WEBMANAGER_SESSION_KEY
WebManager session key under which it is stored in a request attribute.- See Also:
- Constant Field Values
-
-
Method Detail
-
getWrapper
Object getWrapper(int id, Class<?> targetClass)
Returns a wrapper object for the given Siteworks ID.- Parameters:
id
- The id of the object that should be returned.targetClass
- The type of object that should be returned.- Returns:
- The object with the specified id of the specified type, or
null
if such an object could not be found. The java object returned is only valid during the life span of the current session.
-
getNewInstance
Object getNewInstance(String targetClassname)
Returns a new object of the given class.- Parameters:
targetClassname
- Fully qualified classname of object type to create- Returns:
- Object of the given type.
-
getWrapper
Object getWrapper(String uuid, Class<?> targetClass)
Returns a wrapper object for the node with the given UUID.- Parameters:
uuid
- UUID of an object in the repository.targetClass
- The type of the object that should be returned.- Returns:
- The object with the specified id of the specified type, or
null
if such an object could not be found.
-
getContentItem
ContentItem<?> getContentItem(ContentItemId contentItemId)
Returns the content item wrapper with the specified content item id.- Parameters:
contentItemId
- The id of the content item to retrieve- Returns:
- the content item wrapper with the specified content item id
- Since:
- 10.34.0
-
getContentItemVersion
ContentItemVersion<?> getContentItemVersion(ContentItemVersionId contentItemVersionId)
Returns the content item version wrapper with the specified content item id.- Parameters:
contentItemVersionId
- The id of the content item version to retrieve- Returns:
- the content item version wrapper with the specified content item id
- Since:
- 10.34.0
-
getContext
SessionContext getContext()
Return this session's context.- Returns:
- the context of the session.
-
getJcrSession
javax.jcr.Session getJcrSession()
Returns the session to the content repository.- Returns:
- The session to the content repository
-
getWebManagerApplication
WebManagerApplication getWebManagerApplication()
Returns the WebManagerApplication object.- Returns:
- the WebManagerApplication object
-
getPageManagementService
PageManagementService getPageManagementService()
Returns a reference to the page service.- Returns:
- reference to the page service
-
getElementManagementService
ElementManagementService getElementManagementService()
Returns a reference to the element service.- Returns:
- reference to the element service
-
getMediaRepositoryManagementService
MediaRepositoryManagementService getMediaRepositoryManagementService()
Returns a reference to the media repository service.- Returns:
- reference to the media repository service
-
getLinkManagementService
LinkManagementService getLinkManagementService()
Returns a reference to the link management service.- Returns:
- reference to the link management service
-
getPersonalizationManagementService
PersonalizationManagementService getPersonalizationManagementService()
Returns a reference to the personalization management service.- Returns:
- Reference to the personalization management service.
-
save
void save()
Saves the current session.
-
close
void close()
Closes the current session.- Specified by:
close
in interfaceAutoCloseable
-
getEntityCache
EntityCache getEntityCache()
Returns the entity cache for use by the EntityManager.- Returns:
- the entity cache for this Session
-
getOriginIdMap
Map<String,String> getOriginIdMap()
Origin IDs are stored here until the session has been committed to permanent storage, to allow for lookups.- Returns:
- A
Map
: Origin ID => Page (Siteworks) ID. Never returns null and the IDs are never null. - See Also:
ContentItem.getOriginId()
-
clearWrapperCacheForMediaitemVersion
void clearWrapperCacheForMediaitemVersion(int contentid)
Removes the cached wrapper object for the given mediaitem id.- Since:
- 10.35.0
-
-