AnnBatesStampTranslator defines a translator that converts the Bates stamp elements to a string expression. Converts from a string expression to Bates stamp elements that can be saved and loaded using AnnBatesStampComposer.
function lt.Annotations.Documents.AnnBatesStampTranslator class lt.Annotations.Documents.AnnBatesStampTranslator() This class is used by AnnBatesStampComposer when applying save/load. It can also convert Bates stamp elements to/from a string.
A text expression is composed of the following symbols: To convert AnnBatesDateTime to a string, the expression will appear in the following formatted order: The starting expression ExpressionStartSymbol + the name of the type AnnBatesDateTime + the separating symbol ExpressionSeparatingSymbol + the time format as UTC or local + the separating symbol ExpressionSeparatingSymbol + the date format + ending symbol ExpressionEndSymbol. For example:
{{BatesDateTime*Local*MM/dd/yyyy}}{{BatesNumber*6*1*1*1*before*after}}{{BatesDateTime*Local*MM/dd/yyyy}} {{BatesNumber*6*1*1*1*before*after}} This is some textThis example translates Bates stamp elements to a string expression, and then loads it again.
example: function SiteLibrary_DefaultPage$example() {//Create Bates stamp translator instancevar translator = new lt.Annotations.Documents.AnnBatesStampTranslator();//Create some Bates stamp elements to test on translatorvar batesDateTime = new lt.Annotations.Documents.AnnBatesDateTime();batesDateTime.currentDateTime = new Date();var batesNumber = new lt.Annotations.Documents.AnnBatesNumber();batesNumber.autoIncrement = true;batesNumber.startNumber = 3;batesNumber.numberOfDigits = 9;batesNumber.prefixText = "beforeText";batesNumber.suffixText = "afterText";batesNumber.useAllDigits = true;var batesText = lt.Annotations.Documents.AnnBatesText.create("This is test");var elements = [batesDateTime, batesNumber, batesText];var elementsExpression = translator.writeElementsToString(elements);//Print the expressionalert(elementsExpression); // the output will be "{{BatesDateTime*Local*}}{{BatesNumber*9*1*3*1*beforeText*afterText}}This is test"//Load the Bates stamp elements from the expression againvar elements = translator.readFromString(elementsExpression);//Print the count of loaded elements to make sure the load is correctalert(elements.length); // the output will be "3"}