Search in sources :

Example 11 with Document

use of org.apache.chemistry.opencmis.client.api.Document in project alfresco-remote-api by Alfresco.

the class TestCMIS method testAppendContentStream.

@Test
public void testAppendContentStream() throws Exception {
    final TestNetwork network1 = getTestFixture().getRandomNetwork();
    String username = "user" + System.currentTimeMillis();
    PersonInfo personInfo = new PersonInfo(username, username, username, TEST_PASSWORD, null, null, null, null, null, null, null);
    TestPerson person1 = network1.createUser(personInfo);
    String person1Id = person1.getId();
    final String siteName = "site" + System.currentTimeMillis();
    TenantUtil.runAsUserTenant(new TenantRunAsWork<NodeRef>() {

        @Override
        public NodeRef doWork() throws Exception {
            SiteInformation siteInfo = new SiteInformation(siteName, siteName, siteName, SiteVisibility.PRIVATE);
            TestSite site = repoService.createSite(null, siteInfo);
            String name = GUID.generate();
            NodeRef folderNodeRef = repoService.createFolder(site.getContainerNodeRef(DOCUMENT_LIBRARY_CONTAINER_NAME), name);
            return folderNodeRef;
        }
    }, person1Id, network1.getId());
    // Create a document...
    publicApiClient.setRequestContext(new RequestContext(network1.getId(), person1Id));
    CmisSession cmisSession = publicApiClient.createPublicApiCMISSession(Binding.atom, CMIS_VERSION_11);
    Folder docLibrary = (Folder) cmisSession.getObjectByPath("/Sites/" + siteName + "/documentLibrary");
    String name = "mydoc-" + GUID.generate() + ".txt";
    Map<String, String> properties = new HashMap<String, String>();
    {
        // create a document with 2 aspects
        properties.put(PropertyIds.OBJECT_TYPE_ID, TYPE_CMIS_DOCUMENT);
        properties.put(PropertyIds.NAME, name);
    }
    ContentStreamImpl fileContent = new ContentStreamImpl();
    {
        ContentWriter writer = new FileContentWriter(TempFileProvider.createTempFile(GUID.generate(), ".txt"));
        writer.putContent("Ipsum and so on");
        ContentReader reader = writer.getReader();
        fileContent.setMimeType(MimetypeMap.MIMETYPE_TEXT_PLAIN);
        fileContent.setStream(reader.getContentInputStream());
    }
    Document doc = docLibrary.createDocument(properties, fileContent, VersioningState.MAJOR);
    // append a few times
    for (int i = 0; i < 5; i++) {
        fileContent = new ContentStreamImpl();
        {
            ContentWriter writer = new FileContentWriter(TempFileProvider.createTempFile(GUID.generate(), ".txt"));
            writer.putContent("Ipsum and so on");
            ContentReader reader = writer.getReader();
            fileContent.setMimeType(MimetypeMap.MIMETYPE_TEXT_PLAIN);
            fileContent.setStream(reader.getContentInputStream());
        }
        doc.appendContentStream(fileContent, false);
    }
    fileContent = new ContentStreamImpl();
    {
        ContentWriter writer = new FileContentWriter(TempFileProvider.createTempFile(GUID.generate(), ".txt"));
        writer.putContent("Ipsum and so on");
        ContentReader reader = writer.getReader();
        fileContent.setMimeType(MimetypeMap.MIMETYPE_TEXT_PLAIN);
        fileContent.setStream(reader.getContentInputStream());
    }
    doc.appendContentStream(fileContent, true);
    // check the appends
    String path = "/Sites/" + siteName + "/documentLibrary/" + name;
    Document doc1 = (Document) cmisSession.getObjectByPath(path);
    ContentStream contentStream = doc1.getContentStream();
    InputStream in = contentStream.getStream();
    StringWriter writer = new StringWriter();
    IOUtils.copy(in, writer, "UTF-8");
    String content = writer.toString();
    assertEquals("Ipsum and so onIpsum and so onIpsum and so onIpsum and so onIpsum and so onIpsum and so onIpsum and so on", content);
}
Also used : ContentStreamImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl) CmisSession(org.alfresco.rest.api.tests.client.PublicApiClient.CmisSession) HashMap(java.util.HashMap) TestSite(org.alfresco.rest.api.tests.RepoService.TestSite) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) FileContentWriter(org.alfresco.repo.content.filestore.FileContentWriter) ContentReader(org.alfresco.service.cmr.repository.ContentReader) AlfrescoFolder(org.alfresco.cmis.client.AlfrescoFolder) Folder(org.apache.chemistry.opencmis.client.api.Folder) AlfrescoDocument(org.alfresco.cmis.client.AlfrescoDocument) Document(org.apache.chemistry.opencmis.client.api.Document) CmisUpdateConflictException(org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException) CmisConstraintException(org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException) CmisPermissionDeniedException(org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException) CmisInvalidArgumentException(org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException) PublicApiException(org.alfresco.rest.api.tests.client.PublicApiException) CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException) NodeRef(org.alfresco.service.cmr.repository.NodeRef) ContentWriter(org.alfresco.service.cmr.repository.ContentWriter) FileContentWriter(org.alfresco.repo.content.filestore.FileContentWriter) ContentStream(org.apache.chemistry.opencmis.commons.data.ContentStream) StringWriter(java.io.StringWriter) SiteInformation(org.alfresco.rest.api.tests.RepoService.SiteInformation) TestNetwork(org.alfresco.rest.api.tests.RepoService.TestNetwork) RequestContext(org.alfresco.rest.api.tests.client.RequestContext) TestPerson(org.alfresco.rest.api.tests.RepoService.TestPerson) VersionableAspectTest(org.alfresco.repo.version.VersionableAspectTest) Test(org.junit.Test)

Example 12 with Document

use of org.apache.chemistry.opencmis.client.api.Document in project alfresco-remote-api by Alfresco.

the class TestCMIS method testDeleteNonCurrentVersion.

/**
 * Test delete version on versions other than latest (most recent) version (MNT-17228)
 */
@Test
public void testDeleteNonCurrentVersion() throws Exception {
    final TestNetwork network1 = getTestFixture().getRandomNetwork();
    String username = "user" + System.currentTimeMillis();
    PersonInfo personInfo = new PersonInfo(username, username, username, TEST_PASSWORD, null, null, null, null, null, null, null);
    TestPerson person = network1.createUser(personInfo);
    String personId = person.getId();
    publicApiClient.setRequestContext(new RequestContext(network1.getId(), personId));
    CmisSession cmisSession = publicApiClient.createPublicApiCMISSession(Binding.browser, CMIS_VERSION_11, AlfrescoObjectFactoryImpl.class.getName());
    Folder homeFolder = (Folder) cmisSession.getObjectByPath("/User Homes/" + personId);
    assertNotNull(homeFolder.getId());
    // Create a document
    String name = String.format(TEST_DOCUMENT_NAME_PATTERN, GUID.generate());
    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put(PropertyIds.OBJECT_TYPE_ID, TYPE_CMIS_DOCUMENT);
    properties.put(PropertyIds.NAME, name);
    ContentStreamImpl fileContent = new ContentStreamImpl();
    ByteArrayInputStream stream = new ByteArrayInputStream(GUID.generate().getBytes());
    fileContent.setMimeType(MimetypeMap.MIMETYPE_TEXT_PLAIN);
    fileContent.setStream(stream);
    Document doc = homeFolder.createDocument(properties, fileContent, VersioningState.MAJOR);
    String versionLabel = doc.getVersionLabel();
    assertEquals("1.0", versionLabel);
    Document docVersionToDelete = null;
    Document latestDoc = doc;
    int cnt = 4;
    for (int i = 1; i <= cnt; i++) {
        // Update content to create new versions (1.1, 1.2, 1.3, 1.4)
        fileContent = new ContentStreamImpl();
        {
            ContentWriter writer = new FileContentWriter(TempFileProvider.createTempFile(GUID.generate(), ".txt"));
            writer.putContent("Ipsum and so on and so on " + i);
            ContentReader reader = writer.getReader();
            fileContent.setMimeType(MimetypeMap.MIMETYPE_TEXT_PLAIN);
            fileContent.setStream(reader.getContentInputStream());
        }
        latestDoc.setContentStream(fileContent, true);
        latestDoc = latestDoc.getObjectOfLatestVersion(false);
        versionLabel = latestDoc.getVersionLabel();
        assertEquals("1." + i, versionLabel);
        assertEquals(1 + i, cmisSession.getAllVersions(latestDoc.getId()).size());
        if (i == 2) {
            // ie. 1.2
            docVersionToDelete = latestDoc;
        }
    }
    // Test delete with a user without permissions
    String username2 = "user" + System.currentTimeMillis();
    PersonInfo person2Info = new PersonInfo(username2, username2, username2, TEST_PASSWORD, null, null, null, null, null, null, null);
    TestPerson person2 = network1.createUser(person2Info);
    String person2Id = person2.getId();
    TenantUtil.runAsSystemTenant(new TenantRunAsWork<Void>() {

        @Override
        public Void doWork() throws Exception {
            String nodeId = stripCMISSuffix(doc.getId());
            NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
            // Give user person2 READ permissions to access the node
            permissionService.setPermission(nodeRef, person2Id, PermissionService.READ, true);
            return null;
        }
    }, network1.getId());
    // Connect with person2
    publicApiClient.setRequestContext(new RequestContext(network1.getId(), person2Id));
    CmisSession cmisSession2 = publicApiClient.createPublicApiCMISSession(Binding.browser, CMIS_VERSION_11, AlfrescoObjectFactoryImpl.class.getName());
    CmisObject docVersionToDeleteBy2 = cmisSession2.getObject(docVersionToDelete.getId());
    try {
        // (-) Delete v 1.2 (without DELETE permission)
        docVersionToDeleteBy2.delete(false);
        fail("Node version was deleted without permissions.");
    } catch (CmisPermissionDeniedException ex) {
    // expected
    }
    // (+) Delete v 1.2 (with permission)
    docVersionToDelete.delete(false);
    // eg. 1.0, 1.2, 1.3, 1.4 (not 1.1)
    assertEquals(cnt, cmisSession.getAllVersions(doc.getId()).size());
}
Also used : ContentStreamImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl) HashMap(java.util.HashMap) AlfrescoFolder(org.alfresco.cmis.client.AlfrescoFolder) Folder(org.apache.chemistry.opencmis.client.api.Folder) AlfrescoDocument(org.alfresco.cmis.client.AlfrescoDocument) Document(org.apache.chemistry.opencmis.client.api.Document) NodeRef(org.alfresco.service.cmr.repository.NodeRef) CmisPermissionDeniedException(org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException) FileableCmisObject(org.apache.chemistry.opencmis.client.api.FileableCmisObject) CmisObject(org.apache.chemistry.opencmis.client.api.CmisObject) RequestContext(org.alfresco.rest.api.tests.client.RequestContext) AlfrescoObjectFactoryImpl(org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl) CmisSession(org.alfresco.rest.api.tests.client.PublicApiClient.CmisSession) FileContentWriter(org.alfresco.repo.content.filestore.FileContentWriter) ContentReader(org.alfresco.service.cmr.repository.ContentReader) CmisUpdateConflictException(org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException) CmisConstraintException(org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException) CmisPermissionDeniedException(org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException) CmisInvalidArgumentException(org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException) PublicApiException(org.alfresco.rest.api.tests.client.PublicApiException) CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException) ContentWriter(org.alfresco.service.cmr.repository.ContentWriter) FileContentWriter(org.alfresco.repo.content.filestore.FileContentWriter) ByteArrayInputStream(java.io.ByteArrayInputStream) TestNetwork(org.alfresco.rest.api.tests.RepoService.TestNetwork) FileableCmisObject(org.apache.chemistry.opencmis.client.api.FileableCmisObject) CmisObject(org.apache.chemistry.opencmis.client.api.CmisObject) TestPerson(org.alfresco.rest.api.tests.RepoService.TestPerson) VersionableAspectTest(org.alfresco.repo.version.VersionableAspectTest) Test(org.junit.Test)

Example 13 with Document

use of org.apache.chemistry.opencmis.client.api.Document in project iaf by ibissource.

the class CmisSender method sendMessageForActionGet.

private String sendMessageForActionGet(String correlationID, String message, ParameterResolutionContext prc) throws SenderException, TimeOutException {
    if (StringUtils.isEmpty(message)) {
        throw new SenderException(getLogPrefix() + "input string cannot be empty but must contain a documentId");
    }
    CmisObject object = null;
    try {
        object = session.getObject(session.createObjectId(message));
    } catch (CmisObjectNotFoundException e) {
        if (StringUtils.isNotEmpty(getResultOnNotFound())) {
            log.info(getLogPrefix() + "document with id [" + message + "] not found", e);
            return getResultOnNotFound();
        } else {
            throw new SenderException(e);
        }
    }
    Document document = (Document) object;
    ContentStream contentStream = document.getContentStream();
    try {
        InputStream inputStream = contentStream.getStream();
        if (isStreamResultToServlet()) {
            HttpServletResponse response = (HttpServletResponse) prc.getSession().get(IPipeLineSession.HTTP_RESPONSE_KEY);
            String contentType = contentStream.getMimeType();
            if (StringUtils.isNotEmpty(contentType)) {
                log.debug(getLogPrefix() + "setting response Content-Type header [" + contentType + "]");
                response.setHeader("Content-Type", contentType);
            }
            String contentDisposition = "attachment; filename=\"" + contentStream.getFileName() + "\"";
            log.debug(getLogPrefix() + "setting response Content-Disposition header [" + contentDisposition + "]");
            response.setHeader("Content-Disposition", contentDisposition);
            OutputStream outputStream;
            outputStream = response.getOutputStream();
            Misc.streamToStream(inputStream, outputStream);
            log.debug(getLogPrefix() + "copied document content input stream [" + inputStream + "] to output stream [" + outputStream + "]");
            return "";
        } else if (isGetProperties()) {
            if (StringUtils.isNotEmpty(fileInputStreamSessionKey)) {
                prc.getSession().put(getFileInputStreamSessionKey(), inputStream);
            } else {
                byte[] bytes = Misc.streamToBytes(inputStream);
                prc.getSession().put(getFileContentSessionKey(), Base64.encodeBase64String(bytes));
            }
            XmlBuilder cmisXml = new XmlBuilder("cmis");
            XmlBuilder propertiesXml = new XmlBuilder("properties");
            for (Iterator it = document.getProperties().iterator(); it.hasNext(); ) {
                Property property = (Property) it.next();
                propertiesXml.addSubElement(getPropertyXml(property));
            }
            cmisXml.addSubElement(propertiesXml);
            return cmisXml.toXML();
        } else {
            return Misc.streamToString(inputStream, null, false);
        }
    } catch (IOException e) {
        throw new SenderException(e);
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) OutputStream(java.io.OutputStream) HttpServletResponse(javax.servlet.http.HttpServletResponse) IOException(java.io.IOException) Document(org.apache.chemistry.opencmis.client.api.Document) ContentStream(org.apache.chemistry.opencmis.commons.data.ContentStream) CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException) Iterator(java.util.Iterator) XmlBuilder(nl.nn.adapterframework.util.XmlBuilder) CmisObject(org.apache.chemistry.opencmis.client.api.CmisObject) SenderException(nl.nn.adapterframework.core.SenderException) Property(org.apache.chemistry.opencmis.client.api.Property)

