* Base Class of Entities
* Interfacing TemplateHashModel and TemplateModelRoot to be freemarker compliant
*
- * @author rk
- * @version 29.6.1999
+ * @version $Revision: 1.7 $ $Date: 2002/06/28 20:35:38 $
+ * @author $Author: mh $
+ *
+ * $Log: Entity.java,v $
+ * Revision 1.7 2002/06/28 20:35:38 mh
+ * use some cvs macros/id's
+ *
*
*/
this.changed = false;
instances++;
Integer i = new Integer(instances);
- System.err.println("New abstract entity instance: "+i.toString());
+ //System.err.println("New abstract entity instance: "+i.toString());
}
/**
{
if (field.equals("webdb_create_formatted"))
{
- if (hasValueForField("webdb_create"))
- returnValue=StringUtil.dateToReadableDate(getValue("webdb_create"));
+ if (hasValueForField("webdb_create"))
+ returnValue=StringUtil.dateToReadableDate(getValue("webdb_create"));
}
else if (field.equals("webdb_lastchange_formatted"))
{
if (hasValueForField("webdblast_change"))
- returnValue=StringUtil.dateToReadableDate(getValue("webdb_lastchange"));
+ returnValue=StringUtil.dateToReadableDate(getValue("webdb_lastchange"));
+ }
+ else if (field.equals("webdb_create_dc"))
+ {
+ if (hasValueForField("webdb_create"))
+ returnValue=StringUtil.webdbdateToDCDate(getValue("webdb_create"));
}
else
returnValue = (String)theValuesHash.get(field);
return returnValue;
}
-
public boolean hasValueForField(String field)
{
if (theValuesHash!=null)
}
/**
- * Sets the value for a field. Issues a log message if the field name supplied was not found in the Entity.
+ * Sets the value for a field. Issues a log message if the field name
+ * supplied was not found in the Entity.
* @param theProp The field name whose value has to be set
* @param theValue The new value of the field
* @exception StorageObjectException
*/
- public void setValueForProperty (String theProp, String theValue) throws StorageObjectException {
+ public void setValueForProperty (String theProp, String theValue)
+ throws StorageObjectException {
this.changed = true;
if (isField(theProp))
theValuesHash.put(theProp, theValue);
public TemplateModel get(java.lang.String key) throws TemplateModelException
{
- return new SimpleScalar(getValue(key));
+ return new SimpleScalar(getValue(key));
}
-
- public void put(java.lang.String key, TemplateModel model)
+
+ public void put(java.lang.String key, TemplateModel model)
{
// putting should only take place via setValue and is limited to the
// database fields associated with the entity. no additional freemarker