Making the extension point class available

To make the extension point class available to IBM® Product Master, you need to load the .class file to the document store. Or, you need to make the .class file available using a .JAR file in the class path of the Product Master instance.

Before you begin

After you implement an extension point and create the compiled .class file, the .class file is made available to Product Master. Therefore, it gets started by the system when that particular extension point is reached.

About this task

  1. Use one of the following methods to make the extension point class available to Product Master:
    • Load the .class file directly to the document store. You can use a simple Java™ class, which is based on Product Master Java API, to upload a .class file to the document store. The class can be loaded under a subfolder in the document store as well. The file system can be used as a document store in Product Master. The same file system location can be used as a repository of .class files.
      Note: When the .class files are directly loaded to the document store, users are individually working on a particular extension point. This approach might be suitable when you develop the extension point implementation code but is not suited for production environments where there is a need to deploy multiple extension point implementations. Since typically a Product Master deployment has multiple extension points that are implemented, by using a single JAR file to bundle all these classes and deploy them is less error prone compared to handling them individually.
      Approach® 1: Mount the file system as docstore
      By using a file system-mounted docstore, the local file system can be used as a repository of Java API extension point classes. After the file system is mounted, the .class files can be directly copied to that location.

      For more information about mounting, see Mounting a folder to the docstore.

      Approach 2: Use Java APIs to load the .class into docstore
      This approach uses a Java API-based application to upload the .class file. In the following sample code, the .class file gets loaded into the /uploaded_java_classes directory area of the document store. This code segment can be used in a stand-alone Java program, which is compiled and run as Java application. This program can be further updated to clean up all of the classes in the docstore before you upload and can be made to upload more than one .class file.
      In this example: The path of the uploaded .class file in the document store reflects the package structure of the .class file. The document store path is: /uploaded_java_classes/mdmpim/extend/myextensionpoints/ ScriptingSandboxTestImpl.class
      The fully qualified class name that indicates the package structure for the class is: mdmpim.extend.myextensionpoints.ScriptingSandboxTestImpl.class
      Context ctx = PIMContextFactory.getContext("user", "password", "MyCompany");
      
      // Get a handle to docstore manager
      DocstoreManager dsMgr = ctx.getDocstoreManager();
      
      //Create an empty document in the doc store, with full path
      Document doc = dsMgr.createAndPersistDocument
      ("/uploaded_java_classes/mdmpim/extend/myextensionpoints/
      ScriptingSandboxTestImpl.class");
      
      //Set the content
      //create an inputstream from the file system file for your 
      //java class for extension point 
      FileInputStream inStream = new FileInputStream 
      ("C:\\project\\classes\\mdmpim\\extend\\myextensionpoints\\
      ScriptingSandboxTestImpl.class");
      
      doc.setContent(inStream);
      
      ctx.cleanUp();
      Click Collaboration manager > Document Store to check the existence of the .class file.
    • Use the custom or user JAR mechanism. You can use the custom or user .jar mechanism to make an extension point implementation class available to the Product Master system. With this mechanism, all of the extension point implementation classes are bundled into a JAR file and the JAR file is made available to Product Master. This approach is suitable when there are several extension point implementation classes.