@Service @Scope(value="prototype") public class DataContent extends TestData<DataContent>
currentUser, EMAIL, PASSWORD, tasProperties| Constructor and Description |
|---|
DataContent() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAspect(List<XMLAspectData> aspects)
Adding aspects to ContentModels
|
String |
addEmailAlias(String alias)
Add Email Alias aspect (emailserver:aliasable)
dataContent.usingSite(testSite).usingResource(testFolder).addEmailAlias("aliasTas");
|
void |
addFileToFavorites(FileModel file)
Add file to favorites
|
void |
addFolderToFavorites(FolderModel folder)
Add folder to favorites
|
void |
addTagToContent(TagModel model)
Creates a tag for a content file
You must use this in correlation with
TestData.usingResource(ContentModel) |
void |
assertContentDoesNotExist() |
void |
assertContentExist() |
void |
assertContentHasTag(String cmisObjectPath,
TagModel model)
Verify content has tag
|
void |
assertContentSizeIs(long sizeInBytes)
Asserting the size of the content
|
void |
assertContentVersionIs(String version)
Asserting the version of the content
|
void |
cancelCheckOut()
Check out document
|
boolean |
checkContent(String fullPath,
UserModel userModel) |
void |
checkIn(String newContent,
boolean majorVersion,
String checkInComment)
Check in document.
|
void |
checkOutDocument()
Check out document
|
void |
closeContentStream(org.apache.chemistry.opencmis.commons.data.ContentStream contentStream) |
FileModel |
createContent()
It will create a new file in current resource
FileModel newRandomFile = FileModel.getRandomFileModel();
dataContent.usingUser(testUser).usingSite(testSite).createContent(newRandomFile);
|
FileModel |
createContent(org.alfresco.dataprep.CMISUtil.DocumentType documentType)
This is the entry point of the createContent() method to make REST API or CMIS call
|
FileModel |
createContent(FileModel fileModel)
This is the entry point of the createContent() method to make REST API or CMIS call
|
FileModel |
createContentCmisApi(FileModel fileModel)
Creates a random document based on
CMISUtil.DocumentType passed using CMIS
Return the Document object on success creation
dataContent.usingSite(site).createContent(sourceFile);
|
FileModel |
createContentDocTypeCmisApi(org.alfresco.dataprep.CMISUtil.DocumentType documentType)
Creates a random document based on
CMISUtil.DocumentType passed using CMIS
Return the Document object on success creation
dataContent.usingUser(userModel).usingResource(myFolder).createContent(DocumentType.TEXT_PLAIN);
|
FileModel |
createContentDocTypeV1Api(org.alfresco.dataprep.AlfrescoHttpClient client,
FileModel fileModel,
org.alfresco.dataprep.CMISUtil.DocumentType documentType)
Creates a random document based on
CMISUtil.DocumentType passed using REST API
Return the Document object on success creation
dataContent.usingUser(userModel).usingResource(myFolder).createContent(DocumentType.TEXT_PLAIN);
|
FileModel |
createContentV1Api(org.alfresco.dataprep.AlfrescoHttpClient client,
FileModel fileModel)
Creates a file using REST API
Return the
FileModel object on success creation |
ContentModel |
createCustomContent(ContentModel contentModel,
String objectTypeID,
CustomObjectTypeProperties objectTypeProperty) |
FolderModel |
createFolder()
It will create a new folder in current resource
FolderModel newRandomFolder = FolderModel.getRandomFolderModel();
dataContent.usingUser(testUser).usingSite(testSite).createFolder(newRandomFolder);
|
FolderModel |
createFolder(FolderModel folderModel)
This is the entry point of the createFolder() method to make REST API or CMIS call
|
FolderModel |
createFolderCmisApi(String folderName)
It will create a random folder in current resource using CMIS
dataContent.usingUser(testUser).usingSite(testSite).createFolder();
|
FolderModel |
createFolderV1Api(org.alfresco.dataprep.AlfrescoHttpClient client,
FolderModel folderModel,
String username,
String password)
It will create a random folder in current resource using REST API
dataContent.usingUser(testUser).usingSite(testSite).createFolder();
|
void |
deleteContent()
Use this to delete the last resource, either file or folder
dataContent.usingUser(adminUser).usingSite(siteModel).usingResource(repoFile).deleteContent();
|
void |
deleteContentCmisApi()
Use this to delete the last resource, either file or folder using CmisApi
dataContent.usingUser(adminUser).usingSite(siteModel).usingResource(repoFile).deleteContent();
|
void |
deleteContentV1RestApi(org.alfresco.dataprep.AlfrescoHttpClient client)
Use this to delete the last resource, either file or folder using V1 RestApi
dataContent.usingUser(adminUser).usingSite(siteModel).usingResource(repoFile).deleteContent();
|
void |
deleteSite(SiteModel site)
Delete a site
|
void |
deleteTree(FolderModel from)
Delete parent folder along with all children in it
|
void |
deployContentModel(String localModelXMLFilePath) |
void |
emptyUserTrashcan(UserModel user) |
org.apache.chemistry.opencmis.client.api.Document |
getCMISDocument(String filePath)
Get the corresponding CMIS Document Object of a file using only the file path
|
org.apache.chemistry.opencmis.client.api.Folder |
getCMISFolder(String folderPath)
Get the corresponding CMIS Folder Object of a file using only the file path
|
org.alfresco.dataprep.ContentActions |
getContentActions() |
org.apache.chemistry.opencmis.commons.data.ContentStream |
getContentStream(String fileName,
String content) |
FileModel |
getCustomModel()
Returns customModel file is one exists or is deployed using deployContentModel
otherwise null
|
String |
getNodeRef() |
void |
renameContent(ContentModel newContent)
Use this to rename a file or a folder
dataContent.usingUser(adminUser).usingSite(siteModel).usingResource(repoFolder).renameContent(newRepoFolder);
|
void |
setCustomModel(String localModelXMLFilePath)
Deploy a custom content model to repository
http://docs.alfresco.com/5.1/tasks/deploy-dynamic.html
|
void |
setInheritPermissions(boolean inheritPermissions) |
void |
updateContent(org.alfresco.dataprep.AlfrescoHttpClient client,
FileModel fileModel)
This method updates the content of the created document
|
void |
updateContent(org.alfresco.dataprep.AlfrescoHttpClient client,
FileModel fileModel,
org.alfresco.dataprep.CMISUtil.DocumentType documentType)
This method updates the content of the created document
|
void |
updateContent(String newContent)
Update document content
|
DataContent |
usingAdmin()
Defines the current user to be Admin
|
DataContent |
usingUser(UserModel user)
Call this method if you want to use another user rather than admin
defined in
TasProperties properties file |
void |
waitUntilContentIsCreated(String fullPath)
Wait and retry for 15 seconds checking if a resource is created
|
void |
waitUntilContentIsCreatedInLinux(String fullPath)
Wait and retry for 15 seconds checking if a resource is created for Linux OS
|
void |
waitUntilContentIsDeleted(String fullPath) |
assertExtensionAmpExists, assertLogLineIs, getAdminUser, getAlfrescoHome, getCurrentSite, getCurrentSpace, getCurrentUser, getDataDictionaryPath, getLastResource, getRootPath, getSitesPath, getUserHomesPath, isAFile, setCurrentSite, setCurrentSpace, setCurrentUser, setLastResource, usingLastServerLogLines, usingResource, usingRoot, usingSite, usingSite, usingUserHome, usingUserHome, withJMXpublic org.alfresco.dataprep.ContentActions getContentActions()
public DataContent usingUser(UserModel user)
TestDataTasProperties properties fileusingUser in interface DSL<DataContent>usingUser in class TestData<DataContent>public DataContent usingAdmin()
DSLusingAdmin in interface DSL<DataContent>usingAdmin in class TestData<DataContent>public FolderModel createFolder()
FolderModel newRandomFolder = FolderModel.getRandomFolderModel();
dataContent.usingUser(testUser).usingSite(testSite).createFolder(newRandomFolder);
public FolderModel createFolder(FolderModel folderModel)
public FolderModel createFolderV1Api(org.alfresco.dataprep.AlfrescoHttpClient client, FolderModel folderModel, String username, String password)
dataContent.usingUser(testUser).usingSite(testSite).createFolder();
public FolderModel createFolderCmisApi(String folderName)
dataContent.usingUser(testUser).usingSite(testSite).createFolder();
public void deleteContent()
dataContent.usingUser(adminUser).usingSite(siteModel).usingResource(repoFile).deleteContent();
public void deleteContentV1RestApi(org.alfresco.dataprep.AlfrescoHttpClient client)
dataContent.usingUser(adminUser).usingSite(siteModel).usingResource(repoFile).deleteContent();
public void deleteContentCmisApi()
dataContent.usingUser(adminUser).usingSite(siteModel).usingResource(repoFile).deleteContent();
public void renameContent(ContentModel newContent)
dataContent.usingUser(adminUser).usingSite(siteModel).usingResource(repoFolder).renameContent(newRepoFolder);
newContent - public String addEmailAlias(String alias) throws Exception
dataContent.usingSite(testSite).usingResource(testFolder).addEmailAlias("aliasTas");
alias - Exceptionpublic FileModel createContent()
FileModel newRandomFile = FileModel.getRandomFileModel();
dataContent.usingUser(testUser).usingSite(testSite).createContent(newRandomFile);
public FileModel createContent(FileModel fileModel)
public FileModel createContentV1Api(org.alfresco.dataprep.AlfrescoHttpClient client, FileModel fileModel)
FileModel object on success creationclient - fileModel - public void updateContent(org.alfresco.dataprep.AlfrescoHttpClient client,
FileModel fileModel)
client - fileModel - public FileModel createContentCmisApi(FileModel fileModel) throws DataPreparationException
CMISUtil.DocumentType passed using CMIS
Return the Document object on success creation
dataContent.usingSite(site).createContent(sourceFile);
fileModel - DataPreparationExceptionpublic FileModel createContent(org.alfresco.dataprep.CMISUtil.DocumentType documentType) throws DataPreparationException
DataPreparationExceptionpublic FileModel createContentDocTypeV1Api(org.alfresco.dataprep.AlfrescoHttpClient client, FileModel fileModel, org.alfresco.dataprep.CMISUtil.DocumentType documentType)
CMISUtil.DocumentType passed using REST API
Return the Document object on success creation
dataContent.usingUser(userModel).usingResource(myFolder).createContent(DocumentType.TEXT_PLAIN);
client - fileModel - documentType - DataPreparationExceptionpublic void updateContent(org.alfresco.dataprep.AlfrescoHttpClient client,
FileModel fileModel,
org.alfresco.dataprep.CMISUtil.DocumentType documentType)
client - fileModel - documentType - public FileModel createContentDocTypeCmisApi(org.alfresco.dataprep.CMISUtil.DocumentType documentType) throws DataPreparationException
CMISUtil.DocumentType passed using CMIS
Return the Document object on success creation
dataContent.usingUser(userModel).usingResource(myFolder).createContent(DocumentType.TEXT_PLAIN);
documentType - DataPreparationExceptionpublic void assertContentExist()
throws TestConfigurationException
TestConfigurationExceptionpublic void assertContentDoesNotExist()
throws TestConfigurationException
TestConfigurationExceptionpublic boolean checkContent(String fullPath, UserModel userModel) throws TestConfigurationException
fullPath - - the full path to CMIS objectuserModel - TestConfigurationExceptionpublic void waitUntilContentIsDeleted(String fullPath)
public void waitUntilContentIsCreated(String fullPath)
fullPath - public void waitUntilContentIsCreatedInLinux(String fullPath)
fullPath - public void deleteSite(SiteModel site)
site - public void deleteTree(FolderModel from)
from - public void setCustomModel(String localModelXMLFilePath)
localModelXMLFilePath - TestConfigurationExceptionpublic void deployContentModel(String localModelXMLFilePath) throws TestConfigurationException
TestConfigurationExceptionpublic FileModel getCustomModel()
public org.apache.chemistry.opencmis.commons.data.ContentStream getContentStream(String fileName, String content) throws Exception
Exceptionpublic void closeContentStream(org.apache.chemistry.opencmis.commons.data.ContentStream contentStream)
throws IOException
IOExceptionpublic ContentModel createCustomContent(ContentModel contentModel, String objectTypeID, CustomObjectTypeProperties objectTypeProperty) throws Exception
contentModel - objectTypeID - Example: objectTypeID = "D:cmis:document"Exceptionpublic void addTagToContent(TagModel model) throws TestConfigurationException
TestData.usingResource(ContentModel)fileModel - model - tag modelTestConfigurationExceptionpublic void assertContentHasTag(String cmisObjectPath, TagModel model)
cmisObjectPath - model - public String getNodeRef()
TestData.usingResource(ContentModel) and/or TestData.usingSite(SiteModel), etc.public org.apache.chemistry.opencmis.client.api.Document getCMISDocument(String filePath)
filePath - Documentpublic org.apache.chemistry.opencmis.client.api.Folder getCMISFolder(String folderPath)
filePath - Folderpublic void addAspect(List<XMLAspectData> aspects)
object - public void addFileToFavorites(FileModel file) throws DataPreparationException
DataPreparationExceptionpublic void addFolderToFavorites(FolderModel folder) throws DataPreparationException
DataPreparationExceptionpublic void assertContentVersionIs(String version)
version - public void assertContentSizeIs(long sizeInBytes)
sizeInBytes - size in bytespublic void checkOutDocument()
public void cancelCheckOut()
public void updateContent(String newContent)
newContent - public void checkIn(String newContent, boolean majorVersion, String checkInComment)
newContent - majorVersion - true to set major version(e.g. 2.0)checkInComment - public void setInheritPermissions(boolean inheritPermissions)
public void emptyUserTrashcan(UserModel user)
Copyright © 2005–2019 Alfresco Software. All rights reserved.