Commit 7b3c4444 authored by Matija Obreza's avatar Matija Obreza
Browse files


parent 5c614edc
== Data Sources
Anno is able to load data from Excel XLSX and CSV files and through database SQL queries.
Every data source *must* contain at least the following three "columns" that uniquely
identify an accession on Genesys:
. `INSTCODE`: the FAO WIEWS Institute code of the holding genebank
. `ACCENUMB`: Full identifier of the accession in your genebank
. `GENUS`: Genus of the accession
=== Excel and CSV files
To add an Excel or CSV file to the Project, click the "Add file" button in the Toolbar.
You will be prompted with an "Open file" dialog to select the source file to add to the project.
NOTE: Older versions of Excel files (with *xls* extension) are not supported.
Excel files may contain multiple sheets that will be listed as individual data source sheets.
CSV files contain only one sheet. The data sheets from source files are listed as sub-entries of
the source file. To open a data sheet and load the first 300 rows, double click the sheet name.
.Project with XLSX and CSV data sources
Loading data from Excel files is straightforward and requires no further configuration. This is
not the case for CSV files. The file format of CSV files is much more flexible and may require
additional configuration before it loads correctly.
=== CSV file configuration
CSV files are plain text files and do not provide any information about the character encoding,
separator or quote character used to separate text strings from numbers.
NOTE: Use Excel XLSX files instead of CSV files when possible. Open the CSV in Excel, make sure
data is well formatted and save it in XLSX format.
When opening a CSV data source, Anno may not be able to load the file without you providing
information on formatting of the file in the *CSV* tab of the CSV data sheet.
[cols="1,4", options="header"]
.Configuration for CSV files: Formatting
|Character set|CSV files generated from databases usually default to the character set of the
operating system. Use "windows-1250" for files generated on Windows, "x-MacCentralEurope" for Mac OSX.
You will have to experiment (Reload) with different options.
|Separator|Pick comma (,) or tab (blank)
|Quote character|Pick single (') or double quote (")
Even by providing the best settings for the CSV file, you cannot ensure that Anno will be able to read
all data correctly.
NOTE: Convert your CSV file to Excel XLSX format!
Click "Reload" to load the CSV file with the new settings.
=== CSV and Excel header row
Occasionally the data files contain additional rows at the start of the document that should be ignored by Anno.
[cols="1,4", options="header"]
.Configuration for data files: Headers
|Contains headers|Does your CSV file contain a header row?
|Header row index|What is the index of the header row? At the start or further down in the file?
Click "Reload" to read the data with new settings. Make sure that headers are read correctly.
=== Databases
Databases have many advantages over CSV and Excel files and you are likely using a relational database
to manage your accession data. The application allows you to directly query any database system using
a valid JDBC driver that allows the application to connect to the RDBMS.
Click "Add database" in the Toolbar. This will add a JDBC connection to your database as a top-level
source element. You will be able to add individual, tailored SQL queries as actual Anno data sources.
.Adding a database as data source
[cols="1,4", options="header"]
.Add Database dialog
|Datasource type|Select the database type from the list of supported drivers: mysql, MS SQL Server, PostgreSQL, ODBC
|Datasource name|Provide a name for the database connection to be used as the top-level label of the data source
in the Project.
|Connection URL|Edit the JDBC connection string template. You will have to provide the database host name,
port and the database instance name.
|User and Password|Valid username and password to access the database.
|Connect|Attempt to connect to the database with provided settings.
|Download driver|Attempt to download the JDBC driver for the selected database type.
Anno comes with mysql driver embedded, all other drivers
need to be downloaded separately. The *database type* determines which JDBC driver should be loaded.
NOTE: If your database type is not supported, contact for assistance.
Click "Connect" to try to connect to the database. If all went well, you will be presented with the
prompt to add the database link to the Project. Otherwise fix the username, password and the JDBC connect
string (search engines are a good resource to find a valid JDBC connect string for your database!).
.Database successfully added as data source
After the connection to the database is successfully established, the database connection is added as a
top-level data source. You are now able to add SQL queries as individual data sources to the project.
Right-click on the database data source and select "Add SQL query".
.Database successfully added as data source
This will create a data sheet entry under the database label, titled "Unnamed query". Double-click the entry in
the Project data source tree and update the query label and the SQL query itself.
.New database query screen
Press the "Reload" button to load data from the database. This will refresh the contents of the data sheet.
NOTE: Save the Project file regularly.
You should start with a simple SQL query to the database and then create additional data sheets
in the Project as you query for additional accession data.
NOTE: All SQL queries need to include `INSTCODE`, `ACCENUMB` and `GENUS` columns! Use your SQL-JOIN-foo to write
an SQL query that includes this data.
.A dummy SQL query with core columns: `INSTCODE`, `ACCENUMB` and `GENUS`
== Installing Anno
Anno is an open-source project, licensed under Apache License v2.
Anno requires the latest Java Run-Time Environment (JRE) to run.
NOTE: Make sure you don't allow installation of browser toolbars like in the Java JRE installer.
Or any other changes to your default browser configuration.
WARNING: Disable Java in all Internet browsers on your computer. Nobody in their right mind would
still use Java applets in 2016.
If downloading pre-compiled binaries, make sure to download the latest version of Anno for your platform.
You probably have 64-bit CPU and JRE and should use the package labeled `x86_64`. `x86` is for the 32-bit JRE.
Download the package from the[downloads section]
extract if necessary and run the executable for your platform.
|Project page|
|Pre-compiled binaries|
|`git` repository URL|
|Issue tracker|
== Mapping to MCPD
Once you have successfully loaded a data sheet with data you wish to publish on Genesys,
you need to map the columns of your data sheet to Multi-crop Passport Descriptors listed
on the right side of the application window.
. Open the data sheet
. Click on the column heading label to load current column configuration
. Drag the descriptor from MCPD listing to the column configuration pane
After drag-and-dropping the MCPD descriptor in the column configuration pane, the *RDF term* field
will be populated with the descriptor URL (e.g.
NOTE: Your existing data must be compliant with MCPD for straightforward mapping!
=== Basic column mapping
Genesys requires the `INSTCODE`, `ACCENUMB` and `GENUS` for every accession in the data sheet.
Load your data sheet and make sure it contains these three columns.
. Click on the label of the column containing the *FAO WIEWS Institute Code of your genebank*
. Drag the `INSTCODE` descriptor from the MCPD list to the column definition pane
. Select the column containing your *genebank accession numbers*
. Drag the `ACCENUMB` descriptor from the MCPD list to the column definition pane
. Select the *genus* column of your accessions
. Drag the `GENUS` descriptor from the MCPD list to the column definition pane
.Mapping the `ACCENUMB` column
Once these three columns are mapped, double-clicking on a row in the data sheet row listing will
display an alert dialog with the accession data in mapped Genesys JSON format.
.Preview of data in JSON format
As you continue mapping other columns, more information will be included in the JSON preview dialog.
WARNING: An application error dialog will be displayed when mapping is incomplete!
=== Mapping your data to MCPD
=== Handling multiple values
MCPD standard specifies that multiple values may be provided for specific descriptors. One example of such data is
the MCPD `REMARKS` field. You may manage this data in one Excel column or use multiple columns
for each individual comment.
Anno allows you to specify whether a single column contains multiple values and allows you to specify how the
data should be split. Alternatively it allows you to map multiple columns of the data sheet to the same MCPD descriptor.
In both cases, the individual pieces of the data will be converted to an array of values.
=== Using regular expressions
== Pushing data to server
After you have mapped your data to MCPD and confirmed that the JSON looks "just fine",
you are ready to *push* the data to the Genesys server. See Configuration section for
The *Push dialog* offers functions:
. Parse all
. Upload
. Remove
. Changing the logging level between DEBUG, INFO and WARN
.The Push dialog
=== Parse all
The "Parse all" action triggers a read-convert-parse operation of all records in the selected data
sheet. This is a useful operation that will check whether all of your data will correctly load, parse
and convert using the mapping definitions you have provided. Keep an eye on the log report
and fix your data before you attempt a *push* operation.
=== Upload
"Upload" will send the data from the selected data sheet to Genesys server specified in the Settings
dialog. You will be prompted with the Genesys server URL before you begin pushing updates to
the server.
=== Remove
"Remove" is an operation of last resort. It will remove accession records from the active database
to the archive. Only the three core columns must be mapped for the *delete* operation:
WARNING: If applicable, Use `HISTORIC` flag instead of deleting records from Genesys.
Note that Genesys never actually deletes the accession data, it merely moves it to an archive that
remains accessible if the record is referenced by its `PURL`, the Permanent URL.
=== Log levels
The dialog toolbar allows you to toggle the log level from `DEBUG`, `INFO` to `WARN`. This determines the
level of detail rendered in the central log pane of the dialog. It defaults to `INFO`.
== Connecting to Genesys server
The *Settings Dialog* allows you to configure the current Project and specify
which Genesys server will receive your data.
.Settings Dialog
The settings are stored in the Project file and will be saved and loaded with the
rest of the project configuration.
[cols="1,4", options="header"]
.Settings Dialog
|Genesys Server URL|The base URL of the Genesys server instance to use for this project.
For testing purposes the Genesys Server URL must point to
For *production* use the live Genesys URL
|Endpoints|Authorization and Token endpoints will automatically update when the server URL is
changed. Don't touch.
|Client API key and secret|Contact the helpdesk at to obtain the valid
client key and secret. Different values are used for sandbox and production environments.
|Access and Refresh tokens|Authentication tokens used to identify you with Genesys server.
These are obtained by clicking "Authenticate" or loaded from the Project file.
|Clear tokens|Clears access and refresh token values. You will have to re-authenticate with the
|Authenticate|Validates the current configuration against the server or asks you to authenticate
with the server.
=== Authenticating with Genesys
A valid user account on Genesys is required. You may use your Google+ account or create the account
manually by providing a valid email address and an account password.
Make sure you have valid user accounts for the sandbox environment at
and the production servers at
NOTE: You can use Google+ to create your user account on Genesys. You will not need to remember a separate password!
After you have obtained valid Client key and secret from and created your
Genesys accounts, you can authenticate against the selected server (sandbox or production).
Click the "Authenticate" button. When the access and refresh tokens are missing or have expired,
the application will prompt you to authorize the
application's request to access Genesys on your behalf.
If tokens are still valid, their values in the
dialog will be updated with the message: "Tokens are up to date."
.Authentication Dialog
"Open link in browser" opens your default web browser application (Chrome, IE, Firefox, ...) and
Genesys prompts you to allow access to your resources. If you are not yet logged in
to Genesys, you will be prompted to log in before the confirmation dialog is displayed.
.Allow access
Select "Yes, allow access" and Genesys will generate a short-lived *verifier code* that you must copy and paste
to the *Verifier code* field in the Anno dialog. The verifier code is a 6-character string (e.g. `td1S83`).
Unless an error occurs or the verifier code times out, your access and refresh tokens will be updated.
After obtaining the tokens, *save the project* by clicking the "Save" button in the application Toolbar. Give
the project file a name that tells you which Genesys server (production or sandbox) you have selected.
== Troubleshooting
This tool is perfect! No way you have a problem! :-)
However, if you do run into trouble using this tool, contact
for assistance and we will update the tool or this section of the documentation with
resolutions to commonly encountered problems.
== Window Layout
After workspace selection, the main application window is loaded. The window has four sections:
* Toolbar (top)
* List of Data sources (left)
* Data source view (center)
* MCPD descriptor list (right)
.Application Window
=== Toolbar
The toolbar provides access to top-level functions.
.Anno Toolbar
[cols="1,4", options="header"]
.Toolbar buttons
|Load|Load an existing project file
|Save|Save the current project to a file
|Settings|Opens the Settings dialog
|Add file|Add a new data source file to the project
|Automap|Automatically map columns of the currently open dataset to MCPD descriptors
|Push|Opens a dialog to send data to Genesys
|Add database|Add a new database-backed data source to the project
== Workspaces and Projects
Upon starting the application, you will be presented with a *Workspace Launcher* that
allows to create a new Workspace or load an existing Workspace from disk.
A *workspace* allows you to save your Anno configuration files and any JDBC drivers needed
to access your data in one location on your computer.
=== Creating a new Workspace
When you first start the application the you will need to create a new workspace to store
your configuration files.
.Workspace Launcher
Click the "Browse" button and navigate to the directory where you wish to create a new
workspace. You may need to create a new folder for the workspace.
Confirm your selection by pressing "OK".
NOTE: The application will check if the selected folder is empty.
=== Loading an existing workspace
Click the "Browse" button and navigate to the directory with your existing workspace data.
Confirm your selection by pressing "OK".
NOTE: The application will check if the selected folder is a valid Anno workspace folder.
.Invalid workspace folder selection
=== Using the workspace
The workspace acts as a base directory for your configuration and data files. It is good practice
to copy the source files (CSV, Excel) to the workspace folder. This will help you better maintain
your settings and data files you publish on Genesys.
=== Under the hood
Anno creates a sub-folder "jdbc" in your workspace. This folder is used as a source location for
any JDBC drivers you may need to to access your databases.
=== Projects
Anno allows you to manage the settings, data sources and data mapping in *Project* files. A project file
. Server settings, including Genesys server URL, application keys and secrets
. Data sources: CSV, Excel and database queries
. Column configuration and mapping to MCPD
It is good practice to maintain one project file has the configuration used to test the data and push it to the Genesys Sandbox environment,
and a separate project file is used to publish data to the Genesys production servers.
......@@ -105,6 +105,12 @@ public class DataSourceSheet extends AbstractModelObject implements IDataSourceS
public void updateData(List<Object[]> rows) {
int columnCount = 0;
if (rows == null) {
_log.debug("null rows provided. skipping updateData.");
for (Object[] row : rows) {
if (row != null)
columnCount = Math.max(columnCount, row.length);
......@@ -112,7 +118,7 @@ public class DataSourceSheet extends AbstractModelObject implements IDataSourceS
Object[] headers = null;
if (headersIncluded) {
if (headersIncluded && rows.size() > headerRowIndex) {
this.sampleData = rows.subList(headerRowIndex + 1, rows.size());
try {
Object[] headerRow = rows.get(headerRowIndex);
......@@ -63,9 +63,6 @@ public class DatabaseDialog extends Dialog {
protected Shell shell;
private TreeViewer treeViewer;
private Text txtName;
private Text txtDbHost;
private Text txtDbPort;
private Text txtDbName;
private Text txtDbUrl;
private Text txtDbUserName;
private Text txtDbPassword;
......@@ -170,7 +167,7 @@ public class DatabaseDialog extends Dialog {
txtDbPassword = new Text(grpDbConfiguration, SWT.BORDER);
txtDbPassword = new Text(grpDbConfiguration, SWT.BORDER | SWT.PASSWORD);
txtDbPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Composite compositeFooter = new Composite(composite, SWT.NONE);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment