5 Creating Extensions with Platform Development Studio Wizard

This chapter describes how to use Platform Development Studio Wizard to create extensions for Oracle Communications Services Gatekeeper.

About Platform Development Studio Wizard

Platform Development Studio Wizard is an Eclipse plug-in that streamlines the creation of the following Services Gatekeeper extensions:

  • Interceptor Modules

  • OAuth2 Extension Handlers

  • Platform Test Environment (PTE) Custom Modules

  • Web Services API Exposure Project

Note:

The REST API based on WADL (Deprecated wizard and the REST and/or SOAP API based on WSDL (Deprecated) wizard are for backwards compatibility only.

See "Overview of the Platform Development Studio" for more information.

The wizard adapts itself to the type of extension you are creating. It generates the following for each extension:

  • Classes and Ant build files

  • A build file with Ant targets for packaging the extension for deployment

Configuring Platform Development Studio Wizard

Before you create Services Gatekeeper extensions, configure Platform Development Studio Wizard by:

  • Ensuring you have the prerequisite software installed on your system.

  • Configuring Platform Development Studio Wizard directories and logging levels.

  • Ensuring Platform Development Studio Wizard is using the correct JRE.

Prerequisite Software

Ensure that the following software is installed on your system:

  • JDK 1.7.0_15 or higher

  • Eclipse 4.0 or higher

  • Services Gatekeeper Release 6.1

  • Services Gatekeeper Platform Development Studio

    Note:

    Platform Development Studio is automatically installed in your system's Middleware_home/ocsg_pds directory when you run the Services Gatekeeper multi-tier installer and select to install the Administration Server component.

Configuring Platform Development Studio Wizard Directories and Logging Levels

To configure Platform Development Studio Wizard directories and logging levels:

  1. Copy the oracle.ocsg.eclipse.jar file from your Middleware_home/ocsg_pds directory to your Eclipse_Home/plugins directory.

  2. Start Eclipse.

  3. From the Window menu, select Preferences.

    The Preferences window appears.

  4. From the navigation tree, select Services Gatekeeper Platform Development Studio.

    The Services Gatekeeper Platform Development Studio window appears.

  5. In the Middleware Home Directory field, enter or browse to the Middleware_home directory. For example, Oracle/Middleware.

    The Middleware_home directory serves as the repository for common files that are used by Oracle Communications products installed on the same machine, such as Services Gatekeeper and WebLogic Server.

  6. In the JDK Installation Directory field, enter or browse to the directory where the JDK is installed. For example, /java/jdk1.7.0_15.

  7. In the Logging Level group, do one of the following:

    • To create detailed log files, select All.

    • To create less detailed log files, select Standard.

  8. Click OK.

Ensuring Platform Development Studio Wizard Uses JRE 1.7

To ensure that Platform Development Studio Wizard is using JRE 1.7 or higher:

  1. In Eclipse, from the Window menu, select Preferences.

    The Preferences window appears.

  2. From the navigation tree, expand Java and then select Installed JREs.

    The Installed JREs window appears.

  3. Ensure that the Installed JREs table lists JRE 1.7.0_15 or higher.

  4. Click OK.

Generating an Interceptor Module

To generate an interceptor module project:

  1. Open Eclipse.

  2. From the File menu, select New and then select Other to start the New wizard.

    The Select a wizard window appears.

  3. From the navigation tree, expand Services Gatekeeper Platform Development Studio and then select Interceptor Module. Click Next.

    The Generate Interceptors module window appears.

  4. Enter a unique project name and choose a location for your project.

  5. In the Interceptor Settings group, do the following:

    1. In the Package Name field, enter the name of the interceptor module package.

    2. To include a life cycle listener, enter the name in the Application Lifecycle Listener field.

    3. Click the Add icon. Description of addel.png follows
      Description of the illustration ''addel.png''

      The Add Interceptor window appears.

    4. In the Name field, enter the name of the interceptor.

    5. In the Index field, enter the name of interceptor index.

    6. In the Point list, select the location in Services Gatekeeper where the interceptor will intercept events: MO North, MO South, MT North, or MT South.

    7. Click OK.

    8. To create more interceptors, click the Add icon and fill out the information in the Add Interceptor window.

  6. Click Finish.

Generating an OAuth 2.0 Extension Handler

To generate an OAuth 2.0 extension handler project:

  1. Open Eclipse.

  2. From the File menu, select New and then select Other to start the New wizard.

    The Select a wizard window appears.

  3. From the navigation tree, expand Services Gatekeeper Platform Development Studio and then select OAuth2 Extension Handlers. Click Next.

    The Generate OAuth2 Extended Handlers window appears.

  4. Enter a unique project name and choose a location for your project.

  5. In the OAuth2 Extension Settings group, do the following:

    1. In the Package Name field, enter the name of the extension handler.

    2. Click the Add icon. Description of addel.png follows
      Description of the illustration ''addel.png''

      The Add Handler window appears.

    3. In the Handler Name field, enter the name of the OAuth2 handler.

    4. To add more extensive customization for the OAuth2 handler, select the Ext check box.

    5. In the Validator Name field, enter the name of the validator for the OAuth2 handler.

    6. In the Response Type list, select the type of response the validator expects: code or token.

    7. In the Grant Type list, select the grant type that the validator expects: authorization code, refresh token, password, or client credentials.

    8. Click OK.

    9. To create more handlers, click the Add icon and fill out the information in the Add Handler window.

  6. Click Finish.

Generating a Platform Test Environment Custom Module

To generate a Platform Test Environment custom module:

  1. Open Eclipse.

  2. From the File menu, select New and then select Other to start the New wizard.

    The Select a wizard window appears.

  3. From the navigation tree, expand Services Gatekeeper Platform Development Studio and then select PTE Custom Module. Click Next.

    The Generate PTE modules window appears.

  4. Enter a unique project name and choose a location for your project.

  5. To define the module by using a custom WSDL file, select the Use custom WSDL files option.

    The Configure Service WSDL Files area and Configure Callback WSDL Files area are visible.

    1. In the Configure Service WSDL Files area, click the Add icon.

      The WSDL Files Configuration window appears.

    2. In the WSDL File field, either enter the path to the service file or click the Add icon to browse to the service file's location.

    3. In the JAX-WS or JAXB binding files area, click the Add icon.

      The Binding File Configuration window appears.

    4. In the Binding File field, either enter the path to the binding file or click the Add icon to browse to the binding file's location. Click OK.

    5. Click OK.

    6. In the Configure Callback WSDL Files area, click the Add icon.

      The WSDL Files Configuration window appears.

    7. In the WSDL File field, either enter the path to the service file or click the Add icon to browse to the service file's location.

    8. In the JAX-WS or JAXB binding files area, click the Add icon.

      The Binding File Configuration window appears.

    9. In the Binding File field, either enter the path to the binding file or click the Add icon to browse to the binding file's location. Click OK.

    10. Click OK.

  6. To define the module by using a WADL file, select the Use predefined WSDL files option.

    In the drop-down list, select one of the following predefined communication services:

    • px30_audio_call

    • px21_call_notification

    • px30_call_notification

    • px21_multimedia_messaging

    • px21_presence

    • ews_push_message

    • px21_sms

    • ews_binary_sms

    • ews_subscriber_profile

    • px21_terminal_location

    • px21_third_party_call

    • px30_third_party_call

    • px30_payment

  7. To define the module by using a WADL file, select the Use WADL option.

    The Configure Service WADL Files area appears.

    1. Click the Add icon.

      The WADL Files Configuration window appears.

    2. In the WADL File field, either enter the path to the service file or click the Add icon to browse to the service file's location.

    3. Click OK.

  8. To define the module by using a REST-to-REST WADL file, select the Rest2Rest WADL option.

    The Configure Service WADL Files area appears.

    1. Click the Add icon.

      The WADL Files Configuration window appears.

    2. In the WADL File field, either enter the path to the service file or click the Add icon to browse to the service file's location.

    3. Click OK.

  9. From the Settings Area, in the Name field, enter a name for the PTE module.

  10. In the Package Name field, enter the name of the Java package that will contain the package classes.

  11. In the Company field, enter the name of your company.

  12. In the Version field, enter the version number of the PTE module.

  13. Click Finish.

Generating a Web Service API Exposure Project

To generate a web service API exposure project:

  1. Open Eclipse.

  2. From the File menu, select New and then select Project to start the New wizard.

    The Select a wizard window appears.

  3. From the navigation tree, expand Services Gatekeeper Platform Development Studio and then select Web Service API Exposure Project. Click Next.

    The Create a Communication Service window appears.

  4. Enter a unique project name and choose a location for your project.

  5. Click Next.

    The Define the Communication Service window appears.

  6. In the Configure Service WSDL or WADL Files area, click the Add icon.

    The WSDL/WADL Files Configuration window appears.

  7. In the WSDL/WADL File field, either enter the path to the service file or click the Add icon to browse to the service file's location.

  8. Click OK.

  9. In the Configure Callback WSDL or WADL Files area, click the Add icon.

    The WSDL/WADL Files Configuration window appears.

  10. In the WSDL/WADL File field, either enter the path to the service file or click the Add icon to browse to the service file's location.

  11. Click OK.

  12. In the Company field, enter the name of your company.

  13. In the Version field, enter the version number of the communication service.

  14. In the Identifier field, enter an identifier to tie together a collection of Web services. The identifier is used in the names of the generated WAR and JAR files and the service type for the communication service. For example:

    sms_Identifier.war
    sms_Identifier_callback.jar
    
  15. In the Service Type field, enter the service type. The service type is used in EDRs and statistics. For example:

    smsServiceType
    MultimediaMessagingServiceType
    
  16. In the Java Class Package Name field, set the package names to use. For example: com.mycompany.service.

  17. In the Web Services Context Path field, set the context path for the Web service. For example: myService.

  18. In the API Exposure Interface list, select REST to generate a RESTful Service Facade for the communication service, or SOAP to generate SOAP Service Facade for the communication service.

  19. In the Content Type list, select the HTTP content type that Services Gatekeeper uses when it sends a request to the network: application/xml or application/json.

  20. In the Callback Content Type list, select the HTTP content type that Services Gatekeeper uses when it sends a request to the application: application/xml or application/json.

  21. Click Finish.

Adding and Removing Extension Plug-ins

This section describes how to add or remove plug-ins from an extension.

Adding a Plug-in to a Services Gatekeeper Project

To add a plug-in to an existing Services Gatekeeper project:

  1. Open Eclipse.

  2. From the Window menu, click Show View and then click Package Explorer.

    The Package Explorer window appears.

  3. Right-click your Services Gatekeeper project and then choose Properties.

    The Properties for ProjectName appears.

  4. From the navigation tree, select Plugins Configuration.

    The Plugins Configuration window appears.

  5. Click the Add Plugin icon. Description of addplugin.png follows
    Description of the illustration ''addplugin.png''

    The Add Plugin window appears.

  6. In the Protocol field, enter an identifier for the network protocol that the plug-in implements. It is used as a part of the names of the generated JAR file and the service name. For example:

    communicationServiceIdentifier._protocol.jar
    Plugin_communicationServiceIdentifier._protocol
    
  7. In the Schemes field, enter the address schemes that the plug-in can handle. Use a comma-separated list if multiple schemes are supported. For example: tel or sip.

  8. In the Package Name field, enter the package names to be used.

  9. In the Company field, enter the name of your company.

  10. In the Version field, enter the version number of the plug-in.

  11. In the Type area, select SOAP, SOAP to SOAP, or SIP.

  12. Click OK.

  13. Click Apply and then OK.

Removing a Plug-in from a Communication Service

To remove a a plug-in from an existing Services Gatekeeper project:

  1. Open Eclipse.

  2. From the Window menu, click Show View and then click Package Explorer.

    The Package Explorer window appears.

  3. Right-click your Services Gatekeeper project and then choose Properties.

    The Properties for ProjectName appears.

  4. From the navigation tree, select Plugins Configuration.

    The Plugins Configuration window appears and a list of plug-ins defined for the project is displayed.

  5. Select the plug-in to remove.

  6. Click the Remove Plugin icon. Description of removeplugin.png follows
    Description of the illustration ''removeplugin.png''

    The plug-in definitions are removed from the list.

  7. Click Apply to remove the plugin from the project.

    Warning: This removes all parts of the project, including any manually edited or added files.