public class DynamoContentImpl extends AbstractContentImpl
Modifier and Type | Field and Description |
---|---|
protected DynamoPolicyComponent |
policyComponent |
ocPolicyComponent
Modifier | Constructor and Description |
---|---|
protected |
DynamoContentImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
addRelation(AddRelationRequest req)
Adds a relation between parent document and children.
|
void |
applyAspect(java.lang.String ticket,
java.lang.String objectId,
java.lang.String aspectType,
java.util.Map<java.lang.String,java.lang.Object> mandatoryProperties)
Adds an aspect to a document.
|
boolean |
cancelCheckout(java.lang.String ticket,
java.lang.String objectId)
Cancels checkout of document.
|
ContentResult |
checkin(java.lang.String ticket,
java.lang.String objectId,
boolean keepLock,
java.lang.String versionLabels,
java.lang.String comment,
boolean majorVersion)
Checks in a node to the repository.
|
ContentResult |
checkin(java.lang.String ticket,
java.lang.String objectId,
boolean keepLock,
java.lang.String versionLabels,
java.lang.String comment,
boolean majorVersion,
OpenContentObject object,
boolean newVersion,
javax.activation.DataHandler dataHandler)
Checks in a node to the repository.
|
ContentResult |
checkin(java.lang.String ticket,
java.lang.String objectId,
boolean keepLock,
java.lang.String versionLabels,
java.lang.String comment,
boolean majorVersion,
OpenContentObject object,
boolean newVersion,
java.lang.Long size,
javax.activation.DataHandler dataHandler)
Checks in a node to the repository.
|
boolean |
checkout(java.lang.String ticket,
java.lang.String objectId)
Checks out a document.
|
ContentResult |
copyDocument(java.lang.String ticket,
java.lang.String id,
java.lang.String copyName)
Returns objectId for the given copied document only, no content returned.
|
java.lang.String |
createObject(java.lang.String ticket,
CompleteObject object)
Imports document content and properties to the repository.
|
boolean |
deleteObjects(java.lang.String ticket,
java.lang.String[] objectIds,
boolean allVersions)
Deletes objects in the content store.
|
ContentResult |
doEnhancedCreateObject(java.lang.String ticket,
EnhancedCompleteObject object) |
ContentResult |
doEnhancedDeleteObject(java.lang.String ticket,
java.lang.String objectId,
boolean allVersions,
boolean forceDelete) |
ContentResult |
doEnhancedUpdateObject(java.lang.String ticket,
java.lang.String objectId,
EnhancedCompleteObject object,
boolean newVersion,
boolean majorVersion) |
OpenContentObject |
doUpdateObject(java.lang.String ticket,
OpenContentObject oco) |
ContentResult |
enhancedGetObject(java.lang.String ticket,
java.lang.String objectId,
java.lang.String[] fileExtensionArr)
Retrieves document content and properties.
|
ContentResult |
enhancedGetObjectByPath(java.lang.String ticket,
java.lang.String path,
java.lang.String[] fileExtensionArr) |
ContentResult |
enhancedGetPathByFolderId(java.lang.String ticket,
java.lang.String baseId)
Obtain folder path by passing in folder ID
|
ContentResult |
enhancedGetProperties(java.lang.String ticket,
java.lang.String objectId)
Returns metadata for the given id only, no content returned.
|
java.net.URL |
generatePresignedUrl(java.lang.String ticket,
java.lang.String objectId,
java.lang.String[] fileExtensions,
boolean download,
boolean inline)
Gets the presigned url for an object
|
java.util.List<java.lang.String> |
getAppliedAspects(java.lang.String ticket,
java.lang.String objectId)
(non-Javadoc)
|
ObjectContent |
getContent(GetContentRequest request)
Retrieves the content of a repository object.
|
UserResult |
getLockOwner(java.lang.String ticket,
java.lang.String objectId)
Returns a UserResult.
|
OpenContentObject |
getObjectByPath(java.lang.String ticket,
java.lang.String path)
Obtain object by passing its path
WARNING: This method opens an InputStream.
|
OpenContentObject |
getObjectByPath(java.lang.String ticket,
java.lang.String path,
boolean quietMode)
Obtain object by passing its path
This accepts a 'quietMode' parameter that will not throw an error if the object
doesn't exist at that path.
|
ContentResult |
getObjectByVersion(java.lang.String ticket,
java.lang.String id,
java.lang.String versionLabel,
java.lang.String[] fileExtensionArr)
Obtain object for a specific version
|
int |
getPermissionsRequest(java.lang.String ticket,
java.lang.String objectId)
Retrieves permissions set on document.
|
java.util.ArrayList<java.lang.String> |
link(java.lang.String ticket,
java.lang.String childId,
java.lang.String[] unLinkFrom,
java.lang.String[] linkTo)
Creates a link request between document and folders.
|
java.lang.String |
lockDocument(java.lang.String ticket,
java.lang.String objectId)
Locks a document.
|
void |
moveObject(java.lang.String ticket,
java.lang.String objectId,
java.lang.String parentPathOrId)
(non-Javadoc)
|
ContentResult |
removeRelation(java.lang.String ticket,
java.lang.String objectId,
java.lang.String[] removeIds,
java.lang.String relationName)
Removes the relationship between the parentId and the childIds passed in of the relation type passed in
|
java.lang.String |
unlockDocument(java.lang.String ticket,
java.lang.String objectId)
Unlocks out a document.
|
java.lang.String |
updateObject(java.lang.String ticket,
java.lang.String objectId,
CompleteObject object,
boolean newVersion,
boolean majorVersion)
Updates existing document object in the repository.
|
OpenContentObject[] |
updateObjects(java.lang.String ticket,
OpenContentObject[] ocos)
Updates the objects with the same IDs as provided objects.
|
bulkEnhancedCreateObjects, bulkEnhancedCreateObjects, enhancedCreateObject, enhancedCreateObject, enhancedDeleteObject, enhancedDeleteObject, enhancedUpdateObject, enhancedUpdateObject, getObject, setOcPolicyComponent, updateObject
@Autowired protected DynamoPolicyComponent policyComponent
public java.lang.String[] addRelation(AddRelationRequest req)
IContent
req
- an AddRelationRequest
objectThis method will take care of adding the prefix "rel_" to whatever
relationType is passed in TODO: the permissions for this won't quite
work because they should only "need" relate permissions on the document
to add a relation BUT we are calling enhancedUpdateObject on the object,
which will bomb out if the user doesn't have at least WRITE permissions
public boolean cancelCheckout(java.lang.String ticket, java.lang.String objectId)
IContent
ticket
- an authentication ticketobjectId
- the identifier used to locate a documentIContent.cancelCheckout(java.lang.String,
java.lang.String)
public ContentResult checkin(java.lang.String ticket, java.lang.String objectId, boolean keepLock, java.lang.String versionLabels, java.lang.String comment, boolean majorVersion)
IContent
ticket
- a valid OC ticket.objectId
- the objectId of the object to check in.keepLock
- whether to keep the lock or release it after the checkin is complete.versionLabels
- the version lable of the document that will be checked in.comment
- the comment for checking in the document.majorVersion
- true if the document should become a major version on checkin.IContent.checkin(java.lang.String,
java.lang.String, boolean, java.lang.String, java.lang.String, boolean)
public boolean checkout(java.lang.String ticket, java.lang.String objectId)
IContent
ticket
- an authentication ticketobjectId
- the identifier used to locate a documentIContent.checkout(java.lang.String,
java.lang.String)
public java.lang.String createObject(java.lang.String ticket, CompleteObject object)
IContent
ticket
- an authentication ticketobject
- a CompleteObject
objIContent.createObject(java.lang.String,
com.tsgrp.opencontent.core.content.model.CompleteObject)
public boolean deleteObjects(java.lang.String ticket, java.lang.String[] objectIds, boolean allVersions)
IContent
ticket
- an authentication ticketobjectIds
- a list of object identifiers to deleteallVersions
- if true, deletes all versionsIContent.deleteObjects(java.lang.String,
java.lang.String[], boolean)
public ContentResult doEnhancedCreateObject(java.lang.String ticket, EnhancedCompleteObject object)
doEnhancedCreateObject
in class AbstractContentImpl
com.tsgrp.opencontent.core.content.IContent#enhancedCreateObject(java.lang.
String,
com.tsgrp.opencontent.core.content.enhanced.model.EnhancedCompleteObject)
public ContentResult doEnhancedDeleteObject(java.lang.String ticket, java.lang.String objectId, boolean allVersions, boolean forceDelete)
doEnhancedDeleteObject
in class AbstractContentImpl
This implementation assumes
that @param id includes the version.
public ContentResult enhancedGetObject(java.lang.String ticket, java.lang.String objectId, java.lang.String[] fileExtensionArr)
IContent
IContent.enhancedGetProperties(String, String)
instead. Note that since this method gets
both content and properties, calling code must close the ContentResult
with OCUtil.closeQuietly(ContentResult)
.ticket
- String representing the session's ticketobjectId
- ID of the object to getfileExtensionArr
- An array of content types. By default, this array consists of {"pdf", ".*"}, which indicates PDF is preferred, then fall back to the native content.com.tsgrp.opencontent.core.content.IContent#enhancedGetObject(java.lang.
String, java.lang.String, java.lang.String[])
public ContentResult enhancedGetPathByFolderId(java.lang.String ticket, java.lang.String baseId)
IContent
ticket
- String representing the session's ticketbaseId
- id of the folder to get path fromContentResult
error
returns true if method failed, otherwise falseContentResult.result
contains the folder path we are trying to get IContent.enhancedGetPathByFolderId(java.lang.String,
java.lang.String)
public ContentResult doEnhancedUpdateObject(java.lang.String ticket, java.lang.String objectId, EnhancedCompleteObject object, boolean newVersion, boolean majorVersion)
doEnhancedUpdateObject
in class AbstractContentImpl
com.tsgrp.opencontent.core.content.IContent#enhancedUpdateObject(java.lang.
String, java.lang.String,
com.tsgrp.opencontent.core.content.enhanced.model.EnhancedCompleteObject,
boolean, boolean, java.lang.String)
public ContentResult enhancedGetObjectByPath(java.lang.String ticket, java.lang.String path, java.lang.String[] fileExtensionArr)
ticket
- String representing the session's ticketpath
- path to the object to getfileExtensionArr
- An array of content types. By default, this array consists of {"pdf", ".*"}, which indicates PDF is preferred, then fall back to the native content.com.tsgrp.opencontent.core.content.IContent#enhancedGetObjectByPath(java.lang
.String, java.lang.String, java.lang.String[])
public ObjectContent getContent(GetContentRequest request)
IContent
GetContentRequest.setFileExtension(String[])
this method will attempt to return the PDF rendition first, and then the
native content if a PDF rendition does not exist.
Note - when using this method, the InputStream
contained within
ObjectContent.getContent()
must be closed after use.request
- a GetContentRequest
objectObjectContent
- the content of the objectcom.tsgrp.opencontent.core.content.IContent#getContent(com.tsgrp.opencontent.
core.content.model.GetContentRequest)
public java.net.URL generatePresignedUrl(java.lang.String ticket, java.lang.String objectId, java.lang.String[] fileExtensions, boolean download, boolean inline)
generatePresignedUrl
in interface IContent
generatePresignedUrl
in class AbstractContentImpl
{GetContentRequest}
- requestpublic int getPermissionsRequest(java.lang.String ticket, java.lang.String objectId)
IContent
ticket
- an authentication ticketobjectId
- the identifier used to locate a documentcom.tsgrp.opencontent.core.content.IContent#getPermissionsRequest(java.lang.
String, java.lang.String)
public java.util.ArrayList<java.lang.String> link(java.lang.String ticket, java.lang.String childId, java.lang.String[] unLinkFrom, java.lang.String[] linkTo)
IContent
ticket
- String representing the session's ticketchildId
- ID of the object that is to be linkedunLinkFrom
- String[] representing the folders that the object will be unlinked fromlinkTo
- String[] representing the folders that the object will be linked toIContent.link(java.lang.String,
java.lang.String, java.lang.String[], java.lang.String[])
public java.lang.String updateObject(java.lang.String ticket, java.lang.String objectId, CompleteObject object, boolean newVersion, boolean majorVersion)
IContent
ticket
- an authentication ticketobjectId
- the identifier for the document to updateobject
- a CompleteObject
objnewVersion
- true to version or overwrite the existing object, otherwise falsemajorVersion
- true to increment the version to a new major version, otherwise falsecom.tsgrp.opencontent.core.content.IContent#updateObject(java.lang.String,
java.lang.String,
com.tsgrp.opencontent.core.content.model.CompleteObject, boolean,
boolean, java.lang.String)
public OpenContentObject[] updateObjects(java.lang.String ticket, OpenContentObject[] ocos)
IContent
ocos
- - The objects to updateIContent.updateObjects(java.lang.String,
com.tsgrp.opencontent.core.model.json.OpenContentObject[])
public ContentResult getObjectByVersion(java.lang.String ticket, java.lang.String id, java.lang.String versionLabel, java.lang.String[] fileExtensionArr)
IContent
ticket
- String representing the session's ticketid
- id of the object we are trying to getversionLabel
- version of the object we are trying to getfileExtensionArr
- An array of content types. By default, this array consists of {"pdf", ".*"}, which indicates PDF is preferred, then fall back to the native content.com.tsgrp.opencontent.core.content.IContent#getObjectByVersion(java.lang.
String, java.lang.String, java.lang.String, java.lang.String[])
public ContentResult enhancedGetProperties(java.lang.String ticket, java.lang.String objectId)
IContent
ticket
- String representing the session's ticketobjectId
- ID of the object to get properties fromContentResult
error
returns true if method failed, otherwise falseobject
objectType
- repo specific object typeprops
- metadata for objectThis implementation assumes that @param id
includes the version.
public ContentResult removeRelation(java.lang.String ticket, java.lang.String objectId, java.lang.String[] removeIds, java.lang.String relationName)
IContent
ticket
- An authentication ticketobjectId
- ID of the parent object to remove the rendition relation fromremoveIds
- An array of child IDs to remove from relationrelationName
- - name of parent-child relation to removeIContent.removeRelation(java.lang.String,
java.lang.String, java.lang.String[], java.lang.String)
public ContentResult copyDocument(java.lang.String ticket, java.lang.String id, java.lang.String copyName)
IContent
ticket
- String representing the session's ticketid
- id of the object we want to make a copy ofcopyName
- name of the newly copied object. If set to null or "", the name of the new object will be "Copy of ${original object's name}".IContent.copyDocument(java.lang.String,
java.lang.String, java.lang.String)
public java.lang.String lockDocument(java.lang.String ticket, java.lang.String objectId)
IContent
IContent.lockDocument(java.lang.String,
java.lang.String)
public java.lang.String unlockDocument(java.lang.String ticket, java.lang.String objectId)
IContent
IContent.unlockDocument(java.lang.String,
java.lang.String)
public UserResult getLockOwner(java.lang.String ticket, java.lang.String objectId)
IContent
UserResult
UserResult.getError()
- True if there is an error UserResult.getErrorDetails()
- Details about the error UserResult.getUserBeans()
- If the document is locked, an array of length 1, containing the userbean of the locking user or
null of there is no lock. public OpenContentObject doUpdateObject(java.lang.String ticket, OpenContentObject oco)
doUpdateObject
in class AbstractContentImpl
IContent.updateObject(java.lang.String,
com.tsgrp.opencontent.core.model.json.OpenContentObject)
public OpenContentObject getObjectByPath(java.lang.String ticket, java.lang.String path)
IContent
ticket
- String representing the session's ticketpath
- path to the object to getIContent.getObjectByPath(java.lang.String,
java.lang.String)
public OpenContentObject getObjectByPath(java.lang.String ticket, java.lang.String path, boolean quietMode)
IContent
ticket
- sessions ticketpath
- path to the object to hetquietMode
- If true, we will not throw an error if the object doesn't existpublic ContentResult checkin(java.lang.String ticket, java.lang.String objectId, boolean keepLock, java.lang.String versionLabels, java.lang.String comment, boolean majorVersion, OpenContentObject object, boolean newVersion, javax.activation.DataHandler dataHandler)
IContent
ticket
- a valid OC ticket.objectId
- the objectId of the object to check in.keepLock
- whether to keep the lock or release it after the checkin is complete.versionLabels
- the version lable of the document that will be checked in.comment
- the comment for checking in the document.majorVersion
- true if the document should become a major version on checkin.object
- the object to use for setting new property values on checkin - NOTE: this is currently not implemented.newVersion
- whether this should be a new version or the same version.dataHandler
- the data handler containing the input stream for the new content of the checked in object.public ContentResult checkin(java.lang.String ticket, java.lang.String objectId, boolean keepLock, java.lang.String versionLabels, java.lang.String comment, boolean majorVersion, OpenContentObject object, boolean newVersion, java.lang.Long size, javax.activation.DataHandler dataHandler)
IContent
ticket
- a valid OC ticket.objectId
- the objectId of the object to check in.keepLock
- whether to keep the lock or release it after the checkin is complete.versionLabels
- the version lable of the document that will be checked in.comment
- the comment for checking in the document.majorVersion
- true if the document should become a major version on checkin.object
- the object to use for setting new property values on checkin - NOTE: this is currently not implemented.newVersion
- whether this should be a new version or the same version.size
- the object size in bytesdataHandler
- the data handler containing the input stream for the new content of the checked in object.public java.util.List<java.lang.String> getAppliedAspects(java.lang.String ticket, java.lang.String objectId)
IContent.getAppliedAspects(java.lang.String,
java.lang.String)
public void applyAspect(java.lang.String ticket, java.lang.String objectId, java.lang.String aspectType, java.util.Map<java.lang.String,java.lang.Object> mandatoryProperties)
IContent
ticket
- a valid OC ticketobjectId
- the object the aspect will be applied toaspectType
- the type of aspect to be added (in OCName format)mandatoryProperties
- a list of properties that are mandatory for the aspect (in OCName format). Set to null/empty map for no propertiesIContent.applyAspect(java.lang.String,
java.lang.String, java.lang.String, java.util.Map)
public void moveObject(java.lang.String ticket, java.lang.String objectId, java.lang.String parentPathOrId)
ticket
- a valid OC ticket.objectId
- the ID of the object to move to a new folder.parentPathOrId
- the path or ID of the folder to move the new object to.IContent.moveObject(java.lang.String,
java.lang.String, java.lang.String)