Webview

From WandoraWiki
Jump to: navigation, search

Contents

Introduction

Webview is a full featured web browser embedded into the Wandora application. Webview uses the WebView component of the JavaFX framework. To add a Webview panel select menu option View > New panel > Webview. By default, the Webview opens arbitrary subject identifier of selected topic as the Webview location. Next screen capture views Webview with Wandora class topic. The location field contains topic's subject identifier http://wandora.org/si/core/wandora-class.


Webview wandora class.gif


Webview's title bar views the name of current topic. Current topic doesn't change if the user changes manually the URL in location field. For example, the user can change the location to http://wandora.org/www/ and current topic stays Wandora class. Next screen capture views the Wandora after location change.


Webview wandora org.gif


The icons to the left of location field are navigation arrows, reload and stop button for the Webview. Navigation arrows can be used to restore previous and next web location. Notice, Wandora has also topic navigation arrows on the top bar of application window. Webview's navigation arrows work with Webview's navigation history as the topic navigation arrows work with Wandora's topic navigation history. These histories overlap usually but are not identical if the user opens anything else but a topic in the Webview. Reload icon views an arrow circle. It is used to reload the content of current Webview location. Stop icon is cross-shaped and removes the current page in Webview. Removing a page in Webview may be necessary if the page contains defective Javascript code, for example.

To the right of Webview's URL field is an icon with three short horizontal lines. It opens up a menu with Webview specific tools. Next screen capture views the Webview tool menu open.


Webview menu.gif


Webview tools

Pressing an icon right to the Webview's URL field reveals a menu that contains Webview tools. Next chapters describe the tools found in the menu.

Open current topic

This submenu lists all subject identifiers, occurrences and subject locator of the current topic. As the Webview opens an arbitrary subject identifier of a topic, the user can choose to open any other subject or occurrence of the topic with the options in the submenu. Selecting submenu item opens the subject or occurrence URI to the Webview. Also, Webview can view occurrences that are not URLs but plain of HTML text. For example, occurrence may contain a complete HTML page source after a document extraction. Viewing the occurrence in Webview views the page as it was looked from the original URL location.

Next image views the Open current topic submenu of Wandora class topic. Submenu options depend on topic and it's subjects and occurrences.


Webview menu open current topic.gif


Open Wandora's services

Wandora features embedded HTTP server that hosts numerous services. Previously the user has used these services with external WWW browser only. Now these services can be viewed inside the Wandora application too. The submenu contains a list of available services and selecting a service in the list opens it to the Webview. Next image views a D3 graph service module open in Webview. The graph is interactive as it were viewed in the external WWW browser.


Webview d3graph.gif


At the moment Wandora features 26 different services in the embedded server. Some are visualizations that work nicely in the Webview panel. Some are plain data feeds (XTM, RDF) that are not very visual. And some don't work on Webview at all. For example, Flash graph service module doesn't work on Webview as Webview doesn't support Flash. Next image views options found under the Open Wandora's services menu option. It is more than likely that the collection of available services evolves in upcoming Wandora releases.


Webview menu view services.gif


Open Firebug

Opens Firebug web development tool console in the Webview. Firebug is useful if you are developing services for the embedded HTTP server and wish to debug your services.

Open in external browser

Opens Webview's current URL in an external browser application. This can be useful if you suspect the Webview doesn't view the page right.

Add to current topic

This submenu contains several options that copy information in the web page to the current topic:

  • Add selection as an occurrence adds selected text to the current topic as an occurrence. The user can choose occurrence type and scope topics.
  • Add selection source as an occurrence adds source of selected text to the current topic as an occurrence. The user can choose occurrence type and scope topics.
  • Add source as an occurrence adds page source to the current topic as an occurrence. The user can choose occurrence type and scope topics.
  • Add location as an occurrence adds current URL to the current topic as an occurrence. The user can choose occurrence type and scope topics.
  • Add location as a subject locator adds current URL to the current topic as a subject locator. If the topic map already contains a topic with same subject locator, these topics merge.
  • Add location as a subject identifier adds current URL to the topic as a subject identifier. If the topic map already contains a topic with same subject identifier, these two topics merge.
  • Add selection as a basename sets selected text as topic's basename.

For more sophisticated extraction options see the chapter Extract below. Next image views the menu options under the Add to current topic.

Webview menu add to topic.gif

Create a topic

Create a topic menu contains some trivial methods to transform current web location into a topic:

  • Create a topic from location creates a topic and sets current Webview URL as topic's subject identifier. Also, created topic is made instance of a Document topic. Document is made a subclass of Wandora class topic.
  • Create a topic from location and make instance creates a topic and sets current Webview URL as topic's subject identifier. Created topic will be added to current topic as an instance. Webview panel shows current topic in the title bar.
  • Create a topic from location and make subclass creates a topic and sets Webview URL as topic's subject identifier. Created topic will be associated with current topic as a subclass. Webview panel shows current topic in the title bar.
  • Create a topic from location and make associate creates a topic and sets Webview URL as topic's subject identifier. Created topic will be associated with current topic using default association type and default roles. Webview panel shows current topic in the title bar.

Latter three options are useful if the user first opens up a topic in the webview, and then starts to browse other web locations. First topic stays as a current topic as manually adjusted URL field doesn't change the current topic.

Next image views the menu options under Create a topic.

Webview menu create topic.gif

Extract

Wandora has featured a Firefox and Thunderbird plugin extractor for some time. Now the extractor is available in the embedded Webview browser too. Available extraction options are under Extract menu. Next image views available options in Wandora version 2014-04-15. For example, Simple document extractor creates a topic out of web location and adds page source as an occurrence to the topic. RSS extractor recognizes if the page has an RSS feed link and if positive, extracts the RSS feed. OCR extractor utilizes integrated Tesseract OCR engine and extracts text out of selected WEB image. The user has to install Tesseract OCR engine separately, it is not part of Wandora's default installation package. Also, the user should notice that some of available extractors doesn't connect created topics and associations with Wandora's base ontology but the user has to search for created topics and associations.


Webview menu extract.gif


To change the default set of available browser extractors, the user can start Tool manager and adjust Browser extractor list as shown in the screen capture below. More information about available extractors is here. It is more than likely that the default set of browser extractors varies in upcoming Wandora releases.


Tool manager browser extractors.gif

Installing Webview and JavaFX problems

Wandora's Webview is based on JavaFX. JavaFX version 2.0 or above must be available in Wandora's class path before the Webview starts successfully. If Wandora doesn't find the JavaFX, it shows a message

 Can't find JavaFX. Webview has been disabled.

To fix the problem first check your Java version. Since Oracle Java SE 7 update 6 the JavaFX is bundled to be installed with Oracle Java SE platform. We recommend that you update your Java version to SE 7 update 6 or later. However, we emphasize that Wandora has not been tested thoroughly with Java 8.

Although JavaFX is bundled with Java SE, the JavaFX may not be in Wandora's class path. To fix the problem, edit Wandora's startup script at bin/SetClasspath.bat or bin/SetClasspath.sh and fix the file path of jfxrt.jar. Usually the jfxrt.jar locates in your JRE installation, in lib directory.

See also

More information about Wandora's topic panels:

Personal tools