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

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


            throw new CmisObjectNotFoundException("Illegal object id: null");
        }

        // build properties collection
        List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);
        Properties props = getPropertiesFromObject(so, typeDef, requestedIds, true);

        // fill output object
        if (null != includeAllowableActions && includeAllowableActions) {
            AllowableActions allowableActions = so.getAllowableActions(user);
            od.setAllowableActions(allowableActions);
View Full Code Here


            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter) {

        ObjectDataImpl od = new ObjectDataImpl();

        // build properties collection
        Properties props = getPropertiesFromObject(so, typeDef, requestedProperties, requestedFuncs);

        // fill output object
        if (null != includeAllowableActions && includeAllowableActions) {
            // AllowableActions allowableActions =
            // DataObjectCreator.fillAllowableActions(so, user);
View Full Code Here

        // series?
        fVerSvc.checkOut(fRepositoryId, idHolder, null, contentCopied);
        String pwcId = idHolder.getValue();
        // test that object is checked out and that all properties are set
        // correctly
        Properties props = fObjSvc.getProperties(fRepositoryId, pwcId, "*", null);
        String changeToken = (String) props.getProperties().get(PropertyIds.CHANGE_TOKEN).getFirstValue();
        checkVersionProperties(pwcId, VersioningState.CHECKEDOUT, props.getProperties(), null);

        // Test that a second checkout is not possible
        try {
            fVerSvc.checkOut(fRepositoryId, idHolder, null, contentCopied);
            fail("Checking out a document that is already checked-out should fail.");
View Full Code Here

        // series?
        fVerSvc.checkOut(fRepositoryId, idHolder, null, contentCopied);
        String pwcId = idHolder.getValue();

        ContentStream altContent = fCreator.createAlternateContent();
        Properties newProps = fCreator.getUpdatePropertyList(VersionTestTypeSystemCreator.PROPERTY_ID, PROP_VALUE_NEW);
        idHolder = new Holder<String>(pwcId);
//        assertTrue(isCheckedOut(docId));
        assertTrue(isCheckedOut(pwcId));

        // Test check-in and pass content and properties
View Full Code Here

        // series?
        fVerSvc.checkOut(fRepositoryId, idHolder, null, contentCopied);
        String pwcId = idHolder.getValue();

        // Set a new content and modify property
        Properties props = fObjSvc.getProperties(fRepositoryId, pwcId, "*", null);
        String changeToken = (String) props.getProperties().get(PropertyIds.CHANGE_TOKEN).getFirstValue();
        ContentStream altContent = fCreator.createAlternateContent();
        idHolder = new Holder<String>(pwcId);
        Holder<String> tokenHolder = new Holder<String>(changeToken);
        fObjSvc.setContentStream(fRepositoryId, idHolder, true, tokenHolder, altContent, null);
        fCreator.updateProperty(idHolder.getValue(), VersionTestTypeSystemCreator.PROPERTY_ID, PROP_VALUE_NEW);
View Full Code Here

        // series?
        fVerSvc.checkOut(fRepositoryId, idHolder, null, contentCopied);
        String pwcId = idHolder.getValue();

        ContentStream altContent = fCreator.createAlternateContent();
        Properties newProps = fCreator.getUpdatePropertyList(VersionTestTypeSystemCreator.PROPERTY_ID, PROP_VALUE_NEW);
        idHolder = new Holder<String>(pwcId);
//        assertTrue(isCheckedOut(docId));
        assertTrue(isCheckedOut(pwcId));

        // Test check-in and pass content and properties
        String checkinComment = "Checkin with content and properties.";
        fVerSvc.checkIn(fRepositoryId, idHolder, true, newProps, altContent, checkinComment, null, null, null, null);

        Properties latest = fVerSvc.getPropertiesOfLatestVersion(fRepositoryId, docId, docId, true, "*", null);
        assertNotNull(latest);

        checkVersionProperties(verId, versioningState, latest.getProperties(), checkinComment);
    }
View Full Code Here

        // series?
        fVerSvc.checkOut(fRepositoryId, idHolder, null, contentCopied);
        String pwcId = idHolder.getValue();

        ContentStream altContent = fCreator.createAlternateContent();
        Properties newProps = fCreator.getUpdatePropertyList(VersionTestTypeSystemCreator.PROPERTY_ID, PROP_VALUE_NEW);
        idHolder = new Holder<String>(pwcId);
//        assertTrue(isCheckedOut(docId));
        assertTrue(isCheckedOut(pwcId));

        // Test check-in and pass content and properties
View Full Code Here

        for (int i = 0; i < num; i++) {
            List<PropertyData<?>> properties = new ArrayList<PropertyData<?>>();
            properties.add(fFactory.createPropertyIdData(PropertyIds.NAME, "Folder " + i));
            properties.add(fFactory.createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, BaseTypeId.CMIS_FOLDER.value()));
            Properties props = fFactory.createPropertiesData(properties);
            String id = fObjSvc.createFolder(fRepositoryId, props, fRootFolderId, null, null, null, null);
            res[i] = id;
        }
        return res;
    }
View Full Code Here

        assertNotNull(sVal);
        return sVal;
    }

    private boolean isCheckedOut(String objectId) {
        Properties props = fObjSvc.getProperties(fRepositoryId, objectId, "*", null);
        return isCheckedOut(props.getProperties());
    }
View Full Code Here

        Holder<String> idHolder = new Holder<String>(verIdV1);
        Holder<Boolean> contentCopied = new Holder<Boolean>(false);
        fVerSvc.checkOut(fRepositoryId, idHolder, null, contentCopied);

        ContentStream content2 = createContent('a');
        Properties newProps = fCreator.getUpdatePropertyList(VersionTestTypeSystemCreator.PROPERTY_ID,
                "PropertyFromVersion2");
        idHolder = new Holder<String>(verIdV1);
        // Test check-in and pass content and properties
        String checkinComment = "Checkin from Unit Test-2.";
        fVerSvc.checkIn(fRepositoryId, idHolder, true, newProps, content2, checkinComment, null, null, null, null);
View Full Code Here

TOP

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

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.