|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.omus.core.PropertySet
Represents a collection of properties. The PropertySet class is similar to the ActionScript PropertySet object in the Client API. Each group and each user have a set of properties associated with them. The datatype as well as persistence and synchronization settings for each property must be defined in the XML configuration file on the server. See the Configuration chapter for details. The PropertySet object can be used to read individual property values, to load properties from the database or to synchronize them. The actual modification of the value of a property is carried out through methods of the DataField instance that represents the property. Please note that modified values will not be written to the database and not be reflected in the clients before you commit all changes with a call to synchronize. Example code to change some properties of a user and synchronize them might look as follows:
PropertySet ps = group.getProperties();
IntField age = (IntField)ps.getValue("age");
age.setInt(27);
BooleanField married = (BooleanField)ps.getValue("married");
married.setBoolean(false);
try {
ps.synchronize();
} catch (org.omus.db.DbException dbe) {
System.out.println("ERROR: " + dbe);
}
| Method Summary | |
boolean |
contains(java.lang.String name)
Returns true if this PropertySet object contains a property with the specified name |
java.lang.Object |
getOwner()
Returns the owner of this PropertySet object. |
IntField |
getPrimaryKey()
Returns the primary key for this PropertySet object corresponding to the usrID and grpID fields in the userprops and groupprops tables in the database. |
java.lang.Class |
getType(java.lang.String name)
Returns the type of the property with the specified name. |
DataField |
getValue(java.lang.String name)
Returns the value of the property with the specified name or null if the property was not loaded yet. |
boolean |
isLoaded(java.lang.String name)
Returns true if the value of the property with the specified name has been loaded from the database. |
boolean |
isModified(java.lang.String name)
Returns true if the property with the specified name was modified since the last synchronization. |
void |
load(java.lang.String[] propNames)
Loads all values of the properties with the specified names into the client. |
void |
loadAll()
Loads the values of all properties that are not loaded automatically. |
int |
size()
Returns the number of properties in this set. |
void |
synchronize()
Synchronizes all modified properties in this set according to the synchronization settings in the XML configuration file on the server. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public java.lang.Object getOwner()
public IntField getPrimaryKey()
public boolean contains(java.lang.String name)
public boolean isModified(java.lang.String name)
public boolean isLoaded(java.lang.String name)
public java.lang.Class getType(java.lang.String name)
public DataField getValue(java.lang.String name)
public int size()
public void synchronize()
throws DbException
public void load(java.lang.String[] propNames)
throws DbException
public void loadAll()
throws DbException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||