Creating a service
You can create a plug-in to define a service that performs operations on a content server. For example, you can create a service that provides a viewer for specific document types on a IBM FileNet® P8 server.
About this task
You use the application programming interfaces (APIs) that are native to the content server to define the operations that are performed by the service.
Tip: Follow best practices
for servlets when you implement an IBM Content Navigator plug-in service:
- Because the application server is multithreaded, the plug-in service needs to handle multiple threads safely.
- The service will be called on multiple threads for multiple users; therefore, do not use instance variables. Using instance variables can have side effects such as unintentional sharing of information among users.
Procedure
To create a service:
Sample plug-in files for a custom service
The following files in the sample plug-in define a service:| File | Description |
|---|---|
| SamplePluginService.java | This file extends the PluginService class to define a service that obtains system-related details about a document. To obtain this information, the service invokes the appropriate API depending on whether the document is in an IBM Content Manager, IBM Content Manager OnDemand, or IBM FileNet P8 repository. |
| SamplePluginViewerDef.java | This file extends the PluginViewerDef class to define the URL template to launch the viewer that is defined in the SamplePluginViewerService.java file. |
| SamplePluginViewerService.java | This file extends the PluginService class to define a service that provides a custom viewer that does simple formatting of an archived RSS feed. |