Examples of Filing


Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing

    public List<StoredObject> getChildren(int maxItems, int skipCount, String user) {
        List<StoredObject> result = new ArrayList<StoredObject>();
        for (String id : fObjStore.getIds()) {
            StoredObject obj = fObjStore.getObject(id);
            Filing pathObj = (Filing) obj;
            if (pathObj.getParents(user).contains(this)) {
                if (pathObj instanceof VersionedDocument) {
                    DocumentVersion ver = ((VersionedDocument) pathObj).getLatestVersion(false);
                    result.add(ver);
                } else if (pathObj instanceof DocumentVersion) {
                    // ignore
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing

    public boolean hasChild(String name) {
        for (String id : fObjStore.getIds()) {
            StoredObject obj = fObjStore.getObject(id);
            if (obj instanceof Filing) {
                Filing pathObj = (Filing) obj;
                if (pathObj.getParents(null).contains(this) && obj.getName().equals(name)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing

        StoredObject[] sos = validator.moveObject(context, repositoryId, objectId, targetFolderId, sourceFolderId, extension);
        StoredObject so = sos[0];
        Folder targetFolder = null;
        Folder sourceFolder = null;
        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
        Filing spo = null;
        String user = context.getUsername();

        if (null == so) {
            throw new CmisObjectNotFoundException("Unknown object: " + objectId.getValue());
        } else if (so instanceof Filing) {
            spo = (Filing) so;
        } else {
            throw new CmisInvalidArgumentException("Object must be folder or document: " + objectId.getValue());
        }

        StoredObject soTarget = objectStore.getObjectById(targetFolderId);
        if (null == soTarget) {
            throw new CmisObjectNotFoundException("Unknown target folder: " + targetFolderId);
        } else if (soTarget instanceof Folder) {
            targetFolder = (Folder) soTarget;
        } else {
            throw new CmisNotSupportedException("Destination " + targetFolderId
                    + " of a move operation must be a folder");
        }

        StoredObject soSource = objectStore.getObjectById(sourceFolderId);
        if (null == soSource) {
            throw new CmisObjectNotFoundException("Unknown source folder: " + sourceFolderId);
        } else if (soSource instanceof Folder) {
            sourceFolder = (Folder) soSource;
        } else {
            throw new CmisNotSupportedException("Source " + sourceFolderId + " of a move operation must be a folder");
        }

        boolean foundOldParent = false;
        for (Folder parent : spo.getParents(user)) {
            if (parent.getId().equals(soSource.getId())) {
                foundOldParent = true;
                break;
            }
        }
        if (!foundOldParent) {
            throw new CmisNotSupportedException("Cannot move object, source folder " + sourceFolderId
                    + "is not a parent of object " + objectId.getValue());
        }

        if (so instanceof Folder && hasDescendant((Folder) so, targetFolder)) {
            throw new CmisNotSupportedException("Destination of a move cannot be a subfolder of the source");
        }

        spo.move(sourceFolder, targetFolder);
        objectId.setValue(so.getId());
        LOG.debug("stop moveObject()");

        TypeDefinition td = fStoreManager.getTypeById(repositoryId, so.getTypeId()).getTypeDefinition();
        ObjectData od = PropertyCreationHelper.getObjectData(td, so, null, user, false,
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing

        // for now we have only folders that have a parent and the in-memory
        // provider only has one
        // parent for each object (no multi-filing)
        List<ObjectParentData> result = null;

        Filing spo = null;
        if (so instanceof Filing) {
            spo = (Filing) so;
        } else {
            return Collections.emptyList();
        }
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing

        // for now we have only folders that have a parent and the in-memory
        // provider only has one
        // parent for each object (no multi-filing)
        List<ObjectParentData> result = null;

        Filing spo = null;
        if (so instanceof Filing) {
            spo = (Filing) so;
        } else {
            return Collections.emptyList();
        }
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing

        StoredObject[] sos = validator.moveObject(context, repositoryId, objectId, targetFolderId, sourceFolderId, extension);
        StoredObject so = sos[0];
        Folder targetFolder = null;
        Folder sourceFolder = null;
        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
        Filing spo = null;
        String user = context.getUsername();

        if (null == so) {
            throw new CmisObjectNotFoundException("Unknown object: " + objectId.getValue());
        } else if (so instanceof Filing) {
            spo = (Filing) so;
        } else {
            throw new CmisInvalidArgumentException("Object must be folder or document: " + objectId.getValue());
        }

        StoredObject soTarget = objectStore.getObjectById(targetFolderId);
        if (null == soTarget) {
            throw new CmisObjectNotFoundException("Unknown target folder: " + targetFolderId);
        } else if (soTarget instanceof Folder) {
            targetFolder = (Folder) soTarget;
        } else {
            throw new CmisNotSupportedException("Destination " + targetFolderId
                    + " of a move operation must be a folder");
        }

        StoredObject soSource = objectStore.getObjectById(sourceFolderId);
        if (null == soSource) {
            throw new CmisObjectNotFoundException("Unknown source folder: " + sourceFolderId);
        } else if (soSource instanceof Folder) {
            sourceFolder = (Folder) soSource;
        } else {
            throw new CmisNotSupportedException("Source " + sourceFolderId + " of a move operation must be a folder");
        }

        boolean foundOldParent = false;
        for (Folder parent : spo.getParents(user)) {
            if (parent.getId().equals(soSource.getId())) {
                foundOldParent = true;
                break;
            }
        }
        if (!foundOldParent) {
            throw new CmisNotSupportedException("Cannot move object, source folder " + sourceFolderId
                    + "is not a parent of object " + objectId.getValue());
        }

        if (so instanceof Folder && hasDescendant((Folder) so, targetFolder)) {
            throw new CmisNotSupportedException("Destination of a move cannot be a subfolder of the source");
        }

        spo.move(sourceFolder, targetFolder);
        objectId.setValue(so.getId());
        LOG.debug("stop moveObject()");

        TypeDefinition td = fStoreManager.getTypeById(repositoryId, so.getTypeId()).getTypeDefinition();
        ObjectData od = PropertyCreationHelper.getObjectData(td, so, null, user, false,
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing

        // for now we have only folders that have a parent and the in-memory
        // provider only has one
        // parent for each object (no multi-filing)
        List<ObjectParentData> result = null;

        Filing spo = null;
        if (so instanceof Filing) {
            spo = (Filing) so;
        } else {
            return Collections.emptyList();
        }
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing

        StoredObject[] sos = validator.moveObject(context, repositoryId, objectId, targetFolderId, sourceFolderId, extension);
        StoredObject so = sos[0];
        Folder targetFolder = null;
        Folder sourceFolder = null;
        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
        Filing spo = null;
        String user = context.getUsername();

        if (null == so) {
            throw new CmisObjectNotFoundException("Unknown object: " + objectId.getValue());
        } else if (so instanceof Filing) {
            spo = (Filing) so;
        } else {
            throw new CmisInvalidArgumentException("Object must be folder or document: " + objectId.getValue());
        }

        StoredObject soTarget = objectStore.getObjectById(targetFolderId);
        if (null == soTarget) {
            throw new CmisObjectNotFoundException("Unknown target folder: " + targetFolderId);
        } else if (soTarget instanceof Folder) {
            targetFolder = (Folder) soTarget;
        } else {
            throw new CmisNotSupportedException("Destination " + targetFolderId
                    + " of a move operation must be a folder");
        }

        StoredObject soSource = objectStore.getObjectById(sourceFolderId);
        if (null == soSource) {
            throw new CmisObjectNotFoundException("Unknown source folder: " + sourceFolderId);
        } else if (soSource instanceof Folder) {
            sourceFolder = (Folder) soSource;
        } else {
            throw new CmisNotSupportedException("Source " + sourceFolderId + " of a move operation must be a folder");
        }

        boolean foundOldParent = false;
        for (Folder parent : spo.getParents(user)) {
            if (parent.getId().equals(soSource.getId())) {
                foundOldParent = true;
                break;
            }
        }
        if (!foundOldParent) {
            throw new CmisNotSupportedException("Cannot move object, source folder " + sourceFolderId
                    + "is not a parent of object " + objectId.getValue());
        }

        if (so instanceof Folder && hasDescendant((Folder) so, targetFolder)) {
            throw new CmisNotSupportedException("Destination of a move cannot be a subfolder of the source");
        }

        spo.move(sourceFolder, targetFolder);
        objectId.setValue(so.getId());
        LOG.debug("stop moveObject()");

        TypeDefinition td = fStoreManager.getTypeById(repositoryId, so.getTypeId()).getTypeDefinition();
        ObjectData od = PropertyCreationHelper.getObjectData(td, so, null, user, false,
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing

    public List<StoredObject> getChildren(int maxItems, int skipCount, String user) {
        List<StoredObject> result = new ArrayList<StoredObject>();
        for (String id : fObjStore.getIds()) {
            StoredObject obj = fObjStore.getObject(id);
            Filing pathObj = (Filing) obj;
            if (fObjStore.hasReadAccess(user, obj) && pathObj.getParents(user).contains(this)) {
                if (pathObj instanceof VersionedDocument) {
                    DocumentVersion ver = ((VersionedDocument) pathObj).getLatestVersion(false);
                    result.add(ver);
                } else if (pathObj instanceof DocumentVersion) {
                    // ignore
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing

    public boolean hasChild(String name) {
        for (String id : fObjStore.getIds()) {
            StoredObject obj = fObjStore.getObject(id);
            if (obj instanceof Filing) {
                Filing pathObj = (Filing) obj;
                if (pathObj.getParents(null).contains(this) && obj.getName().equals(name)) {
                    return true;
                }
            }
        }
        return false;
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.