cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Accessing 'RoomsService' Service.

Former Member
0 Kudos
85

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;

}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hmmm, interesting. Many thanks for your help. If I get time I will try and narrow down what else changed!

detlev_beutner
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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>

detlev_beutner
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Thanks Detlev.

I have figured out the problem. It required a 'servicesreference' in the portalapps.xml, not a sharing reference.

Cheers,

Mark

detlev_beutner
Active Contributor
0 Kudos

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