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

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


        // initialize the SPI
        CmisBindingsHelper.getSPI(session);

        // set up object factory
        objectFactory = new BindingsObjectFactoryImpl();

        // set up repository service
        repositoryServiceWrapper = new RepositoryServiceImpl(session);

        // add authentication provider to session
View Full Code Here


    public ObjectStoreImpl getStore(String repositoryId) {
        return (ObjectStoreImpl) fMapRepositoryToObjectStore.get(repositoryId);
    }

    public StoreManagerImpl() {
        fObjectFactory = new BindingsObjectFactoryImpl();
    }
View Full Code Here

    }

    public static Properties getPropertiesFromObject(StoredObject so, TypeDefinition td, List<String> requestedIds, boolean fillOptionalPropertyData) {
        // build properties collection

        BindingsObjectFactory objectFactory = new BindingsObjectFactoryImpl();
        Map<String, PropertyData<?>> properties = new HashMap<String, PropertyData<?>>();
        so.fillProperties(properties, objectFactory, requestedIds);

        String typeId = so.getTypeId();
        if (FilterParser.isContainedInFilter(PropertyIds.BASE_TYPE_ID, requestedIds)) {
            if (td == null) {
                log.warn("getPropertiesFromObject(), cannot get type definition, a type with id " + typeId
                        + " is unknown");
            } else {
                String baseTypeId = td.getBaseTypeId().value();
                properties.put(PropertyIds.BASE_TYPE_ID, objectFactory.createPropertyIdData(PropertyIds.BASE_TYPE_ID,
                        baseTypeId));
            }
        }
        List<PropertyData<?>> propertiesList = new ArrayList<PropertyData<?>>(properties.values());

        if (fillOptionalPropertyData) {  // add query name, local name, display name
            fillOptionalPropertyData(td, propertiesList);
        }

        Properties props = objectFactory.createPropertiesData(propertiesList);
        return props;
    }
View Full Code Here

    public static Properties getPropertiesFromObject(StoredObject so, TypeDefinition td,
            Map<String, String> requestedIds, Map<String, String> requestedFuncs) {
        // build properties collection

        List<String> idList = new ArrayList<String>(requestedIds.keySet());
        BindingsObjectFactory objectFactory = new BindingsObjectFactoryImpl();
        Map<String, PropertyData<?>> properties = new HashMap<String, PropertyData<?>>();
        so.fillProperties(properties, objectFactory, idList);

        String typeId = so.getTypeId();
        if (FilterParser.isContainedInFilter(PropertyIds.BASE_TYPE_ID, idList)) {
            if (td == null) {
                log.warn("getPropertiesFromObject(), cannot get type definition, a type with id " + typeId
                        + " is unknown");
            } else {
                String baseTypeId = td.getBaseTypeId().value();
                properties.put(PropertyIds.BASE_TYPE_ID, objectFactory.createPropertyIdData(PropertyIds.BASE_TYPE_ID,
                        baseTypeId));
            }
        }


        Map<String, PropertyData<?>> mappedProperties = new HashMap<String, PropertyData<?>>();
        if (requestedIds.containsKey("*")) {
            for (Map.Entry<String, PropertyData<?>> prop : properties.entrySet()) {
                // map property id to property query name
                String queryName = td.getPropertyDefinitions().get(prop.getKey()).getQueryName();
                String localName = td.getPropertyDefinitions().get(prop.getKey()).getLocalName();
                String displayName = td.getPropertyDefinitions().get(prop.getKey()).getDisplayName();
                AbstractPropertyData<?> ad = (AbstractPropertyData<?>) prop.getValue(); // a bit dirty
                ad.setQueryName(queryName);
                ad.setLocalName(localName);
                ad.setDisplayName(displayName);
                mappedProperties.put(queryName, prop.getValue());
            }
        } else {
            // replace all ids with query names or alias:
            for (Map.Entry<String, PropertyData<?>> prop : properties.entrySet()) {
                String queryNameOrAlias = requestedIds.get(prop.getKey());
                String localName = td.getPropertyDefinitions().get(prop.getKey()).getLocalName();
                String displayName = td.getPropertyDefinitions().get(prop.getKey()).getDisplayName();
                AbstractPropertyData<?> ad = (AbstractPropertyData<?>) prop.getValue(); // a bit dirty
                ad.setQueryName(queryNameOrAlias);
                ad.setLocalName(localName);
                ad.setDisplayName(displayName);
                mappedProperties.put(queryNameOrAlias, prop.getValue());
            }
        }
        // add functions:
        BindingsObjectFactory objFactory = new BindingsObjectFactoryImpl();
        for (Entry<String, String> funcEntry : requestedFuncs.entrySet()) {
            PropertyInteger pi = objFactory.createPropertyIntegerData(funcEntry.getKey(), BigInteger.valueOf(100));
              // fixed dummy value
            mappedProperties.put(funcEntry.getValue(), pi);
        }

        Properties props = new PropertiesImpl(mappedProperties.values());
View Full Code Here

          // create an initial temporary service instance to fill the repository

          InMemoryService svc = new InMemoryService(inMemoryServiceParameters, storeManager);

          BindingsObjectFactory objectFactory = new BindingsObjectFactoryImpl();

          String levelsStr = parameters.get(ConfigConstants.FILLER_DEPTH);
          int levels = 1;
          if (null != levelsStr) {
            levels = Integer.parseInt(levelsStr);
View Full Code Here

    public static Properties getPropertiesFromObject(StoredObject so, TypeDefinition td, List<String> requestedIds,
            boolean fillOptionalPropertyData) {
        // build properties collection

        BindingsObjectFactory objectFactory = new BindingsObjectFactoryImpl();
        Map<String, PropertyData<?>> properties = new HashMap<String, PropertyData<?>>();
        so.fillProperties(properties, objectFactory, requestedIds);

        String typeId = so.getTypeId();
        if (FilterParser.isContainedInFilter(PropertyIds.BASE_TYPE_ID, requestedIds)) {
            if (td == null) {
                log.warn("getPropertiesFromObject(), cannot get type definition, a type with id " + typeId
                        + " is unknown");
            } else {
                String baseTypeId = td.getBaseTypeId().value();
                properties.put(PropertyIds.BASE_TYPE_ID,
                        objectFactory.createPropertyIdData(PropertyIds.BASE_TYPE_ID, baseTypeId));
            }
        }

        // fill not-set properties from type definition (as spec requires)
        Map<String, PropertyDefinition<?>> propDefs = td.getPropertyDefinitions();
        for (PropertyDefinition<?> propDef : propDefs.values()) {
            if (!properties.containsKey(propDef.getId()) && FilterParser.isContainedInFilter(propDef.getId(), requestedIds))
                properties.put(propDef.getId(), getEmptyValue(propDef));
        }

        List<PropertyData<?>> propertiesList = new ArrayList<PropertyData<?>>(properties.values());

        if (fillOptionalPropertyData) { // add query name, local name, display
                                        // name
            fillOptionalPropertyData(td, propertiesList);
        }

        Properties props = objectFactory.createPropertiesData(propertiesList);
        return props;
    }
View Full Code Here

    public static Properties getPropertiesFromObject(StoredObject so, TypeDefinition td,
            Map<String, String> requestedIds, Map<String, String> requestedFuncs) {
        // build properties collection

        List<String> idList = new ArrayList<String>(requestedIds.keySet());
        BindingsObjectFactory objectFactory = new BindingsObjectFactoryImpl();
        Map<String, PropertyData<?>> properties = new HashMap<String, PropertyData<?>>();
        so.fillProperties(properties, objectFactory, idList);

        String typeId = so.getTypeId();
        if (FilterParser.isContainedInFilter(PropertyIds.BASE_TYPE_ID, idList)) {
            if (td == null) {
                log.warn("getPropertiesFromObject(), cannot get type definition, a type with id " + typeId
                        + " is unknown");
            } else {
                String baseTypeId = td.getBaseTypeId().value();
                properties.put(PropertyIds.BASE_TYPE_ID,
                        objectFactory.createPropertyIdData(PropertyIds.BASE_TYPE_ID, baseTypeId));
            }
        }

        Map<String, PropertyData<?>> mappedProperties = new HashMap<String, PropertyData<?>>();
        if (requestedIds.containsKey("*")) {
            for (Map.Entry<String, PropertyData<?>> prop : properties.entrySet()) {
                // map property id to property query name
                String queryName = td.getPropertyDefinitions().get(prop.getKey()).getQueryName();
                String localName = td.getPropertyDefinitions().get(prop.getKey()).getLocalName();
                String displayName = td.getPropertyDefinitions().get(prop.getKey()).getDisplayName();
                AbstractPropertyData<?> ad = (AbstractPropertyData<?>) prop.getValue(); // a
                                                                                        // bit
                                                                                        // dirty
                ad.setQueryName(queryName);
                ad.setLocalName(localName);
                ad.setDisplayName(displayName);
                mappedProperties.put(queryName, prop.getValue());
            }
        } else {
            // replace all ids with query names or alias:
            for (Map.Entry<String, PropertyData<?>> prop : properties.entrySet()) {
                String queryNameOrAlias = requestedIds.get(prop.getKey());
                String localName = td.getPropertyDefinitions().get(prop.getKey()).getLocalName();
                String displayName = td.getPropertyDefinitions().get(prop.getKey()).getDisplayName();
                AbstractPropertyData<?> ad = (AbstractPropertyData<?>) prop.getValue(); // a
                                                                                        // bit
                                                                                        // dirty
                ad.setQueryName(queryNameOrAlias);
                ad.setLocalName(localName);
                ad.setDisplayName(displayName);
                mappedProperties.put(queryNameOrAlias, prop.getValue());
            }
        }
        // add functions:
        BindingsObjectFactory objFactory = new BindingsObjectFactoryImpl();
        for (Entry<String, String> funcEntry : requestedFuncs.entrySet()) {
            PropertyInteger pi = objFactory.createPropertyIntegerData(funcEntry.getKey(), BigInteger.valueOf(100));
            // fixed dummy value
            mappedProperties.put(funcEntry.getValue(), pi);
        }

        Properties props = new PropertiesImpl(mappedProperties.values());
View Full Code Here

    public ObjectStoreImpl getStore(String repositoryId) {
        return (ObjectStoreImpl) fMapRepositoryToObjectStore.get(repositoryId);
    }

    public StoreManagerImpl() {
        fObjectFactory = new BindingsObjectFactoryImpl();
    }
View Full Code Here

    public ObjectStoreImpl getStore(String repositoryId) {
        return (ObjectStoreImpl) fMapRepositoryToObjectStore.get(repositoryId);
    }

    public StoreManagerImpl() {
        fObjectFactory = new BindingsObjectFactoryImpl();
    }
View Full Code Here

            // create an initial temporary service instance to fill the
            // repository

            InMemoryService svc = new InMemoryService(inMemoryServiceParameters, storeManager);

            BindingsObjectFactory objectFactory = new BindingsObjectFactoryImpl();

            String levelsStr = parameters.get(ConfigConstants.FILLER_DEPTH);
            int levels = 1;
            if (null != levelsStr) {
                levels = Integer.parseInt(levelsStr);
View Full Code Here

TOP

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

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.