The addmember and removemember CommandsThese commands will either add a member to or remove a member from a collection of members. The addmember command does not create a member, it simply adds an existing member to a collection. Similarly, the removemember command does not delete a member, it just removes a member from the collection. Members can be identified either by ID or by LoginName. These commands can specify multiple members. There are several types of targets that will process these commands: GroupsYou can add a member to a group by using that group as the command target and sending the addmember command: <er:command er:select="Members/Member[Name='TestGroup']"> <er:addmember> <er:Member xsi:type="erMemTypeUser"> <er:LoginName>bob</er:LoginName> </er:Member> </er:addmember> </er:command> The removemember command works the same way. The response to both commands contains only the status element. The following example shows the removemember equivalent of the above example: <er:command er:select="Members/Member[Name='TestGroup']"> <er:removemember> <er:Member xsi:type="erMemTypeUser"> <er:LoginName>bob</er:LoginName> </er:Member> </er:removemember> </er:command>
RoomsYou can add a member to an eRoom in the same manner as to a group, but
the member’s PrimaryRole
in that eRoom can be specified in the command as well. If the PrimaryRole
is not present, it defaults to erRoleObserver.
The removemember
command works the same way. The response to both commands contains only
the status element. <er:command er:select="Rooms/Room"> <er:addmember> <er:Member xsi:type="erMemTypeUser"> <er:ID>10</er:ID> <er:PrimaryRole>erRoleParticipant</er:PrimaryRole> </er:Member> <er:Member xsi:type="erMemTypeUser"> <er:LoginName>fred</er:LoginName> </er:Member> </er:addmember> </er:command> The above example adds the Member with ID 10 as a Participant, and the member with the LoginName "fred" as an Observer (the default role if none is specified). Since the select attribute matches every Room in the Rooms collection, the Members are added to every Room in the Facility. Again, the removemember command works the same way, although it is never necessary to specify a role when removing a member: <er:command er:select="Rooms/Room"> <er:removemember> <er:Member xsi:type="erMemTypeUser"> <er:ID>10</er:ID> </er:Member> <er:Member xsi:type="erMemTypeUser"> <er:LoginName>fred</er:LoginName> </er:Member> </er:removemember> </er:command>
Access ControlThe addmember
and removemember
commands for the AccessControl
object are slightly more involved, since the object contains two lists
of Members, the OpenAccessList
and the EditAccessList.
The commands must specify which list the member is being added
to or removed from by nesting the member inside that list in the command: <er:command er:select="Rooms/Room[URLName='NewProductLaunch']/HomePage/Items/Item[ID='0_396']/AccessControl"> <er:addmember> <er:EditAccessList> <er:Member xsi:type="erMemTypeUser"> <er:ID>10</er:ID> </er:Member> </er:EditAccessList> </er:addmember> </er:command> This example adds the Member with ID 10 to the EditAccessList of the Item with ID 0_396, giving him edit rights to the item. Multiple Members can be placed inside the list, and both the EditAccessList and the OpenAccessList can appear in the command at the same time. As with Groups and Rooms, removemember works the same way as addmember: <er:command er:select="Rooms/Room[URLName='NewProductLaunch']/HomePage/Items/Item[ID='0_396']/AccessControl"> <er:removemember> <er:EditAccessList> <er:Member xsi:type="erMemTypeUser"> <er:ID>10</er:ID> </er:Member> </er:EditAccessList> </er:removemember> </er:command> CalendarEventsThe addmember and removemember commands can add members to or remove them from a calendar's Participants collection. CommunitiesThe addmember and removemember commands can add members to or remove them from a member as a guest in a Community if the member is not a native community member. DBCellsThe addmember and removemember commands can add members to or remove them from Content if the column type is erColumnTypeMembers. DBColumnsThe addmember and removemember commands can add members to or remove them from MemberList if the column type is erColumnTypeMembers. ProjectTasksThe addmember and removemember commands can add members to and remove them from Resources collection.
|