Summary: this page describes how to manage source code aliases using the Admin Center. This feature is only visible to users with the ADMIN or SUPER ADMIN role. In CAST Imaging ≥ 2.15, aliases can be added using the datasource icon . See: Admin Center - Configuring data source.
Introduction
The alias feature allows you to choose which CAST Storage Service/PostgreSQL instance is used to fetch the source code for an object in a given application when Viewing source code. The Applications panel enables you to manage the application aliases. By default the Schema Name column will always be displayed - this column indicates the name of schema from which the original application data was exported from:
Click to enlarge
If you do not see a list of Applications, click panel 2 to display the Application list:
Use case
This option is aimed at situations where the Application was exported from CAST Storage Service/PostgreSQL instance "A" and the Application is being stored on a different CAST Storage Service/PostgreSQL instance "B" for use with CAST Imaging. Typically this occurs when a CAST Storage Service/PostgreSQL instance is set up specifically for use with CAST Imaging to avoid CAST Imaging connecting to the "production" CAST Storage Service/PostgreSQL instance.
Managing aliases
In order for this feature to function, the details of the CAST Storage Service/PostgreSQL instances containing the Application source code must first be configured in the application.properties file - see Configure the source code viewer for more information - i.e. all required instances must be added. In the following example, two CAST Storage Service/PostgreSQL instances have been added: my_postgresqlA and my_postgresqlB:
datasource.url=jdbc:postgresql://my_postgresql1:2284/postgres,jdbc:postgresql://my_postgresql2:2284/postgres datasource.username=operator,operator datasource.password=CastAIP,CASTAIP datasource.alias=my_postgresqlA,my_postgresqlB
After doing this, an additional column called Selected Alias will be displayed in the Applications panel - this indicates the CAST Storage Service/PostgreSQL instance that CAST Imaging will connect to, to fetch the required source code for your objects:
Click to enlarge
If you need to switch to a different CAST Storage Service/PostgreSQL instance for the Application's source code, select the Application and then click the edit button:
Click to enlarge
Then choose the alias that corresponds to the CAST Storage Service/PostgreSQL instance you want to switch to:
The alias in the Selected Alias column will update to show the alias you selected. This alias (and its corresponding CAST Storage Service/PostgreSQL instance) will now be used to fetch the source code for the application when Viewing source code: