|
OntopolyHowTo
Useful Ontopoly tips
Embedding the Ontopoly instance editorThere are two ways that the Ontopoly instance editor can be embedded inside another page: 1. using an iframeThis technique uses a dynamically resized iframe. Example: http://localhost:8080/ontopoly/examples/embedded-iframe.jsp?topicMapId=JillsMusic.xtm&topicId=262&topicTypeId=216 2. using jQueryThis technique uses jQuery and AJAX. Example: http://localhost:8080/ontopoly/examples/embedded-jquery.jsp?topicMapId=JillsMusic.xtm&topicId=262. As the sample topic maps do not contain subject identifiers the above link may not work in your environment. You'll find the example JSP files in apache-tomcat/webapps/ontopoly/examples/ inside the Ontopia distribution. Have a look at the JSP's example source code to see how these two mechanisms can be used. Enabling authentication and authorizationAuthentication and authorization is disabled by default. There is an example of how authentication and authorization can be added to Ontopoly in the distribution (added after 5.1.0). The example adds simple authentication that lets in anybody that can provide the same username and password, and the ontology is protected, so that the user cannot make any modifications to it. Note that this particular Ontopoly application is there only for illustration purposes. Enable the sample Ontopoly application by changing the 'applicationClassName' parameter in web.xml like this: <filter>
...
<init-param>
<param-name>applicationClassName</param-name>
<param-value>ontopoly.SampleOntopolyApplication</param-value>
</init-param>
...Please take a look at the source code of ontopoly.SampleOntopolyApplication to see how you can customize authorization and authentication in your own copy of Ontopoly. The behaviour of Ontopoly can be changed by subclassing ontopoly.OntopolyApplication and then refering to the subclass in web.xml (see above). Warning: The pluggable authentication and authorization support is currently in development and the APIs my change at any time before the next release. Mounting the Ontopoly application under another context pathIn web.xml add the filterPath init parameter to the filter and adjust the filter-mapping accordingly. Example: <filter>
<filter-name>WicketFilter</filter-name>
<filter-class>
org.apache.wicket.protocol.http.WicketFilter
</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>ontopoly.OntopolyApplication</param-value>
</init-param>
<init-param>
<param-name>filterPath</param-name>
<param-value>foo</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>WicketFilter</filter-name>
<url-pattern>/foo/*</url-pattern>
</filter-mapping>GeotaggingIn order to be able to geotag a topic in Google Maps, create two occurrence types (http://psi.ontopia.net/ontology/longitude and /latitude), and add them to the topic's topic type. This will add a small button next to the latitude field on the topic instance page. Clicking this opens a dialog window for geotagging. There is a more complete description of how to geotag on the blog. | |
The example URLs in items 1 and 2 above are reversed.
Thanks. Now fixed.