Class TMLUtils

java.lang.Object
com.ptc.tml.utils.TMLUtils

public class TMLUtils extends Object
The utility class for TranslationManagement.

Supported API: true
  • Method Details

    • toNavigationCriteria

      public static NavigationCriteria toNavigationCriteria(String csString, Persistable sourceObject) throws TranslationException
      Convert a string representation to a Navigation Criteria; the inverse of toCsString

      Supported API: true
      Throws:
      TranslationException
    • getReference

      public static String getReference(Persistable persistable)
      Gets a string reference to a Persistable
      Parameters:
      persistable -
      Returns:
      Throws:
      TranslationException -

      Supported API: true
    • getPersistable

      public static Persistable getPersistable(String reference) throws TranslationException
      Gets the persistable.
      Parameters:
      reference - the reference
      Returns:
      the persistable
      Throws:
      TranslationException - the translation exception

      Supported API: true
    • getUser

      public static WTPrincipal getUser(String userName) throws TranslationException
      Convert a user name to a WTPrincipal; check the site context if not found, return null.
      Parameters:
      userName -
      Returns:
      Throws:
      TranslationException -

      Supported API: true
    • getUserName

      public static String getUserName(WTPrincipalReference principalRef) throws WTException
      Converts a principalRef to a string
      Parameters:
      principalRef -
      Returns:
      Throws:
      WTException -

      Supported API: true
    • switchSessionPrincipal

      public static String switchSessionPrincipal(String newPrincipalName)
      Sets the principal for the session to the user name specified and returns the name of the previous user. The returned value may be used to set the session user back to its original value.
      Parameters:
      newPrincipalName -
      Returns:


      Supported API: true
    • deleteTempFiles

      public static void deleteTempFiles(File parentImportDir)
      This method will delete the files from temp directory for translation import.

      Supported API: true