Difference between revisions of "Talk:2Pack"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
(Comments from 2Pack Maintainers: some questions to Carlos)
m (Comments from 2Pack Maintainers: found Carlos source)
 
Line 24: Line 24:
 
::Thanks for these back comments to mine. My whole idea is to assist in bringing the bazaar up to date and thus document it. I shall make more study and edit the article - [[User:Red1|Red1]] 18:38, 12 February 2008 (EST)
 
::Thanks for these back comments to mine. My whole idea is to assist in bringing the bazaar up to date and thus document it. I shall make more study and edit the article - [[User:Red1|Red1]] 18:38, 12 February 2008 (EST)
 
::Carlos, i now begin to understand this Lookup for FK ID. So does this means that we need to modify PackIn to replace the Lookup Value with the right ID in the target DB? How is this XML modified to have this Lookup? Can we do it during PackOut? - [[User:Red1|Red1]] 10:00, 14 May 2008 (EDT)
 
::Carlos, i now begin to understand this Lookup for FK ID. So does this means that we need to modify PackIn to replace the Lookup Value with the right ID in the target DB? How is this XML modified to have this Lookup? Can we do it during PackOut? - [[User:Red1|Red1]] 10:00, 14 May 2008 (EDT)
 +
:::I found your code in DataElementHandler.java concerning 'lookupname'. This draws me closer to the answer. Will study it deeper - [[User:Red1|Red1]]
  
 
=Possible future enhancements=
 
=Possible future enhancements=

Latest revision as of 07:12, 14 May 2008

Comments from 2Pack Maintainers

Hi Redhuan, some comments to you assertions on article:

> To look at using 2Pack for replication purposes between
> ADempiere instances. Initial challenge is to overcome
> Unique ID constraints in Search Value fields.

Currently 2Pack can be used to replicate between Adempiere instances, in fact that's the main goal of the program since XML2AD. Initially XML2AD was intended to replicate dictionary forgetting about ID problematic - and Rob extended that in 2pack to replicate any data. - CarlosRuiz
This is great! It is because Tony_tspc raised this in IRC room yesterday to me if any1 is looking into this 2pack issue. And i tot it was an issue. Now i know it is not. I shall try to test it then. - Red1

> Unidirectional replication can use 2Pack to export data at
> satelite and then use Import Loader concept at central.

That must be really easy to do, just convert a SQL to CSV, but I wonder if that's the "wish" - I think is better to replicate XML using PackOut and import XML using Packin (as currently implemented) - what's the value added of Import Loader? IMHO Import Loader is too hardcoded and we must think to replace such tool with another more flexible, possibly improving 2pack. - CarlosRuiz
Converting XML to csv for ImportLoaders to use too is certainly a kind wishlist for many adempiereans as they are more familiar with ImportLoaders.
However, if i get to understand how the PackIn handles this, then i can make a movie to close the learning gap - Red1

> Also explores Import Loader as replicator with a checkbox
> whether to overwrite same IDs or morph them as new IDs

I think this is a need from 2pack, want to document here the current status and possible future enhancements:
- currently you can export with 2pack a SQL statement, it will export ID's for primary and foreign keys
- when importing with PackIn the primary ID's will be replaced in target system and foreign keys are not well managed
- PackIn can manage some extensions not managed by PackOut, this is, you can edit the XML file and convert the foreign keys to the Value, Name or one/two foreign columns. PackIn properly manage this situation, making the lookup to get the foreign ID, look this example of what I'm talking about: [1] that's a PackOut generated XML, edited to manage lookups
- - CarlosRuiz
Thanks for these back comments to mine. My whole idea is to assist in bringing the bazaar up to date and thus document it. I shall make more study and edit the article - Red1 18:38, 12 February 2008 (EST)
Carlos, i now begin to understand this Lookup for FK ID. So does this means that we need to modify PackIn to replace the Lookup Value with the right ID in the target DB? How is this XML modified to have this Lookup? Can we do it during PackOut? - Red1 10:00, 14 May 2008 (EDT)
I found your code in DataElementHandler.java concerning 'lookupname'. This draws me closer to the answer. Will study it deeper - Red1

Possible future enhancements

- Configurable option to make PackOut export ID's or export lookup info
- Configurable option to make PackIn preserve the ID's or find new ones
- I think these options must be defined at the XML package level, not in window

> But remember 2Pack import for data can work if it just handle unique ids

As I showed above, 2pack can manage lookups.

- - CarlosRuiz_globalqss 11:48, 12 February 2008 (EST)