Administrator Scripts

Scripts that may be useful for administrators.

Various Jython scripts are provided to make administration easier. Typically, they are invoked by doing the following on the primary ACS server:
  1. Open a command shell.
  2. cd /d %lspeed_home%\iEngine\python
  3. jython <<scriptname>>.py

Invoking a script with no command line arguments typically prints out usage instructions. Sometimes a script interactively prompts for input. In a few cases, the script just performs its intended task. It is best to read the script before executing it, unless Astoria support has supplied specific instructions on how to run a script.

Here are administrator scripts you can use:
Name Description
batchRollForward.py Performs a batch Roll Forward action on multiple objects. See Rolling Forward an Object Version.

The script processes a pipe-separated value (PSV) file of <Astoria Object ID> | <revision stamp name> values; for example, the following pair of values, 00000018WGA3070GYZ|1.0, instructs the script to roll the file forward to version 1.0.

Run from command shell (cmd): jython batchRollForward.py %PSV file%.
Important: Test the script on a small nuimber of test documents before executing on production content.
checkForBadUsers.py Lists any Astoria User who does not have a matching Windows User Name. Also, this script lists any Astoria User with a matching Windows User Name but whose Windows-account password has expired.
compareFolderItemsInReleases.py Validates that the same named items exist in two releases. Run the command with no arguments to print instructions.
CreateDBUsers.py An administrator can run this script and supply a csv file with the users to be created or modified. See Creating or Modifying a User Definition Using a Script.
customReindex.py submits reindex event(s) to perform specific post processing. Running this script without parameters prints instructions.
destroyFolderItems.py Permanently deletes the specified folder item (folder, document, file, and so on) without performing any referential integrity checks. In addition, the deleted object is permanently deleted; it is not moved to the wastebasket.
disableWasteBasket.py When invoked without arguments, the waste basket is disabled so that all deletions are immediate and non-reversible. When invoked with a parameter of enable, waste basket functionality is re-enabled. See Configuring the Repository Wastebasket.
enableSuppressEmptySVReports.py Enables Astoria to suppress creation of empty separated value reports. Invoking the script will define the enumerated custom attribute definition Suppress Empty SV Report. In addition to the custom attribute being defined, it must be set true on each report definition in Astoria that is to suppress generation of empty output files. See Suppressing the Creation of Empty Separated Value Reports.
fixPersistedIds.py A cleanup script to locate misattributed documents. If found, a repair script must also be run. See the topic Cleaning Up and Repairing Misattributed Documents ACS Installation and Configuration Guide.
fixrawimportlinks.py Fixes broken links with best match found. This script should only be run if instructed by Astoria Support team.
findCommentsOrProcessingInstructions.py Script is used to find xml comments or processing instructions containing a substring you specify.

Usage: jython findCommentsOrProcessingInstructionsContainingText.py –h #this will print out the documentation

Sample command line if you have the guid of the cabinet, folder, or document you want to process:
jython findCommentsOrProcessingInstructionsContainingText.py -tp -c "15_display" 00000016WGA1080GYZ
Sample output:
Parameters: {folderItemStrings=['00000016WGA1080GYZ'], type=2, content=15_display, verbose=false}
Searching: Documents for Don > Biking of type Folder
Hit in doc: Documents for Don > Biking > Documents 1 - 2 > tp_SealBeach.dita, comment: target Pub UDT FAR15 _display.
Result Count: 1. 00000023WHG1003302080GYZ
Done 
Note: The content matching argument is case SENSITIVE.
findCommentsOrProcessingInstructionsContainingText.py Locates text in XML comments or processing instructions and also supports deletion.
findOrRemovePIs.py Removes unwanted processing instructions preceding the first element of a document.
importTopLeaf.py Imports a TopLeaf folder into the database. Parameters are:
  • The folder to import
  • The directory to which the imported folder and its contents are shadowed
  • Optional pattern argument to cause files that match the pattern to be ignored

For example:

jython importTopLeaf.py C:\Users\Don\TopLeaf\Astoria C:\Styles .*\.png

In this example, the script ignores all files that have the .png extension.

reuseReportHelpers.py Prunes obsolete custom attributes from DITA maps that can degrade Workbench performance when viewing or editing those maps. See the task Post-Upgrade Script reuseReportHelpers.py in the ACS Installation and Configuration Guide for Astoria 6.5.
registerAlternativeNamingParams.py Registers DITA-OT transtype parameters to a list of watched parameters. When one of these parameters is present in a transtype parameters map during the composition process, it will trigger Astoria to switch the naming convention of the output file.

