Search in sources :

Example 1 with CmisService

use of org.apache.chemistry.opencmis.commons.server.CmisService in project alfresco-repository by Alfresco.

the class CMISTest method testDeleteTree.

/**
 * Test for MNT-13366.
 */
@Test
public void testDeleteTree() {
    AuthenticationUtil.pushAuthentication();
    AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
    FileInfo parentFolder = null;
    FileInfo childFolder1 = null;
    try {
        // Create a parent folder: parentFolder:
        String parentFolderName = "parentFolder" + GUID.generate();
        parentFolder = createContent(parentFolderName, null, false);
        final NodeRef parentFolderNodeRef = parentFolder.getNodeRef();
        final String parentFolderID = parentFolderNodeRef.getId();
        // Create a child folder: parentFolder -> childFolder1:
        String childFolder1Name = "childFolder1" + GUID.generate();
        childFolder1 = createContent(parentFolder, childFolder1Name, null, false);
        final NodeRef childFolder1NodeRef = childFolder1.getNodeRef();
        // Create a child folder for previous child folder, which will contain a file:
        // parentFolder -> childFolder1 -> childFolder2 -> testdoc.txt
        String childFolder2Name = "childFolder2" + GUID.generate();
        String docName = "testdoc.txt" + GUID.generate();
        final NodeRef childFolder2NodeRef = createContent(childFolder1, childFolder2Name, docName, false).getNodeRef();
        // Store a reference to the file "testdoc.txt" contained by childFolder2:
        List<FileInfo> childFolder2FileList = fileFolderService.list(childFolder2NodeRef);
        final NodeRef childFolder2FileNodeRef = childFolder2FileList.get(0).getNodeRef();
        List<RepositoryInfo> repositories = withCmisService(new CmisServiceCallback<List<RepositoryInfo>>() {

            @Override
            public List<RepositoryInfo> execute(CmisService cmisService) {
                List<RepositoryInfo> repositories = cmisService.getRepositoryInfos(null);
                return repositories;
            }
        });
        assertTrue(repositories.size() > 0);
        RepositoryInfo repo = repositories.get(0);
        final String repositoryId = repo.getId();
        withCmisService(new CmisServiceCallback<Void>() {

            @Override
            public Void execute(CmisService cmisService) {
                // CMIS delete tree:
                FailedToDeleteData failedItems = cmisService.deleteTree(repositoryId, parentFolderID, Boolean.TRUE, UnfileObject.DELETE, Boolean.TRUE, null);
                assertEquals(failedItems.getIds().size(), 0);
                // Reference to the archive root node (the trash-can):
                NodeRef archiveRootNode = nodeArchiveService.getStoreArchiveNode(repositoryHelper.getCompanyHome().getStoreRef());
                // Get the archived ("canned") version of folders and file and check that hirarchy is correct:
                // ArchiveRoot -> archivedParentFolder -> archivedChildFolder1 -> archivedChildFolder2 -> archivedChildFolder2File.
                // Check parentFolder:
                NodeRef archivedParentFolderNodeRef = nodeArchiveService.getArchivedNode(parentFolderNodeRef);
                assertTrue(nodeService.getPrimaryParent(archivedParentFolderNodeRef).getParentRef().equals(archiveRootNode));
                // Check childFolder1:
                NodeRef archivedChildFolder1NodeRef = nodeArchiveService.getArchivedNode(childFolder1NodeRef);
                assertTrue(nodeService.getPrimaryParent(archivedChildFolder1NodeRef).getParentRef().equals(archivedParentFolderNodeRef));
                assertFalse(nodeService.getPrimaryParent(archivedChildFolder1NodeRef).getParentRef().equals(archiveRootNode));
                // Check childFolder2:
                NodeRef archivedChildFolder2NodeRef = nodeArchiveService.getArchivedNode(childFolder2NodeRef);
                assertTrue(nodeService.getPrimaryParent(archivedChildFolder2NodeRef).getParentRef().equals(archivedChildFolder1NodeRef));
                assertFalse(nodeService.getPrimaryParent(archivedChildFolder2NodeRef).getParentRef().equals(archiveRootNode));
                // Check childFolder2's file ("testdoc.txt"):
                NodeRef archivedChildFolder2FileNodeRef = nodeArchiveService.getArchivedNode(childFolder2FileNodeRef);
                assertTrue(nodeService.getPrimaryParent(archivedChildFolder2FileNodeRef).getParentRef().equals(archivedChildFolder2NodeRef));
                assertFalse(nodeService.getPrimaryParent(archivedChildFolder2FileNodeRef).getParentRef().equals(archiveRootNode));
                return null;
            }
        });
    } finally {
        if (parentFolder != null && fileFolderService.exists(parentFolder.getNodeRef())) {
            fileFolderService.delete(parentFolder.getNodeRef());
        }
        AuthenticationUtil.popAuthentication();
    }
}
Also used : RepositoryInfo(org.apache.chemistry.opencmis.commons.data.RepositoryInfo) FailedToDeleteData(org.apache.chemistry.opencmis.commons.data.FailedToDeleteData) NodeRef(org.alfresco.service.cmr.repository.NodeRef) FileInfo(org.alfresco.service.cmr.model.FileInfo) CmisService(org.apache.chemistry.opencmis.commons.server.CmisService) ObjectInFolderList(org.apache.chemistry.opencmis.commons.data.ObjectInFolderList) ArrayList(java.util.ArrayList) ObjectList(org.apache.chemistry.opencmis.commons.data.ObjectList) List(java.util.List) VersionableAspectTest(org.alfresco.repo.version.VersionableAspectTest) Test(org.junit.Test)

Example 2 with CmisService

use of org.apache.chemistry.opencmis.commons.server.CmisService in project alfresco-repository by Alfresco.

the class CMISTest method aPrivateCopyMustAllowTheAdditionOfAspects_CMIS_1_1_Version.

/**
 *  Related to REPO-4613.
 *  This test makes sure that once a copy is checked out, updateProperties method can be called
 *  and properly adds the new properties.
 */
@Test
public void aPrivateCopyMustAllowTheAdditionOfAspects_CMIS_1_1_Version() {
    final String aspectName = "P:cm:summarizable";
    final String propertyName = "cm:summary";
    final String propertyValue = "My summary";
    // get repository id
    final String repositoryId = withCmisService(new CmisServiceCallback<String>() {

        @Override
        public String execute(CmisService cmisService) {
            List<RepositoryInfo> repositories = cmisService.getRepositoryInfos(null);
            RepositoryInfo repo = repositories.get(0);
            final String repositoryId = repo.getId();
            return repositoryId;
        }
    }, CmisVersion.CMIS_1_1);
    final Properties currentProperties = withCmisService(new CmisServiceCallback<Properties>() {

        @Override
        public Properties execute(CmisService cmisService) {
            PropertiesImpl properties = new PropertiesImpl();
            String objectTypeId = "cmis:document";
            properties.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_TYPE_ID, objectTypeId));
            String fileName = "textFile" + GUID.generate();
            properties.addProperty(new PropertyStringImpl(PropertyIds.NAME, fileName));
            final ContentStreamImpl contentStream = new ContentStreamImpl(fileName, MimetypeMap.MIMETYPE_TEXT_PLAIN, "Simple text plain document");
            String objectId = cmisService.create(repositoryId, properties, repositoryHelper.getCompanyHome().getId(), contentStream, VersioningState.MAJOR, null, null);
            final Holder<String> objectIdHolder = new Holder<String>(objectId);
            cmisService.checkOut(repositoryId, objectIdHolder, null, null);
            cmisService.getObject(repositoryId, objectIdHolder.getValue(), null, null, null, null, null, null, null);
            properties = new PropertiesImpl();
            properties.addProperty(new PropertyStringImpl(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, Arrays.asList(aspectName)));
            properties.addProperty(new PropertyStringImpl(propertyName, propertyValue));
            cmisService.updateProperties(repositoryId, objectIdHolder, null, properties, null);
            cmisService.checkIn(repositoryId, objectIdHolder, false, null, null, "checkin", null, null, null, null);
            Properties propertiesValues = cmisService.getProperties(repositoryId, objectIdHolder.getValue(), null, null);
            return propertiesValues;
        }
    }, CmisVersion.CMIS_1_1);
    List<String> secondaryTypeIds = (List<String>) currentProperties.getProperties().get(PropertyIds.SECONDARY_OBJECT_TYPE_IDS).getValues();
    assertTrue(secondaryTypeIds.contains(aspectName));
    assertEquals(currentProperties.getProperties().get(propertyName).getValues().get(0), propertyValue);
}
Also used : ContentStreamImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl) PropertiesImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl) RepositoryInfo(org.apache.chemistry.opencmis.commons.data.RepositoryInfo) Holder(org.apache.chemistry.opencmis.commons.spi.Holder) Properties(org.apache.chemistry.opencmis.commons.data.Properties) PropertyIdImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIdImpl) CmisService(org.apache.chemistry.opencmis.commons.server.CmisService) PropertyStringImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringImpl) ObjectInFolderList(org.apache.chemistry.opencmis.commons.data.ObjectInFolderList) ArrayList(java.util.ArrayList) ObjectList(org.apache.chemistry.opencmis.commons.data.ObjectList) List(java.util.List) VersionableAspectTest(org.alfresco.repo.version.VersionableAspectTest) Test(org.junit.Test)

