Package org.apache.chemistry.opencmis.commons.data

Examples of org.apache.chemistry.opencmis.commons.data.ObjectData


        Holder<String> changeTokenHolder = (changeToken == null ? null : new Holder<String>(changeToken));
        service.deleteContentStream(repositoryId, objectIdHolder, changeTokenHolder, null);

        String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());

        ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
        if (object == null) {
            throw new CmisRuntimeException("Object is null!");
        }

        response.setStatus(HttpServletResponse.SC_OK);
View Full Code Here


        service.setContentStream(repositoryId, objectIdHolder, overwriteFlag, changeTokenHolder,
                createContentStream(request), null);

        String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());

        ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
        if (object == null) {
            throw new CmisRuntimeException("Object is null!");
        }

        // set headers
View Full Code Here

        Holder<String> objectIdHolder = new Holder<String>(objectId);
        service.moveObject(repositoryId, objectIdHolder, targetFolderId, sourceFolderId, null);

        String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());

        ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
        if (object == null) {
            throw new CmisRuntimeException("Object is null!");
        }

        // set headers
View Full Code Here

        if (entry.getId() == null) {
            throw new CmisConnectionException("Received Atom entry is not a CMIS entry!");
        }

        lockLinks();
        ObjectData result = null;
        try {
            // clean up cache
            removeLinks(repositoryId, entry.getId());

            // walk through the entry
View Full Code Here

        if (callUrl != CallUrl.ROOT) {
            return;
        }

        ObjectData object = null;

        if (objectId != null) {
            object = service.getObject(repositoryId, objectId, "cmis:objectId,cmis:objectTypeId,cmis:baseTypeId",
                    false, IncludeRelationships.NONE, "cmis:none", false, false, null);
        } else {
            object = service.getObjectByPath(repositoryId, getPath(request),
                    "cmis:objectId,cmis:objectTypeId,cmis:baseTypeId", false, IncludeRelationships.NONE, "cmis:none",
                    false, false, null);
        }

        if (contextImpl != null) {
            contextImpl.put(CONTEXT_OBJECT_ID, object.getId());
            contextImpl.put(CONTEXT_OBJECT_TYPE_ID, getProperty(object, PropertyIds.OBJECT_TYPE_ID, String.class));
            contextImpl.put(CONTEXT_BASETYPE_ID, getProperty(object, PropertyIds.BASE_TYPE_ID, String.class));
        }
    }
View Full Code Here

        // get parameters
        String objectId = (String) context.get(CONTEXT_OBJECT_ID);
        String filter = getStringParameter(request, PARAM_FILTER);

        // execute
        ObjectData parent = service.getFolderParent(repositoryId, objectId, filter, null);

        if (parent == null) {
            throw new CmisRuntimeException("Parent is null!");
        }
View Full Code Here

        }
        assertEquals(1024, counter);
    }

    protected String getByPath(String id, String path) {
        ObjectData res = null;
        try {
            res = fObjSvc.getObjectByPath(fRepositoryId, path, "*", false, IncludeRelationships.NONE, null, false,
                    false, null);
            assertNotNull(res);
            assertEquals(id, res.getId());
        } catch (Exception e) {
            fail("getObject() failed with exception: " + e);
        }
        return res.getId();
    }
View Full Code Here

        path = pd.getFirstValue() + "/" + name;
        return path;
    }

    protected ObjectData getDocumentObjectData(String id) {
        ObjectData res = null;
        try {
            String returnedId = null;
            res = fObjSvc.getObject(fRepositoryId, id, "*", false, IncludeRelationships.NONE, null, false, false, null);
            assertNotNull(res);
            returnedId = res.getId();
            testReturnedProperties(returnedId, res.getProperties().getProperties());
            assertEquals(id, returnedId);
        } catch (Exception e) {
            fail("getObject() failed with exception: " + e);
        }
        return res;
View Full Code Here

        }
        return res;
    }

    protected String getDocument(String id) {
        ObjectData res = getDocumentObjectData(id);
        assertNotNull(res);
        return res.getId();
    }
View Full Code Here

        // execute
        Holder<String> checkOutId = new Holder<String>(objectId);
        service.checkOut(repositoryId, checkOutId, null, null);

        ObjectData object = getSimpleObject(service, repositoryId, checkOutId.getValue());
        if (object == null) {
            throw new CmisRuntimeException("PWC is null!");
        }

        // return object
        TypeCache typeCache = new TypeCache(repositoryId, service);
        JSONObject jsonObject = JSONConverter.convert(object, typeCache);

        // set headers
        String location = compileUrl(compileBaseUrl(request, repositoryId), RESOURCE_CONTENT, object.getId());

        response.setStatus(HttpServletResponse.SC_CREATED);
        response.setHeader("Location", location);

        response.setStatus(HttpServletResponse.SC_CREATED);
        setCookie(request, response, repositoryId, transaction,
                createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));

        writeJSON(jsonObject, request, response);
    }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.data.ObjectData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.