OFBiz
  1. OFBiz
  2. OFBIZ-2243

In hyperlink and sub-hyperlink elements, replacement of target parameters by parameter sub-elements

    Details

      Description

      This issue is intended to replace, in all hyperlink and sub-hyperlink elements used in forms, screens and menus widgets, target parameters by
      parameter sub-elements using Eclipse regexp S/R

        Issue Links

          Activity

          Hide
          Jacques Le Roux added a comment -

          There are 1100+ hyperlink tags used in OFBiz, 700+ are using parameters. So it's not reasonnable to do it all by hand.

          Here is a method I used for creating a 1st patch. It's not perfect yet as it still needs some hand editing, but far less than if we had all to do by hand

          This 1st patch was created using regexp replacement in Eclipse. The regexps used are

          Search : <hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)"/>
          Replacement : <hyperlink$1 target=$2" link-type="hidden-form">\R\t\t\t\t<parameter param-name="$3"/>\R\t\t\t\t<parameter param-name="$5"/>\R\t\t\t\t<parameter param-name="$7"/>\R\t\t\t\t<parameter param-name="$9"/>\R\t\t\t\t<parameter param-name="$11"/>\R\t\t\t\t<parameter param-name="$13"/>\R\t\t\t\t<parameter param-name="$15"/>\R\t\t\t</hyperlink>
          

          Note that it can't be commited as is for 2 reaons .

          1. It generates tabs that should be replaced by 4 spaces before (done in this 1st patch).
          2. More annoying if there are other informations at the end of the hyperlink element, after the target attribute, they are lost. I added them by hand in the patch. I will try to get a better regexp but ran out of time for now

          So the idea would be to generate a patch for each iteration, removing one match at a time., and to replace tabs by 4 spaces in patches generated. For instance next replacement would be done using

          Search : <hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)"/>
          Replacement : <hyperlink$1 target=$2" link-type="hidden-form">\R\t\t\t\t<parameter param-name="$3"/>\R\t\t\t\t<parameter param-name="$5"/>\R\t\t\t\t<parameter param-name="$7"/>\R\t\t\t\t<parameter param-name="$9"/>\R\t\t\t\t<parameter param-name="$11"/>\R\t\t\t\t<parameter param-name="$13"/>\R\t\t\t</hyperlink>
          

          But before I think I will try to get a better retgexp if nobody beats me on it

          Show
          Jacques Le Roux added a comment - There are 1100+ hyperlink tags used in OFBiz, 700+ are using parameters. So it's not reasonnable to do it all by hand. Here is a method I used for creating a 1st patch. It's not perfect yet as it still needs some hand editing, but far less than if we had all to do by hand This 1st patch was created using regexp replacement in Eclipse. The regexps used are Search : <hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)"/> Replacement : <hyperlink$1 target=$2 " link-type=" hidden-form ">\R\t\t\t\t<parameter param-name=" $3 "/>\R\t\t\t\t<parameter param-name=" $5 "/>\R\t\t\t\t<parameter param-name=" $7 "/>\R\t\t\t\t<parameter param-name=" $9 "/>\R\t\t\t\t<parameter param-name=" $11 "/>\R\t\t\t\t<parameter param-name=" $13 "/>\R\t\t\t\t<parameter param-name=" $15"/>\R\t\t\t</hyperlink> Note that it can't be commited as is for 2 reaons . It generates tabs that should be replaced by 4 spaces before (done in this 1st patch). More annoying if there are other informations at the end of the hyperlink element, after the target attribute, they are lost. I added them by hand in the patch. I will try to get a better regexp but ran out of time for now So the idea would be to generate a patch for each iteration, removing one match at a time., and to replace tabs by 4 spaces in patches generated. For instance next replacement would be done using Search : <hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)"/> Replacement : <hyperlink$1 target=$2 " link-type=" hidden-form ">\R\t\t\t\t<parameter param-name=" $3 "/>\R\t\t\t\t<parameter param-name=" $5 "/>\R\t\t\t\t<parameter param-name=" $7 "/>\R\t\t\t\t<parameter param-name=" $9 "/>\R\t\t\t\t<parameter param-name=" $11 "/>\R\t\t\t\t<parameter param-name=" $13"/>\R\t\t\t</hyperlink> But before I think I will try to get a better retgexp if nobody beats me on it
          Hide
          Jacques Le Roux added a comment -

          Also 2 hyperlinks in this patch should maybe removed, not sure though :they are commented out without any comments why, no time for more details...

          Show
          Jacques Le Roux added a comment - Also 2 hyperlinks in this patch should maybe removed, not sure though :they are commented out without any comments why, no time for more details...
          Hide
          David E. Jones added a comment -

          As a follow-up to the mailing list comment by Bilgin and my reply: we don't have to change all hyperlink instances to use the hidden-form, only those that call a request that calls a service... or more generally requests that process incoming data and persist it, etc.

          However, it shouldn't hurt anything to replace all of them, not that I can think of anyway. If anyone sees an issue with this please speak up. I'm not sure I'm 100% for this approach, but it does resolve the issue and hopefully only introduces a minor side-effect (ie hyperlinks converted that don't need to be).

          Show
          David E. Jones added a comment - As a follow-up to the mailing list comment by Bilgin and my reply: we don't have to change all hyperlink instances to use the hidden-form, only those that call a request that calls a service... or more generally requests that process incoming data and persist it, etc. However, it shouldn't hurt anything to replace all of them, not that I can think of anyway. If anyone sees an issue with this please speak up. I'm not sure I'm 100% for this approach, but it does resolve the issue and hopefully only introduces a minor side-effect (ie hyperlinks converted that don't need to be).
          Hide
          Adrian Crum added a comment -

          It's too bad the widget rendering code can't look that up at run time and output the correct HTML.

          Show
          Adrian Crum added a comment - It's too bad the widget rendering code can't look that up at run time and output the correct HTML.
          Hide
          Adam Heath added a comment -

          Don't replace all links; POST data doesn't show up on access.log type files, while GET data does. It's nice to see GET data in hitreport programs.

          Show
          Adam Heath added a comment - Don't replace all links; POST data doesn't show up on access.log type files, while GET data does. It's nice to see GET data in hitreport programs.
          Hide
          David E. Jones added a comment -

          Yes, I agree Adam. One trend I've been randomly introducing here and there is the use of request-redirect in the controller.xml file... along with the redirect-parameter sub-element that we can use to specify which parameters should go into the URL.

          This way even when going to requests that call a service with encrypted form data we can do a redirect to the view via the browser instead of just internally on the server. The hit-logs are more interesting, and the user has a better experience with reloading pages, bookmarking, etc, etc.

          However, that does require some manual work.

          Show
          David E. Jones added a comment - Yes, I agree Adam. One trend I've been randomly introducing here and there is the use of request-redirect in the controller.xml file... along with the redirect-parameter sub-element that we can use to specify which parameters should go into the URL. This way even when going to requests that call a service with encrypted form data we can do a redirect to the view via the browser instead of just internally on the server. The hit-logs are more interesting, and the user has a better experience with reloading pages, bookmarking, etc, etc. However, that does require some manual work.
          Hide
          David E. Jones added a comment -

          Adrian: you're right that this could be smarter, and I thought about that when writing it (at least choosing the hidden-form versus anchor link-type)... but didn't really like the option of parsing the URL string for the parameters at run-time (it's too messy and potentially error prone, IMO).

          Maybe a good solution to this is to do the fancy search/replace that Jacques has introduced, but ONLY for the parameters (which is the harder and more laborious part) and not for the link-type attribute. That would be a nice cleanup anyway over having the parameters embedded in the URL.

          BTW, one caveat: it's not used very much, but in some cases the param-name does not match the from-field, which is what it assumes if there is no from-field or value. For example in the URL string we could have "productId=$

          {curProd.productId}

          ". If you could watch for that and just leave those out of the S/R that would be a good start for now.

          Could you do that Jacques?

          I'll add a new option to link-type, called "default" which will look at the request corresponding to the link target and choose anchor or hidden-form accordingly.

          Show
          David E. Jones added a comment - Adrian: you're right that this could be smarter, and I thought about that when writing it (at least choosing the hidden-form versus anchor link-type)... but didn't really like the option of parsing the URL string for the parameters at run-time (it's too messy and potentially error prone, IMO). Maybe a good solution to this is to do the fancy search/replace that Jacques has introduced, but ONLY for the parameters (which is the harder and more laborious part) and not for the link-type attribute. That would be a nice cleanup anyway over having the parameters embedded in the URL. BTW, one caveat: it's not used very much, but in some cases the param-name does not match the from-field, which is what it assumes if there is no from-field or value. For example in the URL string we could have "productId=$ {curProd.productId} ". If you could watch for that and just leave those out of the S/R that would be a good start for now. Could you do that Jacques? I'll add a new option to link-type, called "default" which will look at the request corresponding to the link target and choose anchor or hidden-form accordingly.
          Hide
          David E. Jones added a comment -

          Okay, done in SVN rev 755377.

          Show
          David E. Jones added a comment - Okay, done in SVN rev 755377.
          Hide
          Jacques Le Roux added a comment -

          I saw Bilgin comment on dev ML I think David changes in r755377 answer to Bilgin's and Adrian's concerns.

          Adam, I can see some POST data in access.log, for instance
          127.0.0.1 - - [05/Mar/2009:19:43:48 +0100] "POST /catalog/control/prepareAddContentToProduct HTTP/1.1" 200 29136 "https://localhost:18443/catalog/control/EditProductContent?productId=SV-1000" "Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6"
          So I'm not sure to understand your concern, could you elaborate please ?

          David, yes I thought about that too (paramName not the same as ParamValueName). That was one of the reasons, I preferred to share with community before doing a real mess (I have been already bitten when doing recent tags cleanup S/R )

          It's certainly possible, I will have a fresh look tomorrow morning...

          Show
          Jacques Le Roux added a comment - I saw Bilgin comment on dev ML I think David changes in r755377 answer to Bilgin's and Adrian's concerns. Adam, I can see some POST data in access.log, for instance 127.0.0.1 - - [05/Mar/2009:19:43:48 +0100] "POST /catalog/control/prepareAddContentToProduct HTTP/1.1" 200 29136 "https://localhost:18443/catalog/control/EditProductContent?productId=SV-1000" "Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6" So I'm not sure to understand your concern, could you elaborate please ? David, yes I thought about that too (paramName not the same as ParamValueName). That was one of the reasons, I preferred to share with community before doing a real mess (I have been already bitten when doing recent tags cleanup S/R ) It's certainly possible, I will have a fresh look tomorrow morning...
          Hide
          Jacques Le Roux added a comment -

          I removed the patch since something modifed was commited in r756025

          Show
          Jacques Le Roux added a comment - I removed the patch since something modifed was commited in r756025
          Hide
          Jacques Le Roux added a comment -

          Of course there were flaws, the expressions should be

          <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}(.*)/>
            1             2          3      4        5           6        7           8        9          10       11          12       13          14       15    16
          
          <$1hyperlink$2 target=$3"$16>\R\t\t\t\t<parameter param-name="$5"/>\R\t\t\t\t<parameter param-name="$7"/>\R\t\t\t\t<parameter param-name="$9"/>\R\t\t\t\t<parameter param-name="$11"/>\R\t\t\t\t<parameter param-name="$13"/>\R\t\t\t\t<parameter param-name="$15"/>\R\t\t\t</$1hyperlink>
          
          • { needs to be escaped
          • no space should be at end, before last match block in search exp. and before $16 in repl. exp. It will be included in $16 (in our case : 1st iteration, and not $17 as previously) if it exists.

          HTH

          Show
          Jacques Le Roux added a comment - Of course there were flaws, the expressions should be <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}(.*)/> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <$1hyperlink$2 target=$3 "$16>\R\t\t\t\t<parameter param-name=" $5 "/>\R\t\t\t\t<parameter param-name=" $7 "/>\R\t\t\t\t<parameter param-name=" $9 "/>\R\t\t\t\t<parameter param-name=" $11 "/>\R\t\t\t\t<parameter param-name=" $13 "/>\R\t\t\t\t<parameter param-name=" $15"/>\R\t\t\t</$1hyperlink> { needs to be escaped no space should be at end, before last match block in search exp. and before $16 in repl. exp. It will be included in $16 (in our case : 1st iteration, and not $17 as previously) if it exists. HTH
          Hide
          Jacques Le Roux added a comment -

          This is not enough, as explained in revision: 756119,

          • I will have to differentiate from-field (ie "$ {(.*)}") and value (ie "(.*)"). I think I will generalise "${(.*)}

            " and will check by hand...

          • Also there was a wrong " after $3 that should not have been there
          Show
          Jacques Le Roux added a comment - This is not enough, as explained in revision: 756119, I will have to differentiate from-field (ie "$ {(.*)}") and value (ie "(.*)"). I think I will generalise "${(.*)} " and will check by hand... Also there was a wrong " after $3 that should not have been there
          Hide
          Jacques Le Roux added a comment -

          No finally, to be secure, I will generate systematically (for all hyperlinks and sub-hyperlinks) param-name and from-field or value.
          And later I will remove the param-name and from-field duplicated. I guess it's the best strategy (at least for now ;o)

          Show
          Jacques Le Roux added a comment - No finally, to be secure, I will generate systematically (for all hyperlinks and sub-hyperlinks) param-name and from-field or value. And later I will remove the param-name and from-field duplicated. I guess it's the best strategy (at least for now ;o)
          Hide
          Jacques Le Roux added a comment -

          For those interested, here is how I finally did it.

          I had to to some things manually until 1 and 0 parameters, and even at this stage I had to check and modify by hand sometimes. This is because I did not want to create a program for taking into account "value parameters". And also because I wanted to check at it step before commiting, hard work...

          done 6 
          <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)"/>
          <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}(.*)/>
          <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)="(.*)"&amp;(.*)="(.*)"&amp;(.*)="(.*)"&amp;(.*)="(.*)"&amp;(.*)(.*)="(.*)"/>
          18
          
          done 5
          <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)/>
          <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"(.*)/>
          <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)="(.*)"&amp;(.*)="(.*)"&amp;(.*)="(.*)"&amp;(.*)="(.*)"/>
          16
          
          done 4
          global search   <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)/>
          1st pass        <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*)/>
                          <$1hyperlink$2 target=$3" $14>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t\t<parameter param-name="$8" from-field="$9"/>\R\t\t\t\t<parameter param-name="$10" from-field="$11"/>\R\t\t\t\t<parameter param-name="$12" from-field="$13"/>\R\t\t\t</$1hyperlink>
          2d pass         <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"(.*)/>
                          <$1hyperlink$2 target=$3"$14>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t\t<parameter param-name="$8" from-field="$9"/>\R\t\t\t\t<parameter param-name="$10" from-field="$11"/>\R\t\t\t\t<parameter param-name="$12" from-field="$13"/>\R\t\t\t</$1hyperlink>
          14
          
          done 3
          global search   <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)/>
          1st pass        <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*)/>
                          <$1hyperlink$2 target=$3" $12>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t\t<parameter param-name="$8" from-field="$9"/>\R\t\t\t\t<parameter param-name="$10" from-field="$11"/>\R\t\t\t</$1hyperlink>
          2d pass         <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"(.*)/>
                          <$1hyperlink$2 target=$3"$12>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t\t<parameter param-name="$8" from-field="$9"/>\R\t\t\t\t<parameter param-name="$10" from-field="$11"/>\R\t\t\t</$1hyperlink>
          12
          
          done 2
          global search   <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)/>
          1st pass        <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*) (.*) (.*)/>
                          <$1hyperlink$2 target=$3" $10 $11 $12>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t\t<parameter param-name="$8" from-field="$9"/>\R\t\t\t</$1hyperlink>                
          2d pass         <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*) (.*)/>
                          <$1hyperlink$2 target=$3" $10 $11>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t\t<parameter param-name="$8" from-field="$9"/>\R\t\t\t</$1hyperlink>                
          3d pass         <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*)/>
                          <$1hyperlink$2 target=$3" $10>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t\t<parameter param-name="$8" from-field="$9"/>\R\t\t\t</$1hyperlink>
          4th pass        <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"/>
                          <$1hyperlink$2 target=$3">\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t\t<parameter param-name="$8" from-field="$9"/>\R\t\t\t</$1hyperlink>
          10
          
          done 1
          global search   <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)/>
          1st pass        <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\} (.*) (.*) (.*)/>
                          <$1hyperlink$2 target=$3" $8 $9 $10>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t</$1hyperlink>
          2d pass         <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*) (.*)/>
                          <$1hyperlink$2 target=$3" $8 $9>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t</$1hyperlink>
          3d pass         <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*)/>
                          <$1hyperlink$2 target=$3" $8>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t</$1hyperlink>
          4th pass         <field(.*)<(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*)/></field>
                          <field$1\R\t\t\t<$2hyperlink$3 target=$4" $9>\R\t\t\t\t<parameter param-name="$5" from-field="$6"/>\R\t\t\t\t<parameter param-name="$7" from-field="$8"/>\R\t\t\t</$2hyperlink>\R\t\t\</field>
          5th pass        <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"/>
                          <$1hyperlink$2 target=$3">\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t\t<parameter param-name="$6" from-field="$7"/>\R\t\t\t</$1hyperlink>
          6th pass        <field(.*)<(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"/></field>
                          <field$1\R\t\t\t<$2hyperlink$3 target=$4">\R\t\t\t\t<parameter param-name="$5" from-field="$6"/>\R\t\t\t\t<parameter param-name="$7" from-field="$8"/>\R\t\t\t</$2hyperlink>\R\t\t\</field>
          8
          
          done 0
          global search   <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)/>
          1st pass        <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\} (.*) (.*) (.*)/>
                          <$1hyperlink$2 target=$3" $6 $7 $8>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t</$1hyperlink>
          2th pass        <field(.*)<(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}" (.*) (.*)/></field>
                          <field$1\R\t\t\t<$2hyperlink$3 target=$4" $7 $8>\R\t\t\t\t<parameter param-name="$5" from-field="$6"/>\R\t\t\t</$2hyperlink>\R\t\t\</field>
          3d pass         <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}" (.*) (.*)/>
                          <$1hyperlink$2 target=$3" $6 $7>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t</$1hyperlink>
          4th pass        <field(.*)<(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}" (.*)/></field>
                          <field$1\R\t\t\t<$2hyperlink$3 target=$4" $7>\R\t\t\t\t<parameter param-name="$5" from-field="$6"/>\R\t\t\t</$2hyperlink>\R\t\t\</field>
          5th pass        <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}" (.*)/>
                          <$1hyperlink$2 target=$3" $6>\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t</$1hyperlink>
          6th pass        <field(.*)<(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}"/></field>
                          <field$1\R\t\t\t<$2hyperlink$3 target=$4">\R\t\t\t\t<parameter param-name="$5" from-field="$6"/>\R\t\t\t</$2hyperlink>\R\t\t\</field>
          7th pass        <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}"/>
                          <$1hyperlink$2 target=$3">\R\t\t\t\t<parameter param-name="$4" from-field="$5"/>\R\t\t\t</$1hyperlink>
          6
          
          Show
          Jacques Le Roux added a comment - For those interested, here is how I finally did it. I had to to some things manually until 1 and 0 parameters, and even at this stage I had to check and modify by hand sometimes. This is because I did not want to create a program for taking into account "value parameters". And also because I wanted to check at it step before commiting, hard work... done 6 <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)"/> <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}(.*)/> <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)= "(.*)" &amp;(.*)= "(.*)" &amp;(.*)= "(.*)" &amp;(.*)= "(.*)" &amp;(.*)(.*)= "(.*)" /> 18 done 5 <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)/> <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"(.*)/> <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)= "(.*)" &amp;(.*)= "(.*)" &amp;(.*)= "(.*)" &amp;(.*)= "(.*)" /> 16 done 4 global search <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)/> 1st pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*)/> <$1hyperlink$2 target=$3 " $14>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7 "/>\R\t\t\t\t<parameter param-name=" $8 " from-field=" $9 "/>\R\t\t\t\t<parameter param-name=" $10 " from-field=" $11 "/>\R\t\t\t\t<parameter param-name=" $12 " from-field=" $13"/>\R\t\t\t</$1hyperlink> 2d pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"(.*)/> <$1hyperlink$2 target=$3 "$14>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7 "/>\R\t\t\t\t<parameter param-name=" $8 " from-field=" $9 "/>\R\t\t\t\t<parameter param-name=" $10 " from-field=" $11 "/>\R\t\t\t\t<parameter param-name=" $12 " from-field=" $13"/>\R\t\t\t</$1hyperlink> 14 done 3 global search <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)/> 1st pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*)/> <$1hyperlink$2 target=$3 " $12>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7 "/>\R\t\t\t\t<parameter param-name=" $8 " from-field=" $9 "/>\R\t\t\t\t<parameter param-name=" $10 " from-field=" $11"/>\R\t\t\t</$1hyperlink> 2d pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"(.*)/> <$1hyperlink$2 target=$3 "$12>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7 "/>\R\t\t\t\t<parameter param-name=" $8 " from-field=" $9 "/>\R\t\t\t\t<parameter param-name=" $10 " from-field=" $11"/>\R\t\t\t</$1hyperlink> 12 done 2 global search <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)\&amp;(.*)=\$(.*)/> 1st pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*) (.*) (.*)/> <$1hyperlink$2 target=$3 " $10 $11 $12>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7 "/>\R\t\t\t\t<parameter param-name=" $8 " from-field=" $9"/>\R\t\t\t</$1hyperlink> 2d pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*) (.*)/> <$1hyperlink$2 target=$3 " $10 $11>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7 "/>\R\t\t\t\t<parameter param-name=" $8 " from-field=" $9"/>\R\t\t\t</$1hyperlink> 3d pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*)/> <$1hyperlink$2 target=$3 " $10>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7 "/>\R\t\t\t\t<parameter param-name=" $8 " from-field=" $9"/>\R\t\t\t</$1hyperlink> 4th pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"/> <$1hyperlink$2 target=$3 ">\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7 "/>\R\t\t\t\t<parameter param-name=" $8 " from-field=" $9"/>\R\t\t\t</$1hyperlink> 10 done 1 global search <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)\&amp;(.*)=\$(.*)/> 1st pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\} (.*) (.*) (.*)/> <$1hyperlink$2 target=$3 " $8 $9 $10>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7"/>\R\t\t\t</$1hyperlink> 2d pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*) (.*)/> <$1hyperlink$2 target=$3 " $8 $9>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7"/>\R\t\t\t</$1hyperlink> 3d pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*)/> <$1hyperlink$2 target=$3 " $8>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7"/>\R\t\t\t</$1hyperlink> 4th pass <field(.*)<(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}" (.*)/></field> <field$1\R\t\t\t<$2hyperlink$3 target=$4 " $9>\R\t\t\t\t<parameter param-name=" $5 " from-field=" $6 "/>\R\t\t\t\t<parameter param-name=" $7 " from-field=" $8"/>\R\t\t\t</$2hyperlink>\R\t\t\</field> 5th pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"/> <$1hyperlink$2 target=$3 ">\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5 "/>\R\t\t\t\t<parameter param-name=" $6 " from-field=" $7"/>\R\t\t\t</$1hyperlink> 6th pass <field(.*)<(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}\&amp;(.*)=\$\{(.*)\}"/></field> <field$1\R\t\t\t<$2hyperlink$3 target=$4 ">\R\t\t\t\t<parameter param-name=" $5 " from-field=" $6 "/>\R\t\t\t\t<parameter param-name=" $7 " from-field=" $8"/>\R\t\t\t</$2hyperlink>\R\t\t\</field> 8 done 0 global search <(.*)hyperlink(.*) target=(.*)\?(.*)=\$(.*)/> 1st pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\} (.*) (.*) (.*)/> <$1hyperlink$2 target=$3 " $6 $7 $8>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5"/>\R\t\t\t</$1hyperlink> 2th pass <field(.*)<(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}" (.*) (.*)/></field> <field$1\R\t\t\t<$2hyperlink$3 target=$4 " $7 $8>\R\t\t\t\t<parameter param-name=" $5 " from-field=" $6"/>\R\t\t\t</$2hyperlink>\R\t\t\</field> 3d pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}" (.*) (.*)/> <$1hyperlink$2 target=$3 " $6 $7>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5"/>\R\t\t\t</$1hyperlink> 4th pass <field(.*)<(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}" (.*)/></field> <field$1\R\t\t\t<$2hyperlink$3 target=$4 " $7>\R\t\t\t\t<parameter param-name=" $5 " from-field=" $6"/>\R\t\t\t</$2hyperlink>\R\t\t\</field> 5th pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}" (.*)/> <$1hyperlink$2 target=$3 " $6>\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5"/>\R\t\t\t</$1hyperlink> 6th pass <field(.*)<(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}"/></field> <field$1\R\t\t\t<$2hyperlink$3 target=$4 ">\R\t\t\t\t<parameter param-name=" $5 " from-field=" $6"/>\R\t\t\t</$2hyperlink>\R\t\t\</field> 7th pass <(.*)hyperlink(.*) target=(.*)\?(.*)=\$\{(.*)\}"/> <$1hyperlink$2 target=$3 ">\R\t\t\t\t<parameter param-name=" $4 " from-field=" $5"/>\R\t\t\t</$1hyperlink> 6
          Hide
          Jacques Le Roux added a comment -

          Strange how
          And also because I wanted to check at each step before commiting
          became
          And also because I wanted to check at it step before commiting
          in my brain

          Show
          Jacques Le Roux added a comment - Strange how And also because I wanted to check at each step before commiting became And also because I wanted to check at it step before commiting in my brain
          Hide
          David E. Jones added a comment -

          Wow... that's quite the set of regexps...

          Show
          David E. Jones added a comment - Wow... that's quite the set of regexps...

            People

            • Assignee:
              Jacques Le Roux
              Reporter:
              Jacques Le Roux
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development