Example 14 with Document

use of org.apache.chemistry.opencmis.client.api.Document in project alfresco-repository by Alfresco.

the class OpenCmisLocalTest method testCancelCheckoutWhileInCheckedOutState.

/**
 * MNT-14687 - Creating a document as checkedout and then cancelling the
 * checkout should delete the document.
 *
 * This test would have fit better within CheckOutCheckInServiceImplTest but
 * was added here to make use of existing methods
 */
public void testCancelCheckoutWhileInCheckedOutState() {
    ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
    CheckOutCheckInService cociService = serviceRegistry.getCheckOutCheckInService();
    // Authenticate as system
    AuthenticationComponent authenticationComponent = (AuthenticationComponent) ctx.getBean(BEAN_NAME_AUTHENTICATION_COMPONENT);
    authenticationComponent.setSystemUserAsCurrentUser();
    /* Create the document using openCmis services */
    Repository repository = getRepository("admin", "admin");
    Session session = repository.createSession();
    Folder rootFolder = session.getRootFolder();
    // Set file properties
    String docname = "myDoc-" + GUID.generate() + ".txt";
    Map<String, String> props = new HashMap<String, String>();
    {
        props.put(PropertyIds.OBJECT_TYPE_ID, BaseTypeId.CMIS_DOCUMENT.value());
        props.put(PropertyIds.NAME, docname);
    }
    // Create some content
    byte[] byteContent = "Some content".getBytes();
    InputStream stream = new ByteArrayInputStream(byteContent);
    ContentStream contentStream = new ContentStreamImpl(docname, BigInteger.valueOf(byteContent.length), MIME_PLAIN_TEXT, stream);
    // Create the document
    Document doc1 = rootFolder.createDocument(props, contentStream, VersioningState.CHECKEDOUT);
    NodeRef doc1NodeRef = cmisIdToNodeRef(doc1.getId());
    NodeRef doc1WorkingCopy = cociService.getWorkingCopy(doc1NodeRef);
    /* Cancel Checkout */
    cociService.cancelCheckout(doc1WorkingCopy);
    /* Check if both the working copy and the document were deleted */
    NodeService nodeService = serviceRegistry.getNodeService();
    assertFalse(nodeService.exists(doc1NodeRef));
    assertFalse(nodeService.exists(doc1WorkingCopy));
}
Also used : ContentStreamImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl) HashMap(java.util.HashMap) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) NodeService(org.alfresco.service.cmr.repository.NodeService) Folder(org.apache.chemistry.opencmis.client.api.Folder) Document(org.apache.chemistry.opencmis.client.api.Document) NodeRef(org.alfresco.service.cmr.repository.NodeRef) Repository(org.apache.chemistry.opencmis.client.api.Repository) ContentStream(org.apache.chemistry.opencmis.commons.data.ContentStream) CheckOutCheckInService(org.alfresco.service.cmr.coci.CheckOutCheckInService) AuthenticationComponent(org.alfresco.repo.security.authentication.AuthenticationComponent) ByteArrayInputStream(java.io.ByteArrayInputStream) ServiceRegistry(org.alfresco.service.ServiceRegistry) Session(org.apache.chemistry.opencmis.client.api.Session)

