on 2004 Oct 06 4:26 PM
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
markjhockings@yahoo.co.uk
-
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;
}
hmmm, interesting. Many thanks for your help. If I get time I will try and narrow down what else changed!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
it's just one hour ago that I've done that, without any problems, EP6 SP2.
IRooms roomsAPI = (IRooms)
PortalRuntime.getRuntimeResources().getService(
IRooms.PORTAL_SERVICE_ID);
should work perfectly. If not, has the exception thrown been the same as the one you printed here?
Did you add <i>com.sap.netweaver.coll.appl.room</i> to the value of the (Private) SharingReference property?!
Hope it helps
Detlev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Detlev,
Many thanks for your input.
Attached is my PortalApps.xml. The same exception is being thrown as in the original post. Any other ideas?
-
Portalapps.xml----
<?xml version="1.0" encoding="UTF-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="com.sap.netweaver.coll.appl.room,htmlb,usermanagement,knowledgemanagement,com.sap.netweaver.coll.shared"/>
</application-config>
<components>
<component name="MyRooms">
<component-config>
<property name="ClassName"
value="com.sabmiller.collaboration.iviews.MyRooms"/>
<property name="SecurityZone"
value="com.sabmiller.collaboration.iviews/high_safety"/>
</component-config>
<component-profile>
<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
</component-profile>
</component>
</components>
<services/>
</application>
Hi Mark,
I've no quick idea...
- Your coding (com.sabmiller.collaboration.iviews.MyRooms) is within the private part of the portal app?
- When you start your EP, is there any error message within the corresponding error log (under console_logs)?
- To be sure, please use the variation I have used and publish the whole stack trace.
- Which EP version - SP? HF?
Hope it helps
Detlev
PS: For such cases, it is often a great deal to reduce the complete project to a minimum, so your class to just referencing the RoomService and nothing else.
Hi Mark,
nice to hear that it works, but the reason must be different.
This is my portalapp.xml, definitely working, EP6 SP2 P4:
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="htmlb,com.sap.netweaver.coll.appl.room,com.sap.netweaver.coll.shared,com.sap.netweaver.bc.rf,com.sap.netweaver.bc.util,com.sap.portal.usermanagement"/>
</application-config>
<components>
<component name="RoomAuthorizationSetter">
<component-config>
<property name="ClassName" value="com.xx.xxx.authorization.AuthorizationSetter"/>
<property name="SecurityZone" value="com.xx.xxx.authorization.AuthorizationSetter/LOW_SAFETY"/>
</component-config>
<component-profile>
<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
</component-profile>
</component>
</components>
<services/>
</application>
ServicesReference - at least the portal runtime doc (p. 26) says - is equivalent to SharingReference. If ServicesReference works, SharingReference should do, too. Did you try SharingReference? In your example you have used PrivateSharingReference, that's why I have asked if your coding is in the private or public PAR part.
Best regards
Detlev
User | Count |
---|---|
79 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.