use some cvs macros/id's
[mir.git] / source / mir / entity / Entity.java
index 6dd39ac..af81a90 100755 (executable)
@@ -20,8 +20,13 @@ import mir.misc.*;
  * 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
+ *
  *
  */
 
@@ -42,7 +47,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
       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());
     }
 
   /**
@@ -118,13 +123,18 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
     {
       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);
@@ -132,7 +142,6 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
     return returnValue;
   }
 
-
   public boolean hasValueForField(String field)
   {
     if (theValuesHash!=null)
@@ -163,12 +172,14 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * 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);
@@ -283,10 +294,10 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
 
   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