Titania Sync Reference Guide

Chapter 1: Overview

The purpose of this reference guide is to help an IT administrator install and configure the Titania Sync Services. The way this application works is it exports content from Windchill to the local filesystem, them imports it into the target system. In most cases the target system is Titania Delivery. Titania Sync is a Java application that is designed to pull content from one location, and push it to another. When it comes to exporting content from Windchill, Titania uses HTTP requests to Windchill using InfoEngine to get the content. All content and metadata is exported to a temporary location. XML content has special processing that also exports referenced content and resolves those references. If the XML content uses specialized document types, the DTD’s must be specified for that to work. An ACL script to be executed in Arbortext Editor is provided to generate the catalogs required for this utility to read specialized XML. Once all the content has been exported from Windchill, the content is pushed to Titania Delivery.

Titania Sync was primarily designed and is support on Windows platforms. It is a Java applcation though, so it can run on other systems, but Oberon does not officially support those systems.

Titania Sync has a few common use cases.

  • Incremental DITA Sync — This use case involves targeting documents that were updated in the past few days for synchronization. This use case is characterized by the use of a QueryFilter that uses the a query like (thePersistInfo.updateStamp>'currentDate')

  • Bulk Sync — This use case involves targeting a large batch of documents, based on some metadata field using a Query Filter, state State Filter.

  • Publication Sync — This use case involves targeting a single DITA publication, usually by number, and Windchill Sync will also pull down all descendant files for synchronization.

The following are the pull from Windchill methodologies.

  • Folder Filter

  • Query Filter

  • State Filter

The following are push to Titania methodologies.

  • Project Sync — This use case is activated by using the TitaniaSync sync config task type.

  • Find, update, and create — This use case is activated by using the FolderSync sync config task type, with a titaniaRepository also configured.

The find, update, and create use case is designed to migrate content from Windchill to Titania. It will find any of the content that already exists in Windchill and update it using its Windchill Number. The Windchill Number can exist as metadata, or in the filename. If a publication does not exist in Titania, this utility will create a project, and upload the publication to that project along with all referenced content.

At a high level, how this is accomplished is by exporting a batch of content to a folder. It then loops over each file in the folder, pulling the metadata from a HARP-META/metadata.json file. It queries Titania for the object using its Windchill Number which is retrieved from the metadata.json. If the object exists, it updates all instances of it. If it does not, and it is a publication, it creates a project based on the publication title, and uploads it along with any referenced content.

This use case has the following flow.

  • Configure the application

  • Clean up the Windchill export cache

  • Archive the last export job if needed

  • Delete the export directory if needed

  • Run Windchill Export if job is set to pull or full

  • Run Windchill Upload if job is set to push, or full

    • Delete the Manifest

    • Recursively loop over each file in the export directory

      • Query Titania for objects that have the same number, or have the number in the name

      • Loop over each result

        • Recursively update referenced files

        • Update the document if an object doesn’t already exist with the same version, and iteration

      • If the object does not exist in Titania, and a title is returned from one of the titleXPath values, then create a new project and recursively upload referenced files

It is also possible to run Titania Sync from a Windchill workflow using the following code. However, we typically discourage this as it can lead to a significant load on the server as well as make content inacessible while it is being reprocessed. It is far more efficient to run Windchill Sync as a nightly job, off peak hours for both the Windchill and Titania Delivery server.

try{
    wt.doc.WTDocument doc = (wt.doc.WTDocument)primaryBusinessObject;
    String tempWorkDir = java.nio.file.Files.
			createTempDirectory("titaniasync-").toString().replace("\\","/");
    System.out.println(tempWorkDir);
    ProcessBuilder pb = new ProcessBuilder(
			"D:\\ptc\\Windchill_11.0\\Java\\bin\\java.exe", 
			"-Xmx512m","-cp", ".\\classes;.\\lib\\*","com.titania.css.ContentSyncMain",
			"-resourceFolder", ".",
			"-workingFolder", tempWorkDir ,
			"-taskname", "DemoTDSync",
			"-where","number='"+doc.getNumber()+"'");
    pb.directory(new java.io.File(
			"D:\\WindchillToTitaniaSync\\TitaniaSync-1.3.2-SNAPSHOT\\bin\\"));
		Processp = pb.start();
    java.io.InputStream in = p.getInputStream();
    java.io.InputStream err = p.getErrorStream();
		byte b[]=new byte[in.available()];
    in.read(b,0,b.length);
		System.out.println(new String(b));
		byte c[]=new byte[err.available()];
    err.read(c,0,c.length);
		System.out.println(new String(c));
    in.close();
    err.close();
    p.waitFor();
}catch( Exception ex ){
    ex.printStackTrace();
}

Chapter 2: Software Prerequisites

The following are 3rd party software packages are required to be installed prior to installing Titania Sync Services

  • Java JRE 1.8 or Java JRE 11

Chapter 3: Installation

This section details the steps on how to install Titania Sync Services components.

3.1: Installation Distribution

Unzip the installation distribution to a folder on the target server, for example d:\css. This will be the folder referenced by the Task Scheduler.

The Content Sync Services distribution contains the following:

  • The com.titania.repo directory containing the Windchill Info*Engine tasks.

  • The lib directory containing libraries that need to be deployed.

  • The bin directory containing all necessary files to run content sync.

3.2: Installing the WindChill Info*Engine Tasks

