2Pack

From ADempiere
Revision as of 17:50, 29 December 2010 by Red1 (Talk) (Useful Llinks)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

2Pack is an application packaging system for ADempiere/Compiere. 2Pack will allow developers and users to easily share their ADempiere/Compiere customizations and data with other ADempiere/Compiere users.

For the best of 2Pack under OSGI HengSin, please see OSGI HengSin/2Pack.

Some History

2Pack is the creation of Robert Klein based on the XML2AD work of Marco Lombardo in which was also improved by Trifon Trifonov with his AD2XML. Carlos Ruiz and Trifon then housed the improvements in a separate project ComXe. During pre-2Pack days, Red1 has written about progress in XML2AD Tutorial

There is an ongoing migration project of 2Pack from Compiere to ADempiere. Carlos Ruiz has finished that as to the latest version and it has been used by several individuals to do Colombian and German Accounting Localisation and Libero Manufacturing packages. To date Tim (xp-prg) has studied it deeply to the extent of maintaining it and extending it to cover the WorkFlow aspects as needed by Libero.

Some Future

  • The roadmap ahead is to extend 2Pack to be a migration tool to handle Karsten's migration scripts but with rollback.
  • Also to migrate any DB scripts again with rollback, which may need an AD_Migration table to manage these.
  • To look at using 2Pack for replication purposes between ADempiere instances. Initial challenge is to overcome Foreign Key IDs and Unique ID constraints in Search Value fields.
    • Unidirectional replication can use 2Pack to export data at satelite instance and then use Import Loader concept at central. [1]
    • This may explores 2Pack to export in CSV format for Import Loaders common master data importing.
    • Also explores Import Loader as replicator with a checkbox whether to overwrite same IDs or morph them as new IDs
    • This idea not favourable to implement as stated in Talk page.

Some Present

  • Note that there has been some wishlist already done as stated in Talk:2Pack.
  • As such the Data Table migration using 2Pack was tested ok and my hope on the Future is not needed as stated above. - Red1
  • Proposing an approach to resolve the Foreign Key issue during runtime by transposing the SearchKeyValue with the given FK_ID.
    • During PackOut we implement a ReturnValueFromID to store the SearchKeyValue instead of the FK_ID which is not guaranteed in target Database.
    • During PackIn we implement a ReturnIDFromValue to replace the SearchKeyValue with the resident FK_ID in the target Database.
    • Will try this approach and submit a patch on it - Red1 06:09, 12 May 2008 (EDT)
      • This is assuming that the SearchKeyValue is unique. However a failure of this will not be fatal. Just some inaccuracy in data that can be easily checked after migration of the tables.
      • The FK table has to be present first in the target DB. If new records then they have to migrated over also.
      • This approach is now not sound as not all data tables have SearchValue fields. Will explore alternative in Talk page. - Red1 06:27, 14 May 2008 (EDT)
      • As Carlos said, he has solved it for PackIn. Its merely PackOut that needs to create the ValueFromID 'lookupname'. We can try implement only in tables that have Value field. - Red1 10:21, 14 May 2008 (EDT)

Foreign Key Issue

  • One way is as shown by Carlos Ruiz where FK IDs are replaced with LookUpNames.
  • I have contributed a patch in SF.
  • It was tested ok for 1 Order record containing an Order header with its OrderLine. Here i link the XMLs to show how the patch work >BEFORE and AFTER. You can click on both of them and switch between each other in your browser to see where the lookupNames replace the Foreign Keys in both tables.
  • Note that here we even do lookup for SalesRep and C_Order_ID as DocumentNo.
  • The test done is basically the transfer of a single Sales Order from one instance to another instance that has already an extra SO so to prove that the difference in IDs doesn't break the FK relations integrity.
  • More are welcome to test the above patch and feedback in the SF thread below before i release the Part III of the Godfather Trilogy on XML2AD with this 2Pack expose. - Red1 05:06, 28 May 2008 (EDT)

Useful Llinks

Discussion Links

Interested?

2Pack is of great open source interest to: