Re: Improve FindGeneric on webtools

2017-02-17 Thread Jacques Le Roux

That's certainly a good idea Taher,

In the meantime I like Nicolas's proposition, notably to be able to search on 
dates!

Jacques


Le 17/02/2017 à 09:13, Taher Alkhateeb a écrit :

Great initiative Nicolas.

I remember once trying to extend the functionality of performFind but it
contained so much logic that I couldn't reuse it in any reasonable way. The
entire implementation of find services needs heavy refactoring or
replacement because it tries to do everything (searching, parsing,
paginating, displaying, validating). It's just one big monster

I would recommend instead of creating new services, trying to replace the
existing ones (if possible and you go the energy). I think we need multiple
separate components (parser, renderer, paginator, searcher, etc ...). It
would be really great to have small specialized classes or groovy scripts
that split the responsibility instead of this painful implementation we
have at the moment.

On Fri, Feb 17, 2017 at 11:04 AM, Nicolas Malin 
wrote:


I opened the issue https://issues.apache.org/jira/browse/OFBIZ-9217

It's not finish yet but already usefull ;)

Nicolas

Le 17/02/2017 à 06:24, Rishi Solanki a écrit :


+1


On Thu, Feb 16, 2017 at 3:31 PM, Nicolas Malin > wrote:

 Hello, I want just sharing a small improvement realized  yesterday.

 During a travel, I was bored on the train I tried to replace the
 old ftl FindGeneric screen to display and search all entity by an
 xml form with auto-attribute-entity.

 The main problem came from it's impossible to create a xml file
 with use dynamiclay an entityName for the element
  (for cache/performance reason) so I tried to
 generate on the fly by groovy the xml flow, and call without cache
 the rendering, like this :
 *
 String dynamicAutoEntityFieldForm = '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;
 >'


 '' +
 '' +
 '' +
 '' +
 '' +
 ''
 Document dynamicAutoEntityFieldFormXml =
 UtilXml.readXmlDocument(dynamicAutoEntityFieldForm, true, true)
 [...]
 dynamicAutoEntitySearchFormRenderer.render(writer, context)
 
 and on the ftl
 
 ${dynamicAutoEntitySearchForm?string}
 
 I realized this on the search and list form so now I can use
 complex search operator and the performFind for all entity. What
 do you thinks about that ?

 I will open an issue.

 Nicolas


 -- logoNrd 
 Nicolas Malin
 The apache way  : *Openness* Technical
 decisions are made publicly
 informat...@nereide.fr 
 8 rue des Déportés 37000 TOURS, 02 47 50 30 54

 Apache OFBiz |The Apache Way
 |ofbiz-fr
 |réseau LE
 









Re: Improve FindGeneric on webtools

2017-02-17 Thread Taher Alkhateeb
Great initiative Nicolas.

I remember once trying to extend the functionality of performFind but it
contained so much logic that I couldn't reuse it in any reasonable way. The
entire implementation of find services needs heavy refactoring or
replacement because it tries to do everything (searching, parsing,
paginating, displaying, validating). It's just one big monster

I would recommend instead of creating new services, trying to replace the
existing ones (if possible and you go the energy). I think we need multiple
separate components (parser, renderer, paginator, searcher, etc ...). It
would be really great to have small specialized classes or groovy scripts
that split the responsibility instead of this painful implementation we
have at the moment.

On Fri, Feb 17, 2017 at 11:04 AM, Nicolas Malin 
wrote:

> I opened the issue https://issues.apache.org/jira/browse/OFBIZ-9217
>
> It's not finish yet but already usefull ;)
>
> Nicolas
>
> Le 17/02/2017 à 06:24, Rishi Solanki a écrit :
>
>> +1
>>
>>
>> On Thu, Feb 16, 2017 at 3:31 PM, Nicolas Malin > > wrote:
>>
>> Hello, I want just sharing a small improvement realized  yesterday.
>>
>> During a travel, I was bored on the train I tried to replace the
>> old ftl FindGeneric screen to display and search all entity by an
>> xml form with auto-attribute-entity.
>>
>> The main problem came from it's impossible to create a xml file
>> with use dynamiclay an entityName for the element
>>  (for cache/performance reason) so I tried to
>> generate on the fly by groovy the xml flow, and call without cache
>> the rendering, like this :
>> *
>> String dynamicAutoEntityFieldForm = '> encoding="UTF-8"?>> 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;
>> > dtds/widget-form.xsd>>'
>>
>>
>> '> target="FindGeneric">' +
>> '> default-field-type="find"/>' +
>> '' +
>> '' +
>> '> "FormFieldTitle_searchButton", locale) + '">' +
>> ''
>> Document dynamicAutoEntityFieldFormXml =
>> UtilXml.readXmlDocument(dynamicAutoEntityFieldForm, true, true)
>> [...]
>> dynamicAutoEntitySearchFormRenderer.render(writer, context)
>> 
>> and on the ftl
>> 
>> ${dynamicAutoEntitySearchForm?string}
>> 
>> I realized this on the search and list form so now I can use
>> complex search operator and the performFind for all entity. What
>> do you thinks about that ?
>>
>> I will open an issue.
>>
>> Nicolas
>>
>>
>> -- logoNrd 
>> Nicolas Malin
>> The apache way  : *Openness* Technical
>> decisions are made publicly
>> informat...@nereide.fr 
>> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>>
>> Apache OFBiz |The Apache Way
>> |ofbiz-fr
>> |réseau LE
>> 
>>
>>
>>
>


