Class ClientComposer

java.lang.Object
com.arbortext.e3c.ClientComposer

public class ClientComposer extends Object
Java object that manages E3 composition for Epic Editor.
  • Field Details

  • Method Details

    • getInstance

      public static ClientComposer getInstance() throws IOException
      Get singleton instance, allocating if necesary.
      Returns:
      client composer instance
      Throws:
      IOException
    • close

      public static void close()
      Called exit_editor_hook in initrtns.cpp to terminate our storage.
    • compose

      public String compose(Map<String,String> parameters, Map<String,String> types)
      Entry point for both synchronous and asynchronous composition. Either calls 'doCompose' directly or starts a thread to call 'doCompose' in the background.
      Parameters:
      parameters - associative parameter array; some parameters control 'doCompose' operation, some are passed to E3.
      types - associative parameter type array; indicates the type of each parameter in 'parameters'.
      Returns:
      "ok" if the operation is synchronous and succeeds; "async" if the operation is asynchronous; else returns an error message
    • getPostProcessorParameters

      public static Map<String,String> getPostProcessorParameters()
      Returns a map containing parameters for use by the ACL routine compose::callPostProcessorForE3().
      Returns:
      Map of string name/value pairs
    • handleResponse

      public String handleResponse(com.arbortext.e3.client.E3ResponseInterface response, Map<String,String> parameters, E3Tracer tracer) throws Exception
      Decodes a response returned by the PE server.
      Parameters:
      response - response to process
      parameters - composition parameters
      tracer - log object
      Returns:
      "OK" if operation succeeded, or an error message
      Throws:
      Exception - upon error
    • handleResponse

      public String handleResponse(com.arbortext.e3.client.E3ResponseInterface response, Map<String,String> parameters, List<String> missingGraphicWarnings, E3Tracer tracer) throws Exception
      Decodes a response returned by the PE server.
      Parameters:
      response - response to process
      parameters - composition parameters
      missingGraphicWarnings - list of warnings accumulated before the document was transmitted to PE
      tracer - log object
      Returns:
      "OK" if operation succeeded, or an error message
      Throws:
      Exception - upon error
    • getWorkDir

      public String getWorkDir()
      Returns the absolute path to our working directory
      Returns:
      String containing work directory path
    • logAsynchronousError

      public static void logAsynchronousError(String msg, String interactive)
      Appends an error message to the composerlog stanza associated with the current operation.

      Called after an asynchronous call do do_compose() fails; called through ACL java_static() so that this code runs on the main Epic thread.

      Parameters:
      msg - message to append.
      interactive - "1" if we were ultimately called by the GUI, "0" otherwise
    • normalizeOpenDocument

      public String normalizeOpenDocument(String pName, String aclId, com.arbortext.e3c.ClientComposer.DocOptions options, File inputDir, String graphDir, String graphicTransform, List<String> missingGraphicWarnings, E3Tracer tracer) throws Exception
      Writes a flattened version of an open Arbortext Editor document to the input directory (the directory that will be zipped and transmitted to the PE server).

      May also copy graphics or insert _graphic_data PIs, insert location PIs, or translate 3D graphics to 2D.

      Parameters:
      pName - parameter name (for error messages)
      aclId - ACL document ID
      options - DocOptions object specifying graphic handling and other special stuff
      inputDir - directory that will be zipped and sent to the PE server
      graphDir - directory to which we should copy graphics (null to copy to doc_cache_dir())
      graphicTransform - rules for transforming graphics
      missingGraphicWarnings - accumulate warnings here
      tracer - Trace object
      Returns:
      tempDir-relative path to file we write
      Throws:
      Exception - upon error
    • processComposerLog

      public static void processComposerLog(String jarName, String interString)
      Looks for a composerlog.xml in the given response and, if present, extracts the records and inserts them into the current client-side composerlog associated with this compose. NOTE: most of the tracing output below is to help me figure out the reason this routine causes wierd Unix crashes in asynchronous mode. I'll remove it later. (kbosley, 10/23/2003)
      Parameters:
      jarName - name of the .jar we got back from E3
      interString - 1 if we're running asynchronously
    • popMissingGraphicWarning

      public static String popMissingGraphicWarning(String listKey)
      Retrieves a 'missing graphic' warning message from the global list and returns it.
      Parameters:
      listKey - key identifying the list to return
      Returns:
      message or "" if list is empty
    • queueMissingGraphicWarning

      public static int queueMissingGraphicWarning(String msg)
      Loads a 'missing graphic' warning messages into global storage.
      Parameters:
      msg - message to load
      Returns:
      1 for success, 0 for drror
    • setDeleteCompDirs

      public static void setDeleteCompDirs(boolean newValue)
      Stores a new value for 'deleteCompDirs'
      Parameters:
      newValue - value to set
    • setDeleteWorkDir

      public static void setDeleteWorkDir(boolean newValue)
      Stores a new value for 'deleteWorkDir'
      Parameters:
      newValue - value to set
    • setTraceFile

      public static void setTraceFile(boolean newValue)
      Stores a new value for 'traceFile'
      Parameters:
      newValue - value to set
    • setTraceLevel

      public static void setTraceLevel(int newValue)
      Stores a new value for 'traceLevel'
      Parameters:
      newValue - value to set
    • setTraceSystem

      public static void setTraceSystem(boolean newValue)
      Stores a new value for 'traceSystem'
      Parameters:
      newValue - value to set