Annotating @NotContributed prevented it from invoking automatically.

>>What other UI pages exactly?  I'm guessing you have an action that returns a 
>>list of these OmSites?  Or is it when OmSite is in a collection of some other 
>>entity?  (ie is this a standalone or a parented collection of
>>OmSites?) 
Yes, both.


I will install git client to push demo app for any issues again

Thanks


-----Original Message-----
From: Dan Haywood [mailto:d...@haywood-associates.co.uk] 
Sent: Wednesday, June 11, 2014 6:17 PM
To: users
Subject: Re: Action method with Domain object parameter triggers automatically.

On 11 June 2014 13:21, <chittari.va...@wipro.com> wrote:

> Hi,
>
> I have application security service which creates permission to manage 
> particular entity(OmSite). Its action method is:
>
>     @Bookmarkable
>     @MemberOrder(sequence = "9")
>     @Named("Create Site Permission")
>     public OmPermission createSitePermission(final @Named("Choose a 
> site") OmSite site) {
>         final OmPermission obj = 
> newTransientInstance(OmPermission.class);
>
> obj.setPermission(SecurityUtil.formatSitePermission(site.getOrgId(),
> site.getSiteId()));
>         obj.setSite(site);
>         persistIfNotAlready(obj);
>         return obj;
>     }
>
>
> As you can see this method takes OmSite instance to create a 
> permission to that instance. And OmPermission has foreign key to 
> OmSite. This action is displayed in service menu and its working fine.
>
> But the problem I am facing is when I access the list of OmSite 
> objects in other UI pages.


What other UI pages exactly?  I'm guessing you have an action that returns a 
list of these OmSites?  Or is it when OmSite is in a collection of some other 
entity?  (ie is this a standalone or a parented collection of
OmSites?)





> This action method is getting triggered automatically and inserts bulk 
> OmPermissions for all those List<OmSite> objects.
>
>
Clearly that shouldn't happen.  One possible work-around: annotate the action 
as @NotContributed.

>
>


> Could you please look into this issue.
>
>
I will do.  But (just to repeat myself), if you can provide a sample app 
demonstrating the problem up on github, it makes it that much easier / 
motivates me to do so.


Dan



> Br
> Ranganath Varma
>
> The information contained in this electronic message and any 
> attachments to this message are intended for the exclusive use of the 
> addressee(s) and may contain proprietary, confidential or privileged 
> information. If you are not the intended recipient, you should not 
> disseminate, distribute or copy this e-mail. Please notify the sender 
> immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient 
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus 
> transmitted by this email.
>
> www.wipro.com
>

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.

www.wipro.com

Reply via email to