several fixes, mostly in the anti-abuse system
authorzapata <zapata>
Sat, 3 May 2003 00:21:21 +0000 (00:21 +0000)
committerzapata <zapata>
Sat, 3 May 2003 00:21:21 +0000 (00:21 +0000)
37 files changed:
etc/producer/producers.xml
source/mir/entity/Entity.java
source/mir/storage/Database.java
source/mircoders/global/Abuse.java
source/mircoders/localizer/MirAdminInterfaceLocalizer.java
source/mircoders/localizer/basic/MirBasicAdminInterfaceLocalizer.java
source/mircoders/localizer/basic/MirBasicArticlePostingHandler.java
source/mircoders/localizer/basic/MirBasicCommentPostingHandler.java
source/mircoders/localizer/basic/MirBasicPostingSessionHandler.java
source/mircoders/media/ImageProcessor.java
source/mircoders/module/ModuleTopics.java
source/mircoders/servlet/ServletModuleLocalizer.java
source/mircoders/storage/DatabaseArticleType.java
source/mircoders/storage/DatabaseAudio.java
source/mircoders/storage/DatabaseBreaking.java
source/mircoders/storage/DatabaseComment.java
source/mircoders/storage/DatabaseCommentStatus.java
source/mircoders/storage/DatabaseCommentToMedia.java
source/mircoders/storage/DatabaseContent.java
source/mircoders/storage/DatabaseContentToMedia.java
source/mircoders/storage/DatabaseContentToTopics.java
source/mircoders/storage/DatabaseImageColor.java
source/mircoders/storage/DatabaseImageFormat.java
source/mircoders/storage/DatabaseImageLayout.java
source/mircoders/storage/DatabaseImageType.java
source/mircoders/storage/DatabaseImages.java
source/mircoders/storage/DatabaseLanguage.java
source/mircoders/storage/DatabaseMedia.java
source/mircoders/storage/DatabaseMediaType.java
source/mircoders/storage/DatabaseMediafolder.java
source/mircoders/storage/DatabaseMessages.java
source/mircoders/storage/DatabaseOther.java
source/mircoders/storage/DatabaseRights.java
source/mircoders/storage/DatabaseTopics.java
source/mircoders/storage/DatabaseUploadedMedia.java
source/mircoders/storage/DatabaseUsers.java
source/mircoders/storage/DatabaseVideo.java

index 0027d3e..13bb6cb 100755 (executable)
@@ -56,6 +56,7 @@
               <Generate 
                 generator="/emailThisArticle.template" 
                 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.txt"/>
+               <!--
               <PDFPreFormat 
                 key="article" 
                 numLinesBetweenImages="3" 
@@ -70,7 +71,7 @@
               <PDFGenerate
                 generator="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.fo"
                 destination="${config.storageRoot}/${pathprefix}/${article.date.formatted.yyyy}/${article.date.formatted.MM}/${article.id}.pdf"
-                stylesheet="${config['Producer.HTML2FOStyleSheet']}" />
+                stylesheet="${config['Producer.HTML2FOStyleSheet']}" /> -->
              </Language>
              <IndexContent key="article" pathToIndex="${config['IndexPath']}"/>
           </then>
index 4cb4299..e4d8927 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 package  mir.entity;
@@ -51,7 +51,7 @@ import freemarker.template.TemplateModelRoot;
  * an entity. Entities are used to represent rows of a database table.<p>
  * Interfacing TemplateHashModel and TemplateModelRoot to be freemarker compliant
  *
- * @version $Id: Entity.java,v 1.20 2003/04/21 12:42:46 idfx Exp $
+ * @version $Id: Entity.java,v 1.21 2003/05/03 00:21:22 zapata Exp $
  * @author rk
  *
  */
