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

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


    public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
            Properties properties, ExtensionsData extension) {
        // we need an object id
        if ((objectId == null) || (objectId.getValue() == null) || (objectId.getValue().length() == 0)) {
            throw new CmisInvalidArgumentException("Object id must be set!");
        }

        // find the link
        String link = loadLink(repositoryId, objectId.getValue(), Constants.REL_SELF, Constants.MEDIATYPE_ENTRY);
View Full Code Here


    }

    public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
            ExtensionsData extension) {
        if ((objectId == null) || (objectId.getValue() == null) || (objectId.getValue().length() == 0)) {
            throw new CmisInvalidArgumentException("Object id must be set!");
        }

        if ((targetFolderId == null) || (targetFolderId.length() == 0) || (sourceFolderId == null)
                || (sourceFolderId.length() == 0)) {
            throw new CmisInvalidArgumentException("Source and target folder must be set!");
        }

        // find the link
        String link = loadLink(repositoryId, targetFolderId, Constants.REL_DOWN, Constants.MEDIATYPE_CHILDREN);
View Full Code Here

    public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
            Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
        // we need an object id
        if ((objectId == null) || (objectId.getValue() == null)) {
            throw new CmisInvalidArgumentException("Object ID must be set!");
        }

        // we need content
        if ((contentStream == null) || (contentStream.getStream() == null) || (contentStream.getMimeType() == null)) {
            throw new CmisInvalidArgumentException("Content must be set!");
        }

        // find the link
        String link = loadLink(repositoryId, objectId.getValue(), Constants.REL_EDITMEDIA, null);
View Full Code Here

    public void deleteContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
            ExtensionsData extension) {
        // we need an object id
        if ((objectId == null) || (objectId.getValue() == null)) {
            throw new CmisInvalidArgumentException("Object ID must be set!");
        }

        // find the link
        String link = loadLink(repositoryId, objectId.getValue(), Constants.REL_EDITMEDIA, null);
View Full Code Here

    // ---- internal ----

    private static void checkCreateProperties(Properties properties) {
        if ((properties == null) || (properties.getProperties() == null)) {
            throw new CmisInvalidArgumentException("Properties must be set!");
        }

        if (!properties.getProperties().containsKey(PropertyIds.OBJECT_TYPE_ID)) {
            throw new CmisInvalidArgumentException("Property " + PropertyIds.OBJECT_TYPE_ID + " must be set!");
        }

        if (properties.getProperties().containsKey(PropertyIds.OBJECT_ID)) {
            throw new CmisInvalidArgumentException("Property " + PropertyIds.OBJECT_ID + " must not be set!");
        }
    }
View Full Code Here

        StoredObject so = super.checkIn(context, repositoryId, objectId, addAces, removeAces, extension);
//        StoredObject container = so instanceof DocumentVersion ? ((DocumentVersion)so).getParentDocument() : so;
       
        if (null != addAces || null != removeAces)
            throw new CmisInvalidArgumentException(
                    "version specific ACLs are not supported, addAces and removeAces must be null.");
       
        checkWriteAccess(repositoryId, context.getUsername(), so);
        return so;
    }
View Full Code Here

        StoredObject so;
        List<ObjectData> res = new ArrayList<ObjectData>();
        if (null == versionSeriesId)
            versionSeriesId = objectId;
        if (null == versionSeriesId)
            throw new CmisInvalidArgumentException("getAllVersions requires a version series id, but ist was null.");
        so = validator.getAllVersions(context, repositoryId, objectId, versionSeriesId, extension);

        if (!(so instanceof VersionedDocument)) {
            so = validator.getObject(context, repositoryId, objectId, extension)
            ObjectData objData = getObject(context, repositoryId, objectId, filter, includeAllowableActions,
View Full Code Here

                    includeRelationships, extension, objectInfos);
        } else if (so instanceof Document) {
            objData = getObject(context, repositoryId, so.getId(), filter, includeAllowableActions,
                    includeRelationships, extension, objectInfos);
        } else {
            throw new CmisInvalidArgumentException("Object is not instance of a document (version series)");
        }

        // provide information for Atom links for version series:
        if (context.isObjectInfoRequired()) {
            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
View Full Code Here

            VersionedDocument verDoc = (VersionedDocument) so;
            latestVersionObject = verDoc.getLatestVersion(major);
        } else if (so instanceof Document) {
            latestVersionObject = so;
        } else {
            throw new CmisInvalidArgumentException("Object is not instance of a document (version series)");
        }

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

        TypeDefinition td = fStoreManager.getTypeById(repositoryId, latestVersionObject.getTypeId()).getTypeDefinition();
View Full Code Here

        DocumentTypeCreationHelper.mergePropertyDefinitions(getPropertyDefinitions(), propertyDefinitions);
    }

    private void init(String id, String displayName) {
        if (!NameValidator.isValidId(id)) {
            throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
        }

        setBaseTypeId(BaseTypeId.CMIS_FOLDER);
        setId(id);
        if (displayName == null) {
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.