Advanced Query Results Customization for Request Offerings

Advanced Query Results Customization for Request Offerings

  • Comments 6
  • Likes

This is a follow up post to the Request Offering Wizard Overview post and was also written by Neil Lydick.

Two Query Results settings cannot be modified in the UI and require manual edits to a configuration file or management pack. These settings include:

1. Setting the maximum number of instances displayed in all Query Results controls: The Query Results prompt type is unique in that it fetches live CMDB data to display rows to portal end-users. If the request author specifies a type and criteria that do not adequately restrict the set of instances displayed, then the performance of the portal server and CMDB can degrade. This degradation becomes more apparent as the number of request offering page views per visitor increases.

A global option exists in the SCSM Portal Web Server settings file (\inetpub\wwwroot\System Center Service Manager Portal\ContentHost\Clientbin\Settings.xml) to limit the maximum number of instances that can be displayed in any Query Results control. This setting applies to all clients and request offerings.

The key/value pair that can be added to the Settings.xml file is:

<Setting Key="DEFAULT_MAX_RESULTS" Value="100"/>

where Value=”” assumes an integer value. Result sets retrieved from the CMDB are capped at the maximum value specified.

2. Setting the number of instances displayed per-page in a Query Results control: By default, each Query Results control displays the set of instances matching its configured criteria in a series of pages containing 10 instances each. The number of instances displayed per page can be altered for a specific Query Results control by editing the XML of the Management Pack in which its parent Request Offering is saved. In contrast to the DEFAULT_MAX_RESULTS setting, the number of instances displayed per page is not a global setting affecting all Query Results controls: it can vary for individual controls.

The steps to configure this setting are as follows:

1. Identify the Management Pack in which the Request Offering is saved. This is found in the General tab of the Request Offering wizard.

2. Go to the Management Packs view in Administration -> Management Packs and select the Management Pack (MP) found in Step 1.

3. Once the MP is selected, click “Export” on the tasks pane to write this MP to a file.

4. Open the MP in a text editor and locate the XML for the request offering containing the Query Results control you wish to customize. You should see an <Extension> element within the MP containing <RequestOffering> sub-elements. Look for a RequestOffering that has a “Title” attribute that matches the title that you specified in the wizard.

5. Within the <RequestOffering> element, you should see a <PresentationMappingTemplate> element that contains a <Sources> subelement, which itself contains a list of <Source> child elements. Each <Source> element corresponds to a user prompt in the RO wizard. You can identify the Source element that corresponds to the Query Results user prompt you wish to customize by matching the text in the “Prompt” attribute to the text that you entered for the Query Results prompt. The ControlType attribute for the correct Source element will have its ControlType attribute set to “System.SupportingItem.PortalControl.InstancePicker,” which indicates that the corresponding prompt control is a Query Results control.

6. Under the correct <Source> element, you should find two additional subelements: <Configuration>, and, under <Configuration>, <Details>. To customize the number of instances displayed per Query Results page, add an attribute to the <Details> element with the name PageSize. Set the value of this attribute to the number of instances that you wish to display per Query Results page. Add only this attribute and preserve the surrounding XML.

A valid edit will look similar to Figure 54 (highlighted text added manually):

<Configuration>

    <Details IsMultiSelectAllowed="false" HideDetailsView="true" PageSize="5">

    <ClassOrProjection Id="7b070bc5-0f54-6663-f840-17affa1d6304" IsProjection="false" />

Figure 54: Customizing the Number of Instances Displayed Per Page

7. Save the edits to the MP file.

8. Import the saved MP file (Administration -> Management Packs -> (Tasks Pane) -> Import).

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • This is good information. What other XML customization can be perform do within the Management Packs, i.e., is there a schema definition file where we can do some self-discovery?

    Specifically, I'm trying to specify a default value for a MP Enumeration control.

  • @Mike B -

    Yes, the schema .xsd file is available as part of the SCSM job aids package.   Version 1.1 of the schema which is for SCSM 2010 is available now.  We'll update it with the new version for SCSM 2012 soon.

    go.microsoft.com/fwlink

  • Travis - I've just tried this on a 2012 SP1 box but I'm not getting the outcome? It's for query on the portal where it limits it to 2000 objects. I have tried adding the Default_Max_Results to 5000 but it's not worked. I have reset IIS / restarted portal server and also bounced management servers but still showing max 2000 objects.

    Any thoughts on why this might be different in SP1?

  • <Setting Key="DEFAULT_MAX_RESULTS" Value="4000"/> this does not work in my case. results are 0 when the size of result reaches more than 2000

    Even restarted Portal Server. No luck

  • Is the process different in SP1. As I am using 2012 sp1 UR2

  • @Shahid Roofi: Have you set MaximumInstanceCount on the IIS?

    See blogs.technet.com/.../how-to-increase-the-max-number-of-objects-in-a-query-result-prompt.aspx