Below are detailed steps to install Windchill Info*Engine tasks:
  1. Log into the Windchill server as an administrator or as a user that has rights to the Windchill installation.
  2. navigate to the Info*Engine tasks folder. This is typically located within the Windchill Installation folder at windchill\tasks .
  3. Locate the com.titania.repo folder within the distribution. Copy the entire folder to the tasks folder.
  4. Launch the Windchill Command Shell.
  5. In the Windchill installation directory, execute the following command to eliminate the maximum query results:.xconfmanager -s com.ptc.windchill.search.queryLimit=-1 -t \codebase\wt.properties –p
  6. In the Windchill installation directory, execute the following command to allow the export to run for longer than 1 hour:.xconfmanager -s wt.intersvrcom.security.graceTimePeriod=21600 -p
  7. Restart the Windchill services.
This completes the installation of the Windchill Info*Engine tasks.

3.3: Installing the Task Scheduler

Below are detailed steps to schedule a sync task using Windows Task Scheduler:
  1. Locate Task Scheduler script content_sync.bat within the distribution bin .
  2. Open the Windows Task Scheduler from within the Administrative Tools.
  3. Click on the Task Schedule Library folder in the left pane.
  4. From the Action menu, select New Folder. A dialog prompting for name is displayed. Enter a name of a folder that will contain all of the sync tasks. For example, the folder name may be Titania. Click the OK button to accept. The new folder appears in the left-pane.
  5. Click on the new folder and select Create Task from the Action menu. A Create Task dialog appears.
  6. Follow the instructions on each tab:
    1. General tab: Give the task a name. Select the option to Run whether user is logged on or not.
    2. Triggers tab: Create a new trigger to run the sync at a specific interval.
    3. Actions tab: Provide the name of the sync task to run.
      The Program/script should be <distfolder>\bin\content_sync.bat. Replace <distfolder> with the actual location of the distribution folder.
      The Add arguments prompt should be <taskname>. Replace <taskname> with the sync task name that is defined in the sync-task.xml file.
      The Start in prompt should be <distfolder>\bin. Replace <distfolder> with the actual location of the distribution folder.
  7. Click the OK button to create the new Task
This concludes the installation of the Content Sync Task Scheduler.

3.4: Testing the Installation

Once the system has been configured, the next step is to test the installation. How you test it differs for different installations, but it is usually recommend to identify a document in Windchill, such as a DITA bookmap, and configuring the utility to sync that bookmap using a query filter, targeting it by number using a query such as (number='0000506969')”. Then you can run the utility and verify that the bookmap and all its components were successfully synchronized.

Chapter 4: Configuration

The configurations for Titania Delivery have the following strucutre. The idea behind the configuration is that you can configure any number of Windchill and Titania repositories in the repo-config.xml as you need to. Then in the sync-config.xml you create any number of tasks and collections. The task ties together a Windchill repository, and possibly a Titania Repository. It contains various configuration paramters that define that sync job and it points to a collection which targets a batch of documents. Lastly from the command line, you run a specific task which will ultimately export a batch of documents from Windchill, and in most cases push those documents to Titania delivery in a specific way.

4.1: Configuring a proxy for Titania Delivery

This utility is designed to support running with a proxy. To do this, open each of the batch files, and add the four proxy parameters.

  • proxyHost — The value of this parameter is the host name for a proxy.

  • proxyPort — The value of this parameter is the port enabled for a proxy.

  • proxyUser — The value of this parameter is the username for an authenticated proxy.

  • proxyPass — The value of this parameter is the password for an authenticated proxy.

The following graphic is an example of what the batch file will look like.

4.2: Find Update and Create Use Case

Application Overview

When configured in a specific way, this utility will migrate content from Windchill to Titania. It will find any of the content that already exists in Windchill and update it using its Windchill Number. The Windchill Number can exist as metadata, or in the filename. If a publication does not exist in Titania, this utility will create a project, and upload the publication to that project along with all referenced content. A publication, as it pertains to this utility, is identified by any document that a title is extracted for using the titleXPath task configuration parameter.

At a high level, how this utility accomplishes that is by executing an export collection to generate output in a local folder. It then loops over each file in the folder, pulling the metadata from a HARP-META/metadata.json file. It queries Titania for the object using its Windchill Number which is retrieved from the metadata.json. If the object exists, it updates all instances of it. If it does not, and it is a publication, it creates a project based on the publication title, and uploads it along with any referenced content.

The application has the following flow.

  • Configure the application

  • Clean up the Windchill export cache

  • Archive the last export job if needed

  • Delete the export directory if needed

  • Run Windchill Export if job is set to pull or full

  • Run Windchill Upload if job is set to push, or full

    • Delete the Manifest

    • Recursively loop over each file in the export directory

      • Query Titania for objects that have the same number, or have the number in the name

      • Loop over each result

        • Recursively update referenced files

        • Update the document if an object doesn’t already exist with the same version, and iteration

      • If the object does not exist in Titania, and a title is returned from one of the titleXPath values, then create a new project and recursively upload referenced files

Running the Utility

Three batch files are provided with the application and are in the root of the extracted package. These tasks can be executed by opening a command prompt, navigating to the root folder of the extracted package, then running one of the batch files listed below, followed by a space, then the name of the task from the sync-config.xml. For example, the following text could be typed into the command line “content_sync.bat DemoFullSync” assuming a task named DemoFullSync exists in the sync-config.xml.

