You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Brett Palmer <br...@gmail.com> on 2010/04/13 23:44:37 UTC

Using custom delegator in simple method

Does anyone know if it's possible to specify the entity delegator you want
to use in a simple method instead of using the "default" delegator?

I know you can do it from a Java service but I would like to do it from a
simple method if possible.

We have an ofbiz application that uses two delegators.  The first delegator
is the default one and points to a local ofbiz database.  The second
delegator is use to access a remote ofbiz database.  Simple methods would be
very convenient for us passing data between the two databases.


Thanks,


Brett

Re: Using custom delegator in simple method

Posted by Brett Palmer <br...@gmail.com>.
Thanks both of the suggested solutions will work for me.  I think I'll try
the shorter "call-class-method" for now.


Brett

On Wed, Apr 14, 2010 at 10:35 PM, Scott Gray <sc...@hotwaxmedia.com>wrote:

> You might be better off doing a call-class-method for
> DelegatorFactory.getDelegator(String)
>
> Regards
> Scott
>
> On 15/04/2010, at 4:30 PM, Rishi Solanki wrote:
>
> > Bret,
> > For this you can get the delegator objects as follows in simple method;
> > <create-object class-name="org.ofbiz.entity.GenericDelegator"
> > field="delegator1">
> > <create-object class-name="org.ofbiz.entity.GenericDelegator"
> > field="delegator1">
> > Need to pass the parameters constructor needs. This tag automatically
> call
> > the constructor of the class specified in the class-name attribute.
> >
> > One more pointer is use <set ../> tag in simple method and in value tag
> you
> > can do all java code use ${groovy: 'post your code here'}
> > HTH!
> >
> > Rishi Solanki
> > Manager, Enterprise Software Developer
> > HotWax Media Pvt. Ltd.
> > Direct: +91-9893287847
> > http://www.hotwaxmedia.com
> >
> >
> > On Wed, Apr 14, 2010 at 3:14 AM, Brett Palmer <brettgpalmer@gmail.com
> >wrote:
> >
> >> Does anyone know if it's possible to specify the entity delegator you
> want
> >> to use in a simple method instead of using the "default" delegator?
> >>
> >> I know you can do it from a Java service but I would like to do it from
> a
> >> simple method if possible.
> >>
> >> We have an ofbiz application that uses two delegators.  The first
> delegator
> >> is the default one and points to a local ofbiz database.  The second
> >> delegator is use to access a remote ofbiz database.  Simple methods
> would
> >> be
> >> very convenient for us passing data between the two databases.
> >>
> >>
> >> Thanks,
> >>
> >>
> >> Brett
> >>
>
>

Re: Using custom delegator in simple method

Posted by Scott Gray <sc...@hotwaxmedia.com>.
You might be better off doing a call-class-method for DelegatorFactory.getDelegator(String)

Regards
Scott

On 15/04/2010, at 4:30 PM, Rishi Solanki wrote:

> Bret,
> For this you can get the delegator objects as follows in simple method;
> <create-object class-name="org.ofbiz.entity.GenericDelegator"
> field="delegator1">
> <create-object class-name="org.ofbiz.entity.GenericDelegator"
> field="delegator1">
> Need to pass the parameters constructor needs. This tag automatically call
> the constructor of the class specified in the class-name attribute.
> 
> One more pointer is use <set ../> tag in simple method and in value tag you
> can do all java code use ${groovy: 'post your code here'}
> HTH!
> 
> Rishi Solanki
> Manager, Enterprise Software Developer
> HotWax Media Pvt. Ltd.
> Direct: +91-9893287847
> http://www.hotwaxmedia.com
> 
> 
> On Wed, Apr 14, 2010 at 3:14 AM, Brett Palmer <br...@gmail.com>wrote:
> 
>> Does anyone know if it's possible to specify the entity delegator you want
>> to use in a simple method instead of using the "default" delegator?
>> 
>> I know you can do it from a Java service but I would like to do it from a
>> simple method if possible.
>> 
>> We have an ofbiz application that uses two delegators.  The first delegator
>> is the default one and points to a local ofbiz database.  The second
>> delegator is use to access a remote ofbiz database.  Simple methods would
>> be
>> very convenient for us passing data between the two databases.
>> 
>> 
>> Thanks,
>> 
>> 
>> Brett
>> 


Re: Using custom delegator in simple method

Posted by Rishi Solanki <ri...@gmail.com>.
Bret,
For this you can get the delegator objects as follows in simple method;
<create-object class-name="org.ofbiz.entity.GenericDelegator"
field="delegator1">
<create-object class-name="org.ofbiz.entity.GenericDelegator"
field="delegator1">
Need to pass the parameters constructor needs. This tag automatically call
the constructor of the class specified in the class-name attribute.

One more pointer is use <set ../> tag in simple method and in value tag you
can do all java code use ${groovy: 'post your code here'}
HTH!

Rishi Solanki
Manager, Enterprise Software Developer
HotWax Media Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxmedia.com


On Wed, Apr 14, 2010 at 3:14 AM, Brett Palmer <br...@gmail.com>wrote:

> Does anyone know if it's possible to specify the entity delegator you want
> to use in a simple method instead of using the "default" delegator?
>
> I know you can do it from a Java service but I would like to do it from a
> simple method if possible.
>
> We have an ofbiz application that uses two delegators.  The first delegator
> is the default one and points to a local ofbiz database.  The second
> delegator is use to access a remote ofbiz database.  Simple methods would
> be
> very convenient for us passing data between the two databases.
>
>
> Thanks,
>
>
> Brett
>