The use of the UocListViewControl for editing multi-value reference attributes

Jorge has recently thoroughly documented the UocIdentityPicker control using the subject of searching for and selecting resources as values for a multi-value reference attribute in a three post series:

I wanted to demonstrate an alternative technique that I use that I find particularly useful for small sets of data: the UocListView control. Here’s a screenshot to illustrate the point.

What I have is a UocListView control bound to a simple XPath filter and a multi-value reference attribute. When the grouping (the tab) is rendered the XPath is executed and the requestor is presented with the results of the query in a list. The checkboxes enable one or more elements of the list to be selected. When the requestor clicks OK the selected resources are written to the “target” multi-value reference attribute. Of course you can also configure the UocListView in single-selection mode and bind it to a single-value reference attribute. Or you can choose not to bind it to an attribute at all and simply utilise the display for informational purposes, e.g. listing group members (akin to the memberOf backlink in AD DS). Brad has documented this particular technique in the past –see here for an example of listing information using the UocListView. But I digress. To achieve what I have illustrated in the above image, which is writing the selected values to the underlying reference attribute, I used this control (grouping left for completeness):

 <!--Provisioning tab--> 
 <my:Grouping my:Name="externalSystemsTab" my:Caption="Provisioning" my:Enabled="true" my:Visible="true"> 
     <my:Control my:Name="ExternalSystems" 
             my:TypeName="UocListView" 
             my:Caption="{Binding Source=schema, Path=RequestedExternalSystems.DisplayName}" 
             my:Description="{Binding Source=schema, Path=RequestedExternalSystems.Description}" 
             my:RightsLevel="{Binding Source=rights, Path=RequestedExternalSystems}"> 

         <my:Properties> 
                 <my:Property my:Name="ColumnsToDisplay" my:Value="DisplayName, Description"/> 
                 <my:Property my:Name="ResultObjectType" my:Value="ExternalSystem"/> 
                 <my:Property my:Name="UsageKeywords" my:Value="ExternalSystem"/> 
                 <my:Property my:Name="ListFilter" my:Value="/ExternalSystem"/> 
                 <my:Property my:Name="EmptyResultText" my:Value="There are no external systems available to choose."/> 
                 <my:Property my:Name="PageSize" my:Value="10"/> 
                 <my:Property my:Name="ShowTitleBar" my:Value="false"/> 
                 <my:Property my:Name="ShowActionBar" my:Value="false"/> 
                 <my:Property my:Name="ShowPreview" my:Value="false"/> 
                 <my:Property my:Name="ShowSearchControl" my:Value="false"/> 
                 <my:Property my:Name="EnableSelection" my:Value="true"/> 
                 <my:Property my:Name="SingleSelection" my:Value="false"/> 
                 <my:Property my:Name="SelectedValue" my:Value="{Binding Source=object, Path=RequestedExternalSystems, Mode=TwoWay}"/> 
                 <my:Property my:Name="ItemClickBehavior" my:Value="ModelessDialog"/> 
                 <my:Property my:Name="ReadOnly" my:Value="false"/> 
         </my:Properties> 
     </my:Control> 
 </my:Grouping> 

I’ll talk you through the configuration. For more information on the properties utilised see the Resource Control Display Configuration XML Reference document.

There is one control in the grouping and, as you can see from the picture, this is a new grouping on the User RCDC. The Person resource type has a custom multi-value reference attribute called RequestedExternalSystems. There is also a custom resource type called ExternalSystem. The intention of the RequestedExternalSystems attribute is for a user’s manager, or even the user, to select systems to be provisioned into. They’ll do this by selecting available ExternalSystem resources. This is a proof of concept I’m working on and is not relevant to this discussion, other than it is some background to the control and the screenshot. It is just something I have available to illustrate the use of this technique. The aspects of the control that we care about are these:

 <my:Property my:Name="ColumnsToDisplay" my:Value="DisplayName, Description"/> 
 <my:Property my:Name="ResultObjectType" my:Value="ExternalSystem"/> 
 <my:Property my:Name="ListFilter" my:Value="/ExternalSystem"/> 
 <my:Property my:Name="EmptyResultText" my:Value="There are no external systems available to choose."/> 
 <my:Property my:Name="EnableSelection" my:Value="true"/> 
 <my:Property my:Name="SingleSelection" my:Value="false"/> 
 <my:Property my:Name="SelectedValue" my:Value="{Binding Source=object, Path=RequestedExternalSystems, Mode=TwoWay}"/> 

Here is a quick summary of what each property does. Some aren’t strictly needed, but I like to define the properties instead of relying on the defaults as it’s immediately more apparent as to what a control does if the entire configuration is in front of you.

  • The ColumnsToDisplay property is quite obvious. That defines which attribute values to show in the result list.
  • The ResultObjectType property is an optional property to scope the result type. It’s not really needed in this example because of the ListFilter.
  • The ListFilter defines the contents of the list. That is, this is the XPath query executed to build the list. The property requires that the ShowSearchControl property is not used, i.e. is set to false. This property can take variables in the form of %LoginID%, %Attribute_AccountName%, etc.
  • The EmptyResultText is quite self-explanatory. If the XPath in the ListFilter yields no results then this text is displayed.
  • The EnableSelection property toggles the checkbox and allows for entries to be selected. Multiple selections or a single selection are governed by the SingleSelection property. The SingleSelection property default is false, therefore it’s not strictly needed in this example. The EnableSelection property default is true, so these values are more of a documentation exercise than anything else.
  • Lastly the SelectedValue property is how we bind the control to the attribute. The value specifies the multi-value reference attribute therefore selected values are written to this attribute.

This is quite a trivial tip but I felt it complimented Jorge’s great work so thought I’d post it.

Advertisements

About Paul Williams

IT consultant working for Microsoft specialising in Identity Management and Directory Services.
This entry was posted in FIM, FIM 2010 and tagged , , , , , , , , . Bookmark the permalink.

4 Responses to The use of the UocListViewControl for editing multi-value reference attributes

  1. Ross Currie says:

    Was looking at the RCDC reference and see under UOCListView:
    “UocListView does not work with single-valued reference attributes. It can be used only with multivalued reference attributes. For single-valued reference attributes, see UocIdentityPicker in this document.”

    So, not sure if “Of course you can also configure the UocListView in single-selection mode and bind it to a single-value reference attribute.” is accurate.

    I gave it a shot but couldn’t get the RCDC to load using a single-value reference. Of course, there’s probably limited value in setting SingleSelection to true for a multi-value reference field.

  2. taz00 says:

    I got it loading using a single valued reference. But when time comes to submit the selected value, it simply does not register a change in selection.

  3. I really should update the post! 🙂

    Good feedback guys. As soon as I have some time I’ll stand up a FIM server, play and update.

    At the moment I’m knee-deep in AD FS and AD CS and the only FIM work I’ve done over the last four months has been Synchronization Service only projects -and I’ve got more of those coming in the form of MIIS to FIM upgrades!

    Looks like I have got a couple of pipeline portal projects in the not too distant future, so I’ll play with this the same time. I think what we’re saying is my throwaway comment is wrong and this technique only works properly with multivalued attributes right?

  4. Kendric says:

    Hi,
    I’m trying to implement this control for group provisioning. Instead of the custom resource type ExternalSystem I am using the built in DomainConfiguration resource type. The control is working correctly but is populating the multivalue attribute “RequestedExternalSystems” with “urn:uuid:1aff46f4-5511-452d-bcbd-7f7b34b0fe14” but I want it to populate the multi-value attribute with the “DisplayName” or “Domain” name of the Domain resource. What do I need to modify in the RCDC code to do this?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s