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

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


                    "My Folder Type", InMemoryFolderTypeDefinition.getRootFolderType());
            // create a simple string property type and
            // attach the property definition to the type definition for
            // document and folder type
            Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            PropertyStringDefinitionImpl prop = PropertyCreationHelper.createStringDefinition(
                    TEST_DOCUMENT_STRING_PROP_ID, "Sample Doc String Property", Updatability.READWRITE);
            propertyDefinitions.put(prop.getId(), prop);
            cmisDocumentType.addCustomPropertyDefinitions(propertyDefinitions);

            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            prop = PropertyCreationHelper.createStringDefinition(TEST_FOLDER_STRING_PROP_ID,
                    "Sample Folder String Property", Updatability.READWRITE);
            propertyDefinitions.put(prop.getId(), prop);
            cmisFolderType.addCustomPropertyDefinitions(propertyDefinitions);

            InMemoryDocumentTypeDefinition customDocType = createCustomTypeWithStringIntProperty();
            // add type to types collection
            typesList.add(cmisDocumentType);
View Full Code Here


        private static InMemoryDocumentTypeDefinition createCustomTypeWithStringIntProperty() {
            InMemoryDocumentTypeDefinition cmisDocumentType = new InMemoryDocumentTypeDefinition(
                    TEST_CUSTOM_DOCUMENT_TYPE_ID, "My Custom Document Type", InMemoryDocumentTypeDefinition
                            .getRootDocumentType());
            Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
            PropertyStringDefinitionImpl prop = PropertyCreationHelper.createStringDefinition(
                    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));
View Full Code Here

        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", Updatability.READWRITE);
            prop.setIsRequired(false);
            propertyDefinitions.put(prop.getId(), prop);

            PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(
                    TEST_DOCUMENT_MY_SUB_INT_PROP_ID, "Subtype", Updatability.READWRITE);
            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", Updatability.READWRITE);
            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", Updatability.READWRITE);
            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", Updatability.READWRITE);
            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", Updatability.READWRITE);
            prop2.setIsRequired(false);
            List<BigInteger> defVal = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
View Full Code Here

       
        String repositoryId = getRepositoryId();
       
        // test null property id
        InMemoryDocumentTypeDefinition typeDef = createTypeForAddingAtRuntime();
        PropertyStringDefinitionImpl pd = getPropertyDefinitionImpl(typeDef);
        pd.setId(null);
        checkAddingType(repositoryId, typeDef, CmisInvalidArgumentException.class);
       
        // test illegal property id
        typeDef = createTypeForAddingAtRuntime();
        pd = getPropertyDefinitionImpl(typeDef);
        pd.setQueryName(pd.getQueryName() + "!*!");
        checkAddingType(repositoryId, typeDef, CmisInvalidArgumentException.class);

        // test null property query name
        typeDef = createTypeForAddingAtRuntime();
        pd = getPropertyDefinitionImpl(typeDef);
        pd.setQueryName(null);
        checkAddingType(repositoryId, typeDef, CmisInvalidArgumentException.class);

        // test illegal property query name
        typeDef = createTypeForAddingAtRuntime();
        pd = getPropertyDefinitionImpl(typeDef);
        pd.setQueryName(pd.getQueryName() + "!!!");
        checkAddingType(repositoryId, typeDef, CmisInvalidArgumentException.class);

        // test null property local name
        typeDef = createTypeForAddingAtRuntime();
        pd = getPropertyDefinitionImpl(typeDef);
        pd.setLocalName(null);
        checkAddingType(repositoryId, typeDef, CmisInvalidArgumentException.class);

        // test illegal property local name
        typeDef = createTypeForAddingAtRuntime();
        pd = getPropertyDefinitionImpl(typeDef);
        pd.setLocalName(typeDef.getLocalName() + "!!!");
        checkAddingType(repositoryId, typeDef, CmisInvalidArgumentException.class);

        log.info("... testTypeMutabilityPropertyNameConstraints() finished.");             
    }
View Full Code Here

        assertNotNull(repository);
        return repository.getRootFolderId();
    }

    private PropertyStringDefinitionImpl getPropertyDefinitionImpl(TypeDefinition typeDef) {
        @SuppressWarnings("unchecked")
        PropertyStringDefinitionImpl pd = (PropertyStringDefinitionImpl) typeDef.getPropertyDefinitions().get(PROPERTY_ID_TITLE);
        return pd;
    }
View Full Code Here

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

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

        }

        AbstractPropertyDefinition<?> result = null;

        if (propertyDefinition instanceof CmisPropertyStringDefinitionType) {
            result = new PropertyStringDefinitionImpl();

            ((PropertyStringDefinitionImpl) result)
                    .setChoices(convertChoiceStringList(((CmisPropertyStringDefinitionType) propertyDefinition)
                            .getChoice()));
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.