Installation of Plot Data Edit Function

Author: Hirohisa Mori / joshuaï¼ globalbase.org + Tomohito Nakajima / nakajimaï¼ zeta.co.jp / ZETA Co. + [Transrate]Reiko Inoue Bendtsen c/o Suzaku Translations / (http://www.suzaku-translations.com/) +

* Abstract
* System Requirements
* [Step 1] vct File Selection
* [Step 2] vct File Setting
* [Step 3] Confirmation of gbview Condition Layer Settings
* [Step 4] Setting of gbview Condition Layers
* [Step 5] Confirmation of Setting of gbview Coordinate System ID
* [Step 6] Rebooting gbview
* [Step 7] Changing HTTP-GATEWAY settings
* [Step 8] Changing HTTP-GATEWAY Settings (Addition of Layer)
* [Step 9] Changing HTTP-GATEWAY Setting (Addition of vct File Selection Menu)
* [Step 10] Final Confirmation

Abstract

This section explains how to enable the plot data edit function on a server on which gbview and HTTP-GATEWAY are installed.

[UP] Go To Page Top

System Requirements

All tasks in the previous section, "How to Install Default LOCALBASE (View System Only)", must have been completed before performing this task.

Moreover, the vct plot data file to be edited must be on the server on which gbview is running.

[UP] Go To Page Top

[Step 1] vct File Selection

Select the vct file to be edited. Please refer to [UNDEF REF (gb-data-structure)]for the detailed explanation of vct files. Here, it is explained how to copy an already existing vct file to the appropriate destination so that it can be viewed in the proper coordinate data context in COSMOS. The vct file can be empty or contain plot data already.

When viewing the selected vct file in COSMOS, the file is basically never specified directly. It is much more likely that the mechanism used in practice will be to paste the contents of an existing vct file into a certain coordinate system file ( files with .crd extension ) to allow it to be viewed in COSMOS by specifying the coordinate system file. In the following example, let us assume that the vct file name and URL are sample.vct and xlp:/domainname:8080/samples/sample.vct, respectively, and the same information of the coordinate system file is stored in sample.crd and xlp:/domainname:8080/samples/sample.crd. Although these two files have been mapped, the mapping data itself is irrelevant here.

[MEMO] If you want to create a new vct file and edit it, first create a vct file and a crd file and then a map file for mapping purposes; check that the file can be viewed in COSMOS and then proceed to the next step. It is also possible to use an existing crd file and create and add a new vct file based on that.


[UP] Go To Page Top

[Step 2] vct File Setting

Add an editing range and a style sheet for editing to the selected vct file, which is sample.vct in our example. For example, the vct file before editing is as follows.

<?xl version="0.1" encoding="UTF-8"?>
<vector>
<meta>
 <bib xmlns:gb="xlp://isjhp1.nichibun.ac.jp:8080/gb_metadata">
  <gb:title data="Fukuoka-prefecture Local Dalls" type="text"/>
  <gb:subtitle data="Fukuoka-prefecture Local Dalls" type="text"/>
  <gb:creator data="Fujita Laboratory, Toyo University" type="text"/>
  <gb:content.period data="" type="W3C-DTF"/>
  <gb:issue.period data="2006-07-03" type="W3C-DTF"/>
  <gb:property data="plot" type="gb-prop"/>
 </bib>
 <file type="xl"/>
 <base-unit unit="degree"/>
</meta>
<mark img="http://www.zeta.co.jp/gbs/ajax/images/icon.gif"
	code="2560"
	name="2560"@valign="center"
	halign="center"
	transparent="#ffffff">

	<point>130.244080 33.567089</point>
</mark>
......
 

In the following listing, edit-mr and set-scheme specifications for editing have been added to the file above:

<?xl version="0.1" encoding="UTF-8"?>
<vector>
<meta>
 <bib xmlns:gb="xlp://isjhp1.nichibun.ac.jp:8080/gb_metadata">
  <gb:title data="Fukuoka-prefecture Local Dalls" type="text"/>
  <gb:subtitle data="Fukuoka-prefecture Local Dalls" type="text"/>
  <gb:creator data="Fujita Laboratory, Toyo University" type="text"/>
  <gb:content.period data="" type="W3C-DTF"/>
  <gb:issue.period data="2006-07-03" type="W3C-DTF"/>
  <gb:property data="plot" type="gb-prop"/>
 </bib>
 <file type="xl"/>

<!-------------------------------------------------------
	Setting of editing range, provide coordinates of the four 
	map corners using the edit-mr tag
-------------------------------------------------------->
 <edit-mr>
  ((129.955948degree  32.965313degree ) 
   (131.347168degree  33.884868degree ))
 </edit-mr>
<!------------------------------------------------------>
 <base-unit unit="degree"/>
</meta>

<!-------------------------------------------------------
	Style sheet for editing, set-scheme
-------------------------------------------------------->

<set-scheme scheme="general"
    onmap="xlp://gbs1.itakura.toyo.ac.jp:8080/style/onmap.xl"
    onmap.type="text/xl"
    card="xlp://gbs1.itakura.toyo.ac.jp:8080/style/card.xl"
    card.type="text/xl"
/>

<!------------------------------------------------------>

<mark img="http://www.zeta.co.jp/gbs/ajax/images/icon.gif"
	code="2560"
	name="2560"@valign="center"
	halign="center"
	transparent="#ffffff">

	<point>130.244080 33.567089</point>
</mark>
 

The editing range specifies the range of coordinates in the vct coordinate system. Please be aware that this is not necessarily identical to the coordinate system specified in the coordinate system file ( .crd ) into which the vct file is pasted. Note also that, at the moment, the style sheets for editing that can be used are basically limited to URLs xlp://gbs1.itakura.toyo.ac.jp:8080/style/onmap.xl and xlp://gbs1.itakura.toyo.ac.jp:8080/style/card.xl. We thus recommend that you cut and paste the following character string as is.

<set-scheme scheme="general"
    onmap="xlp://gbs1.itakura.toyo.ac.jp:8080/style/onmap.xl"
    onmap.type="text/xl"
    card="xlp://gbs1.itakura.toyo.ac.jp:8080/style/card.xl"
    card.type="text/xl"
/>
 



[ATTENTION] When you finish rewriting the file, execute the following command immediately.

$ xl makefile.xl - - 
 



[UP] Go To Page Top

[Step 3] Confirmation of gbview Condition Layer Settings

In this step, the gbview settings of httpagent.xl is checked, i.e., it should be checked if the edited vct file can be viewed correctly in LOCALBASE. It is not possible to check sample.vct directly. It is thus necessary to check that the coordinate system into which the vct file is pasted, xlp://domainname:8080/samples/sample.crd, can be viewed in LOCALBASE. The point here is to check whether the search conditions for locating xlp://domainname:8080/samples/sample.crd are set correctly in the Condition elements of the gbview settings. For example, there should be no problems if the URL is directly specified as follows:

	  <URL>
	   xlp://domainname:8080/samples/sample.crd
	  </URL>
 

Due care must be taken because the file may be made viewable by indirect specifcation, such as via search with periods and gb-property settings. If the file is set to be viewable, proceed to "Confirmation of Setting of gbview Coordinate System ID". If not, proceed to the next step.

[MEMO] The gbview setting in httpagent.xl corresponds to the following element.

<HttpAgent path="/gbgate/main.cgi"
	remote="xlp://localhost:8080/@gbview/">
	<HTTPSetup type="raw">
	....
	</HTTPSetup>
</HttpAgent>
 

The remote="xlp://localhost:8080/@gbview/" specification indicates that gbview is running on the local host.


[UP] Go To Page Top

[Step 4] Setting of gbview Condition Layers

In this step, conditional expressions to allow sample.crd and sample.vct to be viewed are specified. Although there are various advanced methods for setting complicated search conditions, such as search via period and gb-property, the least error-prone way is to enter the URL directly as shown below.

	  <URL>
	   xlp://domainname:8080/samples/sample.crd
	  </URL>
 

The entire setting specification including each of the elements above looks like:

	<Condition><quote>
	 <query qtype="URL" active="on" id="11">
	  <URL>
	   xlp://domainname:8080/samples/sample.crd
	  </URL>
	  <URL>
	   xlp://isjhp2.nichibun.ac.jp:8080/kokudo20000/coord/00.crd
	  </URL>
	 </query>
	</quote></Condition>
 

It is necessary to include the identifier referenced from HTTP-GATEWAY in the conditional expression, which is id="11" in the example above. This ID must be unique among all the specified conditional expressions. Make sure the ID is not duplicated.

[UP] Go To Page Top

[Step 5] Confirmation of Setting of gbview Coordinate System ID

Check that the definition of xlp://domainname:8080/samples/sample.crd is included in the coordinate system ID definition element Coordinate in httpagent.xl. Please refer to [UNDEF REF (HTTPSetup--Coordinate)]for the detailed explanation of the Coordinate element. If a line such as the following is included in the element:

	<Coordinate> 10
		xlp://domainname:8080/samples/sample.crd
	</Coordinate>
 

Add the setting for editing as follows:

	<Coordinate> 10
		xlp://domainname:8080/samples/sample.crd
		xlp://domainname:8080/samples/sample.vct
		/home/gbs-user/public/xldocs/samples/sample.vct
	</Coordinate>
 

The first character string specifies the coordinate system file to be read at viewing, and the next string is the vct file to be edited. The last path provides the actual position of the file on the server as an absolute path.

[ATTENTION] Since gbview writes directly to the file specified as editing target, this file must be on the server on which gbview is running.
If the setting of coordinate identifier of xlp://domainname:8080/samples/sample.crd has not been made, add a new Coordinate element as shown above. In this case, be careful that the identifier, which is "10" in the example above, does not overlap with other coordinate identifiers.

[UP] Go To Page Top

[Step 6] Rebooting gbview

Restart gbview. At the time of writing, rebooting GLOBALBASE is the only way to restart gbview.

$ /etc/init.d/launch-xl stop
$ ps -fA | egrep gbview
....... Check if gbview is terminated ......
$ /etc/init.d/launch-xl start
 

The script for starting/shutting down the GLOBALBASE server varies slightly depending on the underlying OS. The commands above can be used on Linux, FreeBSD and Solaris. Please refer to Document "LANDSCAPE Startup Manual"for the detailed explanation.

[UP] Go To Page Top

[Step 7] Changing HTTP-GATEWAY settings

Basically, the only settings that need to be migrated are those of the viewing function, client_conf.xml. This file has to be integrated with or replace the settings file in the sample directory, xlsamples/www/gateway/client_confs/client_conf2.xml.

In order to launch the plot data edit function in addition to the viewing function, perform the following two tasks:
  1. Add layers to allow viewing plot data
  2. Add a menu that allows selecting a vct file to be edited
The second task, including the menu for selecting a vct file to be edited, in particular, requires using a new tag, editableVctCtrl. To avoid problems, we recommend that you copy and edit a sample of client_conf2.xml. Changing htmlId, in particular, is basically asking for unexpected errors; make sure to copy and modify the contents of the file correctly.

[ATTENTION] The htmlId tag must match with the sample in the client_confs directory. If you change the tag more than necessary, unexpected phenomena are likely to occur.


[UP] Go To Page Top

[Step 8] Changing HTTP-GATEWAY Settings (Addition of Layer)

Edit client_conf.xml of HTTP-GATEWAY to allow viewing the conditional expressions and coordinate system set with gbview. HTTP-GATEWAY refers to the conditional expressions on the gbview side based on the layerCtrl element. Make sure that the 11thlayer is set according to the setting of [UNDEF REF (layer-setup)]. For example, the element might look as follows:

	<layerCtrl htmlId="layers1">
		<layer name="Present Map" id="1" visible="true">
			<desc>This is the present map</desc>
		</layer>
<!---------------------------------------------------------
Addition
----------------------------------------------------------->
		<layer name="Plot data to be edited" id="11" visible="true">
			<desc>This is the plot data to be edited</desc>
		</layer>
	</layerCtrl>
 



[MEMO] It is not necessary to change layerCtrl if viewing of the coordinate system file and vct file to be edited has already been enabled.


[UP] Go To Page Top

[Step 9] Changing HTTP-GATEWAY Setting (Addition of vct File Selection Menu)

Next, add the selection menu of the vct file to be edited with client_conf.xml. It is sufficient to enter the information below the editableVctCtrl element, which is explained in "Changing HTTP-GATEWAY settings". Each editableVct element corresponds to one editable vct file that can be selected in a combo box. The information elements are placed below this editableVct element. This element allows displaying a separate input window for each vct.

<editableVctCtrl htmlId="editableVctSelect1" >
  <editableVct active="true" vctId="2" name="sample.vct plot">
    <mark img="images/icon.gif" transparentColor="0x3FFFFFFF" />
    <information scheme="general">
      <field name="Prefecture name" visible="off" media="off" />
      <field name="Region name" visible="off" media="off" />
      <field name="Classification" visible="off" media="off" />
    </information>
  </editableVct>
  <editableVct vctId="3" name="Plot for Fukushima">
    <mark img="images/icon.gif" transparentColor="0x3FFFFFFF" />
    <information scheme="general">
      <field name="Prefecture name" visible="off" media="off" />
      <field name="Region name" visible="off" media="off" />
      <field name="Classification" visible="off" media="off" />
  </information>
  </editableVct>
</editableVctCtrl>
 



[UP] Go To Page Top

[Step 10] Final Confirmation




Figure Installed plot edit window


After making the settings above, try referencing gateway/edit/main.html of HTTP-GATEWAY with the WWW browser. Since the gateway part depends on the copy destination directory, make sure to enter the corresponding directory name. Confirm that a window looking like Fig.(Installed plot edit window) appears.

Moreover, make sure to zoom in on the map to check that the specific data referred to in the sample.vct plot data appears, and that it can be plotted without problems when "sample.vct plot" is selected in the vector editing menu. Please refer to Document "LOCALBASE User Interface Manual"for how to plot data.

[UP] Go To Page Top
  GLOBALBASE has particated in the open source software support program SORCE FORGE SourceForge.jp SourceForge.net Logo