Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Display Lobby list

Avatar

Level 3

I want to display a list of users pending in the lobby in a tilelist. Like I have for the list of owners and viewers with dataProvider="{cSession.userManager.hostCollection}". I need displayName, userIcon and the customfield. I have tried a couple of ways but with no success.

<mx:TileList focusRoundedCorners="10" cornerRadius="10" id="userQueList" borderThickness="0" backgroundAlpha="0" dataProvider="{cSession.roomManager.knockingQueue.pendingQueue}" rowCount="1" height="100%">

<mx:itemRenderer>

<mx:Component>

<mx:HBox cornerRadius="10" width="200">

<mx:Image source="{data.usericonURL}" scaleX=".25" scaleY=".25"/>

<mx:VBox>

    <mx:Label text="{data.displayName}" styleName="title" />

    <mx:Label text="{data.customFields['LocationName']}" styleName="description" />

</mx:VBox>

</mx:HBox>

</mx:Component>

</mx:itemRenderer>

</mx:TileList>

Keith.

14 Replies

Avatar

Former Community Member

Hi,

Fields like CustomField , usericonURL etc are part of UserDescriptor which gets created when a user is let into the room. As long as users are waiting for approval to get into the room, they won't be in the UserManager and will not have these fields.

Look at  the example KnockingQueue in examples folder that shows exactly how we can display the pending Queue which is part of the roomManager. At that point, it contains certain basic properties like userID , name , connection , role etc. So, you will need to have some List of your own to show and render the data you have.

I will paste a small portion of the code from that example here.

                    var pendingArray:Array = new Array();
                    var queue:Array = cSession.roomManager.knockingQueue.pendingQueue ;
                    for ( var i:int = 0 ; i < queue.length ; i++ ) {
                        var item:UserQueueItem = queue[i] as UserQueueItem ;
                        pendingArray.push({label:item.descriptor.displayName,descriptor:item.descriptor});
                    }

The item.descriptor object if you see in debugger contains name, userID etc. You can use this code and your own list ( as in example) to display the required information.

Thanks

Hironmay Basu

Avatar

Level 3

Thanks,

I have had a look at the item descriptor and have found that customfields is missing. For my app this is essential for the owners in the room to be able to see certain inforamtion about the users waiting in the lobby before they let them in.

Also from an AFCS point of view I would imagine that it would be as important to see all details about users in a queue as it is about those in the room. Especialy if they are allowed to set customFields while the user is in the queue. I think the call like

cSession.userManager.participantCollection for the lobby would be just as needed.

What about creating the UserDescriptor when the user is created?

Could you suggest a possible way to get the customeField for those in the Lobby.

Thanks, Keith

Avatar

Former Community Member

Hi Keith,

As I told you, customFields and many other fields are part of the UserDescriptor and at present we don't support any more fields other than the basic fields in itemDescriptor object you saw.

From AFCS point of view, we haven't found a use case since we want to give information to users only when he is allowed to enter the room.


In future , we will think over it for sure what all we can add and expose even when the user is waiting.

As of now, for customFields, one thing you can do is you can override the registerCustomField method

and in that when you create a node for that field( every customField has a node ), then you can have you own Node configuration with accessModel as 5 i.e. Lobby , something like this.

You can also modify it in your local source if dont want to override.

override public function registerCustomUserField(p_fieldName:String):void
        {
            if (_umCollectionNode.canUserConfigure(myUserID)) {

                if (!isCustomFieldDefined(p_fieldName)) {
                         var myNodeConfig:NodeConfiguration = _userListNodeConfig.clone();

                         myNodeConfig.accessModel = UserRoles.LOBBY ;

                         _umCollectionNode.createNode(p_fieldName, myNodeConfig);
                } else {
                    throw new Error("UserManager.registerCustomUserField : custom field " + p_fieldName + " already registered.");
                }
            } else {
                throw new Error("UserManager.registerCustomUserField : Insufficient privileges to register a custom user field");
            }
        }

Try this out and see what happens

Thanks

Hironmay Basu

Avatar

Level 3

