Class: GroupObject

helma.Group.GroupObject(Instance)

This class wraps the java GroupObject and provides several methods for retrieving and manipulating properties.

Constructor

new GroupObject(Instance)

Constructs a new helma.Group.GroupObject.
Parameters:
Name Type Description
Instance Object of helma.extensions.helmagroups.GroupObject
Source:

Members

(static) GET_FIRST

Static properties of GroupObject constructor function. These values determine if and for how many confirmation of the group members this instance waits after a modification. These values are passed through to org.jgroups.blocks.GroupRequest, for further comments see the sourcecode of that class
Source:

Methods

countChildren()

Returns the number of child GroupObjects
Source:
Returns:
The number of child GroupObjects of this helma.Group.GroupObject instance

countProperties()

Returns the number of properties of this GroupObject
Source:
Returns:
The number of properties

get(key)

Returns either a property or a child GroupObject from this GroupObject instance. The key passed as argument may be a String, an Array containing Strings or a String containing separator characters ("/"). In the latter two cases the argument is considered a path and the function walks down that path to find the requested GroupObject.
Parameters:
Name Type Description
key Object Either
  • a String
  • a String containing slashes
  • an Array containing String keys
Source:
Returns:
Depending on the argument either the appropriate property value or a helma.Group.GroupObject

getJavaObject()

Returns the wrapped java GroupObject.
Source:
Returns:
Instance of helma.extensions.helmagroups.GroupObject;

getProperty(key)

Gets a property from this GroupObject. The key passed as argument is always considered a property even if it contains a slash. This is actually a workaround for the fact that other instances of the group not using the javascript extension aren't forbidden to add properties containing a slash in the property's name. So, using this extension we can at least read the property.
Parameters:
Name Type Description
key String The name of the property to return
Source:
Returns:
The value of the property

isLocal()

Returns true if the GroupObject is not replicated
Source:
Returns:
True if this GroupObject is still local

listChildren()

Returns an Array containing all child GroupObjects
Source:
Returns:
An Array containing GroupObjects

listProperties()

Returns an Array containing all property names of this GroupObject instance
Source:
Returns:
An Array containing property names

remove(key, The)

Removes a property or a child GroupObject from this instance. The Key may be a String, an Array or a String with separator characters ("/"). In the latter two cases the argument is considered a path and the function walks down that path to find the GroupObject and deletes it.
Parameters:
Name Type Description
key Object Either
  • a String
  • a String containing slashes
  • an Array containing String keys
The Number mode to use when committing the change to the helma.Group
Source:

set(key, The, The)

Sets a property or a child GroupObject in this instance. The Key may be a String, an Array or a String with separator characters ("/"). In the latter two cases the argument is considered a path and all GroupObjects along this path are created if necessary.
Parameters:
Name Type Description
key Object Either
  • a String
  • a String containing slashes
  • an Array containing String keys
The Number value to set the property to.
The Object mode to use when committing the change to the helma.Group
Source:

toJSObject()

Converts this GroupObject into a vanilla Object
Source:
Returns:
An Object containing all properties of this GroupObject

unwrap()

Clones this GroupObject and returns it. This method should be considered if many properties of a GroupObject must be set or modified since every change to an already replicated GroupObject will result in immediate network traffic. Using unwrap one can modify several properties and then commit the GroupObject at once using {@link #wrap).
Source:
Returns:
A clone of this GroupObject

wrap(The)

Exchanges this GroupObject with the one passed as argument. This is done by exchanging the wrapped instance of helma.extensions.helmagroups.GroupObject
Parameters:
Name Type Description
The GroupObject GroupObject to use
Source:
Returns:
The GroupObject with the exchanged wrapped java object

(inner) checkWriteAccess()

private method that returns true if the group is writable
Source:
Returns:
Boolean

(inner) createPath()

if key is a path, walks through the path and returns the lowest GroupObject. if tree ends somewhere in the path, function creates the missing GroupObjects.
Source:
Returns:
helma.Group.GroupObject

(inner) getLastKeyElement()

Returns the last element if the key passed as argument is a path.
Source:
Returns:
Boolean

(inner) keyIsPath()

Checks if the key passed as argument is a path (either an Array or a String that contains separator characters)
Source:
Returns:
Boolean

(inner) walkPath()

if key is a path, walks through the path and returns the lowest GroupObject. if tree ends somewhere in the path, function returns null.
Source:
Returns:
null or GroupObject