Re: svn commit: r1793254 - /ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/FindGeneric.groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1793254 - /ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/FindGeneric.groovy

taher
Whoa! That was painful to read, this file It is creating dynamic models for
XML documents and then parsing them for stuff like entities and widgets and
hard-coding XML attributes and then shoving everything back to the context.
Phew!

If anyone has the time and would like to review this, I would recommend
re-writing this thing completely from scratch with all dependencies updated.

On Sun, Apr 30, 2017 at 12:54 PM, <[hidden email]> wrote:

> Author: jleroux
> Date: Sun Apr 30 09:54:58 2017
> New Revision: 1793254
>
> URL: http://svn.apache.org/viewvc?rev=1793254&view=rev
> Log:
> Improved: When searched from FindGeneric page it looses entityName from
> the url
> (OFBIZ-9341)
>
> Steps to generate:
> 1. Go to webtools (https://localhost:8443/webtools/control/main)
> 2. Click on "Entity Engine" (https://localhost:8443/
> webtools/control/entitymaint)
> 3. Click on any entity to view (https://localhost:8443/
> webtools/control/FindGeneric?entityName=AccommodationClass)
> 4. Click on "search" button (https://localhost:8443/
> webtools/control/FindGeneric)
>
> When the search is hit, it looses the entityName from the url as it used to
> happen in previous releases and according to the pattern on other search
> pages.
>
> Thanks: Aditya Sharma
>
> Modified:
>     ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/
> FindGeneric.groovy
>
> Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/
> groovyScripts/entity/FindGeneric.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/
> framework/webtools/groovyScripts/entity/FindGeneric.groovy?rev=
> 1793254&r1=1793253&r2=1793254&view=diff
> ============================================================
> ==================
> --- ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/FindGeneric.groovy
> (original)
> +++ ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/FindGeneric.groovy
> Sun Apr 30 09:54:58 2017
> @@ -44,11 +44,10 @@ if (modelEntity) {
>      ModelReader entityModelReader = delegator.getModelReader()
>      //create the search form with auto-fields-entity
>      String dynamicAutoEntityFieldSearchForm = '<?xml version="1.0"
> encoding="UTF-8"?><forms xmlns:xsi="http://www.w3.org/
> 2001/XMLSchema-instance" xmlns="http://ofbiz.apache.org/Widget-Form"
> xsi:schemaLocation="http://ofbiz.apache.org/Widget-Form
> http://ofbiz.apache.org/dtds/widget-form.xsd">' +
> -            '<form name="FindGeneric" type="single"
> target="FindGeneric">' +
> +            '<form name="FindGeneric" type="single" target="FindGeneric?entityName='+
> entityName +'">' +
>              '<auto-fields-entity entity-name="' + entityName + '"
> default-field-type="find"/>' +
>              '<field name="noConditionFind"><hidden value="Y"/></field>' +
>              '<field name="searchOptions_collapsed" ><hidden
> value="true"/></field>' +
> -            '<field name="entityName"><hidden value="' + entityName +
> '"/></field>' +
>              '<field name="searchButton" title="' +
> UtilProperties.getMessage("CommonUiLabels",
> "FormFieldTitle_searchButton", locale) + '"><submit/></field>'
>
>      //call modelEntity to complete information on the field type
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1793254 - /ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/FindGeneric.groovy

Deepak Dixit-3
Thanks Taher, totally make sense
Here is the ticket for reference, I'll review and try to update this
dynamic thing
https://issues.apache.org/jira/browse/OFBIZ-9458

Thanks & Regards
--
Deepak Dixit
www.hotwaxsystems.com
www.hotwax.co

On Sun, Apr 30, 2017 at 5:34 PM, Taher Alkhateeb <[hidden email]
> wrote:

> Whoa! That was painful to read, this file It is creating dynamic models for
> XML documents and then parsing them for stuff like entities and widgets and
> hard-coding XML attributes and then shoving everything back to the context.
> Phew!
>
> If anyone has the time and would like to review this, I would recommend
> re-writing this thing completely from scratch with all dependencies
> updated.
>
> On Sun, Apr 30, 2017 at 12:54 PM, <[hidden email]> wrote:
>
> > Author: jleroux
> > Date: Sun Apr 30 09:54:58 2017
> > New Revision: 1793254
> >
> > URL: http://svn.apache.org/viewvc?rev=1793254&view=rev
> > Log:
> > Improved: When searched from FindGeneric page it looses entityName from
> > the url
> > (OFBIZ-9341)
> >
> > Steps to generate:
> > 1. Go to webtools (https://localhost:8443/webtools/control/main)
> > 2. Click on "Entity Engine" (https://localhost:8443/
> > webtools/control/entitymaint)
> > 3. Click on any entity to view (https://localhost:8443/
> > webtools/control/FindGeneric?entityName=AccommodationClass)
> > 4. Click on "search" button (https://localhost:8443/
> > webtools/control/FindGeneric)
> >
> > When the search is hit, it looses the entityName from the url as it used
> to
> > happen in previous releases and according to the pattern on other search
> > pages.
> >
> > Thanks: Aditya Sharma
> >
> > Modified:
> >     ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/
> > FindGeneric.groovy
> >
> > Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/
> > groovyScripts/entity/FindGeneric.groovy
> > URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/
> > framework/webtools/groovyScripts/entity/FindGeneric.groovy?rev=
> > 1793254&r1=1793253&r2=1793254&view=diff
> > ============================================================
> > ==================
> > --- ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/
> FindGeneric.groovy
> > (original)
> > +++ ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/
> FindGeneric.groovy
> > Sun Apr 30 09:54:58 2017
> > @@ -44,11 +44,10 @@ if (modelEntity) {
> >      ModelReader entityModelReader = delegator.getModelReader()
> >      //create the search form with auto-fields-entity
> >      String dynamicAutoEntityFieldSearchForm = '<?xml version="1.0"
> > encoding="UTF-8"?><forms xmlns:xsi="http://www.w3.org/
> > 2001/XMLSchema-instance" xmlns="http://ofbiz.apache.org/Widget-Form"
> > xsi:schemaLocation="http://ofbiz.apache.org/Widget-Form
> > http://ofbiz.apache.org/dtds/widget-form.xsd">' +
> > -            '<form name="FindGeneric" type="single"
> > target="FindGeneric">' +
> > +            '<form name="FindGeneric" type="single" target="FindGeneric?
> entityName='+
> > entityName +'">' +
> >              '<auto-fields-entity entity-name="' + entityName + '"
> > default-field-type="find"/>' +
> >              '<field name="noConditionFind"><hidden value="Y"/></field>'
> +
> >              '<field name="searchOptions_collapsed" ><hidden
> > value="true"/></field>' +
> > -            '<field name="entityName"><hidden value="' + entityName +
> > '"/></field>' +
> >              '<field name="searchButton" title="' +
> > UtilProperties.getMessage("CommonUiLabels",
> > "FormFieldTitle_searchButton", locale) + '"><submit/></field>'
> >
> >      //call modelEntity to complete information on the field type
> >
> >
> >
>