Developing Vocabulary Component with XVCD

This section describes the procedures on creating the vocabulary component of xfy technology by using VCD.

1. Creating Vocabulary Component

Vocabulary component is a xfy component providing display and edit function for the DOM sub-tree created from the target XML document. For xfy Basic Edition, the following vocabulary components are included by default:

To create a professional vocabulary component, use Java language to describe a program. An expert developer is needed to create a program using Java language. XVCD is the script that allows one to create a vocabulary component without expertise in Java. XVCD associates an XML vocabulary where a vocabulary component already exists and new XML vocabulary in two ways. Thus, the new XML vocabulary is available in existing displaying and editing system of vocabulary components.

As an example, consider creating a vocabulary component using text and numerical values for XML vocabulary. The simplest way is to create an edit screen with an input field like a web form. You can also accomplish your objective without an input field if you have the same skill to create an HTML display. In this case, you can easily create dedicated vocabulary components by creating a script by XVCD utilizing XHTML components for xfy.

2. Creating Vocabulary Component with XVCD

This section describes environment for vocabulary components using XVCD, and how to create vocabulary components. The following procedures show how to create a vocabulary component using XVCD:

  1. Prepare development
  2. Create target XML document for display and edit
  3. Create a XVCD file
  4. Install vocabulary components in the running environment of xfy technology user agent

The following are the step-by-step descriptions to create a vocabulary component. In addition, refer to procedure instructions with samples provided by "Developing Vocabulary Component with XVCD Tutorial".

2.1. Preparation

xfy Developer's Toolkit is provided for assisting in the creation of a vocabulary component with XVCD. By implementing xfy Developer's Toolkit according to the procedures in advance, you can effectively create a vocabulary component with XVCD.

For support creating vocabulary component with xfy Developer's Toolkit, refer to [Support Creating Vocabulary Component with xfy Developer's Toolkit].

2.2. Providing an XML Document

First of all, for process verification, create an target XML document file for display and edits using XML vocabulary.

When there is no XML document file using the target XML vocabulary, create an XML document file that can be used for verifying the process of the XVCD created. The XML document is used only for process verification, and is not necessary to provide all requirements for XML vocabulary. And, when there is XML document files using the XML vocabulary, select the XML document file that can be used for verifying the process of XVCD to be created.

Describe processing instructions to associate XVCD file and register vocabulary component In XML document file for process verification.

2.3. Creating a XVCD File

Describe a vocabulary component with XVCD to display and edit the XML document.

  1. Creating a XVCD file
    Create a XVCD file composed of xvcd:xvcd element as a vertex element, xvcd:vocabulary element or xvcd:template element. If the vertex element of XML document matches the pattern specified in match attribute of xvcd:vocabulary element, XVCD can be applied to the XML document. When * or node() is specified in the attribute, the XVCD can be applied to any XML document.
  2. Creating Display, Edit Functions
    Create display, edit, etc., functions by describing ui:ui element, xvcd:command element and xvcd:template element, etc. We recommend that you begin with basic functions such as simple display.
  3. Verifying the XVCD process
    Check if the intended functions are successfully implemented by opening the XML document for process verification in which processing instructions were described in xfy technology user agent.
  4. Adding function to a XVCD file
    After confirming that the functions operate successfully, enhance the functions progressively such as commands, user interfaces, or templates for new documents.
    It is recommended that you check the process of function every time you create a new function.

See the sample of XVCD for creating a XVCD file. You can also see the references for each element or attribute.

2.4. Installing Vocabulary Component

After successfully creating a vocabulary component, install it in the running environment of xfy technology user agent.

When creating XVCD files, describing processing instructions in a XML document allows you to use vocabulary components. This can however be accomplished only if you install the xfy Developer's Toolkit. You should also describe processing instructions in all XML documents that you want to process in vocabulary component creation with XVCD. Thus there is a problem whereby an XML document without processing instructions cannot be processed directly. To avoid such problems, you should create and install the vocabulary component.

By installing and using the vocabulary component, you can process XML documents even in an environment in which the xfy Developer's Toolkit was not installed. You can also process XML documents without processing instructions to associate XVCD files

Under ordinary circumstances, a JAR file is created to use various xfy components such as the vocabulary component of the xfy technology user agent. Created xfy component is to be installed in the running environment of the xfy technology user agent.

A way to place XVCD file under scripts folder is provided as a simple way for the vocabulary component created with XVCD.

2.4.1. Installing in scripts Folder

The way to place XVCD files under the scripts folder is provided in order to simply use vocabulary component with XVCD.

The scripts folder is contained in the folder where xfy technology was installed. Save XVCD files created in the scripts folder. Installation of the vocabulary component with XVCD is now complete. On startup, the xfy technology user agent refers to the XVCD file in scripts folder and registers vocabulary components based on xvcd:vocabulary element's setting described in it.

2.4.2. Creating a JAR File

The intended way to use vocabulary component in xfy technology user agent is to create a JAR file and install it in running environment of xfy technology user agent.

The following are the descriptions of step-by-step procedures to archive a vocabulary component created by a XVCD to JAR file.

  1. Creating a Class in Java Language Which Registers XVCD to System
    To register the XVCD to the system, create a class that implements the interface defined in xfy technology. After creating the class, create a class file by compiling the class with Java compiler.
  2. Creating a Manifest file
    In a manifest file, describe necessary information to operate a component. The main information described is shown below.
    • Vendor name
    • Component Name
    • Class Name Working as Component
    • Function Provided by Component
  3. Create a JAR file
    Creates a JAR file from XVCD files, class files and manifest files.
  4. Placing the Created JAR File under the Running Environment of xfy technology User Agent
    Places a JAR file in the folder for executables of xfy technology user agent. You can use the vocabulary component when you launch the xfy technology user agent after placing a JAR file.

We have a plan to develop and provide a tool that allows you to easily create a JAR file by executing the above procedures in a dialog form.

3. Support Creating Vocabulary Component with xfy Developer's Toolkit

To use created vocabulary component in xfy technology user agent, you should create a JAR file and install it in running environment of xfy technology user agent. After installing vocabulary component, you must restart the xfy technology user agent. Therefore, when developing the vocabulary component, you may repeat installation and restart xfy technology user agent to check the behavior, so developing task greatly takes time and effort.

Installing of xfy Developer's Toolkit allows you to register the vocabulary component using the processing instruction described in the XML document file. As this associates XVCD file based on processing instruction and register a vocabulary component, the vocabulary component becomes available even if no Jar file is created and installed in the running environment of xfy technology user agent. Changes are also reflected after changing the XVCD file and reloading the XML document file, so you don't have to restart the xfy technology user agent. Association of XVCD file and registration of vocabulary components by processing instruction are effective only when the xfy Developer's Toolkit is installed.

If you use xfy Basic Edition 1.0, you don't need to install xfy Developer's Toolkit since xfy Basic Edition 1.0 already includes xfy Developer's Toolkit.

In xfy Developer's Toolkit, additional tools and features will be provided for supporting vocabulary component creation.

XVCD File Association by Process Instruction

To associate XVCD file in processing instruction:

Specifying the External File in Your XML Document
As you write the xml-stylesheet processing instruction to associate your XSLT style sheet, you can write a processing instruction in your XML document to associate desired XVCD file. To associate a particular XVCD file, you write the com.xfytec processing instruction with the vocabulary-connection parameter in the XML document, as shown below:
<?com.xfytec vocabulary-connection href="URL of XVCD file " ?>
The vocabulary component in the XVCD file associated by com.xfytec vocabulary-connection processing instruction takes precedence over installed vocabulary components. And, if multiple XVCDs are associated in com.xfytec vocabulary-connection processing instruction, first described vocabulary component in XVCD file takes precedence.
Embedding a XVCD into Your XML Document
You can write a XVCD embedded in your XML document as well as an XSLT. When using an embedded XVCD, you must specify the id attribute in the xvcd:xvcd element for the embedded XVCD. Then, in the com.xfytec vocabulary-connection processing instruction, you write the ID value that you specified in id attribute of the XVCD.
<?com.xfytec vocabulary-connection href="#value of ID attribute of the xvcd:xvcd element in embedded XVCD" ?>