[
https://issues.apache.org/jira/browse/OFBIZ-2243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jacques Le Roux updated OFBIZ-2243:
-----------------------------------
Attachment: OFBIZ-2243.patch
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
{code}
Search : <hyperlink(.*)
target=(.*)\?(.*)=\$(.*)\&(.*)=\$(.*)\&(.*)=\$(.*)\&(.*)=\$(.*)\&(.*)=\$(.*)\&(.*)=\$(.*)\&(.*)=\$(.*)"/>
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>
{code}
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
{code}
Search : <hyperlink(.*)
target=(.*)\?(.*)=\$(.*)\&(.*)=\$(.*)\&(.*)=\$(.*)\&(.*)=\$(.*)\&(.*)=\$(.*)\&(.*)=\$(.*)"/>
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>
{code}
But before I think I will try to get a better retgexp if nobody beats me on it
:)
> In hyperlink element, replacement of target parameters by
> link-type="hidden-form" and parameter sub-elements
> ------------------------------------------------------------------------------------------------------------
>
> Key: OFBIZ-2243
> URL: https://issues.apache.org/jira/browse/OFBIZ-2243
> Project: OFBiz
> Issue Type: Improvement
> Components: ALL COMPONENTS
> Affects Versions: SVN trunk
> Reporter: Jacques Le Roux
> Attachments: OFBIZ-2243.patch
>
>
> This issue is intended to replace, in all hyperlink elements used in forms,
> screens and menus widgets, target parameters by
> * link-type="hidden-form"
> * and parameter sub-elements
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.