Wednesday, December 17, 2008

ILM 2 RC0 – Add the Raw Filter XOML to Set Objects

It’s inevitable, you will want to build an XPATH query that the Filter Builder control can’t support so you end up going in through Advanced View to view/edit the Filter XOML directly. This works but the Filter builder just won’t render your query any longer. The SearchScope object doesn’t even provide a Filter Builder yet because it uses a different Filter attribute under the hood; however we can change the Create or Edit OVC configuration for Sets to include the ability to view this attribute. As always, you will want to save the default export of the Set OVC but crack that puppy open and insert this control right after the FilterBuilder control.
<my:Control my:Name="Filter" my:TypeName="UocTextBox" my:Caption="{Binding Source=schema, Path=Filter.DisplayName}" my:AutoPostback="true" my:Description="Raw Filter XOML" my:RightsLevel="{Binding Source=rights, Path=Filter}">
<my:Properties>
<my:Property my:Name="Rows" my:Value="10"/>
<my:Property my:Name="Columns" my:Value="60"/>
<my:Property my:Name="MaxLength" my:Value="500"/>
<my:Property my:Name="Text" my:Value="{Binding Source=object, Path=Filter, Mode=TwoWay}"/>
</my:Properties>
</my:Control>

By setting the AutoPostback value here to true we also allow for direct edits to refresh the Filter Builder, assuming your updates aren’t using an unsupported operation. Load the updated file back into the OVC object and then IISRESET. When you are done the control should render like so:

image

If you’d like more real estate here like this:

image

…then what you want to do is change the Columns to 120 and add the my:ExpandArea="true" directive on the Control line like so:

<my:Control my:Name="Filter" my:TypeName="UocTextBox" my:Caption="{Binding Source=schema, Path=Filter.DisplayName}" my:ExpandArea="true" my:AutoPostback="true" my:Description="Raw Filter XOML" my:RightsLevel="{Binding Source=rights, Path=Filter}">

For more information on how to edit OVC objects, see the previous posts on the subject:

0 comments:

Post a Comment