123. XXE.open

Parameter syntax:

[ '[readOnly]' ]?
[ 
  '[reopen]' | 
  '[reopenIfNewer]' |
  ('[checkIsOpened]' S file_name_or_URL) |
  file_name_or_URL 
]?

Opens a document in XXE.

Without a parameter, this command displays the file chooser dialog box to let the user specify which document to open.

Parameters:

[readOnly]

This parameter is a modifier which allows to open in read-only mode the document specified by the other parameters.

[reopen]

Reopens document currently opened in XXE. Useful to implement a ``revert to saved'' command.

[reopenIfNewer]

Reopens document currently opened in XXE, but only if it has been modified by an external application.

If the document currently opened in XXE has not been modified by an external application, this command does nothing at all, succeeds and returns current com.xmlmind.xml.doc.Document.

Note that this option works exactly like [reopen] if the document is stored on a HTTP or FTP server. That is, XXE will only check the dates of local files.

[checkIsOpened]

The command cannot be executed unless specified document has been opened in XXE. If specified document is already opened in XXE, this command just returns it (a com.xmlmind.xml.doc.Document object) which may be useful to write higher-level commands.

file_name_or_URL

Opens specified document.

Returns CommandResult.DONE having newly opened com.xmlmind.xml.doc.Document as its value (for use by higher-level commands), CommandResult.FAILED if specified document cannot be opened or CommandResult.CANCELED if user has canceled the command.

See XXE.save for an example of use for this command.