Traditionally Astoria names its output files in the format [name].[extension]. However the presence of a registered parameter will alter the naming to be of the format _id_[astoria_object id]_[name].[extension]. This naming convention is required for certain transtypes to work, such as EditLink. See About the EditLink Plugin . However, Astoria automatically adds the three EditLink plugin custom parameters to the watched parameters during an upgrade or installation, so customers who subsequently install the EditLink plugin do not need to run the script to add the parameters. The script is supplied for customers who may install other plugins that require similar functionality to work correctly.

Supported commands are:
  • add - requires a parameter argument. Adds a parameter to the watch list.
  • remove - requires a parameter argument. Removes a parameter from the watch list.
  • list - does not require a parameter argument. Lists all of the currently watched parameters.

The parameter argument is the name of the parameter to register to watch.

ServletsRecycling.py This script will recycle all read/write servlets on Primary and Secondary ACS servers. No parameters are needed.

Run this script only on the Primary ACS Server.

Periodically servlets should go offline exit/restart, reinitialize, then go back online. Only one servlet should recycle at a time.

Note that the script waits 5-10 minutes per servlet, so this can take a few hours to execute. Ideally, it should be scheduled to run during lowest system usage such as right after backups.

setActivityLogging.py Enables logging of repository activity, creating an Activity DITA map in the Administration cabinet's Logs > Deletions folder, and creating a new DITA topic in the map identifying the activity performed in the repository per day. Logon and logout events are always included by default. An administrator can specify the duration of a session. If a user doesn't perform any operations for the session duration, a logout event is captured.

The Event Queue Properties sheet for Deletions can specify which optional types of events are logged. Logon and logout events are always included by default.

  This script will recycle all read/write servlets on primary and secondary ACS servers. No parameters are needed.

Run this script only on the Primary ACS Server.Note that the script waits 5-10 minutes per servlet, so this can take a few hours to execute.Ideally, it should be scheduled to run during lowest system usage such as right after backups.

setAcrolinxData.py This script configures Acrolinx settings to use SSO and compatibility with Acrolinx API (1.0.8). An administrator can configure:
  • Acrolinx host
  • Signature
  • API token
setATMConrefOption.py Sets translation option that determines if conref text is included as an attribute in the exported translation file.
setAppAdmins.py Sets or Lists the application administrators group.
setCachingOption.py Sets the option that determines whether caching is enabled or disabled for certain operations and objects
This setting affects the HTML output during Review of structured documents and files and provides hints to the browser about how to handle caching of graphics and HTML. This affects review in and out of the Workbench as well as on mobile platforms.
  • none - browsers are instructed not to cache text or graphics
  • graphics - browsers are instructed to cache graphics and not text
  • HTML - browsers are instructed to cache text and not graphics
  • graphicsAndHTML - browsers are instructed to cache both text and graphics

setCheckinOption.py Configures checkin dialog constraints.

This option controls whether users are required to checkin validated XML without detected errors. This is done by forcing the Validate and Cancel on Errors buttons of the checkin dialog to be checked and disabled.

This script can also set require a minimum length for checkin notes, which can be used to force all users to provide a checkin note for every checkin.

This script can set a control to prevent users from altering the Version Name when checking in an object.

setClientDefaults.py The Astoria repository database defaults to 500-second connect and read timeouts. Run this script to specify values that override the default timeouts limits.

Increase the read timeout limit to eliminate errors when importing large document sets or performing other operations which exceed the timeout limit. After you run the script, close all Workbenches and then restart them.

setClientExceptionLogging.py Enables an administrator to configure a global policy for the client logging of stack traces. The default policy is that client stack traces are logged in the client log. For additional security, an administrator can configure the policy to instead have those traces logged in ACS read servlet logs. The script also enables the administrator to override the global policy on a per user basis. The script prompts the user with the various options and does not take any command line parameters.

For examples of client logging and servlet logging when configured to override the global policy, see the topic Configuring Stack Trace Logging in the ACS Installation and Configuration Guide for Astoria 6.5.

