Package org.apache.chemistry.opencmis.commons.exceptions

Examples of org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException


    }

    // Helper functions
    private void init(String name, Folder parent) {
        if (!NameValidator.isValidId(name)) {
            throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
        }
        setName(name);
        setParent(parent);
    }
View Full Code Here


    public TypeDefinitionContainer getTypeById(String repositoryId, String typeId, boolean includePropertyDefinitions,
            int depth) {
        TypeManager typeManager = fMapRepositoryToTypeManager.get(repositoryId);
        if (null == typeManager) {
            throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
        }

        TypeDefinitionContainer tc = typeManager.getTypeById(typeId);
        List<TypeDefinitionContainer> result = null;

        if (tc != null) {
            if (depth == -1) {
                result = tc.getChildren();
                if (!includePropertyDefinitions) {
                    cloneTypeList(depth - 1, false, result);
                }
            } else if (depth == 0 || depth < -1) {
                throw new CmisInvalidArgumentException("illegal depth value: " + depth);
            } else {
                result = tc.getChildren();
                cloneTypeList(depth - 1, includePropertyDefinitions, result);
            }
        }
View Full Code Here

    public Collection<TypeDefinitionContainer> getTypeDefinitionList(String repositoryId,
            boolean includePropertyDefinitions) {
        Collection<TypeDefinitionContainer> result;
        TypeManager typeManager = fMapRepositoryToTypeManager.get(repositoryId);
        if (null == typeManager) {
            throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
        }
        Collection<TypeDefinitionContainer> typeColl = typeManager.getTypeDefinitionList();
        if (includePropertyDefinitions) {
            result = typeColl;
        } else {
View Full Code Here

    }

    public List<TypeDefinitionContainer> getRootTypes(String repositoryId) {
        TypeManager typeManager = fMapRepositoryToTypeManager.get(repositoryId);
        if (null == typeManager) {
            throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
        }
        List<TypeDefinitionContainer> rootTypes = typeManager.getRootTypes();

        return rootTypes;
    }
View Full Code Here

    }

    public void clearTypeSystem(String repositoryId) {
        TypeManagerImpl typeManager = fMapRepositoryToTypeManager.get(repositoryId);
        if (null == typeManager) {
            throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
        }

        typeManager.clearTypeSystem();
    }
View Full Code Here

     *            object id
     * @return object for objectId
     */
    protected StoredObject checkStandardParameters(String repositoryId, String objectId) {
        if (null == repositoryId) {
            throw new CmisInvalidArgumentException("Repository Id cannot be null.");
        }

        if (null == objectId) {
            throw new CmisInvalidArgumentException("Object Id cannot be null.");
        }

        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);

        if (objStore == null) {
View Full Code Here

    protected StoredObject checkStandardParametersAllowNull(String repositoryId, String objectId) {

        StoredObject so = null;

        if (null == repositoryId) {
            throw new CmisInvalidArgumentException("Repository Id cannot be null.");
        }

        if (null != objectId) {

            ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
View Full Code Here

    }

    protected StoredObject checkExistingObjectId(ObjectStore objStore, String objectId) {

        if (null == objectId) {
            throw new CmisInvalidArgumentException("Object Id cannot be null.");
        }

        StoredObject so = objStore.getObjectById(objectId);

        if (so == null) {
View Full Code Here

        return so;
    }

    protected void checkRepositoryId(String repositoryId) {
        if (null == repositoryId) {
            throw new CmisInvalidArgumentException("Repository Id cannot be null.");
        }

        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);

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

        return ver;
    }

    public boolean deleteVersion(DocumentVersion version) {
        if (fIsCheckedOut) {
            throw new CmisInvalidArgumentException("version cannot be deleted if document is checked-out: " + version.getId());
        }
        boolean found = fVersions.remove(version);
        if (!found) {
            throw new CmisInvalidArgumentException("Version is not contained in the document:" + version.getId());
        }

        return !fVersions.isEmpty();
    }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException

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.