@@ -60,7 +60,6 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
 {
   protected static MirPropertiesConfiguration configuration;
 
-  private boolean changed;
   protected Map theValuesHash; // tablekey / value
   protected StorageObject theStorageObject;
   protected List streamedInput = null;
@@ -77,8 +76,6 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
 
   public Entity() {
     logger = new LoggerWrapper("Entity");
-
-    this.changed = false;
   }
 
   /**
@@ -98,7 +95,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * Sets the values of the Entity.
+   * Sets the values of the Entity. (Only to be called by the Storage Object)
    * @param theStringValues Map containing the new values of the Entity
    */
 
@@ -113,14 +110,6 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * Returns whether the content of the Entity has changed.
-   * @return true wenn ja, sonst false
-   */
-  public boolean changed() {
-    return changed;
-  }
-
-  /**
    * Returns the primary key of the Entity.
    * @return String Id
    */
@@ -129,7 +118,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * Defines the primary key of the Entity
+   * Defines the primary key of the Entity (only to be set by the StorageObject)
    * @param id
    */
   public void setId(String id) {
@@ -173,7 +162,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   public String insert() throws StorageObjectExc {
     logger.debug("Entity: trying to insert ...");
     if (theStorageObject != null) {
-      return theStorageObject.insert( (Entity)this);
+      return theStorageObject.insert(this);
     }
     else
       throw new StorageObjectExc("theStorageObject == null!");
@@ -184,7 +173,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
    * @exception StorageObjectException
    */
   public void update() throws StorageObjectFailure {
-    theStorageObject.update( (Entity)this);
+    theStorageObject.update(this);
   }
 
   /**
@@ -196,13 +185,11 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
    */
   public void setValueForProperty(String theProp, String theValue) throws
       StorageObjectFailure {
-    this.changed = true;
     if (isField(theProp))
       theValuesHash.put(theProp, theValue);
     else {
       logger.warn("Entity.setValueForProperty: Property not found: " + theProp + " (" + theValue + ")");
     }
-
   }
 
   /**
@@ -232,18 +219,6 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
     return theStorageObject.getLabels();
   }
 
-  /**
-   * Returns a Map with all values of the Entity.
-   * @return Map with field name as key and the corresponding values
-   *
-       * @deprecated This method is deprecated and will be deleted in the next release.
-   *  Entity interfaces freemarker.template.TemplateHashModel now and can
-   *  be used in the same way as SimpleHash.
-   */
-  public Map getValues() {
-    logger.warn("using deprecated Entity.getValues() - a waste of resources");
-    return theValuesHash;
-  }
 
   /**
    * Returns an ArrayList with all database fields that can
@@ -270,8 +245,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
     return theStorageObject.getFields().contains(fieldName);
   }
 
-  protected void throwStorageObjectFailure(Throwable e, String wo) throws
-      StorageObjectFailure {
+  protected void throwStorageObjectFailure(Throwable e, String wo) throws StorageObjectFailure {
     logger.error(e.toString() + " function: " + wo);
     e.printStackTrace(logger.asPrintWriter(LoggerWrapper.DEBUG_MESSAGE));
 
index eefa88b..7c89df4 100755 (executable)
@@ -76,7 +76,7 @@ import mir.util.JDBCStringRoutines;
  * Treiber, Host, User und Passwort, ueber den der Zugriff auf die
  * Datenbank erfolgt.
  *
- * @version $Id: Database.java,v 1.41 2003/05/02 01:02:45 zapata Exp $
+ * @version $Id: Database.java,v 1.42 2003/05/03 00:21:22 zapata Exp $
  * @author rk
  *
  */
@@ -109,7 +109,6 @@ public class Database implements StorageObject {
   protected ArrayList metadataNotNullFields;
   protected int[] metadataTypes;
   protected Class theEntityClass;
-  protected StorageObject myselfDatabase;
   protected SimpleList popupCache = null;
   protected boolean hasPopupCache = false;
   protected SimpleHash hashCache = null;
@@ -725,7 +724,7 @@ public class Database implements StorageObject {
       if (theEntityClass != null) {
         returnEntity = (Entity) theEntityClass.newInstance();
         returnEntity.setValues(theResultHash);
-        returnEntity.setStorage(myselfDatabase);
+        returnEntity.setStorage(this);
 
         if (returnEntity instanceof StorableObject) {
           logger.debug("CACHE: ( in) " + returnEntity.getId() + " :" + theTable);
@@ -754,8 +753,7 @@ public class Database implements StorageObject {
   }
 
   /**
-   * insert-Operator: f?gt eine Entity in die Tabelle ein. Eine Spalte WEBDB_CREATE
-   * wird automatisch mit dem aktuellen Datum gefuellt.
+   * Inserts an entity into the database.
    *
    * @param theEntity
    * @return der Wert des Primary-keys der eingef?gten Entity
@@ -795,7 +793,8 @@ public class Database implements StorageObject {
           if (aField.equals("webdb_create") ||
               aField.equals("webdb_lastchange")) {
             aValue = "NOW()";
-          } else {
+          }
+          else {
             if ((streamedInput != null) && streamedInput.contains(aField)) {
               aValue = "?";
             } else {
@@ -851,9 +850,7 @@ public class Database implements StorageObject {
         return null;
       }
 
-      pstmt =
-        con.prepareStatement(theAdaptor.getLastInsertSQL(
-            (Database) myselfDatabase));
+      pstmt = con.prepareStatement(theAdaptor.getLastInsertSQL(this));
 
       ResultSet rs = pstmt.executeQuery();
       rs.next();
@@ -878,8 +875,7 @@ public class Database implements StorageObject {
   }
 
   /**
-   * update-Operator: aktualisiert eine Entity. Eine Spalte WEBDB_LASTCHANGE
-   * wird automatisch mit dem aktuellen Datum gefuellt.
+   * Updates an entity in the database
    *
    * @param theEntity
    */
@@ -975,9 +971,8 @@ public class Database implements StorageObject {
     }
 
     sql.append(" where id=").append(id);
+    logger.debug("UPDATE: " + sql);
 
-    //theLog.printInfo("UPDATE: " + sql);
-    // execute sql
     try {
       con = getPooledCon();
       con.setAutoCommit(false);
@@ -992,12 +987,15 @@ public class Database implements StorageObject {
       }
 
       pstmt.executeUpdate();
-    } catch (SQLException sqe) {
+    }
+    catch (SQLException sqe) {
       throwSQLException(sqe, "update");
-    } finally {
+    }
+    finally {
       try {
         con.setAutoCommit(true);
-      } catch (Exception e) {
+      }
+      catch (Exception e) {
         ;
       }
 
@@ -1483,8 +1481,7 @@ public class Database implements StorageObject {
    * @param wo Funktonsname, in der die SQLException geworfen wurde
    * @exception StorageObjectException
    */
-  protected void throwSQLException(SQLException sqe, String aFunction)
-    throws StorageObjectFailure {
+  protected void throwSQLException(SQLException sqe, String aFunction) throws StorageObjectFailure {
     String state = "";
     String message = "";
     int vendor = 0;
index 41b31f8..b0e28d5 100755 (executable)
@@ -207,6 +207,7 @@ public class Abuse {
       MirAdminInterfaceLocalizer.MirSimpleEntityOperation operation = MirGlobal.localizer().adminInterface().simpleCommentOperationForName(commentBlockAction);
 
       if (checkCookie(Arrays.asList(cookies)) || checkIpFilter(address) || checkRegExpFilter(aComment)) {
+        logger.debug("performing operation " + operation.getName());
         operation.perform(null, MirGlobal.localizer().dataModel().adapterModel().makeEntityAdapter("comment", aComment));
         setCookie(aResponse);
       }
@@ -238,12 +239,15 @@ public class Abuse {
         address = request.getRemoteAddr();
         cookies = request.getCookies();
       }
+      else
+        logger.debug("no request available! " + aRequest.getClass().getName());
 
       logArticle(address, anArticle.getId(), new Date(), browser);
 
-      MirAdminInterfaceLocalizer.MirSimpleEntityOperation operation = MirGlobal.localizer().adminInterface().simpleCommentOperationForName(commentBlockAction);
+      MirAdminInterfaceLocalizer.MirSimpleEntityOperation operation = MirGlobal.localizer().adminInterface().simpleArticleOperationForName(commentBlockAction);
 
       if (checkCookie(Arrays.asList(cookies)) || checkIpFilter(address) || checkRegExpFilter(anArticle)) {
+        logger.debug("performing operation " + operation.getName());
         operation.perform(null, MirGlobal.localizer().dataModel().adapterModel().makeEntityAdapter("content", anArticle));
         setCookie(aResponse);
       }
index cc859fd..25fc488 100755 (executable)
@@ -82,7 +82,7 @@ public interface MirAdminInterfaceLocalizer {
 
   public interface MirSimpleEntityOperation {
     public String getName();
-    public boolean isAvailable(EntityAdapter anEntity);
-    public void perform(EntityAdapter aUser, EntityAdapter anEntity);
+    public boolean isAvailable(EntityAdapter anEntity) throws MirLocalizerExc, MirLocalizerFailure;
+    public void perform(EntityAdapter aUser, EntityAdapter anEntity) throws MirLocalizerExc, MirLocalizerFailure;
   }
 }
\ No newline at end of file
index 97a3f28..7196ea1 100755 (executable)
@@ -34,7 +34,7 @@ import java.text.SimpleDateFormat;
 import java.util.GregorianCalendar;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.Vector;
 
 import mir.entity.Entity;
@@ -139,18 +139,19 @@ public class MirBasicAdminInterfaceLocalizer implements MirAdminInterfaceLocaliz
       }
     };
 
-    public void perform(EntityAdapter aUser, EntityAdapter anEntity) {
+    public void perform(EntityAdapter aUser, EntityAdapter anEntity) throws MirLocalizerExc, MirLocalizerFailure {
       Entity entity = anEntity.getEntity();
       try {
         performModification(aUser, entity);
         entity.update();
       }
       catch (Throwable t) {
+        throw new MirLocalizerFailure(t);
       }
     };
 
     protected abstract boolean isAvailable(Entity anEntity) throws StorageObjectFailure ;
-    protected abstract void performModification(EntityAdapter aUser, Entity anEntity) throws StorageObjectFailure ;
+    protected abstract void performModification(EntityAdapter aUser, Entity anEntity)  throws MirLocalizerExc, MirLocalizerFailure ;
   }
 
   public static abstract class CommentModifyingOperation extends EntityModifyingOperation {
@@ -297,19 +298,22 @@ public class MirBasicAdminInterfaceLocalizer implements MirAdminInterfaceLocaliz
 
   protected static class ChangeArticleFieldOperation extends ArticleModifyingOperation {
     private String field;
-    private String oldValue;
+    private Set oldValues;
     private String newValue;
 
-    public ChangeArticleFieldOperation(String aName, String aField, String anOldValue, String aNewValue, boolean aLogOperation) {
+    public ChangeArticleFieldOperation(String aName, String aField, String anOldValues[], String aNewValue, boolean aLogOperation) {
       super(aName, aLogOperation);
 
       field = aField;
       newValue = aNewValue;
-      oldValue = anOldValue;
+      oldValues = new HashSet(Arrays.asList(anOldValues));
+    }
+    public ChangeArticleFieldOperation(String aName, String aField, String anOldValue, String aNewValue, boolean aLogOperation) {
+      this(aName, aField, new String[] {anOldValue}, aNewValue, aLogOperation);
     }
 
     protected boolean isAvailable(EntityContent anArticle) {
-      return anArticle.getValue(field) != null && anArticle.getValue(field).equals(oldValue);
+      return anArticle.getValue(field) != null && oldValues.contains(anArticle.getValue(field));
     }
 
     protected void performModification(EntityAdapter aUser, EntityContent anArticle) throws StorageObjectFailure {
index 3923bcb..fa13298 100755 (executable)
@@ -91,6 +91,8 @@ public class MirBasicArticlePostingHandler extends MirBasicPostingSessionHandler
   }
 
   public void validate(List aResults, Request aRequest, Session aSession) throws SessionExc, SessionFailure {
+    super.validate(aResults, aRequest, aSession);
+
     testFieldEntered(aRequest, "title", "validationerror.missing", aResults);
     testFieldEntered(aRequest, "description", "validationerror.missing", aResults);
     testFieldEntered(aRequest, "creator", "validationerror.missing", aResults);
index 6b05ddb..7707dff 100755 (executable)
@@ -87,6 +87,8 @@ public class MirBasicCommentPostingHandler extends MirBasicPostingSessionHandler
   }
 
   public void validate(List aResults, Request aRequest, Session aSession) throws SessionExc, SessionFailure {
+    super.validate(aResults, aRequest, aSession);
+
     testFieldEntered(aRequest, "title", "validationerror.missing", aResults);
     testFieldEntered(aRequest, "description", "validationerror.missing", aResults);
     testFieldEntered(aRequest, "creator", "validationerror.missing", aResults);
index e89d119..08a7f57 100755 (executable)
@@ -35,10 +35,9 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Random;
-import java.util.*;
+import java.util.Vector;
 
 import mir.config.MirPropertiesConfiguration;
-import mir.entity.Entity;
 import mir.log.LoggerWrapper;
 import mir.session.Request;
 import mir.session.Response;
@@ -49,14 +48,8 @@ import mir.session.SessionHandler;
 import mir.session.UploadedFile;
 import mir.storage.StorageObject;
 import mir.util.ExceptionFunctions;
-import mircoders.entity.EntityComment;
 import mircoders.global.MirGlobal;
-import mircoders.media.MediaUploadProcessor;
-import mircoders.module.ModuleComment;
-import mircoders.storage.DatabaseComment;
-import mircoders.storage.DatabaseCommentToMedia;
-import mircoders.storage.DatabaseContent;
-import mircoders.module.*;
+import mircoders.module.ModuleMediaType;
 
 /**
  *
@@ -103,12 +96,18 @@ public abstract class MirBasicPostingSessionHandler implements SessionHandler {
   }
 
   public void processRequest(Request aRequest, Session aSession, Response aResponse) throws SessionExc, SessionFailure {
-    if (aSession.getAttribute("initialRequest")==null) {
-      initialRequest(aRequest, aSession, aResponse);
-      aSession.setAttribute("initialRequest", "no");
+    if (MirGlobal.abuse().getOpenPostingDisabled()) {
+      makeOpenPostingDisabledResponse(aRequest, aSession, aResponse);
+      aSession.terminate();
     }
     else {
-      subsequentRequest(aRequest, aSession, aResponse);
+      if (aSession.getAttribute("initialRequest") == null) {
+        initialRequest(aRequest, aSession, aResponse);
+        aSession.setAttribute("initialRequest", "no");
+      }
+      else {
+        subsequentRequest(aRequest, aSession, aResponse);
+      }
     }
   };
 
@@ -218,6 +217,10 @@ public abstract class MirBasicPostingSessionHandler implements SessionHandler {
     }
   };
 
+  protected void makeOpenPostingDisabledResponse(Request aRequest, Session aSession, Response aResponse) {
+    aResponse.setResponseGenerator(configuration.getString("ServletModule.OpenIndy.PostingDisabledTemplate"));
+  }
+
   protected void preProcessRequest(Request aRequest, Session aSession) throws SessionExc, SessionFailure {
   };
   public void processUploadedFile(Request aRequest, Session aSession, UploadedFile aFile) throws SessionExc, SessionFailure {
@@ -244,6 +247,15 @@ public abstract class MirBasicPostingSessionHandler implements SessionHandler {
   }
 
   protected void validate(List aResults, Request aRequest, Session aSession) throws SessionExc, SessionFailure {
+    String password = (String) aSession.getAttribute("password");
+
+    if (password!=null) {
+      String submittedPassword= aRequest.getParameter("password").trim();
+
+      if (!password.equals(submittedPassword)) {
+        aResults.add(new ValidationError("password", "passwordmismatch"));
+      }
+    }
   }
 
   /**
index 22b4609..40f152e 100755 (executable)
@@ -85,17 +85,10 @@ public class ImageProcessor {
     ImageLayout layout = new ImageLayout();
     nrComponents = tempImage.getColorModel().getNumColorComponents();
 
-/*    System.out.println("blaat sample model = " + tempImage.getSampleModel().toString());
-    System.out.println("blaat color model = " + tempImage.getColorModel().toString());
-    System.out.println("blaat nr color components = " + tempImage.getColorModel().getNumColorComponents());
-    System.out.println("blaat nr components = " + tempImage.getColorModel().getNumComponents());
- */
     bands = new int[nrComponents];
     for (int i=0; i<nrComponents; i++)
       bands[i]=i;
 
-
-
     layout.setColorModel(ColorModel.getRGBdefault());
     layout.setSampleModel(
         new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
index 84c6149..cd8a781 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 package mircoders.module;
index 1498178..119e626 100755 (executable)
@@ -121,7 +121,9 @@ public class ServletModuleLocalizer extends ServletModule {
         operation.perform(aUser, comment);
         logger.info("Operation " + anOperation + " successfully performed on comment " + anId);
       }
-      logger.error("Error while performing " + anOperation + " on comment " + anId + ": comment is null");
+      else {
+        logger.error("Error while performing " + anOperation + " on comment " + anId + ": comment is null");
+      }
     }
     catch (Throwable e) {
       logger.error("Error while performing " + anOperation + " on comment " + anId + ": " + e.getMessage());
@@ -179,7 +181,9 @@ public class ServletModuleLocalizer extends ServletModule {
         operation.perform(aUser, article);
         logger.info("Operation " + anOperation + " successfully performed on article " + anId);
       }
-      logger.error("Error while performing " + anOperation + " on article " + anId + ": article is null");
+      else {
+        logger.error("Error while performing " + anOperation + " on article " + anId + ": article is null");
+      }
     }
     catch (Throwable e) {
       logger.error("Error while performing " + anOperation + " on article " + anId + ": " + e.getMessage());
index 85ff8ed..9ba7abc 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -54,7 +54,6 @@ public class DatabaseArticleType extends Database implements StorageObject{
   public synchronized static DatabaseArticleType getInstance() throws StorageObjectFailure {
     if (instance == null) {
       instance = new DatabaseArticleType();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index fbe24e3..bed4e44 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 package mircoders.storage;
@@ -47,11 +47,9 @@ public class DatabaseAudio extends Database implements StorageObject{
   // the following *has* to be sychronized cause this static method
   // could get preemted and we could end up with 2 instances of DatabaseFoo..
   // see the "Singletons with needles and thread" article at JavaWorld -mh
-  public synchronized static DatabaseAudio getInstance() throws
-      StorageObjectFailure {
+  public synchronized static DatabaseAudio getInstance() {
     if (instance == null) {
       instance = new DatabaseAudio();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index c85a317..f7c0c87 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -48,11 +48,9 @@ public class DatabaseBreaking extends Database implements StorageObject{
   // the following *has* to be sychronized cause this static method
   // could get preemted and we could end up with 2 instances of DatabaseFoo..
   // see the "Singletons with needles and thread" article at JavaWorld -mh
-  public synchronized static DatabaseBreaking getInstance()
-    throws StorageObjectFailure {
+  public synchronized static DatabaseBreaking getInstance() throws StorageObjectFailure {
     if (instance == null) {
       instance = new DatabaseBreaking();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index d9ceef9..3151c99 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -51,14 +51,9 @@ public class DatabaseComment extends Database implements StorageObject{
 
   private static DatabaseComment instance;
 
-  public static DatabaseComment getInstance() {
+  public synchronized static DatabaseComment getInstance() {
     if (instance == null) {
-      synchronized (DatabaseComment.class) {
-        if (instance == null) {
-          instance = new DatabaseComment();
-          instance.myselfDatabase = instance;
-        }
-      }
+      instance = new DatabaseComment();
     }
     return instance;
   }
index 349f4cf..c2f5cc8 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -50,14 +50,9 @@ public class DatabaseCommentStatus extends Database implements StorageObject{
 
   private static DatabaseCommentStatus instance;
 
-  public static DatabaseCommentStatus getInstance() throws StorageObjectFailure {
+  public synchronized static DatabaseCommentStatus getInstance() throws StorageObjectFailure {
     if (instance == null) {
-      synchronized (DatabaseCommentStatus.class) {
-        if (instance == null) {
-          instance = new DatabaseCommentStatus();
-          instance.myselfDatabase = instance;
-        }
-      }
+      instance = new DatabaseCommentStatus();
     }
 
     return instance;
index 0cf28f8..9868d6b 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -47,7 +47,7 @@ import mircoders.entity.EntityUploadedMedia;
  * <b>implements abstract DB connection to the comment_x_media SQL table
  *
  * @author RK, mir-coders group
- * @version $Id: DatabaseCommentToMedia.java,v 1.2 2003/04/21 12:42:47 idfx Exp $
+ * @version $Id: DatabaseCommentToMedia.java,v 1.3 2003/05/03 00:21:22 zapata Exp $
  *
  */
 
@@ -55,14 +55,9 @@ public class DatabaseCommentToMedia extends Database implements StorageObject{
 
   private static DatabaseCommentToMedia instance;
 
-  public static DatabaseCommentToMedia getInstance() {
+  public static synchronized DatabaseCommentToMedia getInstance() {
     if (instance == null) {
-      synchronized (DatabaseCommentToMedia.class) {
-        if (instance == null) {
-          instance = new DatabaseCommentToMedia();
-          instance.myselfDatabase = instance;
-        }
-      }
+      instance = new DatabaseCommentToMedia();
     }
     return instance;
   }
index b332778..a5fc5a4 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -57,12 +57,10 @@ public class DatabaseContent extends Database implements StorageObject {
   // the following *has* to be sychronized cause this static method
   // could get preemted and we could end up with 2 instances of DatabaseFoo.
   // see the "Singletons with needles and thread" article at JavaWorld -mh
-  public synchronized static DatabaseContent getInstance()
-    throws StorageObjectFailure {
+  public synchronized static DatabaseContent getInstance() {
 
     if (instance == null ) {
       instance = new DatabaseContent();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index c06f91a..8cb8a56 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -47,7 +47,7 @@ import mircoders.entity.EntityUploadedMedia;
  * <b>implements abstract DB connection to the content_x_media SQL table
  *
  * @author RK, mir-coders group
- * @version $Id: DatabaseContentToMedia.java,v 1.18 2003/04/21 12:42:48 idfx Exp $
+ * @version $Id: DatabaseContentToMedia.java,v 1.19 2003/05/03 00:21:22 zapata Exp $
  *
  */
 
@@ -55,14 +55,9 @@ public class DatabaseContentToMedia extends Database implements StorageObject{
 
   private static DatabaseContentToMedia instance;
 
-  public static DatabaseContentToMedia getInstance() {
+  public synchronized static DatabaseContentToMedia getInstance() {
     if (instance == null) {
-      synchronized (DatabaseContentToMedia.class) {
-        if (instance == null) {
-          instance = new DatabaseContentToMedia();
-          instance.myselfDatabase = instance;
-        }
-      }
+      instance = new DatabaseContentToMedia();
     }
     return instance;
   }
index 52e6dbd..7475e90 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -57,14 +57,9 @@ public class DatabaseContentToTopics extends Database implements StorageObject{
 
   private static DatabaseContentToTopics instance;
 
-  public static DatabaseContentToTopics getInstance() {
+  public synchronized static DatabaseContentToTopics getInstance() {
     if (instance == null) {
-      synchronized (DatabaseContentToTopics.class) {
-        if (instance == null) {
-          instance = new DatabaseContentToTopics();
-          instance.myselfDatabase = instance;
-        }
-      }
+      instance = new DatabaseContentToTopics();
     }
     return instance;
   }
index 90c7844..f857d70 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -53,7 +53,6 @@ public class DatabaseImageColor extends Database implements StorageObject{
   public synchronized static DatabaseImageColor getInstance() {
     if (instance == null) {
       instance = new DatabaseImageColor();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index ee0dd72..310987d 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -53,7 +53,6 @@ public class DatabaseImageFormat extends Database implements StorageObject{
   public synchronized static DatabaseImageFormat getInstance() {
     if (instance == null) {
       instance = new DatabaseImageFormat();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index 7b04222..1fac5a3 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -53,7 +53,6 @@ public class DatabaseImageLayout extends Database implements StorageObject{
   public synchronized static DatabaseImageLayout getInstance() {
     if (instance == null) {
       instance = new DatabaseImageLayout();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index f8875e4..377f1f7 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 package mircoders.storage;
@@ -50,7 +50,6 @@ public class DatabaseImageType extends Database implements StorageObject{
   public synchronized static DatabaseImageType getInstance() {
     if (instance == null) {
       instance = new DatabaseImageType();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index 7e1f030..d525df4 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -57,7 +57,6 @@ public class DatabaseImages extends Database implements StorageObject{
   public synchronized static DatabaseImages getInstance() {
     if (instance == null) {
       instance = new DatabaseImages();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index 17d7496..e0b15bc 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -58,7 +58,6 @@ public class DatabaseLanguage extends Database implements StorageObject{
       StorageObjectFailure {
     if (instance == null) {
       instance = new DatabaseLanguage();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index 16d1002..ed653a5 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -55,7 +55,6 @@ public class DatabaseMedia extends Database implements StorageObject{
   public synchronized static DatabaseMedia getInstance() {
     if (instance == null) {
       instance = new DatabaseMedia();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index 157caf9..398acb2 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 package mircoders.storage;
@@ -51,7 +51,6 @@ public class DatabaseMediaType extends Database implements StorageObject{
   public synchronized static DatabaseMediaType getInstance() {
     if (instance == null) {
       instance = new DatabaseMediaType();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index d9eed43..01be686 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -57,7 +57,6 @@ public class DatabaseMediafolder extends Database implements StorageObject{
   public synchronized static DatabaseMediafolder getInstance() {
     if (instance == null) {
       instance = new DatabaseMediafolder();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index 464e232..81ad696 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -51,7 +51,6 @@ public class DatabaseMessages extends Database implements StorageObject{
   public synchronized static DatabaseMessages getInstance() {
     if (instance == null) {
       instance = new DatabaseMessages();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index cec0498..22f4875 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 package mircoders.storage;
@@ -55,7 +55,6 @@ public class DatabaseOther extends Database implements StorageObject{
   public synchronized static DatabaseOther getInstance() {
     if (instance == null) {
       instance = new DatabaseOther();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index e0f5995..11914a8 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -48,11 +48,9 @@ public class DatabaseRights extends Database implements StorageObject{
   // the following *has* to be sychronized cause this static method
   // could get preemted and we could end up with 2 instances of DatabaseFoo..
   // see the "Singletons with needles and thread" article at JavaWorld -mh
-  public synchronized static DatabaseRights getInstance() throws
-      StorageObjectFailure {
+  public synchronized static DatabaseRights getInstance() {
     if (instance == null) {
       instance = new DatabaseRights();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index f392261..2b502cb 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -49,11 +49,9 @@ public class DatabaseTopics extends Database implements StorageObject{
   // the following *has* to be sychronized cause this static method
   // could get preemted and we could end up with 2 instances of DatabaseFoo..
   // see the "Singletons with needles and thread" article at JavaWorld -mh
-  public synchronized static DatabaseTopics getInstance() throws
-      StorageObjectFailure {
+  public synchronized static DatabaseTopics getInstance() {
     if (instance == null) {
       instance = new DatabaseTopics();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index 3d43389..0e077ed 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -41,14 +41,9 @@ public class DatabaseUploadedMedia extends Database implements StorageObject {
   private static DatabaseUploadedMedia  instance;
   private static EntityRelation         relationMediaType;
 
-  public static DatabaseUploadedMedia getInstance() {
+  public synchronized static DatabaseUploadedMedia getInstance() {
     if (instance == null ) {
-      synchronized(DatabaseUploadedMedia.class) {
-        if (instance == null ) {
-          instance = new DatabaseUploadedMedia();
-          instance.myselfDatabase = instance;
-        }
-      }
+      instance = new DatabaseUploadedMedia();
     }
 
     return instance;
index 8e104b1..89e1ae6 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -49,11 +49,9 @@ public class DatabaseUsers extends Database implements StorageObject{
   // the following *has* to be sychronized cause this static method
   // could get preemted and we could end up with 2 instances of DatabaseFoo..
   // see the "Singletons with needles and thread" article at JavaWorld -mh
-  public synchronized static DatabaseUsers getInstance() throws
-      StorageObjectFailure {
+  public synchronized static DatabaseUsers getInstance() {
     if (instance == null) {
       instance = new DatabaseUsers();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }
index 02238c3..a51d5b1 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 
@@ -57,7 +57,6 @@ public class DatabaseVideo extends Database implements StorageObject{
   public synchronized static DatabaseVideo getInstance() {
     if (instance == null) {
       instance = new DatabaseVideo();
-      instance.myselfDatabase = instance;
     }
     return instance;
   }