adding doc
authorgrok <grok>
Thu, 28 Jul 2005 14:12:36 +0000 (14:12 +0000)
committergrok <grok>
Thu, 28 Jul 2005 14:12:36 +0000 (14:12 +0000)
source/mir/producer/Producer.java
source/mircoders/abuse/FilterEngine.java
source/mircoders/global/Abuse.java

index a7ffe93..051bbe9 100755 (executable)
@@ -31,6 +31,12 @@ package mir.producer;
 
 import mir.log.LoggerWrapper;
 
+/** A producer is  a task. producers are mostly  used to generate pages
+ *  but occasionally,  producers  are  used to do  other stuff  such as
+ *  pull  rss   feeds.  The   producers  are  configured   through  the
+ *  producers.xml file. Producers appear, for example, on the 
+ *  admin->"Generate manually"->"advanced page": (Tasks) 
+ */
 public interface Producer {
   /**
    *
index 1f6cc42..41b0d40 100755 (executable)
@@ -86,7 +86,8 @@ public class FilterEngine {
     reload();
   }
   /** applies all filters from all filter groups to an Entity.
-   *  The entity may be, for example, an article, or a comment.  
+   *  The entity may be, for example, an article, or a comment.
+   *  It returns a filter that matches if it finds one, null otherwise  
    */
   public Filter testPosting(Entity anEntity, Request aRequest) {
     Iterator i = filterGroups.iterator();
@@ -270,6 +271,7 @@ public class FilterEngine {
       return entity.getFieldValue("name");
     }
   }
+  
   /** This class reflects a row of the filter database table. 
    * To actually run a filter on data, use the test() method. 
    * This class will automatically retreive and use the correct 
index 360a592..a6afb11 100755 (executable)
@@ -62,7 +62,13 @@ import mircoders.localizer.MirAdminInterfaceLocalizer;
 
 import org.apache.commons.collections.ExtendedProperties;
 
-
+/**
+ *  This class manages abuse (spam, offending material, etc.). This
+ *  is done by using a set of filters managed by the FilterEngine class.
+ *  Filters may be of different types (IP, throttle, regexp...), 
+ *  but are created and configured in a single user interface (web page),
+ *  and are stored in a single database table called "filter". 
+ */
 public class Abuse {
   private LoggerWrapper logger;
   private int logSize;
@@ -136,7 +142,11 @@ public class Abuse {
 
     return false;
   }
-
+  /** Checks if there is a filter that matches a comment and takes 
+   * appropriate action (as configured in the xxxxxaction field of 
+   * the filter table). The actual matching is delegated to the 
+   * FilterEngine class. 
+   */
   public void checkComment(EntityComment aComment, Request aRequest, HttpServletResponse aResponse) {
     try {
       long time = System.currentTimeMillis();
@@ -172,7 +182,11 @@ public class Abuse {
       logger.error("Exception thrown while checking comment", t);
     }
   }
-
+  /** Checks if there is a filter that matches an articleand takes 
+   * appropriate action (as configured in the xxxxxaction field of 
+   * the filter table). The actual matching is delegated to the 
+   * FilterEngine class. 
+   */
   public void checkArticle(EntityContent anArticle, Request aRequest, HttpServletResponse aResponse) {
     try {
       long time = System.currentTimeMillis();