Package org.apache.chemistry.opencmis.commons.enums

Examples of org.apache.chemistry.opencmis.commons.enums.PropertyType


        AbstractPropertyDefinition<?> result = null;

        String id = getString(json, JSON_PROPERTY_ID);

        // find property type
        PropertyType propertyType = getEnum(json, JSON_PROPERTY_TYPE_PROPERTY_TYPE, PropertyType.class);
        if (propertyType == null) {
            throw new CmisRuntimeException("Invalid property type '" + id + "'! Data type not set!");
        }

        // find
View Full Code Here


                String id = getString(jsonPropertyMap, JSON_PROPERTY_ID);
                if (id == null) {
                    throw new CmisRuntimeException("Invalid property!");
                }

                PropertyType propertyType = null;
                try {
                    propertyType = PropertyType.fromValue(getString(jsonPropertyMap, JSON_PROPERTY_DATATYPE));
                } catch (Exception e) {
                    throw new CmisRuntimeException("Invalid property: " + id);
                }
View Full Code Here

    private Map<String,List<Object>> getConstraintsFromDocument(Document d) {
        Map<String,List<Object>> constraints = new HashMap<String,List<Object>>();
        List<org.apache.chemistry.opencmis.client.api.Property<?>> docProps = d.getProperties();
        for (org.apache.chemistry.opencmis.client.api.Property<?> p : docProps) {
            if (!excludedProperties.contains(p.getQueryName())) {
                PropertyType t = p.getType();
                List<Object> values = new ArrayList<Object>();
                if (p.isMultiValued()) {
                    values.addAll(CMISUtils.getTypedPropertyValues(t, p.getValues()));
                } else {
                    values.add(CMISUtils.getTypedPropertyValue(t, p.getValue()));
View Full Code Here

        AbstractPropertyDefinition<?> result = null;

        String id = getString(json, JSON_PROPERTY_ID);

        // find property type
        PropertyType propertyType = getEnum(json, JSON_PROPERTY_TYPE_PROPERTY_TYPE, PropertyType.class);
        if (propertyType == null) {
            throw new CmisRuntimeException("Invalid property type '" + id + "'! Data type not set!");
        }

        // find
View Full Code Here

                String queryName = getString(jsonPropertyMap, JSON_PROPERTY_QUERYNAME);
                if (id == null && queryName == null) {
                    throw new CmisRuntimeException("Invalid property!");
                }

                PropertyType propertyType = null;
                try {
                    propertyType = PropertyType.fromValue(getString(jsonPropertyMap, JSON_PROPERTY_DATATYPE));
                } catch (Exception e) {
                    throw new CmisRuntimeException("Invalid property: " + id, e);
                }
View Full Code Here

            if (isNotEmpty(creatablePropertyTypes.getCanCreate())) {
                Set<PropertyType> propertyTypeSet = EnumSet.noneOf(PropertyType.class);
                target.setCanCreate(propertyTypeSet);
                for (EnumPropertyType propType : creatablePropertyTypes.getCanCreate()) {
                    PropertyType propertyType = convert(PropertyType.class, propType);
                    if (propertyType != null) {
                        propertyTypeSet.add(propertyType);
                    }
                }
            }
View Full Code Here

                throw new IllegalStateException("LIKE operator requires String literal on right hand side.");
            }

            ColumnReference colRef = getColumnReference(colNode);
            PropertyDefinition<?> pd = colRef.getPropertyDefinition();
            PropertyType propType = pd.getPropertyType();
            if (propType != PropertyType.STRING && propType != PropertyType.HTML && propType != PropertyType.ID
                    && propType != PropertyType.URI) {
                throw new IllegalStateException("Property type " + propType.value() + " is not allowed FOR LIKE");
            }
            if (pd.getCardinality() != Cardinality.SINGLE) {
                throw new IllegalStateException("LIKE is not allowed for multi-value properties ");
            }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.enums.PropertyType

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.