System
[ class tree: System ] [ index: System ] [ all elements ]

Class: TViewStateManager

Source Location: /TViewStateManager.php

Class Overview


TViewStateManager class

Class Details

[line 30]
TViewStateManager class

TViewStateManager maintains the storage of viewstate data on server side. When it is enabled, page viewstate data will be saved in session. You can extend this class to store viewstate data with other methods.




version:  v1.0, last update on 2004/08/13 21:44:52
author:  Qiang Xue <qiang.xue@gmail.com>


[ Top ]

Variables

Constants

Methods



Class Variables

$currentID = -1

[line 37]



access:  protected

Type:   mixed


[ Top ]

$encrypt = false

[line 39]



access:  protected

Type:   mixed


[ Top ]

$key = ''

[line 38]



access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 47]

TViewStateManager __construct( mixed $config)

Constructor.

Reads the configuration given in the app spec. In particular, the attribute 'enabled' and 'buffer-size' are read.




Parameters:

mixed   $config   the configuration.

[ Top ]

method computeHMAC [line 163]

string computeHMAC( string &$data, string $key)

Computes the HMAC of the input data.

This method returns MD5-based HMAC. It can be overriden to provide other way of HMAC computation.




return:  HMAC of the data
access:  protected


Parameters:

string   &$data   data
string   $key   key

[ Top ]

method decode [line 210]

void &decode( mixed &$data)



access:  public


[ Top ]

method encode [line 192]

void &encode( mixed &$viewstate)



access:  public


[ Top ]

method generateRandomKey [line 174]

void generateRandomKey( )



access:  protected


[ Top ]

method getBufferSize [line 69]

integer getBufferSize( )



return:  the number of page viewstates that will be saved
access:  public


[ Top ]

method getKey [line 182]

void getKey( )



access:  protected


[ Top ]

method isEnabled [line 77]

boolean isEnabled( )



return:  is server-side viewstate maintenance enabled
access:  public


[ Top ]

method loadViewState [line 135]

string &loadViewState( integer $id)

Loads a viewstate (in terms of a string) from session.

This method can be overriden to provide customized retrieval of viewstate data. If you override this method, please override saveViewState() as well.




return:  viewstate data
access:  public


Parameters:

integer   $id   an ID identifying the storage of this viewstate

[ Top ]

method saveViewState [line 94]

integer saveViewState( string &$viewState)

Saves a viewstate (in terms of a string) in session.

Default implementation saves current page viewstate into an array that contains a list of pages' viewstate that are due to past visits within current session. The array is then saved into session. This method can be overriden to provide customized storage of viewstate data. If you override this method, please override loadViewState() as well.




return:  an ID identifying the storage of this viewstate
access:  public


Parameters:

string   &$viewState   viewstate data

[ Top ]


Class Constants

MAX_PAGE_NUMBER = 100

[line 32]


[ Top ]

SESSION_KEY = 'key'

[line 34]


[ Top ]

SESSION_VSM = 'vsm'

[line 33]


[ Top ]



© 2004-2005 PRADO Software Group. All Rights Reserved.