4.11. Data Source Updating

There are many circumstances where you will want to move a group of templates or a complete installation of EspressChart from one location to another. For example an application can move from development to a production environment. In each environment, the location and connection information for data sources may be different. In this scenario, updating chart templates one by one as detailed in the previous section isn't a feasible way to change the connection information for a large number of templates. Instead, EspressChart allows you to quickly update a group of templates based on information in the data registry.

Although chart templates maintain an internal copy of the data source information (allowing them to be deployed independently), they also maintain information (location & source) about the data registry from which they were created. Hence, when you modify a chart's query (as detailed in Section 4.2.4 - Editing Queries), you have the option to save the changes back to the data registry. In order to use this feature, you will have to keep your data registry up to date. This means that query changes should be saved back to the registry and changes in data view structure should be propagated to data view queries as detailed in Section 4.2.3.2 - Updating Data View Queries.

To use this feature, first make any modifications to the data registry that you want to propagate to the chart templates. These modifications can include database connection information, file locations for text, XML data files, and even changes to data views or queries that you want to pass to the templates. Note that if you're moving charts between installations, the data registry file will need to be moved to the same relative location in the new installation. In addition, the associated query files for that registry (.qry/.dvw/.ddt) will need to be moved to /queries/ directory of the new installation (Query file names begin with the name of the registry).

From the data source manager, select UpdateCharts. This will bring up a dialog allowing you to select which charts you want to update.

Select charts for Data Source Updating

To select charts to update, first browse to the directory that contains the charts. After you select a directory, any chart templates will appear in the left side of the dialog. You can select any templates you want to update and click the Add button. You can navigate to as many different directories as you want to select templates. Selecting the Connection Info Only option will only update the connection information (database URL, driver, username, password, and locations for XML files, text files and Java classes). Queries and data view information will not be updated in the templates.

Once you finish selecting the templates you want to update, click OK and the updating process will begin. A dialog will display the current progress and any errors.

A log file named UpdateDataSources will also be written in the root directory of the installation with the contents of the progress screen. Charts that fail the updating for various reasons can be updated manually using the option in Chart Designer.

[Note]Note

Only charts for the current data registry will be modified. If you select charts that do not retrieve their data from a source in the current registry, they will be ignored.