Search in sources :

Example 6 with GetRequest

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

the class VBulletin method createMemberGroupListRequest.

@Override
protected WebRequest createMemberGroupListRequest() {
    WebRequest request = new GetRequest(httpClient, url, "profile.php");
    request.addParameter(new NameValuePair("do", "editusergroups"));
    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 7 with GetRequest

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

the class Forum method getThreads.

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;
        }
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return new HashSet<IThread>(threadMap.values());
}
Also used : NameValuePair(org.apache.commons.httpclient.NameValuePair) AbstractBBObject(org.eclipse.ecf.internal.bulletinboard.commons.AbstractBBObject) WebRequest(org.eclipse.ecf.internal.bulletinboard.commons.webapp.WebRequest) GetRequest(org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest) ID(org.eclipse.ecf.core.identity.ID) ForumID(org.eclipse.ecf.internal.provider.phpbb.identity.ForumID) IOException(java.io.IOException) URL(java.net.URL) IThread(org.eclipse.ecf.bulletinboard.IThread) HashSet(java.util.HashSet)

Example 8 with GetRequest

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

the class Forum method getThreads.

public Collection<IThread> getThreads() {
    VBParser parser = (VBParser) bb.getParser();
    Map<ID, IThread> threadMap = null;
    WebRequest request = new GetRequest(bb.getHttpClient(), getURL(), "");
    request.addParameter(new NameValuePair("f", String.valueOf(id.getLongValue())));
    try {
        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;
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    return new HashSet<IThread>(threadMap.values());
}
Also used : NameValuePair(org.apache.commons.httpclient.NameValuePair) AbstractBBObject(org.eclipse.ecf.internal.bulletinboard.commons.AbstractBBObject) WebRequest(org.eclipse.ecf.internal.bulletinboard.commons.webapp.WebRequest) GetRequest(org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest) ID(org.eclipse.ecf.core.identity.ID) ForumID(org.eclipse.ecf.internal.provider.vbulletin.identity.ForumID) IOException(java.io.IOException) IThread(org.eclipse.ecf.bulletinboard.IThread) HashSet(java.util.HashSet)

Example 9 with GetRequest

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

the class PHPBB method createMemberPageRequest.

@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;
}
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 10 with GetRequest

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

the class PHPBB method getThread.

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;
    }
    return null;
}
Also used : NameValuePair(org.apache.commons.httpclient.NameValuePair) GetRequest(org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest) IOException(java.io.IOException) IThread(org.eclipse.ecf.bulletinboard.IThread)

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