I have changed the p_accessModel:int=5 in the NodeConfigiration. How can I now list the node along with th displayName now the I can subscribe to it? It is still not in the the item.decriptor

Is it possible maybe to set the Knocking queue for viewers, role 10? I want to be able to select a users from a list and pop them a message box with an enter button which will change their state to the main room from the waiting room they were just in.

Avatar

Former Community Member

I guess the knocking queue example does exactly that.However, its the host who can allow entry to the room. The example shows the pending people in a list with their names and the host select can access /deny them entry. Kocking Queue if you set to viewer's role then you won't be able to access any knocking queue item since your role at the time of knocking is 5.

If you can't get it to work, tell me the exact use case in brief and i might look over it in code details in weekend.

Thanks

Hironmay Basu

Avatar

Level 3

Great.

I have hosts who log into a room with the webcam and fileshare pods for discussion. They login with host passwords through php.

I have a second group of people who are to join the discussion to ask their question to the hosts. I am only allowing one at a time for one on one consultation. Again they have a separate password . When they login they are sent to a waiting room.

The host's have a list of users in the waiting room and they can select who is next to join once the current user has left the room. The list display's their name, user icon and company(customField).

Once the next user is selected by the host to join, the user recieves a pop with an enter button. This will change the users state to the main room.

Thanks for the help.

Avatar

Former Community Member

Hi,

So basically I tried to verify your problem . In the current case, the problem is if someone has a permission level of 5 i.e. LOBBY he doesn't get

any UserManager Items. So, even setting the accessModel value for the CustomField to LOBBY won't work.

I guess under such circumstances , the best way is to have a shared model of your own , that stores the value of any field or any usericon/image that you want. When you create that model , its collection node can have nodes with accessModel as LOBBY.

It will be like any shared model , remember Nigel gave you one such sharedmodel months back that you can use for customField.So , you can use such a model in case you want to show company or any other fields when you are in the LOBBY. Let me know if you can't get it to work. I can then try it out for you.

Thanks

Hironmay Basu

Avatar

Level 3

One question on that before I try. When the hosts change the users role from lobby to publisher will that node be accessed through the userManager?

<mx:DataGrid id="adgInterviewee" width="100%" height="20%" selectedIndex="0" showHeaders="true" headerHeight="50" sortableColumns="false" dataProvider="{cSession.userManager.participantCollection}">

     <mx:columns>

          <mx:DataGridColumn     headerText="Column 1" headerRenderer="comp.hdrRenderInterviewee">

               <mx:itemRenderer>

                    <mx:Component>

                         <mx:HBox height="60"verticalAlign="top">

                              <mx:Image source="images/imgConnected.png" id="imgConnected"/>

                               <mx:VBox verticalGap="2">

                                   <mx:Label text="{data.displayName}" styleName="title"/>

                                   <mx:Label text="{data.customFields['LocationName']}" styleName="description" />

                               </mx:VBox>

                              <mx:Spacer width="100%"/>

                              <mx:Imagesource="{data.usericonURL}" scaleX=".25" scaleY=".25"/>

                         </mx:HBox>

                    </mx:Component>

               </mx:itemRenderer>

          </mx:DataGridColumn>    

         </mx:columns>

</mx:DataGrid>

Thanks

Avatar

Former Community Member

Hi Keith,

This is definitely an area of the SDK that isn't as well-explored as it probably should be. We should take some time and think on ways of designing something a little more robust. Currently, the way the lobby works :

1. Only hosts can see the users in the lobby, via RoomManager.knockingQueue. Even users in the lobby can't see other users there.

2. The host only gets a very basic descriptor from the user in the lobby.

3. Almost every other aspect of a room is invisible from the lobby - they have accessmodels higher than 5. This includes UserManager, etc.

4. When the host accepts a user from the knockingqueue, they are promoted to VIEWER or PUBLISHER, depending on autoPromote.

5. Only after the user leaves the knocking queue are they really considered "users", in the UserManager, etc.

So, for your case, what do you need to have the user be able to send to the host? As Basu says, you could likely add a new model which even lobby folks can publish to. I suspect this will still have some issues, but let's design a way out of it - let us know what you find out.

