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

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


        result.setCapabilityJoin(getEnum(json, JSON_CAP_JOIN, CapabilityJoin.class));
        result.setCapabilityAcl(getEnum(json, JSON_CAP_ACL, CapabilityAcl.class));

        Map<String, Object> creatablePropertyTypesJson = getMap(json.get(JSON_CAP_CREATABLE_PROPERTY_TYPES));
        if (creatablePropertyTypesJson != null) {
            CreatablePropertyTypesImpl creatablePropertyTypes = new CreatablePropertyTypesImpl();

            List<Object> canCreateJson = getList(creatablePropertyTypesJson
                    .get(JSON_CAP_CREATABLE_PROPERTY_TYPES_CANCREATE));
            if (canCreateJson != null) {
                Set<PropertyType> canCreate = EnumSet.noneOf(PropertyType.class);

                for (Object o : canCreateJson) {
                    try {
                        if (o != null) {
                            canCreate.add(PropertyType.fromValue(o.toString()));
                        }
                    } catch (Exception e) {
                        // ignore
                    }
                }

                creatablePropertyTypes.setCanCreate(canCreate);
            }

            convertExtension(creatablePropertyTypesJson, creatablePropertyTypes, CAP_CREATABLE_PROPERTY_TYPES_KEYS);

            result.setCreatablePropertyTypes(creatablePropertyTypes);
View Full Code Here


        result.setCapabilityJoin(getEnum(json, JSON_CAP_JOIN, CapabilityJoin.class));
        result.setCapabilityAcl(getEnum(json, JSON_CAP_ACL, CapabilityAcl.class));

        Map<String, Object> creatablePropertyTypesJson = getMap(json.get(JSON_CAP_CREATABLE_PROPERTY_TYPES));
        if (creatablePropertyTypesJson != null) {
            CreatablePropertyTypesImpl creatablePropertyTypes = new CreatablePropertyTypesImpl();

            List<Object> canCreateJson = getList(creatablePropertyTypesJson
                    .get(JSON_CAP_CREATABLE_PROPERTY_TYPES_CANCREATE));
            if (canCreateJson != null) {
                Set<PropertyType> canCreate = new HashSet<PropertyType>();

                for (Object o : canCreateJson) {
                    try {
                        if (o != null) {
                            canCreate.add(PropertyType.fromValue(o.toString()));
                        }
                    } catch (Exception e) {
                        // ignore
                    }
                }

                creatablePropertyTypes.setCanCreate(canCreate);
            }

            convertExtension(creatablePropertyTypesJson, creatablePropertyTypes, CAP_CREATABLE_PROPERTY_TYPES_KEYS);

            result.setCreatablePropertyTypes(creatablePropertyTypes);
View Full Code Here

        result.setCapabilityJoin(getEnum(json, JSON_CAP_JOIN, CapabilityJoin.class));
        result.setCapabilityAcl(getEnum(json, JSON_CAP_ACL, CapabilityAcl.class));

        Map<String, Object> creatablePropertyTypesJson = getMap(json.get(JSON_CAP_CREATABLE_PROPERTY_TYPES));
        if (creatablePropertyTypesJson != null) {
            CreatablePropertyTypesImpl creatablePropertyTypes = new CreatablePropertyTypesImpl();

            List<Object> canCreateJson = getList(creatablePropertyTypesJson
                    .get(JSON_CAP_CREATABLE_PROPERTY_TYPES_CANCREATE));
            if (canCreateJson != null) {
                Set<PropertyType> canCreate = EnumSet.noneOf(PropertyType.class);

                for (Object o : canCreateJson) {
                    try {
                        if (o != null) {
                            canCreate.add(PropertyType.fromValue(o.toString()));
                        }
                    } catch (Exception e) {
                        // ignore
                    }
                }

                creatablePropertyTypes.setCanCreate(canCreate);
            }

            convertExtension(creatablePropertyTypesJson, creatablePropertyTypes, CAP_CREATABLE_PROPERTY_TYPES_KEYS);

            result.setCreatablePropertyTypes(creatablePropertyTypes);
View Full Code Here

        result.setSupportsUnfiling(capabilities.isCapabilityUnfiling());
        result.setSupportsVersionSpecificFiling(capabilities.isCapabilityVersionSpecificFiling());
        if (capabilities.getCapabilityCreatablePropertyTypes() != null) {
            CmisCreatablePropertyTypesType creatablePropertyTypes = capabilities.getCapabilityCreatablePropertyTypes();

            CreatablePropertyTypesImpl target = new CreatablePropertyTypesImpl();
            result.setCreatablePropertyTypes(target);

            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);
                    }
                }
            }

            convertExtension(creatablePropertyTypes, target);
        }
        if (capabilities.getCapabilityNewTypeSettableAttributes() != null) {
            CmisNewTypeSettableAttributes newTypeSettableAttributes = capabilities
                    .getCapabilityNewTypeSettableAttributes();

            NewTypeSettableAttributesImpl target = new NewTypeSettableAttributesImpl();
            result.setNewTypeSettableAttributes(target);

            target.setCanSetId(newTypeSettableAttributes.isId());
            target.setCanSetLocalName(newTypeSettableAttributes.isLocalName());
            target.setCanSetLocalNamespace(newTypeSettableAttributes.isLocalNamespace());
            target.setCanSetDisplayName(newTypeSettableAttributes.isDisplayName());
            target.setCanSetQueryName(newTypeSettableAttributes.isQueryName());
            target.setCanSetDescription(newTypeSettableAttributes.isDescription());
            target.setCanSetCreatable(newTypeSettableAttributes.isCreatable());
            target.setCanSetFileable(newTypeSettableAttributes.isFileable());
            target.setCanSetQueryable(newTypeSettableAttributes.isQueryable());
            target.setCanSetFulltextIndexed(newTypeSettableAttributes.isFulltextIndexed());
            target.setCanSetIncludedInSupertypeQuery(newTypeSettableAttributes.isIncludedInSupertypeQuery());
            target.setCanSetControllablePolicy(newTypeSettableAttributes.isControllablePolicy());
            target.setCanSetControllableAcl(newTypeSettableAttributes.isControllableACL());

            convertExtension(newTypeSettableAttributes, target);
        }

        // handle extensions
View Full Code Here

                add(PropertyType.ID);
                add(PropertyType.INTEGER);
                add(PropertyType.STRING);
                add(PropertyType.URI);
            }};
            CreatablePropertyTypesImpl creatablePropertyTypes = new CreatablePropertyTypesImpl();
            creatablePropertyTypes.setCanCreate(propertyTypeSet);
            caps.setCreatablePropertyTypes(creatablePropertyTypes);
        } else {
            repoInfo.setCmisVersionSupported(CmisVersion.CMIS_1_0.value());
            repoInfo.setCmisVersion(CmisVersion.CMIS_1_0);
        }
View Full Code Here

TOP

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

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.