History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CARGO-211
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Magnus Grimsell
Reporter: Nigel Magnay
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Cargo

API for implementing merging

Created: 16/Nov/05 10:51 AM   Updated: 30/Mar/06 04:25 AM
Component/s: Module API
Affects Version/s: 0.6
Fix Version/s: 0.7

Time Tracking:
Not Specified

File Attachments: 1. Text File doMerge.patch (34 kb)
2. Text File mergeApi.patch (34 kb)



 Description  « Hide
This is a proposed patch that gives the basis of some classes that could be used to do merging of artefacts (such as War files) beyond the existing merging available in WebXmlMerger.

Basically it consists of an interface - IMergeProcessor - this allows merge processors to be passed artefacts to be merged, and then on performMerge() they would return their merged artefact. So for example a WarArchiveMerger would get passed (and return) WarArchives.

MergeSet is an abstract class that contains 3 sets -
things found just in the left hand side of a merge
things found just in the right hand side of a merge
things found in both sides of a merge (potential conflicts).

In order to perform a merge, a mergeset is passed a MergeStrategy, which is called back (as a visitor) to each node in order to perform the merging. Two examples (Preserve, Overwrite) cover the most common cases. Specific merge functionality can be provided by creating custom strategies and examining the items in question in order to determine what to do.

Two subtypes of MergeSet exist - one that is populated from collections of items (MergeNodeList - NodeLists), and the other from single elements (MergeElement - Elements).

Thoughts?



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Nigel Magnay - 21/Nov/05 05:09 AM
This supercedes the previous patch - I changed the interface IMergeProcessor to follow the correct convention (MergeProcessor dropping the I).

This patch relies on the AbstractNodeList part of the xml patch (think this is -209).


Magnus Grimsell - 23/Nov/05 11:53 AM
Applied patch.

Vincent Massol - 02/Dec/05 03:25 AM
reopening to change the component to "Module API"