At a high level, what you should do is configure the application, run the pull batch file, verify the output looks good, and there is a HARP-META/metadata.json in the export directory that looks complete. If everything looks good, run the push batch file, then verify the files made it to Titania as expected. Once the utility is running as expected, the full sync batch file can be executed, without push or pull in the name.

  • content_sync - pull.bat — This file runs the utility in an export from Windchill mode. It is usually a good idea to run this first, then check the exportFolder and verify content is making it there, and there is a folder at the root level called HARP-META with a file in it called metadata.json that has the metadata for the files being migrated.

  • content_sync - push.bat — This file runs the utility in a push to Titania mode that will skip over the Windchill export and attempt to sync whatever is in the export folder. The export folder should have files to migrate and the HARP-META/metadata.json when this is executed.

  • content_sync.bat — This file runs the application in its full sync mode where content is exported from Windchill and pushed to Titania. This is the mode that will typically be run on an ongoing basis.

Configuring the Utility to use a Proxy

This utility is designed to support running with a proxy. To do this, open each of the batch files, and add the four proxy parameters.

  • proxyHost — The value of this parameter is the host name for a proxy.

  • proxyPort — The value of this parameter is the port enabled for a proxy.

  • proxyUser — The value of this parameter is the username for an authenticated proxy.

  • proxyPass — The value of this parameter is the password for an authenticated proxy.

The following graphic is an example of what the batch file will look like.

Sync Configuration File

Windchill Sync has two primary configuration files. The first is the repo-config.xml which contains the configuration information such as Windchill and Titania Delivery connection information such as the URL, username and password. The following is an example of the content of the repo-config.xml

There are two types of Repository configuration elements. One of type “windchill”, the other of type “titania-delivery”. You must have both to sync data between the two systems.

The windchill repository must have the following configuration parameters.

  • url — The URL to the Windchill server, ending in /Windchill/

  • username — The Windchill username of a user that has access to all the content that is being exported.

  • password — The password for the Windchill user.

The titania-delivery repository must have the following configuration parameters.

  • url — The URL to the Titania Delivery server ending in /admin/

  • username — The Titania Delivery user that has access to the organizations that content will be uploaded to.

  • password — The Titania Delivery user’s password.

  • organizationKey — The organization key defining the organization where new projects will be created. This key can be found in the URL when navigating to that organization in the Titania Delivery admin UI.

  • updateKey — This is typically the Windchill Number, as mapped to Titania Delivery in the sync config. It must match the metadata name of Windchill number in Titania Delivery.

  • revisionId — This is typically the Windchill revision ID, as mapped to Titania Delivery in the sync config. It must match the metadata name of Windchill revision ID in Titania Delivery.

  • iterationId— This is typically the Windchill Iteration number, as mapped to Titania Delivery in the sync config. It must match the metadata name of Windchill iteration number in Titania Delivery.

Sync Configuration File

The sync-config.xml contains the configuration information for the tasks that sync information from Windchill to Titania Delivery. The following image is an example of the Task in a sync-config.xml.

The sync configuration has a specific element hierarchy that must be preserved. A single sync-config.xml can have many Task elements. Each Task represents a specific synchronization job or task designed to pick up a certain collection of documents and migrate them to Titania in a specific way. The task can be called from the command line by it’s name. The task ties together various configuration components and triggers certain features and functions. Each task must have certain configuration components. As an example, each task must have “repository”, “collection”, and “titaniaRepository” Param elements that ties Windchill, Titania, and the collection of documents that will be migrated to Titania.

