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

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


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

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

        final InputStream stream = contentStream.getStream();

        // Content-Disposition header for the filename
        Map<String, String> headers = null;
View Full Code Here


        if ((objectId == null) || (objectId.getValue() == null) || (objectId.getValue().length() == 0)) {
            throw new CmisInvalidArgumentException("Object id must be set!");
        }

        // build URL
        UrlBuilder url = getObjectUrl(repositoryId, objectId.getValue());

        // prepare form data
        final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_SET_CONTENT, contentStream);
        formData.addParameter(Constants.PARAM_OVERWRITE_FLAG, overwriteFlag);
        formData.addParameter(Constants.PARAM_CHANGE_TOKEN, (changeToken == null ? null : changeToken.getValue()));
View Full Code Here

        if ((objectId == null) || (objectId.getValue() == null) || (objectId.getValue().length() == 0)) {
            throw new CmisInvalidArgumentException("Object id must be set!");
        }

        // build URL
        UrlBuilder url = getObjectUrl(repositoryId, objectId.getValue());

        // prepare form data
        final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_DELETE_CONTENT);
        formData.addParameter(Constants.PARAM_CHANGE_TOKEN, (changeToken == null ? null : changeToken.getValue()));
View Full Code Here

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

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

        delete(url);

        objectId.setValue(null);
View Full Code Here

    public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
            BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
        // build URL
        UrlBuilder url = getRepositoryUrl(repositoryId);

        // prepare form data
        final FormDataWriter formData = new FormDataWriter(Constants.CMISACTION_QUERY);
        formData.addParameter(Constants.PARAM_Q, statement);
        formData.addParameter(Constants.PARAM_SEARCH_ALL_VERSIONS, searchAllVersions);
View Full Code Here

    }

    public ObjectList getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
            String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems, ExtensionsData extension) {
        // build URL
        UrlBuilder url = getRepositoryUrl(repositoryId, Constants.SELECTOR_CONTENT_CHANGES);
        url.addParameter(Constants.PARAM_SUB_RELATIONSHIP_TYPES,
                changeLogToken == null ? null : changeLogToken.getValue());
        url.addParameter(Constants.PARAM_PROPERTIES, includeProperties);
        url.addParameter(Constants.PARAM_FILTER, filter);
        url.addParameter(Constants.PARAM_POLICY_IDS, includePolicyIds);
        url.addParameter(Constants.PARAM_ACL, includeAcl);
        url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);

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

        if (link == null) {
            throw new CmisObjectNotFoundException("Unknown repository or type!");
        }

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_PROPERTY_DEFINITIONS, includePropertyDefinitions);
        url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
        url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);

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

        if (link == null) {
            throw new CmisObjectNotFoundException("Unknown repository or type!");
        }

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_DEPTH, depth);
        url.addParameter(Constants.PARAM_PROPERTY_DEFINITIONS, includePropertyDefinitions);

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

    @SuppressWarnings("unchecked")
    protected List<RepositoryInfo> getRepositoriesInternal(String repositoryId) {
        List<RepositoryInfo> repInfos = new ArrayList<RepositoryInfo>();

        // retrieve service doc
        UrlBuilder url = new UrlBuilder(getServiceDocURL());
        url.addParameter(Constants.PARAM_REPOSITORY_ID, repositoryId);

        // read and parse
        HttpUtils.Response resp = read(url);
        ServiceDoc serviceDoc = parse(resp.getStream(), ServiceDoc.class);
View Full Code Here

                : Constants.TEMPLATE_OBJECT_BY_PATH), parameters);
        if (link == null) {
            throw new CmisObjectNotFoundException("Unknown repository!");
        }

        UrlBuilder url = new UrlBuilder(link);
        // workaround for missing template parameter in the CMIS spec
        if (returnVersion != null && returnVersion != ReturnVersion.THIS) {
            url.addParameter(Constants.PARAM_RETURN_VERSION, returnVersion);
        }

        // read and parse
        HttpUtils.Response resp = read(url);
        AtomEntry entry = parse(resp.getStream(), AtomEntry.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.