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

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


            Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            PropertyStringDefinitionImpl prop1 = PropertyCreationHelper.createStringDefinition(SECONDARY_STRING_PROP,
                    "Secondary String Property", Updatability.READWRITE);
            propertyDefinitions.put(prop1.getId(), prop1);
            PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(SECONDARY_INTEGER_PROP,
                    "Secondary Integer Property", Updatability.READWRITE);
            prop2.setIsRequired(true);
            propertyDefinitions.put(prop2.getId(), prop2);
            cmisSecondaryType.addCustomPropertyDefinitions(propertyDefinitions);

            return cmisSecondaryType;           
        }
View Full Code Here


        prop5 = PropertyCreationHelper.createIdMultiDefinition("IdPropMV", "Sample Id Html multi-value Property",
                Updatability.READWRITE);
        propertyDefinitions.put(prop5.getId(), prop5);

        PropertyIntegerDefinitionImpl prop6 = PropertyCreationHelper.createIntegerDefinition("IntProp",
                "Sample Int Property", Updatability.READWRITE);
        propertyDefinitions.put(prop6.getId(), prop6);

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

        PropertyStringDefinitionImpl prop7 = PropertyCreationHelper.createStringDefinition("StringProp",
                "Sample String Property", Updatability.READWRITE);
        propertyDefinitions.put(prop7.getId(), prop7);
View Full Code Here

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

        prop5 = PropertyCreationHelper.createIdMultiDefinition(PROP_ID_ID_MULTI_VALUE, "Sample Id Html multi-value Property", Updatability.READONLY);
        propertyDefinitions.put(prop5.getId(), prop5);

        PropertyIntegerDefinitionImpl prop6 = PropertyCreationHelper.createIntegerDefinition(PROP_ID_INT,
                "Sample Int Property", Updatability.READONLY);
        propertyDefinitions.put(prop6.getId(), prop6);

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

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

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

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

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

        PropertyStringDefinitionImpl prop9 = PropertyCreationHelper.createStringDefinition("PickListProp",
                "Sample Pick List Property", Updatability.READONLY);
        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", Updatability.READONLY);
        propertyDefinitions.put(propTop.getId(), propTop);
        cmisDocTypeTopLevel.addCustomPropertyDefinitions(propertyDefinitions);

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

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

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

        // create a single String property definition

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

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

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

        // create a folder type
        // create a complex type with properties
        InMemoryFolderTypeDefinition cmisFolderType = new InMemoryFolderTypeDefinition(FOLDER_TYPE,
                "Folder type with properties", InMemoryFolderTypeDefinition.getRootFolderType());

        // create a two property definitions for folder

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

        prop6 = PropertyCreationHelper.createIntegerDefinition(PROP_ID_INT, "Sample Folder Int Property", Updatability.READONLY);
        propertyDefinitions.put(prop6.getId(), prop6);

        prop7 = PropertyCreationHelper.createStringDefinition(PROP_ID_STRING,
            "Sample Folder String Property", Updatability.READONLY);
        propertyDefinitions.put(prop7.getId(), prop7);
        cmisFolderType.addCustomPropertyDefinitions(propertyDefinitions);

        // CMIS 1.1 create a secondary type
        InMemorySecondaryTypeDefinition cmisSecondaryType = new InMemorySecondaryTypeDefinition(SECONDARY_TYPE,
                "MySecondaryType");
        // create a single String property definition
        propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        PropertyStringDefinitionImpl propStr = PropertyCreationHelper.createStringDefinition(SECONDARY_STRING_PROP,
                "Secondary String Property", Updatability.READWRITE);
        propertyDefinitions.put(propStr.getId(), propStr);
        PropertyIntegerDefinitionImpl propInt = PropertyCreationHelper.createIntegerDefinition(SECONDARY_INTEGER_PROP,
                "Secondary Integer Property", Updatability.READWRITE);
        propInt.setIsRequired(true);
        propertyDefinitions.put(propInt.getId(), propInt);
        cmisSecondaryType.addCustomPropertyDefinitions(propertyDefinitions);


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

                "Checkin Comment", Updatability.READONLY);
        // read-only, because
        // not set as property
        propertyDefinitions.put(propS.getId(), propS);

        PropertyIntegerDefinitionImpl propI = PropertyCreationHelper.createIntegerDefinition(
                PropertyIds.CONTENT_STREAM_LENGTH, "Content Length", Updatability.READONLY);
        propertyDefinitions.put(propI.getId(), propI);

        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CONTENT_STREAM_MIME_TYPE,
                "Mime Type", Updatability.READONLY);
        propertyDefinitions.put(propS.getId(), propS);
View Full Code Here

        InMemoryDocumentTypeDefinition cmisLaterType = new InMemoryDocumentTypeDefinition(TYPE_ID_MUTABILITY,
                "Type with two properties", InMemoryDocumentTypeDefinition.getRootDocumentType());

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

        PropertyIntegerDefinitionImpl prop1 = PropertyCreationHelper.createIntegerDefinition(PROPERTY_ID_NUMBER,
                "Sample Int Property", Updatability.READWRITE);
        propertyDefinitions.put(prop1.getId(), prop1);

        PropertyStringDefinitionImpl prop2 = PropertyCreationHelper.createStringDefinition(PROPERTY_ID_TITLE,
                "Sample String Property", Updatability.READWRITE);
        propertyDefinitions.put(prop2.getId(), prop2);
       
View Full Code Here

TOP

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

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.