Bulk Publishing and Translating - merkator-software/GaiaBuilder-manual GitHub Wiki

GaiaBuilder has the option for bulk publishing and translating apps and maps. Only one configuration needs to be maintained and stored into GIT, but can be published many times with minor configuration differences and translations. This streamlines the development and publishing process, while delivering the right configuration to the right user.

To do this, GaiaBuilder introduces the concept of Subenvironments. A Subenvironment depends on a main environment and will take the default settings from the main environment.

The following options are available when bulk publishing Mapservices with the Enterprise Geodatabase

  • Switch the database connectionstring using a unique database username from the Subenvironment configuration
  • Switch the database schema using the schema name in the Subenvironment configuration
  • Publish the Mapservice to the ArcGIS Server folder from the Subenvironment configuration
  • Apply specific service configuration parameters from the Subenvironment configuration

The following options are available when bulk publishing Mapservices and Content

  • Publish the Mapservice or Content to the Portal folder from the Subenvironment configuration
  • Share with a group specified in the Subenvironment configuration

The following options are available when bulk publishing Content

  • Apply specific rewrites from the Subenvironment configuration
  • Translate content using the translation CSV file from the Subenvironment configuration

SubEnvironmentRegistry

The SubEnvironmentRegistry makes it easy to add new Subenvironments. There is no need to reconfigure the GaiaBuilder.ini for a new bulk publishing target or to add a new language. This also avoids changing the GIT configuration for the same reasons. The SubEnvironmentRegistry will configured as a Hosted Table Service On ArcGIS Enterprise

Configuration

Open ArcGIS Pro and open the GaiaBuilder Content Processing GP Toolbox. The necessary tools to configure and administer the SubEnvironmentRegistry can be found here

images/ToolboxSubEnv.png

  1. Open the tool Create the Subenvironment registry
    1. Default Schema : the input database schema which will be updated to the target subenvironment database schema when publishing Mapservices
    2. Default User : the input database user which will be updated to the target subenvironment database user when publishing Mapservices
    3. Default Rewrites : the Key and Seach text will will serve as the input when rewriting content to the target subenvironment. The search text should contain text or url's which will be replaced during publishing images/CreateSubenvregistry.png
  2. Run the tool. Then open ArcGIS Enterprise and locate the published SubEnvironmentRegistry item: images/SubEnvRegistryStep1.png
  3. Open the tool Add Sub Environment images/AddSubEnvironment.png
    1. Identifier : the unique identifier for this Subenvironment
    2. Inifile Base Environment : the main environment which is configured in GaiaBuilder.ini . This setting maps Portal for ArcGIS and low level configuration settings onto the SubEnvironment
    3. GIS Server : The URL of the ArcGIS Server to publish the Mapservices to
    4. Portal : The URL of the Portal for content publishing
    5. DB Schema : the database schema where Mapservices should switch to for the tables and featureclasses
    6. DB Username: the username of the database user which should used to publish the tables and featureclasses with. A database registration with this username should be present in the ArcGIS Server Datastore configuration
    7. Groups : comma separated list of groupnames the services and content should be shared with
    8. GIS Server folder : the ArcGIS Server folder where Mapservices for this Subenvironment should be published
    9. Portal folder : the Portal folder where the services and content for this Subenvironment should be published
    10. Service properties : Optional list of service properties which will override any service property configured in the Mapservice JSON configuration
    11. Rewrites : List of rewrite replacements. Make sure that the keys and number of entries match the keys and entries at the default environment. This gisserver is added by default, but can be changed or removed.
    12. Language file : CSV-file containing the translations for the content. The directory where this file is stored must be supplied runtime on the commandline
  4. Run the tool. Then verify the result on the published SubEnvironmentRegistry item

Publishing using the Subenvironment

Run InstallContent_lite.py with the parameter "-e *" to publish all subenvironments. Replace * with the Identifier to publish the specified Identifier only For example:

  • python.exe GaiaBuilder\Installcontent_lite.py -f content.json -s MYSERVER -e *
  • python.exe GaiaBuilder\Installcontent_lite.py -f content.json -s MYSERVER -e MYFIRSTSUBENV

Translating content

Using a language file, content can be translated. The translation works using a exact search and replace on specified properties. This is slightly different from the text search&replace with the rewrites, which works using text search and replace. The input text as JSON property has to be an exact match on order to replace this match with the translation, furthermore, the JSON property key has to be matched as well.

Run InstallContent_lite.py with the parameter "-e *" to publish all subenvironments. Replace * with the Identifier to publish the specified Identifier only. Supply the directory where the translation CSV files are stored with the -t parameter For example:

  • python.exe GaiaBuilder\Installcontent_lite.py -f content.json -s MYSERVER -e * -t C:\Translations
  • python.exe GaiaBuilder\Installcontent_lite.py -f content.json -s MYSERVER -e EN -t C:\Translations

The CSV files itself are configured in the SubEnvironmentRegistry

CSV file format

The CSV file format has three columns, separated by the semicolon character ;

  1. JSON properties, comma separated. The translation will be applied to these JSON properties only. Case sensitive!
  2. Translation input. The value of the JSON property, or the Fieldname when a Layer Field will be translated
  3. Translation, the value that will replace the input

For example, translation from English to Dutch the JSON properties 'name' and 'title' :

name,title;CUSTOMERS;Klanten

The example above will translate all JSON properties 'name' and 'title' where the text value is 'CUSTOMERS' and replace this text value with 'Klanten'

For example, translation from English to Dutch the JSON properties 'label' and 'alias' :

label,alias;CUSTOMER_NAME;Klantnaam

The example above will translate all JSON properties where the text value is 'CUSTOMER_NAME' and replace this text value with 'Klantnaam', or when the JSON Object is a Field configuration on a layer, the CUSTOMER_NAME column name will be compared as well and in that case, the 'label' value will be set to 'Klantnaam'