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

## Class jala.History

    Object
       |
       +--jala.History

class jala.History

This class is an implementation of a Browser-like history stack suitable to use in any Helma application. The difference to a Browser's history is that this implementation ignores POST requests and checks if Urls in the stack are still valid to prevent eg. redirections to a HopObject's url that has been deleted. Plus it is capable to create new "intermediate" history-stacks and this way maintain a "history of histories" which is needed for eg. editing sessions in a popup window that should use their own request history without interfering with the history of the main window.
Defined in History.js

Constructor Summary
`jala.History ()` Constructs a new History object.

Method Summary
`void` | `add()` Initializes a new history stack, adds it to the array of stacks (which makes it the default one to use for further requests) and records the current request Url.
`void` | `clear()` Clears the currently active history stack
`String` | `dump()` Returns the contents of all history stacks as string
`String` | `peek(<Number> offset)` Retrieves the request Url at the given position in the current history stack.
`String` | `pop(<Number> offset)` Retrieves the first valid request Url in history stack starting with a given offset.
`void` | `push()` Records a request Url in the currently active history stack.
`void` | `redirect(<Number> offset)` Redirects the client back to the first valid request in history.
`void` | `remove()` Removes the current history stack

Constructor Detail

### jala.History

    jala.History()

Constructs a new History object.

Method Detail

### add

    void add()

Initializes a new history stack, adds it to the array of stacks (which makes it the default one to use for further requests) and records the current request Url.

### clear

    void clear()

Clears the currently active history stack

### dump

    String dump()

Returns the contents of all history stacks as string

Returns:

The history stacks as string

### peek

    String peek(<Number> offset)

Retrieves the request Url at the given position in the current history stack. If no offset is given the last Url in the stack is returned. This method does not alter the stack contents!

Parameters:

`offset` - The index position in history stack to start searching at

Returns:

The Url of the request

### pop

    String pop(<Number> offset)

Retrieves the first valid request Url in history stack starting with a given offset. The default offset is 1. Any valid Url found is removed from the stack, therefor this method alters the contents of the history stack.

Parameters:

`offset` - The index position in history stack to start searching at

Returns:

The Url of the request

### push

    void push()

Records a request Url in the currently active history stack.

### redirect

    void redirect(<Number> offset)

Redirects the client back to the first valid request in history. Please mind that searching for a valid Url starts at history.length - 2.

Parameters:

`offset` - The index position in the stack to start searching at

### remove

    void remove()

Removes the current history stack

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

Documentation generated by JSDoc on Tue May 29 10:26:15 2007