Class WebappAuthorDocumentFactory

java.lang.Object
ro.sync.ecss.extensions.api.webapp.WebappAuthorDocumentFactory
All Implemented Interfaces:
WebappAuthorDocumentFactoryConstants

@API(type=NOT_EXTENDABLE, src=PRIVATE) public final class WebappAuthorDocumentFactory extends Object implements WebappAuthorDocumentFactoryConstants
Factory class that creates the document model to be used in the Web Reviewer.
Since:
15.1
  • Method Details

    • createDITAMapDocumentInfo

      public static DITAMapDocumentModel createDITAMapDocumentInfo(URL systemIdUrl, Reader docReader, List bomBytes, Map<String,?> sessionAttributes) throws IOException, SAXException
      Factory method that creates an editable DITA Map document model for the document with the specified systemID. It takes care of detecting the encoding, resolving DTD, etc.
      Parameters:
      systemIdUrl - The document URL.
      docReader - Reader over the document.
      bomBytes - BOM bytes.
      sessionAttributes - A map of session attributes.
      Returns:
      The author document.
      Throws:
      IOException
      SAXException
      Since:
      26.1

      **************************************
      EXPERIMENTAL - Subject to change
      **************************************

      Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.

    • createAuthorDocumentInfo

      public static AuthorDocumentModel createAuthorDocumentInfo(URL systemIdUrl, Reader docReader, List bomBytes, Map<String,?> sessionAttributes) throws IOException, SAXException
      Factory method that creates a document model for the document with the specified systemID. It takes care of detecting the encoding, resolving DTD, CSS resources, etc.
      Parameters:
      systemIdUrl - The document URL.
      docReader - Reader over the document.
      bomBytes - BOM bytes.
      sessionAttributes - A map of session attributes.
      Returns:
      The author document.
      Throws:
      IOException
      SAXException
    • createAuthorDocumentInfo

      public static AuthorDocumentModel createAuthorDocumentInfo(String systemID, Map<String,?> sessionAttributes) throws IOException, SAXException
      Factory method that creates a document model for the document with the specified systemID. It takes care of detecting the encoding, resolving DTD, CSS resources, etc.
      Parameters:
      systemID - The document URL.
      sessionAttributes - The session attributes.
      Returns:
      The author document.
      Throws:
      IOException
      SAXException
    • createAuthorDocumentInfo

      public static AuthorDocumentModel createAuthorDocumentInfo(String systemID, Reader docReader, Map<String,?> sessionAttributes) throws IOException, SAXException
      Factory method that creates a document model for the document with the specified systemID. It takes care of detecting the encoding, resolving DTD, CSS resources, etc.
      Parameters:
      systemID - The document URL.
      docReader - Reader over the document.
      sessionAttributes - Session attributes.
      Returns:
      The author document.
      Throws:
      IOException
      SAXException
    • setOptions

      public static void setOptions(File workDir, String optionsFileName) throws MalformedURLException
      Sets the file to be used to load the oxygen options. This method should be called before any other use of the Options singleton.
      Parameters:
      workDir - The directory in which the options file resides.
      optionsFileName - The name of the options file.
      Throws:
      MalformedURLException - Unable to set the working dir.
    • setFrameworks

      public static void setFrameworks(File frameworksDir) throws MalformedURLException
      Sets the folder that contains the frameworks. This method should be called before creating any document models.
      Parameters:
      frameworksDir - The folder that contains the frameworks.
      Throws:
      MalformedURLException - If the framework's directory URL is malformed.
    • setUserFrameworks

      public static void setUserFrameworks(File userFrameworksDir) throws MalformedURLException
      Sets the folder that contains the frameworks the user has uploaded. This method should be called before creating any document models.
      Parameters:
      userFrameworksDir - The folder that contains the user uploaded frameworks.
      Throws:
      MalformedURLException - If the framework's directory URL is malformed.
    • setPlugins

      @Deprecated public static void setPlugins(File workDir)
      Deprecated.
      Sets the folder that contains the plugins. This method should be called before creating any document models.
      Parameters:
      workDir - The folder that contains the plugins.
    • setPlugins

      public static void setPlugins(File pluginsDir, File userUploadedPluginsDir)
      Sets the folder that contains the plugins. This method should be called before creating any document models.
      Parameters:
      pluginsDir - The folder that contains the plugins.
      userUploadedPluginsDir - the directory holding the user uploaded plugins.
    • getPluginsJS

      public static Reader getPluginsJS()
      Returns a reader over all JS files from the plugins. Beside plugins options it contains some server-side options.
      Returns:
      The reader over the concatenated JS files from plugins.
    • getPluginsCSS

      public static Reader getPluginsCSS()
      Returns a reader over the plugins WebappCSSResource files.
      Returns:
      The reader over the concatenated CSS files from plugins.
    • init

      public static void init()
      Initialize the web application.
    • getInitializationFatalError

      public static Optional<String> getInitializationFatalError()
      Returns:
      Fatal error that occurred during initialization. This can be presented in browser when trying to access Web Author.
    • dispose

      public static void dispose()
      Disposes any resources used by the document factory.
    • createDITAMapDocumentInfo

      public static DITAMapDocumentModel createDITAMapDocumentInfo(String systemID, Reader docReader, Map<String,?> sessionAttributes) throws IOException, SAXException
      Factory method that creates an editable DITA Map document model for the document with the specified systemID. It takes care of detecting the encoding, resolving DTD, etc.
      Parameters:
      systemID - The document URL.
      docReader - Reader over the document.
      sessionAttributes - Session attributes.
      Returns:
      The author document.
      Throws:
      IOException
      SAXException
      Since:
      26.1

      **************************************
      EXPERIMENTAL - Subject to change
      **************************************

      Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.

    • createDITAMapDocumentInfo

      public static DITAMapDocumentModel createDITAMapDocumentInfo(String systemID, Map<String,?> sessionAttributes) throws IOException, SAXException
      Factory method that creates an editable DITA Map document model for the document with the specified systemID. It takes care of detecting the encoding, resolving DTD, etc.
      Parameters:
      systemID - The document URL.
      sessionAttributes - The session attributes.
      Returns:
      The author document.
      Throws:
      IOException
      SAXException
      Since:
      26.1

      **************************************
      EXPERIMENTAL - Subject to change
      **************************************

      Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.