The following list describes the Task parameters available for use in the sync-config.xml.

  • repository — The name of the Windchill Repository defined in the Repo-Config.xml. This must match the name attribute of the Windchill Repository.

  • titaniaRepository — The name of the Titania Delivery Repository defined in the Repo-Config.xml. This must match the name attribute of the titania-delivery Repository.

  • collection — The name of the collection defined later in the sync-config.xml. This must match the name attribute of a collection.

  • exportToFolderPath — The path to a folder where the content will be to from Windchill.

  • mirrorRepositoryFolderPaths — This determines whether or not the Windchill Repository folder structure is recreated. This must be set to false.

  • fileReferenceAttributes — A comma delimited list of names of attributes in the XML that reference other documents.

  • exportAllReferencedGraphics — If set to false, graphics will not be exported.

  • outputJSONMetadataFile — This must be set to true It creates a file in the export directory /HARP-META/metadata.json that contains all the metadata for files being pushed to Titania.

  • nameByNumber — If set to true, the Windchill number will be used as the base name for the file being exported from Windchill. The default value is false, and if ensureFileUniqueness is also set to false, then files will be named by their Windchill filename.

  • reprocessAllProjects — If set to true, all of the projects that were updated will be reprocessed. The project level process will be called with modified dependents to prevent processing files that do not need to be processed. Then a file with the metadata attribute topdocno will be reprocessed.

  • archivePath — Before the sync task is executed, the export folder is zipped up and placed in the folder defined in this value.

  • cleanup — This should be set to true. When true this deletes the export directory before the sync job is executed.

  • titleXPath — A comma delimited list of xpaths used to extract the title of publications. If a title is extracted, a new object will be created in Titania Delivery if the file does not already exist in Titania Delivery.

  • elementsToNotResolve — A comma delimited list of element names. Documents referenced by these elements will not be exported. As an example, the xref element in DITA is a cross reference. It should have already been included in the current manual export. This configuration parameter takes precedent over downloadReferences, and resolveIfNotInTitania.

  • filenameAppender — A value to append to the filename before the extension. Windchill attributes can be enclosed in ${} and will be filled in at runtime. An example is "-${revision}${iteration}" where Windchill revision and iteration will be filled in. This may negatively impact This utilities ability to keep the most up to date version of files in Titania Delivery and should be left out. This is purely for export functionality.

  • downloadReferences — If set to true, referenced files such as topicrefs, conrefs, etc, will be downloaded for files picked up by the main QueryFilter or StateFilter.

  • resolveIfNotInTitania —This flag works in conjunction with downloadReferences. If this parameter is set to true, and downloadReferences to false, this flag triggers functionality in the pull from Windchill that will cause the utility to only export referenced components when the latest version of them does not already exist in Titania. This code attempts to query Titania Delivery to determine if the file exists and if it does, and it is the latest version, then it will not export it. If it does not exist, or the version and iteration does not match, then it will be exported. The code also queries Titania Delivery for the parent file, and makes sure that the referenced file exists with the correct version and iteration in those projects. If this code fails for some reason, then it fails safely and exports the documents.

  • reprocessInitialDelay — After all of the content migration is complete, the next step is to reprocess all the projects that content was uploaded to. This parameter is a number, in milliseconds, that the thread is delayed between the content upload, and the reprocess. This occurs once.. This is useful what a lot of content has been uploaded, to give Titania some time to finish processing the files uploaded, before the reprocessing of the projects begins.

  • reprocessDelay —After all of the content is migrated, all of the projects that were uploaded to are reprocessed. This parameter is a number, in milliseconds to delay between reprocessing each project. This delay can occur many times in a sync job, between each project that needs to be reprocessed.

  • ensureFileUniqueness — This parameter triggers code that names the objects being exported from Windchill with the following format. The name of the file from windchill, followed by a dash “-” followed by the document number. It is recommended to leave this out, or set the value to false, and set nameByNumber to true for this migration utility. If nameByNumber is set to true, it will take precedence. The default value is false.

  • fullSync — This is a deprecated parameter and is no longer in use.

  • carryOverMetadata — This parameter triggers functionality that copies existing values defined in Titania over to the new object. An example value would be “portalVisible,hideOnLandingPage,_td.profiles” where values from portalVisible, hideOnLandingPage, and _td.profiles will be carried over. If this parameter is not defined, and metadataToDrop is also not defined, then no metadata will be carried over to the new object. Only metadata mapped from Windchill, and metadata extracted from the document will show up on the new version of the document.

  • metadataToDrop — This parameter triggers functionality that copies all existing metadata fields from Titania over to the new version of the object being uploaded to Titania except for the comma delimited list of attributes in the value of this parameter. As an example, you could specify “devicename,faultcode,servicemodel” to include all other metadata fields, but drop these. If a metadata field is also defined in carryOverMetadata, that takes precedence. carryOverMetadata or metadataDrop should be used, not both.

  • maxReprocessMapWaitMinutes — This parameter defines the maximum number of minutes to watch the map reprocessing before starting the next map reprocessing. How this works is after all the projects have been reprocessed, code checks the servers content processing queue. If there are any items in the content processing queue, then the thread waits for 30 seconds, and checks again. This check occurs between each project with maps to reprocess. Once the content processing queue is empty, code queries Titania Delivery for any documents that have a value for a metadata field called topdocno. If any are found, that document is reprocessed. After the reprocess is called, code watches and checks the status of this documents reprocessing. It waits for X number of minutes (where Xis by default 20 minutes, or the number of minutes defined in maxReprocessMapWaitMinutes), or until the document processing is complete before proceeding to the next project. After that, the code waits for the content processing queue to be empty, and repeats the process on the next project. Please note: The Titania Delivery user account used for this sync job must be a member of the System Monitors group, and be able to see “Content Engine Status” in the upper right when logging into the Titania Delivery admin UI.

Mapping Metadata

The MetadataMappings contains key value pair mappings of the Windchill attribute names to Titania Delivery metadata names. The target values must match what is defined in the repo-config.xml for updateKey, revisionId, and iterationId.

Sync Configuration Collections

A collection must also be configured to provide the information needed about the collection of documents to by pushed from Windchill to Titania Delivery.

Certain information must be provided. See the following list.

  • containerName — This is the name of the Windchill container, which can be a library, product, etc.

  • containerType — This is the Windchill object type for the Windchill container.

  • objectType — This is the type of objects that will be queried for. It is a best practice to be specific as possible on this. As an example “WCTYPE|wt.epm.EPMDocument” will also retrieve documents that are of types that inherit from EPMDocument, however, sometimes custom soft attributes will not be retrievable unless you use the specific object type that has the custom soft type on it.

  • syncSubFolders — This is used in conjunction with a folder filter. If you sync objects from a folder, and this is set to true, the descendant folders will also be exported. In most cases this should be set to false, or left out.

The following are a few examples of collections.

This collection targets one document by its Windchill number.

The next example targets multiple documents by their number using a pipe “|” delimiter between number queries.

The next example targets documents that were updated today, or yesterday. The currentDate-24 can be modified to target a longer range of updated documents. This can be done by increasing the 24 by increments of 24. Windchill only supports increments of days.

The following example uses a state parameter. This parameter ensures only objects that are in the specified state will be exported. This should include the states for topics, maps, graphics, etc that will be exported by this job..

4.3: Repository Configurations

The Repository Configurations provide the necessary information to enable the Titania Sync Services to connect to a source repository.

The following sections detail the repository configuration options.

4.3.1: Windchill Repository

The Windchill Repository provides a connection to the PTC Windchill content management system. This allows the user to view in real time what is on the Windchill content management system within a local environment.

Attributes

Attribute Name

Description

name

Descriptive name of the repository.

type

“windchill”

Parameters

Parameter Name

Description

url

url of the Windchill instance.

username

Username of the end user that will perform the actions within the repository.

password

Password of enduser that is associated with the username

Example

Below is an example of how to configure a Windchill Repository

<Repository name="Windchill" type="windchill">
	<Param name='url' value='http://acm.company.com/Windchill' />
	<Param name='username' value='orgadmin' />
	<Param name='password' value='password' />
</Repository>

4.3.2: Titania Delivery Repository

The Titania Delivery Repository provides a connection to a Titania Delivery Project.

Attributes

Attribute Name

Description

name

Descriptive name of the repository.

type

“titania-delivery”

Parameters

Parameter Name

Description

url

url of the HARP admin service. For example, https://qa.titaniadelivery.com/admin/.

username

Username of the end user that will perform the actions within the repository.

password

Password of end user that is associated with the username.

projectKey

Key for a specific project. This can be obtained by looking at the HARP URL while within the project. For example, 5458dca0efa24ad663b70918.

projectFolder

The folder within the project to push content into. May be blank to push to the root of the project.

requestTimeout

An integer in milliseconds that defines how long the Titania Sync client will wait before timing out when executing HTTP Requests. The maximum number this can be when this was written is 60000 due to that be the max amount of time before the server side issues a time-out. This is useful when syncing to folder in Titania that have thousands of objects.

updateKey

updateKey doesn’t do anything on its own, but is used in conjunction with the parameter updateDuplicates, and/or reprocessContexts. It defines the Titania metadata field name that the underlying code will use to find associated objects.

updateDuplicates

updateKey must also be defined. This parameter activates functionality that loops over each object being pushed from Windchill to Titania, it queries Titania for other objects with the same updateKey value and updates those objects with the latest version of the object content, and metadata.

reprocessContexts

updateKey must also be defined. This parameter activates functionality that loops over each object being synchronized with Titania from Windchill. It queries Titania for objects that have the same updateKey in any project, and creates a list of contexts. After all objects have been evaluated, and a unique list of contexts that need to be reprocessed is created, code iterates over each context and reprocesses them. This code waits up to 5 minutes for each object to be reprocessed and reports the status in the log as it does this.

Example

Below is an example of how to configure a Titania Repository

<Repository name="TitaniaQA" type="titania-delivery">
  <Param name='url' value='https://td.example.com/admin/' />
  <Param name='username' value='demo@example.com' />
  <Param name='password' value='Passw0rd' />
  <Param name='organizationKey value='654017194c8ae97e026cc894' />
  <Param name='updateKey' value='wc.number' />
	<Param name='revisionId' value='wc.revision' />
	<Param name='iterationId' value='wc.iteration' />
</Repository>

4.4: Content Sync Configurations

The content sync configurations detail one or more tasks used to synchronize content from a specific repository to a destination. The content sync configurations are located in the Tomcat content Sync WEB-INFO\sync-config.xml.

4.4.1: Tasks

Tasks are the primary building blocks of the content sync. All synchronization is defined by a task. There can be one or more tasks that define how content is synchronized. The following sections detail the available types of task configurations.

4.4.1.1: Folder Synchronization Task

The Folder synchronization Task provides the ability to synchronize content located in a repository with the local file system. The following tables detail the Attributes and Parameters along with their description.

Attributes

Attribute Name

Description

name

Descriptive name of the task.

type

“FolderSync”

Parameters

Parameter Name

Description

repository

The name of the repository as defined in the repository configuration. A Parameter is required.

collection

The name of the collection as defined in the collections element. Parameter is required.

fullSync

Indicates if a full or incremental sync should be performed. Valid values are true or false. Default value is “false”.

exportToFolderPath

Location on the local file system where content will be synced to.

mirrorRepositoryFolderPaths

Indicates if the repository folder structure should be mirrored on the local file system. If true, the container and folders will be mirrored. If false, all files will be synced to a single folder.

fileReferenceAttributes

A comma delimited list of all attribute names that contain an xml or graphical reference, delimited by commas. Default value is “href”.

exportAllReferencedGraphics

Indicates if any graphics referenced by the xml is also synced, whether it is in the collection or not.

enforceFileUniqueness

Indicates if the system should ensure that local file names are unique. If true, the Windchill document number will be appended to the filename. If false, only the Windchill filename will be used. Duplicate files will be overwritten. Default value is “true”.

outputMetadataFile

Indicates if the system should generate an XML .properties file along with the exported content file. If true, a properties file having the same base name as the content file will be created and contain all attributes returned by the filter. Additional attributes can be returned by using the filter includeMetadata parameter. If false, no properties file will be created. Default value is “false”.

outputJSONMetadataFile