Example 15 with Document

use of org.apache.chemistry.opencmis.client.api.Document in project iaf by ibissource.

the class CmisSender method sendMessageForActionCreate.

private Message sendMessageForActionCreate(Session cmisSession, Message message, PipeLineSession session, ParameterValueList pvl) throws SenderException {
    String fileName = null;
    try {
        fileName = session.getMessage(getParameterOverriddenAttributeValue(pvl, "filenameSessionKey", getFilenameSessionKey())).asString();
    } catch (IOException e) {
        throw new SenderException("Unable to get filename from session key [" + getFilenameSessionKey() + "]", e);
    }
    String mediaType;
    Map<String, Object> props = new HashMap<String, Object>();
    Element cmisElement;
    try {
        if (XmlUtils.isWellFormed(message, "cmis")) {
            cmisElement = XmlUtils.buildElement(message);
        } else {
            cmisElement = XmlUtils.buildElement("<cmis/>");
        }
        String objectTypeId = XmlUtils.getChildTagAsString(cmisElement, "objectTypeId");
        if (StringUtils.isNotEmpty(objectTypeId)) {
            props.put(PropertyIds.OBJECT_TYPE_ID, objectTypeId);
        } else {
            props.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
        }
        String name = XmlUtils.getChildTagAsString(cmisElement, "name");
        if (StringUtils.isEmpty(fileName)) {
            fileName = XmlUtils.getChildTagAsString(cmisElement, "fileName");
        }
        mediaType = XmlUtils.getChildTagAsString(cmisElement, "mediaType");
        if (StringUtils.isNotEmpty(name)) {
            props.put(PropertyIds.NAME, name);
        } else if (StringUtils.isNotEmpty(fileName)) {
            props.put(PropertyIds.NAME, fileName);
        } else {
            props.put(PropertyIds.NAME, "[unknown]");
        }
        Element propertiesElement = XmlUtils.getFirstChildTag(cmisElement, "properties");
        if (propertiesElement != null) {
            processProperties(propertiesElement, props);
        }
    } catch (DomBuilderException e) {
        throw new SenderException(getLogPrefix() + "exception parsing [" + message + "]", e);
    }
    if (StringUtils.isEmpty(mediaType)) {
        mediaType = getDefaultMediaType();
    }
    ContentStream contentStream;
    try {
        Message inputFromSessionKey = session.getMessage(getParameterOverriddenAttributeValue(pvl, "fileSessionKey", getFileSessionKey()));
        if (convert2Base64 && inputFromSessionKey.asObject() instanceof String) {
            inputFromSessionKey = new Message(Base64.decodeBase64(inputFromSessionKey.asByteArray()));
        }
        long fileLength = inputFromSessionKey.size();
        contentStream = cmisSession.getObjectFactory().createContentStream(fileName, fileLength, mediaType, inputFromSessionKey.asInputStream());
    } catch (IOException e) {
        throw new SenderException(e);
    }
    if (isUseRootFolder()) {
        Folder folder = cmisSession.getRootFolder();
        Document document = folder.createDocument(props, contentStream, VersioningState.NONE);
        log.debug(getLogPrefix() + "created new document [ " + document.getId() + "]");
        return new Message(document.getId());
    }
    ObjectId objectId = cmisSession.createDocument(props, null, contentStream, VersioningState.NONE);
    log.debug(getLogPrefix() + "created new document [ " + objectId.getId() + "]");
    return new Message(objectId.getId());
}
Also used : Message(nl.nn.adapterframework.stream.Message) HashMap(java.util.HashMap) ObjectId(org.apache.chemistry.opencmis.client.api.ObjectId) Element(org.w3c.dom.Element) IOException(java.io.IOException) Folder(org.apache.chemistry.opencmis.client.api.Folder) Document(org.apache.chemistry.opencmis.client.api.Document) ContentStream(org.apache.chemistry.opencmis.commons.data.ContentStream) CmisObject(org.apache.chemistry.opencmis.client.api.CmisObject) DomBuilderException(nl.nn.adapterframework.util.DomBuilderException) SenderException(nl.nn.adapterframework.core.SenderException)

Aggregations

Document (org.apache.chemistry.opencmis.client.api.Document)101 Folder (org.apache.chemistry.opencmis.client.api.Folder)62 HashMap (java.util.HashMap)43 CmisObject (org.apache.chemistry.opencmis.client.api.CmisObject)41 CmisTestResult (org.apache.chemistry.opencmis.tck.CmisTestResult)40 ContentStream (org.apache.chemistry.opencmis.commons.data.ContentStream)36 ContentStreamImpl (org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl)30 CmisObjectNotFoundException (org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException)28 ByteArrayInputStream (java.io.ByteArrayInputStream)27 ObjectId (org.apache.chemistry.opencmis.client.api.ObjectId)25 DocumentTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition)23 CmisConstraintException (org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException)21 CmisInvalidArgumentException (org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException)20 ArrayList (java.util.ArrayList)19 Test (org.junit.Test)19 InputStream (java.io.InputStream)18 NodeRef (org.alfresco.service.cmr.repository.NodeRef)17 CmisPermissionDeniedException (org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException)17 AlfrescoDocument (org.alfresco.cmis.client.AlfrescoDocument)16 VersionableAspectTest (org.alfresco.repo.version.VersionableAspectTest)16