For anyone on this thread, let us know how you'd like to see us improve this feature.

thanks

nigel

Avatar

Level 3

All I really need is when the user is selected by the host they are sent a pop, could the

// Accept the knocker.

private function onAcceptClick(p_evt:MouseEvent):void

{

if ( cSession.userManager.myUserRole == UserRoles.OWNER ) {

cSession.roomManager.knockingQueue.acceptUser(knockingList.selectedItem.descriptor.userID);

}

}

be used with the

if ( cSession.userManager.myUserRole == UserRoles.VIEWER ) {

cSession.roomManager.knockingQueue.addEventListener(UserQueueEvent.ACCEPT,onMyAccept);

cSession.roomManager.knockingQueue.addEventListener(UserQueueEvent.DENY,onMyDeny);

}

Basicly a custom UserQueue to send the selected user a pop up from the host. If so I could intialy set the user to viewer and then promote to publisher. That way all are in the room and under the userManager.

Avatar

Level 3

Hi Nigel,

So from what I now understand of the lobby, the following case scenario would not work.

I am a user and I want to go to the lobby. I cannot be assigned viewer, publisher or owner as I would join a room.

The reason why I want to go to the lobby is to chat to users and invite them to private rooms or view what rooms are available with how many users and in these rooms and a list of user names to see are any of my friends in before I enter. I should see what rooms are locked or open for me to join.

Therefore I would not as lobby role:

1. see a list of others in the lobby

2. be able to chat

3. view available rooms with the setting and users

4. create a new room with invited friends

The principle of the lobby is a great function and needed and should keep its own user role as it does so if I wanted to join a room where I would have to authorized first I can. The lobby in essence should be a super room.

Also the userQueue is a good function but any user role shoule be allowed to be added.

Thanks

Avatar

Level 3

Hi

Just an update on what I have done to solve the problem. I have changed the sdk now to put the role of viewer into the knocking queue instead of lobby.

Now I can choose the selected user from the cSession.userManager.audienceCollection and the private function onMyAccept(p_evt:UserQueueEvent):void event will fire.

It still would be nice however to have more control over the lobby.

Thanks, Keith

Avatar

Former Community Member

Hi Keith,

What part of the SDK did you change? Let us know and we can evaluate potential general solutions to your problem.

thanks

nigel

Avatar

Level 3

Hi Nigel,

I changed the following:

connectionsession.as

   if ( (_roomManager.roomState == RoomSettings.ROOM_STATE_ACTIVE || _roomManager.roomState == RoomSettings.ROOM_STATE_HOST_NOT_ARRIVED) && _userManager.myUserRole <= UserRoles.VIEWER && (_roomManager.guestsHaveToKnock == true) ) {

roomManager.as

public function subscribe():

void

{

_userManager = _connectSession.userManager;

initializeModel();

_collectionNode =

new

CollectionNode();

_collectionNode.sharedID = COLLECTION_NAME;

_collectionNode.connectSession = _connectSession;

_collectionNode.addEventListener(CollectionNodeEvent.SYNCHRONIZATION_CHANGE, onSynchronizationChange);

_collectionNode.addEventListener(CollectionNodeEvent.ITEM_RECEIVE, onItemReceive);

_collectionNode.addEventListener(CollectionNodeEvent.ITEM_RETRACT, onItemRetract);

_collectionNode.subscribe();

_knockingQueue =

new

UserQueue();

_knockingQueue.addEventListener(UserQueueEvent.ITEM_UPDATE,onKnockingQueueUpdate);

_knockingQueue.collectionNode = _collectionNode;

_knockingQueue.nodeNameQueue = NODE_KNOCKINGQUEUE_QUEUE ;

_knockingQueue.nodeNameNotification = NODE_KNOCKINGQUEUE_NOTIFICATIONS ;

_knockingQueue.roleForRequesting = UserRoles.VIEWER ;

_knockingQueue.roleForManaging = UserRoles.OWNER ;

_knockingQueue.userDependentQueueItems =

true

;

_knockingQueue.sessionDependentQueueItems =

true

;

_knockingQueue.sharedID =

"knocking_UserQueue"

;