If set to true, code will be executed to convert metadata to format natively supported by Titania in a HARP-META/metadata.json file. This feature creates a new metadat file for each sync and does not compound the metadata synchronized from previous sync jobs.

Contains Elements

  • Task Hook

Example

<Task name="Production" type="FolderSync">
	<Param name="repository" value="Windchill"/>
	<Param name="collection" value="Released Documents"/>
	<Param name="fullSync" value="false"/>
	<Param name="exportToFolderPath" value="c:\temp\export"/>
	<Param name="mirrorRepositoryFolderPaths" value="true"/>
	<Param name="fileReferenceAttributes" value="href"/> <!--  separated by commas -->
	<Param name="exportAllReferencedGraphics" value="true"/>
	<Param name="ensureFileUniqueness" value="true"/>
</Task>

4.4.1.2: Titania Delivery Synchronization Task

The Titania Delivery synchronization Task provides the ability to synchronize content located in a repository with a Titania Delivery project. It does this by exporting the content from the Windchill repository to the local file system, and then syncing that folder to Titania Delivery. The following tables detail the Attributes and Parameters along with their description.

Attributes

Attribute Name

Description

name

Descriptive name of the task.

type

“TDSync”

Parameters

Parameter Name

Description

repository

The name of the Windchill repository as defined in the repository configuration. Required.

titaniaRepository

The name of the Titania Delivery repository representing the project. Required.

collection

The name of the collection as defined in the collections element. Required.

fullSync

Indicates if a full or incremental sync should be performed. Valid values are true or false. Default value is “false”.

exportToFolderPath

Location on the local file system where content will be synced to. Optional. If not specified, a temporary directory will be created.

cleanup Indicates whether to delete the folder containing the exported files after the sync is complete. The default is "true" if exportToFolderPath is not specified, and "false" if it is.

mirrorRepositoryFolderPaths

Indicates if the repository folder structure should be mirrored on the local file system. If true, the container and folders will be mirrored. If false, all files will be synced to a single folder.

fileReferenceAttributes

A comma delimited list of all attribute names that contain an xml or graphical reference, delimited by commas. Default value is “href”.

exportAllReferencedGraphics

Indicates if any graphics referenced by the xml is also synced, whether it is in the collection or not.

enforceFileUniqueness

Indicates if the system should ensure that local file names are unique. If true, the Windchill document number will be appended to the filename. If false, only the Windchill filename will be used. Duplicate files will be overwritten. Default value is “true”.

Contains Elements

  • MetadataMappings

  • TaskHook

Example

<Task name="DemoTDSync" type="TDSync">
  <Param name="repository" value="DemoWindchillRepo"/>
  <Param name="collection" value="AllDocuments"/>
  <Param name="titaniaRepository" value="DemoTDRepo"/>
  <Param name="mirrorRepositoryFolderPaths" value="true"/>
  <Param name="fileReferenceAttributes" value="href"/>
  <Param name="exportAllReferencedGraphics" value="true"/>
  <Param name="ensureFileUniqueness" value="false"/>
</Task>

4.4.2: Task Hooks

4.4.2.1: Command Line Task Hook

The command line hook allows for a Windows command file to be executed. The command file is executed in its own thread so must contain all necessary environmental information.

Attributes

Attribute Name

Description

event

Valid values:

  • PreTask – Hook is triggered prior to the task initialization and object collection..

  • PostTask – Hook is triggered after the task has completed execution.

type

“CommandLineHook”

Parameters

Parameter Name

Description

command

The name of the command file located in the resource folder. If using a relative path, the current folder location is within the web applications WEB-INF folder.

Example:

The following example details how to configure a command line task hook to call a bat file located in the WEB-INF/hooks folder.

<Task name="Production" type="FolderSync">
	...
	<TaskHook event="PostTask" type="CommandLineHook">
		<Param name="command" value="hooks/post-task-stub.bat"/>
	</TaskHook>				
</Task>

4.4.2.2: Java Task Hook

The Java hook allows custom Java code to be executed.

Attributes

Attribute Name

Description

event

Valid values:

  • PreTask – Hook is triggered prior to the task initialization and object collection..

  • PostTask – Hook is triggered after the task has completed execution.

type

“CommandLineHook”

Parameters

Parameter Name

Description

class

The fully qualified name of the custom Java class. The custom Java class must implement the com.titania.css.engine.hook.IJavaHook interface and be located in the syncs Java classpath.

Example:

The following example details how to configure a Java task hook.

<Task name="Production" type="FolderSync">
	...
	<TaskHook event="PreTask" type="JavaHook">
	    <Param name="class" value="com.oberon.acme.css.SPSyncPreTaskHook"/>
	</TaskHook>				
</Task>

4.4.3: Collections

Collections define the data set within the repository that will be synced.

4.4.3.1: Basic Collection

The basic collection provides a wrapper around one or more filters. Within a collection are filters that may select or exclude objects within the repository. Filters act on previously selected objects within the collection. For example, if filter 1 includes objects A and B, then filter 2 excludes object B, then the collection contains only object A. However, if filter 1 excludes object B, then filter 2 includes objects A and B, then the collection contains both object A and B. This is because object B was not yet in the collection to exclude.

Common parameters used by one or more filters can be included as a collection parameter and then inherited by all of the filter parameters. Any collection based parameter may be overwritten by a filter based parameter.

