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

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


    private ObjectInFolderList getChildrenIntern(String repositoryId, String folderId, String filter, String orderBy,
            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
            Boolean includePathSegments, int maxItems, int skipCount, boolean folderOnly, ObjectInfoHandler objectInfos,
            String user) {

        ObjectInFolderListImpl result = new ObjectInFolderListImpl();
        List<ObjectInFolderData> folderList = new ArrayList<ObjectInFolderData>();
        ObjectStore fs = fStoreManager.getObjectStore(repositoryId);
        StoredObject so = fs.getObjectById(folderId);
        Folder folder = null;

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

        if (so instanceof Folder) {
            folder = (Folder) so;
        }
        else {
            return null; // it is a document and has no children
        }

        Children.ChildrenResult children = folderOnly ? folder.getFolderChildren(maxItems, skipCount, user) : folder
                .getChildren(maxItems, skipCount, user);

        for (StoredObject spo : children.getChildren()) {
            ObjectInFolderDataImpl oifd = new ObjectInFolderDataImpl();
            if (includePathSegments != null && includePathSegments) {
                oifd.setPathSegment(spo.getName());
            }

            TypeDefinition typeDef = fStoreManager.getTypeById(repositoryId, spo.getTypeId()).getTypeDefinition();
            ObjectData objectData = PropertyCreationHelper.getObjectData(typeDef, spo, filter, user, includeAllowableActions,
                    includeRelationships, renditionFilter, false, false, null);

            oifd.setObject(objectData);
            folderList.add(oifd);
            // add additional information for Atom
            if (objectInfos != null) {
                ObjectInfoImpl objectInfo = new ObjectInfoImpl();
                fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, spo, objectInfo);
                objectInfos.addObjectInfo(objectInfo);
            }

        }
        result.setObjects(folderList);
        result.setNumItems(BigInteger.valueOf(children.getNoItems()));
        result.setHasMoreItems(children.getNoItems() > skipCount + folderList.size());

        if (objectInfos != null) {
            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
            objectInfos.addObjectInfo(objectInfo);
View Full Code Here

TOP

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

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.