Incident Dashboard

The Contoso Corporation uses an incident management system that tracks any issues that Contoso partners report. An example of an incident is a broken MRI machine that a partner needs to troubleshoot and repair. The incident management system includes a workflow that assigns the incident to higher levels of support as an issue escalates. If an incident reaches level 3, the system invokes a WCF Web service that creates a collaborative SharePoint site. This site allows partners and Contoso engineers to share documents, review status and work together to resolve the problem. The incident Web site is a subsite that exists within the partner's site collection.

The Incident Dashboard is located within a partner's collaboration site collection. It lists the incidents that a partner has reported as well as the active tasks that are associated with each incident. It is similar to a table of contents because it summarizes the information that is contained in other pages. The Incident Dashboard demonstrates a cross-site query with a Content Query Web Part.

To view the Incident Dashboard go to the homepage of the partner's collaboration site collection and click Manage Incidents in the global navigation bar.

The following figure illustrates the Incident Dashboard.

Partner Portal Incident Dashboard

Ff650156.195fd70a-15ef-4c6d-ad2f-67f45ce6df62(en-us,PandP.10).png

The Incident Dashboard contains the following information:

  • The active tasks for all incidents
  • The active incidents
  • The closed incidents

Active Incident Tasks

The Active Incident Tasks pane is a summary of all the active tasks for all incidents. A task is active if its status field is anything other than Completed. The summary is the result of a cross-site query.

The Active Incident Tasks pane is implemented with a Content Query Web Part. This is a standard Web Part that is provided by Microsoft Offices SharePoint Services. You can use the Content Query Web Part to create custom views of data that is obtained from many lists within a site collection, and to present that data on a single Web page. After you add the Content Query Web Part to a Web page, you can customize the Web Part's querying behavior, custom lists, and content types by setting custom properties.

The Incident Dashboard uses the Content Query Web Part to perform a cross-site query across lists that are found in subsites of the current partner's site collection. Each level 3 incident corresponds to a subsite. The Content Query Web Part presents the results of the query, which are then displayed on the dashboard. The Web Part is configured to include a customized query that is field based. You can also configure the Web Part to search for particular content types and list templates.

The Custom Query Web Part is configured in the file PartnerPortal\Contoso.PartnerPortal.Collaboration.Incident\IncidentsLandingPage\Module.xml, found in the Contoso.PartnerPortal.Collaboration.Incident project. The following code shows the configuration.

<AllUsersWebPart WebPartOrder="1" WebPartZoneID="Left">
    <![CDATA[
        <webParts>
            <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
              <metaData>
                <type name="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
                <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
              </metaData>
              <data>
                <properties>
                <! ... !>
</properties>
              </data>
            </webPart>
          </webParts>
        ]]>
      </AllUsersWebPart>

The configuration determines the Web Part's order and zone. It also identifies the Web Part class ContentByQueryWebPart. This class is located in the Microsoft.SharePoint.Publishing.WebControls namespace.

The following code shows how to create the custom query. This code is located in PartnerPortal\Contoso.PartnerPortal.Collaboration.Incident\IncidentsLandingPage\Module.xml.

<property name="ContentTypeBeginsWithId" type="string">0x0108009BBBA7168ED64455B16ECDBD00BA7997</property>

The ContentTypeBeginsWithId property sets the content type ID for the custom query. The string 0x0108009BBBA7168ED64455B16ECDBD00BA7997 is the content type identifier for the Incident Task content type. This content type is defined in the Content Types/IncidentTask/IncidentTask.xml file of the Contoso.PartnerPortal.Collaboration.Incident project.

By default, the Content Query Web Part searches the current site and all of its subsites. In the Partner Portal application, the partner collaboration site that contains the incident dashboard also contains a subsite for each incident that is associated with that partner. As a consequence, the Web Part's default scope searches all incident tasks for the current partner.

Note

It is possible to customize the scope of the query. For more information, see How to: Customize the Content Query Web Part by using Custom Properties on MSDN.

The query is further restricted to include only incident tasks that have not been completed. This field-based query is expressed by overriding properties with names that begin with Filter. The query for the Active Incident Tasks is shown in the following code.

<properties>
   <!-- ... -->
   <property name="FilterField1" 
      type="string">{c15b34c3-ce7d-490a-b133-3f4de8801b76}</property>
   <!-- ... -->
   <property name="FilterType1" type="string">Choice</property>
   <!-- ... -->
   <property name="FilterOperator1" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Neq</property>
  <!-- ... -->
  <property name="FilterValue1" type="string">Completed</property>
   <!-- ... -->
</properties>

Together, the four properties, FilterField1, FilterType1, FilterOperator1 and FilterValue1 express the constraint that the status field must not equal Completed.

The FilterField1 property identifies the field that is used for comparison. In this case, the property is set to the field ID of the Status field. This ID is defined in the Lists\Tasks\schema.xml file of the Contoso.PartnerPortal.Collaboration.OrderException project.

The FilterType1 property is set to the value Choice to indicate that the comparison is performed on enumerated values. The Status field is declared with the Choice type.

The FilterOperator1 property specifies that the basis of selection is the Neq operator, which means not equal.

The FilterValue1 property is the value of the Status field that is used for comparison. In this case, the value is Completed.

More Information

For more information on the Content Query Web Part, see How to: Customize the Content Query Web Part by using Custom Properties on MSDN.

Home page on MSDN | Community site