Re: Improve FindGeneric on webtools

2017-02-17 Thread Nicolas Malin

I opened the issue https://issues.apache.org/jira/browse/OFBIZ-9217

It's not finish yet but already usefull ;)

Nicolas

Le 17/02/2017 à 06:24, Rishi Solanki a écrit :

+1


On Thu, Feb 16, 2017 at 3:31 PM, Nicolas Malin 
> wrote:


Hello, I want just sharing a small improvement realized  yesterday.

During a travel, I was bored on the train I tried to replace the
old ftl FindGeneric screen to display and search all entity by an
xml form with auto-attribute-entity.

The main problem came from it's impossible to create a xml file
with use dynamiclay an entityName for the element
 (for cache/performance reason) so I tried to
generate on the fly by groovy the xml flow, and call without cache
the rendering, like this :
*
String dynamicAutoEntityFieldForm = '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;

>'

'' +
'' +
'' +
'' +
'' +
''
Document dynamicAutoEntityFieldFormXml =
UtilXml.readXmlDocument(dynamicAutoEntityFieldForm, true, true)
[...]
dynamicAutoEntitySearchFormRenderer.render(writer, context)

and on the ftl

${dynamicAutoEntitySearchForm?string}

I realized this on the search and list form so now I can use
complex search operator and the performFind for all entity. What
do you thinks about that ?

I will open an issue.

Nicolas


-- 
logoNrd 

Nicolas Malin
The apache way  : *Openness* Technical
decisions are made publicly
informat...@nereide.fr 
8 rue des Déportés 37000 TOURS, 02 47 50 30 54

Apache OFBiz |The Apache Way
|ofbiz-fr
|réseau LE







Re: Improve FindGeneric on webtools

2017-02-16 Thread Rishi Solanki
+1

Rishi Solanki
Sr. Manager, Enterprise Software Development
HotWax Systems Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxsystems.com

On Thu, Feb 16, 2017 at 3:31 PM, Nicolas Malin 
wrote:

> Hello, I want just sharing a small improvement realized  yesterday.
>
> During a travel, I was bored on the train I tried to replace the old ftl
> FindGeneric screen to display and search all entity by an xml form with
> auto-attribute-entity.
> The main problem came from it's impossible to create a xml file with use
> dynamiclay an entityName for the element  (for
> cache/performance reason) so I tried to generate on the fly by groovy the
> xml flow, and call without cache the rendering, like this :
> *
> String dynamicAutoEntityFieldForm = ' encoding="UTF-8"?>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;
> >'
>
> '' +
> ' default-field-type="find"/>' +
> '' +
> '' +
> ' "FormFieldTitle_searchButton", locale) + '">' +
> ''
> Document dynamicAutoEntityFieldFormXml = 
> UtilXml.readXmlDocument(dynamicAutoEntityFieldForm,
> true, true)
> [...]
> dynamicAutoEntitySearchFormRenderer.render(writer, context)
> 
> and on the ftl
> 
> ${dynamicAutoEntitySearchForm?string}
> 
> I realized this on the search and list form so now I can use complex
> search operator and the performFind for all entity. What do you thinks
> about that ?
>
> I will open an issue.
>
> Nicolas
>
>
> --
> [image: logoNrd] 
> Nicolas Malin
> The apache way  : *Openness* Technical
> decisions are made publicly
> informat...@nereide.fr
> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
> Apache OFBiz |The Apache Way
> |ofbiz-fr |réseau LE
> 
>


Improve FindGeneric on webtools

2017-02-16 Thread Nicolas Malin

Hello, I want just sharing a small improvement realized yesterday.

During a travel, I was bored on the train I tried to replace the old ftl 
FindGeneric screen to display and search all entity by an xml form with 
auto-attribute-entity.


The main problem came from it's impossible to create a xml file with use 
dynamiclay an entityName for the element  (for 
cache/performance reason) so I tried to generate on the fly by groovy 
the xml flow, and call without cache the rendering, like this :

*
String dynamicAutoEntityFieldForm = 'encoding="UTF-8"?>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;>'

'' +
'default-field-type="find"/>' +

'' +
'' +
'"FormFieldTitle_searchButton", locale) + '">' +

''
Document dynamicAutoEntityFieldFormXml = 
UtilXml.readXmlDocument(dynamicAutoEntityFieldForm, true, true)

[...]
dynamicAutoEntitySearchFormRenderer.render(writer, context)

and on the ftl

${dynamicAutoEntitySearchForm?string}

I realized this on the search and list form so now I can use complex 
search operator and the performFind for all entity. What do you thinks 
about that ?


I will open an issue.

Nicolas


--
logoNrd 
Nicolas Malin
The apache way  : *Openness* Technical 
decisions are made publicly

informat...@nereide.fr
8 rue des Déportés 37000 TOURS, 02 47 50 30 54

Apache OFBiz |The Apache Way 
|ofbiz-fr |réseau LE