org.olat.properties
Class NarrowedPropertyManager

java.lang.Object
  extended by org.olat.properties.NarrowedPropertyManager

public class NarrowedPropertyManager
extends java.lang.Object

Initial Date: Mar 10, 2004

Author:
Mike Stock Comment:

Method Summary
 Property createPropertyInstance(Identity identity, BusinessGroup group, java.lang.String category, java.lang.String name, java.lang.Float floatValue, java.lang.Long longValue, java.lang.String stringValue, java.lang.String textValue)
          Create a property
 void deleteAllProperties()
          deletes all properties of this resourceable
 void deleteProperties(Identity identity, BusinessGroup group, java.lang.String category, java.lang.String name)
          Delete properties.
 void deleteProperty(Property p)
          Delete a property from the database
 java.util.List findProperties(Identity identity, BusinessGroup grp, java.lang.String category, java.lang.String name)
          Generic find method.
 Property findProperty(Identity identity, BusinessGroup grp, java.lang.String category, java.lang.String name)
          Generic find method.
static NarrowedPropertyManager getInstance(OLATResourceable resourceable)
          Get an instance of a narrowed property manager for this olat resource
 java.util.List listProperties(Identity identity, BusinessGroup grp, java.lang.String category, java.lang.String name)
          Generic method.
 void saveProperty(Property p)
          Save a property in the database
 void updateProperty(Property p)
          Save or update a property
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NarrowedPropertyManager getInstance(OLATResourceable resourceable)
Get an instance of a narrowed property manager for this olat resource

Parameters:
resourceable - The resource
Returns:
The narrowed property manager

createPropertyInstance

public Property createPropertyInstance(Identity identity,
                                       BusinessGroup group,
                                       java.lang.String category,
                                       java.lang.String name,
                                       java.lang.Float floatValue,
                                       java.lang.Long longValue,
                                       java.lang.String stringValue,
                                       java.lang.String textValue)
Create a property

Parameters:
identity -
group -
category -
name -
floatValue -
longValue -
stringValue -
textValue -
Returns:
The created property

deleteProperty

public void deleteProperty(Property p)
Delete a property from the database

Parameters:
p -

saveProperty

public void saveProperty(Property p)
Save a property in the database

Parameters:
p -

updateProperty

public void updateProperty(Property p)
Save or update a property

Parameters:
p -

listProperties

public java.util.List listProperties(Identity identity,
                                     BusinessGroup grp,
                                     java.lang.String category,
                                     java.lang.String name)
Generic method. Returns a list of Property objects. This is an inexact match i.e. parameters with null values will not be included in the query.

Parameters:
identity -
grp -
category -
name -
Returns:
a list of Property objects

findProperties

public java.util.List findProperties(Identity identity,
                                     BusinessGroup grp,
                                     java.lang.String category,
                                     java.lang.String name)
Generic find method. Returns a list of Property objects. This is an exact match i.e. if you pass-on null values, null values will be included in the query.

Parameters:
identity -
grp -
category -
name -
Returns:
a list of Property objects

findProperty

public Property findProperty(Identity identity,
                             BusinessGroup grp,
                             java.lang.String category,
                             java.lang.String name)
Generic find method.

Parameters:
identity -
grp -
category -
name -
Returns:
The property or null if no property found
Throws:
AssertException - if more than one property matches.

deleteAllProperties

public void deleteAllProperties()
deletes all properties of this resourceable


deleteProperties

public void deleteProperties(Identity identity,
                             BusinessGroup group,
                             java.lang.String category,
                             java.lang.String name)
Delete properties. IMPORTANT: if an argument is null, then it will be not considered in the delete statement, which means not only the record having a "null" value will be deleted, but all. At least one of the arguments must be not null, otherwhise an assert exception will be thrown. If you want to delete all properties of this ressource, then use the deleteAllProperties() method.

Parameters:
identity -
group -
category -
name -