Parameters may also be inherited from the referring task components. The best example is to set the repository in the task and let it be inherited by the filter rather than specifying the repository parameter in each filter.

Attributes

Attribute Name

Description

name

Descriptive name of the collection.

type

“Basic”

Contains Elements

  • Filter

Example

The following example defines collection of all released manuals.

<Collection name="ReleasedDocuments" type="Basic">
	<Param name="containerName" value="Manuals"/>
	<Param name="containerType" value="wt.inf.library.WTLibrary"/>
	<Param name="objectType" value="com.company.DynamicDocument"/>
	
	<Filter name="IncludeReleased" type="StateFilter">
		<Param name="state" value="RELEASED"/>
	</Filter>
</Collection>

4.4.4: Filters

Filters include or exclude objects from a collection.

4.4.4.1: State Filter

The State Filter queries the repository for objects having a specified state within a revision tree and returns the most recent iteration matching that state.

Below are the attributes and parameters along with a detailed description.

Attributes

Attribute Name

Description

name

Descriptive name of the task.

type

“StateFilter”

Parameters

Parameters are inherited from Collection and referencing elements (i.e. Task).

Parameter Name

Description

containerName

Name of the product or library to be queried.

containerType

Internal object type name of the container to be queried. The out-of-the-box Library container name is “wt.inf.library.WTLibrary”. The out-of-the-box Product container name is “wt.pdmlink.PDMLinkProduct”. If containerName is specified, containerType is required.

state

Internal name of the target state. Required.

objectType

The fully qualified name of the object type to be queried. The default Document object type is “WCTYPE|wt.doc.WTDocument” and the default EPM Document Type is “WCTYPE|wt.epm.EPMDocument”

folder

The container folder to be queried. For example “/Publications”.

criteria

Any additional criteria to be included in the query. The criteria must confirm to the Info*Engine Search-Objects task WHERE Clause. For additional information, refer to the PTC Windchill Adapters Guide.

excludeIfLaterRevision

If the objects returned by the filter are of a later version that what is already been returned by previous filters, if excludeIfLaterRevision is true, the object is removed from the filter. For example, if a document revision history is:

B.1 Cancelled

A.2 Released

A.1 In Work

If a previous filter queried for released objects, version A.2 would be in the collection. However, if the a second filter is applied to query for Cancelled objects, returning B.1, and the excludeIfLaterRevision is true, A.2 will be removed from the collection.

includeMetadata

Additional Windchill attributes to be included with the filter results. The attribute must be defined in the object type or ancestor object type. Multiple attributes can be specified delimited with commas. Attribute names must be the internal Windchill name.

syncSubFolders

True or false. Indicates whether to process synchronize subfolders of content. This applies to QueryFilters and StateFilters.

downloadReferences

If set to false, this will still name referenced XML files in the same way, but it will not recursively download and resolve them. This is used for incremental update scenarios where just a map is updated but none of the descendant objects are as an example.

nameByNumber

When set to true, this sets the filename as the Windchill number.

Example

The following example defines collection of all released manuals. If a document has a state of CANCELLED in a later revision compared to a RELEASED revision, the document will be removed from the collection.

<Collection name="Released Documents" type="Basic">
	<Param name="containerName" value="Manuals"/>
	<Param name="containerType" value="wt.inf.library.WTLibrary"/>
	<Param name="objectType" value="com.company.DynamicDocument"/>
	
	<Filter name="IncludeReleased" type="StateFilter">
		<Param name="state" value="RELEASED"/>
	</Filter>
	
	<Filter name="ExcludeCancelled" type="StateFilter">
		<Param name="excludeIfLaterRevision" value="true"/>
		<Param name="state" value="CANCELLED"/>
	</Filter>
</Collection>

4.4.4.2: Query Filter

The Query Filter queries the repository for objects using specified criteria returning the latest objects.

Below are the attributes and parameters along with a detailed description.

Attributes

Attribute Name

Description

name

Descriptive name of the task.

type

“QueryFilter”

Parameters

Parameters are inherited from Collection and referencing elements (i.e. Task).

Parameter Name

Description

containerName

Name of the product or library to be queried.

containerType

Internal object type name of the container to be queried. The out-of-the-box Library container name is “wt.inf.library.WTLibrary”. The out-of-the-box Product container name is “wt.pdmlink.PDMLinkProduct”. If containerName is specified, containerType is required.

objectType

The fully qualified name of the object type to be queried. The default Document object type is “WCTYPE|wt.doc.WTDocument” and the default EPM Document Type is “WCTYPE|wt.epm.EPMDocument”

folder

The container folder to be queried. For example “/Publications”.

criteria

Any additional criteria to be included in the query. The criteria must confirm to the Info*Engine Search-Objects task WHERE Clause. For additional information, refer to the PTC Windchill Adapters Guide.

includeMetadata

Additional Windchill attributes to be included with the filter results. The attribute must be defined in the object type or ancestor object type. Multiple attributes can be specified delimited with commas. Attribute names must be the internal Windchill name.

syncSubFolders

True or false. Indicates whether to process synchronize subfolders of content. This applies to QueryFilters and StateFilters.

downloadReferences

If set to false, this will still name referenced XML files in the same way, but it will not recursively download and resolve them. This is used for incremental update scenarios where just a map is updated but none of the descendant objects are as an example.

nameByNumber

