Accessing data with URLs

Table of Contents

Instant JChem URLs

Overview

Instant JChem URLs is a feature that arrived in IJC 2.3. It allows you to define access to information in IJC using a URL that other people can use to obtain an identical view point. This is best illustrated by means of an example. Lets assume that you have created a shared MySQL or Oracle database, and had created a specific list of compounds that you wanted other users to be able to use. You can easily do this by:

  1. Making the form public (sharing it) so that other people can access it

  2. Making the query public (sharing it) so that other people can access it

  3. Generating an IJC URL that specified the particular form and query

  4. Sending an email to the other users containing the URL

  5. The other users read the email, click on the link and IJC starts up, opens the form and executes the query. The user is now seeing exactly what you wanted then to see.
    For reasons that should be obvious IJC URLs are of most use in a shared project environment where the URL has identical context for all users. However they can also be used in local databases or in remote databases that are not part of a shared project configuration, but they are of more limited use.

Generating URLs

An IJC URL is generated using a dialog that can be opened with Tools -> Generate URL. You must be using a shared project (otherwise the URL would have no meaning when shared).
images/download/attachments/45328693/createURL.png

At the top of the dialog is the list of actions that are available. Opening a view is currently the only action, but others may be added in the future.

Warnings:

When generating URLs you may see some warnings about the URL you are trying to generate.

Selected view/query/list is not shared.

  • If you are creating the generated URL for other people to use then it is essential that any views, lists and queries that are used in the URL are shared. Without this your other users will not be able to access the information. If you try to use one of these that is not shared you will see a warning message informing you of this. You can share the item by selecting the view/list/query and clicking on the 'Share' button.

URL will not work if you put it in a web page or email.

  • This indicates that the shared project is not deployed in a manner that allows you to use the URL in a web page or an email. The Java Web Start instance of IJC must be deployed using the UrlWebApp server. To see how to do this consult the admin docs .

Creating an 'Open view' URL

Specify the exact action:

Open view

  • This opens the specified view and shows all the data.
    An example URL looks like this:

    http://www.chemaxon.com/urldemo/demo.jnlp?view=8BCD646043688090353F199D948541F8&action=OpenURLAction&project=UrlPubChemDemo&schema=.server%2Flocaldb

    Note: multiple views can be specified by manually editing the URL and adding the additional views as a comma separated list e.g.

    http://www.chemaxon.com/urldemo/demo.jnlp?view=8BCD646043688090353F199D948541F8,32F03682857288B598AEC37779F034AD&action=OpenURLAction&project=UrlPubChemDemo&schema=.server%2Flocaldb

Open view and select query or list

  • This opens the specified view and applies the specified query or list. The query or list is specified using the right hand explorer. Only permanent lists or queries can be used. Temporary queries and lists are also shown as you can use the normal list and query operations to make these permanent (or to edit them or perform list logic etc. to generate new lists).
    An example URL looks like this:

    http://www.chemaxon.com/urldemo/demo.jnlp?view=8BCD646043688090353F199D948541F8&action=OpenURLAction&project=UrlPubChemDemo&schema=.server%2Flocaldb&permanent_query=01B3200CCBF2AEB146421F9A13C644D4

Open view and show rows

  • This opens the specified view and shows the specified rows. The rows that are specified are the CURRENT row numbers e.g. you can say open the view and show the rows that are currently rows 7, 11 and 18. This will open the view and show just those three rows.
    An example URL looks like this:

    http://www.chemaxon.com/urldemo/demo.jnlp?view=8BCD646043688090353F199D948541F8&action=OpenURLAction&project=UrlPubChemDemo&selected_row=1999&schema=.server%2Flocaldb

In all cases the view is specified using the 'Select view' explorer.

There is also a checkbox named 'Show only selected data tree' which allows you to hide data trees that are not needed. This can be used to simplify what users see. Note that this should be considered as for convenience purposes, and is not a secure approach to hide data from users. If you need a secure approach to controlling access you should look at the approach described in the Filtering items using roles administrators tips and trick.

The generated URL is displayed at the bottom of the dialog. It can be generated in HTML format for pasting into a web page by checking the 'HTML text' checkbox. Access the URL by clicking on the 'Copy to clipboard' button and then paste it wherever you need.

Opening URLs

An IJC URL can be opened using any of these approaches:

From inside IJC

  • Using Tools -> Open URL and paste the URL into the text box.

Using a command line option

  • instantjchem --openUrl <url>

Using an extra parameter to Java Web Start URL

  • http://www.yourserver.com/UrlWebApp/demo.ijp?view=32F03682857288B598AEC37779F034AD&action=OpenURLAction&project=demo&schema=.server%2Flocaldb&permanent_query=7BB2FB31A160E9874DCA06B4140E4292

    If you are generating the URL from the Java Web Start version then the full URL that launches IJC is generated, so the URL will launch IJC when pasted into a browser or clicked on in an email. Use the Generate URL function inside IJC to generate this - do not try to generate it manually!

Additional information for administrators

IJC URLs have most benefit when IJC is launched using Java Web Start and requires the use of shared projects. Consult the following administrator's documentation for details of how to set these up: