Platform Built-in Command Reference

This chapter explains the platform built-in commands.

1. Overview

This section provides an overview of the platform built-in commands.

1.1. Features and Usage

The platform built-in commands are provided with the platform that executes VC.

You can add commands to the platform by providing their plug-ins. Therefore, you must identify the module that provides the command when executing it. To identify the module, you use the namespace.

When you write a command in your XVCD, you must explicitly identify the to namespace to which it belongs. It requires you to use QName to represent the name of any command provided with the platform or plug-ins. Command names without a namespace prefix are used locally in the document.

1.2. Namespace URI Reference

The namespace URI reference for the platform built-in commands is http://xmlns.xfytec.com/command. In the descriptions below, we use command: as the namespace prefix to describe every platform built-in command.

Also, we use the following namespaces and their prefixes in the descriptions below.

  • VC Core
    We use xvcd: as the namespace prefix. For more information, see the VC Core Reference.
  • Platform Command Instruction
    We use instruction: as the namespace prefix. For more information, see the Platform Command Instruction Reference.

2. Platform Built-in Commands

This section explains each platform built-in command by its type.

2.1. File Commands

Commands for file are listed below.

command:open Command

Opens a document in a new window.

Parameter:
string command:url

Specify a file to load with encoded URL.

If it is omitted, the dialog for file selection is displayed to select the loading file.

command:reload Command

Reloads the currently opened document.

Parameter:
string command:encoding

Specifies the encoding for the document. This is set to the string representing the encoding. If set to default, the encoding is inferred from the MIME type of the file or the contents of the document.

If omitted, the document is reloaded with the current encoding.

command:save command

Saves the currently opened document.

Parameter:
string command:save-as

Specify whether to save as or not. This can be a string. If set to "true", the file selection dialog box opens. The document is saved as the file name specified in the dialog box, if necessary. If you set "false", the document is saved into the same document.

If omitted, "false" is assumed to be set.

command:close Command

Closes the window. If there are any modified but not saved documents when the window is being closed, the behavior of the command depends upon the property settings in the xfy technology user agent.

Parameter:

No parameter.

command:exit Command

Closes all documents opened by xfy technology user agent and terminates the xfy technology user agent. If there are any modified but not saved documents when the window is being closed, the behavior of the command depends upon the property settings in the xfy technology user agent.

Parameter:

No parameter.

2.2. View Commands

Commands for display are listed below.

command:change-vocabulary Command

Changes a view to the vocabulary service specified by the parameter.

The vocabulary service to be changed is specified using QName, or namespace URI and local name. If all parameters are omitted, the vocabulary service is changed to the one first displayed when the XML document is opened.

Parameter:
string command:vocabulary-name

Specifies the vocabulary service to be used with the vocabulary name used by the vocabulary service. It can be QName. If the specified value is not QName, the vocabulary names are searched on the assumption that the local name of the vocabulary is specified in string.

If omitted, a value is assumed to be not specified.

string command:vocabulary-name-ns

Specifies the namespace URI reference to which the vocabulary service refers in URI string.

If omitted, a value is assumed to be not specified.

string command:vocabulary-name-local

Specifies the local name to which the vocabulary service refers in string.

If omitted, a value is assumed to be not specified.

command:backward Command

Moves to the previous document while navigating through documents using their links.

Parameter:

No parameter.

command:forward Command

Moves to the next document while navigating through documents using their links.

Parameter:

No parameter.

command:upward Command

Moves to the parent directory.

Parameter:

No parameter.

command:home Command

Displays the document configured as the home page.

Parameter:

No parameter.

command:source Command

Displays the source text of the currently opened document.

Parameter:

No parameter.

2.3. Edit Commands

Commands for edit are listed below.

command:undo Command

Reverses the last edit operation.

Parameter:

No parameter.

command:redo Command

Performs the last reversed edit operation again.

Parameter:

No parameter.

command:move-point Command

Moves the caret to the coordinates of the screen specified with the parameters below.

Parameter:
number command:screen-x

Specifies the x coordinate to move the caret to. The coordinates of the top left corner of the canvas are (0,0).

number command:screen-y

Specifies the y coordinate to move the caret to. The coordinates of the top left corner of the canvas are (0,0).

boolean command:selecting

Specify whether to move caret with selecting a range or without. This can be a true/false value.

true
The caret is moved with selection.
false
The caret is moved without selection.

If omitted, false is assumed to be specified.

command:move-right Command

Moves the caret to the right.

Parameter:
string command:unit

Specifies the unit to move the caret by. This can be specified with one of the following strings.

character
Moves the caret by characters.
word
Moves the caret by words.
node
Moves the caret by nodes.

If omitted, character is assumed to be specified.

boolean command:selecting

Specify whether to move caret with selecting a range or without. This can be a true/false value.

true
The caret is moved with selection.
false
The caret is moved without selection.

If omitted, false is assumed to be specified.

command:move-left Command

Moves the caret to the left.

Parameter:
string command:unit

Specifies the unit to move the caret by. This can be specified with one of the following strings.

character
Moves the caret by characters.
word
Moves the caret by words.
node
Moves the caret by nodes.

If omitted, character is assumed to be specified.

boolean command:selecting

Specify whether to move caret with selecting a range or without. This can be a true/false value.

true
The caret is moved with selection.
false
The caret is moved without selection.

If omitted, false is assumed to be specified.

command:move-up Command

Moves the caret upward.

Parameter:
boolean command:selecting

Specify whether to move caret with selecting a range or without. This can be a true/false value.

true
The caret is moved with selection.
false
The caret is moved without selection.

If omitted, false is assumed to be specified.

command:move-down Command

Moves the caret downward.

Parameter:
boolean command:selecting

Specify whether to move caret with selecting a range or without. This can be a true/false value.

true
The caret is moved with selection.
false
The caret is moved without selection.

If omitted, false is assumed to be specified.

command:move-home Command

Moves the caret to the top of the moving unit.

Parameter:
string command:unit

Specifies the unit to move the caret by. This can be specified with one of the following strings.

character
Moves the caret by characters.
word
Moves the caret by words.
node
Moves the caret by nodes.
line
Moves the caret by lines.

If omitted, character is assumed to be specified.

boolean command:stop-home-end

Specifies whether or not to stop the caret at the top of the moving unit that contains the current position. If set to true, the caret stops at the head of the current moving unit.

If omitted, moves the caret at the top of previous moving unit.

boolean command:selecting

Specify whether to move caret with selecting a range or without. This can be a true/false value.

true
The caret is moved with selection.
false
The caret is moved without selection.

If omitted, false is assumed to be specified.

command:move-end Command

Moves the caret to the end of the moving unit.

Parameter:
string command:unit

Specifies the unit to move the caret by. This can be specified with one of the following strings.

character
Moves the caret by characters.
word
Moves the caret by words.
node
Moves the caret by nodes.
line
Moves the caret by lines.

If omitted, character is assumed to be specified.

boolean command:stop-home-end

Specifies whether or not to stop the caret at the end of the moving unit that contains the current position. If set to true, the caret stops at the end of the current moving unit.

If omitted, moves the caret to the end of next moving unit.

boolean command:selecting

Specify whether to move caret with selecting a range or without. This can be a true/false value.

true
The caret is moved with selection.
false
The caret is moved without selection.

If omitted, false is assumed to be specified.

command:select Command

Selects an object at the current caret position.

Parameter:
string command:unit

Specifies the unit to select an object by. This can be specified with one of the following strings.

character
Makes selection by characters.
word
Makes selection by words.
node
Makes selection by nodes.
line
Makes selection by lines.

If omitted, character is assumed to be specified.

2.4. Bookmark Commands

Commands for bookmarks are listed below.

command:add-bookmark Command

Adds a bookmark for the currently opened document.

Parameter:

No parameter.

command:remove-bookmark Command

Removes the bookmark for the currently opened document.

Parameter:

No parameter.

command:edit-bookmark Command

Edits the bookmarks.

Parameter:

No parameter.

2.5. Tool Commands

Commands for tools are listed below.

command:transformed-document-writer Command

Saves the destination document to be saved for the currently opened document if it is converted to display by VC.

This command is available when xfy Developer's Toolkit is installed.

Parameter:
string command:save-url

Specify the encoded URL to save the destination document to.

If omitted, dialog box to select a document to save is displayed.

string command:document-type

Specifies the save format. This can be a string. If html is set, the save format is HTML. Otherwise, the save format is XML.

If omitted, the save format is XML format.

2.6. Other

Other commands are listed below.

command:dialog-close Command

Closes the dialog box opened by the instruction:dialog. Available only for dialog boxes.

Parameter:

No parameter.

command:show-context-menu Command

A command to display context menu in the coordinates the (0,0) of which is the top left corner of the document display area.

This command is invoked if a user performs an operation to display a popup menu such as right-clicking in the document display area. If you overwrite this command by using instruction:show-popup instruction, dynamic context menu is performed.

Parameter:
number command:x

Specify the top left corner's x coordinate of the context menu for displaying it. The coordinate is relative to the top left corner of the document display area.

number command:y

Specify the top left corner's y coordinate of the context menu for displaying it. The coordinate is relative to the top left corner of the document display area.