Package lumis.content.core
Class ContentManager
- java.lang.Object
-
- lumis.content.core.ContentManager
-
- All Implemented Interfaces:
IContentManager
public class ContentManager extends Object implements IContentManager
Content manager implementation.- Since:
- 4.2.0
- Version:
- $Revision: 22372 $ $Date: 2019-02-06 19:01:54 -0200 (Wed, 06 Feb 2019) $
-
-
Constructor Summary
Constructors Constructor Description ContentManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContent(Content content)
Adds a content to persistence.void
deleteContent(Content content)
Deletes a content from persistence.ContentVersion
getActiveVersionByItemId(String itemId)
Returns theactive version
of theContentLocale
that theContentVersion
with the given item id belongs to.String
getActiveVersionItemIdByItemId(String itemId)
Try to find theitem id
of theactive version
of theContentLocale
that theContentVersion
with the given item id belongs to.Content
getContent(String contentId)
Returns a persistent content instance.Content
getContentByItemId(String itemId)
Returns the content related with the specified business data.ContentLocale
getContentLocale(String contentLocaleId)
Returns the a content locale by its identifier.ContentVersion
getContentVersion(String contentVersionId)
Returns the a content version by its identifier.ContentVersion
getContentVersionByItemId(String itemId)
Returns the a content version that refers the given itemId.ContentVersion
getPublishedContentVersion(String contentId, String serviceInstanceId)
Returns the published version more appropriated to the current user for the specified content and service instance.void
lock(String contentLocaleId, LockType lockType)
Locks contentlocale acording to lockType.void
releaseLock(String contentLocaleId)
Releases the lock for the contentLocale.void
scheduleReindex(Content content)
Schedules the re-indexing of a content after the current transaction commits.
-
-
-
Method Detail
-
addContent
public void addContent(Content content) throws PortalException
Description copied from interface:IContentManager
Adds a content to persistence.- Specified by:
addContent
in interfaceIContentManager
- Parameters:
content
- the transient content instance to be persisted.- Throws:
PortalException
-
deleteContent
public void deleteContent(Content content) throws PortalException
Description copied from interface:IContentManager
Deletes a content from persistence.- Specified by:
deleteContent
in interfaceIContentManager
- Parameters:
content
- the persistent content instance to be deleted.- Throws:
PortalException
-
getContent
public Content getContent(String contentId) throws PortalException
Description copied from interface:IContentManager
Returns a persistent content instance.- Specified by:
getContent
in interfaceIContentManager
- Parameters:
contentId
- the content's identifier.- Returns:
- a persistent content instance.
- Throws:
PortalObjectNotFoundException
- if no content with such id was found.PortalException
-
getContentByItemId
public Content getContentByItemId(String itemId) throws PortalException
Description copied from interface:IContentManager
Returns the content related with the specified business data.- Specified by:
getContentByItemId
in interfaceIContentManager
- Parameters:
itemId
- the business data identifier.- Returns:
- a persistent content instance.
- Throws:
PortalObjectNotFoundException
- if no content for such itemId was found.PortalException
-
scheduleReindex
public void scheduleReindex(Content content) throws PortalException
Description copied from interface:IContentManager
Schedules the re-indexing of a content after the current transaction commits.Re-indexing of contents occurs automatically when a content's metadata is affected, so this method normally is not needed to be used directly. But this may be used in case of a customized change of content's data that doesn't trigger the re-indexing automatically.
- Specified by:
scheduleReindex
in interfaceIContentManager
- Parameters:
content
- the content.- Throws:
PortalException
-
getContentLocale
public ContentLocale getContentLocale(String contentLocaleId) throws PortalException
Description copied from interface:IContentManager
Returns the a content locale by its identifier.- Specified by:
getContentLocale
in interfaceIContentManager
- Parameters:
contentLocaleId
- the content locale identifier.- Returns:
- the content locale.
- Throws:
PortalObjectNotFoundException
- if no content locale with the given identifier was found.PortalException
-
getContentVersionByItemId
public ContentVersion getContentVersionByItemId(String itemId) throws PortalException
Description copied from interface:IContentManager
Returns the a content version that refers the given itemId.- Specified by:
getContentVersionByItemId
in interfaceIContentManager
- Parameters:
itemId
- the item identifier.- Returns:
- the content version.
- Throws:
PortalObjectNotFoundException
- if no such content version was found.PortalException
-
getContentVersion
public ContentVersion getContentVersion(String contentVersionId) throws PortalException
Description copied from interface:IContentManager
Returns the a content version by its identifier.- Specified by:
getContentVersion
in interfaceIContentManager
- Parameters:
contentVersionId
- the content version identifier.- Returns:
- the content version.
- Throws:
PortalObjectNotFoundException
- if no content version with the given identifier was found.PortalException
-
getPublishedContentVersion
public ContentVersion getPublishedContentVersion(String contentId, String serviceInstanceId) throws PortalException
Description copied from interface:IContentManager
Returns the published version more appropriated to the current user for the specified content and service instance.- Specified by:
getPublishedContentVersion
in interfaceIContentManager
- Parameters:
contentId
- the content identifier.serviceInstanceId
- the service instance identifier where the version is published to. This is an optional argument, ifnull
, the publication to service instance is not used to filter the version query.- Returns:
- the content version.
- Throws:
PortalObjectNotFoundException
- if no version published to the user and service instance, in the appropriated locale, was found.PortalException
-
lock
public void lock(String contentLocaleId, LockType lockType) throws ContentLocaleAlreadyLockedException, PortalException
Description copied from interface:IContentManager
Locks contentlocale acording to lockType. If lock metadata is not available for the content, this method does nothing and does not throw exception regarding metadata not configured for this content. It creates a new transaction to execute the update.- Specified by:
lock
in interfaceIContentManager
- Parameters:
contentLocaleId
- the id of the content-locale to change its lock.lockType
- defines what type of lock that the content-locale should have. SeeLockType
.- Throws:
ContentLocaleAlreadyLockedException
- when there already is a lock on the content-locale and the person trying to lock is not the current lock owner.AccessDeniedException
- if the current user does not have permission to lock the content locale.PortalException
-
releaseLock
public void releaseLock(String contentLocaleId) throws PortalException
Description copied from interface:IContentManager
Releases the lock for the contentLocale. If lock metadata is not available for the content, this method does nothing and does not throw exception regarding metadata not configured this content.. It creates a new transaction to execute the update.- Specified by:
releaseLock
in interfaceIContentManager
- Parameters:
contentLocaleId
- the id of the content-locale to release its lock.- Throws:
AccessDeniedException
- if the current user does not have permission to release the lock on the content locale.PortalException
-
getActiveVersionItemIdByItemId
public String getActiveVersionItemIdByItemId(String itemId) throws NoActiveVersionPossibleMappingException, PortalException
Try to find theitem id
of theactive version
of theContentLocale
that theContentVersion
with the given item id belongs to.- Parameters:
itemId
- the item id.- Returns:
- a mapped item id.
- Throws:
NoActiveVersionPossibleMappingException
- if no mapping could be done.PortalException
- if any other problem occur.- Since:
- 6.0.0
-
getActiveVersionByItemId
public ContentVersion getActiveVersionByItemId(String itemId) throws NoActiveVersionPossibleMappingException, PortalException
Returns theactive version
of theContentLocale
that theContentVersion
with the given item id belongs to.- Parameters:
itemId
- the item id.- Returns:
- the active version.
- Throws:
NoActiveVersionPossibleMappingException
- if no mapping could be done.PortalException
- if any other problem occur.- Since:
- 10.4.0
-
-