public class SolrContentImpl extends AbstractContentImpl
ocPolicyComponent
Modifier | Constructor and Description |
---|---|
protected |
SolrContentImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
addRelation(AddRelationRequest req)
Adds a relation between parent document and children.
|
void |
addSecurityToContentRequest(java.lang.String ticket,
java.lang.String objectId,
java.lang.StringBuffer readQuery)
Abstract method used to append additional security to a query for a specific user
retrieved from a ticket number.
|
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 id,
boolean allVersions,
boolean forceDelete) |
ContentResult |
doEnhancedUpdateObject(java.lang.String ticket,
java.lang.String id,
EnhancedCompleteObject object,
boolean newVersion,
boolean majorVersion) |
OpenContentObject |
doUpdateObject(java.lang.String ticket,
OpenContentObject oco) |
ContentResult |
enhancedGetObject(java.lang.String ticket,
java.lang.String id,
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 objectId)
Obtain folder path by passing in folder ID
|
ContentResult |
enhancedGetProperties(java.lang.String ticket,
java.lang.String id)
Returns metadata for the given id only, no content returned.
|
java.util.List<java.lang.String> |
getAppliedAspects(java.lang.String ticket,
java.lang.String objectId)
Retrieves a list of aspects applied to the provided objectId.
|
ObjectContent |
getContent(GetContentRequest request)
GetContent streams runs another query returning only the filePath that streams the file
from the filesystem via HPI
|
EnhancedObjectProperty[] |
getEnhancedProperties(java.lang.String ticket,
java.lang.String objectId)
Retrieves document properties.
|
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 quiet)
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)
Moves an object in the repository from one folder to another.
|
protected StringArray[] |
performContentQuery(java.lang.String ticket,
java.lang.String objectId,
java.lang.String idAttr,
java.lang.String mimeTypeAttr,
java.lang.String contentLocationAttr)
Queries for the necessary attributes need to fetch content for a given object id.
|
ContentResult |
removeRelation(java.lang.String ticket,
java.lang.String parentObjectId,
java.lang.String[] childIds,
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, generatePresignedUrl, getObject, setOcPolicyComponent, updateObject
public java.lang.String[] addRelation(AddRelationRequest req)
IContent
req
- an AddRelationRequest
objectIContent.addRelation(com.tsgrp.opencontent.core.content.model.AddRelationRequest)
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.com.tsgrp.opencontent.core.content.IContent#checkin(com.tsgrp.opencontent.core.content.model.CheckinRequest)
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 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
IContent.enhancedCreateObject(java.lang.String, EnhancedCompleteObject)
public ContentResult doEnhancedDeleteObject(java.lang.String ticket, java.lang.String id, boolean allVersions, boolean forceDelete)
doEnhancedDeleteObject
in class AbstractContentImpl
forceDelete
- - Not implemented for Solr, should always be set to FalseIContent.enhancedDeleteObject(java.lang.String, java.lang.String, boolean, boolean)
public ContentResult enhancedGetObject(java.lang.String ticket, java.lang.String id, 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 ticketid
- 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.IContent.enhancedGetObject(java.lang.String, java.lang.String, java.lang.String[])
public EnhancedObjectProperty[] getEnhancedProperties(java.lang.String ticket, java.lang.String objectId)
ticket
- an authentication ticketobjectId
- the identifier used to locate a documentpublic 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.IContent.enhancedGetObjectByPath(java.lang.String, java.lang.String, java.lang.String[])
public ContentResult enhancedGetPathByFolderId(java.lang.String ticket, java.lang.String objectId)
IContent
ticket
- String representing the session's ticketobjectId
- 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 id, EnhancedCompleteObject object, boolean newVersion, boolean majorVersion)
public ObjectContent getContent(GetContentRequest request)
request
- GetContentRequest that is provided by HPIIContent.getContent(com.tsgrp.opencontent.core.content.model.GetContentRequest)
public int getPermissionsRequest(java.lang.String ticket, java.lang.String objectId)
IContent
ticket
- an authentication ticketobjectId
- the identifier used to locate a documentIContent.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 falseIContent.updateObject(java.lang.String, java.lang.String, com.tsgrp.opencontent.core.content.model.CompleteObject, boolean, boolean)
public OpenContentObject[] updateObjects(java.lang.String ticket, OpenContentObject[] ocos)
IContent
ocos
- - The objects to updateIContent.updateObjects(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.IContent.getObjectByVersion(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
public ContentResult enhancedGetProperties(java.lang.String ticket, java.lang.String id)
IContent
ticket
- String representing the session's ticketid
- ID of the object to get properties fromContentResult
error
returns true if method failed, otherwise falseobject
objectType
- repo specific object typeprops
- metadata for objectIContent.enhancedGetProperties(java.lang.String, java.lang.String)
public ContentResult removeRelation(java.lang.String ticket, java.lang.String parentObjectId, java.lang.String[] childIds, java.lang.String relationName)
IContent
ticket
- An authentication ticketparentObjectId
- ID of the parent object to remove the rendition relation fromchildIds
- An array of child IDs to remove from relationrelationName
- - name of parent-child relation to removepublic 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}".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. IContent.getLockOwner(java.lang.String, java.lang.String)
public OpenContentObject doUpdateObject(java.lang.String ticket, OpenContentObject oco)
doUpdateObject
in class AbstractContentImpl
public OpenContentObject getObjectByPath(java.lang.String ticket, java.lang.String path)
IContent
ticket
- String representing the session's ticketpath
- path to the object to getpublic OpenContentObject getObjectByPath(java.lang.String ticket, java.lang.String path, boolean quiet)
IContent
ticket
- sessions ticketpath
- path to the object to hetquiet
- 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 java.util.List<java.lang.String> getAppliedAspects(java.lang.String ticket, java.lang.String objectId)
IContent
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)
IContent
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.public void addSecurityToContentRequest(java.lang.String ticket, java.lang.String objectId, java.lang.StringBuffer readQuery)
ticket
- - An authentication ticket.queryString
- - The query to be modified. Expect this query's OC implementation to
be complete prior to entering this method.protected StringArray[] performContentQuery(java.lang.String ticket, java.lang.String objectId, java.lang.String idAttr, java.lang.String mimeTypeAttr, java.lang.String contentLocationAttr)
ticket
- A valid OC ticket.objectId
- A valid object id for the object we wish to fetch content for.idAttr
- The name of the id attribute in solr.mimeTypeAttr
- The name of the mimetype attribute in solrcontentLocationAttr
- The name of the attribute in solr that governs the content's location.