{"id":12500,"date":"2019-06-16T18:37:32","date_gmt":"2019-06-16T16:37:32","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/"},"modified":"2025-10-24T09:32:13","modified_gmt":"2025-10-24T07:32:13","slug":"connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/","title":{"rendered":"Connecting to a Repository via a Dynamically Edited dfc.properties File (part II)"},"content":{"rendered":"<p>This is part II of the 2-part article. See <a title=\"Connecting to a Repository via a Dynamically Edited dfc.properties File (part I)\" href=\"https:\/\/www.dbi-services.com\/blog\/?p=32748&amp;preview=true\" target=\"_blank\" rel=\"noopener noreferrer\">for part I of this article<\/a>.<\/p>\n<h2>Testing<\/h2>\n<p>We will test on the host machine named docker that hosts 2 containers, container01 and container011. All 3 machines run a repository. Its name is respectively dmtest on docker (shortly, dmtest@docker:1489), dmtest01@container01:1489 (dmtest01@container01:2489 externally) and dmtest01@container011:1489 (dmtest01@container011:5489 externally). Incidentally, the enhanced syntax is also a good way to uniquely identify the repositories.<br \/>\nThe current dfc.properties file on the host docker:<br \/>\n<code><br \/>\n$ grep docbroker \/app\/dctm\/config\/dfc.properties<br \/>\ndfc.docbroker.host[0]=docker<br \/>\ndfc.docbroker.port[0]=1489<br \/>\n<\/code><br \/>\nThis is used for the local docbase dmtest.<br \/>\nLet&#8217;s tag all the docbases for an easy identification later:<br \/>\n<code><br \/>\n$ iapi dmtest -Udmadmin -Pdmadmin &lt;&lt;eoq<br \/>\nretrieve,c,dm_docbase_config<br \/>\nset,c,l,title<br \/>\ndmtest on docker host VM<br \/>\nsave,c,l<br \/>\neoq<br \/>\n<\/code><br \/>\nIdem from within container01 with its default dfc.properties file:<br \/>\n<code><br \/>\n$ iapi dmtest01 -Udmadmin -Pdmadmin &lt;&lt;eoq<br \/>\nretrieve,c,dm_docbase_config<br \/>\nset,c,l,title<br \/>\ndmtest01 created silently on container01<br \/>\nsave,c,l<br \/>\neoq<br \/>\n<\/code><br \/>\nIdem from within container011:<br \/>\n<code><br \/>\n$ iapi dmtest01 -Udmadmin -Pdmadmin &lt;&lt;eoq<br \/>\nretrieve,c,dm_docbase_config<br \/>\nset,c,l,title<br \/>\ndmtest01 created silently on container011<br \/>\nsave,c,l<br \/>\neoq<br \/>\n<\/code><br \/>\nFirst, let&#039;s access container01.dmtest01 from the containers&#039; host VM with the current dfc.properties file:<br \/>\n<code><br \/>\n$ idql dmtest01 -Udmadmin -Pdmadmin<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n\tOpenText Documentum idql - Interactive document query interface<br \/>\n\tCopyright (c) 2018. OpenText Corporation<br \/>\n\tAll rights reserved.<br \/>\n\tClient Library Release 16.4.0070.0035<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\nConnecting to Server using docbase dmtest01<br \/>\nCould not connect<br \/>\n[DM_DOCBROKER_E_NO_SERVERS_FOR_DOCBASE]error:  \"The DocBroker running on host (docker:1489) does not know of a server for the specified docbase (dmtest01)\"<br \/>\n<\/code><br \/>\nAs expected, it does not work because container01.dmtest01 does not project to the host&#8217;s docbroker. Now, let&#8217;s turn to widql:<br \/>\n<code><br \/>\n$ .\/widql <strong>dmtest01@docker:2489<\/strong> -Udmadmin -Pdmadmin --keep &lt;&lt;eoq<br \/>\nselect title from dm_docbase_config<br \/>\ngo<br \/>\neoq<br \/>\n\tOpenText Documentum idql - Interactive document query interface<br \/>\n\tCopyright (c) 2018. OpenText Corporation<br \/>\n\tAll rights reserved.<br \/>\n\tClient Library Release 16.4.0070.0035<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\nConnecting to Server using docbase dmtest01<br \/>\n[DM_SESSION_I_SESSION_START]info:  &quot;Session 0100c350800011bb started for user dmadmin.&quot;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\nConnected to OpenText Documentum Server running Release 16.4.0000.0248  Linux64.Oracle<br \/>\ntitle<br \/>\n------------------------------------------<br \/>\ndmtest01 created silently on container01<br \/>\n<\/code><br \/>\nIt works.<br \/>\nWe used <strong>&ndash;&ndash;keep<\/strong>, therefore the dfc.properties file has changed:<br \/>\n<code><br \/>\n$ grep docbroker \/app\/dctm\/config\/dfc.properties<br \/>\ndfc.docbroker.host[0]=docker<br \/>\ndfc.docbroker.port[0]=2489<br \/>\n<\/code><br \/>\nIndeed.<br \/>\nThat docbase can also be reached by the container&#8217;s IP address and internal port 1489:<br \/>\n<code><br \/>\n$ docker exec -it container01 ifconfig eth0 | head -3<br \/>\neth0: flags=4163  mtu 1500<br \/>\n        <strong>inet 192.168.33.101<\/strong>  netmask 255.255.255.0  broadcast 192.168.33.255<br \/>\n        ether 02:42:c0:a8:21:65  txqueuelen 0  (Ethernet)<br \/>\n&nbsp;<br \/>\n$ .\/widql <strong>dmtest01@192.168.33.101:1489<\/strong> -Udmadmin -Pdmadmin &lt;&lt;eoq<br \/>\nselect title from dm_docbase_config<br \/>\ngo<br \/>\neoq<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest01<br \/>\n[DM_SESSION_I_SESSION_START]info:  &quot;Session 0100c350800011b5 started for user dmadmin.&quot;<br \/>\n...<br \/>\ntitle<br \/>\n------------------------------------------<br \/>\ndmtest01 created silently on container01<br \/>\n<\/code><br \/>\nIs the local dmtest docbase still reachable ?:<br \/>\n<code><br \/>\n$ idql dmtest -Udmadmin -Pdmadmin<br \/>\n...<br \/>\nCould not connect<br \/>\n[DM_DOCBROKER_E_NO_SERVERS_FOR_DOCBASE]error:  \"The DocBroker running on host (docker:2489) does not know of a server for the specified docbase (dmtest)\"<br \/>\n<\/code><br \/>\nNot with that changed dfc.properties file and the standard tools. But by using our nifty little tool:<br \/>\n<code><br \/>\n$ .\/widql <strong>dmtest@docker:1489<\/strong> -Udmadmin -Pdmadmin &lt;&lt;eoq<br \/>\nselect title from dm_docbase_config<br \/>\ngo<br \/>\neoq<br \/>\n...<br \/>\nConnected to OpenText Documentum Server running Release 16.4.0080.0129  Linux64.Oracle<br \/>\ntitle<br \/>\n----------------------<br \/>\ndmtest on host VM<br \/>\n<\/code><br \/>\nFine !<br \/>\nIs container011.dmtest01 reachable now ?<br \/>\n<code><br \/>\n$ .\/widql <strong>dmtest01<\/strong> -Udmadmin -Pdmadmin &lt;&lt;eoq<br \/>\nselect title from dm_docbase_config<br \/>\ngo<br \/>\neoq<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest01<br \/>\n...<br \/>\nConnected to OpenText Documentum Server running Release 16.4.0000.0248  Linux64.Oracle<br \/>\ntitle<br \/>\n-------------------------------------------<br \/>\ndmtest01 created silently on <strong>container01<\/strong><br \/>\n<\/code><br \/>\nThis is container01.dmtest01, not the one we want, i.e. the one on container011.<br \/>\nNote that .\/widql was called without the extended syntax so it invoked the standard idql directly.<br \/>\nLet try again:<br \/>\n<code><br \/>\n$ .\/widql <strong>dmtest01@docker:5489<\/strong> -Udmadmin -Pdmadmin &lt;&lt;eoq<br \/>\nselect title from dm_docbase_config<br \/>\ngo<br \/>\neoq<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest01<br \/>\n[DM_SESSION_I_SESSION_START]info:  &quot;Session 0100c3508000059e started for user dmadmin.&quot;<br \/>\n...<br \/>\ntitle<br \/>\n------------------------------------------<br \/>\ndmtest01 created silently on <strong>container011<\/strong><br \/>\n<\/code><br \/>\nHere we go, it works !<br \/>\nThe same using the container&#8217;s IP address and its docbroker&#8217;s internal port:<br \/>\n<code><br \/>\n$ docker exec -it container011 ifconfig eth0 | head -3<br \/>\neth0: flags=4163  mtu 1500<br \/>\n        <strong>inet 192.168.33.104<\/strong>  netmask 255.255.255.0  broadcast 192.168.33.255<br \/>\n        ether 02:42:c0:a8:21:68  txqueuelen 0  (Ethernet)<br \/>\n&nbsp;<br \/>\n$ .\/widql <strong>dmtest01@192.168.33.104:5489<\/strong> -Udmadmin -Pdmadmin &lt;&lt;eoq<br \/>\nselect title from dm_docbase_config<br \/>\ngo<br \/>\neoq<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest01<br \/>\n[DM_SESSION_I_SESSION_START]info:  &quot;Session 0100c35080000598 started for user dmadmin.&quot;<br \/>\n...<br \/>\ntitle<br \/>\n------------------------------------------<br \/>\ndmtest01 created silently on <strong>container011<\/strong><br \/>\n<\/code><br \/>\nTry now the same connection but with &ndash;&ndash;append and &ndash;&ndash;keep:<br \/>\n<code><br \/>\n$ .\/widql <strong>dmtest01@docker:5489<\/strong> -Udmadmin -Pdmadmin <strong>--append --keep<\/strong> &lt;&lt;eoq<br \/>\nselect title from dm_docbase_config<br \/>\ngo<br \/>\neoq<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest01<br \/>\n...<br \/>\nConnected to OpenText Documentum Server running Release 16.4.0000.0248  Linux64.Oracle<br \/>\ntitle<br \/>\n-------------------------------------------<br \/>\ndmtest01 created silently on container011<br \/>\n<\/code><br \/>\nWhat is the content of dfc.properties now ?<br \/>\n<code><br \/>\n$ grep docbroker \/app\/dctm\/config\/dfc.properties<br \/>\ndfc.docbroker.host[0]=docker<br \/>\ndfc.docbroker.port[0]=2489<br \/>\ndfc.docbroker.host[1]=docker<br \/>\ndfc.docbroker.port[1]=5489<br \/>\n<\/code><br \/>\nBoth options have been taken into account as expected.<br \/>\nLet&#8217;s try to reach the VM host&#8217;s repository:<br \/>\n<code><br \/>\n$ .\/widql <strong>dmtest<\/strong> -Udmadmin -Pdmadmin &lt;&lt;eoq<br \/>\nselect title from dm_docbase_config<br \/>\ngo<br \/>\neoq<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest<br \/>\nCould not connect<br \/>\n[DM_DOCBROKER_E_NO_SERVERS_FOR_DOCBASE]error:  &quot;The DocBroker running on host (docker:2489) does not know of a server for the specified docbase (dmtest)&quot;<br \/>\n<\/code><br \/>\nSpecify the docbroker&#8217;s host and the &ndash;&ndash;verbose option:<br \/>\n<code><br \/>\n$ .\/widql <strong>dmtest@docker<\/strong> -Udmadmin -Pdmadmin --verbose &lt;&lt;eoq<br \/>\nselect title from dm_docbase_config<br \/>\ngo<br \/>\neoq<br \/>\n&nbsp;<br \/>\nchanging to docker:...<br \/>\nrequested changes:<br \/>\n# removed: dfc.docbroker.host[0]=docker<br \/>\n# removed: dfc.docbroker.port[0]=2489<br \/>\n# removed: dfc.docbroker.host[1]=docker<br \/>\n# removed: dfc.docbroker.port[1]=5489<br \/>\n# added: dfc.docbroker.host[0]=docker<br \/>\n# added: dfc.docbroker.port[0]=2489<br \/>\ndiffs:<br \/>\n12,13d11<br \/>\n&lt; dfc.docbroker.host[1]=docker<br \/>\n&lt; dfc.docbroker.port[1]=5489<br \/>\ncalling original: \/app\/dctm\/product\/16.4\/bin\/idql dmtest -Udmadmin -Pdmadmin<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest<br \/>\nCould not connect<br \/>\n[DM_DOCBROKER_E_NO_SERVERS_FOR_DOCBASE]error:  &quot;The DocBroker running on host (docker:2489) does not know of a server for the specified docbase (dmtest)&quot;<br \/>\n<\/code><br \/>\nSince the port was not specified, the wrapper took the first port found in the dfc.properties to supply the missing value, i.e. 2489 which is incorrect as dmtest@docker only projects to port docker:1489.<br \/>\nUse an unambiguous command now:<br \/>\n<code><br \/>\n$ .\/widql <strong>dmtest@docker:1489<\/strong> -Udmadmin -Pdmadmin &ndash;&ndash;verbose &lt;&lt;eoq<br \/>\nselect title from dm_docbase_config<br \/>\ngo<br \/>\neoq<br \/>\n&nbsp;<br \/>\nchanging to docker:1489...<br \/>\nrequested changes:<br \/>\n# removed: dfc.docbroker.host[0]=docker<br \/>\n# removed: dfc.docbroker.port[0]=2489<br \/>\n# removed: dfc.docbroker.host[1]=docker<br \/>\n# removed: dfc.docbroker.port[1]=5489<br \/>\n# added: dfc.docbroker.host[0]=docker<br \/>\n# added: dfc.docbroker.port[0]=1489<br \/>\ndiffs:<br \/>\n11,13c11<br \/>\n&lt; dfc.docbroker.port[0]=2489<br \/>\n&lt; dfc.docbroker.host[1]=docker<br \/>\n dfc.docbroker.port[0]=1489<br \/>\ncalling original: \/app\/dctm\/product\/16.4\/bin\/idql dmtest -Udmadmin -Pdmadmin<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest<br \/>\n...<br \/>\nConnected to OpenText Documentum Server running Release 16.4.0080.0129  Linux64.Oracle<br \/>\ntitle<br \/>\n--------------------<br \/>\ndmtest on host VM<br \/>\n<\/code><br \/>\nLooks OK.<br \/>\nLet&#8217;s try wdmawk now. But first, here is the test code twdmawk.awk:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [3]\">\n$ cat twdmawk.awk \nBEGIN {\n   print \"repo_target=\" repo_target, \"docbase=\" docbase\n   session = dmAPIGet(\"connect,\" docbase \",dmadmin,dmadmin\")\n   print dmAPIGet(\"getmessage,\" session)\n   dmAPIGet(\"retrieve,\" session \",dm_docbase_config\")\n   print dmAPIGet(\"get,\" session \",l,title\")\n   dmAPIExec(\"disconnect,\" session)\n   exit(0)\n}\n<\/pre>\n<p>Line 3 displays the two variables automatically passed to dmawk by the wrapper, <strong>repo_target<\/strong> and <strong>docbase<\/strong>.<br \/>\nThe test script connects to the docbase which was silently passed as command-line parameter by wdmawk through the -v option after it extracted it from the given target parameter docbase[@host[:port]], as illustrated below with the &ndash;&ndash;verbose option.<br \/>\nLet&#8217;s see the invocation for the repository on the host VM:<br \/>\n<code><br \/>\n$ .\/wdmawk <strong>dmtest@docker:1489<\/strong> -f .\/twdmawk.awk --verbose<br \/>\nchanging to docker:1489...<br \/>\nrequested changes:<br \/>\n# removed: dfc.docbroker.host[0]=docker<br \/>\n# removed: dfc.docbroker.port[0]=2489<br \/>\n# removed: dfc.docbroker.host[1]=docker<br \/>\n# removed: dfc.docbroker.port[1]=5489<br \/>\n# added: dfc.docbroker.host[0]=docker<br \/>\n# added: dfc.docbroker.port[0]=1489<br \/>\ndiffs:<br \/>\n11,13c11<br \/>\n&lt; dfc.docbroker.port[0]=2489<br \/>\n&lt; dfc.docbroker.host[1]=docker<br \/>\n&ndash;&ndash;<br \/>\n&gt; dfc.docbroker.port[0]=1489<br \/>\ncalling original: \/app\/dctm\/product\/16.4\/bin\/dmawk -v docbase=dmtest -f .\/twdmawk.awk<br \/>\nrepo_target= docbase=dmtest<br \/>\n[DM_SESSION_I_SESSION_START]info:  \"Session 0100c3508000367b started for user dmadmin.\"<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\ndmtest on host VM<br \/>\n<\/code><br \/>\nLet&#8217;s acces the container01&#8217;s repository :<br \/>\n<code><br \/>\n$ .\/wdmawk <strong>dmtest01@docker:2489<\/strong> -f .\/twdmawk.awk<br \/>\n&nbsp;<br \/>\n[DM_SESSION_I_SESSION_START]info:  \"Session 0100c35080001202 started for user dmadmin.\"<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\ndmtest01 created silently on container01<br \/>\n<\/code><br \/>\nA small typo in the port number and &#8230;<br \/>\n<code><br \/>\ndmadmin@docker:~$ .\/wdmawk <strong>dmtest01@docker:3489<\/strong> -f .\/twdmawk.awk<br \/>\n&nbsp;<br \/>\n[DFC_DOCBROKER_REQUEST_FAILED] Request to Docbroker \"docker:3489\" failed<br \/>\n&nbsp;<br \/>\n[DM_SESSION_E_RPC_ERROR]error:  \"Server communication failure\"<br \/>\n&nbsp;<br \/>\njava.net.ConnectException: Connection refused (Connection refused)<br \/>\n<\/code><br \/>\nNote the stupid error message &#8220;&#8230; Connection refused &#8230;&#8221;, very misleading when investigating a problem. It&#8217;s just that there nobody listening on that port.<br \/>\nLet&#8217;s access the container011&#8217;s repository:<br \/>\n<code><br \/>\ndmadmin@docker:~$ .\/wdmawk <strong>dmtest01@docker:5489<\/strong> -f .\/twdmawk.awk<br \/>\n&nbsp;<br \/>\n[DM_SESSION_I_SESSION_START]info:  \"Session 0100c350800005ef started for user dmadmin.\"<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\ndmtest01 created silently on container011<br \/>\n<\/code><br \/>\nEffect of the -v option:<br \/>\n<code><br \/>\ndmadmin@docker:~$ .\/wdmawk -v <strong>dmtest01@docker:5489<\/strong> -f .\/twdmawk.awk --verbose<br \/>\n...<br \/>\ncalling original: \/app\/dctm\/product\/16.4\/bin\/dmawk -v repo_target=dmtest@docker:1489 -v docbase=dmtest -f .\/twdmawk.awk<br \/>\nrepo_target=dmtest@docker:1489 docbase=dmtest<br \/>\n[DM_SESSION_I_SESSION_START]info:  \"Session 0100c35080003684 started for user dmadmin.\"<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\ndmtest on host VM<br \/>\n<\/code><br \/>\nA repo_target parameter with the extended syntax has been passed to dmawk.<br \/>\nLet&#8217;s now quickly check the wrapper from within the containers.<br \/>\n<strong>Container01<\/strong><br \/>\nThe host&#8217;s docbase:<br \/>\n<code><br \/>\n[dmadmin@container01 scripts]$ .\/wiapi <strong>dmtest@docker:1489<\/strong> -Udmadmin -Pdmadmin&lt;&lt;eoq<br \/>\nretrieve,c,dm_docbase_config<br \/>\nget,c,l,title<br \/>\neoq<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest<br \/>\n...<br \/>\ndmtest on host VM<br \/>\n<\/code><br \/>\nThe container011&#8217;s docbase:<br \/>\n<code><br \/>\n[dmadmin@container01 scripts]$ .\/wiapi <strong>dmtest01@container011:1489<\/strong> -Udmadmin -Pdmadmin&lt;&lt;eoq<br \/>\nretrieve,c,dm_docbase_config<br \/>\nget,c,l,title<br \/>\neoq<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest01<br \/>\n...<br \/>\ndmtest01 created silently on container011<br \/>\n...<br \/>\n<\/code><br \/>\n<strong>Container011<\/strong><br \/>\nThe host&#8217;s docbase:<br \/>\n<code><br \/>\ndmadmin@container011 scripts]$ .\/wiapi <strong>dmtest@docker:1489<\/strong> -Udmadmin -Pdmadmin&lt;&lt;eoq<br \/>\nretrieve,c,dm_docbase_config<br \/>\nget,c,l,title<br \/>\neoq<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest<br \/>\n...<br \/>\nConnected to OpenText Documentum Server running Release 16.4.0080.0129  Linux64.Oracle<br \/>\n...<br \/>\ndmtest on host VM<br \/>\n...<br \/>\n<\/code><br \/>\nThe docbase on container01:<br \/>\n<code><br \/>\ndmadmin@container011 scripts]$ .\/wiapi <strong>dmtest01@container01:1489<\/strong> -Udmadmin -Pdmadmin&lt;&lt;eoq<br \/>\nretrieve,c,dm_docbase_config<br \/>\nget,c,l,title<br \/>\neoq<br \/>\n...<br \/>\n...<br \/>\nConnecting to Server using docbase dmtest01<br \/>\n...<br \/>\ndmtest01 created silently on container01<br \/>\n...<br \/>\n<\/code><br \/>\nLet&#8217;s briefly test the usage of the sourced configuration file. Here is a snippet of the file shown earlier in this article:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [9,10]\">\n# repository connection configuration file;\n# must be sourced prior so the environment variables can be resolved;\n# this is a enhancement over the dfc.properties file syntax used by the dctm_wrapper utility:\n# docbroker.host[i]=...\n# docbroker.port[i]=...\n# it supports several syntaxes:\n# docbroker only definition [[docbroker_host]:[port]];\n#    usage: .\/widql dmtest@$dmtest\n# full definition docbase[@[docbroker_host]:[port]]\n#    usage: .\/widql $test\n# alternate ':' separator docbase:[[docbroker_host]:[docroker_port]];\n#    usage: .\/widql $dmtestVM\n# alias literal;\n#    usage: .\/widql test\n# in order to resolve alias literals, the wrapper will source the configuration file by itself;\n...\n# container011.dmtest01;\n# docbroker only definition docbroker_host:port;\nd_dmtest011=container011:5489\ndi_dmtest011=192.168.33.104:1489\n# full definition;\nf_dmtest011=dmtest01@container011:2489\nfip_dmtest011=dmtest01@192.168.33.104:1489\n<\/pre>\n<p>With a good name convention, the variables can be easily remembered which saves a lot of typing too.<br \/>\nNote on lines 9 and 10 how the whole extended target name can be specified, including the repository name.<br \/>\nA few tests:<br \/>\n<code><br \/>\ndmadmin@docker:~$ .\/widql <strong>dmtest01@$d_dmtest011<\/strong> -Udmadmin -Pdmadmin --verbose<br \/>\ncurrent_cmd=[.\/widql dmtest01@container011:5489 -Udmadmin -Pdmadmin --verbose]<br \/>\n...<br \/>\n&nbsp;<br \/>\ndmadmin@docker:~$ .\/widql <strong>dmtest01@$dip_dmtest011<\/strong> -Udmadmin -Pdmadmin --verbose<br \/>\ncurrent_cmd=[.\/widql dmtest01@192.168.33.104:1489 -Udmadmin -Pdmadmin --verbose]<br \/>\n...<br \/>\n&nbsp;<br \/>\ndmadmin@docker:~$ .\/widql <strong>$f_dmtest011<\/strong> -Udmadmin -Pdmadmin --verbose<br \/>\ncurrent_cmd=[.\/widql dmtest01@container011:2489 -Udmadmin -Pdmadmin --verbose]<br \/>\n...<br \/>\n&nbsp;<br \/>\ndmadmin@docker:~$ .\/widql <strong>$fip_dmtest011<\/strong> -Udmadmin -Pdmadmin --verbose<br \/>\ncurrent_cmd=[.\/widql dmtest01@192.168.33.104:1489 -Udmadmin -Pdmadmin --verbose]<br \/>\n...<br \/>\n<\/code><br \/>\nThe variables have been expanded by the shell prior to entering the wrapper, no programming effort was needed here, which is always appreciated.<\/p>\n<h2>Possible Enhancements<\/h2>\n<p>As shown precedently, the alternate configuration file lists aliases for the couples docbroker:port and even repository@docbroker:port. In passing, the wrapper also supports the version repository:docbroker:port.<br \/>\nNow, in order to better match Documentum syntax, is it possible to be even more transparent by removing dollar signs, colons and at-signs while still accessing the extended syntax ? E.g.:<br \/>\n<code><br \/>\n$ .\/widql <strong>dmtest<\/strong> -Udmadmin ....<br \/>\n<\/code><br \/>\nYes it is. The trick here is to first look up the alias in the configuration file, which incidentally becomes mandatory now, and re-execute the program with the alias resolved. As we are all lazy coders, we will not explicitly code the looking up but instead rely on the shell: the wrapper will source the file, resolve the target and re-<strong>exec<\/strong>ute itself.<br \/>\nIf the alias has not been defined in the file, then the wrapper considers it as the name of a repository and falls back to the usual command-line tools.<br \/>\nA good thing is that no new format has to be introduced in the file as the target is still the name of an environment variable.<br \/>\nSince the changes are really minimal, let&#8217;s do it. Hereafter, the diff output showing the changes from the listing in part I:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: [6,13,18]\">\n71c71,74\n&lt;  \n---\n&gt; \n&gt; # this variable points to the target repositories alias file and defaults to repository_connections.aliases;\n&gt; REPO_ALIAS=${REPO_ALIAS:-~\/repository_connections.aliases}\n&gt; \n121a125\n&gt; [[ bVerbose -eq 1 ]] &amp;&amp; echo \"current configuration file=[$REPO_ALIAS]\"\n253a258,265\n&gt; else\n&gt;    [[ -f $REPO_ALIAS ]] &amp;&amp; . $REPO_ALIAS\n&gt;    definition=${!1}\n&gt;    [[ $bVerbose -eq 1 ]] &amp;&amp; echo \"alias lookup in $REPO_ALIAS: $1 = $definition\"\n&gt;    if [[ ! -z $definition ]]; then\n&gt;       new_cmd=${current_cmd\/$1\/$definition}\n&gt;       [[ $bVerbose -eq 1 ]] &amp;&amp; echo \"invoking $new_cmd\"\n&gt;       exec $new_cmd\n<\/pre>\n<p>On line 6, the target configuration file pointed to by the REPO_ALIAS environment variable gets sourced if existing. $REPO_ALIAS defaults to repository_connections.aliases but can be changed before calling the wrapper.<br \/>\nNote on line 13 how bash can dereference a variable 1 containing the name of another variable 2 to get variable 2&#8217;s value (indirect expansion), nice touch.<br \/>\nOn line 18, the script execs itself with the resolved repository target.<br \/>\nTo apply the patch in-place, save the diffs above in diff-file and run the following command:<br \/>\n<code><br \/>\npatch old-file &lt; diff-file<br \/>\n<\/code><br \/>\n<strong>Testing<\/strong><br \/>\nFor conciseness, the tests below only show how the target is resolved. The actual connection has already been tested abundantly earlier.<br \/>\n<code><br \/>\n<strong>dmadmin@docker:~$ .\/widql f_dmtest -Udmadmin -Pdmadmin --verbose<\/strong><br \/>\ncurrent_cmd=[.\/widql f_dmtest -Udmadmin -Pdmadmin --verbose]<br \/>\nalias lookup in \/home\/dmadmin\/repository_connections.aliases: f_dmtest = dmtest@docker:1489<br \/>\ninvoking .\/widql dmtest@docker:1489 -Udmadmin -Pdmadmin --verbose<br \/>\ncurrent_cmd=[\/home\/dmadmin\/widql dmtest@docker:1489 -Udmadmin -Pdmadmin --verbose]<br \/>\n...<br \/>\n<strong>dmadmin@docker:~$ .\/widql fip_dmtest01 -Udmadmin -Pdmadmin --verbose<\/strong><br \/>\ncurrent_cmd=[.\/widql fip_dmtest01 -Udmadmin -Pdmadmin --verbose]<br \/>\nalias lookup in \/home\/dmadmin\/repository_connections.aliases: fip_dmtest01 = dmtest01@192.168.33.2:1489<br \/>\ninvoking .\/widql dmtest01@192.168.33.2:1489 -Udmadmin -Pdmadmin --verbose<br \/>\ncurrent_cmd=[\/home\/dmadmin\/widql dmtest01@192.168.33.2:1489 -Udmadmin -Pdmadmin --verbose]<br \/>\n...<br \/>\n<strong>dmadmin@docker:~$ .\/widql fip_dmtest011 -Udmadmin -Pdmadmin --verbose<\/strong><br \/>\ncurrent_cmd=[.\/widql fip_dmtest011 -Udmadmin -Pdmadmin --verbose]<br \/>\nalias lookup in \/home\/dmadmin\/repository_connections.aliases: fip_dmtest011 = dmtest01@192.168.33.3:1489<br \/>\ninvoking .\/widql dmtest01@192.168.33.3:1489 -Udmadmin -Pdmadmin --verbose<br \/>\ncurrent_cmd=[\/home\/dmadmin\/widql dmtest01@192.168.33.3:1489 -Udmadmin -Pdmadmin --verbose]<br \/>\n<\/code><br \/>\nNote how the targets are cleaner now, no curly little fancy shell characters in front.<\/p>\n<h2>Conclusion<\/h2>\n<p>As I was testing this little utility, I was surprised to realize how confortable and natural its usage is. It feels actually better to add the docbroker&#8217;s host and port than to stop at the docbase name, probably because it makes the intented repository absolutely unambiguous. The good thing is that is almost invisible, except for its invocation but even this can be smoothed out by using command aliases or renaming the symlinks.<br \/>\nWhen one has to work with identically named docbases or with clones existing in different environments, dctm-wrapper brings a real relief. And it was quick and easy to put together too.<br \/>\nAs it modifies an essential configuration file, it is mainly aimed at developers or administrators on their machine, but then those constitute the targeted audience anyway.<br \/>\nAs always, if you have any ideas for some utility that could benefit us all, please do no hesitate to suggest them in the comment section. Feedback is welcome too of course.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is part II of the 2-part article. See for part I of this article. Testing We will test on the host machine named docker that hosts 2 containers, container01 and container011. All 3 machines run a repository. Its name is respectively dmtest on docker (shortly, dmtest@docker:1489), dmtest01@container01:1489 (dmtest01@container01:2489 externally) and dmtest01@container011:1489 (dmtest01@container011:5489 externally). Incidentally, [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[525],"tags":[],"type_dbi":[],"class_list":["post-12500","post","type-post","status-publish","format-standard","hentry","category-enterprise-content-management"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Connecting to a Repository via a Dynamically Edited dfc.properties File (part II) - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Connecting to a Repository via a Dynamically Edited dfc.properties File (part II)\" \/>\n<meta property=\"og:description\" content=\"This is part II of the 2-part article. See for part I of this article. Testing We will test on the host machine named docker that hosts 2 containers, container01 and container011. All 3 machines run a repository. Its name is respectively dmtest on docker (shortly, dmtest@docker:1489), dmtest01@container01:1489 (dmtest01@container01:2489 externally) and dmtest01@container011:1489 (dmtest01@container011:5489 externally). Incidentally, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-16T16:37:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-24T07:32:13+00:00\" \/>\n<meta name=\"author\" content=\"Middleware Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Middleware Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/\"},\"author\":{\"name\":\"Middleware Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\"},\"headline\":\"Connecting to a Repository via a Dynamically Edited dfc.properties File (part II)\",\"datePublished\":\"2019-06-16T16:37:32+00:00\",\"dateModified\":\"2025-10-24T07:32:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/\"},\"wordCount\":1121,\"commentCount\":0,\"articleSection\":[\"Enterprise content management\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/\",\"name\":\"Connecting to a Repository via a Dynamically Edited dfc.properties File (part II) - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2019-06-16T16:37:32+00:00\",\"dateModified\":\"2025-10-24T07:32:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Connecting to a Repository via a Dynamically Edited dfc.properties File (part II)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\",\"name\":\"Middleware Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"caption\":\"Middleware Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Connecting to a Repository via a Dynamically Edited dfc.properties File (part II) - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/","og_locale":"en_US","og_type":"article","og_title":"Connecting to a Repository via a Dynamically Edited dfc.properties File (part II)","og_description":"This is part II of the 2-part article. See for part I of this article. Testing We will test on the host machine named docker that hosts 2 containers, container01 and container011. All 3 machines run a repository. Its name is respectively dmtest on docker (shortly, dmtest@docker:1489), dmtest01@container01:1489 (dmtest01@container01:2489 externally) and dmtest01@container011:1489 (dmtest01@container011:5489 externally). Incidentally, [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/","og_site_name":"dbi Blog","article_published_time":"2019-06-16T16:37:32+00:00","article_modified_time":"2025-10-24T07:32:13+00:00","author":"Middleware Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Middleware Team","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/"},"author":{"name":"Middleware Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"headline":"Connecting to a Repository via a Dynamically Edited dfc.properties File (part II)","datePublished":"2019-06-16T16:37:32+00:00","dateModified":"2025-10-24T07:32:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/"},"wordCount":1121,"commentCount":0,"articleSection":["Enterprise content management"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/","url":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/","name":"Connecting to a Repository via a Dynamically Edited dfc.properties File (part II) - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2019-06-16T16:37:32+00:00","dateModified":"2025-10-24T07:32:13+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/connecting-to-a-repository-via-a-dynamically-edited-dfc-properties-file-part-ii\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Connecting to a Repository via a Dynamically Edited dfc.properties File (part II)"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1","name":"Middleware Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","caption":"Middleware Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=12500"}],"version-history":[{"count":1,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12500\/revisions"}],"predecessor-version":[{"id":41184,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12500\/revisions\/41184"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=12500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=12500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=12500"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=12500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}