Hi,
I am having an issue accessing the RoomsService on the EP6 sp2 portal. I am attempting to write a 'My Rooms' iView using the collaboration api, but seem unable to get the service from the portal.
I would like help accessing the RoomsService api and IRooms objects from someone who has successfully achieved this. I have tried using the various ways of referring to the service, such as
IRooms.KM_SERVICE_ID,
IRooms.PORTAL_SERVICE_ID
"Rooms Service".
Any help appreciated.
Thanks,
Mark Hockings
-
ERROR TEXT----
Caused by: com.sapportals.portal.prt.service.ServiceException: Service not found: RoomsService
at com.sapportals.portal.prt.core.service.ServiceManager.getPortalServiceItem(ServiceManager.java:350)
at com.sapportals.portal.prt.core.service.ServiceManager.get(ServiceManager.java:162)
at com.sapportals.portal.prt.runtime.Portal$RuntimeResources.getService(Portal.java:132)
at com.sabmiller.collaboration.iviews.MyRooms$ThePage.retrieveMyRooms(MyRooms.java:74)
at com.sabmiller.collaboration.iviews.MyRooms$ThePage.doProcessBeforeOutput(MyRooms.java:60)
-
-
My Code----
public void doProcessBeforeOutput() throws PageException {
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentContext context = request.getComponentContext();
IPortalComponentSession session = (IPortalComponentSession) request.getComponentSession();
String userId = request.getUser().getUid();
IUser user = null;
try {
user = UMFactory.getUserFactory().getUser(userId);
} catch (UMException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
NameLinkBean bean = new NameLinkBean();
try {
bean = retrieveMyRooms(user);
} catch (UMException e) {
e.printStackTrace();
}
session.putValue("bean",bean);
this.setJspName("myrooms.jsp");
}
public NameLinkBean retrieveMyRooms(IUser user) throws UMException
{
//Get the Rooms API Service
<b>IRooms roomsAPI = (IRooms)PortalRuntime.getRuntimeResources().getService("RoomsService");</b>
//Retrieve Rooms
IRoom[] myRooms = roomsAPI.getAllRoomsForUser(user);
ArrayList roomNames = new ArrayList();
String roomName;
ArrayList roomUrls = new ArrayList();
String roomUrl;
//Iterate over Rooms
NameLinkBean bean = new NameLinkBean();
for(int i = 0; i < myRooms.length; i++){
roomName = myRooms<i>.getName();
roomUrl = myRooms<i>.getRoomAccessURLInternal();
bean.addNameLink(roomName,roomUrl);
}
return bean;
}