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

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


        PropertyStringDefinition prop2 = PropertyCreationHelper.createStringDefinition(STRING_PROP,
                "Sample String Property");
        propertyDefinitions.put(prop2.getId(), prop2);

        PropertyIntegerDefinitionImpl prop3 = PropertyCreationHelper.createIntegerDefinition(INT_PROP,
                "Sample Integer Property");
        propertyDefinitions.put(prop2.getId(), prop2);

        cmisType.setPropertyDefinitions(propertyDefinitions);

        typeDefs.add(cmisType);
        myType = cmisType;

        // add another type definition with exactly the same properties
        cmisType = new InMemoryDocumentTypeDefinition(MY_DOC_TYPE_COPY,
                "Document Type Duplicated", InMemoryDocumentTypeDefinition.getRootDocumentType());
        cmisType.setPropertyDefinitions(propertyDefinitions); // add same properties
        typeDefs.add(cmisType);
        myTypeCopy = cmisType;


        // Second test type

        cmisType = new InMemoryDocumentTypeDefinition(BOOK_TYPE,
                "Book Document Type", InMemoryDocumentTypeDefinition.getRootDocumentType());

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

        prop2 = PropertyCreationHelper.createStringDefinition(TITLE_PROP, "Title of Book");
        propertyDefinitions.put(prop2.getId(), prop2);

        prop2 = PropertyCreationHelper.createStringDefinition(AUTHOR_PROP, "Author of Book");
        propertyDefinitions.put(prop2.getId(), prop2);

        prop3 = PropertyCreationHelper.createIntegerDefinition(ISBN_PROP,
                "ISBN of Book");
        propertyDefinitions.put(prop3.getId(), prop3);

        PropertyDateTimeDefinitionImpl prop4 = PropertyCreationHelper.createDateTimeDefinition(PUB_DATE_PROP,
                "Publishing Date of Book");
        propertyDefinitions.put(prop4.getId(), prop4);
View Full Code Here


            break;
        case ID:
            result = new PropertyIdDefinitionImpl();
            break;
        case INTEGER:
            result = new PropertyIntegerDefinitionImpl();
            break;
        case STRING:
            result = new PropertyStringDefinitionImpl();
            break;
        case URI:
View Full Code Here

                    TEST_DOCUMENT_MY_STRING_PROP_ID, "My String Property");
            prop.setIsRequired(false);
            prop.setMaxLength(BigInteger.valueOf(20)); // max len to 20
            propertyDefinitions.put(prop.getId(), prop);

            PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(
                    TEST_DOCUMENT_MY_INT_PROP_ID, "My Integer Property");
            prop2.setIsRequired(true);
            prop2.setMinValue(BigInteger.valueOf(-10000));
            prop2.setMaxValue(BigInteger.valueOf(10000));
            propertyDefinitions.put(prop2.getId(), prop2);
            cmisDocumentType.addCustomPropertyDefinitions(propertyDefinitions);
            return cmisDocumentType;
        }
View Full Code Here

            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);
            cmisDocumentType.addCustomPropertyDefinitions(propertyDefinitions);
            return cmisDocumentType;
        }
View Full Code Here

            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)); }};
            prop2.setDefaultValue(defVal);
            propertyDefinitions.put(prop2.getId(), prop2);

            PropertyIntegerDefinitionImpl prop3 = PropertyCreationHelper.createIntegerDefinition(
                    TEST_DOCUMENT_MY_INT_PROP_ID_MANDATORY_DEFAULT, "Test Integer Property Mandatory default");
            prop3.setIsRequired(true);
            List<BigInteger> defVal2 = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
            prop3.setDefaultValue(defVal2);
            propertyDefinitions.put(prop3.getId(), prop3);

            cmisDocumentType.addCustomPropertyDefinitions(propertyDefinitions);

            return cmisDocumentType;
        }
View Full Code Here

            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)); }};
            prop2.setDefaultValue(defVal);
            propertyDefinitions.put(prop2.getId(), prop2);

            PropertyIntegerDefinitionImpl prop3 = PropertyCreationHelper.createIntegerDefinition(
                    TEST_FOLDER_MY_INT_PROP_ID_MANDATORY_DEFAULT, "Test Integer Property Mandatory default");
            prop3.setIsRequired(true);
            List<BigInteger> defVal2 = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
            prop3.setDefaultValue(defVal2);
            propertyDefinitions.put(prop3.getId(), prop3);

            cmisFolderType.addCustomPropertyDefinitions(propertyDefinitions);

            return cmisFolderType;
        }
View Full Code Here

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

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

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

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

            CmisPropertyId prop = ((CmisPropertyIdDefinitionType) propertyDefinition).getDefaultValue();
            if (prop != null) {
                ((PropertyIdDefinitionImpl) result).setDefaultValue(prop.getValue());
            }
        } else if (propertyDefinition instanceof CmisPropertyIntegerDefinitionType) {
            result = new PropertyIntegerDefinitionImpl();

            ((PropertyIntegerDefinitionImpl) result)
                    .setChoices(convertChoiceIntegerList(((CmisPropertyIntegerDefinitionType) propertyDefinition)
                            .getChoice()));
View Full Code Here

                    TEST_DOCUMENT_MY_STRING_PROP_ID, "My String Property", Updatability.READWRITE);
            prop.setIsRequired(false);
            prop.setMaxLength(BigInteger.valueOf(20)); // max len to 20
            propertyDefinitions.put(prop.getId(), prop);

            PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(
                    TEST_DOCUMENT_MY_INT_PROP_ID, "My Integer Property", Updatability.READWRITE);
            prop2.setIsRequired(true);
            prop2.setMinValue(BigInteger.valueOf(-10000));
            prop2.setMaxValue(BigInteger.valueOf(10000));
            propertyDefinitions.put(prop2.getId(), prop2);
            cmisDocumentType.addCustomPropertyDefinitions(propertyDefinitions);
            return cmisDocumentType;
        }
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.