Examples of UrlBuilder


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

        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

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

        if (link == null) {
            throwLinkException(repositoryId, objectId, Constants.REL_ALLOWABLEACTIONS,
                    Constants.MEDIATYPE_ALLOWABLEACTION);
        }

        UrlBuilder url = new UrlBuilder(link);

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

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

        }

        // TODO FIXME using the content link for non-default streams is
        // incorrect, rel=alternate links should be used (if somehow the
        // stream id is known for them, which isn't the case in CMIS 1.0).
        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_STREAM_ID, streamId);

        // get the content
        HttpUtils.Response resp = HttpUtils.invokeGET(url, getSession(), offset, length);

        // check response code
View Full Code Here

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

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

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_SOURCE_FOLDER_ID, sourceFolderId);

        // set up object and writer
        final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId.getValue()));

        // post move request
View Full Code Here

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

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());
        }

        delete(url);

        objectId.setValue(null);
View Full Code Here

Examples of org.apache.deltacloud.client.utils.UrlBuilder

public class UrlBuilderTest {

  @Test
  public void buildsHost() {
    String host = "jboss.org";
    assertEquals(host, new UrlBuilder(host).toString());
  }
View Full Code Here

Examples of org.beangle.web.url.UrlBuilder

   *
   * @return the full URL of this request
   */
  public String getFullRequestUrl() {
    HttpServletRequest r = getHttpRequest();
    UrlBuilder builder = new UrlBuilder(r.getContextPath());
    builder.scheme(r.getScheme()).serverName(r.getServerName()).port(r.getServerPort());
    builder.requestURI(r.getRequestURI()).pathInfo(r.getPathInfo());
    builder.queryString(r.getQueryString());
    return builder.buildUrl();
  }
View Full Code Here

Examples of org.exoplatform.web.application.URLBuilder

   {
      org.exoplatform.webui.config.Event event = config.getUIComponentEventConfig(name);
      if (event == null)
         return "??config??";
      WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
      URLBuilder urlBuilder = context.getURLBuilder();
      if (urlBuilder == null)
         return "??builder??";
      String confirm = loadConfirmMesssage(event, context, beanId);
      return urlBuilder.createAjaxURL(this, event.getName(), confirm, beanId, params).toString();
   }
View Full Code Here

Examples of org.geomajas.plugin.printing.client.util.UrlBuilder

      public void execute(CommandResponse r) {
        stopProgress();
        if (r instanceof PrintGetTemplateResponse) {
          PrintGetTemplateResponse response = (PrintGetTemplateResponse) r;
          GWT.log("Downloading " + response.getDocumentId(), null);
          UrlBuilder url = new UrlBuilder(GWT.getHostPageBaseURL());
          url.addPath("d/printing").addParameter("documentId", response.getDocumentId());
          url.addParameter("name", (String) fileNameItem.getValue());
          url.addParameter("userToken", command.getUserToken());
          if ("save".equals(downloadTypeGroup.getValue())) {
            url.addParameter("download", "1");
            String encodedUrl = url.toString();
            // create a hidden iframe to avoid popups ???
            HTMLPanel hiddenFrame = new HTMLPanel("<iframe src='" + encodedUrl
                + "'+style='position:absolute;width:0;height:0;border:0'>");
            hiddenFrame.setVisible(false);
            addChild(hiddenFrame);
          } else {
            url.addParameter("download", "0");
            String encodedUrl = url.toString();
            com.google.gwt.user.client.Window.open(encodedUrl, "_blank", null);
          }
        }
      }
    });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.