org.eclnt.jsfserver.bufferedcontent

## Class DefaultBufferedContent

- java.lang.Object
- - org.eclnt.jsfserver.bufferedcontent.DefaultBufferedContent

- All Implemented Interfaces:
    java.io.Serializable, IBufferedContent
  Direct Known Subclasses:
    LogViewer.MyBufferedContent

      public abstract class DefaultBufferedContent
      extends java.lang.Object
      implements IBufferedContent

  Default implementation of IBufferedContent interface. Should be used for all implementations. This class will be updated in case the interface is extended.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBufferedContent()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `beginGetting()` When overriding this method always call super() in your implementation!
    `void` | `endGetting()` When overriding this method always call super() in your implementation!
    `long` | `getContentLength()` Default implementation calls `IBufferedContent.getContent()` and passes back the length of the array.
    `java.lang.String` | `getCurrentClientFileName()` Deprecated.
    `java.lang.String` | `getCurrentRequestQueryString()` When the buffered content is accessed then you may be interested in the URL by which the buffered content is called. - This parameter is only valid when the buffered content is actually requested from the client side.
    `java.lang.String` | `getCurrentRequestURL()` When the buffered content is accessed then you may be interested in the URL by which the buffered content is called. - This parameter is only valid when the buffered content is actually requested from the client side.
    `java.lang.String` | `getExtension()`
    `java.lang.String` | `getFileName()` File name for download, which is set within the http header response parameters.
    `java.lang.String` | `getId()` Returns the id under which the buffered content is registered.
    `java.lang.String` | `getURL()` The URL that can be passed back to client side for accessing the buffered content.
    `java.lang.String` | `getURLForBROWSERUsage()` Deprecated.
    `void` | `passClientFileName(java.lang.String clientFileName)` Internal usage. - The ccfilename-parameter of the current request, accessing the buffered content is passed.
    `void` | `passCurrentRequestQueryString(java.lang.String queryString)` Internal usage. - The request query string of the current request, accessing the buffered content is passed.
    `void` | `passCurrentRequestURL(java.lang.String url)` Internal usage. - The request URL of the current request, accessing the buffered content is passed.
    `void` | `preProcessResponse(HttpServletResponse response)` In the default implementation the header parameter "x-frame-options" is set to "sameorigin" so that the buffered content is not embed-able into pages coming from some different host.
    `void` | `setExtension(java.lang.String value)` You may pass an optional extension (e.g.
    `void` | `setFileName(java.lang.String value)` You may pass an optional file name (e.g.

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

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

    - ### Methods inherited from interface org.eclnt.jsfserver.bufferedcontent.IBufferedContent

      `getContent, getContentType`

- - ### Constructor Detail

    - #### DefaultBufferedContent

          public DefaultBufferedContent()

  - ### Method Detail

    - #### getContentLength

          public long getContentLength()

      Default implementation calls `IBufferedContent.getContent()` and passes back the length of the array. Please pay attention: if getContent() is a complex method then you definitely should override the getContentLength-implementation so that `IBufferedContent.getContent()` is not called twice - first time for finding the length and second time for finding the content. - This method is called in the download scenario only, if the corresponding download component is explicitly marked (e.g. FILEDOWNLOADBUTTON-WITHCONTENTSIZE).
      Specified by:
        `getContentLength` in interface `IBufferedContent`

    - #### setExtension

          public void setExtension(java.lang.String value)

      You may pass an optional extension (e.g. "xls", "txt", "pdf", "html", ...). This extension is appended to the URL. If the URL is sent to the browser then the extension helps the browser to start the right application that is associated with the content.
      The definition of the extension will be ignored if passing an explicit file name by calling `setFileName(String)`.
      PLEASE CHECK: when using the extension then the servlet mapping of the BufferedContentServlet needs to be up to date - please check your web.xml file against the template (web.xml_template).

    - #### getExtension

          public java.lang.String getExtension()

    - #### setFileName

          public void setFileName(java.lang.String value)

      You may pass an optional file name (e.g. "harry.xls", "jo.txt", ...). The URL that is internally built up will end with this file name, so that it gets automatically proposed when doing direct downloads via a web browser.
      The purpose for adding a file name is to pass a file name into the URL so that browsers propose the file name when e.g. downloading data from this URL.
      If setting an explicit file name, then this definition will override the extension-definition that you may do with `setExtension(String)`.
      PLEASE CHECK: when using the extension then the servlet mapping of the BufferedContentServlet needs to be up to date - please check your web.xml file against the template (web.xml_template).

    - #### getFileName

          public java.lang.String getFileName()

      Description copied from interface: `IBufferedContent`
      File name for download, which is set within the http header response parameters. Only is used in the context of browser processing.
      Specified by:
        `getFileName` in interface `IBufferedContent`

    - #### getId

          public java.lang.String getId()

      Returns the id under which the buffered content is registered.
      Specified by:
        `getId` in interface `IBufferedContent`

    - #### getURL

          public java.lang.String getURL()

      The URL that can be passed back to client side for accessing the buffered content. The URL contains the session id. The URL is a relative URL that can be passed to all Swing-based components (e.g. FILEDOWNLOADLINK) in any scenario.
      When using CaptainCasa in embedded usage mode (UI is running with stand alone Tomcat within one virtual machine) and passing the URL to the BROWSER component then there will be problems. Use the function getURLForBrowserUsage() instead.
      Specified by:
        `getURL` in interface `IBufferedContent`

    - #### getURLForBROWSERUsage

          @Deprecated
          public java.lang.String getURLForBROWSERUsage()

      Deprecated.
      Depreacted - usr `getURL()`. The embedded mode ist not supported with the RISC client.
      Passes back a "normal URL" when running in "normal scenarios". When using CaptainCasa Enterprise Client in embedded usage mode (Tomcat running directly inside client) then the URL passed back is a file:///-URL. In this case the content is directly resolved within this method and written into a temporary location (work directory).
      Specified by:
        `getURLForBROWSERUsage` in interface `IBufferedContent`

    - #### passClientFileName

          public void passClientFileName(java.lang.String clientFileName)

      Internal usage. - The ccfilename-parameter of the current request, accessing the buffered content is passed.
      Specified by:
        `passClientFileName` in interface `IBufferedContent`

    - #### passCurrentRequestURL

          public void passCurrentRequestURL(java.lang.String url)

      Internal usage. - The request URL of the current request, accessing the buffered content is passed.
      Specified by:
        `passCurrentRequestURL` in interface `IBufferedContent`

    - #### getCurrentRequestURL

          public java.lang.String getCurrentRequestURL()

      When the buffered content is accessed then you may be interested in the URL by which the buffered content is called. - This parameter is only valid when the buffered content is actually requested from the client side.

    - #### passCurrentRequestQueryString

          public void passCurrentRequestQueryString(java.lang.String queryString)

      Internal usage. - The request query string of the current request, accessing the buffered content is passed.
      Specified by:
        `passCurrentRequestQueryString` in interface `IBufferedContent`

    - #### getCurrentRequestQueryString

          public java.lang.String getCurrentRequestQueryString()

      When the buffered content is accessed then you may be interested in the URL by which the buffered content is called. - This parameter is only valid when the buffered content is actually requested from the client side.

    - #### getCurrentClientFileName

          @Deprecated
          public java.lang.String getCurrentClientFileName()

      Deprecated.
      This function is not available in the RISC client! The browser never tells details about the local file system of the client... This is the reason for setting this method to deprecated.
      If the access to the buffered content is associated with a client file download, then the name of the client file is available via this method.

    - #### beginGetting

          public void beginGetting()

      When overriding this method always call super() in your implementation!
      Specified by:
        `beginGetting` in interface `IBufferedContent`

    - #### endGetting

          public void endGetting()

      When overriding this method always call super() in your implementation!
      Specified by:
        `endGetting` in interface `IBufferedContent`

    - #### preProcessResponse

          public void preProcessResponse(HttpServletResponse response)

      In the default implementation the header parameter "x-frame-options" is set to "sameorigin" so that the buffered content is not embed-able into pages coming from some different host. You may override this behavior.
      Specified by:
        `preProcessResponse` in interface `IBufferedContent`

Copyright © CaptainCasa Gmbh. All Rights Reserved.