use of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest in project ecf by eclipse.
the class MemberGroup method attainDetailsFetched.
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();
}
}
}
use of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest in project ecf by eclipse.
the class MemberGroup method getMembers.
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);
}
}
} catch (IOException e) {
e.printStackTrace();
}
return new HashSet<IMember>(map.values());
}
use of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest in project ecf by eclipse.
the class PHPBB method getMessage.
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;
((Member) author).setBulletinBoard(this);
return msg;
}
return null;
}
use of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest in project ecf by eclipse.
the class PHPBB 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;
}
use of org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest in project ecf by eclipse.
the class VBulletin method getThread.
public IThread getThread(ID id) throws BBException {
GetRequest request = new GetRequest(httpClient, url, "showthread.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;
}
Aggregations