API Plug-ins › How to Write and Use API Plug-ins
How to Write and Use API Plug-ins
To write and use an API plug-in, follow this process:
- Define the purpose of the plug-in, for example, to populate a select field with meeting rooms that a user can reserve for a specifed time period. Other examples include options for the meeting room, such as projectors, video conferencing units, and microphones.
- Meet the prequisites. Be able to do the following proficiently:
- Program in Java
- Create forms using the Form Designer
- Create the following fields in Form Designer forms:
- Single select, multiselect, and dual list fields
- Dynamic table fields
- Review the API Plug-in documentation, as follows:
- Log in to CA Service Catalog and select Administration, Tools.
- In the left menu, select Links.
- Scroll down to the Documentation section and click Plug-in Documentation.
The API documentation is automatically generated Java documentation based on the Java class methods for the plug-ins. You use the interfaces, classes, methods, and so forth to implement your plug-in.
- Create a Java class for the type of Form Designer field for which the plug-in applies, as follows:
- For single select, multiselect, and dual list fields: Create a Java class that implements the interface named com.ca.usm.plugins.apis.forms.FDSelectDataProvider
- For dynamic table fields: Create a Java class that implements the interface named com.ca.usm.plugins.apis.forms.FDTableDataProvider
Both interfaces and sample Java classes appear in the API Plug-in documentation. You can use the samples in the API Plug-in documentation as models for your Java classes.
- (Optional) If you use content configuration forms, retrieve values from fields on these forms and use them as needed.
- Create a properties file for the plug-in. You can use the samples in the API Plug-in documentation as models for your properties files.
- If applicable, do one of the following:
- Create a folder to store the following:
- The properties file
Important! Store the properties file at the top level of the folder. Do not store the properties file in a subfolder.
- Any JAR files that provide the classes and supporting libraries
You can store them in subfolders, if necessary.
- Do the following to activate the plug-in:
- Stop the Windows service for Service View. The service is named CA Service View.
- Copy your folder (including all subfolders, if any) to the %USM_HOME%\filestore\plug-in folder.
- Restart the Windows service for Service View.
- Do the following to verify that the plug-in was successfully adopted:
- Log in to CA Service Catalog and select Administration, Tools.
- In the left menu, select Plug-ins.
- Verify that the plug-in is listed and that its details appear properly.
You are ready to test this API for use in a form field.