Example 3 with CmisService

use of org.apache.chemistry.opencmis.commons.server.CmisService in project alfresco-repository by Alfresco.

the class CMISTest method testContentMimeTypeDetection.

/**
 * ALF-18006 Test content mimetype auto-detection into CmisStreamInterceptor when "Content-Type" is not defined.
 */
@Test
public void testContentMimeTypeDetection() {
    ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
    FileFolderService ffs = serviceRegistry.getFileFolderService();
    AuthenticationComponent authenticationComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
    final String isoEncoding = "ISO-8859-1";
    final String utfEncoding = "UTF-8";
    // get repository id
    List<RepositoryInfo> repositories = withCmisService(new CmisServiceCallback<List<RepositoryInfo>>() {

        @Override
        public List<RepositoryInfo> execute(CmisService cmisService) {
            List<RepositoryInfo> repositories = cmisService.getRepositoryInfos(null);
            return repositories;
        }
    });
    assertTrue(repositories.size() > 0);
    RepositoryInfo repo = repositories.get(0);
    final String repositoryId = repo.getId();
    // create simple text plain content
    final PropertiesImpl properties = new PropertiesImpl();
    String objectTypeId = "cmis:document";
    properties.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_TYPE_ID, objectTypeId));
    String fileName = "textFile" + GUID.generate();
    properties.addProperty(new PropertyStringImpl(PropertyIds.NAME, fileName));
    final ContentStreamImpl contentStream = new ContentStreamImpl(fileName, MimetypeMap.MIMETYPE_TEXT_PLAIN, "Simple text plain document");
    String objectId = withCmisService(new CmisServiceCallback<String>() {

        @Override
        public String execute(CmisService cmisService) {
            String objectId = cmisService.create(repositoryId, properties, repositoryHelper.getCompanyHome().getId(), contentStream, VersioningState.MAJOR, null, null);
            return objectId;
        }
    });
    final Holder<String> objectIdHolder = new Holder<String>(objectId);
    final String path = "/" + fileName;
    // create content stream with undefined mimetype and file name
    {
        final ContentStreamImpl contentStreamHTML = new ContentStreamImpl(null, null, "<html><head><title> Hello </title></head><body><p> Test html</p></body></html></body></html>");
        withCmisService(new CmisServiceCallback<Void>() {

            @Override
            public Void execute(CmisService cmisService) {
                cmisService.setContentStream(repositoryId, objectIdHolder, true, null, contentStreamHTML, null);
                return null;
            }
        });
        // check mimetype
        ObjectData objectData = withCmisService(new CmisServiceCallback<ObjectData>() {

            @Override
            public ObjectData execute(CmisService cmisService) {
                return cmisService.getObjectByPath(repositoryId, path, null, false, IncludeRelationships.NONE, null, false, false, null);
            }
        });
        final String objectId1 = objectData.getId();
        String contentType = withCmisService(new CmisServiceCallback<String>() {

            @Override
            public String execute(CmisService cmisService) {
                String contentType = cmisService.getObjectInfo(repositoryId, objectId1).getContentType();
                return contentType;
            }
        });
        assertEquals("Mimetype is not defined correctly.", MimetypeMap.MIMETYPE_HTML, contentType);
        // check that the encoding is detected correctly
        checkEncoding(ffs, authenticationComponent, objectData, utfEncoding);
    }
    // create content stream with mimetype and encoding as UTF-8
    {
        String mimeType = MimetypeMap.MIMETYPE_TEXT_PLAIN + "; charset=" + isoEncoding;
        // NOTE that we intentionally specify the wrong charset here.
        // Alfresco will detect the encoding (as UTF-8 - given by the ContentStreamImpl constructor)
        final ContentStreamImpl contentStreamHTML = new ContentStreamImpl(null, mimeType, "<html><head><title> Hello </title></head><body><p> Test html</p></body></html></body></html>");
        withCmisService(new CmisServiceCallback<Void>() {

            @Override
            public Void execute(CmisService cmisService) {
                Holder<String> latestObjectIdHolder = getHolderOfObjectOfLatestVersion(cmisService, repositoryId, objectIdHolder);
                cmisService.setContentStream(repositoryId, latestObjectIdHolder, true, null, contentStreamHTML, null);
                return null;
            }
        });
        // check mimetype
        final ObjectData objectData = withCmisService(new CmisServiceCallback<ObjectData>() {

            @Override
            public ObjectData execute(CmisService cmisService) {
                ObjectData objectData = cmisService.getObjectByPath(repositoryId, path, null, false, IncludeRelationships.NONE, null, false, false, null);
                return objectData;
            }
        });
        String contentType = withCmisService(new CmisServiceCallback<String>() {

            @Override
            public String execute(CmisService cmisService) {
                String contentType = cmisService.getObjectInfo(repositoryId, objectData.getId()).getContentType();
                return contentType;
            }
        });
        assertEquals("Mimetype is not defined correctly.", MimetypeMap.MIMETYPE_TEXT_PLAIN, contentType);
        // check that the encoding is detected correctly
        checkEncoding(ffs, authenticationComponent, objectData, utfEncoding);
    }
    // create content stream with mimetype and encoding as ISO-8859-1
    {
        String mimeType = MimetypeMap.MIMETYPE_TEXT_PLAIN + "; charset=" + utfEncoding;
        // NOTE that we intentionally specify the wrong charset here.
        // Alfresco will detect the encoding (as ISO-8859-1 - given by the ContentStreamImpl with streams)
        String content = "<html><head><title>aegif Mind Share Leader Generating New Paradigms by aegif corporation</title></head><body><p> Test html</p></body></html></body></html>";
        byte[] buf = null;
        try {
            // set the encoding here for the content stream
            buf = content.getBytes(isoEncoding);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        ByteArrayInputStream input = new ByteArrayInputStream(buf);
        final ContentStream contentStreamHTML = new ContentStreamImpl(null, BigInteger.valueOf(buf.length), mimeType, input);
        withCmisService(new CmisServiceCallback<Void>() {

            @Override
            public Void execute(CmisService cmisService) {
                Holder<String> latestObjectIdHolder = getHolderOfObjectOfLatestVersion(cmisService, repositoryId, objectIdHolder);
                cmisService.setContentStream(repositoryId, latestObjectIdHolder, true, null, contentStreamHTML, null);
                return null;
            }
        });
        // check mimetype
        final ObjectData objectData = withCmisService(new CmisServiceCallback<ObjectData>() {

            @Override
            public ObjectData execute(CmisService cmisService) {
                ObjectData objectData = cmisService.getObjectByPath(repositoryId, path, null, false, IncludeRelationships.NONE, null, false, false, null);
                return objectData;
            }
        });
        String contentType = withCmisService(new CmisServiceCallback<String>() {

            @Override
            public String execute(CmisService cmisService) {
                String contentType = cmisService.getObjectInfo(repositoryId, objectData.getId()).getContentType();
                return contentType;
            }
        });
        assertEquals("Mimetype is not defined correctly.", MimetypeMap.MIMETYPE_TEXT_PLAIN, contentType);
        // check that the encoding is detected correctly
        checkEncoding(ffs, authenticationComponent, objectData, isoEncoding);
    }
    // checkout/checkin object with mimetype and encoding
    {
        ObjectData objectDa = withCmisService(new CmisServiceCallback<ObjectData>() {

            @Override
            public ObjectData execute(CmisService cmisService) {
                return cmisService.getObjectByPath(repositoryId, path, null, false, IncludeRelationships.NONE, null, false, false, null);
            }
        });
        objectIdHolder.setValue(objectDa.getId());
        withCmisService(new CmisServiceCallback<Void>() {

            @Override
            public Void execute(CmisService cmisService) {
                cmisService.checkOut(repositoryId, objectIdHolder, null, new Holder<Boolean>());
                return null;
            }
        });
        String mimeType = MimetypeMap.MIMETYPE_HTML + "; charset=UTF-8";
        final ContentStreamImpl contentStreamHTML = new ContentStreamImpl(null, mimeType, "<html><head><title> Hello </title></head><body><p> Test html</p></body></html></body></html>");
        withCmisService(new CmisServiceCallback<Void>() {

            @Override
            public Void execute(CmisService cmisService) {
                cmisService.checkIn(repositoryId, objectIdHolder, false, null, contentStreamHTML, "checkin", null, null, null, null);
                return null;
            }
        });
        // check mimetype
        final ObjectData objectData = withCmisService(new CmisServiceCallback<ObjectData>() {

            @Override
            public ObjectData execute(CmisService cmisService) {
                ObjectData objectData = cmisService.getObjectByPath(repositoryId, path, null, false, IncludeRelationships.NONE, null, false, false, null);
                return objectData;
            }
        });
        String contentType = withCmisService(new CmisServiceCallback<String>() {

            @Override
            public String execute(CmisService cmisService) {
                String contentType = cmisService.getObjectInfo(repositoryId, objectData.getId()).getContentType();
                return contentType;
            }
        });
        assertEquals("Mimetype is not defined correctly.", MimetypeMap.MIMETYPE_HTML, contentType);
        checkEncoding(ffs, authenticationComponent, objectData, utfEncoding);
    }
}
Also used : ContentStreamImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl) PropertiesImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl) RepositoryInfo(org.apache.chemistry.opencmis.commons.data.RepositoryInfo) Holder(org.apache.chemistry.opencmis.commons.spi.Holder) ObjectData(org.apache.chemistry.opencmis.commons.data.ObjectData) UnsupportedEncodingException(java.io.UnsupportedEncodingException) FileFolderService(org.alfresco.service.cmr.model.FileFolderService) PropertyIdImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIdImpl) ContentStream(org.apache.chemistry.opencmis.commons.data.ContentStream) AuthenticationComponent(org.alfresco.repo.security.authentication.AuthenticationComponent) CmisService(org.apache.chemistry.opencmis.commons.server.CmisService) PropertyStringImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringImpl) ByteArrayInputStream(java.io.ByteArrayInputStream) ObjectInFolderList(org.apache.chemistry.opencmis.commons.data.ObjectInFolderList) ArrayList(java.util.ArrayList) ObjectList(org.apache.chemistry.opencmis.commons.data.ObjectList) List(java.util.List) ServiceRegistry(org.alfresco.service.ServiceRegistry) VersionableAspectTest(org.alfresco.repo.version.VersionableAspectTest) Test(org.junit.Test)

