Configure a Service Module

In order to use a service module, certain steps must be taken to configure its use.

In the ServiceModules.xml file of the Sample Provisioning User Interface Framework, add a new ServiceModule element. A fully configured service module node would have following structure:

<ServiceModule  Name="SampleService" DisplayName="Sample Service" 
Allow="HA:HU,RU,BU,CU,NoSelf;RA:RU,BU,CU,NoSelf;CA:BU,CU,NoSelf;" Visible="true" ValidationRequired="true"
Path="~\ServiceModules\DemoServiceModule.ascx" ServiceModuleControllerFilePath="~\ServiceModules\DemoServiceModuleController.xml" Description="A Demo Service">
</ServiceModule>

Attribute Required Description
Name Yes Unique ID of service module. This has to be unique across ServiceModules.xml.
DisplayName Yes Name that will be displayed in the Services drop-down menu.
Allow Yes

Specifies the permissions for the specified service.

The following format is used:

Role : Object Type;

Role can be HA, RA, CA, CU. Value can be HU, RU, BU, CU, HO, RO, BO, CO, Self, NoSelf (comma separated when multivalued). Multiple roles are separated by a semi-colon. Self specifies that the logged-on user can carry out the action on himself whereas NoSelf means that the user cannot. If a * is specified then it is available to all the roles.

Visible Yes Controls if the service module will be visible in the service menu
ValidationRequired Yes --
Path Yes Physical path where the user control (.ascx) file for the service module is present.
ServiceModuleControllerFilePath Yes The physical path of the Service Module Controller XML file.
Description Yes Description of the service

The Description attribute of a Service Module or Action element is displayed as a tool tip. There are two special cases for service modules: In the first case, the service is an action in itself. For such service modules, the service module node in ServiceModules.xml looks like this:

<ServiceModule  Name="DemoServiceModule" Visible="true" 
ValidationRequired="true"
Path="~\ServiceModules\DemoServiceModule.ascx" ServiceModuleControllerFilePath="~\ServiceModules\ DemoServiceModuleController.xml"
				Description="This is a Demo Service Module">
</ServiceModule>

In the second case, the service has one or more Actions associated with it, and its node in ServiceModules.xml looks like this:

<ServiceModule  Name="DemoServiceModule" DisplayName="Demo Service Module" Allow="*" Visible="true" ValidationRequired="false"
Description="Gives you Demo Actions to perform for organizations and users">
</ServiceModule>

Attribute Required Description
Name Yes Unique ID of service module. This has to be unique across ServiceModules.xml.
DisplayName Yes Name that will be displayed in the Services drop-down menu.
Visible No Controls if the service module will be visible in the service menu.
Allow Yes The * makes the service visible to all the Roles. However, it is also possible to use the Allow attribute to set role-based permissions.
ValidationRequired Yes As the service module is not an action in itself, and it will have one or more actions under it, this attribute is set to false. This attribute should be set to true for the child Actions if required.
Description Yes Description of the service

The associated Actions of the Service are listed as child elements as shown below:

<Action  Name="DemoAction01" DisplayName="Demo Action 01" 
Allow="HA:HU,RU,BU,CU,NoSelf;RA:RU,BU,CU,NoSelf;CA:BU,CU,NoSelf;" Visible="true" ValidationRequired="true"
Path="~\ServiceModules\DemoServiceModule\DemoAction01.ascx" ServiceModuleControllerFilePath="~\ ServiceModules\DemoServiceModule\DemoAction01Controller.xml"
		Description="Allows you to perform Demo Action 01">
</Action>

Attribute Required Description
Name Yes Unique ID of service module. This has to be unique across ServiceModules.xml.
DisplayName Yes Name that will be displayed in the Services drop-down menu.
Allow Yes

Specifies the permissions for the specified Service.

The following format is used:

Role : Object Type;

Role can be HA, RA, CA, CU. Value can be HU, RU, BU, CU, HO, RO, BO, CO, Self, NoSelf (comma separated when multivalued). Multiple Roles are separated by a semi-colon. Self specifies that the logged on user can carry out the action on himself whereas NoSelf means that he cannot. If a * is specified then it is available to all the roles.

Visible Yes This controls if the service module will be visible in the service menu.
ValidationRequired Yes This specifies if any validations are required or not for the Action. It can be set either as true (if validation is required) or false (if validation is not required).
Path Yes The physical path where the user control (.ascx) file for the service module is present.
ServiceModuleControllerFilePath Yes The physical path of the Service Module Controller XML file.
Description Yes Description of the service

The Constants used to define the namespace name and procedure names of the Service are listed as child elements of the Service as shown below::

<Constants Key="DemoServiceNamespace" Value="MPSSampleWebUI.WebServiceProxy.DemoService.Service"></Constants>

<Constants Key="Procedure1" Value="DemoProcedure"></Constants>

Attribute Required Description
Key Yes This is the unique name of the namespace/Procedurename.
Value Yes The actual namespace/Procedurename.