Package org.eclipse.ecf.internal.bulletinboard.commons.webapp

Examples of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest


    return sessionId;
  }

  public List<IForum> getForums() {
    if (cachedForums.isEmpty()) {
      GetRequest request = new GetRequest(httpClient, url, "");
      try {
        request.execute();
        String resp = request.getResponseBodyAsString();
        request.releaseConnection();
        cachedForums = getParser().parseForums(resp);
        for (Forum forum : cachedForums.values()) {
          forum.setBulletinBoard(this);
        }
      } catch (IOException e) {
View Full Code Here


    return (PHPBBParser) this.parser;
  }

  @Override
  protected WebRequest createMemberListRequest() {
    return new GetRequest(httpClient, url, "memberlist.php");
  }
View Full Code Here

    return new GetRequest(httpClient, url, "memberlist.php");
  }

  @Override
  protected WebRequest createMemberPageRequest(ID id) {
    WebRequest request = new GetRequest(httpClient, url, "profile.php");

    NameValuePair params[] = {
        new NameValuePair("mode", "viewprofile"),
        new NameValuePair("u", String.valueOf(((MemberID) id)
            .getLongValue())) };
    request.setParameters(params);
    return request;
  }
View Full Code Here

    return request;
  }

  @Override
  protected WebRequest createMemberGroupListRequest() {
    return new GetRequest(httpClient, url, "groupcp.php");
  }
View Full Code Here

      throw new BBException(e);
    }
  }

  public IThread getThread(ID id) throws BBException {
    GetRequest request = new GetRequest(httpClient, url, "viewtopic.php");
    request.addParameter(new NameValuePair("t", String
        .valueOf(((ThreadID) id).getLongValue())));
    String resp = null;
    try {
      request.execute();
      resp = request.getResponseBodyAsString();
    } catch (IOException e) {
      e.printStackTrace();
    }
    request.releaseConnection();
    if (resp != null) {
      Thread t = getParser().parseThreadPageForThreadAttributes(resp);
      t.setBulletinBoard(this);
      return t;
    }
View Full Code Here

    }
    return null;
  }

  public IThreadMessage getMessage(ID id) throws BBException {
    GetRequest request = new GetRequest(httpClient, url, "viewtopic.php");
    request.addParameter(new NameValuePair("p", String
        .valueOf(((ThreadMessageID) id).getLongValue())));
    String resp = null;
    try {
      request.execute();
      resp = request.getResponseBodyAsString();
    } catch (IOException e) {
      e.printStackTrace();
    }
    request.releaseConnection();
    if (resp != null) {
      ThreadMessage msg = getParser().parseRequestedMessage(
          (ThreadMessageID) id, resp);
      msg.setBulletinBoard(this);
      IMember author = msg.author;
View Full Code Here

    return null;
  }

  public String getTitle() throws BBException {
    if (this.title == null) {
      GetRequest request = new GetRequest(httpClient, url, "");
      String resp = null;
      try {
        request.execute();
        resp = request.getResponseBodyAsString();
      } catch (IOException e) {
        throw new BBException(e);
      }
      request.releaseConnection();
      if (resp != null) {
        this.title = getParser().parseTitle(resp);
      }
    }
    return this.title;
View Full Code Here

  public Collection<IThread> getThreads() {
    PHPBBParser parser = (PHPBBParser) bb.getParser();
    Map<ID, IThread> threadMap = null;
    try {
      WebRequest request = new GetRequest(bb.getHttpClient(), new URL(id
          .toExternalForm()), "");
      request.addParameter(new NameValuePair("f", String.valueOf(id
          .getLongValue())));
      request.execute();
      String resp = request.getResponseBodyAsString();
      request.releaseConnection();
      threadMap = parser.parseThreads(resp);
      for (IThread thread : threadMap.values()) {
        ((AbstractBBObject) thread).setBulletinBoard(bb);
        ((Thread) thread).forum = this;
      }
View Full Code Here

    this.detailsFetched = false;
  }

  private void attainDetailsFetched() {
    if (!detailsFetched) {
      GetRequest request = new GetRequest(bb.getHttpClient(),
          bb.getURL(), "groupcp.php");
      request.addParameter(new NameValuePair("g", String.valueOf(id
          .getLongValue())));
      String resp = null;
      try {
        request.execute();
        resp = request.getResponseBodyAsString();
      } catch (IOException e) {
        e.printStackTrace();
      }
      request.releaseConnection();
      if (resp != null) {
        MemberGroup group = ((PHPBBParser) bb.getParser())
            .parseMemberGroup(resp);
        group.detailsFetched = true;
        this.description = group.getDescription();
View Full Code Here

    return description;
  }

  public Collection<IMember> getMembers() {
    Map<ID, IMember> map = Collections.emptyMap();
    GetRequest request = new GetRequest(bb.getHttpClient(), bb.getURL(),
        "groupcp.php");
    request.addParameter(new NameValuePair("g", String.valueOf(id
        .getLongValue())));
    try {
      request.execute();
      String str = request.getResponseBodyAsString();
      request.releaseConnection();
      if (str != null) {
        map = bb.getParser().parseMembers(str);
        for (IMember member : map.values()) {
          ((AbstractBBObject) member).setBulletinBoard(bb);
        }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest

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.