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

Examples of org.apache.chemistry.opencmis.commons.impl.UrlBuilder


        return (newObj == null ? null : newObj.getId());
    }

    public AllowableActions getAllowableActions(String repositoryId, String objectId, ExtensionsData extension) {
        // build URL
        UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_ALLOWABLEACTIONS);

        // read and parse
        HttpUtils.Response resp = read(url);
        Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
View Full Code Here


            if (link == null) {
                throwLinkException(repositoryId, folderId, Constants.REL_DOWN, Constants.MEDIATYPE_CHILDREN);
            }
        }

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_VERSIONIG_STATE, versioningState);

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
        object.setPolicyIds(convertPolicyIds(policies));
View Full Code Here

    public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
            IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
            Boolean includeAcl, ExtensionsData extension) {
        // build URL
        UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_OBJECT);
        url.addParameter(Constants.PARAM_FILTER, filter);
        url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
        url.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
        url.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
        url.addParameter(Constants.PARAM_POLICY_IDS, includePolicyIds);
        url.addParameter(Constants.PARAM_ACL, includeAcl);

        // read and parse
        HttpUtils.Response resp = read(url);
        Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
View Full Code Here

        if (link == null) {
            throwLinkException(repositoryId, folderId, Constants.REL_DOWN, Constants.MEDIATYPE_CHILDREN);
        }

        UrlBuilder url = new UrlBuilder(link);

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
        object.setPolicyIds(convertPolicyIds(policies));
View Full Code Here

            if (link == null) {
                throwLinkException(repositoryId, folderId, Constants.REL_DOWN, Constants.MEDIATYPE_CHILDREN);
            }
        }

        UrlBuilder url = new UrlBuilder(link);

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
        object.setPolicyIds(convertPolicyIds(policies));
View Full Code Here

        if (link == null) {
            throwLinkException(repositoryId, sourceId, Constants.REL_RELATIONSHIPS, Constants.MEDIATYPE_FEED);
        }

        UrlBuilder url = new UrlBuilder(link);

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
        object.setPolicyIds(convertPolicyIds(policies));
View Full Code Here

        if (link == null) {
            throwLinkException(repositoryId, objectId.getValue(), Constants.REL_SELF, Constants.MEDIATYPE_ENTRY);
        }

        UrlBuilder url = new UrlBuilder(link);
        if (changeToken != null) {
            url.addParameter(Constants.PARAM_CHANGE_TOKEN, changeToken.getValue());
        }

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
View Full Code Here

    public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
            IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
            Boolean includeAcl, ExtensionsData extension) {
        // build URL
        UrlBuilder url = getPathUrl(repositoryId, path, Constants.SELECTOR_OBJECT);
        url.addParameter(Constants.PARAM_FILTER, filter);
        url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
        url.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
        url.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
        url.addParameter(Constants.PARAM_POLICY_IDS, includePolicyIds);
        url.addParameter(Constants.PARAM_ACL, includeAcl);

        // read and parse
        HttpUtils.Response resp = read(url);
        Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
View Full Code Here

        if (link == null) {
            throwLinkException(repositoryId, objectId, Constants.REL_SELF, Constants.MEDIATYPE_ENTRY);
        }

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_ALL_VERSIONS, allVersions);

        delete(url);
    }
View Full Code Here

        if (link == null) {
            throwLinkException(repositoryId, folderId, Constants.REL_DOWN, Constants.MEDIATYPE_DESCENDANTS);
        }

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_ALL_VERSIONS, allVersions);
        url.addParameter(Constants.PARAM_UNFILE_OBJECTS, unfileObjects);
        url.addParameter(Constants.PARAM_CONTINUE_ON_FAILURE, continueOnFailure);

        // make the call
        HttpUtils.Response resp = HttpUtils.invokeDELETE(url, getSession());

        // check response code
        if (resp.getResponseCode() == 200 || resp.getResponseCode() == 202 || resp.getResponseCode() == 204) {
            return new FailedToDeleteDataImpl();
        }

        // If the server returned an internal server error, get the remaining
        // children of the folder. We only retrieve the first level, since
        // getDescendants() is not supported by all repositories.
        if (resp.getResponseCode() == 500) {
            link = loadLink(repositoryId, folderId, Constants.REL_DOWN, Constants.MEDIATYPE_CHILDREN);

            if (link != null) {
                url = new UrlBuilder(link);
                // we only want the object ids
                url.addParameter(Constants.PARAM_FILTER, "cmis:objectId");
                url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, false);
                url.addParameter(Constants.PARAM_RELATIONSHIPS, IncludeRelationships.NONE);
                url.addParameter(Constants.PARAM_RENDITION_FILTER, "cmis:none");
                url.addParameter(Constants.PARAM_PATH_SEGMENT, false);
                // 1000 children should be enough to indicate a problem
                url.addParameter(Constants.PARAM_MAX_ITEMS, 1000);
                url.addParameter(Constants.PARAM_SKIP_COUNT, 0);

                // read and parse
                resp = read(url);
                AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.impl.UrlBuilder

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.