de.esprit.appsuite.database.io

## Class DBOHtmlWriter<C extends ApplicationContext>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.appsuite.task.AbstractAsyncExecutable<C>
      - - de.esprit.appsuite.io.DataWriter<C>
        - - de.esprit.appsuite.xml.TagWriter<C>
          - - de.esprit.appsuite.database.io.DBOHtmlWriter<C>

- All Implemented Interfaces:
    ApplicationObject<C>, AsyncExecutable<C>, CancellableTask, TaskMonitorSupport, SimpleLogSupport, Dumpable, Executable, java.io.Closeable, java.lang.AutoCloseable

      public abstract class DBOHtmlWriter<C extends ApplicationContext>
      extends TagWriter<C>

  This writer uses a TagWriter for converting the state of a DBObject to an HTML table description for output in web pages. Warning: If writing to a stream the latter will not be closed by default! This is because when you write to a socket the web-server actually needs to close the stream. Use `DataWriter.setCloseStreamWhenFinished(boolean)` if you want to get it closed. This applies only when writing to a stream. If you write to a file, close will done automatically.
  Author:
    Rainer Buesch

- - ### Field Summary

    - ### Fields inherited from class de.esprit.appsuite.xml.TagWriter

      `attrs, DEFAULT_ENCODING`

    - ### Fields inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `childTaskRef, isTestMode, monitorController, resultRef, stateFlag`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DBOHtmlWriter(C ctx, java.io.File outFile)`
    `DBOHtmlWriter(C ctx, java.io.OutputStream out)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeTable()`
    `protected AttrList` | `getHeaderFontAttributes()` Defines the font attributes used to print column headers
    `protected AttrList` | `getPKHeaderFontAttributes()` Defines the font attributes used to print primary key column headers
    `protected AttrList` | `getTableAttributes()` Defines the attributes for the HTML table.
    `void` | `openTable(DBObject dbo)` Opens a HTML table for the given DBOjbect master and prints the table header
    `protected void` | `performWriteFooter()`
    `protected void` | `performWriteHeader()`
    `java.lang.String` | `toHtmlValue(java.lang.Object o)`
    `void` | `writeDBObject(DBObject dbo)` Writes the given DBObject's data as a HTML table row

    - ### Methods inherited from class de.esprit.appsuite.xml.TagWriter

      `attr, close, closeTag, getSimpleTagCloseBracket, getTag, isWritingEmptyTags, openTag, openTag, performWrite, performWriteBody, printIndent, setIndentString, setWriteEmptyTags, writeComment, writeTag, writeTag, writeTag, writeTag, writeValue, writeXmlHeader`

    - ### Methods inherited from class de.esprit.appsuite.io.DataWriter

      `createFileOutputStream, executeAsync, flush, format, format, getEncoding, getOutputFile, getWriteDuration, getWriter, openStream, print, print, print, print, print, print, print, print, print, printf, printf, printLine, println, println, println, println, println, println, println, println, println, println, setCloseStreamWhenFinished, setEncoding, setOutputFile, setOutputStream, write, write, write, write, write`

    - ### Methods inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `addMonitor, checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, doOnCancel, doOnFailure, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, handleFinish, handleStart, handleSuccess, hasError, hasMonitor, isCancellable, notifyProceeded, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface de.esprit.appsuite.launch.ApplicationObject

      `getApplicationContext`

    - ### Methods inherited from interface de.esprit.common.log.SimpleLogSupport

      `getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

- - ### Constructor Detail

    - #### DBOHtmlWriter

          public DBOHtmlWriter(C ctx,
                       java.io.OutputStream out)

    - #### DBOHtmlWriter

          public DBOHtmlWriter(C ctx,
                       java.io.File outFile)

  - ### Method Detail

    - #### openTable

          public void openTable(DBObject dbo)

      Opens a HTML table for the given DBOjbect master and prints the table header

    - #### getTableAttributes

          protected AttrList getTableAttributes()

      Defines the attributes for the HTML table. Default: "style=font-size:14" and "border=1"

    - #### getPKHeaderFontAttributes

          protected AttrList getPKHeaderFontAttributes()

      Defines the font attributes used to print primary key column headers

    - #### getHeaderFontAttributes

          protected AttrList getHeaderFontAttributes()

      Defines the font attributes used to print column headers

    - #### writeDBObject

          public void writeDBObject(DBObject dbo)

      Writes the given DBObject's data as a HTML table row

    - #### closeTable

          public void closeTable()

    - #### toHtmlValue

          public java.lang.String toHtmlValue(java.lang.Object o)

    - #### performWriteHeader

          protected void performWriteHeader()
                                     throws java.lang.Exception

      Overrides:
        `performWriteHeader` in class `TagWriter<C extends ApplicationContext>`
      Throws:
        `java.lang.Exception`

    - #### performWriteFooter

          protected void performWriteFooter()
                                     throws java.lang.Exception

      Overrides:
        `performWriteFooter` in class `TagWriter<C extends ApplicationContext>`
      Throws:
        `java.lang.Exception`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.