Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RAM Java API to get community forums

Is there support in RAM Java API to get forums used by a community which are not necessarily linked to an asset?

Specifically, in a community homepage, one can see various tabs: Overview, Configuration, Forums, Statistics, Audit. How do we get a programmatic handle on the content of the Forums tab? These forums and topics are not linked to an asset.

0 votes


Accepted answer

Permanent link
It uses internal API, but the following code should do what you want.

RAMSession session = new RAMSession("http://localhost:8080/ram", "admin", "admin");
RAMCommunity community = session.getCommunity(1003);
AssetIdentification communityAssetId = null;
try {
	Method getInternalCommunity = community.getClass().getDeclaredMethod("getInternalCommunity");
	getInternalCommunity.setAccessible(true);
	CommunitySO internalCommunity = (CommunitySO)getInternalCommunity.invoke(community);
	communityAssetId = internalCommunity.getHomepageAsset().getIdentification();
} catch (SecurityException e) {
	e.printStackTrace();
} catch (NoSuchMethodException e) {
	e.printStackTrace();
} catch (IllegalArgumentException e) {
	e.printStackTrace();
} catch (IllegalAccessException e) {
	e.printStackTrace();
} catch (InvocationTargetException e) {
	e.printStackTrace();
}
		
RAMAsset asset = session.getAsset(communityAssetId);
Forum[] forums = asset.getForums();
for(Forum forum : forums) {
	System.out.println(forum.getTitle());
}
session.release();

Anuradha Bhamidipaty selected this answer as the correct answer

1 vote


One other answer

Permanent link
One way to get them is as an RSS feed. When you open one of these forums there is an RSS link. You would copy that link and then use it with straight HTTP client code to access the forum.

0 votes

Comments

Thanks Richard. Any suggestion on getting the list of forums to start with? Say, if a new forum is created, can it be detected?

No, I don't know how to do that. I don't think there is any.

When you create forums, you have an RSS feed link on the right top corner.
if you click on it, and show your page source, it is XML with RSS tag (http://www.w3schools.com/rss/default.asp)


Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,950

Question asked: Jun 25 '13, 12:51 a.m.

Question was seen: 4,713 times

Last updated: Jun 26 '13, 12:39 p.m.

Related questions
Confirmation Cancel Confirm