cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Room Id

Former Member
0 Kudos

Hi

I would like to develop a custom Iview for collaboration.

IRoom room = roomsAPI.getRoom("c0514d6b-57ab-2810-dcaf-8ab435de7871");

response.write(room.getDescription());

response.write(room.getName());

response.write(""+room.getLastModified());

In the above code i am hardcoding the room Id. But my requirement once user selects a particular room in a room directory. I would like to capture the room id of that room?

Experts!! Any coding snippet is appreciated.

Thanks & Regards

Ravi

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI,

To add to Patricio Garcia's post

In the given link goto -> Using and Extending the KMC Platform -> Collaboration -> How to Use the Rooms API.

Code snippet

============

IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();

IUser user;

user = request.getUser();

IRooms roomsAPI = (IRooms) PortalRuntime.getRuntimeResources().getService(

IRooms.PORTAL_SERVICE_ID);

IRoom[] <b>allUserRooms</b> = roomsAPI.getAllRoomsForUser(user);

for (int i = 0; i < allUserRooms.length; i++) {

Vector val = new Vector();

String roomName = allUserRooms<i>.getName();

}

The method .getName is a method for IRoom.

I have created an IRoom array for holding all the rooms available for the user[allUserRooms]. Then i am getting the name of each room by iterating through the array.

Message was edited by: Kirupanand Venkatapathi

Former Member
0 Kudos

Hi Venkatapathi

I gone through your code:

But the problem is there is no method like allUserRooms.getName().

Is it a working code or Let me know If I am doing any mistake.

Can u reply as as possible.

Thanks & Regards

ravi

Former Member
0 Kudos

hi ravi,

As kiru already said, he is iterating through the array.

IRooms roomsAPI = (IRooms) PortalRuntime.getRuntimeResources().getService(IRooms.PORTAL_SERVICE_ID);

IRoom[] allUserRooms = roomsAPI.getAllRoomsForUser(request.getUser());

for(int i=0;i<allUserRooms.length;i++){

String roomName = <b>allUserRooms[ i].getName();</b>

}

Former Member
0 Kudos

Hi Kiru

My actual requirement is below:

I have created a room template with documents, room info, tasks, member lists, member roles....

and I have created a new room basing on the above room template. When I am creating new room i am giving a long description and once i entered the room navigate through room info page the description is expanded with horizontal bar.

But my requirement is to split the description into two to three lines.(with out using horizontal bar).

For that, Should i have to create a new custom iview.

Do you have any idea on how to handle the above problem?

Don't worry about your reward points.

Thanks

Ravi

Former Member
0 Kudos

Hi,

Did u try to use IRooms in Scheduler or abstractportalcomponent.

In abstractportalcomponent it works , but am doing in scheduler and am unable to get IRooms .

Am getting following error . can you help me.......

am getting following exception while trying to retrieve IRooms object. Exception coming at line .

roomsAPI =

(IRooms) PortalRuntime.getRuntimeResources().getService(

IRooms.PORTAL_SERVICE_ID);

Detailed Exception In log file .

processing ERROR [ThreadPool.Worker3 2006-08-08 23:05:04] Log4jExampleUsage: Application encountered an internal exception Message Is :

java.lang.ClassCastException

Message was edited by: kaushik1 meduri1

Former Member
0 Kudos

Hi,

How to Use the Rooms API

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/knowledge management and collaboration developers guide.html

Patricio.