System Center Service Manager Authoring Guide

Microsoft Corporation

Published: March 27, 2008

Author

Anat Kerry

Applies To

Service Manager Community Technology Preview 2 Release

Feedback

Send suggestions and comments about this document to

This document supports a preliminary release of a software product that may be changed substantially prior to final commercial release. This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information in this document, including URL and other Internet Web site references, is subject to change without notice. The entire risk of the use or the results from the use of this document remains with the user. Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in examples herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2008 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows Server, Windows Vista, and Active Directory are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

All other trademarks are property of their respective owners.

Revision History

Release Date / Changes
November 21, 2008 / Original release of this guide

Contents

Service Manager Authoring Introduction

What’s In This Guide

System Center Common Schema

Changes to the Common Schema

Properties and Property Restrictions

Images

Enumerations

Relationships

Type Projections

Console Tasks

Resources

Forms

See Also

Creating a Service Manager Management Pack

Creating a Management Pack

The Manifest

Creating a Class

Creating a form

User Interface and Localization Elements

Categories

PresentationTypes

Presentation

Importing a Management Pack by Using the Command Line

Full Example

Class Extensions

See Also

Guidelines for Creating Service Manager Forms

Introduction

Form Implementation

User Experience Design

Code Behind

Data Sources

Data Validation and Error Handling

Form Lifecycle

Form Commands and Events

Forms customization and upgrades

Adding a form to a Management Pack

See Also

[This is prerelease documentation and is subject to change in future releases.]

Service Manager Authoring Introduction

Welcome to the System Center Service Manager Authoring Guide.

System Center Service Manager integrates with Active Directory, Operations Manager, and Configuration Manager to build a single reconciled inventory of an organization’s assets called a configuration management database (CMDB). Service Manager can be customized and extended by creating and modifying management packs. This authoring guide describes the use and customization of management packs and management pack components.

What’s In This Guide

This guide includes the following topics:

Topic / Description
System Center Common Schema / Describes Service Manager-specific additions to the management pack schema.
Creating a Service Manager Management Pack / Contains detailed information about management pack elements and how to use them.
Guidelines for Creating Service Manager Forms / Describes how to create and extend Service Manager forms.

System Center Common Schema

System Center Service Manager includes an updated version of the System Center Management Pack Schema. This schema is now called the System Center Common Schema, and it includes a number of improvements and additions that are intended to enhance existing functionality and enable Service Manager features.

This prerelease document describes the changes between the previous version of the schema and the current Beta release of Service Manager. Complete documentation will be provided in future releases of Service Manager.

Important

For more information about Service Manager management packs, including more XML samples, see Creating a Service Manager Management Pack.

Changes to the Common Schema

This section describes specific changes and additions to the System Center Common Schema.

Properties and Property Restrictions

The common schema extends classes with a number of new property types. These include binary types, enumerators, and autoincrement types.

You can now define restrictions on certain property values. For example, you can now define a regular expression restriction on a string property value. In the following example, the BuildingName property has a regular expression restriction that is defined so only a value that contains the word Building, followed by a space and then a number, is considered valid.

<ClassType ID="Lobby" Accessibility="Public" Base="System!System.Entity">

<Property ID="Id" Type="int" Key="true" />

<Property ID="BuildingName" Type="string" RegEx="Building [0-9]+" />

</ClassType>

Images

Images are no longer stored inside a management pack, and therefore the <PresentationTypes> section of the management pack no longer contains the tags <Images>, <Image>, or <ImageData>. Instead, use an image resource.

<Resources>

<Image ID="TestLibrary.Resources.Image1" Accessibility="Public" FileName="image.png"/>

</Resources>

Enumerations

The common schema now supports enumerations. Enumerations are a tree of values that can be used to restrict the value of a property or attribute.

Each enumeration has a required unique ID attribute and an optional Parent attribute.

In the following example, an enumeration called XBoxState is defined with three possible values: Running, Stopped, and Error:

<EnumerationTypes>

<EnumerationValue ID="XBoxState" Accessibility="Public"/>

<EnumerationValue ID="XBoxState.Running" Parent="XBoxState" Accessibility="Public"/>

<EnumerationValue ID="XBoxState.Stopped" Parent="XBoxState" Accessibility="Public"/>

<EnumerationValue ID="XBoxState.Error" Parent="XBoxState" Accessibility="Public" />

</EnumerationTypes>

In the following example, the Xbox class defines an enum property of type XBoxState:

<ClassType ID="XBox" Accessibility="Public" Base="System!System.ConfigItem" Hosted="true">

<Property ID="Id" Type="int" Key="true" />

<Property ID="Name" Type="string" />

