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

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


        }
        log.info("... testCreateObject() finished.");

        // test create a document with a folder type, should fail:
        try {
            Properties props = createDocumentProperties("DocumentWithAFolderType", FOLDER_TYPE_ID);
            id = fObjSvc.createDocument(fRepositoryId, props, fRootFolderId, null, VersioningState.NONE, null, null,
                    null, null);
            assertNotNull(id);
            fail("Creating  document with a folder type should fail.");
        } catch (Exception e) {
            log.info("Creating  document with a folder type failed as expected.");
        }
        // test create a document with an illegal name, should fail:
        try {
            Properties props = createDocumentProperties("abc ()", DOCUMENT_TYPE_ID);
            fObjSvc.createDocument(fRepositoryId, props, fRootFolderId, null, VersioningState.NONE, null, null,
                    null, null);
            fail("Creating  document with an illegal name should fail.");
        } catch (Exception e) {
            assertTrue(e instanceof CmisInvalidArgumentException);
View Full Code Here


        List<String> policies = null;
        Acl addACEs = null;
        Acl removeACEs = null;
        ExtensionsData extension = null;

        Properties props = createDocumentProperties(DOCUMENT_ID, DOCUMENT_TYPE_ID);

        contentStream = (ContentStreamDataImpl) createContent();
        contentStream.setFileName(null);
        contentStream.setMimeType(null);
View Full Code Here

        String id1 = createDocument(fRootFolderId, true);
        // create a second document with first as source
        String id2 = null;
        try {
            VersioningState versioningState = VersioningState.NONE;
            Properties props = createDocumentPropertiesForDocumentFromSource("Document From Source");
            id2 = fObjSvc.createDocumentFromSource(fRepositoryId, id1, props, fRootFolderId, versioningState, null,
                    null, null, null);
            if (null == id2) {
                fail("createDocumentFromSource failed.");
            }
View Full Code Here

            // properties.add(fFactory.createPropertyIdData(PropertyIds.
            // CMIS_OBJECT_TYPE_ID, TEST_CUSTOM_DOCUMENT_TYPE_ID));
            // Generate some property values for custom attributes
            properties.add(fFactory.createPropertyStringData(TEST_DOCUMENT_MY_STRING_PROP_ID, newStringPropVal));
            properties.add(fFactory.createPropertyIntegerData(TEST_DOCUMENT_MY_INT_PROP_ID, newIntPropVal));
            Properties newProps = fFactory.createPropertiesData(properties);

            Holder<String> idHolder = new Holder<String>(id);
            Holder<String> changeTokenHolder = new Holder<String>();
            fObjSvc.updateProperties(fRepositoryId, idHolder, changeTokenHolder, newProps, null);
            oldChangeToken = changeTokenHolder.getValue(); // store for later
View Full Code Here

        // We only provide a name but not a type id, as spec says to copy
        // missing attributes
        // from the existing one
        List<PropertyData<?>> properties = new ArrayList<PropertyData<?>>();
        properties.add(fFactory.createPropertyIdData(PropertyIds.NAME, name));
        Properties props = fFactory.createPropertiesData(properties);
        return props;
    }
View Full Code Here

        properties.add(fFactory.createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, TEST_CUSTOM_DOCUMENT_TYPE_ID));
        // Generate some property values for custom attributes
        properties.add(fFactory.createPropertyStringData(TEST_DOCUMENT_MY_STRING_PROP_ID, "My pretty string"));
        properties.add(fFactory.createPropertyIntegerData(TEST_DOCUMENT_MY_INT_PROP_ID, BigInteger.valueOf(4711)));

        Properties props = fFactory.createPropertiesData(properties);

        if (withContent) {
            contentStream = createContent();
        }
View Full Code Here

        properties.add(fFactory.createPropertyStringData(TEST_DOCUMENT_MY_STRING_PROP_ID, "My pretty string"));
        properties.add(fFactory.createPropertyIntegerData(TEST_DOCUMENT_MY_INT_PROP_ID, BigInteger.valueOf(4711)));
        properties.add(fFactory.createPropertyStringData(TEST_DOCUMENT_MY_SUB_STRING_PROP_ID, "another cool string"));
        properties.add(fFactory.createPropertyIntegerData(TEST_DOCUMENT_MY_SUB_INT_PROP_ID, BigInteger.valueOf(4712)));

        Properties props = fFactory.createPropertiesData(properties);

        if (withContent) {
            contentStream = createContent();
        }
View Full Code Here

                    + e1.getClass().getName() + ").");
        }

        try {
            ContentStream contentStream = createContent(MAX_SIZE + 1);
            Properties props = createDocumentProperties("TestMaxContentSize", DOCUMENT_TYPE_ID);
            fObjSvc.createDocument(fRepositoryId, props, fRootFolderId, contentStream, VersioningState.NONE, null,
                    null, null, null);
            fail("createDocument with exceeded content size should fail.");
        } catch (CmisInvalidArgumentException e) {
            log.debug("createDocument with exceeded failed as excpected.");
View Full Code Here

        }

        List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);

        TypeDefinition td = fStoreManager.getTypeById(repositoryId, latestVersionObject.getTypeId()).getTypeDefinition();
        Properties props = PropertyCreationHelper.getPropertiesFromObject(latestVersionObject, td,
                requestedIds, true);

        return props;
    }
View Full Code Here

        for (int i = 0; i < NUM_ROOT_FOLDERS; i++) {
            List<PropertyData<?>> properties = new ArrayList<PropertyData<?>>();
            properties.add(fFactory.createPropertyIdData(PropertyIds.NAME, "Folder " + i));
            properties.add(fFactory.createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, InMemoryFolderTypeDefinition
                    .getRootFolderType().getId()));
            Properties props = fFactory.createPropertiesData(properties);
            String id = fObjSvc.createFolder(fRepositoryId, props, fRootFolderId, null, null, null, null);
            if (i == 3) {
                fLevel1FolderId = id;
            }
        }
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.