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

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


        log.info("starting testAllowableActions() ...");
        final boolean withContent = false;
        String id = createDocument(fRootFolderId, withContent);

        // get allowable actions via getObject
        ObjectData res = fObjSvc.getObject(fRepositoryId, id, "*", true, IncludeRelationships.NONE, null, false, false,
                null);
        assertNotNull(res.getAllowableActions());
        Set<Action> actions = res.getAllowableActions().getAllowableActions();
        assertNotNull(actions);
        verifyAllowableActionsDocument(actions, false, withContent);

        // get allowable actions via getAllowableActions
        AllowableActions allowableActions = fObjSvc.getAllowableActions(fRepositoryId, id, null);
View Full Code Here


        log.info("starting testDefaultPropertiesDocument() ...");
        String id = createDocument("DefPropDoc", fRootFolderId, TEST_DOC_TYPE_WITH_DEFAULTS_ID, false);
        if (id != null) {
            log.info("createDocument succeeded with created id: " + id);
        }
        ObjectData res = getDocumentObjectData(id);
        Map<String, PropertyData<?>> props = res.getProperties().getProperties();
        PropertyData<?> pd =  props.get(TEST_DOCUMENT_MY_INT_PROP_ID);
        assertNotNull(pd);
        Object bi = pd.getFirstValue();
        assertNotNull(bi);
        assertEquals(BigInteger.valueOf(100), bi);
View Full Code Here

        log.info("starting testDefaultPropertiesFolder() ...");
        String id = createFolder("DefPropFolder", fRootFolderId, TEST_FOLDER_TYPE_WITH_DEFAULTS_ID);
        if (id != null) {
            log.info("createDocument succeeded with created id: " + id);
        }
        ObjectData res = getDocumentObjectData(id);
        Map<String, PropertyData<?>> props = res.getProperties().getProperties();
        PropertyData<?> pd =  props.get(TEST_FOLDER_MY_INT_PROP_ID);
        assertNotNull(pd);
        Object bi = pd.getFirstValue();
        assertNotNull(bi);
        assertEquals(BigInteger.valueOf(100), bi);
View Full Code Here

            log.info("  createDocument succeeded with created id: " + id);
        }

        log.info("  getting object");
        String filter = PropertyIds.NAME + "," + PropertyIds.CREATION_DATE + "," + PropertyIds.LAST_MODIFICATION_DATE;
        ObjectData res = fObjSvc.getObject(fRepositoryId, id, filter, false, IncludeRelationships.NONE, null, false, false, null);

        String returnedId = res.getId();
        assertEquals(id, returnedId);
        log.info("... testGetObjectNoObjectIdInFilter() finished.");
    }
View Full Code Here

        assertFalse(actions.contains(Action.CAN_GET_ACL));
        assertFalse(actions.contains(Action.CAN_APPLY_ACL));
    }

    private String retrieveDocument(String id) {
        ObjectData res = getDocumentObjectData(id);
        String returnedId = res.getId();
        testReturnedProperties(returnedId, DOCUMENT_ID, DOCUMENT_TYPE_ID, res.getProperties().getProperties());
        return returnedId;
    }
View Full Code Here

            compileObjectType(context, file, null, false, false, userReadOnly, objectInfos);
        }

        // get parent folder
        File parent = file.getParentFile();
        ObjectData object = compileObjectType(context, parent, filterCollection, iaa, false, userReadOnly, objectInfos);

        ObjectParentDataImpl result = new ObjectParentDataImpl();
        result.setObject(object);
        if (irps) {
            result.setRelativePathSegment(file.getName());
View Full Code Here

            String objectId = getObjectId();

            OperationContext oc = getCreationContext();

            // get the latest data from the repository
            ObjectData objectData = getSession()
                    .getBinding()
                    .getObjectService()
                    .getObject(getRepositoryId(), objectId, oc.getFilterString(), oc.isIncludeAllowableActions(),
                            oc.getIncludeRelationships(), oc.getRenditionFilterString(), oc.isIncludePolicies(),
                            oc.isIncludeAcls(), null);
View Full Code Here

                createContentStream(request), checkinComment, createPolicies(cp), createAddAcl(cp),
                createRemoveAcl(cp), null);

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

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

        // return object
        JSONObject jsonObject = JSONConverter.convert(object, typeCache);

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

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

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

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

            for (StoredObject checkedOut : checkedOuts) {
                TypeDefinition td = fStoreManager.getTypeById(repositoryId, checkedOut.getTypeId()).getTypeDefinition();
//                DocumentVersion workingCopy = ((VersionedDocument) checkedOut).getPwc();
//                if (null == workingCopy)
//                  throw new CmisConstraintException("document " + checkedOut + " is checked out but has no working copy");      
                ObjectData od = PropertyCreationHelper.getObjectData(td, checkedOut, filter, user,
                        includeAllowableActions, includeRelationships, renditionFilter, false, false, extension);
                if (context.isObjectInfoRequired()) {
                    ObjectInfoImpl objectInfo = new ObjectInfoImpl();
                    fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, /* workingCopy */ checkedOut, objectInfo);
                    objectInfos.addObjectInfo(objectInfo);
                }
                odList.add(od);
            }
        } else {
            ObjectInFolderList children = getChildrenIntern(repositoryId, folderId, filter, orderBy,
                    includeAllowableActions, includeRelationships, renditionFilter, false, -1, -1, false, context
                            .isObjectInfoRequired() ? objectInfos : null, user);
            for (ObjectInFolderData child : children.getObjects()) {
                ObjectData obj = child.getObject();
                StoredObject so = fStoreManager.getObjectStore(repositoryId).getObjectById(obj.getId());
                LOG.info("Checked out: children:" + obj.getId());
                if (so instanceof DocumentVersion && ((DocumentVersion) so).getParentDocument().isCheckedOut()) {
                    odList.add(obj);
                    if (context.isObjectInfoRequired()) {
                        ObjectInfoImpl objectInfo = new ObjectInfoImpl();
                        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
View Full Code Here

        } else {
            throw new CmisInvalidArgumentException("Can't get folder parent, id does not refer to a folder: "
                    + folderId);
        }

        ObjectData res = getFolderParentIntern(repositoryId, folder, filter, false,
            IncludeRelationships.NONE, context.getUsername(), context.isObjectInfoRequired() ? objectInfos : null);
        if (res == null) {
            throw new CmisInvalidArgumentException("Cannot get parent of a root folder");
        }
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.