<Property ID=“State" Type="enum" EnumType=“XBoxState" />

</ClassType>

Relationships

The functionality of relationship definitions has been enhanced in the common schema. The RelationshipType type now has Source and Target subelements, with ID properties that can be used as display names. In addition, minimum and maximum cardinality for both the source and target can be defined (for example, 1-to-1 or 0-to-many relationships).

The cardinality is not enforced by the management pack validation process, but it is intended to help define user interfaces for the management pack. For example, the cardinality can be checked to determine whether a field can be represented in a form by a text box or a list.

Important

Any MaxCardinality value that is defined as greater than 1 is processed as unlimited.

In the following example, a hosting relationship (called HasXBoxes) between the Lobby type and the Xbox type is defined. In this relationship definition, each Lobby type can have multiple Xbox types.

<RelationshipType ID="HasXBoxes" Accessibility="Public" Base="System!System.Hosting">

<Source ID="Source" Type="Lobby" />

<Target ID="Target" Type="XBox" MinCardinality="0" MaxCardinality="9999" />

</RelationshipType>

Type Projections

Type projections represent an aggregation of multiple related types in the management pack, similar to views that are defined in a SQL database that can return data from multiple tables. Type projections store and retrieve all the aggregated data in one operation to the database, and they can make it easier to define user interfaces for a management pack.

In the following example, a projection is defined for an incident management view. This projection combines several different components, related to an incident, into one unit that can be used more easily for forms and database operations.

<TypeProjections>

<TypeProjection ID="System.WorkItem.Incident.View.ProjectionType"

Accessibility="Public" Type="Incident!System.WorkItem.Incident">

<Component Alias="AffectedUser"

Path="$Target/Path[Relationship='SMCore!System.WorkItemCreatedForUser']$"/>

<Component Alias="AssignedUser" Path="$Target/Path[Relationship='SMCore!System.WorkItemAssignedToUser']$"/>

</TypeProjection>

<TypeProjection ID="System.WorkItem.Incident.View.DCMProjectionType" Accessibility="Public" Type="Incident!System.WorkItem.Incident.DCMIncident">

<Component Alias="AffectedUser" Path="$Target/Path[Relationship='SMCore!System.WorkItemCreatedForUser']$"/>

<Component Alias="AssignedUser" Path="$Target/Path[Relationship='SMCore!System.WorkItemAssignedToUser']$"/>

<!--Baseline and CI Information-->

<Component Alias="AffectedComputer" Path="$Target/Path[Relationship='Incident!System.WorkItem.Incident.DCMIncident.Refers.NonComplianceComputer']$"/>

</TypeProjection>

<TypeProjection ID="System.WorkItem.ChangeRequestViewProjection" Accessibility="Public" Type="System.WorkItem.ChangeRequest">

<Component Alias="AssignedTo" Path="$Target/Path[Relationship='SMCore!System.WorkItemAssignedToUser']$"/>

</TypeProjection>

<TypeProjection ID="System.WorkItem.ChangeRequestProjection" Accessibility="Public" Type="System.WorkItem.ChangeRequest">

<Component Alias="Activity" Path="$Target/Path[Relationship='SMActivity!System.WorkItemContainsActivity']$">

<Component Alias="ActivityAssignedTo" Path="$Target/Path[Relationship='SMCore!System.WorkItemAssignedToUser']$"/>

<Component Alias="ActivityRelatedWorkItem" Path="$Target/Path[Relationship='SMCore!System.WorkItemRelatesToWorkItem']$">

<Component Alias="ActivityRelatedWorkItemAssignedTo" Path="$Target/Path[Relationship='SMCore!System.WorkItemAssignedToUser']$"/>

</Component>

<Component Alias="ActivityRelatedConfigItem" Path="$Target/Path[Relationship='SMCore!System.WorkItemRelatesToConfigItem']$"/>

<Component Alias="ActivityAboutConfigItem" Path="$Target/Path[Relationship='System!System.WorkItemAboutConfigItem']$"/>

<Component Alias="ActivityFileAttachment" Path="$Target/Path[Relationship='System!System.WorkItemHasFileAttachment']$">

<Component Alias="ActivityFileAttachmentAddedBy" Path="$Target/Path[Relationship='System!System.FileAttachmentAddedByUser']$"/>

</Component>

<Component Alias="Reviewer" Path="$Target/Path[Relationship='SMActivity!System.ReviewActivityHasReviewer']$">

<Component Alias="User" Path="$Target/Path[Relationship='SMActivity!System.ReviewerIsUser']$"/>

<Component Alias="VotedBy" Path="$Target/Path[Relationship='SMActivity!System.ReviewerVotedByUser']$"/>

</Component>

</Component>

<Component Alias="CreatedBy" Path="$Target/Path[Relationship='SMCore!System.WorkItemCreatedByUser']$"/>

<Component Alias="AssignedTo" Path="$Target/Path[Relationship='SMCore!System.WorkItemAssignedToUser']$"/>

<Component Alias="CreatedFor" Path="$Target/Path[Relationship='SMCore!System.WorkItemCreatedForUser']$"/>

<Component Alias="RelatedWorkItem" Path="$Target/Path[Relationship='SMCore!System.WorkItemRelatesToWorkItem']$">

<Component Alias="RelatedWorkItemAssignedTo" Path="$Target/Path[Relationship='SMCore!System.WorkItemAssignedToUser']$"/>

</Component>

<Component Alias="RelatedConfigItem" Path="$Target/Path[Relationship='SMCore!System.WorkItemRelatesToConfigItem']$"/>

<Component Alias="AboutConfigItem" Path="$Target/Path[Relationship='System!System.WorkItemAboutConfigItem']$"/>

<Component Alias="FileAttachment" Path="$Target/Path[Relationship='System!System.WorkItemHasFileAttachment']$">

<Component Alias="FileAttachmentAddedBy" Path="$Target/Path[Relationship='System!System.FileAttachmentAddedByUser']$"/>

</Component>

</TypeProjection>

<TypeProjection ID="System.FileAttachmentProjection" Accessibility="Public" Type="System!System.FileAttachment">

<Component Alias="FileAttachmentAddedBy" Path="$Target/Path[Relationship='System!System.FileAttachmentAddedByUser']$"/>

</TypeProjection>

</TypeProjections>

Console Tasks

Console tasks have been extended in the common schema. Instead of being simple pointers to an application directory and executable file name, a ConsoleTask is implemented as handler code in a .NET assembly, with reference to the assembly housing the code, the handler name, and a list of named values that can be passed as arguments to the handler.

In the following example, a handler called Some.Handler.Name is defined in the assembly MyLibrary.Resources.Assembly. A list of handler parameters and their values is also defined.

<ConsoleTask ID="MyLibrary.ConsoleTasks.T1"

Accessibility="Public"

Target="System!System.Entity"

Enabled="true"

RequireOutput="true">

<Assembly>MyLibrary.Resources.Assembly1</Assembly>

<Handler>Some.Handler.Name</Handler>

<Parameters>

<Argument Name="Application">cmd.exe</Argument>

<Argument Name="WorkingDirectory">%TEMP%</Argument>

<Argument>test1</Argument>

<Argument>test2</Argument>

</Parameters>

</ConsoleTask>

Resources

Binary data is no longer stored directly in a management pack. Instead, metadata about the binary resource is stored in the management pack, and the actual binary data is stored externally in a resource file. The metadata includes a unique identifier, the file name, creation data, modified date, and accessibility.

Binary data can include generic resources, images, assemblies, report definitions, and forms. The following example shows a generic XML resource, an assembly resource, and a report resource.

<Resources>

<Resource ID="TestLibrary.Resources.Test1" Accessibility="Public" FileName="foo.xml"/>

<Resource ID="TestLibrary.Resources.Test2" Accessibility="Public" FileName="bar.xml"/>

<Assembly ID="TestLibrary.Resources.Assembly1" Accessibility="Public" QualifiedName="Baz, Version=1.0.0.0" FileName="baz.dll"/>

<Assembly ID="TestLibrary.Resources.Assembly2" Accessibility="Public" QualifiedName="Yoyo, Version=1.0.0.0" FileName="yoyo.dll">

<Dependency ID="TestLibrary.Resources.Assembly1"/>

</Assembly>

<ReportResource ID="TestLibrary.Resources.Report1" Accessibility="Public" MIMEType="text/xml" FileName="foo.xml"/>

<Image ID="TestLibrary.Resources.Image1" Accessibility="Public" FileName="image.png"/>

</Resources>

Forms

Forms can now be defined in a management pack. Forms can be used to view and modify a single instance of a type or type projection.

Forms are based on the Windows Presentation Framework (WPF) and are defined in assemblies. The assembly and class that contain the forms implementations for a management pack are included in the resources section of the management pack. As with any binary resource in a management pack that uses the new common schema, the management pack itself does not contain the binary data for the form. Only the resource manifest is specified in the management pack.

You can specify your own configuration information for the form in the management pack. In the following example, the Configuration section contains a ShowXBoxes property. This configuration information is not evaluated by the management pack verification process; it is only interpreted by the form implementation.

<Forms>

<Form ID="LobbyForm" Target="Projection" Assembly="FormAssembly“ TypeName="MyFormClass">

