|
Document object
Base prototype for all Document objects SyntaxTo create a Document object:
var parameters = new Document.Parameters ( );
var doc = new Document (parameters, "view") Parametersdocument_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 Ofnone. Implemented InECMerge 2.1 DescriptionThe 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. PropertiesProperties of information[side]
NB: there may be additional information for specific
document type, such TextDocument.
Methods
get_statistics
ExamplesExample 1.Creates a document and displays it with focus.
var parameters = new Document.Parameters();
See also
Method loadSyntaxfunction load (url)
Parametersurl. URL object or String. Location of the ECMS or ECMT file. Method OfDocument constructor Implemented InECMerge 2.1 DescriptionLoads an ECMS or ECMT file from a given location, creates the appropriate type of Document for it and returns this document. ExamplesExample 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_statisticsSyntaxfunction Document.get_statistics ( )
Parametersselection. FolderDocument.Select. Specifies the sub-set of folder items for which the statistics are computed. Method OfDocument object, FolderDocument object Implemented InECMerge 2.1 DescriptionComputes the statistics for the document or sub-set of it, and returns a Statistics object describing the result. Examplessee Statistics object examples. See Also
Method is_in_fully_solved_stateSyntaxfunction Document.is_in_fully_solved_state( )
Parametersnone. Method Ofnone. Implemented InECMerge 2.1.75 DescriptionReturns 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. ExamplesExample 1.This simple tells whether the document currently viewed is in fully solved state:
var my_doc = current_frame.coordinator.document;
See Also
Method reloadSyntaxfunction Document.reload (smart, side) Parameterssmart. Boolean. True to get a reload only if specified side
changed. False if reload is systematic. If omitted, true is
implied
Method OfDocument object Implemented InECMerge 2.1 DescriptionReloads the given side in a smart or systematic way. Once the data is reloaded, comparison computations are re-done if necessary. ExamplesExample 1.Reloads forcefully the right side of a document:
var my_doc;
See Also
Methods do_export / do_importSyntaxfunction Document.do_export (format, need_new_name,
questions_answers)
Parametersformat.
Document
Format string. One of the supported document format. For
import, only "unix_patch" is supported currently.
Method OfDocument object Implemented InECMerge 2.1 Descriptiondo_export saves information in the requested format,
following the settings and locations specified in the current
Document.parameters.
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. ExamplesExample 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";
See Also
Method set_parametersSyntaxfunction Document.set_parameters (new_parameters, from_application)
Parametersnew_parameters.
Document.Parameters object. New
parameters which should replace current document parameters
Method OfDocument object Implemented InECMerge 2.4 DescriptionThis function is used to change parameters of the document once it is created. It allows the caller to change input urls, numbers of sources as well as all the comparison and view options. It cannot be used to change the type of document though. ExamplesExample 1.This example demonstrates how to change the kind of patch to generate for the document currently viewed in ECMerge:
See Also
Method synchronize_optionsSyntaxfunction Document.synchronize_options ( replace )
Parametersreplace. Boolean. If not specified or undefined, the question Keep/Replace is asked if necessary. If specified, True accepts application options changes and False provoques the Keep semantic Method OfDocument object Implemented InECMerge 2.2 DescriptionCall this function to ask for the synchronization between the application master copy of an OptionsSet and the one saved in the document. This function is internally called each time a document gets viewed. ExamplesExample 1.Loads a document from a file with a local path, using automatic upgrade from String to URL, then force it to get the options from the application master copy:
var my_doc = Document.load
("/loca/path/website-sync.ecmt");
See Also
|
|||||