Porting OpenbravoMQ.jar to iDempiere

2011-09-28
2013-03-07
  • Redhuan D. Oon
    Redhuan D. Oon
    2011-09-28

    I am asking Mike and Mark from Makati to look at the above that i just did and uploaded to SVN. To try to make the adempiere package above as another OSGi bundle in our such implementation of it called iDempiere as done by Hengsin.

    You can compare between equal codebase adempiere361 by Carlos Ruiz  and the Hengsin version, both in Kenai repository.

    You can check out by hg mercurial into your Eclipse or IDE.

    Carlos already just port over a new bundle which is my recently enhanced JavaPOS. So you can see the recent activity (oh oh.. its not a new bundle but he inject my code probably into the previous BASE / POS bundle).. so u have to try to look at other bundles to compare to get an idea.

     
  • Redhuan D. Oon
    Redhuan D. Oon
    2011-10-06

    I have asked the super master about OSGi plugin and he replied below:

    Create your process as an extension as documented here - http://hengsin.googlecode.com/hg/doc/extension/Process.html ( The priority attribute is missing there. Anyway, Eclipse will show you that when you define your extension ).

    You can use either the priority value to ensure your version of implementation is use or create a new version, say OBImportOrder and use 2pack or sqlscript to update the process definition to refer to your class.

    A probably better approach but more time consuming would be to extend the ImportOrder process with extension or event hook that you can plugin to achieve what you need.

    Regards,
    Low

    On 5 October 2011 13:10, red1 <red1@red1.org> wrote:

        Thanks for the advice and i think i got what u mean as i will try to explain what i did. In OB POS integration i override ImportOrder.java as in the forum http://red1.org/adempiere/viewtopic.php?f=29&t=1356#p6686

        "After exporting the sales to the ERP, and processing the imports allow us to see the stock movement reflected in the Product Info panel. However i discovered a flaw in all the ImportOrders. They should not import IDs but Name or SearchValues and an IDLookUp be done instead. Thus the Warehouse_ID field is not useful as the POS ID is not a PK ID but a real name such as Store Central. Such a name field is not set in I_Order window nor table."

        So, should i map Import classes into a bundle interface and extend it for use here?

        On 10/5/11 10:40 AM, Heng Sin Low wrote:

            At the moment, all the bundle doesn't allow direct classes override like what we all have been doing using customization.jar and patches.jar. It can be implemented like it is pointed out here - http://wiki.eclipse.org/FAQ_Can_fragments_be_used_to_patch_a_plug-in%3F but none of the bundle have that implemented at the moment. What classes you have override ? I would recommend to investigate on possibilities of doing the same without any overriding of classes. If needed, we can add extension, event hook or new api for that. The other alternative would be to clone the bundle that you want to change, make your changes and install it as a slightly newer version. Not recommended unless you have to make extensive customization to the bundle.

            You can package the migration script as 2pack package ( see org.adempiere.plugin.utils/AdempiereActivator ), store it as /META-INF/2Pack.zip in your bundle and it will be installed the first time your bundle is started.

            Regards,
            Low

    On 5 October 2011 08:12, red1 <red1@red1.org> wrote:

        Heng Sin,
    like to ask how it is best to convert a package i.e the OB POS addon i did as a separate bundle on iDempiere? The OB POS for ADempiere side is just some migration scripts and classes override.