Creating an xfy Plug-in Using xfy Plug-in Archiver

This document explains how to create an xfy plug-in using xfy Plug-in Archiver with simple examples.

This tutorial teaches you how to operate the following features using xfy Plug-in Archiver.

1. Content of Tutorial

This tutorial explains how to create an xfy plug-in using xfy Plug-in Archiver, step by step with very simple examples. The XVCD file and the associated file are required. By working through this tutorial, you can create an xfy plug-in JAR file that you can use with an xfy user agent, based on an XVCD file and so on.

For preparations of the development environment for working through this tutorial, see "Preparing The XVCD Development Environment."

Sample Codes

Sample codings in this tutorial are contained doc/samples/developers/tutorial/xvcd_archive_tool in xfy Developer's Toolkit  distribution package. Many XVCD samples are provided in xfy Developer's Toolkit in addition to the tutorial. To learn more about XVCD, see these samples.

2. Preparation of an XVCD File

First of all, prepare an XVCD file or other file that can be the source of an xfy plug-in JAR file.

xfy Plug-in Archiver archives the whole under the specified folder as an xfy plug-in JAR file. Therefore, the reference of the prepared XVCD file must conclude under the folder in which that XVCD file exists. The references occur in the files used when the source XVCD file is executed. The types of the file are the XVCD file, user interface configuration file, and resource file, and so on.

In this tutorial, we use the sample contained in the doc/samples/developers/tutorial/xvcd_archive_tool of xfy Developer's Toolkit distribution package. This folder contains each file of lite-document2.resource and lite-document2.ui referred by lite-document2.xvcd, the independent lite-document2.xfr, besides the XVCD file named lite-document2.xvcd. For more information about the content or the used element and attribution of these files, see each reference below.

3. Running xfy Plug-in Archiver

Now, let's create an xfy plug-in JAR file from the prepared XVCD file using xfy Plug-in Archiver.

In addition, about operations of xfy Plug-in Archiver, see "xfy Plug-in Archiver Help."

  1. Start xfy Plug-in Archiver

    On xfy Client, select Tools - Develepment Tools - xfy Plug-in Archiver.
    xfy Plug-in Archiver starts, and the Archive File Setting Window appears.

    Starting xfy Plug-in Archiver
    Starting xfy Plug-in Archiver
  2. Setting the Property of the xfy Plug-in

    On the Archive File Setting Window, set the property of the xfy plug-in to create.

    File Type
    As you create an xfy plug-in from an XVCD, select xfy plug-in JAR file (JAR).
    Vendor Name
    For vendor name, use a string describing the domain name in the reverse order possessed by the vendor which created the xfy plug-in. In this example, you are assumed to belong to the organization called example.com. In this case, enter "com.example".
    Plugin Name
    Based on the name entered here, the file name of the xfy plug-in JAR file is determined. So, the name must not be duplicated within the same vendor. In this example, enter "tutorial".
    Version
    Specifies the version of the archive file created. In the 4 input fields, in order from the left, specify the major version, the minor version, the build number and the revision. In this example, in order from the left, enter "1", "0", "1" and "0".
    Display Name
    Enter the name to display the xfy plug-in you create. The Display Name can be omitted. In this example, enter "sample plug-in".
    Description
    Enter the explanation about the xfy plug-in to create. The Description can be omitted. In this example, enter "This is sample xfy plug-in JAR file.".
    Copyright
    Enter the copyright information about the xfy plug-in to create. The copyright information can be omitted. In this example, enter "(C)2006 example.com".
    Source Folder
    Specifies the folder in which the XVCD file to be the base to create an xfy plug-in JAR file exists. Here, specify the doc/samples/developers/tutorial/xvcd_archive_tool folder in xfy Developer's Toolkit distribution package prepared in the step above.
    Inputting the Setting
    Inputting the Setting

    After all the settings are completed, click Next.
    Selection Window for File to Register to the System is displayed.

  3. Selecting File for Register to System

    On the selection window for file to register to the system, the XVCD and XFR files existing under the source folder are displayed in each list.

    File Selection for Register to System
    File Selection for Register to System

    The XVCD and XFR files selected as the files to be registered to the system are referred when the xfy platform starts and loads the xfy plug-in JAR file. And, based on the setting of the xvcd:vocabulary element or xfr:xfr element described in the file, each component is registered to the xfy platform.

    Select all the files and click Next, here.
    The Destination Folder Selection Window is displayed.

  4. Specifying Destination Folder to Save the xfy Plug-in JAR File

    On the Destination Folder Selection Window, specify the destination folder to save the xfy plug-in JAR file. In this example, the destination folder is "C:\Documents and Settings\xfyuser\My Documents".

    Specifying the Destination Folder
    Specifying the Destination Folder

    In the folder specified here, the sub-folder is created with the name entered in Vendor Name on the Archive File Setting Window. In the created folder, the xfy plug-in JAR file is created. The name of the created xfy plug-in JAR file is the name entered in Plug-in Name on the Archive File Setting Window plus the extension ".jar". The file name created in this example is "C:\Documents and Settings\xfyuser\My Documents\com.example\tutorial.jar".

  5. Creating an xfy Plug-in JAR File

    After specifying the destination folder, click Create to create an xfy plug-in JAR file. If the xfy plug-in JAR file is created, the message box showing the path to the saved file appears. Trace the displayed path to check for the xfy plug-in JAR file saved.

    Succeeded Message Dialog Box
    The message displayed if the xfy plug-in JAR file is created

4. Using the Created xfy Plug-in JAR File

Try to actually use the xfy plug-in. You can use the created xfy plug-in JAR file after you import it into the runtime environment of the xfy user agent and restart the xfy user agent.

Before you follow the steps below, exit all the xfy user agents and applications, if running, except xfy Client.

4.1. Importing an xfy Plug-in JAR File

xfy Client allows you to import xfy plug-in JAR files from client environment. Import the created xfy plug-in JAR file to the runtime environment of xfy platform using this function. To import an xfy plug-in JAR file, follow the steps below:

  1. Select Tools - Package Configuration.
    The Package Configuration dialog box is displayed.
  2. Click Import.
    The Open dialog box is displayed.
  3. Select the xfy plug-in JAR file you have created and then click Open.

This completes the import of xfy plug-in from client environment. For more information about Package Management Tool, see "Package Management Tool Help."

4.2. Starting and Checking xfy Client

After importing the xfy plug-in from the client environment, restart xfy Client. The source XVCD file to create the xfy plug-in at this time contains the document template if lite-document. Now, let's display it in xfy Client. Display document templates with steps below.

  1. Select File - New.
    The New dialog box is displayed.
  2. From the list of document templates, select the "New_lite-document" and click Open.

Is the template of the lite-document displayed? If the template is displayed and the document can be displayed and edited successfully, creating the xfy plug-in JAR file from the XVCD file and importing the xfy plug-in JAR file to the xfy platform are succeeded.

5. Summary

The lesson learned here is summarized below.