Multiple Cloverleaf Client Icons

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Multiple Cloverleaf Client Icons

  • Creator
    Topic
  • #51019
    Tim Jipson
    Participant

      It realy drives me crazy to constantly switch between our prod and test servers in the Cloverleaf GUI,

      and several times I’ve started making a change in the test system only to realize that I wasn’t in the test system.

      The procedure below describes who I’m able to automatically switch between multiple Host/Site combos just by clicking on a

      different icon. This has helped me out a lot but, of course, use it at your own risk.

      Locate C:quovadxqdx5.6integratorclient

      Make a directory called: USER

      Copy client.ini ro the new USER directory

      Go to the USER directory

      Create ChangeEviron.cmd

      Code:


      @ECHO OFF
      IF “%1″==”HOST1-SITE1.ini” GOTO ChangeFile
      IF “%1″==”HOST2-SITE1.ini” GOTO ChangeFile
      ECHO “%1” is not a valid argument!
      pause
      exit
      :ChangeFile
      COPY C:quovadxqdx5.6integratorclientUSER%1 C:quovadxqdx5.6integratorclientclient.ini
      START C:quovadxqdx5.6integratorclguibinhciaccess.exe
      exit

      Edit the lines “last_host” and “last_environ” in CLIENT.INI to the host and site you wish to connect to

      and save with a name similar to HOST1-SITE1.ini or HOST2-SITE2.ini. These names must match the ChangeEnviron.cmd IF statments or you will get an error.

      Next create desktop shortcuts pointed to:

      C:quovadxqdx5.6integratorclientUSERChangeEviron.cmd HOST1_SITE1.ini

      C:quovadxqdx5.6integratorclientUSERChangeEviron.cmd HOST2_SITE1.ini

      Now you’ll be able to switch between the several Host/Site combos by clinking on an icon.

      The best part is HOST1 and HOST2(Prod and Test) can have different colored icons.

    Viewing 1 reply thread
    • Author
      Replies
      • #68469
        Steve Williams
        Participant

          I’ve updated the code slightly to make it a bit more portable from version to version of Cloverleaf.

          Code:


          @ECHO OFF
          IF “%1″==”HOST1-SITE1.ini” GOTO ChangeFile
          IF “%1″==”HOST2-SITE2.ini” GOTO ChangeFile
          ECHO “%1” is not a valid argument!
          pause
          exit
          :ChangeFile
          COPY %CL_INSTALL_DIR%integratorclientUSER%1 %CL_INSTALL_DIR%integratorclientclient.ini
          START %CL_INSTALL_DIR%integratorclguibinhciaccess.exe
          exit

          Note the use of the environmnet variable CL_INSTALL_DIR. You may have to manually add this to your Windows workstation environment if it does not already exist. Some versions of the Cloverleaf Client installer fail to add the environ var to the user account.

        • #68470
          Steve Carter
          Participant

            Here’s a piece of code that I threw together to quickly access a site on any server.  It requires that Tcl be loaded on your local machine and a batch file to execute the script.  This allows me to quickly launch the GUi into any site on any server (including sites not listed in the server.ini).

            The short explanation is that it reads your client.ini to get a list of previously accessed hosts.  You select a host and then it gets a list of sites from the server.ini on said server.  Select a site by number or name and it then edits your client.ini and launches the GUI.

            Let me know if there are any questions.  Feel free to use at your own risk.

            Steve

            Code:

            #! C:/Tcl/bin/tclsh85
            package require ftp

            set FH [open C:/quovadx/qdx5.7/integrator/client/client.ini r]
            set data [read $FH]
            close $FH
            set data [split $data n]
            set index [lsearch $data “hosts=*”]
            set hostList [lindex $data $index]
            set hostList [lindex [split $hostList =] 1]
            set hostList [split $hostList ,]

            set hostItem “”
            while { $hostItem == “” } {
             puts “ttSelect Host Servern”
             set cnt 0
             foreach host $hostList {
               incr cnt
               set hostArray($cnt) $host
               puts “tt$cnt)  $hostn”
             }
             puts -nonewline “tChoose host number or type in hostname:  ”
             flush stdout
             gets stdin hostItem
             if { ($hostItem == “”) || ($hostItem > $cnt) } {
              set hostItem “”
               continue
             }
             if { [string length $hostItem] == “1” } {
               set host $hostArray($hostItem)
             } else {
               set host $hostItem
             }
            }

            set user “username”
            set passwd “password”
            set remoteDir “/quovadx/qdx5.7/integrator/server”

            set FTP [ftp::Open $host $user $passwd]
            ftp::Cd $FTP $remoteDir
            ftp::Get $FTP server.ini -variable serverData

            ftp::Close $FTP

            set serverData [split $serverData n]
            set index [lsearch $serverData “environs=*”]

            set line [lindex $serverData $index]
            set siteList [lindex [split $line =] 1]
            set siteList [split $siteList “;”]
            set siteList [lsort $siteList]
            set masterSiteList “”
            foreach site $siteList {
            if { $site == “” } {
            continue
            }
            set site [file tail $site]
            lappend masterSiteList $site
            }

            set siteItem “”
            while { $siteItem == “” } {
            puts “ttSelect Siten”
            set cnt 0
            foreach site $masterSiteList {
            incr cnt
            set siteArray($cnt) $site
            puts “tt$cnt)  $siten”
            }
            puts -nonewline “tChoose site number or type in site name:  ”
            flush stdout
            gets stdin siteItem
            # Comment out the ‘if’ and close brace if you want to access a site that’s
            # not in the server.ini file
            #if { [lsearch -exact $masterSiteList $siteItem] != “-1” } {
            set site $siteItem
            break
            #}
            if { ![string is digit $siteItem] } {
            puts “string is not a digit”
            set siteItem “”
            continue
            }
            if { ($siteItem == “”) || ($siteItem > $cnt) } {
            set siteItem “”
            continue
            } else {
            set site $siteArray($siteItem)
            }
            }

            set index [lsearch $data “last_host=*”]
            set newLine “last_host=$host”
            set data [lreplace $data $index $index $newLine]

            set index [lsearch $data “last_environ=*”]
            set newLine “last_environ=/quovadx/qdx5.7/integrator/$site”
            set data [lreplace $data $index $index $newLine]
            set data [join $data n]

            set FH [open C:/quovadx/qdx5.7/integrator/client/client.ini w]
            puts $FH $data
            close $FH

            exec c:/quovadx/qdx5.7/integrator/clgui/bin/hciaccess.exe &
            exit

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.