Entry Types
RAMADDA recognizes any plugin file that ends with types.xml as an entry type definition file. Here is an exampletypes.xml file and there are numerous examples in the source code @ github, e.g. https://github.com/geodesystems/ramadda/tree/master/src/org/ramadda/geodata/point/resources

You can use the above xml file as a plugin, copying it into your RAMADDA home/plugins directory. But, if you wanted to include html or other resources you should create a directory structure like below and zip the directory and copy the .zip file to the plugins directory.
someplugin
      exampletypes.xml
      htdocs
          myplugin
               example.png
For example, this would allow you to reference the example.png image as an icon for the entry type with the property:
<property name="icon" value="/myplugin/example.png"/>>
There are many many plugins defined in the RAMADDA source that have types.xml file that can be used as reference: https://github.com/geodesystems/ramadda/tree/master/src/org/ramadda/plugins and https://github.com/geodesystems/ramadda/tree/master/src/org/ramadda/geodata
Column Data Types
Each entry can have any number of column attributes. Each column (see in the example above) has a name, label, type, etc. Here are the list of available data types.
  • string - Use size="..." to specify the column size
  • enumeration - See below to specify values
  • enumerationplus - Just like enumeration but allows use to enter new text values
  • list - A big string internally but shows a list of newline separated text values to the user
  • password - A string but is shown in a password field and is not exported or otherwise accessible.
  • int - Integer
  • double - floating point number
  • percentage - floating point number shows as percentage
  • boolean - true of false
  • date - A date
  • datetime - A date and a time
  • clob - A big character large object
  • email - Shows as an email address
  • url - Shows as a URL
  • latlon - A single geographic point
  • latlonbbox - Geographic spatial bounds
For enumeration or enumerationplus types you can specify a set of enumeration values.
  <column name="fruit" label="Fruit" type="enumeration" values="apple,banana,orange" cansearch="true" />
If this is a large list you can define the values in an external file. This file can be contained in a plugin .zip file or can be stored in your RAMADDA home directory under a "resources" subdirectory. The rule is that the file path has to have a "resources" directory in it. For example, in the Archive plugin there is a resources directory under the full path: values="file:/org/ramadda/plugins/archive/resources/lithology.txt"
Wiki Template
An entry type can have a wiki tag that defines the wiki text template for the entry. The example file above has an example of this wiki text, e.g.:
<wiki>
<![CDATA[
+section title={{name}}
:navtop
{{description wikify=true}}
:heading Charts
{{group}}
{{display type=linechart showMenu=true fields=discharge}}
{{display type=linechart showMenu=true fields=gauge_height}}
:vspace 0.5em
:heading Table
{{display_download}}
{{display_table}}
:vspace 1em
----
:heading Information
+row
+col-md-6
{{information  details="true"  showTitle="false"  }} 
-col
+col-6
{{map}}
-col
-row
-section
]]>
</wiki>
Create Entry Type Form
All entries have a Create Entry Type form available. For example, let's say you have 100 CSV files of the same format and want to create a new entry type. Upload one of the CSV files to your RAMADDA. You can use the SeeSV package to data wrangle the CSV file, cleaning up the data, adding a header, etc. You can then edit the description of the CSV file and enter the appropriate wiki text to define the entry type's appearance.

Once satisfied, select "Create Entry Type" from the Entry popup menu. In this form you can specify a type ID, name, category, etc. If needed you can also specify any number of metadata columns. Once defined you can hit Install Type to generate the entry type definition and install it into memory. This allows you to create an entry of this type to try it out. However, this does not permanently install the entry type definition. To do that press Download Type. This will generate a plugin file (e.g., <some type>_types.xml) which needs to be copied into the RAMADDA plugins directory or incorporated into a zipped up plugin file. This can then be placed in your RAMADDA's plugin directory and, once restarted, your RAMADDA will now have that new entry type where you can upload your files as that type, etc.

