|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XMLMergeDocument
The interface for external modules to perform a three-way merge of an XML
document. It will be called when a version on one branch has to be merged
with a version on another. This decision is taken based on the structure of
the version tree and on the outcome of the XMLTestDifference
module that applies to the document format. Such modules are declared in
/configuration/maps.xml
using the merge
element as
* in the following example:
<merge>
<mime-type>text/xml</mime-type>
<!-- Additional mime-type elements can come here. -->
<!-- Several path elements can come here. -->
<class>
<name>be.re.repo.mod.XMLCopyMerge</name>
<!-- Optional URL relative to maps.xml.
<jar>modules/my_module.jar</jar>
</class>
</merge>
XMLTestDifference
Method Summary | |
---|---|
void |
complete(XMLEventReader in,
XMLEventWriter out,
String mimeType,
Context context)
This method is called to perform completion on the contents of a version when the shouldComplete method returns true . |
boolean |
merge(XMLEventReader base,
XMLEventReader source,
XMLEventReader target,
XMLEventWriter out,
String mimeType,
Context context)
This method calculates the merge and detects possible conflicts. |
boolean |
shouldComplete(String mimeType)
|
boolean |
storeWithConflicts(String mimeType)
|
Method Detail |
---|
void complete(XMLEventReader in, XMLEventWriter out, String mimeType, Context context) throws IOException
shouldComplete
method returns true
. The
method can take into account the conflict resolution actions the user may
have done on the version.
in
- the XML-stream of the version.out
- the XML-stream into which the completed version should be
written.mimeType
- the MIME type of the document.context
- the repository context.
IOException
boolean merge(XMLEventReader base, XMLEventReader source, XMLEventReader target, XMLEventWriter out, String mimeType, Context context) throws IOException, XMLStreamException
base
- the XML-stream of the version that is a common ancestor of
source
and target
in the version tree.source
- the XML-stream of the version on the branch that is to be
merged into the other branch.target
- the XML-stream of the version on the branch into which the
merge is being done.out
- the XML-stream into which the merged result should be
written.mimeType
- the MIME type of the document.context
- the repository context.
true
if the merge is automatic, false
if
there are conflicts.
IOException
XMLStreamException
boolean shouldComplete(String mimeType)
mimeType
- the MIME type of the document.
true
if the contents of the version should be
subjected to a completion process.boolean storeWithConflicts(String mimeType)
mimeType
- the MIME type of the document.
true
if it is OK to store the result despite the
presence of conflicts, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |