{"id":409,"date":"2016-08-28T17:35:50","date_gmt":"2016-08-28T15:35:50","guid":{"rendered":"http:\/\/h2916922.stratoserver.net:8084\/?page_id=409"},"modified":"2016-08-28T18:22:52","modified_gmt":"2016-08-28T16:22:52","slug":"central-configuration-plugin-manual","status":"publish","type":"page","link":"https:\/\/www.ivojonker.nl\/?page_id=409","title":{"rendered":"Central Configuration-plugin manual"},"content":{"rendered":"<p>This is a short manual on how to use the Central Configuration plugin for IBM Content Navigator &amp; IBM Case Manager.<\/p>\n<p>For updates please see:<\/p>\n<p><a href=\"http:\/\/h2916922.stratoserver.net:8084\/?p=407\">The introductory blogpost at ivojonker.nl<\/a><\/p>\n<p>Also available in <a href=\"http:\/\/h2916922.stratoserver.net:8084\/ivo\/wp-attachments\/CentralConfigurationPlugin%20manual.docx\">.docx<\/a> and .<a href=\"http:\/\/h2916922.stratoserver.net:8084\/ivo\/wp-attachments\/CentralConfigurationPlugin%20manual.pdf\">pdf<\/a><\/p>\n<p>Contents<\/p>\n<p><a href=\"#post-409-_Toc460171024\">Introduction 1<\/a><\/p>\n<p><a href=\"#post-409-_Toc460171025\">1. Preparing and installing the plugin 1<\/a><\/p>\n<p><a href=\"#post-409-_Toc460171026\">1.1. Preparing the .jar file for use in your environment. 1<\/a><\/p>\n<p><a href=\"#post-409-_Toc460171027\">1.2. Installing the .jar file as navigator plugin \/ for use within navigator 1<\/a><\/p>\n<p><a href=\"#post-409-_Toc460171028\">1.3. Adding and removing configuration entries using the ICN Plugin manager 1<\/a><\/p>\n<p><a href=\"#post-409-_Toc460171029\">1.4. Installing the .jar for global use within java EE applications (WebSphere) 1<\/a><\/p>\n<p><a href=\"#post-409-_Toc460171030\">1.5. Using the .jar in a single java EE application (running on WebSphere) 1<\/a><\/p>\n<p><a href=\"#post-409-_Toc460171031\">2. Accessing the plugin from your code. 1<\/a><\/p>\n<p><a href=\"#post-409-_Toc460171032\">2.1. From dojo\/JavaScript. 1<\/a><\/p>\n<p><a href=\"#post-409-_Toc460171033\">2.2. From java 1<\/a><\/p>\n<h1><a id=\"post-409-_Toc460171025\"><\/a>Preparing and installing the plugin<\/h1>\n<h2><a id=\"post-409-_Toc460171026\"><\/a>Preparing the .jar file for use in your environment.<\/h2>\n<ol>\n<li>Download the CentralConfiguration.jar plugin file.<\/li>\n<li>Open the CentralConfiguration.jar plugin file with an archive browser (e.g. WinRAR, or 7zip)<\/li>\n<li>Within the CentralConfiguration.jar open the \u2018config.properties\u2019 file for editing.<br \/>\nThree properties need to be specified, although the defaults may probably work, please take into account the following:<\/p>\n<ol>\n<li><strong>DATASOURCEJNDI<\/strong>: The configuration plugin relies on a datasource to be available within the JNDI. While you may re-use the navigator\u2019s datasource (default ECMClientDS), it is probably better to define a new \u2013 specific datasource for architectural reasons.<\/li>\n<li><strong>CONFIGTABLENAME<\/strong>: A database table will be created within the datasource. Be sure not to pick an existing table-name.<\/li>\n<li><strong>CREATETABLEQUERY<\/strong>: When creating the table to store the configuration, this query will be used. Update the data-types as needed by your database provider.<\/li>\n<\/ol>\n<\/li>\n<li>Save the updated \u2018config.properties\u2019 file within the \u2018CentralConfiguration.jar\u2019.<\/li>\n<\/ol>\n<h2><a id=\"post-409-_Toc460171027\"><\/a>Installing the .jar file as navigator plugin \/ for use within navigator<\/h2>\n<ol>\n<li>Login as an administrative user on the admin desktop (navigator?desktop=admin). Then navigate to the \u2018Plug-ins\u2019 page and press the \u2018New Plugin-button\u2019.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1040\" height=\"405\" class=\"wp-image-432\" src=\"http:\/\/h2916922.stratoserver.net:8084\/wp-content\/uploads\/2016\/08\/word-image.png\" srcset=\"https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image.png 1040w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-300x117.png 300w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-768x299.png 768w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-1024x399.png 1024w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-750x292.png 750w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-400x156.png 400w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-430x167.png 430w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-150x58.png 150w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-100x39.png 100w\" sizes=\"auto, (max-width: 1040px) 100vw, 1040px\" \/><\/p>\n<ol>\n<li>Fill in the path to the JAR file and press load; <img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"695\" class=\"wp-image-433\" src=\"http:\/\/h2916922.stratoserver.net:8084\/wp-content\/uploads\/2016\/08\/word-image-1.png\" srcset=\"https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-1.png 866w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-1-300x241.png 300w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-1-768x616.png 768w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-1-750x602.png 750w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-1-400x321.png 400w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-1-430x345.png 430w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-1-150x120.png 150w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-1-100x80.png 100w\" sizes=\"auto, (max-width: 866px) 100vw, 866px\" \/><\/li>\n<li>After loading, look at the field \u201cConfiguration status\u201d, if all was configured well there\u2019s probably a notice that the configuration table does not yet exist. Click on the [create table] button. The following message should appear:<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"353\" height=\"281\" class=\"wp-image-434\" src=\"http:\/\/h2916922.stratoserver.net:8084\/wp-content\/uploads\/2016\/08\/word-image-2.png\" srcset=\"https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-2.png 353w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-2-300x239.png 300w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-2-150x119.png 150w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-2-100x80.png 100w\" sizes=\"auto, (max-width: 353px) 100vw, 353px\" \/><\/li>\n<\/ol>\n<p>And the status becomes \u2018ready\u2019<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"510\" height=\"82\" class=\"wp-image-435\" src=\"http:\/\/h2916922.stratoserver.net:8084\/wp-content\/uploads\/2016\/08\/word-image-3.png\" srcset=\"https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-3.png 510w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-3-300x48.png 300w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-3-400x64.png 400w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-3-430x69.png 430w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-3-150x24.png 150w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-3-100x16.png 100w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/p>\n<ol>\n<li>All is set.<\/li>\n<\/ol>\n<h2><a id=\"post-409-_Toc460171028\"><\/a>Adding and removing configuration entries using the ICN Plugin manager<\/h2>\n<ol>\n<li>To add an entry, simply type in your key in the \u2018Add new property\u2019 textfield, and press add.<\/li>\n<li>The new entry will be automatically grouped with other entries sharing the same namespace.<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"336\" class=\"wp-image-436\" src=\"http:\/\/h2916922.stratoserver.net:8084\/wp-content\/uploads\/2016\/08\/word-image-4.png\" srcset=\"https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-4.png 932w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-4-300x108.png 300w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-4-768x277.png 768w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-4-750x270.png 750w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-4-400x144.png 400w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-4-430x155.png 430w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-4-150x54.png 150w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-4-100x36.png 100w\" sizes=\"auto, (max-width: 932px) 100vw, 932px\" \/><\/li>\n<\/ol>\n<p>Each entry has the following attributes:<br \/>\n<strong>Key<\/strong>: The identification attribute that will be used to retrieve the property.<br \/>\n<strong>Value<\/strong>: The value of the attribute which can be any (multiline) string.<br \/>\n<strong>Description<\/strong>: (click on the information icon) A description of the property so other administrators can understand it\u2019s purpose without consulting documentation.<br \/>\n<strong>Expose to frontend<\/strong>: Whether or not this entry should be accessible on the frontend. <strong>Warning<\/strong>: please note that any properties exposed to the frontend will be accessible to all authenticated users. Its discouraged to expose any passwords or api-keys.<br \/>\n<strong>Evaluate at frontend<\/strong>: Whether or not to call javascript-eval() on the content when accessing the content via JavaScript. This can be useful if you want to have JSON objects desterilized, or functions as configuration objects.<\/p>\n<ol>\n<li>Finally press the \u201csave\u201d button to persist the changes. If all goes well, no messages will be shown.<\/li>\n<\/ol>\n<p>An entry can be removed by entering its full canonical name in the \u2018Add new property field\u2019 followed by pressing the \u2018Delete\u2019 button.<\/p>\n<h2><a id=\"post-409-_Toc460171029\"><\/a>Installing the .jar for global use within java EE applications (WebSphere)<\/h2>\n<p>I personally prefer to make the configuration plugin accessible to all the applications running on WebSphere. Only one instance will exist per JVM and only one .jar has to be maintained. The way I usually achieve this is my creating a shared library and connect it to JVM\u2019s class loader.<\/p>\n<p>After taking these steps, don\u2019t forget to reference a copy of the configuration.jar during design\/build-time.<\/p>\n<ol>\n<li>Copy the plugin .jar to newly made directory accessible to the WebSphere server. For example, \u2018c:\\IBM\\shared libraries\\\u2019.<\/li>\n<li>Open the WebSphere console (<a href=\"https:\/\/localhost:9043\/ibm\/console\">https:\/\/localhost:9043\/ibm\/console<\/a>) and navigate to Environment -&gt; Shared Libraries. Press \u201cNew\u201d to create a new Shared Library.<\/li>\n<li>Choose a meaningful name (e.g. \u201cCentral Configuration\u201d, or \u201c&lt;Project name&gt;Shared libraries\u201d if you\u2019re intended on having multiple jars available for general use). Enter your path (from step 1) in the class path.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"651\" class=\"wp-image-437\" src=\"http:\/\/h2916922.stratoserver.net:8084\/wp-content\/uploads\/2016\/08\/word-image-5.png\" srcset=\"https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-5.png 707w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-5-300x276.png 300w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-5-400x368.png 400w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-5-430x396.png 430w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-5-150x138.png 150w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-5-100x92.png 100w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/p>\n<ol>\n<li>Press apply, followed by Save.<\/li>\n<li>Next navigate to Servers-&gt; WebSphere application servers-&gt;&lt;server name&gt;-&gt;Java and Process Management-&gt;Class loader.<\/li>\n<li>Select the class loader already available (if no available, create one). Navigate to \u201cShared library references\u201d.<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"702\" height=\"345\" class=\"wp-image-438\" src=\"http:\/\/h2916922.stratoserver.net:8084\/wp-content\/uploads\/2016\/08\/word-image-6.png\" srcset=\"https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-6.png 702w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-6-300x147.png 300w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-6-400x197.png 400w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-6-430x211.png 430w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-6-150x74.png 150w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-6-100x49.png 100w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/li>\n<li>Add the newly created shared library, then press save.<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"423\" class=\"wp-image-439\" src=\"http:\/\/h2916922.stratoserver.net:8084\/wp-content\/uploads\/2016\/08\/word-image-7.png\" srcset=\"https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-7.png 705w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-7-300x180.png 300w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-7-400x240.png 400w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-7-430x258.png 430w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-7-150x90.png 150w, https:\/\/www.ivojonker.nl\/wp-content\/uploads\/2016\/08\/word-image-7-100x60.png 100w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><\/li>\n<li>Finally restart WebSphere to effectuate.<\/li>\n<\/ol>\n<h2><a id=\"post-409-_Toc460171030\"><\/a>Using the .jar in a single java EE application (running on WebSphere)<\/h2>\n<p>Simply copy the jar file within your &lt;app.war&gt;\\web-inf\\lib directory; or your &lt;ear&gt;\\lib directory and you\u2019re set to go.<\/p>\n<h1><a id=\"post-409-_Toc460171031\"><\/a>Accessing the plugin from your code.<\/h1>\n<h2><a id=\"post-409-_Toc460171032\"><\/a>2.1. From dojo\/JavaScript.<\/h2>\n<p>Assuming you\u2019re trying to access specific properties from within the IBM Content Navigator context, the following snippet is all you need to get started.<\/p>\n<pre class=\"lang:js decode:true \">require(\"CentralConfiguration\").get(\"filenet.ce.iiop\")<\/pre>\n<p>A second parameter can be provided to return a default value if the key ends up to be null or not present in the configuration repository.<\/p>\n<h2><a id=\"post-409-_Toc460171033\"><\/a>2.2. From java<\/h2>\n<p><em>Please take into account that the Central Configuration plugin requires the application to be run within a WebSphere context. <\/em><\/p>\n<pre class=\"lang:java decode:true\">package nl.ivojonker.sample;\r\n\r\nimport nl.ivojonker.icn.configuration.Configuration;\r\n\r\npublic class SampleUsage {\r\n\t\r\n\tpublic static void doStuff(){\r\n\t\t\r\n\t\tboolean useCache = false;\r\n\t\t\r\n\t\t\/\/Retrieves the singleton with default useCache = true Simply re-uses earlier collected configuration \r\n\t\tConfiguration config = Configuration.getInstance();\r\n\t\t\r\n\t\t\/\/Retrieves the singleton with the option to provide useCache=false\r\n\t\tconfig = Configuration.getInstance(useCache);\r\n\t\t\r\n\t\t\/\/Retrieves the singleton, but will not throw exceptions upon failure - might sometimes be convenient.\r\n\t\t\/\/The risk of not having a configuration available might be mitigated by using the following .getProperty(key,default) function.\r\n\t\tconfig = Configuration.getInstanceSupressExceptions(useCache)\r\n\r\n\t\t\/\/retrieves the value for filenet.ce.defaultobjectstore.\r\n\t\tconfig.getProperty(\"filenet.ce.defaultobjectstore\");\r\n\t\t\r\n\r\n\t\t\/\/retrieves the value for filenet.ce.defaultobjectstore, but returns default if the value does not exist.\r\n\t\tconfig.getProperty(\"filenet.ce.defaultobjectstore\",\"TARGET\");\r\n\t}\r\n\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a short manual on how to use the Central Configuration plugin for IBM Content Navigator &amp; IBM Case Manager. For updates please see: The introductory blogpost at ivojonker.nl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page_fullwidth.php","meta":{"footnotes":""},"class_list":["post-409","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ivojonker.nl\/index.php?rest_route=\/wp\/v2\/pages\/409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ivojonker.nl\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ivojonker.nl\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ivojonker.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ivojonker.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=409"}],"version-history":[{"count":8,"href":"https:\/\/www.ivojonker.nl\/index.php?rest_route=\/wp\/v2\/pages\/409\/revisions"}],"predecessor-version":[{"id":446,"href":"https:\/\/www.ivojonker.nl\/index.php?rest_route=\/wp\/v2\/pages\/409\/revisions\/446"}],"wp:attachment":[{"href":"https:\/\/www.ivojonker.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}