Skip to main content
Version: 8.3

ContentService service

Level: advanced

Endpoints

/

Check whether the bundling service is functional. To access the endpoint, use GET method. The / endpoint takes no parameters.

Parameters

ContentPath*

Path to the directory that includes static content.

OutputPath

Path to the directory that stores the files generated by the bundling service, for example, bundled files.


/process-content

Primary endpoint. Enable generation of minified bundled files and changes to the _ContentBootstrap.js configuration file. To access the endpoint, use POST method. The /process-content endpoint takes parameters passed within the request body in JSON.

Parameters

ContentPath*

Path to the directory that includes static content.

OutputPath

Path to the directory that stores the files generated by the bundling service, for example, bundled files. The parameter value matches the ContentPath parameter value that has the bundles suffix added.

SchemasBundlesRequireUrl

The URL used in the RequireJs configuration file for the browser to load bundled and/or minified files. Required when changing the default value of the OutputPath parameter to a different value.

MinifyJs

Specify whether to minify *.js files. By default, true.

Available values

true

*.js files are minified.

false

*.js files are not minified.

MinifyConfigs

Specify whether to minify the generated RequireJs configuration files. By default, true.

Available values

true

The generated RequireJs configuration files are minified.

false

The generated RequireJs configuration files are not minified.

ApplyBundlesForSchemas

Specify whether to bundle *.js files of static schema content. By default, true.

Available values

true

*.js files of static schema content are bundled.

false

*.js files of static schema content are not bundled.

ApplyBundlesForResources

Specify whether to bundle *.js files of schema resources. By default, true.

Available values

true

*.js files of schema resources are bundled.

false

*.js files of schema resources are not bundled.


/clear-bundles

Disable generation of minified bundled files, remove bundled files, and change the _ContentBootstrap.js configuration file. To access the endpoint, use POST method. The /clear-bundles endpoint takes parameters passed within the request body in JSON.

Parameters

ContentPath*

Path to the directory that includes static content.

OutputPath

Path to the directory that stores the files generated by the bundling service, for example, bundled files. The parameter value matches the ContentPath parameter value that has the bundles suffix added.

Force

Specify whether to remove bundled files. By default, false.

Available values

true

Enable forced removal of bundled files.

false

Disable forced removal of bundled files.


/minify-content

Minify static content. To access the endpoint, use POST method. The /minify-content endpoint takes parameters passed within the request body in JSON.

Parameters

ContentPath*

Path to the directory that includes static content.

OutputPath

Path to the directory that stores the files generated by the bundling service, for example, bundled files. The parameter value matches the ContentPath parameter value.


Settings

Logging

Manage logging levels. Instructions: Set up logging for Creatio on-site via the LoggingConfiguration configuration object.


UseParallelism

Specify whether to use parallelism. Parallelism speeds up minification and bundling. Parallelism significantly increases the load on the CPU as well as network and/or drives. By default, false.

Available values

true

Parallelism is enabled. File processing operations are divided into independent blocks. This helps speed up the bundling service.

false

Parallelism is disabled.


UseCancellation

Specify whether to cancel operations automatically. Automatic cancellation of operations prevents overusing resources when requesting static content repeatedly if the previous request is not completed. Automatic cancellation of operations is performed only when bundling content and does not affect other operations. On a standard exit, for example, by pressing Ctrl + C in the console or stopping the pool via IIS, the bundling service stops receiving new requests as well as tries to end the ongoing processing safely. By default, true.

Important

We recommend safe termination unless forcible termination is required. Forcibly terminating the ContentService might cause Creatio to fail.

Available values

true

Automatic cancellation of operations is enabled and Creatio terminates the execution of cancelable tasks. The bundling service receives a request to process static content that is already processed, schedules the next operation, and tries to cancel the current operation.

false

Automatic cancellation of operations is disabled and Creatio awaits until the started tasks are completed.


ShutdownFinalizationDelay

Manage the amount of extra waiting time in milliseconds to complete the bundling service safely.


BundleGeneration

Manage bundling.

Parameters

DictionaryPath

The path to the BundlesDictionary.txt file of the dictionary. The BundlesDictionary.txt file is pre-generated and delivered with ContentService. The dictionary is the schema bundling order to optimize the creation of bundled files. Schemas not in the dictionary are included in the bundled files in alphabetical order. We recommend generating a custom dictionary for heavily customized instances.

Generate a custom dictionary
  1. Download and unpack the *.zip archive that includes the FileListGetter utility. Download

    The utility requires the .NET Framework version 4.7.2 or later in the Creatio instance to generate a custom dictionary.

  2. Open the app page.

  3. Open the Network tab in browser debugging tools. Learn more: Front-end debugging tools overview.

  4. Load static content files. To do this, refresh the page.

  5. Save the *.har file to the HarFiles directory of the FileListGetter utility. To do this, right-click the downloaded file area and select the corresponding option.

  6. Repeat steps 1–5 for all app pages to generate a dictionary.

  7. Copy the BundlesDictionary.txt file to the Output directory of the FileListGetter utility.

  8. Run the FileListGetter.exe utility file.

As a result, a custom dictionary will be generated and saved to the BundlesDictionary.txt file in the Output directory.

IgnoredFileNamePatterns

Manage how to ignore files that must not be bundled. Bundling service ignores the following files:

  • Static content files that are not valid RequireJS modules. Browsers cannot load these files from bundled files.
  • Static content configuration files that are loaded in a special way and must not be bundled.

BundleMinLength

Size threshold in characters/bytes for generated bundled files. If the bundled file size exceeds the specified value during bundling, its generation stops and the next bundled file is created. By default, "204800" (generates files whose size is 200–250Kb).


InfluxDbConnectionString

InfluxDb connection string. ContentWatcher and ContentService enable recording the metrics of successful and unsuccessful operations in InfluxDb. Learn more: official vendor documentation (InfluxDb).

Configure the connection to the InfluxDb
  1. Open the appsettings.json file.
  2. Go to the InfluxDbConnectionString attribute.
  3. Use parameters to configure connection.
  4. Save the changes.
appsettings.json file
"InfluxDbConnectionString": "url=http://1.2.3.4:5678; db=content; user=User1; password=QwErTy; version=v_1_3"
Parameters

url*

InfluxDb server URL.

db

The name of the database to write the metrics. By default, "content."

user

The user name to connect to the InfluxDb server. By default, an empty string.

password

The password to connect to the InfluxDb server. By default, an empty string.

version

Version of the InfluxDb server. By default, "Latest." Available values: "Latest," "v_1_3," "v_1_0_0," "v_0_9_6," "v_0_9_5," "v_0_9_2," "v_0_8_x."

InfluxDb metrics

The InfluxDb metrics are written by the ContentService and ContentWatcher. Learn more about metrics written by ContentWatcher: ContentWatcher common settings.

service_processing_duration

Content processing duration.

service_error

Errors received while bundling, deleting temporary directories, and cleaning bundled files.


InfluxDbConnectionTimeout

Timeout in milliseconds for InfluxDb connection. By default, "5000."