setDiagnosticMail.py Configures the email address used for the diagnostic tool.
setDitaErrorPolicy.py Configures if DITA-OT should generate output when non-fatal errors are detected. The default is true. In either case, the log will report all errors.
setDITAOTClasspath.py The script automatically locates all folders starting with DITA-OT inside of the %lspeed_home% directory and constructs the classpath for each DITA-OT version automatically. However, the user is still prompted for VMArgs for each DITA-OT. If the user simply presses Enter at this prompt, the default VM args are used.
Note: This script is called by the Run DITA-OT Integrator command after it has made changes to the DITA-OT files on the server.
setDITAOTEntityMappings.py Defines how to convert a character entity to a character during DITA-OT composition
setDITAOTFilenameCharacters.py Configures which characters to exclude from filenames when exporting for composition.
setDocumentsImportPolicy.py Specifies where structured document references (sub documents) are stored in the repository when importing a structured document. Policy options are:
  • 1 -No hierarchy - All subdocuments are placed in the specified folder for the import operation.
  • 2 -Hierarchy Tranche - Documents are tranched (broken up into separate folders), each folder containing a maximum of 100 documents.
  • 3 -No Hierarchy First Tranche - This is the default value. The first 100 documents are stored in the specified folder for the import; additional documents are tranched into subfolders, each containing a maximum of 100 documents.

When you run the script, the current policy value is displayed. Click Enter to accept the current policy, or click an option number to change the policy. A changed policy takes effect immediately for subsequent imports.

setDomain.py Attach a domain name to all users.
setDTDDataPreload.py Clears and configures DTDs to be cached in ACS Servlets
setEditorOnlineModeCheck.py Changes the polling frequency with which the bridge verifies network access to the server. By default, the polling is disabled. To enable polling, enter the number of seconds between polling intervals.
setElementDescriptions.py Adds or changes element descriptions via script rather than from Workbench dialog.
setEntityFileWhereUsed.py Enables and lists if only first level of documents referencing a file via entity reuse is listed, or if all levels (the default) should be listed.
setEntityNamePrefix.py Sets the prefix characters to be prepended on entity names created by the 'Create Database Entity' dialog used by the LAN Bridge
setEnvironmentVariableRepositoryOverrides.py Overrides the default value for batch operation environment variable, AST_JRE_XOPTS, without requiring system restart since values are stored in repository and read every time a batch job is created. The script must be run by a system administrator on the Primary Astoria Communication Server.
Run the script with no arguments and instructions are printed out. The names of various batch operations are:
  • changeStatus: for changing a object's workflow state through the Change Status command
  • submitBatchedBranchRelease: for branching operations initiated through the Branch Release command
  • submitDITAOT: for composition operations initiated through the Compose With DITA-OT command
  • submitDITAweb: for sending data to the Congility Content Server platform through the Publish to Astoria Portal command
  • submitIngeniux: for sending data to the Ingeniux platform through the Publish to Astoria Portal command
  • submitReport: for Astoria Reports invoked through the Run Report or Run Scoped Report commands
  • submitResetStatus: for resetting an object's workflow state through the Reset Status command
  • submitStartTranslation: for translation packages created through the Start Translation command
setEnumerationLimit.py Sets an Enumeration Limit. This is the maximum number of objects that will be listed in any container in the Workbench. When you click on a folder, or an administrative object, such as an event queue, the children of that object are displayed in the Details view. By default, all items are listed. If you set the Enumeration Limit to X, then only the first X items will be listed.

If you set a limit and an object exceeds the limit, the Details view indicates you have reached the Enumeration limit, and shows the number of additional items not displayed.

Leave the default value of no limit unless you are directed to limit the number by Astoria technical support.

setFileNameFiltering.py Configure file name filtering for export, compose, and translate operations.
setFilterAttributeInfo.py Configures filtering emphasis of elements. Both the background color and list of elements can be listed and changed.
setForceExternal.py Configures the xml importer behavior regarding external references.
setFTPConnectMode.py Sets active or passive FTP behavior for Compose or Reports batch jobs.
Note: Export jobs use the same settings as those for Compose jobs.
setGlobalApp.py This is a general purpose script for storing configuration data. As an example, administrators can configure the pattern used for altering folder item names when duplicates occur during import and move operations. The following commands configure Astoria to use a Windows-like format.
  1. jython setGlobalApp.py 0 com.astoria.database folderItemUniqueName prefix " ("
  2. jython setGlobalApp.py 1 com.astoria.database folderItemUniqueName counter 2
  3. jython setGlobalApp.py 0 com.astoria.database folderItemUniqueName suffix ")"
Note that in this example, the counter is the seed value for duplicate names. The first copy would have (2) appended.
setGraphicsImportPolicy.py Specifies where graphics and external file references are stored in the repository when importing a structured document.
Policy options are:
1 - No Hierarchy
All files and external files are placed in the specified folder for the import operation.
2 - Hierarchy Tranche
Files are tranched (broken up into separate folders), each folder containing a maximum of 100 files.
3 -No Hierarchy First Tranche
Default value. The first 100 files are stored in the specified folder for the import; additional files are tranched into subfolders, each containing a maximum of 100 files.

