You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Georg Potthast <no...@georgpotthast.de> on 2020/11/01 20:41:31 UTC

How to return to a previous plugin version?

For testing I create a plugin, e.g. mytest: “gradlew 
createPlugin -PpluginId=mytest”. To be able to fall back to a working 
version, I frequently copy this plugin directory to e.g. mytest-1, mytest-2 
etc. When I decide to use the mytest-1 directory again, I rename the 
directory I am currently working with to mytest-current and copy mytest-1 to 
mytest. Then I restart ofbiz and expect that to work with this mytest 
directory.

However, OFBiz seems to continue to work with the former current directory. 
E.g. I have made three menu items in mytest-current while I had just two 
menu items in the older mytest-1 directory. After copying the mytest-1 
directory to mytest and restarting OFBiz, I still have three menu items 
displayed although there should be only two.

What could be the reason for this and what do I have to do to properly fall 
back to the state of mytest-1? 


Re: How to return to a previous plugin version?

Posted by Georg Potthast <no...@georgpotthast.de>.
Thank you Aditya and Michael,

I worked with various versions of the same plugin. So I had several mytest* 
plugins in the plugin directory with the same mount point in the 
ofbiz-component.xml file. I did not remember that OFBiz runs through all 
directories and reads the ofbiz-component.xml files for each.

Now I moved all the directories I made for backup into a directory outside 
of the ofbiz directory. Now it works as far as I can tell. I use WinMerge to 
compare the directories for changes.

Georg

-----Ursprüngliche Nachricht----- 
From: Michael Brohl
Sent: Monday, November 2, 2020 6:36 PM
To: user@ofbiz.apache.org
Subject: Re: How to return to a previous plugin version?

Additionally, I'd recommend putting a component-load.xml in the plugins
directory where you can specify which plugin(s) should be loaded and in
which order.

For a quick change, simply comment out the plugins you do not need and
restart ofbiz.

component-load.xml

<component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/component-loader.xsd">
    <load-component component-location="mytest"/>
    <load-component component-location="mytest-2"/>
   <!-- <load-component component-location="mytest-current"/> -->
</component-loader>

You should be able to see the loading of your plugin(s) in the log like
this:

2020-11-02 14:56:23,028 |main |CatalinaContainer             |I|
Creating context [mytest]


Best regards,

Michael Brohl

ecomify GmbH - www.ecomify.de


Am 02.11.20 um 07:19 schrieb Aditya Sharma:
> Hi Georg,
>
> What I suspect with a cursory reading is as you made a replica the values
> of mount point etc may be the same
> https://github.com/apache/ofbiz-plugins/blob/trunk/ecommerce/ofbiz-component.xml#L55
>
> As you are new to OFBiz, I would recommend using the Gradle task to create
> a new plugin instead of replicating it.
>
> if you just want to play with it with various versions of same plugin. I
> would recommend you is to initialise plugin as a local git repo and create
> separate branches for drastic changes. This way it would easy to track the
> changes also.
> https://git-scm.com/docs/git-init
>
> HTH
>
> Thanks and Regards,
> Aditya Sharma
>
> On Mon, Nov 2, 2020 at 2:11 AM Georg Potthast <no...@georgpotthast.de>
> wrote:
>
>> For testing I create a plugin, e.g. mytest: “gradlew
>> createPlugin -PpluginId=mytest”. To be able to fall back to a working
>> version, I frequently copy this plugin directory to e.g. mytest-1,
>> mytest-2
>> etc. When I decide to use the mytest-1 directory again, I rename the
>> directory I am currently working with to mytest-current and copy mytest-1
>> to
>> mytest. Then I restart ofbiz and expect that to work with this mytest
>> directory.
>>
>> However, OFBiz seems to continue to work with the former current
>> directory.
>> E.g. I have made three menu items in mytest-current while I had just two
>> menu items in the older mytest-1 directory. After copying the mytest-1
>> directory to mytest and restarting OFBiz, I still have three menu items
>> displayed although there should be only two.
>>
>> What could be the reason for this and what do I have to do to properly
>> fall
>> back to the state of mytest-1?
>>
>>


Re: How to return to a previous plugin version?

Posted by Michael Brohl <mi...@ecomify.de>.
Additionally, I'd recommend putting a component-load.xml in the plugins 
directory where you can specify which plugin(s) should be loaded and in 
which order.

For a quick change, simply comment out the plugins you do not need and 
restart ofbiz.

component-load.xml

<component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/component-loader.xsd">
     <load-component component-location="mytest"/>
     <load-component component-location="mytest-2"/>
    <!-- <load-component component-location="mytest-current"/> -->
</component-loader>

You should be able to see the loading of your plugin(s) in the log like 
this:

2020-11-02 14:56:23,028 |main |CatalinaContainer             |I| 
Creating context [mytest]


Best regards,

Michael Brohl

ecomify GmbH - www.ecomify.de


Am 02.11.20 um 07:19 schrieb Aditya Sharma:
> Hi Georg,
>
> What I suspect with a cursory reading is as you made a replica the values
> of mount point etc may be the same
> https://github.com/apache/ofbiz-plugins/blob/trunk/ecommerce/ofbiz-component.xml#L55
>
> As you are new to OFBiz, I would recommend using the Gradle task to create
> a new plugin instead of replicating it.
>
> if you just want to play with it with various versions of same plugin. I
> would recommend you is to initialise plugin as a local git repo and create
> separate branches for drastic changes. This way it would easy to track the
> changes also.
> https://git-scm.com/docs/git-init
>
> HTH
>
> Thanks and Regards,
> Aditya Sharma
>
> On Mon, Nov 2, 2020 at 2:11 AM Georg Potthast <no...@georgpotthast.de>
> wrote:
>
>> For testing I create a plugin, e.g. mytest: “gradlew
>> createPlugin -PpluginId=mytest”. To be able to fall back to a working
>> version, I frequently copy this plugin directory to e.g. mytest-1,
>> mytest-2
>> etc. When I decide to use the mytest-1 directory again, I rename the
>> directory I am currently working with to mytest-current and copy mytest-1
>> to
>> mytest. Then I restart ofbiz and expect that to work with this mytest
>> directory.
>>
>> However, OFBiz seems to continue to work with the former current
>> directory.
>> E.g. I have made three menu items in mytest-current while I had just two
>> menu items in the older mytest-1 directory. After copying the mytest-1
>> directory to mytest and restarting OFBiz, I still have three menu items
>> displayed although there should be only two.
>>
>> What could be the reason for this and what do I have to do to properly
>> fall
>> back to the state of mytest-1?
>>
>>


Re: How to return to a previous plugin version?

Posted by Aditya Sharma <ad...@apache.org>.
Hi Georg,

What I suspect with a cursory reading is as you made a replica the values
of mount point etc may be the same
https://github.com/apache/ofbiz-plugins/blob/trunk/ecommerce/ofbiz-component.xml#L55

As you are new to OFBiz, I would recommend using the Gradle task to create
a new plugin instead of replicating it.

if you just want to play with it with various versions of same plugin. I
would recommend you is to initialise plugin as a local git repo and create
separate branches for drastic changes. This way it would easy to track the
changes also.
https://git-scm.com/docs/git-init

HTH

Thanks and Regards,
Aditya Sharma

On Mon, Nov 2, 2020 at 2:11 AM Georg Potthast <no...@georgpotthast.de>
wrote:

> For testing I create a plugin, e.g. mytest: “gradlew
> createPlugin -PpluginId=mytest”. To be able to fall back to a working
> version, I frequently copy this plugin directory to e.g. mytest-1,
> mytest-2
> etc. When I decide to use the mytest-1 directory again, I rename the
> directory I am currently working with to mytest-current and copy mytest-1
> to
> mytest. Then I restart ofbiz and expect that to work with this mytest
> directory.
>
> However, OFBiz seems to continue to work with the former current
> directory.
> E.g. I have made three menu items in mytest-current while I had just two
> menu items in the older mytest-1 directory. After copying the mytest-1
> directory to mytest and restarting OFBiz, I still have three menu items
> displayed although there should be only two.
>
> What could be the reason for this and what do I have to do to properly
> fall
> back to the state of mytest-1?
>
>