Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ajax4jsf.resource
Interface InternetResource

    public interface InternetResource

Interface for work with off-page internet resources ( images, scripts, styles etc. ) All instances must work in two phases - render page ( application set HTML code and attributes to reference resource ) and in concrete request to resource body. For best performance, preffer to realise it as "lightweght" pattern.

Version:
  $Revision: 1.1.2.2 $ $Date: 2007/01/11 16:52:15 $
Author:
  asmirnov@exadel.com (latest modification by $Author: nick_belaevski $)

Field Summary
`static java.lang.String` | `CODEC_ATTR`
`static java.lang.String` | `DATA_SEPARATOR`
`static long` | `DEFAULT_EXPIRE`
`static java.lang.String` | `DEFAULT_EXPITE_PARAMETER`
`static int` | `DEFAULT_TTL`
`static java.lang.String` | `ENCODE_PASS_PARAMETER`
`static java.lang.String` | `ENCODE_URI_PARAMETER`
`static java.lang.String` | `RESOURCE_PROTOCOL`
`static java.lang.String` | `RESOURCE_URI_PREFIX`
`static int` | `RESOURCE_URI_PREFIX_LENGTH`

Method Summary
`void` | `encode(javax.faces.context.FacesContext context, java.lang.Object data)` Encode resource as Markup .
`void` | `encode(javax.faces.context.FacesContext context, java.lang.Object data, java.util.Map<java.lang.String,java.lang.Object> attributes)` Encode resource as Markup with custom attributes .
`void` | `encodeBegin(javax.faces.context.FacesContext context, java.lang.Object component, java.util.Map<java.lang.String,java.lang.Object> attrs)` Encode start tag, attributes and body ( for inline script or style )
`void` | `encodeEnd(javax.faces.context.FacesContext context, java.lang.Object component)` Encode closed tag.
`int` | `getContentLength(ResourceContext resourceContext)`
`java.lang.String` | `getContentType(ResourceContext resourceContext)`
`long` | `getExpired(ResourceContext resourceContext)`
`java.lang.String` | `getKey()`
`java.util.Date` | `getLastModified(ResourceContext resourceContext)`
`java.lang.Object` | `getProperty(java.lang.Object key)` Custom properties for resource ( image size etc.
`ResourceRenderer` | `getRenderer(ResourceContext resourceContext)`
`java.io.InputStream` | `getResourceAsStream(ResourceContext context)`
`java.lang.String` | `getUri(javax.faces.context.FacesContext context, java.lang.Object data)`
`boolean` | `isCacheable(ResourceContext resourceContext)`
`boolean` | `isSessionAware()` Flag for check session-dependencies for resource.
`boolean` | `requireFacesContext()`
`void` | `send(ResourceContext context)` Send incapsulated resource to client by `ResourceContext` .
`void` | `sendHeaders(ResourceContext response)` Set response headers based on resource properties ( mime type etc ) TODO - send via `FacesContext` ???
`void` | `setCacheable(boolean cacheable)`
`void` | `setExpired(long expired)`
`void` | `setKey(java.lang.String key)`
`void` | `setLastModified(java.util.Date lastModified)`
`void` | `setProperty(java.lang.Object key, java.lang.Object value)` Set new value for custom property.
`void` | `setRenderer(ResourceRenderer renderer)` Set concrete renderer ( for brige pattern ).
`void` | `setSessionAware(boolean sessionAware)`

Field Detail

### CODEC_ATTR

    static final java.lang.String CODEC_ATTR

See Also:
  Constant Field Values

### DATA_SEPARATOR

    static final java.lang.String DATA_SEPARATOR

See Also:
  Constant Field Values

### DEFAULT_EXPITE_PARAMETER

    static final java.lang.String DEFAULT_EXPITE_PARAMETER

See Also:
  Constant Field Values

### DEFAULT_TTL

    static final int DEFAULT_TTL

See Also:
  Constant Field Values

### ENCODE_PASS_PARAMETER

    static final java.lang.String ENCODE_PASS_PARAMETER

See Also:
  Constant Field Values

### ENCODE_URI_PARAMETER

    static final java.lang.String ENCODE_URI_PARAMETER

See Also:
  Constant Field Values

### RESOURCE_PROTOCOL

    static final java.lang.String RESOURCE_PROTOCOL

See Also:
  Constant Field Values

### RESOURCE_URI_PREFIX

    static final java.lang.String RESOURCE_URI_PREFIX

See Also:
  Constant Field Values

### RESOURCE_URI_PREFIX_LENGTH

    static final int RESOURCE_URI_PREFIX_LENGTH

### DEFAULT_EXPIRE

    static final long DEFAULT_EXPIRE

See Also:
  Constant Field Values

Method Detail

### getContentLength

    int getContentLength(ResourceContext resourceContext)

  Parameters:
    `resourceContext` - current `ResourceContext`
  Returns:
    Returns the contentLength.

### getExpired

    long getExpired(ResourceContext resourceContext)

  Parameters:
    `resourceContext` - current `ResourceContext`
  Returns:
    Returns the expired.

### getLastModified

    java.util.Date getLastModified(ResourceContext resourceContext)

  Parameters:
    `resourceContext` - current `ResourceContext`
  Returns:
    Returns the lastModified.

### isCacheable

    boolean isCacheable(ResourceContext resourceContext)

  Parameters:
    `resourceContext` - current `ResourceContext`
  Returns:
    Returns the cacheable.

### getContentType

    java.lang.String getContentType(ResourceContext resourceContext)

  Parameters:
    `resourceContext` - current `ResourceContext`
  Returns:
    Returns the mimeType.

### getResourceAsStream

    java.io.InputStream getResourceAsStream(ResourceContext context)

  Parameters:
    `context` - TODO
  Returns:
    input stream with resource

### getUri

    java.lang.String getUri(javax.faces.context.FacesContext context,
                            java.lang.Object data)

  Returns:
    string with URI for get resource from page.

### encode

    void encode(javax.faces.context.FacesContext context,
                java.lang.Object data)
                throws java.io.IOException

  Encode resource as Markup .

  Parameters:
    `context` -
    `data` -
  Throws:
    `java.io.IOException`

### encode

    void encode(javax.faces.context.FacesContext context,
                java.lang.Object data,
                java.util.Map<java.lang.String,java.lang.Object> attributes)
                throws java.io.IOException

  Encode resource as Markup with custom attributes .

  Parameters:
    `context` -
    `data` -
    `attributes` -
  Throws:
    `java.io.IOException`

### encodeBegin

    void encodeBegin(javax.faces.context.FacesContext context,
                     java.lang.Object component,
                     java.util.Map<java.lang.String,java.lang.Object> attrs)
                     throws java.io.IOException

  Encode start tag, attributes and body ( for inline script or style )

  Parameters:
    `context` -
    `component` -
    `attrs` -
  Throws:
    `java.io.IOException`

### encodeEnd

    void encodeEnd(javax.faces.context.FacesContext context,
                   java.lang.Object component)
                   throws java.io.IOException

  Encode closed tag.

  Parameters:
    `context` -
    `component` -
  Throws:
    `java.io.IOException`

### send

    void send(ResourceContext context)
              throws java.io.IOException

  Send incapsulated resource to client by `ResourceContext` .

  Parameters:
    `context` -
  Throws:
    `java.io.IOException`

### sendHeaders

    void sendHeaders(ResourceContext response)

  Set response headers based on resource properties ( mime type etc ) TODO - send via `FacesContext` ???

  Parameters:
    `response` -

### getProperty

    java.lang.Object getProperty(java.lang.Object key)

  Custom properties for resource ( image size etc. )

  Parameters:
    `key` -
  Returns:
    property value, or null if not set.

### setProperty

    void setProperty(java.lang.Object key,
                     java.lang.Object value)

  Set new value for custom property.

  Parameters:
    `key` -
    `value` -

### setRenderer

    void setRenderer(ResourceRenderer renderer)

  Set concrete renderer ( for brige pattern ). In renderer, incapsulate encoding functions, content type, resource encoding.

  Parameters:
    `renderer` -

### requireFacesContext

    boolean requireFacesContext()

  Returns:
    true, if resource must be rendered in faces request cicle.

### isSessionAware

    boolean isSessionAware()

  Flag for check session-dependencies for resource. In application-wide case, resource URL not prepared by context.getExternalContext().encodeResourceURL(resourceURL) and used application-wide cache for store.

  Returns:

### setKey

    void setKey(java.lang.String key)

### getKey

    java.lang.String getKey()

### getRenderer

    ResourceRenderer getRenderer(ResourceContext resourceContext)

### setSessionAware

    void setSessionAware(boolean sessionAware)

### setCacheable

    void setCacheable(boolean cacheable)

### setLastModified

    void setLastModified(java.util.Date lastModified)

### setExpired

    void setExpired(long expired)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.