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(com.edorasware.commons.core.content.ContentManager contentManager,
com.edorasware.api.workobject.WorkObjectService workObjectService,
com.edorasware.commons.core.identity.CurrentUserService currentUserService,
com.edorasware.api.time.TimeProvider timeProvider,
com.edorasware.commons.core.content.ContentDetector contentDetector,
boolean enableVersioning)
Instantiates a new Content manager helper.
|
| Modifier and Type | Method and Description |
|---|---|
com.edorasware.commons.core.content.ContentMetadata |
getContentMetadata(String workObjectId)
Gets content metadata.
|
Optional<com.edorasware.commons.core.content.ContentReference> |
getContentReference(String workObjectId)
Gets content reference.
|
Optional<com.edorasware.commons.core.content.ContentReference> |
getContentReference(com.edorasware.api.workobject.WorkObject workObject)
Gets content reference.
|
void |
saveWorkObjectContent(String workObjectId,
com.edorasware.commons.core.content.MediaResource mediaResource,
Optional<Instant> lastModifiedDate,
Optional<Instant> uploadDate)
Save work object content content reference.
|
com.edorasware.commons.core.content.ContentReference |
saveWorkObjectContentReference(String workObjectId,
com.edorasware.commons.core.content.MediaResource resource,
Optional<Instant> lastModifiedDate,
Optional<Instant> uploadDate)
Save work object content content reference.
|
public ContentManagerHelper(com.edorasware.commons.core.content.ContentManager contentManager,
com.edorasware.api.workobject.WorkObjectService workObjectService,
com.edorasware.commons.core.identity.CurrentUserService currentUserService,
com.edorasware.api.time.TimeProvider timeProvider,
com.edorasware.commons.core.content.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 com.edorasware.commons.core.content.ContentMetadata getContentMetadata(String workObjectId)
Gets content metadata.
workObjectId - the work object global idcom.edorasware.commons.core.content.ContentException - if no content reference is found for the WorkObjectIdIllegalArgumentException - if the WorkObjectId is nullpublic void saveWorkObjectContent(String workObjectId, com.edorasware.commons.core.content.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 datecom.edorasware.api.exception.EntityNotFoundException - if no work object is found for the IDpublic com.edorasware.commons.core.content.ContentReference saveWorkObjectContentReference(String workObjectId, com.edorasware.commons.core.content.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 datecom.edorasware.api.exception.EntityNotFoundException - if no work object is found for the WorkObjectIdpublic Optional<com.edorasware.commons.core.content.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<com.edorasware.commons.core.content.ContentReference> getContentReference(com.edorasware.api.workobject.WorkObject workObject)
Gets content reference.
workObject - the work objectIllegalArgumentException - if the work object is nullCopyright © 2010 - 2018 edorasware ag. All Rights Reserved.