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. |
Accepted answer
Sheehan Anderson (1.2k●4)
| answered Jun 26 '13, 12:38 p.m.
JAZZ DEVELOPER edited Jun 26 '13, 12:39 p.m.
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
|
One other answer
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.
Comments
Anuradha Bhamidipaty
commented Jun 25 '13, 2:03 p.m.
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.
|
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.