Step 1. Launch Aspire and open the Content Source Management Page

Launch Aspire (if it's not already running). See:

Step 2. Add or select a Workflow

  • Add a new workflow or open an existing workflow.
  • For this step, please refer to the Workflow Introduction.

Step 3. Add the DBserver Publisher to the Workflow

  • Select the event for which you want to add the Elasticsearch Publisher to, from the Event combo.
  • To add an Elasticsearch Publisher, drag the Elasticsearch Publisher from the Rules Section on the right side of the screen and drop it below the Workflow Event to the left side of the screen. This will automatically open the Elasticsearch Publisher window for the configuration of the publisher.



Step 3a. Specify a description for the Publisher

 In the top section of the DBserver Publisher configuration window, specify the description for the publisher.


Step 3b. Specify General Settings

In the General Settings section of the DBserver Publisher configuration, specify the General Settings values for the connection to the DB engine.

  1. Database connection: Configuration for connecting to the DB.
    1. JDBC URL: Url where the DB engine is running. This needs to follow this format: "jdbc:<DB_ENGINE>://<PLACE_WHERE_THE_DB_SERVER_IS_RUNNING>:<DB_PORT>/<NAME_OF_DB_TO_CONNECT_TO>".
    2. User: Name of the user with access to the DB.
    3. Password: Password to connect to the DB.
  2. Use Local Driver: Tell Aspire to use a Local downloaded driver or an uploaded driver.
    1. JBDC Driver Jar (if selected "Local Driver"): Path where the driver jar is (recommended in the "lib" folder).
    2. Driver Resource File (if not selected "Local Driver"): The Aspire Resource with the driver. 




Step 3b. Specify JDBC advanced options

This is if you need more advanced/customized options to use the JDBC driver.

  1. Specify JDBC Driver Class: If you need to manually specify the Driver class.
    1. JDBC Driver Class: The name of the Default Driver Class.
  2. Specify Classpath: If you need to add external jars that the driver depends on.
    1. JDBC Classpath: The classpath for external jars.

Step 3c. Specify Table options

This section is for the table on the DB.

  1. Table Name: Name of the table you want to publish to.
  2. Id Column Name: Name of the Id column. If you have multiple PK, separate by comma.
  3. Transform document before mapping: For Groovy transformations.
  4. Use a File for Mapping: If you have an existing file/resource for mapping the columns to publish to.
    1. Use Local Mapping File: If you have a file in your local or want to use an Aspire resource.
      1. Mapping File: Path to the mapping JSON file. An example of this file is shown below.
    2. Resource Mapping File: The Aspire resource with the mapping.
  5. Table mapping (if not using a mapping file): The mapping to publish to DB via the Aspire UI.
    1. You hit the "+" (plus sign) button to create a mapping.
      1. Document Field Path: The path inside the Aspire Document to map.
      2. Column Name: The name of the column to publish the mapped field from the document.
      3. Field Type: The type of data that the mapping will have (it must be similar or equal to the type on the DB table).
      4. Use a default value: If you want to add a default value if there are missing data on the aspire document. 



Mapping File Example.json
{
	"fieldMapping": [
		{
			"fieldPath": "/doc/qid",
			"columnName": "qid",
			"fieldType": "stringType",
			"useDefaultValue": "false"
		},
		{
			"fieldPath": "/doc/id",
			"columnName": "id",
			"fieldType": "stringType",
			"useDefaultValue": "false"
		},
	    {
			"fieldPath": "/doc/connectorSpecific/field[@name='actor_id']",
			"columnName": "actor_id",
			"fieldType": "longType",
			"useDefaultValue": "false"
		},
		{
			"fieldPath": "/doc/connectorSpecific/field[@name='actor_id']",
			"columnName": "actor_id_l",
			"fieldType": "longType",
			"useDefaultValue": "false"
		},
		{
			"fieldPath": "/doc/connectorSpecific/field[@name='first_name']",
			"columnName": "first_name",
			"fieldType": "stringType",
			"useDefaultValue": "false"
		},
		{
			"fieldPath": "/doc/connectorSpecific/field[@name='last_name']",
			"columnName": "last_name",
			"fieldType": "stringType",
			"useDefaultValue": "false"
		},
		{
			"fieldPath": "/doc/connectorSpecific/field[@name='last_update']",
			"columnName": "last_update",
			"fieldType": "datetimeType",
			"useDefaultValue": "false"
		},
		{
			"fieldPath": "/doc/seed/properties/batchRetrieve",
			"columnName": "batchRetrieve",
			"fieldType": "booleanType",
			"useDefaultValue": "false"
		},
		{
			"fieldPath": "/doc/seed/properties/stringIdColumn",
			"columnName": "stringIdColumn",
			"fieldType": "booleanType",
			"useDefaultValue": "false"
		}	
	]
}

Step 3d. Specify Debug Configuration


 In the Debug section of the Elasticsearch Publisher configuration, specify the Debug flag.

  1. Debug: Check to enable debug mode to show debug messages from the publisher.


Step 3e. Click on the Add button


Once you click the add button, the Elasticsearch Publisher settings will be saved.


Once you've clicked on the Add button, it will take a moment for Aspire to download all of the necessary components (the Jar files) from the Maven repository and load them into Aspire. Once that's done, the publisher will appear in the Workflow Tree.

For details on using the Workflow section, please refer to Workflow introduction.