Examples of DocumentTypeDefinition


Examples of org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition

        CmisTypeDefinitionType result = null;

        if (typeDefinition instanceof DocumentTypeDefinition) {
            result = new CmisTypeDocumentDefinitionType();

            DocumentTypeDefinition docTypeDefintion = (DocumentTypeDefinition) typeDefinition;
            ((CmisTypeDocumentDefinitionType) result).setVersionable(convertBoolean(docTypeDefintion.isVersionable(),
                    false));
            ((CmisTypeDocumentDefinitionType) result).setContentStreamAllowed(convert(EnumContentStreamAllowed.class,
                    docTypeDefintion.getContentStreamAllowed()));
        } else if (typeDefinition instanceof FolderTypeDefinition) {
            result = new CmisTypeFolderDefinitionType();
        } else if (typeDefinition instanceof RelationshipTypeDefinition) {
            result = new CmisTypeRelationshipDefinitionType();
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition

            Map<String, PropertyData<?>> props, String checkinComment) {
        for (PropertyData<?> pd : props.values()) {
            log.info("return property id: " + pd.getId() + ", value: " + pd.getValues());
        }

        DocumentTypeDefinition typeDef = (DocumentTypeDefinition) fRepSvc.getTypeDefinition(fRepositoryId,
                VersionTestTypeSystemCreator.VERSION_TEST_DOCUMENT_TYPE_ID, null);
        PropertyBoolean pdb = (PropertyBoolean) props.get(PropertyIds.IS_LATEST_VERSION);
        assertNotNull(pdb);
        boolean bVal = pdb.getFirstValue();
        assertEquals(versioningState != VersioningState.CHECKEDOUT, bVal); // if
        // checked
        // out
        // it
        // isn
        // 't
        // the
        // latest
        // version

        pdb = (PropertyBoolean) props.get(PropertyIds.IS_MAJOR_VERSION);
        assertNotNull(pdb);
        bVal = pdb.getFirstValue();
        assertEquals(versioningState == VersioningState.MAJOR, bVal);

        pdb = (PropertyBoolean) props.get(PropertyIds.IS_LATEST_MAJOR_VERSION);
        assertNotNull(pdb);
        bVal = pdb.getFirstValue();
        assertEquals(versioningState == VersioningState.MAJOR, bVal);

        PropertyId pdid = (PropertyId) props.get(PropertyIds.VERSION_SERIES_ID);
        assertNotNull(pdb);
        String sVal = pdid.getFirstValue();
        if (typeDef.isVersionable()) {
            assertFalse(docId.equals(sVal));
        } else {
            assertEquals(docId, sVal);
        }
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition

        CmisTypeDefinitionType result = null;

        if (typeDefinition instanceof DocumentTypeDefinition) {
            result = new CmisTypeDocumentDefinitionType();

            DocumentTypeDefinition docTypeDefintion = (DocumentTypeDefinition) typeDefinition;
            ((CmisTypeDocumentDefinitionType) result).setVersionable(convertBoolean(docTypeDefintion.isVersionable(),
                    false));
            ((CmisTypeDocumentDefinitionType) result).setContentStreamAllowed(convert(EnumContentStreamAllowed.class,
                    docTypeDefintion.getContentStreamAllowed()));
        } else if (typeDefinition instanceof FolderTypeDefinition) {
            result = new CmisTypeFolderDefinitionType();
        } else if (typeDefinition instanceof RelationshipTypeDefinition) {
            result = new CmisTypeRelationshipDefinitionType();
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition

            f = createResult(WARNING, "Type description is not set!");
            addResult(results, assertStringNotEmpty(type.getDescription(), null, f));

            if (BaseTypeId.CMIS_DOCUMENT.equals(type.getBaseTypeId())) {
                DocumentTypeDefinition docType = (DocumentTypeDefinition) type;

                f = createResult(FAILURE, "Versionable flag is not set!");
                addResult(results, assertNotNull(docType.isVersionable(), null, f));

                f = createResult(FAILURE, "Content stream allowed flag is not set!");
                addResult(results, assertNotNull(docType.getContentStreamAllowed(), null, f));
            } else if (BaseTypeId.CMIS_FOLDER.equals(type.getBaseTypeId())) {
                if (type.isFileable() != null) {
                    f = createResult(FAILURE, "Folder types must be fileable!");
                    addResult(results, assertIsTrue(type.isFileable(), null, f));
                }
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition

                "My Type 8 Level 2", cmisType2);
        typesList.add(cmisType22);
        InMemoryDocumentTypeDefinition cmisType23 = new InMemoryDocumentTypeDefinition("MyDocType2.3",
                "My Type 9 Level 2", cmisType2);
        typesList.add(cmisType23);
        DocumentTypeDefinition cmisType24 = new InMemoryDocumentTypeDefinition("MyDocType2.4", "My Type 10 Level 2",
                cmisType2);
        typesList.add(cmisType24);
        InMemoryDocumentTypeDefinition cmisType25 = new InMemoryDocumentTypeDefinition("MyDocType2.5",
                "My Type 11 Level 2", cmisType2);
        typesList.add(cmisType25);
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition

                queryableBox.setSelected(is(type.isQueryable()));
                aclBox.setSelected(is(type.isControllableAcl()));
                policyBox.setSelected(is(type.isControllablePolicy()));

                if (type instanceof DocumentTypeDefinition) {
                    DocumentTypeDefinition docType = (DocumentTypeDefinition) type;
                    versionableBox.setVisible(true);
                    versionableBox.setSelected(is(docType.isVersionable()));
                    contentStreamAllowedField.setVisible(true);
                    contentStreamAllowedField.setText(docType.getContentStreamAllowed() == null ? "???" : docType
                            .getContentStreamAllowed().toString());
                } else {
                    versionableBox.setVisible(false);
                    contentStreamAllowedField.setVisible(false);
                }
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition

        CmisTypeDefinitionType result = null;

        if (typeDefinition instanceof DocumentTypeDefinition) {
            result = new CmisTypeDocumentDefinitionType();

            DocumentTypeDefinition docTypeDefintion = (DocumentTypeDefinition) typeDefinition;
            ((CmisTypeDocumentDefinitionType) result).setVersionable(convertBoolean(docTypeDefintion.isVersionable(),
                    false));
            ((CmisTypeDocumentDefinitionType) result).setContentStreamAllowed(convert(EnumContentStreamAllowed.class,
                    docTypeDefintion.getContentStreamAllowed()));
        } else if (typeDefinition instanceof FolderTypeDefinition) {
            result = new CmisTypeFolderDefinitionType();
        } else if (typeDefinition instanceof RelationshipTypeDefinition) {
            result = new CmisTypeRelationshipDefinitionType();
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition

        typeBox = new JComboBox(getTypes(BaseTypeId.CMIS_DOCUMENT.value()));
        typeBox.setSelectedIndex(0);
        typeBox.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                DocumentTypeDefinition type = (DocumentTypeDefinition) ((ObjectTypeItem) typeBox.getSelectedItem())
                        .getObjectType();
                if (type.isVersionable()) {
                    versioningStateBox.setSelectedItem(VersioningState.MAJOR);
                } else {
                    versioningStateBox.setSelectedItem(VersioningState.NONE);
                }
            }
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition

            f = createResult(WARNING, "Type description is not set!");
            addResult(results, assertStringNotEmpty(type.getDescription(), null, f));

            if (BaseTypeId.CMIS_DOCUMENT.equals(type.getBaseTypeId())) {
                DocumentTypeDefinition docType = (DocumentTypeDefinition) type;

                f = createResult(FAILURE, "Versionable flag is not set!");
                addResult(results, assertNotNull(docType.isVersionable(), null, f));

                f = createResult(FAILURE, "Content stream allowed flag is not set!");
                addResult(results, assertNotNull(docType.getContentStreamAllowed(), null, f));
            } else if (BaseTypeId.CMIS_FOLDER.equals(type.getBaseTypeId())) {
                // nothing to do
            } else if (BaseTypeId.CMIS_RELATIONSHIP.equals(type.getBaseTypeId())) {
                RelationshipTypeDefinition relType = (RelationshipTypeDefinition) type;
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition

            Map<String, PropertyData<?>> props, String checkinComment) {
        for (PropertyData<?> pd : props.values()) {
            log.info("return property id: " + pd.getId() + ", value: " + pd.getValues());
        }

        DocumentTypeDefinition typeDef = (DocumentTypeDefinition) fRepSvc.getTypeDefinition(fRepositoryId,
                VersionTestTypeSystemCreator.VERSION_TEST_DOCUMENT_TYPE_ID, null);
        PropertyBoolean pdb = (PropertyBoolean) props.get(PropertyIds.IS_LATEST_VERSION);
        assertNotNull(pdb);
        boolean bVal = pdb.getFirstValue();
        assertEquals(versioningState != VersioningState.CHECKEDOUT, bVal); // if
        // checked
        // out
        // it
        // isn
        // 't
        // the
        // latest
        // version

        pdb = (PropertyBoolean) props.get(PropertyIds.IS_MAJOR_VERSION);
        assertNotNull(pdb);
        bVal = pdb.getFirstValue();
        assertEquals(versioningState == VersioningState.MAJOR, bVal);

        pdb = (PropertyBoolean) props.get(PropertyIds.IS_LATEST_MAJOR_VERSION);
        assertNotNull(pdb);
        bVal = pdb.getFirstValue();
        assertEquals(versioningState == VersioningState.MAJOR, bVal);

        PropertyId pdid = (PropertyId) props.get(PropertyIds.VERSION_SERIES_ID);
        assertNotNull(pdb);
        String sVal = pdid.getFirstValue();
        if (typeDef.isVersionable())
            assertFalse(docId.equals(sVal));
        else
            assertEquals(docId, sVal);

        pdb = (PropertyBoolean) props.get(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.