Overview | File | Class | Tree | Index | Help
| Jala 1.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class jala.RemoteContent

    Object
       |
       +--helma.Http
             |
             +--jala.RemoteContent

class jala.RemoteContent
extends helma.Http

API to define, fetch and update content from a remote site.
Defined in RemoteContent.js

Field Summary
`<static> <final> File` | `CACHEDIR` The default cache directory.
`<static> <final> int` | `HTTP` A constant representing the HTTP retrieval method.
`<static> <final> String` | `SUFFIX` The default name of the cache directory.
`<static> <final> int` | `XMLRPC` A constant representing the XML-RPC retrieval method.

Constructor Summary
`jala.RemoteContent (<String> url, <Integer> method, <File> storage)` Construct a new remote content handler.

Method Summary
`void` | `clear()` Flushes (empties) the cached remote content.
`Object` | `get(<String> key)` Get an arbitrary property of the remote content.
`Array` | `getKeys()` Get all available property names.
`Boolean` | `needsUpdate()` Tests whether the remote content needs to be updated.
`void` | `setInterval(<Number> interval)` Set the interval the remote content's cache is bound to be updated.
`String` | `toString()` Get a string representation of the remote content.
`String` | `update()` Get the updated and cached remote content.
`Object` | `valueOf()` Get the value of the remote content.
`<static> void` | `exec()` Apply a custom method on all remote content in a file-based cache.
`<static> void` | `flush(<File> cache)` Remove all remote content from a file-based cache.
`<static> void` | `forEach(<Function> callback, <File> cache)` Apply a custom method on all remote content in a file-based cache.

Field Detail

### CACHEDIR

    <static> <final> File CACHEDIR

The default cache directory.

### HTTP

    <static> <final> int HTTP

A constant representing the HTTP retrieval method.

See Also:
  Constant Field Values

### SUFFIX

    <static> <final> String SUFFIX

The default name of the cache directory.

See Also:
  Constant Field Values

### XMLRPC

    <static> <final> int XMLRPC

A constant representing the XML-RPC retrieval method.

See Also:
  Constant Field Values

Constructor Detail

### jala.RemoteContent

    jala.RemoteContent(<String> url, <Integer> method, <File> storage)

Construct a new remote content handler.

Parameters:

`url` - The URL string of the remote site.

`method` - The method to retrieve the remote content.

`storage` - The cache directory.

Returns:

A new remote content handler.

Method Detail

### clear

    void clear()

Flushes (empties) the cached remote content.

### get

    Object get(<String> key)

Get an arbitrary property of the remote content.

Parameters:

`key` - The name of the property.

Returns:

The value of the property.

### getKeys

    Array getKeys()

Get all available property names.

Returns:

The list of property names.

### needsUpdate

    Boolean needsUpdate()

Tests whether the remote content needs to be updated.

Returns:

True if the remote content needs to be updated.

### setInterval

    void setInterval(<Number> interval)

Set the interval the remote content's cache is bound to be updated.

Parameters:

`interval` - The interval value in milliseconds.

### toString

    String toString()

Get a string representation of the remote content.

Returns:

The remote content as string.

### update

    String update()

Get the updated and cached remote content.

Returns:

The content as retrieved from the remote site.

### valueOf

    Object valueOf()

Get the value of the remote content.

Returns:

The remote content including response header data.

### exec

    <static> void exec()

Apply a custom method on all remote content in a file-based cache.

Parameters:

`callback` - The callback method to be executed for each remote content file.

`cache` - An optional target directory.

Deprecated Use forEach() instead.

### flush

    <static> void flush(<File> cache)

Remove all remote content from a file-based cache.

Parameters:

`cache` - An optional target directory.

### forEach

    <static> void forEach(<Function> callback, <File> cache)

Apply a custom method on all remote content in a file-based cache.

Parameters:

`callback` - The callback method to be executed for each remote content file.

`cache` - An optional target directory.

Overview | File | Class | Tree | Index | Help
| Jala 1.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Tue Jan 8 15:45:31 2008