When you run the script, the current policy value is displayed. Click Enter to accept the current policy, or click an option number to change the policy. A changed policy takes effect immediately for subsequent imports.

setIncludeOTObjectIdAttribute.py Configure that the repository Object ID of document root elements be included in files supplied to the DITA open toolkit.
setIncludeOTSnapshotAttribute.py Enable or disable support for DITA-OT XML exported from Astoria to contain a root element attribute with the snapshot label specified. See Configuring Inclusion of a Root Element Attribute for Snapshot Label.
setIngeniuxSettings.py Sets the Astoria Portal Ingeniux location and Ingeniux login properties for Publish to Astoria Portal. The script will prompt you for the settings. See Configuring the Astoria Portal for Ingeniux Server.
setLocaleMappings.py Configures locale mappings used in translation.
setMapPathLevel.py Displays and sets the number of breadcrumb levels of a document that are sent to Acrolinx. This metadata enables Acrolinx to classify the document. The default (0) sends all breadcrumb levels.
setNameOrDescriptionOfStructuredDocuments.py Changes the name or description of documents using regular expressions.
setNewXmlDocumentGeneratedId.py Configures the automatic generation of ids when creating a new structured document. Both Automatic and Semi-automatic policies are available.

Settings include the seed and the pattern. The seed is a number to start ids with, which will increment for each new Id. The pattern allows you to add text to each new Id, and must contain {0}.

