This plugin allows hypergraph applet (http://hypergraph.sourceforge.net/) to run in jspwiki.

You just need to :

  • put hypergraph.jar situated in attachment into '<tomcat_path>/webapps/<your_webapp>/WEB-INF/lib'
  • add 'jspwiki.plugin.searchPath = hypergraph' in your jspwiki.properties (located in '<tomcat_path>/webapps/<your_webapp>/WEB-INF/')
  • add hyperapplet.jar (situated in attachment) in the attachment of the page that you will refer to in the 'archive' and 'dtd' parameters of the plugin
  • add GraphXML.dtd (situated in attachment) in the attachment of the page that you will refer to in the 'archive' and 'dtd' parameters of the plugin

The original hyperapplet.jar was modified a little bit to accept xml input as argument in the body of the plugin. The two modified source files HExplorerApplet.java and SAXReader.java can be found in attachment for information purpose (they are used in the hyperapplet.jar also situated in attachment).

If you want to refer to an xml file instead of adding xml in the body of the command line invoking this plugin, just use file='./attach/<your_page_name>/<your_graph_file.xml>'. In the same way, just put the property properties='./attach/<your_page_name>/<your_property_file.xml>' if you want to use an hypergraph property file.

  • don't forget to do explicit references to the files you may use
    • absolute path : /<your_webapp_name>/attach/<your_page_name>/<file_name>
    • local path from web page : ./attach/<your_page_name>/<file_name>



HypergraphPlugin/screenshot.jpg
demo graph
[{Hypergraph debug='false' width='100%' height='600' archive='HypergraphPlugin/hyperapplet.jar'
dtd='HypergraphPlugin/GraphXML.dtd'

<GraphXML>
    <graph id="some_example">

    	<!--********************************************
    	    * First we have to define some nodes       *
    	    ******************************************** -->

    	<!--A simple node, the root of the tree.
    	    The text of the node is blue, the background of the node is a light blue.
    	    If the node is clicked, the HyperGraph homepage is opened in a new window. -->
	<node name="1" >
	    <label>
		The root
	    </label>
	    <dataref>
		<ref xlink:show="new" xlink:href = "http://hypergraph.sourceforge.net"/>
	    </dataref>
	    <style>
		<line colour="blue"/>
		<fill colour="#d0d0ff"/>
	    </style>
	</node>

    	<!--A node with an empty label. 
    	    An icon is shown together with the label.
    	    If the node is clicked, the HyperGraph homepage is opened.
    	    The attribute "xlink:show" is not specified, so it depends on the
    	    property "hypergraph.examples.hexplorer.GraphPanel.target"
    	    in the property file how the browser shows the new page.
    	-->
	<node name="2">
	    <label/> <!-- No label -->
	    <dataref>
	        <ref xlink:href = "http://hypergraph.sourceforge.net"/>
	    </dataref>
	    <style>
	        <fill xlink:href="point.gif"/>
	    </style>
	</node>

    	<!--A node with a label and an icon.
    	    This node has a reference to node "31" in the same graph;
    	    if the node is clicked, node "31" is centered. -->
	<node name="3" >
	    <label>
		Click to center node 31
	    </label>
	    <dataref>
		<ref xlink:href = "#31"/>
	    </dataref>
	    <style>
		<fill xlink:href="point.gif"/>
	    </style>
	</node>

	<!--If the user clicks this node,
	    the hypergraph homepage is loaded in the same window.
	    Same behaviour as property 
	    "hypergraph.examples.hexplorer.GraphPanel.target=_self"
	-->
	<node name="4" >
	    <label>
		xlink:show = replace
	    </label>
	    <dataref>
		<ref xlink:show = "replace"
			 xlink:href = "http://hypergraph.sourceforge.net"/>
	    </dataref>
	</node>

	<!--If the user clicks this node,
	    the hypergraph homepage is loaded in the same window.
	    Same behaviour as property 
	    "hypergraph.examples.hexplorer.GraphPanel.target=_self"
	-->
	<node name="5" >
	    <label>
		xlink:show = new
	    </label>
	    <dataref>
	        <ref xlink:show = "new"
		     xlink:href = "http://hypergraph.sourceforge.net"/>
	    </dataref>
	</node>

	<node name="7" >
	    <label>
		xlink:show = none
	    </label>
	    <dataref>
		<ref xlink:show = "none"
		     xlink:href = "http://hypergraph.sourceforge.net"/>
	    </dataref>
	</node>

	<node name="8" >
	    <label>
		no xlink:show
	    </label>
	    <dataref>
		<ref xlink:href = "http://hypergraph.sourceforge.net"/>
	    </dataref>
	</node>

	<!-- Call of javascript function is possible as well : -->
	<node name="9" >
	    <label>
	        javascript
	    </label>
	    <dataref>
		<ref xlink:show = "replace"
		     xlink:href = "javascript:showGraphText()"/>
	    </dataref>
	</node>

	<!-- This node is linked to node 1 with an invisible edge
	    (see edge definition below) -->
	<node name="6" >
	    <label>
		Invisible edge !
	    </label>
	</node>

    	<!--********************************************
    	    * Now some egdes                           *
    	    ******************************************** -->

	<!-- Some directed edges. As a default, an edge is not directed. -->
	<edge source="1" target="7" isDirected="true"/>
	<edge source="1" target="8" isDirected="true"/>
	<edge source="1" target="9" isDirected="true"/>
	<!-- A dashed red egde from node 1 to node 2 -->
        <edge source="1" target="2">
	    <style>
		<line linewidth="1" linestyle="dashed" colour="red"/>
	    </style>
	</edge>
	<!--A dotted red egde from node 2 to node 10.
	    Node 10 hasn't been defined, so it's created and gets default attributes.-->
        <edge source="2" target="10">
	    <style>
		<line linewidth="1" linestyle="dotted" colour="red"/>
	    </style>
	</edge>
	<!--A default egde from node 2 to node 11 (which is created with default attributes).
	    This edge has a label -->
        <edge source="2" target="11">
            <label>edge label</label>
	</edge>
	<edge source="2" target="12"/>
        <edge source="2" target="13"/>
        <edge source="2" target="14"/>
        <!-- some other edges with line styles and widths-->
	<edge source="1" target="3">
	    <style>
		<line linewidth="1" linestyle="dotted" colour="red"/>
	    </style>
	</edge>
	<edge source="1" target="4">
	    <style>
		<line linewidth="1" linestyle="dash-dotted" colour="red"/>
	    </style>
	</edge>
	<edge source="1" target="5">
	    <style>
		<line linewidth="3" linestyle="solid" colour="red"/>
	    </style>
	</edge>
	<edge source="1" target="6">
	    <style>
		<line linewidth="1" linestyle="none" colour="red"/>
	    </style>
	</edge>
	<edge source="1" target="7"/>
	<edge source="1" target="8"/>
	<edge source="1" target="9"/>
	<edge source="4" target="15"/>
	<edge source="4" target="16"/>
	<edge source="4" target="17"/>
	<edge source="4" target="18"/>
	<edge source="4" target="19"/>
	<edge source="4" target="20"/>
	<edge source="4" target="21"/>
	<edge source="4" target="22"/>
	<edge source="4" target="23"/>
	<edge source="4" target="24"/>
	<edge source="16" target="25"/>
	<edge source="16" target="26"/>
	<edge source="16" target="27"/>
	<edge source="16" target="28"/>
	<edge source="16" target="29"/>
	<edge source="16" target="30"/>
	<edge source="16" target="31"/>

    </graph>
</GraphXML>
}]

Add new attachment

In order to upload a new attachment to this page, please use the following box to find the file, then click on “Upload”.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
dtd
GraphXML.dtd 11.6 kB 1 05-Nov-2009 12:57 DuvergerP
java
HExplorerApplet.java 6.0 kB 2 11-Nov-2009 20:15 DuvergerP
java
SAXReader.java 3.5 kB 1 05-Nov-2009 12:58 DuvergerP
jar
hyperapplet.jar 132.0 kB 2 11-Nov-2009 20:14 DuvergerP
jar
hypergraph.jar 5.4 kB 3 11-Nov-2009 20:14 DuvergerP
jpg
screenshot.jpg 29.6 kB 1 05-Nov-2009 12:57 DuvergerP
« This page (revision-9) was last changed on 08-Nov-2009 19:34 by DuvergerP