It's all about the answers!

Ask a question

New feed subscription titles


enzo zuk (12693) | asked Sep 04 '09, 10:15 a.m.
hi,
how can i get all titles relative to added (by user) feed subscription?
i have the need to fetch these and show in a view, added previously to RTC 2.0 ui...

any hints?

13 answers



permanent link
Work Item & UI Commons Team (1.3k1) | answered Sep 07 '09, 3:49 a.m.
zuk wrote:
hi,
how can i get all titles relative to added (by user) feed
subscription?
i have the need to fetch these and show in a view, added previously to
RTC 2.0 ui...

any hints?


Just call FeedManager.getDefault().getChannel(String url) to get the
feed for the given URL. It provides methods to access news items inside.

--
Benjamin Pasero
Work Item & UI Commons Team

permanent link
enzo zuk (12693) | answered Sep 07 '09, 7:53 a.m.
Just call FeedManager.getDefault().getChannel(String url) to get the
feed for the given URL. It provides methods to access news items inside.


excuse me, i'm afraid there may be a misunderstanding...
i'm interesting to get all titles of the feed subscriptions added by users (the subscripions that are visible in Feed folder), not all the newsItem info...

permanent link
Work Item & UI Commons Team (1.3k1) | answered Sep 07 '09, 9:15 a.m.
zuk wrote:
Just call FeedManager.getDefault().getChannel(String url) to get
the
feed for the given URL. It provides methods to access news items
inside.

excuse me, i'm afraid there may be a misunderstanding...
i'm interesting to get all titles of the feed subscriptions added by
users (the subscripions that are visible in Feed folder), not all the
newsItem info...


com.ibm.team.feed.core.FeedManager.getChannels()

--
Benjamin Pasero
Work Item & UI Commons Team

permanent link
Work Item & UI Commons Team (1.3k1) | answered Sep 07 '09, 9:27 a.m.
Benjamin Pasero wrote:
zuk wrote:
Just call FeedManager.getDefault().getChannel(String url) to get
the
feed for the given URL. It provides methods to access news items
inside.

excuse me, i'm afraid there may be a misunderstanding...
i'm interesting to get all titles of the feed subscriptions added by
users (the subscripions that are visible in Feed folder), not all the
newsItem info...


com.ibm.team.feed.core.FeedManager.getChannels()


And to find out if they are added by the user you could check for the
category (channel.getCategory) matching
"com.ibm.team.feed.core.SystemFeed" which is our special ID for system
feeds (the one pointing to the repository). Note that some of these
could still be added manually by the user.

--
Benjamin Pasero
Work Item & UI Commons Team

permanent link
enzo zuk (12693) | answered Sep 10 '09, 11:35 a.m.

And to find out if they are added by the user you could check for the
category (channel.getCategory) matching
"com.ibm.team.feed.core.SystemFeed" which is our special ID for system
feeds (the one pointing to the repository). Note that some of these
could still be added manually by the user.


this is ok...
but now i have the need to get only the specific feed channel who is opened in that moment, to be more precise for which view is opened.
for example, if i have two subscriptions added by user, my application should react in different way depending on who channel (subscription) is opened;
so i would get the channel name when it is used in rtc.
how can i do this?

regards
enzo

permanent link
Work Item & UI Commons Team (1.3k1) | answered Sep 11 '09, 4:26 a.m.
zuk wrote:
And to find out if they are added by the user you could check for
the
category (channel.getCategory) matching
"com.ibm.team.feed.core.SystemFeed" which is our special
ID for system
feeds (the one pointing to the repository). Note that some of these
could still be added manually by the user.


this is ok...
but now i have the need to get only the specific feed channel who is
opened in that moment, to be more precise for which view is opened.
for example, if i have two subscriptions added by user, my application
should react in different way depending on who channel (subscription)
is opened;
so i would get the channel name when it is used in rtc.
how can i do this?

regards
enzo



You mean opened in the Timeline Editor? Hm, you can use the PlatformUI
facade to get the currently opened editors and then iterate over all
instances of com.ibm.team.feed.ui.internal.itemview.FeedItemView. When
you ask this class for its editor input, you will be able to find out
the feed or feeds that are displayed.

Hope that helps.

--
Benjamin Pasero
Work Item & UI Commons Team

permanent link
enzo zuk (12693) | answered Sep 11 '09, 5:47 a.m.
this is what i need!
where can i find an example for manage PlatformUI facade?
i don't know how use and initialize it...

thanks
enzo

permanent link
Work Item & UI Commons Team (1.3k1) | answered Sep 11 '09, 6:36 a.m.
zuk wrote:
this is what i need!
where can i find an example for manage PlatformUI facade?
i don't know how use and initialize it...

thanks
enzo


Try something like
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences().
But take a look at the API for possible NULL values being returned.

--
Benjamin Pasero
Work Item & UI Commons Team

permanent link
enzo zuk (12693) | answered Sep 14 '09, 11:56 a.m.

Try something like
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences().
But take a look at the API for possible NULL values being returned.


i have tried with


IEditorReference[] e=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
for (int i=0;i<e.length;i++){
System.out.println(e[i].getTitle());

}


but this return only one item, that is "news reader and events".
i'm not able to iterate over all instances of com.ibm.team.feed.ui.internal.itemview.FeedItemView...

i should try something like

Class c=PlatformUI.getWorkbench().getActiveWorkbenchWindow(). getActivePage().getClass().forName("com.ibm.team.feed.ui.internal.itemview.FeedItemView");


?

permanent link
Work Item & UI Commons Team (1.3k1) | answered Sep 15 '09, 4:12 a.m.
zuk wrote:
Try something like

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences().
But take a look at the API for possible NULL values being returned.


i have tried with


IEditorReference[]
e=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
for (int i=0;i<e.length;i++){
System.out.println(e.getTitle());

}


but this return only one item, that is "news reader and
events".
i'm not able to iterate over all instances of
com.ibm.team.feed.ui.internal.itemview.FeedItemView...

i should try something like

Class
c=PlatformUI.getWorkbench().getActiveWorkbenchWindow(). getActivePage().getClass().forName("com.ibm.team.feed.ui.internal.itemview.FeedItemView");


?



No you should not. If more than 1 Feedview is opened, then you will get
each of them using the API I mentioned earlier.

--
Benjamin Pasero
Work Item & UI Commons Team

Your answer


Register or 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.