Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2013-06-11T06:43:57Z by tmparker
george.baker
george.baker
314 Posts
ACCEPTED ANSWER

Pinned topic Parsing Global variable overrides after initial connection

‏2013-06-10T22:53:45Z |

I have a requirement to accept global variable overrides, which I can do and it works when I initially launch the applications.   I have several questions:

  1. If I add a set GV statement in the Start event it seems to override the URL override.  Example:  I have a GV, X defined and in the Start event I set X=0, but when I invoke the application I specify ?hatsgv_X=1.  It appears that when I use the GV the value is 0 and not what I expected, 1. If this correct or must I have an error somewhere else?
  2. I also have a requirement to accept an override after the application is running.  For example, I would initially invoke the application with ?hatsgv_X=1 and after processing a few screens I need to change the value of the GV by specifying a new value, e.g. ?hatsgv_X=2.  This does not seem to work.  Is this supported?  If so is there a special syntax required?
  3. If the standard overrides mentioned above are not supported by HATS I will need to write some BL or Javascript to parse my own URL, but I need some help understanding which to use and where.  I've previously used Javascript in the index.jsp to do this, but my understanding is that it is only executed when initializing the servlet for the first time and not every time it is referenced.  Ideally the url would look like this:  http://server/app?UUI=xxxxxxx.  I would extract the value of UUI and set the GVs manually.  However, I am not sure of where to insert the code so that it is executed every time a request is processed.

This is a critical part of our project so a quick response is requested.

  • george.baker
    george.baker
    314 Posts
    ACCEPTED ANSWER

    Re: Parsing Global variable overrides after initial connection

    ‏2013-06-10T22:59:57Z  in response to george.baker

    I changed my testing technique and found that specifying the ?hatsgv_X=2 in the URL is processed on every submission, so that resolves most of my issues.  I may be required to process the overrides manually because they are being forwarded to the browser by another application and will likely not adhere to the HATS convention of hatsgv_gv.  It will in fact be a string that I must parse into multiple variables.  So the question remains, in what event/page can I place my own logic to parse and set the global variables on every request?

    • tmparker
      tmparker
      518 Posts
      ACCEPTED ANSWER

      Re: Parsing Global variable overrides after initial connection

      ‏2013-06-11T06:43:57Z  in response to george.baker

      Hi George,

      If you need to process the query string for every request that is sent, and you aren't able to use the hatsgv_ syntax, then I think you would need to create a custom entry servlet to do this.  You could extend our entry servlet and add your own logic on top of that.  If you are using the hatsgv_ syntax, make sure you have the option to allow global variables to be overridden by client requests enabled in the project settings.

      Thanks

      Tim