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

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


        return typesList;
    }

    public static void setBasicPropertyDefinitions(Map<String, PropertyDefinition<?>> propertyDefinitions) {

        PropertyStringDefinitionImpl propS = PropertyCreationHelper.createStringDefinition(PropertyIds.NAME,
                "CMIS Name Property");
        propS.setUpdatability(Updatability.READWRITE);
        propS.setIsRequired(true);
        propertyDefinitions.put(propS.getId(), propS);

        PropertyIdDefinitionImpl propId = PropertyCreationHelper.createIdDefinition(PropertyIds.OBJECT_ID,
                "CMIS Object Id Property");
        propId.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propId.getId(), propId);

        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.OBJECT_TYPE_ID, "CMIS Object Type Id Property");
        propId.setUpdatability(Updatability.ONCREATE);
        propId.setIsRequired(true);
        propertyDefinitions.put(propId.getId(), propId);

        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.BASE_TYPE_ID, "CMIS Base Type Id Property");
        propId.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propId.getId(), propId);

        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CREATED_BY, "CMIS Created By Property");
        propS.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propS.getId(), propS);

        PropertyDateTimeDefinitionImpl propD = PropertyCreationHelper.createDateTimeDefinition(
                PropertyIds.CREATION_DATE, "CMIS Creation Date Property");
        propD.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propD.getId(), propD);

        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.LAST_MODIFIED_BY,
                "CMIS Last Modified By Property");
        propS.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propS.getId(), propS);

        propD = PropertyCreationHelper.createDateTimeDefinition(PropertyIds.LAST_MODIFICATION_DATE,
                "CMIS Last Modification Date Property");
        propD.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propD.getId(), propD);

        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CHANGE_TOKEN, "CMIS Change Token Property");
        propS.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propS.getId(), propS);
    }
View Full Code Here


        propB = PropertyCreationHelper.createBooleanDefinition(PropertyIds.IS_LATEST_MAJOR_VERSION,
                "CMIS Is Latest Major Version Property");
        propB.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propB.getId(), propB);

        PropertyStringDefinitionImpl propS = PropertyCreationHelper.createStringDefinition(PropertyIds.VERSION_LABEL,
                "CMIS Version Label Property");
        propS.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propS.getId(), propS);

        PropertyIdDefinitionImpl propId = PropertyCreationHelper.createIdDefinition(PropertyIds.VERSION_SERIES_ID,
                "CMIS Version Series Id Property");
        propId.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propId.getId(), propId);

        propB = PropertyCreationHelper.createBooleanDefinition(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT,
                "CMIS Is Version Series Checked Out Property");
        propB.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propB.getId(), propB);

        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.VERSION_SERIES_CHECKED_OUT_BY,
                "CMIS Version Series Checked Out By Property");
        propS.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propS.getId(), propS);

        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.VERSION_SERIES_CHECKED_OUT_ID,
                "CMIS Version Series Checked Out Id Property");
        propId.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propId.getId(), propId);

        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CHECKIN_COMMENT,
                "CMIS Checkin Comment Property");
        propS.setUpdatability(Updatability.READONLY); // Note: spec says
        // read-only, because
        // not set as property
        propertyDefinitions.put(propS.getId(), propS);

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

        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CONTENT_STREAM_MIME_TYPE,
                "CMIS Content Stream Mime Type Property");
        propS.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propS.getId(), propS);

        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CONTENT_STREAM_FILE_NAME,
                "CMIS Content Stream File Name Property");
        propertyDefinitions.put(propS.getId(), propS);

        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.CONTENT_STREAM_ID, "CMIS Stream Id Property");
        propId.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propId.getId(), propId);
View Full Code Here

                "CMIS Allowed Childe Object Type Ids Property");
        propId.setUpdatability(Updatability.READONLY);
        propId.setCardinality(Cardinality.MULTI);
        propertyDefinitions.put(propId.getId(), propId);

        PropertyStringDefinitionImpl propS = PropertyCreationHelper.createStringDefinition(PropertyIds.PATH,
                "CMIS Path Property");
        propS.setUpdatability(Updatability.READONLY);
        propertyDefinitions.put(propS.getId(), propS);

    }
View Full Code Here

    }

    public static void setBasicPolicyPropertyDefinitions(Map<String, PropertyDefinition<?>> propertyDefinitions) {

        setBasicPropertyDefinitions(propertyDefinitions);
        PropertyStringDefinitionImpl propS = PropertyCreationHelper.createStringDefinition(PropertyIds.POLICY_TEXT,
                "CMIS Policy Text Property");
        propS.setIsRequired(true);
        propertyDefinitions.put(propS.getId(), propS);
    }
View Full Code Here

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

        prop6 = PropertyCreationHelper.createIntegerMultiDefinition("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.createUriMultiDefinition("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"));
        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.setPropertyDefinitions(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.setPropertyDefinitions(propertyDefinitions);

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

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

        // add type to types collection
        typesList.add(cmisDocTypeTopLevel);
        typesList.add(cmisDocTypeLevel1);
        typesList.add(cmisDocTypeLevel2);

        // Create a type that is versionable
        InMemoryDocumentTypeDefinition cmisVersionedType = new InMemoryDocumentTypeDefinition(VERSIONED_TYPE,
                "VersionedType", InMemoryDocumentTypeDefinition.getRootDocumentType());

        // create a single String property definition

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

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

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

        // add type to types collection
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(PICK_LIST_PROP_DEF,
                "Sample Pick List Property");

        PropertyCreationHelper.addElemToPicklist(prop9, "red");
        PropertyCreationHelper.addElemToPicklist(prop9, "green");
        PropertyCreationHelper.addElemToPicklist(prop9, "blue");
View Full Code Here

                "String Document Type for Validation", InMemoryDocumentTypeDefinition.getRootDocumentType());

        Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        // create a String property definition

        PropertyStringDefinitionImpl propDef = PropertyCreationHelper.createStringDefinition(STRING_PROP_TYPE,
                "Sample String Property");
        propDef.setMaxLength(BigInteger.valueOf(10));
        propertyDefinitions.put(propDef.getId(), propDef);

        cmisType.setPropertyDefinitions(propertyDefinitions);

        return cmisType;
    }
View Full Code Here

                "PickList Document Type for Validation", InMemoryDocumentTypeDefinition.getRootDocumentType());

        Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        // create a String property definition

        PropertyStringDefinitionImpl propDef = PropertyCreationHelper.createStringDefinition(PICK_LIST_PROP_DEF,
                "Sample PickList (choice) Property");
        List<Choice<String>> choiceList = new ArrayList<Choice<String>>();
        ChoiceImpl<String> elem = new ChoiceImpl<String>();
        elem.setValue(Collections.singletonList("red"));
        elem.setDisplayName("Red");
        choiceList.add(elem);
        elem = new ChoiceImpl<String>();
        elem.setValue(Collections.singletonList("green"));
        elem.setDisplayName("Green");
        choiceList.add(elem);
        elem = new ChoiceImpl<String>();
        elem.setValue(Collections.singletonList("blue"));
        elem.setDisplayName("Blue");
        choiceList.add(elem);
        elem = new ChoiceImpl<String>();
        elem.setValue(Collections.singletonList("black"));
        elem.setDisplayName("Black");
        choiceList.add(elem);
        propDef.setChoices(choiceList);
        propDef.setDefaultValue(Collections.singletonList("blue"));
        propDef.setCardinality(cardinality);
        propertyDefinitions.put(propDef.getId(), propDef);
        cmisType.setPropertyDefinitions(propertyDefinitions);

        return cmisType;
    }
View Full Code Here

                "PickList Document Type for Validation", InMemoryDocumentTypeDefinition.getRootDocumentType());

        Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
        // create a String property definition

        PropertyStringDefinitionImpl propDef = PropertyCreationHelper.createStringDefinition(PICK_LIST_PROP_DEF,
                "Sample PickList (choice) Property");
        List<Choice<String>> choiceList = new ArrayList<Choice<String>>();
        ChoiceImpl<String> elem = new ChoiceImpl<String>();
        List<String> valueList = new ArrayList<String>();
        valueList.add("red");
        valueList.add("green");
        valueList.add("blue");
        elem.setValue(valueList);
        elem.setDisplayName("RGB");
        choiceList.add(elem);

        elem = new ChoiceImpl<String>();
        valueList = new ArrayList<String>();
        valueList.add("cyan");
        valueList.add("magenta");
        valueList.add("yellow");
        valueList.add("black");
        elem.setValue(valueList);
        elem.setDisplayName("CMYK");
        choiceList.add(elem);

        propDef.setChoices(choiceList);
        // propDef.setDefaultValue(...);
        propDef.setCardinality(Cardinality.MULTI);
        propertyDefinitions.put(propDef.getId(), propDef);
        cmisType.setPropertyDefinitions(propertyDefinitions);

        return cmisType;
    }
View Full Code Here

        // create a String property definition

        // Create a two-level pick list with an outer property list state and an
        // inner
        // list of city
        PropertyStringDefinitionImpl propDef = PropertyCreationHelper.createStringDefinition(PICK_LIST_PROP_DEF,
                "Sample PickList (choice) Property");
        List<Choice<String>> choiceListOuter = new ArrayList<Choice<String>>();

        ChoiceImpl<String> elemOuter = new ChoiceImpl<String>();
        elemOuter.setDisplayName("Bavaria");
        List<Choice<String>> choiceListInner = new ArrayList<Choice<String>>();
        ChoiceImpl<String> elemInner = new ChoiceImpl<String>();
        elemInner.setDisplayName("Munich");
        elemInner.setValue(Collections.singletonList("munich"));
        choiceListInner.add(elemInner);
        elemInner = new ChoiceImpl<String>();
        elemInner.setDisplayName("Ingolstadt");
        elemInner.setValue(Collections.singletonList("ingolstadt"));
        choiceListInner.add(elemInner);
        elemInner = new ChoiceImpl<String>();
        elemInner.setDisplayName("Passau");
        elemInner.setValue(Collections.singletonList("passau"));
        choiceListInner.add(elemInner);
        elemOuter.setChoice(choiceListInner);
        choiceListOuter.add(elemOuter);

        elemOuter = new ChoiceImpl<String>();
        elemOuter.setDisplayName("Baden Wurtemberg");
        choiceListInner = new ArrayList<Choice<String>>();
        elemInner = new ChoiceImpl<String>();
        elemInner.setDisplayName("Stuttgart");
        elemInner.setValue(Collections.singletonList("stuttgart"));
        choiceListInner.add(elemInner);
        elemInner = new ChoiceImpl<String>();
        elemInner.setDisplayName("Karlsruhe");
        elemInner.setValue(Collections.singletonList("karlsruhe"));
        choiceListInner.add(elemInner);
        elemInner = new ChoiceImpl<String>();
        elemInner.setDisplayName("Walldorf");
        elemInner.setValue(Collections.singletonList("walldorf"));
        choiceListInner.add(elemInner);
        elemOuter.setChoice(choiceListInner);
        choiceListOuter.add(elemOuter);

        propDef.setChoices(choiceListOuter);
        propDef.setCardinality(cardinality);
        propertyDefinitions.put(propDef.getId(), propDef);
        cmisType.setPropertyDefinitions(propertyDefinitions);

        return cmisType;
    }
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.