Package org.apache.chemistry.opencmis.commons.impl.dataobjects

Examples of org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringDefinitionImpl


        private static InMemoryDocumentTypeDefinition createCustomInheritedType(InMemoryDocumentTypeDefinition baseType) {
            InMemoryDocumentTypeDefinition cmisDocumentType = new InMemoryDocumentTypeDefinition(
                    TEST_INHERITED_CUSTOM_DOCUMENT_TYPE_ID, "My Custom Document Type", baseType);
            Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            PropertyStringDefinitionImpl prop = PropertyCreationHelper.createStringDefinition(
                    TEST_DOCUMENT_MY_SUB_STRING_PROP_ID, "Subtype String Property");
            prop.setIsRequired(false);
            propertyDefinitions.put(prop.getId(), prop);

            PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(
                    TEST_DOCUMENT_MY_SUB_INT_PROP_ID, "Subtype");
            prop2.setIsRequired(true);
            propertyDefinitions.put(prop2.getId(), prop2);
View Full Code Here


        private static InMemoryDocumentTypeDefinition createDocumentTypeWithDefault() {
            InMemoryDocumentTypeDefinition cmisDocumentType = new InMemoryDocumentTypeDefinition(
                    TEST_DOC_TYPE_WITH_DEFAULTS_ID, "Document Type With default values", InMemoryDocumentTypeDefinition
                    .getRootDocumentType());
            Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            PropertyStringDefinitionImpl prop = PropertyCreationHelper.createStringMultiDefinition(
                    TEST_DOCUMENT_MY_MULTI_STRING_PROP_ID, "Test Multi String Property");
            prop.setIsRequired(false);
            List<String> defValS = new ArrayList<String>() {{ add("Apache"); add("CMIS"); }};
            prop.setDefaultValue(defValS);
            propertyDefinitions.put(prop.getId(), prop);

            PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(
                    TEST_DOCUMENT_MY_INT_PROP_ID, "Test Integer Property");
            prop2.setIsRequired(false);
            List<BigInteger> defVal = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
View Full Code Here

        private static InMemoryFolderTypeDefinition createFolderTypeWithDefault() {
            InMemoryFolderTypeDefinition cmisFolderType = new InMemoryFolderTypeDefinition(
                    TEST_FOLDER_TYPE_WITH_DEFAULTS_ID, "Folder Type With default values", InMemoryFolderTypeDefinition.
                    getRootFolderType());
            Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            PropertyStringDefinitionImpl prop = PropertyCreationHelper.createStringMultiDefinition(
                    TEST_FOLDER_MY_MULTI_STRING_PROP_ID, "Test Multi String Property");
            prop.setIsRequired(false);
            List<String> defValS = new ArrayList<String>() {{ add("Apache"); add("CMIS"); }};
            prop.setDefaultValue(defValS);
            propertyDefinitions.put(prop.getId(), prop);

            PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(
                    TEST_FOLDER_MY_INT_PROP_ID, "Test Integer Property");
            prop2.setIsRequired(false);
            List<BigInteger> defVal = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
View Full Code Here

        InMemoryDocumentTypeDefinition cmisSuperType = new InMemoryDocumentTypeDefinition(DOC_TYPE_SUPER,
                "Document Type With a child", InMemoryDocumentTypeDefinition.getRootDocumentType());

        Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        // create a String property definition
        PropertyStringDefinitionImpl propDef = PropertyCreationHelper.createStringDefinition(STRING_PROP_TYPE_SUPER,
                "Sample String Property SuperType");
        propDef.setMaxLength(BigInteger.valueOf(10));
        propertyDefinitions.put(propDef.getId(), propDef);
        cmisSuperType.setPropertyDefinitions(propertyDefinitions);

        // create sub type
        InMemoryDocumentTypeDefinition cmisSubType = new InMemoryDocumentTypeDefinition(DOC_TYPE_SUB,
                "Document Type With a parent", cmisSuperType);

        propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        // create a String property definition
        propDef = PropertyCreationHelper.createStringDefinition(STRING_PROP_TYPE_SUB, "Sample String Property Subtype");
        propDef.setMaxLength(BigInteger.valueOf(20));
        propertyDefinitions.put(propDef.getId(), propDef);
        cmisSubType.setPropertyDefinitions(propertyDefinitions);

        tm.addTypeDefinition(cmisSuperType);
        tm.addTypeDefinition(cmisSubType);
View Full Code Here

        createStandardDefinition(prop, id, PropertyType.INTEGER, displayName, Cardinality.MULTI);
        return prop;
    }

    public static PropertyStringDefinitionImpl createStringDefinition(String id, String displayName) {
        PropertyStringDefinitionImpl prop = new PropertyStringDefinitionImpl();
        createStandardDefinition(prop, id, PropertyType.STRING, displayName, Cardinality.SINGLE);
        return prop;
    }
View Full Code Here

        createStandardDefinition(prop, id, PropertyType.STRING, displayName, Cardinality.SINGLE);
        return prop;
    }

    public static PropertyStringDefinitionImpl createStringMultiDefinition(String id, String displayName) {
        PropertyStringDefinitionImpl prop = new PropertyStringDefinitionImpl();
        createStandardDefinition(prop, id, PropertyType.STRING, displayName, Cardinality.MULTI);
        return prop;
    }
View Full Code Here

        propertyDefinitions.put(prop6.getId(), prop6);

        prop6 = PropertyCreationHelper.createIntegerMultiDefinition(PROP_ID_INT_MULTI_VALUE, "Sample Int multi-value Property");
        propertyDefinitions.put(prop6.getId(), prop6);

        PropertyStringDefinitionImpl prop7 = PropertyCreationHelper.createStringDefinition(PROP_ID_STRING,
                "Sample String Property");
        propertyDefinitions.put(prop7.getId(), prop7);

        prop7 = PropertyCreationHelper.createStringMultiDefinition(PROP_ID_STRING_MULTI_VALUE,
        "Sample String multi-value Property");
        propertyDefinitions.put(prop7.getId(), prop7);

        PropertyUriDefinitionImpl prop8 = PropertyCreationHelper.createUriDefinition(PROP_ID_URI, "Sample Uri Property");
        propertyDefinitions.put(prop8.getId(), prop8);

        prop8 = PropertyCreationHelper.createUriMultiDefinition(PROP_ID_URI_MULTI_VALUE, "Sample Uri multi-value Property");
        propertyDefinitions.put(prop8.getId(), prop8);

        PropertyStringDefinitionImpl prop9 = PropertyCreationHelper.createStringDefinition("PickListProp",
                "Sample Pick List Property");
        List<Choice<String>> choiceList = new ArrayList<Choice<String>>();
        ChoiceImpl<String> elem = new ChoiceImpl<String>();
        elem.setValue(Collections.singletonList("red"));
        choiceList.add(elem);
        elem = new ChoiceImpl<String>();
        elem.setValue(Collections.singletonList("green"));
        choiceList.add(elem);
        elem = new ChoiceImpl<String>();
        elem.setValue(Collections.singletonList("blue"));
        choiceList.add(elem);
        elem = new ChoiceImpl<String>();
        elem.setValue(Collections.singletonList("black"));
        choiceList.add(elem);
        prop9.setChoices(choiceList);
        prop9.setDefaultValue(Collections.singletonList("blue"));
        propertyDefinitions.put(prop9.getId(), prop9);

        /*
         * try short form: / PropertyCreationHelper.addElemToPicklist(prop9,
         * "red"); PropertyCreationHelper.addElemToPicklist(prop9, "green");
         * PropertyCreationHelper.addElemToPicklist(prop9, "blue");
         * PropertyCreationHelper.addElemToPicklist(prop9, "black");
         * PropertyCreationHelper.setDefaultValue(prop9, "blue"); /
         */

        cmisComplexType.addCustomPropertyDefinitions(propertyDefinitions);

        // add type to types collection
        typesList.add(cmisComplexType);

        // create a type hierarchy with inherited properties
        InMemoryDocumentTypeDefinition cmisDocTypeTopLevel = new InMemoryDocumentTypeDefinition(TOPLEVEL_TYPE,
                "Document type with properties, Level 1", InMemoryDocumentTypeDefinition.getRootDocumentType());

        InMemoryDocumentTypeDefinition cmisDocTypeLevel1 = new InMemoryDocumentTypeDefinition(LEVEL1_TYPE,
                "Document type with inherited properties, Level 2", cmisDocTypeTopLevel);

        InMemoryDocumentTypeDefinition cmisDocTypeLevel2 = new InMemoryDocumentTypeDefinition(LEVEL2_TYPE,
                "Document type with inherited properties, Level 3", cmisDocTypeLevel1);

        propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        PropertyStringDefinitionImpl propTop = PropertyCreationHelper.createStringDefinition("StringPropTopLevel",
                "Sample String Property");
        propertyDefinitions.put(propTop.getId(), propTop);
        cmisDocTypeTopLevel.addCustomPropertyDefinitions(propertyDefinitions);

        propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        PropertyStringDefinitionImpl propLevel1 = PropertyCreationHelper.createStringDefinition("StringPropLevel1",
                "String Property Level 1");
        propertyDefinitions.put(propLevel1.getId(), propLevel1);
        cmisDocTypeLevel1.addCustomPropertyDefinitions(propertyDefinitions);

        propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        PropertyStringDefinitionImpl propLevel2 = PropertyCreationHelper.createStringDefinition("StringPropLevel2",
                "String Property Level 2");
        propertyDefinitions.put(propLevel2.getId(), propLevel2);
        cmisDocTypeLevel2.addCustomPropertyDefinitions(propertyDefinitions);

        // create a versioned type with properties
        InMemoryDocumentTypeDefinition cmisVersionedType = new InMemoryDocumentTypeDefinition(VERSION_DOCUMENT_TYPE_ID,
                "VersionedType", InMemoryDocumentTypeDefinition.getRootDocumentType());

        // create a single String property definition

        propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();

        PropertyStringDefinitionImpl prop1 = PropertyCreationHelper.createStringDefinition(VERSION_PROPERTY_ID,
                "Sample String Property");
        propertyDefinitions.put(prop1.getId(), prop1);

        cmisVersionedType.addCustomPropertyDefinitions(propertyDefinitions);
        cmisVersionedType.setIsVersionable(true); // make it a versionable type;

        // create a folder type
View Full Code Here

            // create a single String property definition

            Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();

            PropertyStringDefinitionImpl prop1 = PropertyCreationHelper.createStringDefinition(PROPERTY_ID,
                    "Sample String Property");
            propertyDefinitions.put(prop1.getId(), prop1);

            cmisComplexType.addCustomPropertyDefinitions(propertyDefinitions);
            cmisComplexType.setIsVersionable(true); // make it a versionable
            // type;
View Full Code Here

            propertyDefinitions.put(prop6.getId(), prop6);

            prop6 = PropertyCreationHelper.createIntegerDefinition("IntPropMV", "Sample Int multi-value Property");
            propertyDefinitions.put(prop6.getId(), prop6);

            PropertyStringDefinitionImpl prop7 = PropertyCreationHelper.createStringDefinition("StringProp",
                    "Sample String Property");
            propertyDefinitions.put(prop7.getId(), prop7);

            PropertyUriDefinitionImpl prop8 = PropertyCreationHelper.createUriDefinition("UriProp",
                    "Sample Uri Property");
            propertyDefinitions.put(prop8.getId(), prop8);

            prop8 = PropertyCreationHelper.createUriDefinition("UriPropMV", "Sample Uri multi-value Property");
            propertyDefinitions.put(prop8.getId(), prop8);

            PropertyStringDefinitionImpl prop9 = PropertyCreationHelper.createStringDefinition("PickListProp",
                    "Sample Pick List Property");
            List<Choice<String>> choiceList = new ArrayList<Choice<String>>();
            ChoiceImpl<String> elem = new ChoiceImpl<String>();
            elem.setValue(Collections.singletonList("red"));
            choiceList.add(elem);
            elem = new ChoiceImpl<String>();
            elem.setValue(Collections.singletonList("green"));
            choiceList.add(elem);
            elem = new ChoiceImpl<String>();
            elem.setValue(Collections.singletonList("blue"));
            choiceList.add(elem);
            elem = new ChoiceImpl<String>();
            elem.setValue(Collections.singletonList("black"));
            choiceList.add(elem);
            prop9.setChoices(choiceList);
            prop9.setDefaultValue(Collections.singletonList("blue"));

            /*
             * try short form: / PropertyCreationHelper.addElemToPicklist(prop9,
             * "red"); PropertyCreationHelper.addElemToPicklist(prop9, "green");
             * PropertyCreationHelper.addElemToPicklist(prop9, "blue");
             * PropertyCreationHelper.addElemToPicklist(prop9, "black");
             * PropertyCreationHelper.setDefaultValue(prop9, "blue"); /
             */

            cmisComplexType.addCustomPropertyDefinitions(propertyDefinitions);

            // add type to types collection
            typesList.add(cmisComplexType);

            // create a type hierarchy with inherited properties
            InMemoryDocumentTypeDefinition cmisDocTypeTopLevel = new InMemoryDocumentTypeDefinition(TOPLEVEL_TYPE,
                    "Document type with properties, Level 1", InMemoryDocumentTypeDefinition.getRootDocumentType());

            InMemoryDocumentTypeDefinition cmisDocTypeLevel1 = new InMemoryDocumentTypeDefinition(LEVEL1_TYPE,
                    "Document type with inherited properties, Level 2", cmisDocTypeTopLevel);

            InMemoryDocumentTypeDefinition cmisDocTypeLevel2 = new InMemoryDocumentTypeDefinition(LEVEL2_TYPE,
                    "Document type with inherited properties, Level 3", cmisDocTypeLevel1);

            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            PropertyStringDefinitionImpl propTop = PropertyCreationHelper.createStringDefinition("StringPropTopLevel",
                    "Sample String Property");
            propertyDefinitions.put(propTop.getId(), propTop);
            cmisDocTypeTopLevel.addCustomPropertyDefinitions(propertyDefinitions);

            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            PropertyStringDefinitionImpl propLevel1 = PropertyCreationHelper.createStringDefinition("StringPropLevel1",
                    "String Property Level 1");
            propertyDefinitions.put(propLevel1.getId(), propLevel1);
            cmisDocTypeLevel1.addCustomPropertyDefinitions(propertyDefinitions);

            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            PropertyStringDefinitionImpl propLevel2 = PropertyCreationHelper.createStringDefinition("StringPropLevel2",
                    "String Property Level 2");
            propertyDefinitions.put(propLevel2.getId(), propLevel2);
            cmisDocTypeLevel2.addCustomPropertyDefinitions(propertyDefinitions);

            // add type to types collection
            typesList.add(cmisDocTypeTopLevel);
            typesList.add(cmisDocTypeLevel1);
View Full Code Here

        // create a boolean property definition

        Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();

        PropertyStringDefinitionImpl prop1 = PropertyCreationHelper.createStringDefinition(PROPERTY_ID,
                "Sample String Property");
        propertyDefinitions.put(prop1.getId(), prop1);

        cmisComplexType.addCustomPropertyDefinitions(propertyDefinitions);
        cmisComplexType.setIsVersionable(true); // make it a versionable type;

        // add type to types collection
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringDefinitionImpl

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.