Show TOC

GWM Outlook Add-In Project StructureLocate this document in the navigation structure

Understanding the structure of the generated project for the GWM Outlook Add-in template.

Using the GWM Visual Studio Add-In tool, you can create a GWM Outlook add-in template for Contacts, Tasks, and Appointments applications through the GWM Outlook Add-in wizard.

On completion of the steps in the wizard, a project containing the generated code and resources for the GWM Outlook Add-in template is created in the path, for example, C:\...\Visual Studio 2012\Projects\<Your Project Name>.
Note The path for the generated content for your GWM Outlook Add-in template depends on the version of Microsoft Visual Studio you are using.

The content of the project is presented in the Solution Explorer pane with the following structure:

Project Structure

The image above shows an add-in project with multiple templates, each interacting with a different service, such as, contact, WFService and Z_SG_TIME_MGMT.

Business Entity

The section describes the classes generated in the Business Entity folder as part of the GWM Outlook Add-In project.

The following are the classes:

  • BusinessApplicationFactory

    This is the factory class which instantiates the appropriate BusinessApplication class based on the BusinessApplicationName. The method GetBusinessApplication, can be extended to add as many business application names as required.

  • BusinessApplication

    This is the abstract class which defines the methods for Create, Read Update and Delete (CRUD) operations for the Contacts, Tasks, and Calendars. The class can be extended to add more operations, or fields required across business application classes.

  • BusinessConnectivityHelper

    This class handles the connectivity to the OData endpoint. It performs the required handling to enable authentication to the SAP Gateway endpoint. It also triggers the call to the SAP Gateway endpoint with requestId and SAP Passport required for enterprise readiness.

The diagram below shows a sample class diagram for the Business Entity: BusinessEntity

Logger

The Logger folder contains the Logger class.

This class provides APIs to log the necessary information to the Event Viewer, or a local file. The class uses System.Trace API, and therefore the logging can be enabled through the file, app.config. This class can be extended to support any other custom logging, including third party logs.

Outlook

This folder contains a subfolder for the template type generated, for example, Contacts, Appointments, and Tasks. Each folder contains a subfolder with the name of the template type created.

Example

For example, the Contacts folder will contain a subfolder for each application of type, Contacts, created.

Common Classes

These classes are common for any type of application created in the GWM project.

  • ExceptionHandler

    This class contains methods for handling the exceptions occurring in the project. The class provides methods for finding the severity of the exception, getting the detailed exception message, logging the exception and showing up the error/warning message to the user and so on.

    This class can be extended to provide custom handling of errors/exceptions.

  • ExplorerWrapper

    This is the base class for all Explorer wrappers. The class contains the methods for identifying the current explorer instance, registering/unregistering the close events on the explorer.

    The class also provides the Close eventhandler which can be extended to perform any specific operations on the close of the current explorer.

  • InspectorWrapper

    This is the base class for all inspector wrappers. The class contains the methods for identifying the current inspector instance, registering/unregistering the close events on the inspector.

    The class also provides the Close eventhandler which can be extended to perform any specific operations on the close of the current inspector.

  • OutlookRibbon

    This is the Ribbon class which contains the methods for showing and hiding the required buttons at the explorer/inspector windows.

    The class also provides the eventhandlers for all the buttons on the ribbon UI.

    These methods can be extended to perform specific operations. For example, fetching of items from service is performed as a background job, can be run as foreground job.

  • OutlookUtilities

    This is the Helper class for the project. The class contains methods used across the project such as cleaning up the COM objects, finding the Microsoft Outlook item in the given folder of the Microsoft Outlook, checking if the item is an SAP bound item, removing the user properties of an Microsoft Outlook item during its deletion and so on. The class can be extended to add helper methods.

  • ValueHelpForm

    This class contains methods for populating the F4 or value help data on to a form and then returning the selected value to the application. You can extend the class to suit your needs.

Formatter Classes

This folder contains formatter classes to format the data to be used in the application. You can create custom formatters to format the data as required. The classes that are used are:

Formatter

IPropertyFormatterInterface for formatting the runtime values of the properties of OData entity.

  • TaskStatusFormatter

    This class implements the IPropertyFormatter interface. This class helps to format the runtime value of the TaskStatus Property of the Task item.

  • FreeBusyFormatter

    This class implements the IPropertyFormatter interface. This class helps to format the runtime value of FreeBusy Property of the Appointment item.

  • GenderFormatter

    This class implements the IPropertyFormatter interface. This class helps to format the runtime value of Gender Property of the Contact item.

  • SensitivityFormatter

    This class implements the IPropertyFormatter interface. This class helps to format the Sensitivity Property of the Appointment item.

  • PriorityFormatter

    This class implements the IPropertyFormatter interface. This class helps to format the runtime value of Priority Property of the Contacts, Tasks, Appointments item.

Validator Classes

The diagram below shows the classes of the validator. See Extending the Validation Methods for more information of writing Validators.

Validator

The folder contains classes for performing client side validations. The developer can extend the classes to perform custom validations. The classes that are being used here are:

  • IValidator

    This is an interface that provides the methods for checking if validation is successful and constructing the validation error message.

  • IApplicationValidation

    This is an interface that provides the methods for performing the required validation. See Contact[Appointment]Validator.

    This class implements the IValidator interface. The class helps perform the required validation of SAP contact [appointment] item’s properties.

Associated Entities Classes

The following diagram shows the classes in the Associated Entities tab.

AssociatedEntitiesTab

These classes are responsible for populating a Microsoft Outlook tab region with the associated entities selected by the user during project creation. You can add your own associated entities tabs. See How to Add Custom Tabs to Display Associated Entities for more information.

  • AssociatedEntitiesTab

    This class will initialize the Associated Entities region based on the following conditions:

    • The associated item is an SAP bound item

    • The item has a user property “BusinessApplicationName” with the proper application name (application the item belongs to).

    • The EntryID of the item is not null.

      The class then loads the tabs for each associated entity selected by the user during the application creation.

  • AssociatedEntitesTabMediator

    This is the mediator class for the AssociatedEntitiesTab class which helps in performing the following business operations.

    Initially only the first tab is loaded with the data. The other tabs are loaded with data on selection. The data of all selected tabs is cached for particular session.

User Properties Classes

The diagram below shows the classes used in the User Properties tab:

User Properties

These classes are responsible for populating a Microsoft Outlook tab region with the user-defined, or custom properties selected by the user during project creation, and also show up the value help data for each property if maintained in the backend connected.

You can add your own custom tabs. See How to Add Custom Tabs to Display Associated Entities

  • UserPropertiesTab

    This is the Windows form class which provides the UI to show the Microsoft Outlook custom properties which cannot be viewed in the standard Microsoft Outlook UI by default.

    This class can be extended to show more custom properties, for example, complex properties

  • UserPropertiesTabMediator

    This is the mediator class which provides the business operations for the UserProperties Tab region. The class contains the methods for updating the userproperties grid and opening up the value help form with F4 values.

References

The following references are added to the generated project:

  • SAP.IW.GWPAM.SSO

    This assembly contains classes that provide single sign-on capability.

    GWM Visual Studio Add-In supports the use of the following SSO based authentication for client side authentication: SAML2.0, and X.509 certificates

  • SPNEGO SAP.IW.GWPAM.Parser

    This assembly contains the classes that handle the reading of the service document metadata, and the ATOM feed response of the service endpoint.

  • SAP.IW.GWPAM.Common

    This assembly contains the configuration classes which provide the APIs to read the configuration values maintained by the user in app.config and ADM files.

    The assembly also has a GWPAMException class, which contains methods to display custom messages for the errors and exceptions.

Business Application Classes

This class provides the functionality to map the SAP business entity to the Microsoft Outlook fields, and provides APIs to fetch records from SAP, create, update and delete record from SAP.

In some cases the method implementation may be blank depending on the service, for example, in case the SAP Gateway service does not support the create operation, then the create method will be blank.

The class extends the BusinessApplication class, and provides the implementation for CRUD methods. The class also implements the IApplicationValidation interface to perform validations of the service.

The class can be extended to provide different mappings.