Examples of ObjectDataImpl


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

    public static ObjectData getObjectData(TypeDefinition typeDef, StoredObject so, String filter, String user,
            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
            Boolean includePolicyIds, Boolean includeACL, ExtensionsData extension) {

        ObjectDataImpl od = new ObjectDataImpl();

        if (so == null) {
            throw new CmisObjectNotFoundException("Illegal object id: null");
        }

        // build properties collection
        List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);
        Properties props = getPropertiesFromObject(so, typeDef, requestedIds, true);

        // fill output object
        if (null != includeAllowableActions && includeAllowableActions) {
            AllowableActions allowableActions = so.getAllowableActions(user);
            od.setAllowableActions(allowableActions);
        }

        if (null != includeACL && includeACL) {
            Acl acl = so instanceof DocumentVersion ? ((DocumentVersion) so).getParentDocument().getAcl() : so.getAcl();
            od.setAcl(acl);
        }
        od.setIsExactAcl(true);

        if (null != includePolicyIds && includePolicyIds) {
            od.setPolicyIds(DataObjectCreator.fillPolicyIds(so));
        }

        if (null != includeRelationships && includeRelationships != IncludeRelationships.NONE) {
            od.setRelationships(DataObjectCreator.fillRelationships(includeRelationships, so, user));
        }

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

        od.setProperties(props);

        // Note: do not set change event info for this call
        return od;
    }
View Full Code Here

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);
            AllowableActions allowableActions = so.getAllowableActions(user);
            od.setAllowableActions(allowableActions);
        }

        od.setAcl(so.getAcl());
        od.setIsExactAcl(true);

        if (null != includeRelationships && includeRelationships != IncludeRelationships.NONE) {
            od.setRelationships(DataObjectCreator.fillRelationships(includeRelationships, so, user));
        }

        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

    private ObjectData getFolderParentIntern(String repositoryId, SingleFiling sop, String filter,
        Boolean includeAllowableActions, IncludeRelationships includeRelationships,
        String user, ObjectInfoHandler objectInfos) {

        ObjectDataImpl parent = new ObjectDataImpl();

        Folder parentFolder = sop.getParent();

        if (null == parentFolder) {
            return null;
        }

        copyFilteredProperties(repositoryId, parentFolder, filter, parent);
       
        parent.setRelationships(DataObjectCreator.getRelationships(includeRelationships, parentFolder, user));
       
        if (includeAllowableActions != null && includeAllowableActions) {
            //  AllowableActions allowableActions = DataObjectCreator.fillAllowableActions(spo, user);
            AllowableActions allowableActions = parentFolder.getAllowableActions(user);
            parent.setAllowableActions(allowableActions);
          }
       
        if (objectInfos != null) {
            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, parentFolder, objectInfo);
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 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

    /**
     * Compiles an object type object from a file or folder.�
     */
    private ObjectData compileObjectType(CallContext context, File file, Set<String> filter,
            boolean includeAllowableActions, boolean includeAcl, boolean userReadOnly, ObjectInfoHandler objectInfos) {
        ObjectDataImpl result = new ObjectDataImpl();
        ObjectInfoImpl objectInfo = new ObjectInfoImpl();

        result.setProperties(compileProperties(file, filter, objectInfo));

        if (includeAllowableActions) {
            result.setAllowableActions(compileAllowableActions(file, userReadOnly));
        }

        if (includeAcl) {
            result.setAcl(compileAcl(file));
            result.setIsExactAcl(true);
        }

        if (context.isObjectInfoRequired()) {
            objectInfo.setObject(result);
            objectInfos.addObjectInfo(objectInfo);
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

   
   public static ObjectData getObjectData(TypeDefinition typeDef, StoredObject so, String filter, String user,
            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
            Boolean includePolicyIds, Boolean includeACL, ExtensionsData extension) {

        ObjectDataImpl od = new ObjectDataImpl();

        if (so == null)
            throw new CmisObjectNotFoundException("Illegal object id: null");

        // build properties collection
        List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);
        Properties props = getPropertiesFromObject(so, typeDef, requestedIds);

        // fill output object
        if (null != includeAllowableActions && includeAllowableActions) {
            AllowableActions allowableActions = DataObjectCreator.fillAllowableActions(so, user);
            od.setAllowableActions(allowableActions);
        }
        if (null != includeACL && includeACL)
            od.setAcl(null);
        od.setIsExactAcl(true);

        if (null != includePolicyIds && includePolicyIds)
            od.setPolicyIds(DataObjectCreator.fillPolicyIds(so));

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

        // Note: do not set change event info for this call
        return od;
    }
View Full Code Here

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

        List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);

        for (StoredObject spo : children) {
            ObjectInFolderDataImpl oifd = new ObjectInFolderDataImpl();
            ObjectDataImpl objectData = new ObjectDataImpl();
            if (includePathSegments != null && includePathSegments)
                oifd.setPathSegment(spo.getName());
            if (includeAllowableActions != null && includeAllowableActions) {
                AllowableActions allowableActions = DataObjectCreator.fillAllowableActions(spo, user);
                objectData.setAllowableActions(allowableActions);
            }
            if (includeRelationships != null && includeRelationships != IncludeRelationships.NONE) {
                objectData.setRelationships(null /* f.getRelationships() */);
            }
            if (renditionFilter != null && renditionFilter.length() > 0) {
                objectData.setRelationships(null /*
                                                  * f.getRenditions(renditionFilter
                                                  * )
                                                  */);
            }

            TypeDefinition td = fStoreManager.getTypeById(repositoryId, spo.getTypeId()).getTypeDefinition();
            Properties props = PropertyCreationHelper.getPropertiesFromObject(spo, td, requestedIds);
            objectData.setProperties(props);

            oifd.setObject(objectData);
            folderList.add(oifd);
            // add additional information for Atom
            if (objectInfos != null) {
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.