Service error label wit automatic resolution

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

Service error label wit automatic resolution

Nicolas Malin-2
Hello,
After review some issue related to
https://issues.apache.org/jira/browse/OFBIZ-7471, my head raise an old
idea that have been in the past to improve error message on service
validation.
Currently to set an error message related to an attribute, we need to
set it like this :
         <attribute name="file" type="String" mode="IN" optional="false">
             <type-validate>
                 <fail-property resource="ContentErrorUiLabels"
property="ContentRequiredFieldMissingFile"/>
             </type-validate>
         </attribute>
I find this burden, to write and to read.

Maybe we can improve OFBiz to resolve le label automatically with few
easy rule like :
write title error label with the template
ServiceErrorTitle_${serviceName}_${attribute}, if not found resolve the
generic ServiceErrorTitle_${serviceName}, if not found resolve
ServiceErrorTitle_${attribute}
All service label files would be identify to load in cache at ofbiz start.
I think it's :
* easy to develop
* easy to maintain
* don't decrease the performance

Opinions ?

Nicolas

--
logoNrd <https://nereide.fr/>
        Nicolas Malin
The apache way <http://theapacheway.com/> : *Openness* Technical
decisions are made publicly
[hidden email]
8 rue des Déportés 37000 TOURS, 02 47 50 30 54

Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way
<http://theapacheway.com/>|ofbiz-fr <http://www.ofbiz-fr.org/>|réseau LE
<http://www.libre-entreprise.org/>
Reply | Threaded
Open this post in threaded view
|

Re: Service error label wit automatic resolution

Paul Foxworthy
Hi Nicholas,

Are you proposing these labels would be used when there's a missing
parameter to a service? If that's right, the names of labels should
communicate they are about missing parameters.

How about ServiceErrorTitle_${serviceName}_Missing_${attribute} and
ServiceErrorTitle_Missing_${attribute}
. I don't understand when ServiceErrorTitle_${serviceName} would be used.

Cheers

Paul Foxworthy


On 23 July 2017 at 04:26, Nicolas Malin <[hidden email]> wrote:

> Hello,
> After review some issue related to https://issues.apache.org/jira
> /browse/OFBIZ-7471, my head raise an old idea that have been in the past
> to improve error message on service validation.
> Currently to set an error message related to an attribute, we need to set
> it like this :
>         <attribute name="file" type="String" mode="IN" optional="false">
>             <type-validate>
>                 <fail-property resource="ContentErrorUiLabels"
> property="ContentRequiredFieldMissingFile"/>
>             </type-validate>
>         </attribute>
> I find this burden, to write and to read.
>
> Maybe we can improve OFBiz to resolve le label automatically with few easy
> rule like :
> write title error label with the template ServiceErrorTitle_${serviceName}_${attribute},
> if not found resolve the generic ServiceErrorTitle_${serviceName}, if not
> found resolve ServiceErrorTitle_${attribute}
> All service label files would be identify to load in cache at ofbiz start.
> I think it's :
> * easy to develop
> * easy to maintain
> * don't decrease the performance
>
> Opinions ?
>
> Nicolas
>
> --
> logoNrd <https://nereide.fr/>
>         Nicolas Malin
> The apache way <http://theapacheway.com/> : *Openness* Technical
> decisions are made publicly
> [hidden email]
> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>
> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way <
> http://theapacheway.com/>|ofbiz-fr <http://www.ofbiz-fr.org/>|réseau LE <
> http://www.libre-entreprise.org/>
>



--
Coherent Software Australia Pty Ltd
PO Box 2773
Cheltenham Vic 3192
Australia

Phone: +61 3 9585 6788
Web: http://www.coherentsoftware.com.au/
Email: [hidden email]
--
Coherent Software Australia Pty Ltd
http://www.coherentsoftware.com.au/

Bonsai ERP, the all-inclusive ERP system
http://www.bonsaierp.com.au/
Reply | Threaded
Open this post in threaded view
|

Re: Service error label wit automatic resolution

Nicolas Malin-2
Hi Phaul,

I agree for "Missing" but you also can have a type conversion problem.
But no worries.
I get an example for ServiceErrorTitle_${serviceName}

I create the service createMyHome with 200 attributes and define this :
(I use properties syntax for simplify)

ServiceErrorTitle_createMyHome=Oh to create my home you forget some parameters :

ServiceErrorTitle_createMyHome_Missing_address=To create my home I need to know where, please give me an address.


When I call create my home and forget address, OFBiz return :

To create my home I need to know where, please give me an address.


But When I forget doorSize, colorToilet  OFBiz return :

Oh to create my home you forget some parameters: doorSize, colorToilet


Perhaps it's more clear :)
Cheers,
Nicolas

Le 23/07/2017 à 08:03, Paul Foxworthy a écrit :

> Hi Nicholas,
>
> Are you proposing these labels would be used when there's a missing
> parameter to a service? If that's right, the names of labels should
> communicate they are about missing parameters.
>
> How about ServiceErrorTitle_${serviceName}_Missing_${attribute} and
> ServiceErrorTitle_Missing_${attribute}
> . I don't understand when ServiceErrorTitle_${serviceName} would be used.
>
> Cheers
>
> Paul Foxworthy
>
>
> On 23 July 2017 at 04:26, Nicolas Malin <[hidden email]> wrote:
>
>> Hello,
>> After review some issue related to https://issues.apache.org/jira
>> /browse/OFBIZ-7471, my head raise an old idea that have been in the past
>> to improve error message on service validation.
>> Currently to set an error message related to an attribute, we need to set
>> it like this :
>>          <attribute name="file" type="String" mode="IN" optional="false">
>>              <type-validate>
>>                  <fail-property resource="ContentErrorUiLabels"
>> property="ContentRequiredFieldMissingFile"/>
>>              </type-validate>
>>          </attribute>
>> I find this burden, to write and to read.
>>
>> Maybe we can improve OFBiz to resolve le label automatically with few easy
>> rule like :
>> write title error label with the template ServiceErrorTitle_${serviceName}_${attribute},
>> if not found resolve the generic ServiceErrorTitle_${serviceName}, if not
>> found resolve ServiceErrorTitle_${attribute}
>> All service label files would be identify to load in cache at ofbiz start.
>> I think it's :
>> * easy to develop
>> * easy to maintain
>> * don't decrease the performance
>>
>> Opinions ?
>>
>> Nicolas
>>
>> --
>> logoNrd <https://nereide.fr/>
>>          Nicolas Malin
>> The apache way <http://theapacheway.com/> : *Openness* Technical
>> decisions are made publicly
>> [hidden email]
>> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>>
>> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way <
>> http://theapacheway.com/>|ofbiz-fr <http://www.ofbiz-fr.org/>|réseau LE <
>> http://www.libre-entreprise.org/>
>>
>
>