Package com.ptc.tml.preparation
Class CustomTranslationCreationHook
java.lang.Object
com.ptc.tml.preparation.CustomTranslationCreationHook
Manages customization of translation objects during their initialization. An implementation of this class can
be registered in wt.properties and the customize method of that class will be called before translation
objects are persisted. An implementation can provide custom numbering or naming, for example. Many changes
may cause problems with the translation application and the list of these is unknown. Please do not change the
extensions of CADNames.
Supported API: true
Supported API: true
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcustomize(List<CustomTranslationCreationHook.EPMDocumentCopyInfo> documentCopies) Implementing the CustomTranslationCreationHook class, overriding this method, and registering the implementing class in the Windchill/codebase/wt.properties file will enable customization of the translation objects created by TML.
-
Method Details
-
customize
protected abstract void customize(List<CustomTranslationCreationHook.EPMDocumentCopyInfo> documentCopies) throws WTException, WTPropertyVetoException Implementing the CustomTranslationCreationHook class, overriding this method, and registering the implementing class in the Windchill/codebase/wt.properties file will enable customization of the translation objects created by TML. The implementation should take the EPMDocumentCopyInfo objects provided and modify the translation objects (accessible via the getTarget() method) as desired. The source objects are available for reference, but changes to these objects will not be persisted. Any exception thrown by this method will be logged and terminate the translation package creation.
Example implementation that provides custom numbering:
@Override protected void customize(List
documentCopies) throws WTException, WTPropertyVetoException { for (EPMDocumentCopyInfo info : documentCopies) { final String initialNumber = info.getTarget().getNumber(); info.getTarget().setNumber("PTC" + initialNumber); } } - Parameters:
documentCopies- - list of source and target objects- Throws:
WTExceptionWTPropertyVetoException-
Supported API: true
-