Package org.apache.chemistry.opencmis.inmemory.storedobj.api

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


     *            object id
     * @return object for objectId
     */
    protected StoredObject checkStandardParameters(String repositoryId, String objectId) {

        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);

        if (objStore == null)
            throw new CmisObjectNotFoundException("Unknown repository id: " + repositoryId);

        StoredObject so = objStore.getObjectById(objectId);

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

        return so;
View Full Code Here


        return so;
    }

    protected void checkRepositoryId(String repositoryId) {
        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);

        if (objStore == null)
            throw new CmisObjectNotFoundException("Unknown repository id: " + repositoryId);
    }
View Full Code Here

        return rootTypes;
    }

    public RepositoryInfo getRepositoryInfo(String repositoryId) {
        ObjectStore sm = fMapRepositoryToObjectStore.get(repositoryId);
        if (null == sm)
            return null;

        RepositoryInfo repoInfo = createDefaultRepositoryInfo(repositoryId);
View Full Code Here

        typeManager.initTypeSystem(typeDefs);
    }

    private RepositoryInfo createDefaultRepositoryInfo(String repositoryId) {
        ObjectStore objStore = getObjectStore(repositoryId);
        String rootFolderId = objStore.getRootFolder().getId();
        // repository info
        RepositoryInfoImpl repoInfo;
        repoInfo = new RepositoryInfoImpl();
        repoInfo.setId(repositoryId == null ? "inMem" : repositoryId);
        repoInfo.setName("InMemory Repository");
View Full Code Here

    public ObjectList query(String user, String repositoryId, String statement, Boolean searchAllVersions,
            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
            BigInteger maxItems, BigInteger skipCount) {
        TypeManager tm = getTypeManager(repositoryId);
        ObjectStore objectStore = getObjectStore(repositoryId);

        InMemoryQueryProcessor queryProcessor = new InMemoryQueryProcessor();
        ObjectList objList = queryProcessor.query(tm, objectStore, user, repositoryId, statement, searchAllVersions,
                includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount);
View Full Code Here

    public void deleteObjectOrCancelCheckOut(CallContext context, String repositoryId, String objectId,
            Boolean allVersions, ExtensionsData extension) {

        LOG.debug("start deleteObject()");
        checkStandardParameters(repositoryId, objectId);
        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
        LOG.info("delete object for id: " + objectId);

        // check if it is the root folder
        if (objectId.equals(objectStore.getRootFolder().getId()))
            throw new CmisNotSupportedException("You can't delete a root folder");

        objectStore.deleteObject(objectId);
        LOG.debug("stop deleteObject()");
    }
View Full Code Here

        if (null == unfileObjects)
            unfileObjects = UnfileObject.DELETE;
        if (null == continueOnFailure)
            continueOnFailure = false;

        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);

        if (null == so)
            throw new RuntimeException("Cannot delete object with id  " + folderId + ". Object does not exist.");

        if (!(so instanceof Folder))
            throw new RuntimeException("deleteTree can only be invoked on a folder, but id " + folderId
                    + " does not refer to a folder");

        if (unfileObjects == UnfileObject.UNFILE)
            throw new CmisNotSupportedException("This repository does not support unfile operations.");

        // check if it is the root folder
        if (folderId.equals(objectStore.getRootFolder().getId()))
            throw new CmisNotSupportedException("You can't delete a root folder");

        // recursively delete folder
        deleteRecursive(objectStore, (Folder) so, continueOnFailure, allVersions, failedToDeleteIds);
View Full Code Here

    public AllowableActions getAllowableActions(CallContext context, String repositoryId, String objectId,
            ExtensionsData extension) {

        LOG.debug("start getAllowableActions()");
        StoredObject so = checkStandardParameters(repositoryId, objectId);
        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);

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

        String user = context.getUsername();
View Full Code Here

            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
            Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension, ObjectInfoHandler objectInfos) {

        LOG.debug("start getObjectByPath()");
        checkRepositoryId(repositoryId);
        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
        StoredObject so = objectStore.getObjectByPath(path);

        if (so == null)
            throw new CmisObjectNotFoundException("Unknown path: " + path);

        String user = context.getUsername();
View Full Code Here

        LOG.debug("start moveObject()");
        StoredObject so = checkStandardParameters(repositoryId, objectId.getValue());
        Folder targetFolder = null;
        Folder sourceFolder = null;
        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
        Filing spo = null;

        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
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore

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.