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();
}