com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Asset Resource Storage

The Publisher and Store both use a storage mechanism to serve files and images. These resources are stored in a database and its access is controlled using configurations found in the RXT extension files.

The storage mechanism can currently handle only images and PDF files. If more file types need to be handled, then the getContentType function (utility.js:643:getContentType) in the <ES_HOME>/repository/deployment/server/jaggeryapps/publisher/modules/utility.js file needs to be modified.

Changing the storage location

The datasource defines where the database tables reside. The datasource definition is defined in the master-datasources.xml file, which is in the <ES_HOME>/repository/resources/conf/datasources/ directory. The default datasource used for the Publisher and Store in ES is JAGH2.

The storage mechanism uses the master-datasources.xml file to obtain the datasource information. Since there are multiple datasources defined in the master-datasources.xml file, the storage system checked the respective storage.json file in the Publisher and Store configuration directories.

  • Store configuration directory: <ES_HOME>/repository/deployment/server/jaggeryapps/store/config/
  • Publisher configuration directory: <ES_HOME>/repository/deployment/server/jaggeryapps/publisher/config/
storage.json for Publisher
{
    "driverPath":"/drivers/",
    "driverUsed":"default",
    "dataSource":"JAGH2",
    "storageUrlPattern":"/{context}/storage/{type}/{id}/{uuid}",
    "storeFields":["images_banner","images_thumbnail","overview_url"],
    "context":"publisher"
}

To change the storage location:

  1. Define the new datasource in the master-datasources.xml file, which is in the <ES_HOME>/repository/conf/datasources/ directory. 
  2. Navigate to the storage.json file in the respective configuration directory.
    • Store: <ES_HOME>/repository/deployment/server/jaggeryapps/store/config/storage.json
    • Publisher: <ES_HOME>/repository/deployment/server/jaggeryapps/publisher/config/storage.json
  3. Update the dataSource property with the newly defined datasource.
  4. Create the corresponding DB scripts, which will define the create directive for a tables to hold the resources. Name the DB scripts as follows: resource.sql
  5. Save the newly created DB scripts in the <ES_HOME>/dbscripts/storage/<DBMS_NAME> directory.
    For example:
    <ES_HOME>/dbscripts/storage/mysql


At any given time the the storage mechanism can only interact with one relational database.

Storing a field in storage

All fields in the RXT can be stored in the storage by changing the type of the field to file. When a user changes the field type to file, the UI generated will contain a browse button next to the field.

To store a field in storage:

  1. Navigate to the <ES_HOME>/repository/deployment/server/jaggeryapps/publisher/config/ext/ directory.
  2. Open the JSON file that corresponds to your asset.
  3. Change the type parameter to file.

    {
      "name": "banner",
      "table": "images",
      "type": "file"
    },
    {
      "name": "thumbnail",
      "table": "images",
      "type": "file"
    },

Securing resources stored in a DB

If required, the user can set access levels for each state of an asset.

Follow the instructions below to secure an asset:

  1. Navigate to the /config/ext/ directory corresponding to the Publisher or Store.
    Publisher: <PRODUCT_HOME>/repository/deployment/server/jaggeryapps/publisher/config/ext/ directory.
    Store: <PRODUCT_HOME>/repository/deployment/server/jaggeryapps/store/config/ext/ directory.
  2. Open the JSON file corresponding to the asset.
  3. Update the permissions specified for each state of an asset in the Storage function.

    "storage": {
            "images_banner": {
    
                "lifecycle": {
                    "created": ["Internal/private_{overview_provider}"],
                    "in-review": ["Internal/reviewer", "Internal/private_{overview_provider}"],
                    "published": ["Internal/everyone", "Internal/private_{overview_provider}", "Internal/reviewer", "anon"],
                    "unpublished": ["Internal/private_{overview_provider}"]
                }
            },
            "images_thumbnail": {
                "lifecycle": {
                    "created": ["Internal/private_{overview_provider}"],
                    "in-review": ["Internal/reviewer", "Internal/private_{overview_provider}"],
                    "published": ["Internal/everyone", "Internal/private_{overview_provider}", "Internal/reviewer", "anon"],
                    "unpublished": ["Internal/private_{overview_provider}"]
                }
            }
        }
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.