Re: Validation messages to auto-attributes of a service

2016-10-17 Thread Nicolas Malin

I did think about this few years ago.

It's nice to put a dedicate message, and it's more powerfull to put a 
default rule to resolve the label with a pattern like :


Default file for Service error message : 
component/config/ServiceErrorLabels.xml


pattern : ServiceValidation.IN.${service-name}.${service-attribute}

And maybe use a default pattern if not found for a dedicate service

pattern : ServiceValidation.IN.common.${service-attribute}

The advantage, keep service definition light, and offer the possibility 
to surcharge if needed with the  


Nicolas


Le 13/10/2016 à 10:21, Rishi Solanki a écrit :

Applying same to your example;



 
  
 





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

On Thu, Oct 13, 2016 at 1:46 PM, Rishi Solanki 
wrote:


Devanshu,

You can simply try to use override to override the default behavior of
auto-attribute. For example; if you are working on PartyContanctMech and
you want partyId and contactMechId should return custom error message if
empty. Then use the following practice to do that;



 
  
 



Override tag intended to override the default behavior set in the
auto-attributes. Simply using it suggested and implemented at service
defintion level.


HTH!



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

On Thu, Oct 13, 2016 at 11:14 AM, Devanshu Vyas 

Re: Validation messages to auto-attributes of a service

2016-10-13 Thread Rishi Solanki
Applying same to your example;




 






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

On Thu, Oct 13, 2016 at 1:46 PM, Rishi Solanki 
wrote:

> Devanshu,
>
> You can simply try to use override to override the default behavior of
> auto-attribute. For example; if you are working on PartyContanctMech and
> you want partyId and contactMechId should return custom error message if
> empty. Then use the following practice to do that;
>
> 
> 
> 
>  
> 
> 
>
>
> Override tag intended to override the default behavior set in the
> auto-attributes. Simply using it suggested and implemented at service
> defintion level.
>
>
> HTH!
>
>
>
> Rishi Solanki
> Manager, Enterprise Software Development
> HotWax Systems Pvt. Ltd.
> Direct: +91-9893287847
> http://www.hotwaxsystems.com
>
> On Thu, Oct 13, 2016 at 11:14 AM, Devanshu Vyas  > wrote:
>
>> Hello Guys,
>>
>> I came across a situation where I tried to throw a custom
>> (more user-friendly) validation message when a required field in a service
>> is missing. And the service definition was written with auto-attributes,
>> something like this:
>>
>> 
>>
>> And I found myself stuck as I wanted to throw a custom message on a
>> specific field among the PKs of the entity.
>>
>> I want you to suggest me a way to set validate message in such situation
>> like we set on a single attribute like:
>>
>> > optional="false">
>> 
>> > property="checkhelper.select_shipping_destination"/>
>> 
>> 
>>
>> IMO, we can think of doing something like the exclude field inside the
>> auto-attributes to define the validate messages on the fields.
>>
>> 
>> 
>> 
>>
>> Something like this:
>>
>> 
>> > resource="OrderUiLabels"
>> property="checkhelper.select_shipping_destination"/>
>> 
>>
>> Please share your thoughts. :)
>>
>> --
>> Thanks and Regards,
>> Devanshu Vyas
>>
>
>


Re: Validation messages to auto-attributes of a service

2016-10-13 Thread Rishi Solanki
Devanshu,

You can simply try to use override to override the default behavior of
auto-attribute. For example; if you are working on PartyContanctMech and
you want partyId and contactMechId should return custom error message if
empty. Then use the following practice to do that;




 




Override tag intended to override the default behavior set in the
auto-attributes. Simply using it suggested and implemented at service
defintion level.


HTH!



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

On Thu, Oct 13, 2016 at 11:14 AM, Devanshu Vyas 
wrote:

> Hello Guys,
>
> I came across a situation where I tried to throw a custom
> (more user-friendly) validation message when a required field in a service
> is missing. And the service definition was written with auto-attributes,
> something like this:
>
> 
>
> And I found myself stuck as I wanted to throw a custom message on a
> specific field among the PKs of the entity.
>
> I want you to suggest me a way to set validate message in such situation
> like we set on a single attribute like:
>
>  optional="false">
> 
>  property="checkhelper.select_shipping_destination"/>
> 
> 
>
> IMO, we can think of doing something like the exclude field inside the
> auto-attributes to define the validate messages on the fields.
>
> 
> 
> 
>
> Something like this:
>
> 
>  resource="OrderUiLabels"
> property="checkhelper.select_shipping_destination"/>
> 
>
> Please share your thoughts. :)
>
> --
> Thanks and Regards,
> Devanshu Vyas
>


Validation messages to auto-attributes of a service

2016-10-12 Thread Devanshu Vyas
Hello Guys,

I came across a situation where I tried to throw a custom
(more user-friendly) validation message when a required field in a service
is missing. And the service definition was written with auto-attributes,
something like this:



And I found myself stuck as I wanted to throw a custom message on a
specific field among the PKs of the entity.

I want you to suggest me a way to set validate message in such situation
like we set on a single attribute like:







IMO, we can think of doing something like the exclude field inside the
auto-attributes to define the validate messages on the fields.





Something like this:





Please share your thoughts. :)

--
Thanks and Regards,
Devanshu Vyas