Example 4 with CmisService

use of org.apache.chemistry.opencmis.commons.server.CmisService in project alfresco-repository by Alfresco.

the class CMISTest method getAllVersionsWithNullObjectId.

/*
     * REPO-3627 / MNT-19630: CMIS: Unable to call getAllVersions() if node is checked out and if binding type is WSDL
     * 
     * For WS binding the getAllVersions call is made with null objectId
     */
@Test
public void getAllVersionsWithNullObjectId() {
    AuthenticationUtil.pushAuthentication();
    AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
    // Create folder with file
    String folderName = "testfolder" + GUID.generate();
    String docName = "testdoc.txt" + GUID.generate();
    NodeRef folderRef = createContent(folderName, docName, false).getNodeRef();
    List<FileInfo> folderFileList = fileFolderService.list(folderRef);
    final NodeRef fileRef = folderFileList.get(0).getNodeRef();
    // Create new version for file
    transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>() {

        @Override
        public Void execute() throws Throwable {
            // create a new version
            versionService.createVersion(fileRef, null);
            return null;
        }
    });
    // Checkout document and get all versions
    List<ObjectData> versions = withCmisService(new CmisServiceCallback<List<ObjectData>>() {

        @Override
        public List<ObjectData> execute(CmisService cmisService) {
            String repositoryId = cmisService.getRepositoryInfos(null).get(0).getId();
            ObjectData objectData = cmisService.getObjectByPath(repositoryId, "/" + folderName + "/" + docName, null, true, IncludeRelationships.NONE, null, false, true, null);
            // Checkout
            Holder<String> objectId = new Holder<String>(objectData.getId());
            cmisService.checkOut(repositoryId, objectId, null, new Holder<Boolean>(true));
            // Call get all versions with null objectId
            List<ObjectData> versions = cmisService.getAllVersions(repositoryId, null, fileRef.toString(), null, null, null);
            return versions;
        }
    });
    // Check that the correct versions are retrieved
    assertEquals(2, versions.size());
    assertEquals(versions.get(0).getProperties().getProperties().get("cmis:versionLabel").getFirstValue(), "pwc");
    assertEquals(versions.get(1).getProperties().getProperties().get("cmis:versionLabel").getFirstValue(), "0.1");
}
Also used : Holder(org.apache.chemistry.opencmis.commons.spi.Holder) ObjectData(org.apache.chemistry.opencmis.commons.data.ObjectData) NodeRef(org.alfresco.service.cmr.repository.NodeRef) FileInfo(org.alfresco.service.cmr.model.FileInfo) CmisService(org.apache.chemistry.opencmis.commons.server.CmisService) ObjectInFolderList(org.apache.chemistry.opencmis.commons.data.ObjectInFolderList) ArrayList(java.util.ArrayList) ObjectList(org.apache.chemistry.opencmis.commons.data.ObjectList) List(java.util.List) VersionableAspectTest(org.alfresco.repo.version.VersionableAspectTest) Test(org.junit.Test)

