How to get list of variables in plugin.VariablesHandler

I couldn’t find any method in VariablesHandler which returns the list of the variables.
Is there any way to get this list?


yes you are right, we haven’t provided the functionality to retrieve a list of stored variables,but it is easy to expand the variables handler by adding one or two public methods:

The following methode will show you, how a solution could look like:
e.g.: for session variables.

<BR>    public Iterator getSessionVariables() {<BR>        return sessionVariables.keySet().iterator();<BR>    }<BR>

For page variables you just need to copy and adapt this method.

Bye Thorsten

I didnt see a method to remove a specific session variable from VariablesHandler.
Can someone tell me how I can implement this in VariablesHandler class?


currently we do not have a method for deleting a variable, but it is quite easy to insert.

Here is one suggestion:

 public void deleteVariable(String name, String scope){<BR>        cacheVariables.remove(name);<BR>        if (scope.equals(SESSION)){<BR>            sessionVariables.remove(name);<BR>        }<BR>        if (scope.equals(PAGE)){<BR>            pageVariables.remove(name);<BR>        }<BR>    }<BR>

Bye Thorsten