When set to true, this sets the filename as the Windchill number.

Example

The following example defines collection targeting two documents based on their Windchill number.

<Collection name="ExampleCollection" type="Basic">
        <Param name="containerName" value="ExammpleLibrary"/>
        <Param name="containerType" value="wt.inf.library.WTLibrary"/>
        <Param name="objectType" value="WCTYPE|wt.epm.EPMDocument"/>
        <Param name="syncSubfolders" value="false"/>
				<Filter name="LatestManual6" type="QueryFilter">
	     	<Param name="criteria" value="(number='0000506969')|(number='0000506970')"/>
	     </Filter>
      </Collection>

The following example defines collection targeting documents updated in the past two days. The way currentDate-24 is it creates a timestamp of the current date, minus 24 hours. That creates a date of the previous day. Windchill can only support intervals of days.

<Collection name="IncCollection" type="Basic">
    <Param name="containerName" value="Demo-JJ"/>
    <Param name="containerType" value="wt.inf.library.WTLibrary"/>
    <Param name="objectType" value="WCTYPE|wt.epm.EPMDocument"/>
    <Param name="syncSubfolders" value="false"/>
    <Filter name="LatestManual6" type="QueryFilter">
        <Param name="state" value="RELEASED"/>
        <Param name="criteria" value="(thePersistInfo.updateStamp>'currentDate-24')"/>
    </Filter>
</Collection>

The following example defines collection targeting a document based on it’s Windchill number. It also includes a state parameter that will ensure any documents exported are in the RELEASED or INWORK states.

<Collection name="DemoCollectionJJ" type="Basic">
    <Param name="containerType" value="wt.inf.library.WTLibrary"/>
    <Param name="containerName" value="Demo-JJ"/>
    <Param name="objectType" value="WCTYPE|wt.epm.EPMDocument"/>
    <Filter name="LatestManual6" type="QueryFilter">
        <Param name="criteria" value="number='0002913923'"/>
        <Param name="state" value="RELEASED,INWORK"/>
    </Filter>
</Collection>

4.5: Document Types Configurations

This section details how to configure a custom document type. The Content Sync Services comes pre-configured for DITA 1.2. Any other document types must be configured.

Document types are defined using XML catalogs and are located within web application /doctypes folder.

4.5.1: Creating a Custom Document Type

Important Notes

  • All custom doctypes are located in the /doctypes/custom folder.

  • Each document type dependencies should be placed in a single folder within the custom folder.

  • A catalog file within each doctype folder should be created that references each DTD/schema. This catalog file can be created with the ACL script noted in the Referencing Arbortext Document Types section.

  • A master catalog file should be created in the custom folder that references each doctype catalog file.

Refer to the sample document type as an example.

Troubleshooting Document Types

Document Type configurations are highly complex and sometimes it can be a challenge to get them correct. If you run the sync job, and see errors indicating Titania Sync was unable to find a dtd, ent, or xsd file, then the first thing to check is the document type. Make sure the ACL script noted above was executed, and the result was saved to the custom catalog. It is usually a good idea to not have too many levels of file referencing. For example, one catalog can have an entry <nextCatalog catalog=“custom/catalog.xml”/>, and each catalog could reference another. We recommend flattening all the custom catalog entries as much as possible.

In the case of schema’s, the ACL script may not generate all the necessary references. It is usually a good idea to review the catalogs in your Arbortext custom folder, if you see errors indicating Titania Sync is unable to find an xsd file, and pull in any entries that look like the following example.

<public publicId="urn:ptc:names:arbortext:dita:xsd:techinfoMod.xsd" uri="file:///F:/TitaniaSync/bin/doctypes/custom/Arbortext%20TechInfo/techinfoMod.xsd"/>
<public publicId="techinfoDomain.xsd" uri="file:///F:/TitaniaSync/bin/doctypes/custom/Arbortext%20TechInfo%/techinfoDomain.xsd"/>

4.5.2: Referencing Arbortext Document Types

If all of the DTD/schemas are available in an Arbortext application or custom folder, references to these doctypes can be made from the content sync service catalog file. Arbortext catalogs cannot be referenced directly to resolve URI’s as they are not formatted correctly. Following is the procedure to configure content sync services to use the Arbortext document types.

An ACL file named generate-catalog.acl is available in the /tools folder.

  1. Locate the ACL script generate-catalog.acl in the content sync web application WEB-INF/tools folder.

  2. Open Arbortext Editor, ensuring the custom document type is loaded.

  3. Source the generate-catalog.acl from the command line as located in Step 1. A new window will appear containing the generate catalog. The catalog can be used as is or can be modified by removing the unneeded entries.

  4. Save the catalog as catalog.xml to the /doctypes/custom folder. The master catalog file is already configured to reference the custom catalog file.

Note: This ACL script can also be executed from Arbortext Publishing Engine Interactive and other versions of Arbortext Editor.

4.6: Logging Configuration

There are several different log files utilized by the content sync services. The following lists the log files in the order of importance.

Task Logging

Task-specific log files are located in the web service /working/logs folder. These log files are named based on the task name and a summary of the sync actions. The level of detail in this log file can not be changed.

Content Sync Logging

The content sync log file is named ContentSync.log and is located in the web service WEB-INF/working/logs folder. This log file contains logging for all tasks and the overall content sync service. The level of detail in the log file can be controlled by the bin/log4j.properties file.