<Configuration>

<ShowXBoxes>yes</ShowXBoxes>

</Configuration>

</Form>

</Forms>

See Also

Creating a Service Manager Management Pack

Guidelines for Creating Service Manager Forms

Creating a Service Manager Management Pack

Creating a Management Pack

Management packs are used to direct and extend the functionality of Service Manager. This topic describes how to create a management pack to manage projections in an organization.

The Manifest

The first section of a management pack contains the manifest. The manifest identifies the management pack and declare any references to other management packs.

The following example shows the Manifest section of a management pack that was designed to track projectors in an organization.

<Manifest>

<Identity>

<ID>ServiceManager.Projector</ID>

<Version>1.0.2780.0</Version>

</Identity>

<Name>Projector Library</Name>

<References>

<Reference Alias="System">

<ID>System.Library</ID>

<Version>1.0.2780.0</Version>

<PublicKeyToken>9396306c2be7fcc4</PublicKeyToken>

</Reference>

<Reference Alias="SMConfig">

<ID>ServiceManager.ConfigurationManagement.Library</ID>

<Version>1.0.2780.0</Version>

<PublicKeyToken>9396306c2be7fcc4</PublicKeyToken>

</Reference>

<Reference Alias="SMConsole">

<ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>

<Version>1.0.2780.0</Version>

<PublicKeyToken>9396306c2be7fcc4</PublicKeyToken>

</Reference>

<Reference Alias="Authoring">

<ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Authoring</ID>

<Version>1.0.2780.0</Version>

<PublicKeyToken>9396306c2be7fcc4</PublicKeyToken>

</Reference>

</References>

</Manifest>

Creating a Class

The next section of a management pack contains type definitions. The TypeDefinitions section of a management pack contains definitions for classes, enumerations, and relationships that are used by the management pack.

The following example shows a class that contains information about projectors:

<TypeDefinitions>

<EntityTypes>

<ClassTypes>

<ClassType ID="System.ConfigItem.Projector" Base="System!System.ConfigItem" Hosted="false" Accessibility="Public" Abstract="false">

<Property ID="SerialNumber" Type="int" Key="true" />

<Property ID="Make" Type="string" />

<Property ID="Model" Type="string" />

<Property ID="Location" Type="string" />

<Property ID="Condition" Type="enum" EnumType="ProjectorCondition" />

</ClassType>

</ClassTypes>

<RelationshipTypes>

</RelationshipTypes>

<EnumerationTypes>

<EnumerationValue ID="ProjectorCondition" Accessibility="Public"/>

<EnumerationValue ID="ProjectorCondition.Working" Parent="ProjectorCondition" Accessibility="Public"/>

<EnumerationValue ID="ProjectorCondition.BeingRepaired" Parent="ProjectorCondition" Accessibility="Public"/>

<EnumerationValue ID="ProjectorCondition.New" Parent="ProjectorCondition" Accessibility="Public"/>

<EnumerationValue ID="ProjectorCondition.Broken" Parent="ProjectorCondition" Accessibility="Public"/>

<EnumerationValue ID="ProjectorViewTasksEnumeration" Accessibility="Public"/>

</EnumerationTypes>

</EntityTypes>

</TypeDefinitions>

The following is a section-by-section explanation of what the type definition contains.

The ClassTypes section

The ClassType element defines the projector class:.

<ClassType ID="System.ConfigItem.Projector" Base="System!System.ConfigItem" Hosted="false" Accessibility="Public" Abstract="false">

The ID attribute is the unique identifier of this class. It is set to: ID="System.ConfigItem.Projector"

The Base attribute is the ID of the class from which this class derives. Because a projector is a kind of configuration item, this is set to:

Base="System!System.ConfigItem"

The notation of System! indicates that this class, System.ConfigItem, is in the management pack that is referenced by the alias System. For more information, see the References section earlier in this document.

The Hosted attribute defines whether this class is hosted by another class. In this case, an instance of this class can only exist when a host instance exists that contains it. For this example, projectors are not hosted by anything, so the Hosted attribute is set to false:

Hosted="false"

Setting the Hosted attribute to true indicates that the class is hosted by another class. The hosting relationship must be declared in the RelationshipTypes section.

The Accessibility attribute defines whether other classes can derive from this class. In cases where you might want to allow others to create a more specific version of your class, set this attribute to public. For example:

Accessibility="Public"

Setting the Accessibility attribute to Private prevents other classes from deriving from this class.

The Abstract attribute defines whether instances of this class are created, or whether the class should just be used as a parent class to other classes to derive from. In this example, this attribute is set to false. Setting this attribute to true means that no instances of this class can be created directly and that this class can be used only as a parent class.