"Life is very short to modify dmcl.ini manually"
Me.
Requirement:Launch DqMan for specific docbase environment without edit dmcl.ini file.
Solution:
I've noticed that I spend much time for editing dmcl.ini file and launch again the DqMan for switching between environments. So the old my friend "cmd" came to help the issue.
For that before launching DqMan I'm going to edit programatically dmc.ini and then start the dqman.exe.
How I've done that? Bellow is showed:
For that before launching DqMan I'm going to edit programatically dmc.ini and then start the dqman.exe.
How I've done that? Bellow is showed:
1) I've create a batch file "confdqman.bat" with te following lines code:
@echo off
SET ENV=%1
SET ENV_ADRESS=%2
SET CONF_FILE="C:\Program Files\dqMan\dmcl.ini"
SET CONF_FOOTER=.\footer.txt
SET CONF_HEADER=.\header.txt
SET DQMAN_PATH="C:\Program Files\dqMan\"
:start
rem If the dmc.ini does not exist go to nonexistconffile label
if not exist %CONF_FILE% goto nonexistconffile
rem Copy all content of header.txt to dmc.ini file, the > command means that file will be cleared before writing
findstr /x /r /c:.* %CONF_HEADER% > %CONF_FILE%
rem append a env comment ex: #DEV to dmc.ini
echo #%ENV% >> %CONF_FILE%
rem append the host name to dmc.ini
echo host = %ENV_ADRESS% >> %CONF_FILE%
rem append all content of footer.txt to dmc.ini file
findstr /x /r /c:.* %CONF_FOOTER% >> %CONF_FILE%
rem go to DqMan installed path
cd %DQMAN_PATH%
rem run DqMan
start "" dqman.exe
rem go to endproc label
goto endproc
:nonexistconffile
echo Non exist %CONF_FILE%
echo Make shure the file exist then press Enter
pause
goto start
:endproc
Here the ENV=%1 and ENV_ADRESS=%2 these variables are filled from called parameters respectivly %1 - first parameter and %2 - second parameter.
2) If you have noticed there are two adition files .\footer.txt and .\header.txt these files serve for generating the dmcl.ini content.
For my environements the content of these files are:
For my environements the content of these files are:
.\header.txt :
# Default DMCL.INI. Refer to DMCLFULL.INI for other options
# Assuming No Network File System
# Assuming No Compression for Content Tunneling
[DOCBROKER_PRIMARY]
.\footer.txt :
[DMAPI_CONFIGURATION]
cache_queries = T
token_storage_enabled=F
token_storage_path=d:\ Documentum\apptoken
client_codepage=UTF-8
client_os_codepage=UTF-8
max_session_count=1000
connect_pooling_enabled=T
3) Then for each environment I've create addition batch file that call "confdqman.bat" with predefined parameters.
For example for DEV environment I've create in the same folder "dev-dqman.bat" batch file with these lines:
@echo off
rem %1=DEV , %2=192.168.10.12
call %0\..\confdqman.bat DEV 192.168.10.12
That's all, now, the moment of truth!!!
After double click on dev-dqman.bat file DqMan has been launched and "Voila" it suggest to connect to DEV docbase.
Now, if I open C:\Program Files\dqMan\dmcl.ini config file I can see the configuration:
# Default DMCL.INI. Refer to DMCLFULL.INI for other options
# Assuming No Network File System
# Assuming No Compression for Content Tunneling
[DOCBROKER_PRIMARY]
#DEV
host = 192.168.10.12
[DMAPI_CONFIGURATION]
cache_queries = T
token_storage_enabled=F
token_storage_path=d:\ Documentum\apptoken
client_codepage=UTF-8
client_os_codepage=UTF-8
max_session_count=1000
After configuring all environments all batch files are:
After creating shortcuts on Desktop and change the icons :))
Nice, isn't it?
Great stuff, thanks...
ReplyDelete