Package org.alfresco.cmis
Class CmisWrapper
java.lang.Object
org.alfresco.utility.dsl.DSLWrapper<Client>
org.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
org.alfresco.cmis.CmisWrapper
- All Implemented Interfaces:
org.alfresco.utility.dsl.DSL<CmisWrapper>,org.alfresco.utility.dsl.DSLContentModelAction<CmisWrapper>,org.alfresco.utility.dsl.DSLFile<CmisWrapper>,org.alfresco.utility.dsl.DSLFolder<CmisWrapper>
@Service
@Scope("prototype")
public class CmisWrapper
extends org.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
implements org.alfresco.utility.dsl.DSLContentModelAction<CmisWrapper>, org.alfresco.utility.dsl.DSLFile<CmisWrapper>, org.alfresco.utility.dsl.DSLFolder<CmisWrapper>
-
Field Summary
FieldsFields inherited from class org.alfresco.utility.dsl.DSLWrapper
contentService, dataContent, jmxBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAcl(org.alfresco.utility.model.GroupModel group, org.alfresco.utility.constants.UserRole role) Add new permission for a groupaddAcl(org.alfresco.utility.model.GroupModel group, org.alfresco.utility.constants.UserRole role, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Add new permission for a groupAdd new permissions to useraddAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole role) Add new permission for useraddAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole role, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Add new permission for useraddDocumentToFolder(org.alfresco.utility.model.FolderModel destination, boolean allVersions) Method allows you to file a document object in more than one folder.addSecondaryTypes(String... secondaryTypes) Add new secondary typesUpdate permission for user.applyAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole newRole, org.alfresco.utility.constants.UserRole removeRole) Update permission for user.applyAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole newRole, org.alfresco.utility.constants.UserRole removeRole, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Update permission for user.assignToUser(org.alfresco.utility.model.UserModel user, String relationType) Assign user to existent item set in last resourceattachDocument(org.alfresco.utility.model.ContentModel... contents) Attach documents to existent item set in last resourceauthenticateUser(org.alfresco.utility.model.UserModel userModel) authenticateUser(org.alfresco.utility.model.UserModel userModel, Function<org.alfresco.utility.model.UserModel, Map<String, String>> authParameterProvider) authUserUsingBrowserUrlAndBindingType(org.alfresco.utility.model.UserModel userModel, String urlPath, String bindingType) If this is a PWC (private working copy) the check out will be reversed.checkOut()Checks out the documentcopyTo(org.alfresco.utility.model.ContentModel destination) createDataList(org.alfresco.utility.model.DataListModel dataListModel) Create a new data list typecreateDataListItem(org.alfresco.utility.model.DataListItemModel itemModel) Create new data list itemcreateFile(org.alfresco.utility.model.FileModel fileModel) createFile(org.alfresco.utility.model.FileModel fileModel, String cmisBaseTypeId, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) Create a new filecreateFile(org.alfresco.utility.model.FileModel fileModel, Map<String, Object> properties, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) createFile(org.alfresco.utility.model.FileModel fileModel, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) Create a new filecreateFileFromSource(org.alfresco.utility.model.FileModel newfileModel, org.alfresco.utility.model.ContentModel sourceFileModel) Create new file from existing one (that was set in last resource)createFileFromSource(org.alfresco.utility.model.FileModel newfileModel, org.alfresco.utility.model.ContentModel sourceFileModel, String cmisBaseTypeId) Create new file from existing one with versioning state set to Major(that was set in last resource)createFileFromSource(org.alfresco.utility.model.FileModel newfileModel, org.alfresco.utility.model.ContentModel sourceFileModel, String cmisBaseTypeId, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) Create new file from existing one (that was set in last resource)createFileFromSource(org.alfresco.utility.model.FileModel newfileModel, org.alfresco.utility.model.ContentModel sourceFileModel, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) Create new file from existing one (that was set in last resource)createFolder(org.alfresco.utility.model.FolderModel folderModel) createFolder(org.alfresco.utility.model.FolderModel folderModel, String cmisBaseTypeId) createFolder(org.alfresco.utility.model.FolderModel folderModel, Map<String, Object> properties) createRelationshipWith(org.alfresco.utility.model.ContentModel targetContent) Create a 'R:cm:basis' relationship between a source document and a target documentcreateRelationshipWith(org.alfresco.utility.model.ContentModel targetContent, String relationType) Create relationship between a source document and a target documentdelete()deleteAllVersions(boolean allVersions) Deletes all versions if parameter is set to true, otherwise deletes only last versionDelete content streamdeleteContent(boolean refresh) Delete content stream and refresh documentDeletes this folder and all subfolders with all versions and continue on failuredeleteFolderTree(boolean allVersions, org.apache.chemistry.opencmis.commons.enums.UnfileObject unfile, boolean continueOnFailure) Deletes this folder and all subfolders with specific parametersorg.apache.chemistry.opencmis.commons.data.AclCapabilitiesList<org.alfresco.utility.model.FileModel>getFiles()Get child documents from a parent folderList<org.alfresco.utility.model.FolderModel>Get child folders from a parent folderprotected Stringorg.apache.chemistry.opencmis.commons.data.RepositoryInfoorg.apache.chemistry.opencmis.client.api.SessionGet the current sessionmoveTo(org.alfresco.utility.model.ContentModel destination) Starts the process to check in a documentReloads the resource from the repositoryremoveAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole removeRole) Remove permission from userremoveAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole removeRole, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Remove permission from userremoveDocumentFromFolder(org.alfresco.utility.model.FolderModel parentFolder) Method allows you to remove a document object from the given folder.setContent(String content) Set the content stream for a document with overwrite set to TRUEsetContent(String content, boolean overwrite) Set the content stream for a documentupdateProperty(String property, Object value) Update the properties of the last resourceContentModel.usingObjectType(String baseType) Use this method if the document is checked out.usingResource(org.alfresco.utility.model.ContentModel model) usingSite(org.alfresco.utility.model.SiteModel siteModel) usingUserHome(String username) Starts the process to work with a version of a documentwithJMX()Pass a string CMIS query, that will be handled byQueryExecutorusingSession.query(String, boolean)Methods inherited from class org.alfresco.utility.dsl.DSLProtocol
and, buildSiteDocumentLibraryPath, buildUserHomePath, closeJmxConnection, getCurrentSpace, getCurrentUser, getLastContentModel, getLastResource, getLastResourceWithoutPrefix, getProtocolName, isProtocolEnabled, setCurrentSpace, setLastContentModel, setLastResource, then, usingAdmin, usingRoot, usingUser, waitSeconds, whenMethods inherited from class org.alfresco.utility.dsl.DSLWrapper
getDataContentService, getTestUser, setTestUser
-
Field Details
-
LOG
protected org.slf4j.Logger LOG -
STEP_PREFIX
-
deleteTreeFailedObjects
-
-
Constructor Details
-
CmisWrapper
public CmisWrapper()
-
-
Method Details
-
authenticateUser
- Specified by:
authenticateUserin classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
authenticateUser
public CmisWrapper authenticateUser(org.alfresco.utility.model.UserModel userModel, Function<org.alfresco.utility.model.UserModel, Map<String, String>> authParameterProvider) -
authUserUsingBrowserUrlAndBindingType
public CmisWrapper authUserUsingBrowserUrlAndBindingType(org.alfresco.utility.model.UserModel userModel, String urlPath, String bindingType) -
getAuthParameterProviderFactory
-
disconnect
- Specified by:
disconnectin classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
buildPath
- Overrides:
buildPathin classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
getSession
public org.apache.chemistry.opencmis.client.api.Session getSession()Get the current session- Returns:
- Session
-
createFile
- Specified by:
createFilein interfaceorg.alfresco.utility.dsl.DSLFile<CmisWrapper>
-
createFile
public CmisWrapper createFile(org.alfresco.utility.model.FileModel fileModel, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) Create a new file- Parameters:
fileModel-FileModelfile model to be createdversioningState-VersioningState- Returns:
- CmisWrapper
-
createFile
public CmisWrapper createFile(org.alfresco.utility.model.FileModel fileModel, String cmisBaseTypeId, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) Create a new file- Parameters:
fileModel-FileModelfile model to be createdcmisBaseTypeId- base type id (e.g. 'cmis:document')versioningState-VersioningState- Returns:
- CmisWrapper
-
createFile
public CmisWrapper createFile(org.alfresco.utility.model.FileModel fileModel, Map<String, Object> properties, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) -
createFileFromSource
public CmisWrapper createFileFromSource(org.alfresco.utility.model.FileModel newfileModel, org.alfresco.utility.model.ContentModel sourceFileModel) Create new file from existing one (that was set in last resource)- Parameters:
newfileModel-FileModelfile model to be createdsourceFileModel-ContentModelsource file model- Returns:
- CmisWrapper
-
createFileFromSource
public CmisWrapper createFileFromSource(org.alfresco.utility.model.FileModel newfileModel, org.alfresco.utility.model.ContentModel sourceFileModel, String cmisBaseTypeId) Create new file from existing one with versioning state set to Major(that was set in last resource)- Parameters:
newfileModel-FileModelfile model to be createdsourceFileModel-ContentModelsource file modelcmisBaseTypeId- base type id (e.g. 'cmis:document')- Returns:
- CmisWrapper
-
createFileFromSource
public CmisWrapper createFileFromSource(org.alfresco.utility.model.FileModel newfileModel, org.alfresco.utility.model.ContentModel sourceFileModel, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) Create new file from existing one (that was set in last resource)- Parameters:
newfileModel-FileModelfile model to be createdsourceFileModel-ContentModelsource file modelversioningState- version(e.g. 'VersioningState.MAJOR')- Returns:
- CmisWrapper
-
createFileFromSource
public CmisWrapper createFileFromSource(org.alfresco.utility.model.FileModel newfileModel, org.alfresco.utility.model.ContentModel sourceFileModel, String cmisBaseTypeId, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) Create new file from existing one (that was set in last resource)- Parameters:
newfileModel-FileModelfile model to be createdsourceFileModel-ContentModelsource file modelcmisBaseTypeId- base type id (e.g. 'cmis:document')versioningState- (e.g. 'VersioningState.MAJOR')- Returns:
- CmisWrapper
-
createFolder
- Specified by:
createFolderin interfaceorg.alfresco.utility.dsl.DSLFolder<CmisWrapper>
-
createFolder
public CmisWrapper createFolder(org.alfresco.utility.model.FolderModel folderModel, String cmisBaseTypeId) -
createFolder
public CmisWrapper createFolder(org.alfresco.utility.model.FolderModel folderModel, Map<String, Object> properties) -
deleteFolderTree
Deletes this folder and all subfolders with all versions and continue on failure- Returns:
- current wrapper
-
deleteFolderTree
public CmisWrapper deleteFolderTree(boolean allVersions, org.apache.chemistry.opencmis.commons.enums.UnfileObject unfile, boolean continueOnFailure) Deletes this folder and all subfolders with specific parameters- Parameters:
allVersions-unfile-UnfileObjectcontinueOnFailure-- Returns:
- current wrapper
-
getRootPath
- Specified by:
getRootPathin interfaceorg.alfresco.utility.dsl.DSL<CmisWrapper>- Specified by:
getRootPathin classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationException
-
getSitesPath
- Specified by:
getSitesPathin interfaceorg.alfresco.utility.dsl.DSL<CmisWrapper>- Specified by:
getSitesPathin classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationException
-
getUserHomesPath
- Specified by:
getUserHomesPathin interfaceorg.alfresco.utility.dsl.DSL<CmisWrapper>- Specified by:
getUserHomesPathin classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationException
-
getDataDictionaryPath
public String getDataDictionaryPath() throws org.alfresco.utility.exception.TestConfigurationException- Specified by:
getDataDictionaryPathin interfaceorg.alfresco.utility.dsl.DSL<CmisWrapper>- Specified by:
getDataDictionaryPathin classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationException
-
usingSite
- Specified by:
usingSitein interfaceorg.alfresco.utility.dsl.DSL<CmisWrapper>- Specified by:
usingSitein classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
usingSite
- Specified by:
usingSitein interfaceorg.alfresco.utility.dsl.DSL<CmisWrapper>- Specified by:
usingSitein classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
usingUserHome
- Specified by:
usingUserHomein interfaceorg.alfresco.utility.dsl.DSL<CmisWrapper>- Specified by:
usingUserHomein classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
usingUserHome
- Specified by:
usingUserHomein interfaceorg.alfresco.utility.dsl.DSL<CmisWrapper>- Specified by:
usingUserHomein classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
usingResource
- Specified by:
usingResourcein interfaceorg.alfresco.utility.dsl.DSL<CmisWrapper>- Specified by:
usingResourcein classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
getProtocolJMXConfigurationStatus
- Specified by:
getProtocolJMXConfigurationStatusin classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
getPrefixSpace
- Specified by:
getPrefixSpacein classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
rename
- Specified by:
renamein interfaceorg.alfresco.utility.dsl.DSLContentModelAction<CmisWrapper>
-
update
- Specified by:
updatein interfaceorg.alfresco.utility.dsl.DSLContentModelAction<CmisWrapper>
-
update
-
updateProperty
Update the properties of the last resourceContentModel. Example updateProperty("cmis:name", "test1234")- Parameters:
property-value-- Returns:
-
delete
- Specified by:
deletein interfaceorg.alfresco.utility.dsl.DSLContentModelAction<CmisWrapper>
-
deleteAllVersions
Deletes all versions if parameter is set to true, otherwise deletes only last version- Parameters:
allVersions-- Returns:
-
deleteContent
Delete content stream- Returns:
-
deleteContent
Delete content stream and refresh document- Parameters:
refresh- boolean refresh resource- Returns:
-
setContent
Set the content stream for a document- Parameters:
content- String content to setoverwrite-- Returns:
-
setContent
Set the content stream for a document with overwrite set to TRUE- Parameters:
content-- Returns:
-
createRelationshipWith
Create a 'R:cm:basis' relationship between a source document and a target document- Parameters:
targetContent-- Returns:
-
createRelationshipWith
public CmisWrapper createRelationshipWith(org.alfresco.utility.model.ContentModel targetContent, String relationType) Create relationship between a source document and a target document- Parameters:
targetContent-ContentModelrelationType-- Returns:
-
addDocumentToFolder
public CmisWrapper addDocumentToFolder(org.alfresco.utility.model.FolderModel destination, boolean allVersions) Method allows you to file a document object in more than one folder.- Parameters:
destination- - the destination folder to which this document will be addedallVersions- - if this parameter is true, then all versions of the document will be added to the destination folder- Returns:
-
removeDocumentFromFolder
Method allows you to remove a document object from the given folder.- Parameters:
parentFolder- - the folder from which this object should be removed- Returns:
-
getFolders
Get child folders from a parent folder- Specified by:
getFoldersin interfaceorg.alfresco.utility.dsl.DSLFolder<CmisWrapper>- Returns:
- List
-
getFiles
Get child documents from a parent folder- Specified by:
getFilesin interfaceorg.alfresco.utility.dsl.DSLFile<CmisWrapper>- Returns:
- List
-
copyTo
- Specified by:
copyToin interfaceorg.alfresco.utility.dsl.DSLContentModelAction<CmisWrapper>
-
moveTo
- Specified by:
moveToin interfaceorg.alfresco.utility.dsl.DSLContentModelAction<CmisWrapper>
-
getRepositoryInfo
public org.apache.chemistry.opencmis.commons.data.RepositoryInfo getRepositoryInfo() -
getAclCapabilities
public org.apache.chemistry.opencmis.commons.data.AclCapabilities getAclCapabilities() -
checkOut
Checks out the document -
cancelCheckOut
If this is a PWC (private working copy) the check out will be reversed. -
prepareDocumentForCheckIn
Starts the process to check in a document -
refreshResource
Reloads the resource from the repository -
withCMISUtil
- Returns:
- utilities that are used by CMIS
-
withJMX
- Returns:
- JMX DSL for this wrapper
-
assertThat
- Overrides:
assertThatin classorg.alfresco.utility.dsl.DSLProtocol<CmisWrapper>
-
usingVersion
Starts the process to work with a version of a document -
addAcl
public CmisWrapper addAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole role, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Add new permission for user- Parameters:
user- UserModel userrole- UserRole role to addaclPropagation- AclPropagation propagation- Returns:
-
addAcl
public CmisWrapper addAcl(org.alfresco.utility.model.GroupModel group, org.alfresco.utility.constants.UserRole role, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Add new permission for a group- Parameters:
group- GroupModel grouprole- UserRole role to addaclPropagation- AclPropagation propagation- Returns:
-
addAcl
public CmisWrapper addAcl(org.alfresco.utility.model.GroupModel group, org.alfresco.utility.constants.UserRole role) Add new permission for a group- Parameters:
group- GroupModel grouprole- UserRole role to add- Returns:
-
addAcl
Add new permissions to user- Parameters:
user-UserModelpermissions- to add (PermissionMappingcan be used)- Returns:
-
addAcl
public CmisWrapper addAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole role) Add new permission for user- Parameters:
user- UserModel userrole- UserRole role to add- Returns:
-
applyAcl
public CmisWrapper applyAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole newRole, org.alfresco.utility.constants.UserRole removeRole, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Update permission for user. If the role to remove is invalid aCmisConstraintExceptionis thrown.- Parameters:
user- UserModel usernewRole- UserRole new role to addremoveRole- UserRole remove already added roleaclPropagation- AclPropagation- Returns:
-
applyAcl
public CmisWrapper applyAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole newRole, org.alfresco.utility.constants.UserRole removeRole) Update permission for user. If the role to remove is invalid aCmisConstraintExceptionis thrown.- Parameters:
user- UserModel usernewRole- UserRole new role to addremoveRole- UserRole remove already added role- Returns:
-
applyAcl
public CmisWrapper applyAcl(org.alfresco.utility.model.UserModel user, String newPermission, String removePermission) Update permission for user. If the permission to remove is invalid aCmisConstraintExceptionis thrown.- Parameters:
user-UserModelnewPermission- permissions to add (PermissionMappingcan be used)removePermission- permissions to remove (PermissionMappingcan be used)- Returns:
-
removeAcl
public CmisWrapper removeAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole removeRole, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Remove permission from user- Parameters:
user- UserModel userremoveRole- UserRole role to removeaclPropagation- AclPropagation- Returns:
-
removeAcl
public CmisWrapper removeAcl(org.alfresco.utility.model.UserModel user, org.alfresco.utility.constants.UserRole removeRole) Remove permission from user- Parameters:
user- UserModel userremoveRole- UserRole role to remove- Returns:
-
removeAcl
-
withQuery
Pass a string CMIS query, that will be handled byQueryExecutorusingSession.query(String, boolean)- Parameters:
query-- Returns:
QueryExecutorwill all DSL assertions on returned restult
-
usingPWCDocument
Use this method if the document is checked out. If notCmisVersioningExceptionwill be thrown.- Returns:
-
usingObjectType
- Parameters:
baseType-- Returns:
- the DSL of asserting BaseObject type children for example.
-
createDataList
Create a new data list type- Parameters:
dataListModel-DataListModel- Returns:
-
createDataListItem
Create new data list item- Parameters:
itemModel-DataListItemModel- Returns:
-
attachDocument
Attach documents to existent item set in last resource- Parameters:
documents-ContentModellist of content to attach- Returns:
-
assignToUser
Assign user to existent item set in last resource- Parameters:
user-UserModelrelationType- e.g. R:dl:issueAssignedTo, R:dl:assignee, R:dl:taskAssignee- Returns:
-
addSecondaryTypes
Add new secondary types- Parameters:
secondaryTypes- e.g. P:cm:effectivity, P:audio:audio, P:cm:dublincore- Returns:
-