Search in sources :

Example 11 with GetRequest

use of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest in project ecf by eclipse.

the class PHPBB method getForums.

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) {
        // log.error(e);
        }
    }
    return new ArrayList<IForum>(cachedForums.values());
}
Also used : GetRequest(org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest) ArrayList(java.util.ArrayList) IOException(java.io.IOException) IForum(org.eclipse.ecf.bulletinboard.IForum)

Example 12 with GetRequest

use of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest in project ecf by eclipse.

the class VBulletin method getForums.

public List<IForum> getForums() throws BBException {
    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) {
        // log.error(e);
        }
    }
    return new ArrayList<IForum>(cachedForums.values());
}
Also used : GetRequest(org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest) ArrayList(java.util.ArrayList) IOException(java.io.IOException) IForum(org.eclipse.ecf.bulletinboard.IForum)

Example 13 with GetRequest

use of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest in project ecf by eclipse.

the class VBulletin method createMemberPageRequest.

@Override
protected WebRequest createMemberPageRequest(ID id) {
    WebRequest request = new GetRequest(httpClient, url, "member.php");
    NameValuePair[] params = { new NameValuePair("u", String.valueOf(((MemberID) id).getLongValue())) };
    request.setParameters(params);
    return request;
}
Also used : NameValuePair(org.apache.commons.httpclient.NameValuePair) WebRequest(org.eclipse.ecf.internal.bulletinboard.commons.webapp.WebRequest) GetRequest(org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest)

Example 14 with GetRequest

use of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest in project ecf by eclipse.

the class VBulletin method getTitle.

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;
}
Also used : GetRequest(org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest) BBException(org.eclipse.ecf.bulletinboard.BBException) IOException(java.io.IOException)

Aggregations

GetRequest (org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest)14 IOException (java.io.IOException)11 NameValuePair (org.apache.commons.httpclient.NameValuePair)10 WebRequest (org.eclipse.ecf.internal.bulletinboard.commons.webapp.WebRequest)5 IThread (org.eclipse.ecf.bulletinboard.IThread)4 HashSet (java.util.HashSet)3 ID (org.eclipse.ecf.core.identity.ID)3 AbstractBBObject (org.eclipse.ecf.internal.bulletinboard.commons.AbstractBBObject)3 ArrayList (java.util.ArrayList)2 BBException (org.eclipse.ecf.bulletinboard.BBException)2 IForum (org.eclipse.ecf.bulletinboard.IForum)2 IMember (org.eclipse.ecf.bulletinboard.IMember)2 URL (java.net.URL)1 IMemberGroup (org.eclipse.ecf.bulletinboard.IMemberGroup)1 IThreadMessage (org.eclipse.ecf.bulletinboard.IThreadMessage)1 ForumID (org.eclipse.ecf.internal.provider.phpbb.identity.ForumID)1 MemberGroupID (org.eclipse.ecf.internal.provider.phpbb.identity.MemberGroupID)1 ForumID (org.eclipse.ecf.internal.provider.vbulletin.identity.ForumID)1