Upgrading to 12.x

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

Upgrading to 12.x

SkipDever
I am upgrading from Ofbiz 9.x to 12.x.  I have two questions

1.  Do I HAVE to change all all my bsh to groovy.  I know how to do it.  Its
just that I have a thousand or so bsh scripts and would like to do them
later.

2.  Some time before 10.04.02, many GenericDelegator functions have been
removed.  These include several flavors of findByAnd,
FindListIteratorByCondition, etc.  Can someone tell me where they were
deprecated at to I can look at the comments as to which functions to use as
replacements?

Thanks
Skip

Reply | Threaded
Open this post in threaded view
|

Re: Upgrading to 12.x

Adrian Crum-3
On 4/23/2013 11:05 PM, Skip wrote:
> I am upgrading from Ofbiz 9.x to 12.x.  I have two questions
>
> 1.  Do I HAVE to change all all my bsh to groovy.  I know how to do it.  Its
> just that I have a thousand or so bsh scripts and would like to do them
> later.

No. I think initially we just renamed all the bsh files to groovy, then
updated the contents of the files later.

>
> 2.  Some time before 10.04.02, many GenericDelegator functions have been
> removed.  These include several flavors of findByAnd,
> FindListIteratorByCondition, etc.  Can someone tell me where they were
> deprecated at to I can look at the comments as to which functions to use as
> replacements?

The concrete GenericDelegator class was extracted to the Delegator
interface (the original DelegatorInterface was never used). You can look
in the interface code for notes like "NOTE 20080502" - these are notes
David left when he was refactoring the API. Basically, the cache flavors
of the find methods were replaced with a single method that takes a
boolean to indicated get from cache or not.

-Adrian

Reply | Threaded
Open this post in threaded view
|

Re: Upgrading to 12.x

Ruth Hoffman-2
In reply to this post by SkipDever
Hi Skip:
Having gone through this exercise several times, here is my opinion
about what to do:
On 4/23/13 6:05 PM, Skip wrote:
> I am upgrading from Ofbiz 9.x to 12.x.  I have two questions
>
> 1.  Do I HAVE to change all all my bsh to groovy.  I know how to do it.  Its
> just that I have a thousand or so bsh scripts and would like to do them
> later.
No. I resisted this change for a long time. I preferred the error
messages returned by the BeanShell as - many times - they were more
instructive then those now returned by the Groovy implementation. Turns
out, in almost all cases all you need to do is change the name of the
file to have a .groovy extension. Of course, every place you reference
it, you have to change that name as well.
>
> 2.  Some time before 10.04.02, many GenericDelegator functions have been
> removed.  These include several flavors of findByAnd,
> FindListIteratorByCondition, etc.  Can someone tell me where they were
> deprecated at to I can look at the comments as to which functions to use as
> replacements?
What you have to change is GenericDelegator to Delegator in your code.
The findByAnd and FindListIteratorByCondition methods are still
supported. In fact, I see many uses of findByAnd in 12.x Freemarker
templates - of all places. (Probably because it is easier to use then
the "replacement" findList method.)

So, there are really 2 things going on here - one of which you will need
to address to upgrade:

- Change the GenericDelegator to Delegator

- (Optionally) change findByAnd... to "findList" and
FindListIteratorByCondition to "find"

Checkout the OFBiz Javadocs if you need more info on how to use the
delegator.findList and delegator.find methods:

http://ci.apache.org/projects/ofbiz/site/javadocs

Hope that helps.
Ruth
> Thanks
> Skip
>
>

Reply | Threaded
Open this post in threaded view
|

RE: Upgrading to 12.x

SkipDever
Thanks Ruth and Adrian.

A final question, do I have to rename .bsh to .groovy.  Not hard to do that,
but several thousand references in .xml files will take some time.  I ask
this because I see that a beanshell container is still there.

Skip

-----Original Message-----
From: Ruth Hoffman [mailto:[hidden email]]
Sent: Wednesday, April 24, 2013 6:39 AM
To: [hidden email]
Subject: Re: Upgrading to 12.x


Hi Skip:
Having gone through this exercise several times, here is my opinion
about what to do:
On 4/23/13 6:05 PM, Skip wrote:
> I am upgrading from Ofbiz 9.x to 12.x.  I have two questions
>
> 1.  Do I HAVE to change all all my bsh to groovy.  I know how to do it.
Its
> just that I have a thousand or so bsh scripts and would like to do them
> later.
No. I resisted this change for a long time. I preferred the error
messages returned by the BeanShell as - many times - they were more
instructive then those now returned by the Groovy implementation. Turns
out, in almost all cases all you need to do is change the name of the
file to have a .groovy extension. Of course, every place you reference
it, you have to change that name as well.
>
> 2.  Some time before 10.04.02, many GenericDelegator functions have been
> removed.  These include several flavors of findByAnd,
> FindListIteratorByCondition, etc.  Can someone tell me where they were
> deprecated at to I can look at the comments as to which functions to use
as
> replacements?
What you have to change is GenericDelegator to Delegator in your code.
The findByAnd and FindListIteratorByCondition methods are still
supported. In fact, I see many uses of findByAnd in 12.x Freemarker
templates - of all places. (Probably because it is easier to use then
the "replacement" findList method.)

