public class ContentManagerHelper extends Object
The type Content manager helper is a bridge between the content work objects and the ContentManager
. The methods provide a simplified way of accessing the functionality
of the ContentManager
.
Constructor and Description |
---|
ContentManagerHelper(ContentManager contentManager,
WorkObjectService workObjectService,
CurrentUserService currentUserService,
TimeProvider timeProvider,
ContentDetector contentDetector,
boolean enableVersioning)
Instantiates a new Content manager helper.
|
Modifier and Type | Method and Description |
---|---|
ContentMetadata |
getContentMetadata(String workObjectId)
Gets content metadata.
|
Optional<ContentReference> |
getContentReference(String workObjectId)
Gets content reference.
|
Optional<ContentReference> |
getContentReference(WorkObject workObject)
Gets content reference.
|
void |
saveWorkObjectContent(String workObjectId,
MediaResource mediaResource,
Optional<Instant> lastModifiedDate,
Optional<Instant> uploadDate)
Save work object content content reference.
|
ContentReference |
saveWorkObjectContentReference(String workObjectId,
MediaResource resource,
Optional<Instant> lastModifiedDate,
Optional<Instant> uploadDate)
Save work object content content reference.
|
public ContentManagerHelper(ContentManager contentManager, WorkObjectService workObjectService, CurrentUserService currentUserService, TimeProvider timeProvider, ContentDetector contentDetector, boolean enableVersioning)
Instantiates a new Content manager helper.
contentManager
- the content managerworkObjectService
- the any work object servicecurrentUserService
- the current user servicecontentDetector
- the content detectorenableVersioning
- true if the existing content will not be replaced by the new one on updatepublic ContentMetadata getContentMetadata(String workObjectId)
Gets content metadata.
workObjectId
- the work object global idContentException
- if no content reference is found for the WorkObjectIdIllegalArgumentException
- if the WorkObjectId is nullpublic void saveWorkObjectContent(String workObjectId, MediaResource mediaResource, Optional<Instant> lastModifiedDate, Optional<Instant> uploadDate)
Save work object content content reference.
workObjectId
- the work object IDmediaResource
- the media resource to be savedlastModifiedDate
- the last modified dateEntityNotFoundException
- if no work object is found for the IDpublic ContentReference saveWorkObjectContentReference(String workObjectId, MediaResource resource, Optional<Instant> lastModifiedDate, Optional<Instant> uploadDate)
Save work object content content reference.
workObjectId
- the work object idresource
- the media resource being savedlastModifiedDate
- the last modified dateEntityNotFoundException
- if no work object is found for the WorkObjectIdpublic Optional<ContentReference> getContentReference(String workObjectId)
Gets content reference.
workObjectId
- the work object global idOptional.empty()
if either the work object or the content reference are not foundIllegalArgumentException
- if the WorkObjectId is nullpublic Optional<ContentReference> getContentReference(WorkObject workObject)
Gets content reference.
workObject
- the work objectIllegalArgumentException
- if the work object is nullCopyright © 2010 - 2018 edorasware ag. All Rights Reserved.