Example 5 with CmisService

use of org.apache.chemistry.opencmis.commons.server.CmisService in project alfresco-repository by Alfresco.

the class CMISTest method testACE3322.

/**
 * ACE-3322
 */
@Test
public void testACE3322() {
    final String[] types = { "cmis:document", "cmis:relationship", "cmis:folder", "cmis:item" };
    CmisServiceCallback<String> callback = new CmisServiceCallback<String>() {

        @Override
        public String execute(CmisService cmisService) {
            for (int i = 0; i < types.length; i++) {
                List<TypeDefinitionWrapper> baseTypes = cmisDictionaryService.getBaseTypes();
                assertNotNull(baseTypes);
                checkDefs(baseTypes);
                List<TypeDefinitionWrapper> children = cmisDictionaryService.getChildren(types[i]);
                assertNotNull(children);
                // Check that children were updated
                checkDefs(children);
            }
            return "";
        }

        private void checkDefs(List<TypeDefinitionWrapper> defs) {
            for (TypeDefinitionWrapper def : defs) {
                assertNotNull("Type definition was not updated. Please refer to ACE-3322", def.getTypeDefinition(false).getDisplayName());
                assertNotNull("Type definition was not updated. Please refer to ACE-3322", def.getTypeDefinition(false).getDescription());
                // Check that property's display name and description were updated
                for (PropertyDefinitionWrapper property : def.getProperties()) {
                    assertNotNull("Display name is null", property.getPropertyDefinition().getDisplayName());
                    assertNotNull("Description is null", property.getPropertyDefinition().getDescription());
                }
            }
        }
    };
    withCmisService(callback, CmisVersion.CMIS_1_1);
}
Also used : PropertyDefinitionWrapper(org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper) CmisService(org.apache.chemistry.opencmis.commons.server.CmisService) TypeDefinitionWrapper(org.alfresco.opencmis.dictionary.TypeDefinitionWrapper) ObjectInFolderList(org.apache.chemistry.opencmis.commons.data.ObjectInFolderList) ArrayList(java.util.ArrayList) ObjectList(org.apache.chemistry.opencmis.commons.data.ObjectList) List(java.util.List) VersionableAspectTest(org.alfresco.repo.version.VersionableAspectTest) Test(org.junit.Test)

Aggregations

CmisService (org.apache.chemistry.opencmis.commons.server.CmisService)31 VersionableAspectTest (org.alfresco.repo.version.VersionableAspectTest)30 Test (org.junit.Test)30 ArrayList (java.util.ArrayList)26 List (java.util.List)23 ObjectInFolderList (org.apache.chemistry.opencmis.commons.data.ObjectInFolderList)23 ObjectList (org.apache.chemistry.opencmis.commons.data.ObjectList)23 RepositoryInfo (org.apache.chemistry.opencmis.commons.data.RepositoryInfo)23 FileInfo (org.alfresco.service.cmr.model.FileInfo)18 NodeRef (org.alfresco.service.cmr.repository.NodeRef)17 ObjectData (org.apache.chemistry.opencmis.commons.data.ObjectData)14 HashMap (java.util.HashMap)11 PropertiesImpl (org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl)11 Holder (org.apache.chemistry.opencmis.commons.spi.Holder)11 PropertyStringImpl (org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringImpl)10 Map (java.util.Map)9 MimetypeMap (org.alfresco.repo.content.MimetypeMap)9 QName (org.alfresco.service.namespace.QName)8 ContentStreamImpl (org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl)8 PropertyIdImpl (org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIdImpl)8