So, there are really 2 things going on here - one of which you will need
to address to upgrade:

- Change the GenericDelegator to Delegator

- (Optionally) change findByAnd... to "findList" and
FindListIteratorByCondition to "find"

Checkout the OFBiz Javadocs if you need more info on how to use the
delegator.findList and delegator.find methods:

http://ci.apache.org/projects/ofbiz/site/javadocs

Hope that helps.
Ruth
> Thanks
> Skip
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Upgrading to 12.x

Ruth Hoffman-2
Hi Skip:
If you don't want to use Groovy, then do not change your file name
extensions from .bsh to .groovy. Everything should work just like it did
before without ever changing anything.

If you want to move to using Groovy, you can upgrade gradually. I ended
up converting a few files at a time.

Good Luck
Ruth
On 4/24/13 12:19 PM, Skip wrote:

> Thanks Ruth and Adrian.
>
> A final question, do I have to rename .bsh to .groovy.  Not hard to do that,
> but several thousand references in .xml files will take some time.  I ask
> this because I see that a beanshell container is still there.
>
> Skip
>
> -----Original Message-----
> From: Ruth Hoffman [mailto:[hidden email]]
> Sent: Wednesday, April 24, 2013 6:39 AM
> To: [hidden email]
> Subject: Re: Upgrading to 12.x
>
>
> Hi Skip:
> Having gone through this exercise several times, here is my opinion
> about what to do:
> On 4/23/13 6:05 PM, Skip wrote:
>> I am upgrading from Ofbiz 9.x to 12.x.  I have two questions
>>
>> 1.  Do I HAVE to change all all my bsh to groovy.  I know how to do it.
> Its
>> just that I have a thousand or so bsh scripts and would like to do them
>> later.
> No. I resisted this change for a long time. I preferred the error
> messages returned by the BeanShell as - many times - they were more
> instructive then those now returned by the Groovy implementation. Turns
> out, in almost all cases all you need to do is change the name of the
> file to have a .groovy extension. Of course, every place you reference
> it, you have to change that name as well.
>> 2.  Some time before 10.04.02, many GenericDelegator functions have been
>> removed.  These include several flavors of findByAnd,
>> FindListIteratorByCondition, etc.  Can someone tell me where they were
>> deprecated at to I can look at the comments as to which functions to use
> as
>> replacements?
> What you have to change is GenericDelegator to Delegator in your code.
> The findByAnd and FindListIteratorByCondition methods are still
> supported. In fact, I see many uses of findByAnd in 12.x Freemarker
> templates - of all places. (Probably because it is easier to use then
> the "replacement" findList method.)
>
> So, there are really 2 things going on here - one of which you will need
> to address to upgrade:
>
> - Change the GenericDelegator to Delegator
>
> - (Optionally) change findByAnd... to "findList" and
> FindListIteratorByCondition to "find"
>
> Checkout the OFBiz Javadocs if you need more info on how to use the
> delegator.findList and delegator.find methods:
>
> http://ci.apache.org/projects/ofbiz/site/javadocs
>
> Hope that helps.
> Ruth
>> Thanks
>> Skip
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

RE: Upgrading to 12.x

SkipDever
In reply to this post by Ruth Hoffman-2
Thanks Ruth

Skip

-----Original Message-----
From: Ruth Hoffman [mailto:[hidden email]]
Sent: Wednesday, April 24, 2013 6:39 AM
To: [hidden email]
Subject: Re: Upgrading to 12.x


Hi Skip:
Having gone through this exercise several times, here is my opinion
about what to do:
On 4/23/13 6:05 PM, Skip wrote:
> I am upgrading from Ofbiz 9.x to 12.x.  I have two questions
>
> 1.  Do I HAVE to change all all my bsh to groovy.  I know how to do it.
Its
> just that I have a thousand or so bsh scripts and would like to do them
> later.
No. I resisted this change for a long time. I preferred the error
messages returned by the BeanShell as - many times - they were more
instructive then those now returned by the Groovy implementation. Turns
out, in almost all cases all you need to do is change the name of the
file to have a .groovy extension. Of course, every place you reference
it, you have to change that name as well.
>
> 2.  Some time before 10.04.02, many GenericDelegator functions have been
> removed.  These include several flavors of findByAnd,
> FindListIteratorByCondition, etc.  Can someone tell me where they were
> deprecated at to I can look at the comments as to which functions to use
as
> replacements?
What you have to change is GenericDelegator to Delegator in your code.
The findByAnd and FindListIteratorByCondition methods are still
supported. In fact, I see many uses of findByAnd in 12.x Freemarker
templates - of all places. (Probably because it is easier to use then
the "replacement" findList method.)

So, there are really 2 things going on here - one of which you will need
to address to upgrade:

- Change the GenericDelegator to Delegator

- (Optionally) change findByAnd... to "findList" and
FindListIteratorByCondition to "find"

Checkout the OFBiz Javadocs if you need more info on how to use the
delegator.findList and delegator.find methods:

http://ci.apache.org/projects/ofbiz/site/javadocs

Hope that helps.
Ruth
> Thanks
> Skip
>
>