How to get the userLogin GenericValue in a service definition class. I used codes as below:
GenericValue userLogin = (GenericValue) context.get("userLogin"); but I get a null object . |
Administrator
|
It should be in the context http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757
Certainly you have an issue with the context you use a this point. How did you pass it to the called service? It's needed. Jacques From: "zhiyongcui" <[hidden email]> To: <[hidden email]> Sent: Wednesday, December 30, 2009 3:05 PM Subject: userLogin > > How to get the userLogin GenericValue in a service definition class. I used > codes as below: > GenericValue userLogin = (GenericValue) context.get("userLogin"); > but I get a null object . > -- > View this message in context: http://n4.nabble.com/userLogin-tp990922p990922.html > Sent from the OFBiz - User mailing list archive at Nabble.com. > |
If auth is set to false in the service definition then the userLogin
won't be available in the context. Regards Scott HotWax Media http://www.hotwaxmedia.com On 31/12/2009, at 4:29 AM, Jacques Le Roux wrote: > It should be in the context http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757 > Certainly you have an issue with the context you use a this point. > How did you pass it to the called service? It's needed. > > Jacques > > From: "zhiyongcui" <[hidden email]> > To: <[hidden email]> > Sent: Wednesday, December 30, 2009 3:05 PM > Subject: userLogin > > >> How to get the userLogin GenericValue in a service definition >> class. I used >> codes as below: >> GenericValue userLogin = (GenericValue) context.get("userLogin"); >> but I get a null object . >> -- >> View this message in context: http://n4.nabble.com/userLogin-tp990922p990922.html >> Sent from the OFBiz - User mailing list archive at Nabble.com. >> > smime.p7s (4K) Download Attachment |
Administrator
|
Yes, and as Zhiyongcui is using getRelatedParties and as auth is not defined in the service definition then it's set to false, this
is the reason. Jacques From: "Scott Gray" <[hidden email]> > If auth is set to false in the service definition then the userLogin won't be available in the context. > > Regards > Scott > > HotWax Media > http://www.hotwaxmedia.com > > On 31/12/2009, at 4:29 AM, Jacques Le Roux wrote: > >> It should be in the context http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757 Certainly you have an issue >> with the context you use a this point. How did you pass it to the called service? It's needed. >> >> Jacques >> >> From: "zhiyongcui" <[hidden email]> >> To: <[hidden email]> >> Sent: Wednesday, December 30, 2009 3:05 PM >> Subject: userLogin >> >> >>> How to get the userLogin GenericValue in a service definition class. I used >>> codes as below: >>> GenericValue userLogin = (GenericValue) context.get("userLogin"); >>> but I get a null object . >>> -- >>> View this message in context: http://n4.nabble.com/userLogin-tp990922p990922.html >>> Sent from the OFBiz - User mailing list archive at Nabble.com. >>> >> > > |
auth defaults to true
Regards Scott On 2/01/2010, at 10:35 AM, Jacques Le Roux wrote: > Yes, and as Zhiyongcui is using getRelatedParties and as auth is not > defined in the service definition then it's set to false, this is > the reason. > > Jacques > > From: "Scott Gray" <[hidden email]> >> If auth is set to false in the service definition then the >> userLogin won't be available in the context. >> >> Regards >> Scott >> >> HotWax Media >> http://www.hotwaxmedia.com >> >> On 31/12/2009, at 4:29 AM, Jacques Le Roux wrote: >> >>> It should be in the context http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757 >>> Certainly you have an issue with the context you use a this >>> point. How did you pass it to the called service? It's needed. >>> >>> Jacques >>> >>> From: "zhiyongcui" <[hidden email]> >>> To: <[hidden email]> >>> Sent: Wednesday, December 30, 2009 3:05 PM >>> Subject: userLogin >>> >>> >>>> How to get the userLogin GenericValue in a service definition >>>> class. I used >>>> codes as below: >>>> GenericValue userLogin = (GenericValue) context.get("userLogin"); >>>> but I get a null object . >>>> -- >>>> View this message in context: http://n4.nabble.com/userLogin-tp990922p990922.html >>>> Sent from the OFBiz - User mailing list archive at Nabble.com. >>>> >>> >> > > smime.p7s (4K) Download Attachment |
Administrator
|
Areyou sure? That's has changed then, because it's not what I read in the OFBiz Framework Quick Reference Book revision 1.6.2
(Service Definition p.3) and also the XMLcompletion default to false Jacques From: "Scott Gray" <[hidden email]> > auth defaults to true > > Regards > Scott > > On 2/01/2010, at 10:35 AM, Jacques Le Roux wrote: > >> Yes, and as Zhiyongcui is using getRelatedParties and as auth is not defined in the service definition then it's set to false, >> this is the reason. >> >> Jacques >> >> From: "Scott Gray" <[hidden email]> >>> If auth is set to false in the service definition then the userLogin won't be available in the context. >>> >>> Regards >>> Scott >>> >>> HotWax Media >>> http://www.hotwaxmedia.com >>> >>> On 31/12/2009, at 4:29 AM, Jacques Le Roux wrote: >>> >>>> It should be in the context http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757 Certainly you have an issue >>>> with the context you use a this point. How did you pass it to the called service? It's needed. >>>> >>>> Jacques >>>> >>>> From: "zhiyongcui" <[hidden email]> >>>> To: <[hidden email]> >>>> Sent: Wednesday, December 30, 2009 3:05 PM >>>> Subject: userLogin >>>> >>>> >>>>> How to get the userLogin GenericValue in a service definition class. I used >>>>> codes as below: >>>>> GenericValue userLogin = (GenericValue) context.get("userLogin"); >>>>> but I get a null object . >>>>> -- >>>>> View this message in context: http://n4.nabble.com/userLogin-tp990922p990922.html >>>>> Sent from the OFBiz - User mailing list archive at Nabble.com. >>>>> >>>> >>> >> >> > > |
Yeah sorry you're right, I looked at the code instead of the xsd:
// these default to true; if anything but true, make false service.auth = "true".equalsIgnoreCase(serviceElement.getAttribute("auth")); service.export = "true".equalsIgnoreCase(serviceElement.getAttribute("export")); service.debug = "true".equalsIgnoreCase(serviceElement.getAttribute("debug")); Either that comment is wrong or it doesn't mean what I think it means. Regards Scott On 2/01/2010, at 11:45 AM, Jacques Le Roux wrote: > Areyou sure? That's has changed then, because it's not what I read > in the OFBiz Framework Quick Reference Book revision 1.6.2 (Service > Definition p.3) and also the XMLcompletion default to false > > Jacques > > From: "Scott Gray" <[hidden email]> >> auth defaults to true >> >> Regards >> Scott >> >> On 2/01/2010, at 10:35 AM, Jacques Le Roux wrote: >> >>> Yes, and as Zhiyongcui is using getRelatedParties and as auth is >>> not defined in the service definition then it's set to false, >>> this is the reason. >>> >>> Jacques >>> >>> From: "Scott Gray" <[hidden email]> >>>> If auth is set to false in the service definition then the >>>> userLogin won't be available in the context. >>>> >>>> Regards >>>> Scott >>>> >>>> HotWax Media >>>> http://www.hotwaxmedia.com >>>> >>>> On 31/12/2009, at 4:29 AM, Jacques Le Roux wrote: >>>> >>>>> It should be in the context http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757 >>>>> Certainly you have an issue with the context you use a this >>>>> point. How did you pass it to the called service? It's needed. >>>>> >>>>> Jacques >>>>> >>>>> From: "zhiyongcui" <[hidden email]> >>>>> To: <[hidden email]> >>>>> Sent: Wednesday, December 30, 2009 3:05 PM >>>>> Subject: userLogin >>>>> >>>>> >>>>>> How to get the userLogin GenericValue in a service definition >>>>>> class. I used >>>>>> codes as below: >>>>>> GenericValue userLogin = (GenericValue) context.get("userLogin"); >>>>>> but I get a null object . >>>>>> -- >>>>>> View this message in context: http://n4.nabble.com/userLogin-tp990922p990922.html >>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com. >>>>>> >>>>> >>>> >>> >>> >> > > smime.p7s (4K) Download Attachment |
Administrator
|
Mmm... yes, looks like something is wrong, not quite sure what yet...
I'd would more logical to have auth="true" by default, but also then why are there so much services definitions stating it explicitly... Jacques From: "Scott Gray" <[hidden email]> > Yeah sorry you're right, I looked at the code instead of the xsd: > // these default to true; if anything but true, make false > service.auth = "true".equalsIgnoreCase(serviceElement.getAttribute("auth")); > service.export = "true".equalsIgnoreCase(serviceElement.getAttribute("export")); > service.debug = "true".equalsIgnoreCase(serviceElement.getAttribute("debug")); > > Either that comment is wrong or it doesn't mean what I think it means. > > Regards > Scott > > On 2/01/2010, at 11:45 AM, Jacques Le Roux wrote: > >> Areyou sure? That's has changed then, because it's not what I read in the OFBiz Framework Quick Reference Book revision 1.6.2 >> (Service Definition p.3) and also the XMLcompletion default to false >> >> Jacques >> >> From: "Scott Gray" <[hidden email]> >>> auth defaults to true >>> >>> Regards >>> Scott >>> >>> On 2/01/2010, at 10:35 AM, Jacques Le Roux wrote: >>> >>>> Yes, and as Zhiyongcui is using getRelatedParties and as auth is not defined in the service definition then it's set to >>>> false, this is the reason. >>>> >>>> Jacques >>>> >>>> From: "Scott Gray" <[hidden email]> >>>>> If auth is set to false in the service definition then the userLogin won't be available in the context. >>>>> >>>>> Regards >>>>> Scott >>>>> >>>>> HotWax Media >>>>> http://www.hotwaxmedia.com >>>>> >>>>> On 31/12/2009, at 4:29 AM, Jacques Le Roux wrote: >>>>> >>>>>> It should be in the context http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757 Certainly you have an >>>>>> issue with the context you use a this point. How did you pass it to the called service? It's needed. >>>>>> >>>>>> Jacques >>>>>> >>>>>> From: "zhiyongcui" <[hidden email]> >>>>>> To: <[hidden email]> >>>>>> Sent: Wednesday, December 30, 2009 3:05 PM >>>>>> Subject: userLogin >>>>>> >>>>>> >>>>>>> How to get the userLogin GenericValue in a service definition class. I used >>>>>>> codes as below: >>>>>>> GenericValue userLogin = (GenericValue) context.get("userLogin"); >>>>>>> but I get a null object . >>>>>>> -- >>>>>>> View this message in context: http://n4.nabble.com/userLogin-tp990922p990922.html >>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com. >>>>>>> >>>>>> >>>>> >>>> >>>> >>> >> >> > > |
Administrator
|
In reply to this post by zhiyongcui
From: "Jacques Le Roux" <[hidden email]>
> Mmm... yes, looks like something is wrong, not quite sure what yet... > I'd would more logical to have auth="true" by default, but also then why are there so much services definitions stating it > explicitly... Finally this line means, if it's not explicitly true then it's false, so it's false by default (if empty) and the comment is wrong. Jacques > Jacques > > From: "Scott Gray" <[hidden email]> > > >> Yeah sorry you're right, I looked at the code instead of the xsd: >> // these default to true; if anything but true, make false >> service.auth = "true".equalsIgnoreCase(serviceElement.getAttribute("auth")); >> service.export = "true".equalsIgnoreCase(serviceElement.getAttribute("export")); >> service.debug = "true".equalsIgnoreCase(serviceElement.getAttribute("debug")); >> >> Either that comment is wrong or it doesn't mean what I think it means. >> >> Regards >> Scott >> >> On 2/01/2010, at 11:45 AM, Jacques Le Roux wrote: >> >>> Areyou sure? That's has changed then, because it's not what I read in the OFBiz Framework Quick Reference Book revision 1.6.2 >>> (Service Definition p.3) and also the XMLcompletion default to false >>> >>> Jacques >>> >>> From: "Scott Gray" <[hidden email]> >>>> auth defaults to true >>>> >>>> Regards >>>> Scott >>>> >>>> On 2/01/2010, at 10:35 AM, Jacques Le Roux wrote: >>>> >>>>> Yes, and as Zhiyongcui is using getRelatedParties and as auth is not defined in the service definition then it's set to >>>>> false, this is the reason. >>>>> >>>>> Jacques >>>>> >>>>> From: "Scott Gray" <[hidden email]> >>>>>> If auth is set to false in the service definition then the userLogin won't be available in the context. >>>>>> >>>>>> Regards >>>>>> Scott >>>>>> >>>>>> HotWax Media >>>>>> http://www.hotwaxmedia.com >>>>>> >>>>>> On 31/12/2009, at 4:29 AM, Jacques Le Roux wrote: >>>>>> >>>>>>> It should be in the context http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757 Certainly you have an >>>>>>> issue with the context you use a this point. How did you pass it to the called service? It's needed. >>>>>>> >>>>>>> Jacques >>>>>>> >>>>>>> From: "zhiyongcui" <[hidden email]> >>>>>>> To: <[hidden email]> >>>>>>> Sent: Wednesday, December 30, 2009 3:05 PM >>>>>>> Subject: userLogin >>>>>>> >>>>>>> >>>>>>>> How to get the userLogin GenericValue in a service definition class. I used >>>>>>>> codes as below: >>>>>>>> GenericValue userLogin = (GenericValue) context.get("userLogin"); >>>>>>>> but I get a null object . >>>>>>>> -- >>>>>>>> View this message in context: http://n4.nabble.com/userLogin-tp990922p990922.html >>>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com. >>>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>> >>> >>> >> >> > |
In reply to this post by Scott Gray-2
Yeah, that comment looks wrong (the first part is, the second part of the comment is correct). If it is comparing to "true" then anything other than "true" will be false, including empty will be false. -David On Jan 1, 2010, at 4:53 PM, Scott Gray wrote: > Yeah sorry you're right, I looked at the code instead of the xsd: > // these default to true; if anything but true, make false > service.auth = "true".equalsIgnoreCase(serviceElement.getAttribute("auth")); > service.export = "true".equalsIgnoreCase(serviceElement.getAttribute("export")); > service.debug = "true".equalsIgnoreCase(serviceElement.getAttribute("debug")); > > Either that comment is wrong or it doesn't mean what I think it means. > > Regards > Scott > > On 2/01/2010, at 11:45 AM, Jacques Le Roux wrote: > >> Areyou sure? That's has changed then, because it's not what I read in the OFBiz Framework Quick Reference Book revision 1.6.2 (Service Definition p.3) and also the XMLcompletion default to false >> >> Jacques >> >> From: "Scott Gray" <[hidden email]> >>> auth defaults to true >>> >>> Regards >>> Scott >>> >>> On 2/01/2010, at 10:35 AM, Jacques Le Roux wrote: >>> >>>> Yes, and as Zhiyongcui is using getRelatedParties and as auth is not defined in the service definition then it's set to false, this is the reason. >>>> >>>> Jacques >>>> >>>> From: "Scott Gray" <[hidden email]> >>>>> If auth is set to false in the service definition then the userLogin won't be available in the context. >>>>> >>>>> Regards >>>>> Scott >>>>> >>>>> HotWax Media >>>>> http://www.hotwaxmedia.com >>>>> >>>>> On 31/12/2009, at 4:29 AM, Jacques Le Roux wrote: >>>>> >>>>>> It should be in the context http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757 Certainly you have an issue with the context you use a this point. How did you pass it to the called service? It's needed. >>>>>> >>>>>> Jacques >>>>>> >>>>>> From: "zhiyongcui" <[hidden email]> >>>>>> To: <[hidden email]> >>>>>> Sent: Wednesday, December 30, 2009 3:05 PM >>>>>> Subject: userLogin >>>>>> >>>>>> >>>>>>> How to get the userLogin GenericValue in a service definition class. I used >>>>>>> codes as below: >>>>>>> GenericValue userLogin = (GenericValue) context.get("userLogin"); >>>>>>> but I get a null object . >>>>>>> -- >>>>>>> View this message in context: http://n4.nabble.com/userLogin-tp990922p990922.html >>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com. >>>>>>> >>>>>> >>>>> >>>> >>>> >>> >> >> > |
Free forum by Nabble | Edit this page |