Skip to Content

Tough Extension Problem: How do get info from a ON_ADD_USERS_TO_ROLES event

Hi,

I am trying to get the information for an ON_ADD_USERS_TO_ROLES event but I have no idea how to set the info.

I get the exception "...ON_ADD_USERS_TO_ROLES. Extension reports Parameter id added_users_to_roomroles not found in extension context"

I need something like what is contained in the following code for "IRoomInfo".

IRoomInfoReader roomInfoReader = (IRoomInfoReader)context.getValue(RoomExtensionParameter.ROOM_INFO);

IExtensionResult result = extensionFactory.createExtensionResult(0);

result.putValue("RoomID", roomInfoReader.getId());

I have decompiled all the SAP extensions and I can't find a single example..

Thanks.

Dick

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Nov 19, 2004 at 09:20 AM

    Hi Dick,

    IRoomUsers roomUsers = (IRoomUsers) ctx.getValue(RoomExtensionParameter.ADDED_USERS_TO_ROOMROLES);
    ...
    

    The IRoomUsers Interface in fact in described at https://media.sdn.sap.com/html/submitted_docs/nw_kmc/javadoc/coll/Rooms/index.html (yeah, something is documented).

    Hope it helps

    Detlev

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 23, 2004 at 08:17 AM

    Hi Detlev,

    You mentioned problems / workarounds when combining the ON_CREATE_ROOM and ON_ADD_USERS_TO_ROLES extensions.

    I always get the following exception when I try to combine the two extensions:

    at ON_CREATE_ROOM. Extension reports Parameter added_users_to_roomroles is missing.

    The two extensons work fine by themselves but they don't work when they are combined. The key from the context appears to be missing but I don't know why

    Code:

    <snip>

    private IParameterInfo roomInfoInfo;

    private IParameterInfo newUserInfo;

    public TestExtension() {

    roomInfoInfo =

    extensionFactory.createSystemParameterInfo(

    RoomExtensionParameter.ROOM_INFO,

    com.sap.ip.collaboration.room.api.IRoomInfoReader.class,

    true);

    newUserInfo =

    extensionFactory.createSystemParameterInfo( RoomExtensionParameter.ADDED_USERS_TO_ROOMROLES,

    com.sap.ip.collaboration.room.api.IRoomUsers.class , true);

    service_key = GENERIC_SERVICE_KEY + "." +

    SERVICE_NAME;

    }

    public IParameterInfo[] getInputParameterInfos(IExtensionPoint extensionPoint) {

    IParameterInfo result[] = null;

    result = new IParameterInfo[2];

    result[0] = roomInfoInfo;

    result[1] = newUserInfo;

    return result;

    }

    </snip>

    Thanks.

    Dick

    Add a comment
    10|10000 characters needed characters exceeded

    • Dear Dick,

      the extension parameter "RoomExtensionParameter.ADDED_USERS_TO_ROOMROLES" is not available at ON_CREATE_ROOM. Therefore you cannot request this parameter in the method "getInputParameterInfos()" for the extension point ON_CREATE_ROOM. You also need a disctinction in the "process()" method:

      if (RoomExtensionPoint.ON_CREATE_ROOM.equals(point)) {
        IRoomInfoReader roomInfo = (IRoomInfoReader)context.getValue(RoomExtensionParameter.ROOM_INFO);
      }
      if (RoomExtensionPoint.ON_ADD_USERS_TO_ROLES.equals(point)) {
        String roleName = (String)context.getValue(RoomExtensionParameter.ADDED_USERS_TO_ROOMROLES);
      }

      In the "Room Extensions Developer Guide", there is a table "Extension Points and Context" that explains, which parameters are available at which extension point.

      This thread gets a little long - would you please open a new thread for each problem?

      Thank you, and best regards

      Johannes

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.