For example, if you enter:
  • seed = 4
  • pattern = id_{0,number,##########}

    The first new id will be id_4, the next will be id_5, etc.

Use this script in conjunction with setNewXmlDocumentIdMode.

See Configuring New XML Document Options

setNewXmlDocumentIdMode.py Controls the backstop value for requiring the user to specify a document id when creating a new structured document.
Options:
  • absent - the id field is will not be shown in the dialog
  • optional - the id field is available but is not required to be set
  • required - the id field is available and is required
  • semiautomatic - the id field is available, initialized with a generated value, and is required
  • automatic - the id field is displayed, initialized with a generated value, but not revisable.
Use this script in conjunction with setNewXmlDocumentGeneratedId.
Note: The specified template document must contain an id attribute on the root element for the Document Id field to be present in the dialog.
Note: You must restart the Workbench if you change this setting.

See

Configuring New XML Document Options

setNewXmlDocumentTitleMode.py Controls the backstop value for requiring the user to specify a title when creating a new structured document.
Note: The specified template document must contain a title element as a first level child within the root element in order for the Document Title field to be present in the dialog.

See Configuring New XML Document Options

setNodeVisitorTransactionCount.py Controls the checkpointing frequency when processing structured documents. This is a balance between operation performance and interference with other user operations.
setOverrideBasedir.py Configures DITA-OT to use the override directory.
setParentApprovalFlavor.py Defines Bookmaps as the "ParentsExistingApprovals" document flavor. When the Add Snapshot dialog is displayed, the existing snapshot labels of parent documents that are bookmaps will be listed.
setPermissions.py Configures permissions for specified groups or roles on an object
setReleaseManagementEnabled.py Can change the visibility of Products icon in the Navigation view. Specify a value of 1 to enable Release Management.

Can control whether workflow status is copied when documents are branched. See Preserving Workflow Status when Branching an Object.

Can define a named user (must be in the Administrators group) that is allowed to hold locks on objects without preventing merge operations to succeed. See .Allowing a Merge When the Object is Locked to a Named User .

setRestrictedFileExtensions.py Configures whether files with specific filename extensions are either allowed or not allowed to be imported into the repository. By default, all filename extensions are allowed. Enter filename extensions (without the leading .) to identify restricted or allowed file types. You can also prevent files with no extension from being imported. The script displays the current list and prompts the administrator to designate the list type.

Updates are active automatically within an hour of invoking the script, or immediately upon restarting Astoria services on all ACS servers. Changes have no impact on files already residing in the repository.

setSessionManagementPolicy.py Configures Session Duration and idle timeout, as follows:
  • Session Duration: set Current Credentials Period in seconds; default is 86,400 seconds (24 hours)
  • Session Idle: set Current Credentials Activity Duration in seconds; default is 3,600 seconds (1 hour)
After running the script, all Astoria Services on all servers must be restarted for the changes to take effect.
setSendLinkOption.py When using the Publish > ViewLink or Location Link commands, this setting controls the database default, the value for users who have not configured their own value. Options include prompting the user, putting the link on the clipboard, and launching the email client program.
setShowHistoryDisableDocumentMode.py Configures backstop value controlling if document mode is enabled on the show history dialog.
setSlowpokeInfo.py
This script enables an administrator to configure the number of concurrent processors (and, therefore, the number of simultaneously running jobs) for each type of Event Queue for batch operations. Each batch queue is configured independently. Furthermore, the script sets a "cut-off" marking the distinction between short-running jobs and long-running jobs. The default cut-off is five minutes. This means:
  • If a job has a prior-execution duration below the cut-off value, it will be handled by one of the short-running processors (also called a "Fast" or "fast-poke" processor).

  • If a job has a prior-execution duration at or above the cut-off value, it will be handled by one of the long-running processors (also called a "Slow" or a "slow-poke" processor).

  • If a job has no prior-execution duration, it will be handled by one of the short-running processors.

Script arguments are:
  • list: displays current monitor configurations
  • modify: displays current monitor configurations and allows the administrator to modify one or more of them. The administrator specifies an index for modification and new values for maxTotal, fast, slow and sec values. Changes take effect after Astoria Task Service restart or ACS reboot.
    Note: In multi-ACS configurations, each ACS can have its own processor configuration.
    Note: If this script is not executed, the default for each event queue is two processors (with no cutoff time). Jobs are processed in the order in which they were queued.

Example output:

Daemon summaries displays the following processor information for all detected Event Queues:

  • maxTotal: The maximum number of concurrent processors
  • fast: the number of concurrent processors for short-running jobs
  • slow: the numnber of concurrent processors for long-running jobs
  • sec: the threshold, in seconds, marking the cut-off between a short-running and a long-running job
  • The path to the configuration file for each Event Queue
setTopicrefAttributeBehavior.py Configures if and how topicref attributes are copied.
setTranslationDaemonExitFrequency.py Allows the administrator to specify the frequency at which the Translation Import Daemon exits and restarts. The script takes no arguments; instead, it displays the current setting and asks for a new daemon-exit frequency. Enter a number of seconds (3600 is recommended) or no number ( never exits) or CTRL+C (no change). There is a potential benefit in exiting and restarting because Translation Import caches data. The larger the amount of cached data, the slower the operation of the system can actually Translation Import Daemon. Restarting the daemon clears cached data.
Note: As of Astoria 6.9, the impact of the daemon-exit frequency is diminished because Translation Import Daemon spawns worker processes for each import operation, and each worker process gets its own cache, which is destroyed when the import operation is completed.
setupCoolbar.py Controls what coolbar items initially appear in a user's workbench.
setupDITALogging.py Configure where DITA-OT logging is written.
setupFolderFormFlavors.py Registers/Unregisters flavored forms and folders.
setupMakeUniqueFolderItemNames.py Configures string patterns when copy or move operations would result in duplicate names in folders.
setupProfileFiltering.py Configures Profile filtering to use a particular webform.
setupSearchFilters.py Enables Search Filters.
setupThumbnailing.py Configures image thumbnails.
setupValidationOfDependents.py Configures the behavior of some WAN editors when saving data to the repository. Dependency validation can be set off, warning, or failure.
setupWebServicesClientExtensions.py Configures workbench customization.
setupWebServiceExtensions.py Configures server side customization.
setupWebServiceGranularity.py Configures frequency of transaction checkpointing to optimize performance while minimizing contention.
setupWorkbenchCommandExtensions.py Adds, lists, and deletes Workbench commands utilizing configuration information stored in the Astoria repository, not in jars deployed as part of Workbench startup.
setViewLinkOption.py Configures user and backstop option of behavior when a repository link is clicked in an email or browser.
setWaitTimes.py Configures how long to wait for a session before asking again.
setWhereUsed.py Configures if Where Used for structured documents returns all structured documents that reference a part of the specified structured document or only those that directly reference some part of the specified structured document.
setXMLDocumentExtensions.py Displays or replaces the list of file extensions for XML documents. Files of these extensions, when encountered as references during import structured document processing will be parsed and create repository structured documents. See Configuring the Repository to Manage SVG Files as Structured Documents.
setXMLDocumentFlavors.py Enables registration of additional structured document flavors which are in addition to those which Astoria already configures.
setXpathCustomAttributeShadowing.py Enables replication of XML attribute values as custom attributes on XML documents upon checkin. See the topic Configuring Replicating XML Attribute Values as Custom Attributes on XML Documents in the ACS ICA Guide.
  • systemIds.py
  • systemIds.bat
  • Implements Astoria database processing.
  • Is a start manager for the systemIds.py script.

See the topic About the System Id Scripts in the ACS Installation and Configuration guide.