If want to define a new entry type with a data file you can just create some arbitrary Folder entry (or any other type) and go to the Create Entry Type form. Note: the type definitions are saved as a regular RAMADDA metadata property associated with the entry. So, for example, you can copy the entry and the type specifications defined in this form will be copied over.
images/createtype1.png?version=936
Entry Type - Basic
images/createtype_basic.png?version=936
The Basic section allows you to define the basic entry type information-
  • A type ID - this needs to start with type_, be lower case with no spaces or special characters. If there are columns defined then this will also be the database table name.
  • A human readable name for the type
  • A "super type" - entry types in RAMADDA are hierarchical. So for example, in the Archive plugin we have a Site Collection type that has geographic metadata. Other types in that plugin (e.g, Geologic Specimen) have the Site Collection as their super type, thus inheriting the geographic metadta.

    If you want this to be point data (e.g., CSV files) then specify type_point (e.g., CSV files).

    There is a link to the master list of all entry types available.
  • Java handler - this is the Java class that handles this type. RAMADDA will try to figure out what this value should be but you can set it explicitly. If this is point data (e.g,CSV files) then specify "PointTypeHandler". If it is just some normal entry but you will specify metadata columns then specify "GenericTypeHandler". Else leave is as Default.
  • You can specify an optional Super Category and Category. This is used to organize the big list of types.
  • An icon. You can provide your own icon as described above or view the icons available at /repository//icons.html
Entry Type - Properties
The Properties section provides a way to specify the myriad number of entry type properties. Examples of the available properties are listed in the right.
images/createtype_properties.png?version=936
There are 2 sets of properties - the XML Attributes and the more general purpose Properties. Please don't ask why these are separate, there are some legacy issues when dealing with a software system that was first developed in 2008.

The XML attributes have to be of the form:
attribute_name="value"
Entry Type - Advanced Configuration
The Advanced Configuration section allows you to put any other XML into the generated types.xml file. TBD - specify what kinds of things can go in here.

The Map Popup is the snippet of wiki text used when displaying an entry in the map.
images/createtype_advanced.png?version=936
Entry Type - Columns
The Columns section allows you to define the entry type columns. Each column consists of a column name, label, data type and any number of extra properties.
images/createtype_columns.png?version=936
The column name must be a valid database column name - lowercase, no spaces, no punctuation, etc. You can entry these directly into the form or keep them in a separate text file for easy editing then use the Bulk Upload.

The "Show properties" link popups a Column Attributes dialog that allows you to add the many different properties that control the behavior of the Column.

When editing you can right in any of the fields to insert, clear and delete rows.
images/createtype_attributes.png?version=936
Entry Type - Admin
images/createtype_admin.png?version=936
The Admin section allows you to specify a comment which gets included in the generated type.xml file.

If the For Import is not checked then the generated will be of the form - e.g., type_archive_seed_specimen_types.xml and can be directly added as a plugin file.

If For Import is checked then the generated xml file is of the form <type_the_type.xml> and will not be recognized as a plugin file. (e.g., type_archive_seed_specimen.xml) as entry type files all end in "types.xml" You can import the file in a file, e.g., importtypes.xml,that contains, e.g., the below. This allows you to handle in order the entry types that inherit from other types
<types>
<import resource="type_archive_site.xml"/>
<import resource="type_archive_specimen.xml"/>
</types>

If the "Yes, drop the database table" is checked and your password is entered then the whole database table is dropped and recreated from the Columns definiton. Be careful using this as any data might be lost. This is provided because sometimes the database data type of column definitions has to be changed (e.g, a string to a double) and the change isn't allowed by the database.
Creating the entry type
Once specified press Download Type. This will generate and download a types.xml file which you can install as a plugin or import into a types.xml file.

If you have any SeeSV commands specified for the entry to convert CSV data then those are included in the generated types.xml. If you have wiki text specified then that too is included.