Examples of ObjectDataImpl


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

    public static ObjectData getObjectDataQueryResult(TypeDefinition typeDef, StoredObject so, String user,
            Map<String, String> requestedProperties, Map<String, String> requestedFuncs,
            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter
            ) {

        ObjectDataImpl od = new ObjectDataImpl();

        // build properties collection
        Properties props = getPropertiesFromObject(so, typeDef, requestedProperties, requestedFuncs);

        // fill output object
        if (null != includeAllowableActions && includeAllowableActions) {
            AllowableActions allowableActions = DataObjectCreator.fillAllowableActions(so, user);
            od.setAllowableActions(allowableActions);
        }
       
        if (null != includeRelationships && includeRelationships != IncludeRelationships.NONE)
            od.setRelationships(DataObjectCreator.fillRelationships(includeRelationships, so));

        if (renditionFilter != null && renditionFilter.length() > 0)
            od.setRenditions(DataObjectCreator.fillRenditions(so));

        od.setProperties(props);

        return od;
    }
View Full Code Here

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

     */
    public ObjectData compileObjectType(Set<String> filter, Boolean includeAllowableActions,
            ObjectInfoHandler objectInfos, boolean requiresObjectInfo) {

        try {
            ObjectDataImpl result = new ObjectDataImpl();
            ObjectInfoImpl objectInfo = new ObjectInfoImpl();

            PropertiesImpl properties = new PropertiesImpl();
            filter = filter == null ? null : new HashSet<String>(filter);
            compileProperties(properties, filter, objectInfo);
            result.setProperties(properties);
            if (filter != null && !filter.isEmpty()) {
                log.debug("Unknown filter properties: " + filter.toString());
            }

            if (Boolean.TRUE.equals(includeAllowableActions)) {
                result.setAllowableActions(getAllowableActions());
            }

            if (requiresObjectInfo) {
                objectInfo.setObject(result);
                objectInfos.addObjectInfo(objectInfo);
View Full Code Here

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

    public static ObjectData convertObject(final Map<String, Object> json, final TypeCache typeCache) {
        if (json == null) {
            return null;
        }

        ObjectDataImpl result = new ObjectDataImpl();

        result.setAcl(convertAcl(getMap(json.get(JSON_OBJECT_ACL)), null));
        result.setAllowableActions(convertAllowableActions(getMap(json.get(JSON_OBJECT_ALLOWABLE_ACTIONS))));
        Map<String, Object> jsonChangeEventInfo = getMap(json.get(JSON_OBJECT_CHANGE_EVENT_INFO));
        if (jsonChangeEventInfo != null) {
            ChangeEventInfoDataImpl changeEventInfo = new ChangeEventInfoDataImpl();

            changeEventInfo.setChangeTime(getDateTime(jsonChangeEventInfo, JSON_CHANGE_EVENT_TIME));
            changeEventInfo.setChangeType(getEnum(jsonChangeEventInfo, JSON_CHANGE_EVENT_TYPE, ChangeType.class));

            convertExtension(json, result, CHANGE_EVENT_KEYS);

            result.setChangeEventInfo(changeEventInfo);
        }
        result.setIsExactAcl(getBoolean(json, JSON_OBJECT_EXACT_ACL));
        result.setPolicyIds(convertPolicyIds(getMap(json.get(JSON_OBJECT_POLICY_IDS))));

        Map<String, Object> propMap = getMap(json.get(JSON_OBJECT_SUCCINCT_PROPERTIES));
        if (propMap != null) {
            result.setProperties(convertSuccinctProperties(propMap, getMap(json.get(JSON_OBJECT_PROPERTIES_EXTENSION)),
                    typeCache));
        }
        propMap = getMap(json.get(JSON_OBJECT_PROPERTIES));
        if (propMap != null) {
            result.setProperties(convertProperties(propMap, getMap(json.get(JSON_OBJECT_PROPERTIES_EXTENSION))));
        }

        List<Object> jsonRelationships = getList(json.get(JSON_OBJECT_RELATIONSHIPS));
        if (jsonRelationships != null) {
            result.setRelationships(convertObjects(jsonRelationships, typeCache));
        }
        List<Object> jsonRenditions = getList(json.get(JSON_OBJECT_RENDITIONS));
        if (jsonRenditions != null) {
            result.setRenditions(convertRenditions(jsonRenditions));
        }

        convertExtension(json, result, OBJECT_KEYS);

        return result;
View Full Code Here

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

    /**
     * Creates a CMIS object that only contains an id in the property list.
     * Modified
     */
    protected ObjectData createIdObject(String objectId) {
        ObjectDataImpl object = new ObjectDataImpl();

        PropertiesImpl properties = new PropertiesImpl();
        object.setProperties(properties);

        PropertyIdImpl idProperty = new PropertyIdImpl(PropertyIds.OBJECT_ID, objectId);
        properties.addProperty(idProperty);

        return object;
View Full Code Here

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

    public static ObjectData convert(CmisObjectType object) {
        if (object == null) {
            return null;
        }

        ObjectDataImpl result = new ObjectDataImpl();

        result.setAcl(convert(object.getAcl(), object.isExactACL()));
        result.setAllowableActions(convert(object.getAllowableActions()));
        if (object.getChangeEventInfo() != null) {
            ChangeEventInfoDataImpl changeEventInfo = new ChangeEventInfoDataImpl();
            if (object.getChangeEventInfo().getChangeTime() != null) {
                changeEventInfo.setChangeTime(object.getChangeEventInfo().getChangeTime().toGregorianCalendar());
            }
            changeEventInfo.setChangeType(convert(ChangeType.class, object.getChangeEventInfo().getChangeType()));
            convertExtension(object.getChangeEventInfo(), changeEventInfo);

            result.setChangeEventInfo(changeEventInfo);
        }
        result.setIsExactAcl(object.isExactACL());
        result.setPolicyIds(convert(object.getPolicyIds()));
        result.setProperties(convert(object.getProperties()));
        List<ObjectData> relationships = new ArrayList<ObjectData>();
        for (CmisObjectType cmisObject : object.getRelationship()) {
            relationships.add(convert(cmisObject));
        }
        result.setRelationships(relationships);
        List<RenditionData> renditions = new ArrayList<RenditionData>();
        for (CmisRenditionType rendition : object.getRendition()) {
            renditions.add(convert(rendition));
        }
        result.setRenditions(renditions);

        // handle extensions
        convertExtension(object, result);

        return result;
View Full Code Here

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

        url.addParameter(Constants.PARAM_CHECKIN_COMMENT, checkinComment);
        url.addParameter(Constants.PARAM_MAJOR, major);
        url.addParameter(Constants.PARAM_CHECK_IN, "true");

        // set up object and writer
        ObjectDataImpl object = new ObjectDataImpl();
        object.setProperties(properties);
        // object.setPolicyIds(convertPolicyIds(policies));

        if (object.getProperties() == null) {
            object.setProperties(new PropertiesImpl());
        }

        String mediaType = null;
        InputStream stream = null;
View Full Code Here

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

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_VERSIONIG_STATE, versioningState);

        // set up object and writer
        ObjectDataImpl object = new ObjectDataImpl();
        object.setProperties(properties);
        // TODO
        // object.setPolicyIds(convertPolicyIds(policies));

        String mediaType = null;
        InputStream stream = null;
View Full Code Here

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

        }

        UrlBuilder url = new UrlBuilder(link);

        // set up object and writer
        ObjectDataImpl object = new ObjectDataImpl();
        object.setProperties(properties);
        // TODO
        // object.setPolicyIds(convertPolicyIds(policies));

        final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
View Full Code Here

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

        }

        UrlBuilder url = new UrlBuilder(link);

        // set up object and writer
        ObjectDataImpl object = new ObjectDataImpl();
        object.setProperties(properties);
        // TODO
        // object.setPolicyIds(convertPolicyIds(policies));

        final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.remoting.common.data.common.ObjectDataImpl

        return new EncodableObjectDataImpl(type, encodedValue);
    }

    @Override
    public ObjectData createObjectData(final String type, final Oid oid, final boolean hasCompleteData, final Version version) {
        return new ObjectDataImpl(oid, type, hasCompleteData, version);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.