Call us at +1 586 62 ELLIE Office Opened
sales@elliecomputing.com

Newsletter
Keep up to date with the new features added to ECMerge, the new products that we release and receive special offers! (approx. once a month):
HTML version
Text version
Beta Test - Free licence
WeblogRSS 2.0
Testimonials

NewsRSS 2.0
December 12th, 2008: We just released ECMerge 2.2 beta. This version introduces several new features, from which the Launcher, automatic session, shared options, file types and numerous improvements.

November 21st, 2008: We just parametered ECMerge for a new converter (ExifTool) which extracts metadata from a large number of files types (exe, images, audio, video...), find all the need info on the converters page.
               

Document object

 

 

Base prototype for all Document objects

Syntax

To create a Document object:

var parameters = new Document.Parameters ( );
parameters.left.url = "c:\\temp\\plouf"
parameters.right.url = "c:\\temp\\plouf2"
parameters.gui_type = "diff2";
parameters.object_type = "folders";

var doc = new Document (parameters, "view")

Parameters

document_parameters. Documents.Parameters object. Describes all the sources of data, the mode of comparison and the various settings to use

activity. Document Activity string. Purpose of the document. In combination with the options, it helps to determine exactly which type of comparison is appropriate given the sources of data

Property Of

none.

Implemented In

ECMerge 2.1

Description

The Document object is ECMerge object.

It is the central object of ECMerge, it realizes the comparison operation, load and saves data. It lets you study the comparison results.

Properties

Property Description
 parameters Documents.Parameters object. Current parameters for this Document object. This member cannot be modified in place, it must be cloned with doc.parameters.clone( ) then set with doc.parameters = new_parameters
 content Collection of data, indexed per Side string. Read-Only. Not all documents provide such contents see each particular type.

Methods

load

get_statistics
is_in_fully_solved_state
reload
do_import
do_export 

Examples

Example 1.

Creates a document and displays it with focus.

var parameters = new Document.Parameters();
parameters.left.url = "c:\\temp\\plouf"
parameters.right.url = "c:\\temp\\plouf2"

var doc = new Document (parameters);

add_view (doc, true);

See also

Documents.Parameters object, Document Activity string

Method load

Syntax

function load (url)
returns a Document derived object

Parameters

url. URL object or String. Location of the ECMS or ECMT file.

Method Of

Document constructor

Implemented In

ECMerge 2.1

Description

Loads an ECMS or ECMT file from a given location, creates the appropriate type of Document for it and returns this document.

Examples

Example 1.

Loads a document from a file with a local path, using automatic upgrade from String to URL:

var my_doc = Document.load ("/loca/path/website-sync.ecmt");

Method get_statistics

Syntax

function Document.get_statistics ( )
function FolderDocument.get_statistics (selection)
returns a Statistics object

Parameters

selection. FolderDocument.Select. Specifies the sub-set of folder items for which the statistics are computed.

Method Of

Document object, FolderDocument object

Implemented In

ECMerge 2.1

Description

Computes the statistics for the document or sub-set of it, and returns a Statistics object describing the result.

Examples

see Statistics object examples.

See Also

Document object, FolderDocument object, Statistics object

 

Method is_in_fully_solved_state

Syntax

function Document.is_in_fully_solved_state( )
returns a boolean

Parameters

 none.

Method Of

none.

Implemented In

ECMerge 2.1.75

Description

Returns true when the document is fully solved. This is the case all the data are neither in conflict nor un-written (for folders). Basically, after a merge operation, it means that everything is OK.

Examples

Example 1.

This simple tells whether the document currently viewed is in fully solved state: 

var my_doc = current_frame.coordinator.document;
alert (my_doc.is_in_fully_solved_state() ? "totally solved" : "some conflicts are there or things remain to be written");

See Also 

 Document object, FolderDocument object

Method reload

Syntax

function reload (smart, side)

Parameters

smart. Boolean. True to get a reload only if specified side changed. False if reload is systematic. If omitted, true is implied
side. Side String or undefined. Side of the comparison to reload. If undefined or omitted, all the sides used in the comparison or viewer are/is reloaded.

Method Of

Document object

Implemented In

ECMerge 2.1

Description

Reloads the given side in a smart or systematic way. Once the data is reloaded, comparison computations are re-done if necessary.

Examples

Example 1.

Reloads forcefully the right side of a document:

var my_doc;
my_doc.reload (false, "right");

See Also

Document object

Methods do_export / do_import

Syntax

function do_export (format, need_new_name, questions_answers)
function do_import (format, need_new_name, questions_answers)

Parameters

format. Document Format string. One of the supported document format. For import, only "unix_patch" is supported currently.
need_new_name. Boolean or undefined. True if you want the UI to be displayed, false if you do not want the UI to be displayed. If undefined or omitted, Ellié Computing Merge takes the decision whether a UI should be displayed.
questions_answers. Questions/Answers string. Gives pre-established answers to known UI questions, allowing you to avoid messages boxes.

Method Of

Document object

Implemented In

ECMerge 2.1

Description

do_export saves information in the requested format, following the settings and locations specified in the current Document.parameters.
do_import imports information, following the same logic.

The Document.Parameters object contains an OptionsSet member called 'settings' which in turn contains under 'export' namespace many options which are used during the import or export operation.

NB: a 4th parameter may be later added, which would specify the actual sub-set of options or an OptionsSet distinct from Document.parameters.settings, making the call more practical.

Examples

Example 1.

Loads a document from a file with a local path, then exports an XML reports for it at specified location:

var report_target_location = "/tmp/test.xml";
var doc = Document.load ("/loca/path/website-sync.ecmt");

var doc_parameters = doc.parameters.clone ();
doc_parameters.settings["export.xml_export.to.location"].url = report_target_location;
doc_parameters.settings["export.xml_export.embed_file_reports"] = true;
doc_parameters.settings["export.xml_export.sub_reports_format"] = "xml";
log (doc_parameters.settings);
doc.parameters = doc_parameters;
 
// generate the XML report
try {
    doc.do_export ("xml", false);
}
catch (err) {
     log (err);
}

See Also

Document object, Document.Parameters object, OptionsSet object, Questions/Answers string

 

Select your language English Français
© Ellié Computing 2004-2009 - Legal information - Resources