<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>sql/5.5.1/openemm.sql</filename>
    </added>
    <added>
      <filename>sql/5.5.1/update.sql</filename>
    </added>
    <added>
      <filename>src/c/xmlback/preview.c</filename>
    </added>
    <added>
      <filename>src/c/xmlback/rblock.c</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/backend/BC.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/beans/impl/DynaBeanPaginatedListImpl.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/dao/BounceDao.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/dao/impl/BounceDaoImpl.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/preview/Cache.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/preview/Preview.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/service/CampaignQueryWorker.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/service/MailingsQueryWorker.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/service/RecipientQueryBuilder.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/service/RecipientQueryWorker.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/util/SubCheck.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/web/filter/OpenSessionInViewFilter.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/web/filter/SerializeRequestFilter.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/web/forms/AdminForm.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/web/forms/CampaignForm.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/web/forms/EmmActionForm.java</filename>
    </added>
    <added>
      <filename>src/java/org/agnitas/web/forms/StrutsFormBase.java</filename>
    </added>
    <added>
      <filename>src/jsp/WEB-INF/ajaxanywhere.tld</filename>
    </added>
    <added>
      <filename>src/jsp/images/emm/warning.gif</filename>
    </added>
    <added>
      <filename>src/jsp/importwizard/verifymissingfields.jsp</filename>
    </added>
    <added>
      <filename>src/jsp/js/aa.js</filename>
    </added>
    <added>
      <filename>src/jsp/mailing/loading.jsp</filename>
    </added>
    <added>
      <filename>src/jsp/recipient/loading.jsp</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,18 +1,10 @@
 # Sample ResourceBundle properties file
 
-oracle.home=/home/oracle/Oracle9/software
+jdk.execute=/opt/jdk1.5.0_11
 
-profiler.home=/home/openemm/netbeans-4.1/profiler1/modules
+jdk.compile=/opt/jdk1.5.0_11
 
-jdk.execute=/home/openemm/jdk1.5.0_04
-
-jdk.compile=/opt/sun-jdk-1.4.2.04
-
-#jdk.instdir=/home/openemm/nb-profiler-server/profiler-ea-vm
-
-#jdk.instdir=/home/openemm/jdk1.6.0
-
-resin.home=/opt/resin-1.2.10
+resin.home=/opt/resin-3.0.17
 
 appname=/OpenEMM
 </diff>
      <filename>EMMBuild.properties.default</filename>
    </modified>
    <modified>
      <diff>@@ -131,7 +131,103 @@
        &lt;/object&gt; 
       &lt;/void&gt; 
       &lt;void method=&quot;add&quot;&gt; 
-       &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+       &lt;object id=&quot;SubsystemNode0&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+        &lt;void property=&quot;disallowedAfferentsCollection&quot;&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;object id=&quot;SubsystemNode1&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+           &lt;void property=&quot;disallowedEfferentsCollection&quot;&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
+             &lt;object id=&quot;SubsystemNode2&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+              &lt;void property=&quot;disallowedAfferentsCollection&quot;&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;object idref=&quot;SubsystemNode1&quot;/&gt; 
+               &lt;/void&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;string&gt;org.agnitas.web&lt;/string&gt; 
+               &lt;/void&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;name&quot;&gt; 
+               &lt;string&gt;Struts-Actions&lt;/string&gt; 
+              &lt;/void&gt; 
+             &lt;/object&gt; 
+            &lt;/void&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
+             &lt;object id=&quot;SubsystemNode3&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+              &lt;void property=&quot;disallowedAfferentsCollection&quot;&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;object idref=&quot;SubsystemNode1&quot;/&gt; 
+               &lt;/void&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;string&gt;org.agnitas.actions.ops&lt;/string&gt; 
+               &lt;/void&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;string&gt;org.agnitas.beans.impl&lt;/string&gt; 
+               &lt;/void&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;name&quot;&gt; 
+               &lt;string&gt;BeansImpl&lt;/string&gt; 
+              &lt;/void&gt; 
+             &lt;/object&gt; 
+            &lt;/void&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
+             &lt;object idref=&quot;SubsystemNode0&quot;/&gt; 
+            &lt;/void&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
+             &lt;object id=&quot;SubsystemNode4&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+              &lt;void property=&quot;disallowedAfferentsCollection&quot;&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;object idref=&quot;SubsystemNode1&quot;/&gt; 
+               &lt;/void&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;object id=&quot;SubsystemNode5&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+                 &lt;void property=&quot;disallowedEfferentsCollection&quot;&gt; 
+                  &lt;void method=&quot;add&quot;&gt; 
+                   &lt;object idref=&quot;SubsystemNode0&quot;/&gt; 
+                  &lt;/void&gt; 
+                  &lt;void method=&quot;add&quot;&gt; 
+                   &lt;object idref=&quot;SubsystemNode4&quot;/&gt; 
+                  &lt;/void&gt; 
+                 &lt;/void&gt; 
+                 &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+                  &lt;void method=&quot;add&quot;&gt; 
+                   &lt;string&gt;org.agnitas.taglib&lt;/string&gt; 
+                  &lt;/void&gt; 
+                 &lt;/void&gt; 
+                 &lt;void property=&quot;name&quot;&gt; 
+                  &lt;string&gt;Taglibs&lt;/string&gt; 
+                 &lt;/void&gt; 
+                &lt;/object&gt; 
+               &lt;/void&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;string&gt;org.hibernate**&lt;/string&gt; 
+               &lt;/void&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;name&quot;&gt; 
+               &lt;string&gt;hibernate&lt;/string&gt; 
+              &lt;/void&gt; 
+             &lt;/object&gt; 
+            &lt;/void&gt; 
+           &lt;/void&gt; 
+           &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
+             &lt;string&gt;_jsp**&lt;/string&gt; 
+            &lt;/void&gt; 
+           &lt;/void&gt; 
+           &lt;void property=&quot;name&quot;&gt; 
+            &lt;string&gt;JSP&lt;/string&gt; 
+           &lt;/void&gt; 
+          &lt;/object&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;object idref=&quot;SubsystemNode5&quot;/&gt; 
+         &lt;/void&gt; 
+        &lt;/void&gt; 
         &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
          &lt;void method=&quot;add&quot;&gt; 
           &lt;string&gt;java.sql&lt;/string&gt; 
@@ -139,9 +235,18 @@
          &lt;void method=&quot;add&quot;&gt; 
           &lt;string&gt;javax.sql&lt;/string&gt; 
          &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.springframework.jdbc.**&lt;/string&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.springframework.orm.hibernate3**&lt;/string&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;com.mysql.jdbc&lt;/string&gt; 
+         &lt;/void&gt; 
         &lt;/void&gt; 
         &lt;void property=&quot;name&quot;&gt; 
-         &lt;string&gt;sql-support&lt;/string&gt; 
+         &lt;string&gt;db-support&lt;/string&gt; 
         &lt;/void&gt; 
        &lt;/object&gt; 
       &lt;/void&gt; 
@@ -193,6 +298,114 @@
         &lt;/void&gt; 
        &lt;/object&gt; 
       &lt;/void&gt; 
+      &lt;void method=&quot;add&quot;&gt; 
+       &lt;object idref=&quot;SubsystemNode4&quot;/&gt; 
+      &lt;/void&gt; 
+      &lt;void method=&quot;add&quot;&gt; 
+       &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+        &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;java.awt**&lt;/string&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.springframework.orm.hibernate3&lt;/string&gt; 
+         &lt;/void&gt; 
+        &lt;/void&gt; 
+        &lt;void property=&quot;name&quot;&gt; 
+         &lt;string&gt;awt&lt;/string&gt; 
+        &lt;/void&gt; 
+       &lt;/object&gt; 
+      &lt;/void&gt; 
+      &lt;void method=&quot;add&quot;&gt; 
+       &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+        &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.springframework.context**&lt;/string&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.springframework.web.context**&lt;/string&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.springframework.web.struts&lt;/string&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.springframework.dao&lt;/string&gt; 
+         &lt;/void&gt; 
+        &lt;/void&gt; 
+        &lt;void property=&quot;name&quot;&gt; 
+         &lt;string&gt;spring&lt;/string&gt; 
+        &lt;/void&gt; 
+       &lt;/object&gt; 
+      &lt;/void&gt; 
+      &lt;void method=&quot;add&quot;&gt; 
+       &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+        &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.springframework.remoting.jaxrpc&lt;/string&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;java.rmi&lt;/string&gt; 
+         &lt;/void&gt; 
+        &lt;/void&gt; 
+        &lt;void property=&quot;name&quot;&gt; 
+         &lt;string&gt;remoting&lt;/string&gt; 
+        &lt;/void&gt; 
+       &lt;/object&gt; 
+      &lt;/void&gt; 
+      &lt;void method=&quot;add&quot;&gt; 
+       &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+        &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.ajaxtags.tags&lt;/string&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.displaytag.tags&lt;/string&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;org.displaytag.util&lt;/string&gt; 
+         &lt;/void&gt; 
+        &lt;/void&gt; 
+        &lt;void property=&quot;name&quot;&gt; 
+         &lt;string&gt;ui&lt;/string&gt; 
+        &lt;/void&gt; 
+       &lt;/object&gt; 
+      &lt;/void&gt; 
+      &lt;void method=&quot;add&quot;&gt; 
+       &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+        &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;java.security&lt;/string&gt; 
+         &lt;/void&gt; 
+        &lt;/void&gt; 
+        &lt;void property=&quot;name&quot;&gt; 
+         &lt;string&gt;security&lt;/string&gt; 
+        &lt;/void&gt; 
+       &lt;/object&gt; 
+      &lt;/void&gt; 
+      &lt;void method=&quot;add&quot;&gt; 
+       &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+        &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;bsh&lt;/string&gt; 
+         &lt;/void&gt; 
+        &lt;/void&gt; 
+        &lt;void property=&quot;name&quot;&gt; 
+         &lt;string&gt;bsh&lt;/string&gt; 
+        &lt;/void&gt; 
+       &lt;/object&gt; 
+      &lt;/void&gt; 
+      &lt;void method=&quot;add&quot;&gt; 
+       &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+        &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;string&gt;com.ibm.icu.text&lt;/string&gt; 
+         &lt;/void&gt; 
+        &lt;/void&gt; 
+        &lt;void property=&quot;name&quot;&gt; 
+         &lt;string&gt;backend&lt;/string&gt; 
+        &lt;/void&gt; 
+       &lt;/object&gt; 
+      &lt;/void&gt; 
      &lt;/void&gt; 
      &lt;void property=&quot;description&quot;&gt; 
       &lt;string&gt;Contains all external components&lt;/string&gt; 
@@ -235,53 +448,68 @@
               &lt;/void&gt; 
               &lt;void property=&quot;childrenCollection&quot;&gt; 
                &lt;void method=&quot;add&quot;&gt; 
-                &lt;object id=&quot;SubsystemNode0&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
-                 &lt;void property=&quot;disallowedEfferentsCollection&quot;&gt; 
-                  &lt;void method=&quot;add&quot;&gt; 
-                   &lt;object id=&quot;SubsystemNode1&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
-                    &lt;void property=&quot;disallowedAfferentsCollection&quot;&gt; 
-                     &lt;void method=&quot;add&quot;&gt; 
-                      &lt;object idref=&quot;SubsystemNode0&quot;/&gt; 
-                     &lt;/void&gt; 
-                    &lt;/void&gt; 
-                    &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
-                     &lt;void method=&quot;add&quot;&gt; 
-                      &lt;string&gt;org.agnitas.web&lt;/string&gt; 
-                     &lt;/void&gt; 
-                    &lt;/void&gt; 
-                    &lt;void property=&quot;name&quot;&gt; 
-                     &lt;string&gt;Struts-Actions&lt;/string&gt; 
-                    &lt;/void&gt; 
-                   &lt;/object&gt; 
-                  &lt;/void&gt; 
+                &lt;object idref=&quot;SubsystemNode1&quot;/&gt; 
+               &lt;/void&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;index&quot;&gt; 
+               &lt;int&gt;-1&lt;/int&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;name&quot;&gt; 
+               &lt;string&gt;JSP&lt;/string&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;x&quot;&gt; 
+               &lt;int&gt;619&lt;/int&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;y&quot;&gt; 
+               &lt;int&gt;6&lt;/int&gt; 
+              &lt;/void&gt; 
+             &lt;/object&gt; 
+            &lt;/void&gt; 
+           &lt;/void&gt; 
+           &lt;void property=&quot;allowedEfferentsCollection&quot;&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
+             &lt;object idref=&quot;LayerNode2&quot;/&gt; 
+            &lt;/void&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
+             &lt;object idref=&quot;LayerNode3&quot;/&gt; 
+            &lt;/void&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
+             &lt;object id=&quot;LayerNode6&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.LayerNode&quot;&gt; 
+              &lt;void property=&quot;allowedAfferentsCollection&quot;&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;object idref=&quot;LayerNode4&quot;/&gt; 
+               &lt;/void&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;allowedEfferentsCollection&quot;&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;object idref=&quot;LayerNode3&quot;/&gt; 
+               &lt;/void&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;object idref=&quot;LayerNode2&quot;/&gt; 
+               &lt;/void&gt; 
+              &lt;/void&gt; 
+              &lt;void property=&quot;childrenCollection&quot;&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
+                 &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
                   &lt;void method=&quot;add&quot;&gt; 
-                   &lt;object id=&quot;SubsystemNode2&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
-                    &lt;void property=&quot;disallowedAfferentsCollection&quot;&gt; 
-                     &lt;void method=&quot;add&quot;&gt; 
-                      &lt;object idref=&quot;SubsystemNode0&quot;/&gt; 
-                     &lt;/void&gt; 
-                    &lt;/void&gt; 
-                    &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
-                     &lt;void method=&quot;add&quot;&gt; 
-                      &lt;string&gt;org.agnitas.actions.ops&lt;/string&gt; 
-                     &lt;/void&gt; 
-                     &lt;void method=&quot;add&quot;&gt; 
-                      &lt;string&gt;org.agnitas.beans.impl&lt;/string&gt; 
-                     &lt;/void&gt; 
-                    &lt;/void&gt; 
-                    &lt;void property=&quot;name&quot;&gt; 
-                     &lt;string&gt;BeansImpl&lt;/string&gt; 
-                    &lt;/void&gt; 
-                   &lt;/object&gt; 
+                   &lt;string&gt;org.agnitas.service.impl&lt;/string&gt; 
                   &lt;/void&gt; 
                  &lt;/void&gt; 
+                 &lt;void property=&quot;name&quot;&gt; 
+                  &lt;string&gt;serviceImpl&lt;/string&gt; 
+                 &lt;/void&gt; 
+                &lt;/object&gt; 
+               &lt;/void&gt; 
+               &lt;void method=&quot;add&quot;&gt; 
+                &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
                  &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
                   &lt;void method=&quot;add&quot;&gt; 
-                   &lt;string&gt;_jsp**&lt;/string&gt; 
+                   &lt;string&gt;org.agnitas.service&lt;/string&gt; 
                   &lt;/void&gt; 
                  &lt;/void&gt; 
                  &lt;void property=&quot;name&quot;&gt; 
-                  &lt;string&gt;JSP&lt;/string&gt; 
+                  &lt;string&gt;service&lt;/string&gt; 
                  &lt;/void&gt; 
                 &lt;/object&gt; 
                &lt;/void&gt; 
@@ -290,25 +518,17 @@
                &lt;int&gt;-1&lt;/int&gt; 
               &lt;/void&gt; 
               &lt;void property=&quot;name&quot;&gt; 
-               &lt;string&gt;JSP&lt;/string&gt; 
+               &lt;string&gt;service&lt;/string&gt; 
               &lt;/void&gt; 
               &lt;void property=&quot;x&quot;&gt; 
-               &lt;int&gt;488&lt;/int&gt; 
+               &lt;int&gt;371&lt;/int&gt; 
               &lt;/void&gt; 
               &lt;void property=&quot;y&quot;&gt; 
-               &lt;int&gt;3&lt;/int&gt; 
+               &lt;int&gt;144&lt;/int&gt; 
               &lt;/void&gt; 
              &lt;/object&gt; 
             &lt;/void&gt; 
            &lt;/void&gt; 
-           &lt;void property=&quot;allowedEfferentsCollection&quot;&gt; 
-            &lt;void method=&quot;add&quot;&gt; 
-             &lt;object idref=&quot;LayerNode2&quot;/&gt; 
-            &lt;/void&gt; 
-            &lt;void method=&quot;add&quot;&gt; 
-             &lt;object idref=&quot;LayerNode3&quot;/&gt; 
-            &lt;/void&gt; 
-           &lt;/void&gt; 
            &lt;void property=&quot;childrenCollection&quot;&gt; 
             &lt;void method=&quot;add&quot;&gt; 
              &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
@@ -335,47 +555,79 @@
              &lt;/object&gt; 
             &lt;/void&gt; 
             &lt;void method=&quot;add&quot;&gt; 
+             &lt;object idref=&quot;SubsystemNode5&quot;/&gt; 
+            &lt;/void&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
              &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
               &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
                &lt;void method=&quot;add&quot;&gt; 
-                &lt;string&gt;org.agnitas.taglib&lt;/string&gt; 
+                &lt;string&gt;org.agnitas.webservice&lt;/string&gt; 
                &lt;/void&gt; 
               &lt;/void&gt; 
               &lt;void property=&quot;name&quot;&gt; 
-               &lt;string&gt;Taglibs&lt;/string&gt; 
+               &lt;string&gt;Webservices&lt;/string&gt; 
               &lt;/void&gt; 
              &lt;/object&gt; 
             &lt;/void&gt; 
             &lt;void method=&quot;add&quot;&gt; 
+             &lt;object idref=&quot;SubsystemNode2&quot;/&gt; 
+            &lt;/void&gt; 
+           &lt;/void&gt; 
+           &lt;void property=&quot;index&quot;&gt; 
+            &lt;int&gt;-1&lt;/int&gt; 
+           &lt;/void&gt; 
+           &lt;void property=&quot;name&quot;&gt; 
+            &lt;string&gt;UserInterface&lt;/string&gt; 
+           &lt;/void&gt; 
+           &lt;void property=&quot;x&quot;&gt; 
+            &lt;int&gt;418&lt;/int&gt; 
+           &lt;/void&gt; 
+           &lt;void property=&quot;y&quot;&gt; 
+            &lt;int&gt;55&lt;/int&gt; 
+           &lt;/void&gt; 
+          &lt;/object&gt; 
+         &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;object id=&quot;LayerNode7&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.LayerNode&quot;&gt; 
+           &lt;void property=&quot;allowedEfferentsCollection&quot;&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
+             &lt;object idref=&quot;LayerNode3&quot;/&gt; 
+            &lt;/void&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
+             &lt;object idref=&quot;LayerNode2&quot;/&gt; 
+            &lt;/void&gt; 
+           &lt;/void&gt; 
+           &lt;void property=&quot;childrenCollection&quot;&gt; 
+            &lt;void method=&quot;add&quot;&gt; 
              &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.SubsystemNode&quot;&gt; 
               &lt;void property=&quot;includePackagePatternsCollection&quot;&gt; 
                &lt;void method=&quot;add&quot;&gt; 
-                &lt;string&gt;org.agnitas.webservice&lt;/string&gt; 
+                &lt;string&gt;org.agnitas.backend&lt;/string&gt; 
                &lt;/void&gt; 
               &lt;/void&gt; 
               &lt;void property=&quot;name&quot;&gt; 
-               &lt;string&gt;Webservices&lt;/string&gt; 
+               &lt;string&gt;backend&lt;/string&gt; 
               &lt;/void&gt; 
              &lt;/object&gt; 
             &lt;/void&gt; 
-            &lt;void method=&quot;add&quot;&gt; 
-             &lt;object idref=&quot;SubsystemNode1&quot;/&gt; 
-            &lt;/void&gt; 
            &lt;/void&gt; 
            &lt;void property=&quot;index&quot;&gt; 
             &lt;int&gt;-1&lt;/int&gt; 
            &lt;/void&gt; 
            &lt;void property=&quot;name&quot;&gt; 
-            &lt;string&gt;UserInterface&lt;/string&gt; 
+            &lt;string&gt;backend&lt;/string&gt; 
            &lt;/void&gt; 
            &lt;void property=&quot;x&quot;&gt; 
-            &lt;int&gt;276&lt;/int&gt; 
+            &lt;int&gt;32&lt;/int&gt; 
            &lt;/void&gt; 
            &lt;void property=&quot;y&quot;&gt; 
-            &lt;int&gt;126&lt;/int&gt; 
+            &lt;int&gt;77&lt;/int&gt; 
            &lt;/void&gt; 
           &lt;/object&gt; 
          &lt;/void&gt; 
+         &lt;void method=&quot;add&quot;&gt; 
+          &lt;object idref=&quot;LayerNode6&quot;/&gt; 
+         &lt;/void&gt; 
         &lt;/void&gt; 
         &lt;void property=&quot;allowedEfferentsCollection&quot;&gt; 
          &lt;void method=&quot;add&quot;&gt; 
@@ -415,10 +667,10 @@
          &lt;string&gt;Dao&lt;/string&gt; 
         &lt;/void&gt; 
         &lt;void property=&quot;x&quot;&gt; 
-         &lt;int&gt;65&lt;/int&gt; 
+         &lt;int&gt;69&lt;/int&gt; 
         &lt;/void&gt; 
         &lt;void property=&quot;y&quot;&gt; 
-         &lt;int&gt;202&lt;/int&gt; 
+         &lt;int&gt;225&lt;/int&gt; 
         &lt;/void&gt; 
        &lt;/object&gt; 
       &lt;/void&gt; 
@@ -428,6 +680,12 @@
       &lt;void method=&quot;add&quot;&gt; 
        &lt;object idref=&quot;LayerNode5&quot;/&gt; 
       &lt;/void&gt; 
+      &lt;void method=&quot;add&quot;&gt; 
+       &lt;object idref=&quot;LayerNode7&quot;/&gt; 
+      &lt;/void&gt; 
+      &lt;void method=&quot;add&quot;&gt; 
+       &lt;object idref=&quot;LayerNode6&quot;/&gt; 
+      &lt;/void&gt; 
      &lt;/void&gt; 
      &lt;void property=&quot;childrenCollection&quot;&gt; 
       &lt;void method=&quot;add&quot;&gt; 
@@ -455,7 +713,7 @@
        &lt;/object&gt; 
       &lt;/void&gt; 
       &lt;void method=&quot;add&quot;&gt; 
-       &lt;object idref=&quot;SubsystemNode2&quot;/&gt; 
+       &lt;object idref=&quot;SubsystemNode3&quot;/&gt; 
       &lt;/void&gt; 
      &lt;/void&gt; 
      &lt;void property=&quot;index&quot;&gt; 
@@ -468,10 +726,10 @@
       &lt;string&gt;Beans&lt;/string&gt; 
      &lt;/void&gt; 
      &lt;void property=&quot;x&quot;&gt; 
-      &lt;int&gt;267&lt;/int&gt; 
+      &lt;int&gt;488&lt;/int&gt; 
      &lt;/void&gt; 
      &lt;void property=&quot;y&quot;&gt; 
-      &lt;int&gt;323&lt;/int&gt; 
+      &lt;int&gt;316&lt;/int&gt; 
      &lt;/void&gt; 
     &lt;/object&gt; 
    &lt;/void&gt; 
@@ -487,6 +745,12 @@
    &lt;void method=&quot;add&quot;&gt; 
     &lt;object idref=&quot;LayerNode5&quot;/&gt; 
    &lt;/void&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object idref=&quot;LayerNode7&quot;/&gt; 
+   &lt;/void&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object idref=&quot;LayerNode6&quot;/&gt; 
+   &lt;/void&gt; 
   &lt;/void&gt; 
   &lt;void property=&quot;moveCompilationUnitsCollection&quot;&gt; 
    &lt;void method=&quot;add&quot;&gt; 
@@ -534,7 +798,7 @@
    &lt;void method=&quot;add&quot;&gt; 
     &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.MoveCompilationUnitNode&quot;&gt; 
      &lt;void property=&quot;compilationUnit&quot;&gt; 
-      &lt;string&gt;org/agnitas/web/AdminForm.java&lt;/string&gt; 
+      &lt;string&gt;org/agnitas/web/forms/AdminForm.java&lt;/string&gt; 
      &lt;/void&gt; 
      &lt;void property=&quot;date&quot;&gt; 
       &lt;object class=&quot;java.util.Date&quot;&gt; 
@@ -549,7 +813,7 @@
    &lt;void method=&quot;add&quot;&gt; 
     &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.MoveCompilationUnitNode&quot;&gt; 
      &lt;void property=&quot;compilationUnit&quot;&gt; 
-      &lt;string&gt;org/agnitas/web/CampaignForm.java&lt;/string&gt; 
+      &lt;string&gt;org/agnitas/web/forms/CampaignForm.java&lt;/string&gt; 
      &lt;/void&gt; 
      &lt;void property=&quot;date&quot;&gt; 
       &lt;object class=&quot;java.util.Date&quot;&gt; 
@@ -864,7 +1128,7 @@
    &lt;void method=&quot;add&quot;&gt; 
     &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.MoveCompilationUnitNode&quot;&gt; 
      &lt;void property=&quot;compilationUnit&quot;&gt; 
-      &lt;string&gt;org/agnitas/web/StrutsFormBase.java&lt;/string&gt; 
+      &lt;string&gt;org/agnitas/web/forms/StrutsFormBase.java&lt;/string&gt; 
      &lt;/void&gt; 
      &lt;void property=&quot;date&quot;&gt; 
       &lt;object class=&quot;java.util.Date&quot;&gt; 
@@ -969,9 +1233,165 @@
      &lt;/void&gt; 
     &lt;/object&gt; 
    &lt;/void&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.CutTypeDependencyNode&quot;&gt; 
+     &lt;void property=&quot;date&quot;&gt; 
+      &lt;object class=&quot;java.util.Date&quot;&gt; 
+       &lt;long&gt;1213803703132&lt;/long&gt; 
+      &lt;/object&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;fromType&quot;&gt; 
+      &lt;string&gt;org.agnitas.target.impl.TargetNodeDate&lt;/string&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;toType&quot;&gt; 
+      &lt;string&gt;org.agnitas.target.TargetNode&lt;/string&gt; 
+     &lt;/void&gt; 
+    &lt;/object&gt; 
+   &lt;/void&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.CutTypeDependencyNode&quot;&gt; 
+     &lt;void property=&quot;date&quot;&gt; 
+      &lt;object class=&quot;java.util.Date&quot;&gt; 
+       &lt;long&gt;1213803703132&lt;/long&gt; 
+      &lt;/object&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;fromType&quot;&gt; 
+      &lt;string&gt;org.agnitas.target.impl.TargetNodeString&lt;/string&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;toType&quot;&gt; 
+      &lt;string&gt;org.agnitas.target.TargetNode&lt;/string&gt; 
+     &lt;/void&gt; 
+    &lt;/object&gt; 
+   &lt;/void&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object id=&quot;CutTypeDependencyNode0&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.CutTypeDependencyNode&quot;&gt; 
+     &lt;void property=&quot;childInRefactoringChain&quot;&gt; 
+      &lt;object id=&quot;CutTypeDependencyNode1&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.CutTypeDependencyNode&quot;&gt; 
+       &lt;void property=&quot;date&quot;&gt; 
+        &lt;object class=&quot;java.util.Date&quot;&gt; 
+         &lt;long&gt;1213803703132&lt;/long&gt; 
+        &lt;/object&gt; 
+       &lt;/void&gt; 
+       &lt;void property=&quot;fromType&quot;&gt; 
+        &lt;string&gt;org.agnitas.target.impl.TargetRepresentationImpl&lt;/string&gt; 
+       &lt;/void&gt; 
+       &lt;void property=&quot;parentInRefactoringChain&quot;&gt; 
+        &lt;object idref=&quot;CutTypeDependencyNode0&quot;/&gt; 
+       &lt;/void&gt; 
+       &lt;void property=&quot;toType&quot;&gt; 
+        &lt;string&gt;org.agnitas.target.TargetRepresentation&lt;/string&gt; 
+       &lt;/void&gt; 
+      &lt;/object&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;date&quot;&gt; 
+      &lt;object class=&quot;java.util.Date&quot;&gt; 
+       &lt;long&gt;1213803703132&lt;/long&gt; 
+      &lt;/object&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;fromType&quot;&gt; 
+      &lt;string&gt;org.agnitas.target.impl.TargetRepresentationImpl&lt;/string&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;toType&quot;&gt; 
+      &lt;string&gt;org.agnitas.target.TargetNode&lt;/string&gt; 
+     &lt;/void&gt; 
+    &lt;/object&gt; 
+   &lt;/void&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object idref=&quot;CutTypeDependencyNode1&quot;/&gt; 
+   &lt;/void&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object id=&quot;CutTypeDependencyNode2&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.CutTypeDependencyNode&quot;&gt; 
+     &lt;void property=&quot;childInRefactoringChain&quot;&gt; 
+      &lt;object id=&quot;CutTypeDependencyNode3&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.CutTypeDependencyNode&quot;&gt; 
+       &lt;void property=&quot;childInRefactoringChain&quot;&gt; 
+        &lt;object id=&quot;CutTypeDependencyNode4&quot; class=&quot;com.hello2morrow.sonar.core.architecturedescription.CutTypeDependencyNode&quot;&gt; 
+         &lt;void property=&quot;date&quot;&gt; 
+          &lt;object class=&quot;java.util.Date&quot;&gt; 
+           &lt;long&gt;1213803703132&lt;/long&gt; 
+          &lt;/object&gt; 
+         &lt;/void&gt; 
+         &lt;void property=&quot;fromType&quot;&gt; 
+          &lt;string&gt;org.agnitas.target.impl.TargetImpl&lt;/string&gt; 
+         &lt;/void&gt; 
+         &lt;void property=&quot;parentInRefactoringChain&quot;&gt; 
+          &lt;object idref=&quot;CutTypeDependencyNode3&quot;/&gt; 
+         &lt;/void&gt; 
+         &lt;void property=&quot;toType&quot;&gt; 
+          &lt;string&gt;org.agnitas.target.TargetRepresentation&lt;/string&gt; 
+         &lt;/void&gt; 
+        &lt;/object&gt; 
+       &lt;/void&gt; 
+       &lt;void property=&quot;date&quot;&gt; 
+        &lt;object class=&quot;java.util.Date&quot;&gt; 
+         &lt;long&gt;1213803703132&lt;/long&gt; 
+        &lt;/object&gt; 
+       &lt;/void&gt; 
+       &lt;void property=&quot;fromType&quot;&gt; 
+        &lt;string&gt;org.agnitas.target.impl.TargetImpl&lt;/string&gt; 
+       &lt;/void&gt; 
+       &lt;void property=&quot;parentInRefactoringChain&quot;&gt; 
+        &lt;object idref=&quot;CutTypeDependencyNode2&quot;/&gt; 
+       &lt;/void&gt; 
+       &lt;void property=&quot;toType&quot;&gt; 
+        &lt;string&gt;org.agnitas.target.TargetNode&lt;/string&gt; 
+       &lt;/void&gt; 
+      &lt;/object&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;date&quot;&gt; 
+      &lt;object class=&quot;java.util.Date&quot;&gt; 
+       &lt;long&gt;1213803703132&lt;/long&gt; 
+      &lt;/object&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;fromType&quot;&gt; 
+      &lt;string&gt;org.agnitas.target.impl.TargetImpl&lt;/string&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;toType&quot;&gt; 
+      &lt;string&gt;org.agnitas.target.Target&lt;/string&gt; 
+     &lt;/void&gt; 
+    &lt;/object&gt; 
+   &lt;/void&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object idref=&quot;CutTypeDependencyNode3&quot;/&gt; 
+   &lt;/void&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.CutTypeDependencyNode&quot;&gt; 
+     &lt;void property=&quot;date&quot;&gt; 
+      &lt;object class=&quot;java.util.Date&quot;&gt; 
+       &lt;long&gt;1213803703132&lt;/long&gt; 
+      &lt;/object&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;fromType&quot;&gt; 
+      &lt;string&gt;org.agnitas.target.impl.TargetNodeNumeric&lt;/string&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;toType&quot;&gt; 
+      &lt;string&gt;org.agnitas.target.TargetNode&lt;/string&gt; 
+     &lt;/void&gt; 
+    &lt;/object&gt; 
+   &lt;/void&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object idref=&quot;CutTypeDependencyNode4&quot;/&gt; 
+   &lt;/void&gt; 
   &lt;/void&gt; 
   &lt;void property=&quot;name&quot;&gt; 
    &lt;string&gt;architecture-template&lt;/string&gt; 
   &lt;/void&gt; 
+  &lt;void property=&quot;thresholdsCollection&quot;&gt; 
+   &lt;void method=&quot;add&quot;&gt; 
+    &lt;object class=&quot;com.hello2morrow.sonar.core.architecturedescription.ThresholdNode&quot;&gt; 
+     &lt;void property=&quot;attribute&quot;&gt; 
+      &lt;string&gt;lines of code&lt;/string&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;element&quot;&gt; 
+      &lt;string&gt;compilation-unit&lt;/string&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;typeName&quot;&gt; 
+      &lt;string&gt;upper&lt;/string&gt; 
+     &lt;/void&gt; 
+     &lt;void property=&quot;value&quot;&gt; 
+      &lt;string&gt;700&lt;/string&gt; 
+     &lt;/void&gt; 
+    &lt;/object&gt; 
+   &lt;/void&gt; 
+  &lt;/void&gt; 
  &lt;/object&gt; 
 &lt;/java&gt; </diff>
      <filename>architecture.xml</filename>
    </modified>
    <modified>
      <diff>@@ -25,11 +25,13 @@ CFLAGS	= -I.
 SRCS	= atob.c \
 	  buffer.c \
 	  csig.c \
+	  hash.c \
 	  lock.c \
 	  log.c \
+	  map.c \
 	  net.c \
 	  node.c \
-	  map.c \
+	  set.c \
 	  skip.c \
 	  str.c \
 	  tzdiff.c \</diff>
      <filename>src/c/lib/GNUmakefile</filename>
    </modified>
    <modified>
      <diff>@@ -283,6 +283,10 @@ extern bool_t		buffer_appends (buffer_t *b, const char *str);
 extern bool_t		buffer_appendch (buffer_t *b, char ch);
 extern bool_t		buffer_appendnl (buffer_t *b);
 extern bool_t		buffer_appendcrlf (buffer_t *b);
+extern bool_t		buffer_insert (buffer_t *b, int pos, const byte_t *data, int dlen);
+extern bool_t		buffer_insertbuf (buffer_t *b, int pos, buffer_t *data);
+extern bool_t		buffer_insertsn (buffer_t *b, int pos, const char *str, int len);
+extern bool_t		buffer_inserts (buffer_t *b, int pos, const char *str);
 extern bool_t		buffer_stiff (buffer_t *b, const byte_t *data, int dlen);
 extern bool_t		buffer_stiffb (buffer_t *b, byte_t data);
 extern bool_t		buffer_stiffsn (buffer_t *b, const char *str, int len);</diff>
      <filename>src/c/lib/agn.h</filename>
    </modified>
    <modified>
      <diff>@@ -258,6 +258,47 @@ buffer_appendcrlf (buffer_t *b) /*{{{*/
 {
 	return buffer_append (b, (byte_t *) &quot;\r\n&quot;, 2);
 }/*}}}*/
+/** Insert data at given position
+ * @param b the buffer to use
+ * @param pos the position to insert data
+ * @param data the content
+ * @param dlen length of content
+ * @return true if content could be inserted, false otherwise
+ */
+bool_t
+buffer_insert (buffer_t *b, int pos, const byte_t *data, int dlen) /*{{{*/
+{
+	bool_t	st;
+	
+	st = false;
+	if ((b -&gt; length + dlen &lt;= b -&gt; size) || buffer_size (b, b -&gt; length + dlen)) {
+		if (pos &lt; 0)
+			pos = 0;
+		if (pos &lt; b -&gt; length)
+			memmove (b -&gt; buffer + pos + dlen, b -&gt; buffer + pos, b -&gt; length - pos);
+		if (dlen &gt; 0) {
+			memcpy (b -&gt; buffer + pos, data, dlen);
+			b -&gt; length += dlen;
+		}
+		st = true;
+	}
+	return st;
+}/*}}}*/
+bool_t
+buffer_insertbuf (buffer_t *b, int pos, buffer_t *data) /*{{{*/
+{
+	return data ? buffer_insert (b, pos, data -&gt; buffer, data -&gt; length) : true;
+}/*}}}*/
+bool_t
+buffer_insertsn (buffer_t *b, int pos, const char *str, int len) /*{{{*/
+{
+	return buffer_insert (b, pos, (byte_t *) str, len);
+}/*}}}*/
+bool_t
+buffer_inserts (buffer_t *b, int pos, const char *str) /*{{{*/
+{
+	return buffer_insert (b, pos, (byte_t *) str, strlen (str));
+}/*}}}*/
 /** Stiff (append) byte array to buffer.
  * This is like &lt;i&gt;buffer_append&lt;/i&gt;, but more buffer is allocated
  * than currently required. These class of functions are useful when</diff>
      <filename>src/c/lib/buffer.c</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 @echo off
 rem	-*- no -*-
-cl /DWIN32 /I. /Iwin &quot;/IC:\Programme\Microsoft Visual Studio 8\VC\include&quot; /c  atob.c buffer.c lock.c log.c node.c map.c skip.c str.c tzdiff.c var.c compat.c
+cl /DWIN32 /I. /Iwin &quot;/IC:\Programme\Microsoft Visual Studio 8\VC\include&quot; /c  atob.c buffer.c hash.c lock.c log.c node.c map.c skip.c str.c tzdiff.c var.c compat.c</diff>
      <filename>src/c/lib/build.bat</filename>
    </modified>
    <modified>
      <diff>@@ -49,6 +49,8 @@ SRCS	= append.c \
 	  parse.c \
 	  plugin.c \
 	  postfix.c \
+	  preview.c \
+	  rblock.c \
 	  receiver.c \
 	  replace.c \
 	  sqllike.c \</diff>
      <filename>src/c/xmlback/GNUmakefile</filename>
    </modified>
    <modified>
      <diff>@@ -126,12 +126,14 @@ blockmail_alloc (const char *fname, bool_t syncfile, log_t *lg) /*{{{*/
 		b -&gt; eval = NULL;
 
 		b -&gt; usecrlf = false;
+		b -&gt; raw = false;
 		b -&gt; output = NULL;
 		b -&gt; outputdata = NULL;
 		b -&gt; counter = NULL;
 		b -&gt; active = false;
 		b -&gt; head = NULL;
 		b -&gt; body = NULL;
+		b -&gt; rblocks = NULL;
 
 		b -&gt; company_id = -1;
 		b -&gt; mailinglist_id = -1;
@@ -227,6 +229,8 @@ blockmail_free (blockmail_t *b) /*{{{*/
 			buffer_free (b -&gt; head);
 		if (b -&gt; body)
 			buffer_free (b -&gt; body);
+		if (b -&gt; rblocks)
+			rblock_free_all (b -&gt; rblocks);
 		if (b -&gt; mtbuf[0])
 			xmlBufferFree (b -&gt; mtbuf[0]);
 		if (b -&gt; mtbuf[1])</diff>
      <filename>src/c/xmlback/blockmail.c</filename>
    </modified>
    <modified>
      <diff>@@ -60,7 +60,7 @@
   &lt;!ELEMENT maildrop EMPTY&gt;
   &lt;!ATTLIST maildrop status_id %numeric; #REQUIRED&gt;
   &lt;!ELEMENT status EMPTY&gt;
-  &lt;!ATTLIST status field (A | T | E | R | W) #REQUIRED&gt;
+  &lt;!ATTLIST status field (A | T | E | R | W | D | P) #REQUIRED&gt;
  &lt;!ELEMENT general (subject, from_email, profile_url, unsubscribe_url,
 		    auto_url, onepixel_url, password, total_subscribers)&gt;
   &lt;!ELEMENT subject (#PCDATA)&gt;</diff>
      <filename>src/c/xmlback/blockmail.dtd</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 @echo off
 rem	-*- no -*-
-rem cl /DWIN32 /Dinline= /I. /I..\lib /I..\lib\win &quot;/IC:\Programme\Microsoft Visual Studio 8\VC\include&quot; /c append.c block.c blockmail.c blockspec.c codec.c convert.c count.c counter.c create.c data.c dcache.c dyn.c eval.c field.c fix.c generate.c links.c mailtype.c media.c misc.c modify.c none.c parse.c plugin.c postfix.c receiver.c replace.c sqllike.c tag.c tagpos.c url.c xmlback.c dtd.c
-cl /DWIN32 /Dinline= /I. /I..\lib /I..\lib\win &quot;/IC:\Programme\Microsoft Visual Studio 8\VC\include&quot; /c tag.c
+cl /DWIN32 /Dinline= /I. /I..\lib /I..\lib\win &quot;/IC:\Programme\Microsoft Visual Studio 8\VC\include&quot; /c append.c block.c blockmail.c blockspec.c codec.c convert.c count.c counter.c create.c data.c dcache.c dyn.c eval.c field.c fix.c generate.c links.c mailtype.c media.c misc.c modify.c none.c parse.c plugin.c postfix.c receiver.c replace.c sqllike.c tag.c tagpos.c url.c xmlback.c dtd.c preview.c rblock.c
+rem cl /DWIN32 /Dinline= /I. /I..\lib /I..\lib\win &quot;/IC:\Programme\Microsoft Visual Studio 8\VC\include&quot; /c tag.c
 cl *.obj grammer\transform.obj grammer\parse.obj ..\lib\*.obj /link /OUT:xmlback.exe /LIBPATH:..\lib\win /DEFAULTLIB:libxml2.lib /DEFAULTLIB:zlib.lib /DEFAULTLIB:iconv.lib /DEFAULTLIB:libslang.lib &quot;/LIBPATH:C:\Programme\Microsoft Visual Studio 8\VC\lib&quot;
 copy /y xmlback.exe C:\OpenEMM\bin</diff>
      <filename>src/c/xmlback/build.bat</filename>
    </modified>
    <modified>
      <diff>@@ -118,6 +118,7 @@ create_mail (blockmail_t *blockmail, receiver_t *rec) /*{{{*/
 	mailtype_t	*mtyp;
 	blockspec_t	*bspec;
 	block_t		*block;
+	rblock_t	*rbprev, *rbhead;
 	bool_t		changed;
 	
 	mtyp = NULL;
@@ -231,6 +232,8 @@ create_mail (blockmail_t *blockmail, receiver_t *rec) /*{{{*/
 
 	/*
 	 * 3. Stage: create the output */
+	rbprev = NULL;
+	rbhead = NULL;
 	for (n = 0; st &amp;&amp; (n &lt;= mtyp -&gt; blockspec_count); ++n) {
 		if (n &lt; mtyp -&gt; blockspec_count) {
 			bspec = mtyp -&gt; blockspec[n];
@@ -239,51 +242,73 @@ create_mail (blockmail_t *blockmail, receiver_t *rec) /*{{{*/
 			bspec = NULL;
 			block = NULL;
 		}
-		if (postfixes) {
-			postfix_t	*run, *prv;
+		if (blockmail -&gt; raw) {
 			
-			for (run = postfixes, prv = NULL; st &amp;&amp; run; run = run -&gt; stack)
-				if ((! block) || (run -&gt; after &lt; block -&gt; nr)) {
-					dest = (run -&gt; ref -&gt; block -&gt; tid == TID_EMail_Head ? blockmail -&gt; head : blockmail -&gt; body);
-					if (! append_cooked (dest, (attcount ? run -&gt; c -&gt; acont : run -&gt; c -&gt; cont), run -&gt; ref -&gt; block -&gt; charset, Enc8bit)) {
-						log_out (blockmail -&gt; lg, LV_ERROR, &quot;Unable to append postfix for block %d for %d&quot;, run -&gt; ref -&gt; block -&gt; nr, rec -&gt; customer_id);
-						st = false;
-					}
-					if (prv)
-						prv -&gt; stack = run -&gt; stack;
+			if (st &amp;&amp; block &amp;&amp; block -&gt; inuse) {
+				const char	*name;
+				rblock_t	*rbtmp;
+				
+				switch (block -&gt; tid) {
+				default:		name = block -&gt; cid;	break;
+				case TID_EMail_Head:	name = &quot;__head__&quot;;	break;
+				case TID_EMail_Text:	name = &quot;__text__&quot;;	break;
+				case TID_EMail_HTML:	name = &quot;__html__&quot;;	break;
+				}
+				if (rbtmp = rblock_alloc (block -&gt; tid, name, block -&gt; out)) {
+					if (rbprev)
+						rbprev -&gt; next = rbtmp;
 					else
-						postfixes = run -&gt; stack;
-				} else
-					prv = run;
-		}
-		if (st &amp;&amp; block &amp;&amp; block -&gt; inuse) {
-			dest = (block -&gt; tid == TID_EMail_Head ? blockmail -&gt; head : blockmail -&gt; body);
-			if (! append_cooked (dest, (attcount ? bspec -&gt; prefix -&gt; acont : bspec -&gt; prefix -&gt; cont), block -&gt; charset, Enc8bit)) {
-				log_out (blockmail -&gt; lg, LV_ERROR, &quot;Unable to append prefix for block %d for %d&quot;, block -&gt; nr, rec -&gt; customer_id);
-				st = false;
+						blockmail -&gt; rblocks = rbtmp;
+					rbprev = rbtmp;
+					if ((! rbhead) &amp;&amp; (block -&gt; tid == TID_EMail_Head)) {
+						rbhead = rbtmp;
+						append_cooked (blockmail -&gt; head, rbhead -&gt; content, block -&gt; charset, block -&gt; method);
+					}
+				}
 			}
-			if (st) {
-				if (! block -&gt; binary) {
-					if (! append_cooked (dest, block -&gt; out, block -&gt; charset, block -&gt; method))
-						st = false;
-				} else {
-					if (! append_raw (dest, block -&gt; bout))
-						st = false;
+		} else {
+			if (postfixes) {
+				postfix_t	*run, *prv;
+			
+				for (run = postfixes, prv = NULL; st &amp;&amp; run; run = run -&gt; stack)
+					if ((! block) || (run -&gt; after &lt; block -&gt; nr)) {
+						dest = (run -&gt; ref -&gt; block -&gt; tid == TID_EMail_Head ? blockmail -&gt; head : blockmail -&gt; body);
+						if (! append_cooked (dest, (attcount ? run -&gt; c -&gt; acont : run -&gt; c -&gt; cont), run -&gt; ref -&gt; block -&gt; charset, Enc8bit)) {
+							log_out (blockmail -&gt; lg, LV_ERROR, &quot;Unable to append postfix for block %d for %d&quot;, run -&gt; ref -&gt; block -&gt; nr, rec -&gt; customer_id);
+							st = false;
+						}
+						if (prv)
+							prv -&gt; stack = run -&gt; stack;
+						else
+							postfixes = run -&gt; stack;
+					} else
+						prv = run;
+			}
+			if (st &amp;&amp; block &amp;&amp; block -&gt; inuse) {
+				dest = (block -&gt; tid == TID_EMail_Head ? blockmail -&gt; head : blockmail -&gt; body);
+				if (! append_cooked (dest, (attcount ? bspec -&gt; prefix -&gt; acont : bspec -&gt; prefix -&gt; cont), block -&gt; charset, Enc8bit)) {
+					log_out (blockmail -&gt; lg, LV_ERROR, &quot;Unable to append prefix for block %d for %d&quot;, block -&gt; nr, rec -&gt; customer_id);
+					st = false;
+				}
+				if (st) {
+					if (! block -&gt; binary) {
+						if (! append_cooked (dest, block -&gt; out, block -&gt; charset, block -&gt; method))
+							st = false;
+					} else {
+						if (! append_raw (dest, block -&gt; bout))
+							st = false;
+					}
+					if (! st)
+						log_out (blockmail -&gt; lg, LV_ERROR, &quot;Unable to append content of block %d for %d&quot;, block -&gt; nr, rec -&gt; customer_id);
 				}
-				if (! st)
-					log_out (blockmail -&gt; lg, LV_ERROR, &quot;Unable to append content of block %d for %d&quot;, block -&gt; nr, rec -&gt; customer_id);
 			}
 		}
 	}
 	/*
 	 * 4. clear up empty lines in header */
 	cleanup_header (blockmail);
-# ifdef		CSS
-	/*
-	 * 5. optional sign mail */
-	if (blockmail -&gt; dkim)
-		sign_mail (blockmail);
-# endif		/* CSS */
+	if (rbhead)
+		rblock_retreive_content (rbhead, blockmail -&gt; head);
 
 	return st;
 }/*}}}*/
@@ -299,6 +324,8 @@ create_output (blockmail_t *blockmail, receiver_t *rec) /*{{{*/
 	blockmail -&gt; active = true;
 	blockmail -&gt; head -&gt; length = 0;
 	blockmail -&gt; body -&gt; length = 0;
+	if (blockmail -&gt; raw &amp;&amp; blockmail -&gt; rblocks)
+		blockmail -&gt; rblocks = rblock_free_all (blockmail -&gt; rblocks);
 	if (rec -&gt; mediatypes) {
 		char	*copy, *cur, *ptr;
 		mtype_t	type;</diff>
      <filename>src/c/xmlback/create.c</filename>
    </modified>
    <modified>
      <diff>@@ -35,6 +35,8 @@ static output_t	output_table[] = { /*{{{*/
 		generate_oinit,	generate_odeinit, generate_owrite
 	}, {	&quot;count&quot;,	false,
 		count_oinit, count_odeinit, count_owrite
+	}, {	&quot;preview&quot;,	false,
+		preview_oinit, preview_odeinit, preview_owrite
 	}
 	/*}}}*/
 };
@@ -151,6 +153,7 @@ main (int argc, char **argv) /*{{{*/
 	bool_t		quiet;
 	const char	*error_file;
 	bool_t		usecrlf;
+	bool_t		raw;
 	output_t	*out;
 	const char	*outparm;
 	const char	*level;
@@ -163,6 +166,7 @@ main (int argc, char **argv) /*{{{*/
 	quiet = false;
 	error_file = NULL;
 	usecrlf = true;
+	raw = false;
 	out = &amp; output_table[1];
 	outparm = NULL;
 	level = NULL;
@@ -170,7 +174,7 @@ main (int argc, char **argv) /*{{{*/
 	xmlInitParser ();
 	xmlInitializePredefinedEntities ();
 	xmlInitCharEncodingHandlers ();
-	while ((n = getopt (argc, argv, &quot;VDvpqE:lo:L:&quot;)) != -1)
+	while ((n = getopt (argc, argv, &quot;VDvpqE:lro:L:&quot;)) != -1)
 		switch (n) {
 		case 'V':
 			printf (&quot;%s\n&quot;, XML_VERSION);
@@ -193,6 +197,9 @@ main (int argc, char **argv) /*{{{*/
 		case 'l':
 			usecrlf = false;
 			break;
+		case 'r':
+			raw = true;
+			break;
 		case 'o':
 			if (ptr = strchr (optarg, ':')) {
 				len = ptr - optarg;
@@ -255,6 +262,7 @@ main (int argc, char **argv) /*{{{*/
 			log_out (lg, LV_ERROR, &quot;Unable to setup blockmail&quot;);
 		else {
 			blockmail -&gt; usecrlf = usecrlf;
+			blockmail -&gt; raw = raw;
 			blockmail -&gt; output = out;
 			blockmail -&gt; outputdata = NULL;
 			log_idset (lg, &quot;init&quot;);</diff>
      <filename>src/c/xmlback/xmlback.c</filename>
    </modified>
    <modified>
      <diff>@@ -304,6 +304,13 @@ typedef struct counter { /*{{{*/
 	struct counter	*next;
 	/*}}}*/
 }	counter_t;
+typedef struct rblock { /*{{{*/
+	tid_t		tid;		/* type ID			*/
+	char		*bname;		/* name of this block		*/
+	xmlBufferPtr	content;	/* content of the block		*/
+	struct rblock	*next;
+	/*}}}*/
+}	rblock_t;
 typedef struct { /*{{{*/
 	/* internal used only data */
 	const char	*fname;		/* current filename		*/
@@ -317,12 +324,14 @@ typedef struct { /*{{{*/
 	eval_t		*eval;		/* to interpret dynamic content	*/
 	/* output related data */
 	bool_t		usecrlf;	/* use CRLF or LF on output	*/
+	bool_t		raw;		/* just generate raw output	*/
 	output_t	*output;	/* output information		*/
 	void		*outputdata;	/* output related private data	*/
 	counter_t	*counter;	/* counter for created mails	*/
 	bool_t		active;		/* if user is active		*/
 	buffer_t	*head;		/* the created head ..		*/
 	buffer_t	*body;		/* .. and body			*/
+	rblock_t	*rblocks;	/* the raw blocks		*/
 
 	/*
 	 * from here, the data is from the input file or from dynamic enviroment
@@ -491,6 +500,12 @@ extern mailtype_t	*mailtype_free (mailtype_t *m);
 extern counter_t	*counter_alloc (const char *mediatype, const char *subtype);
 extern counter_t	*counter_free (counter_t *c);
 extern counter_t	*counter_free_all (counter_t *c);
+extern rblock_t		*rblock_alloc (tid_t tid, const char *bname, xmlBufferPtr content);
+extern rblock_t		*rblock_free (rblock_t *r);
+extern rblock_t		*rblock_free_all (rblock_t *r);
+extern bool_t		rblock_set_name (rblock_t *r, const char *bname);
+extern bool_t		rblock_set_content (rblock_t *r, xmlBufferPtr content);
+extern bool_t		rblock_retreive_content (rblock_t *r, buffer_t *content);
 extern blockmail_t	*blockmail_alloc (const char *fname, bool_t syncfile, log_t *lg);
 extern blockmail_t	*blockmail_free (blockmail_t *b);
 extern bool_t		blockmail_count (blockmail_t *b, const char *mediatype, const char *subtype, long bytes);
@@ -576,6 +591,9 @@ extern bool_t		generate_owrite (void *data, blockmail_t *blockmail, receiver_t *
 extern void		*count_oinit (blockmail_t *blockmail, var_t *opts);
 extern bool_t		count_odeinit (void *data, blockmail_t *blockmail, bool_t success);
 extern bool_t		count_owrite (void *data, blockmail_t *blockmail, receiver_t *rec);
+extern void		*preview_oinit (blockmail_t *blockmail, var_t *opts);
+extern bool_t		preview_odeinit (void *data, blockmail_t *blockmail, bool_t success);
+extern bool_t		preview_owrite (void *data, blockmail_t *blockmail, receiver_t *rec);
 
 /*
  * plugin handling</diff>
      <filename>src/c/xmlback/xmlback.h</filename>
    </modified>
    <modified>
      <diff>@@ -97,7 +97,7 @@ public class BlockCollection {
         tg.initialize (data);
         return tg;
     }
-    
+
     /**
      * Constructor for this class
      */
@@ -328,6 +328,12 @@ public class BlockCollection {
     public String mailingClause () {
         return &quot;mailing_id = &quot; + data.mailing_id;
     }
+    
+    public String reduceClause () {
+        if (data.isPreviewMailing ())
+            return &quot; AND comptype IN (0, 4)&quot;;
+        return &quot;&quot;;
+    }
 
     public String componentFields () {
         return &quot;comptype, url_id, compname, mtype, target_id, emmblock, binblock&quot;;
@@ -344,7 +350,7 @@ public class BlockCollection {
 
         query = &quot;SELECT &quot; + componentFields () + &quot; &quot; +
             &quot;FROM component_tbl &quot; +
-            &quot;WHERE company_id = &quot; + data.company_id + &quot; AND (&quot; + mailingClause () + &quot;) &quot; +
+            &quot;WHERE company_id = &quot; + data.company_id + &quot; AND (&quot; + mailingClause () + &quot;) &quot; + reduceClause () +
             &quot;ORDER BY component_id&quot;;
         try {
             Vector      collect;</diff>
      <filename>src/java/org/agnitas/backend/BlockCollection.java</filename>
    </modified>
    <modified>
      <diff>@@ -50,26 +50,6 @@ public class Data {
     final static long serialVersionUID = 0x055da1a;
     /** the file to read the configuration from */
     final static String INI_FILE = &quot;Mailgun.ini&quot;;
-    /** Available output file formats */
-    final static String[]   OUT_MODES = {
-        &quot;meta&quot;
-    };
-    /** Output file format constant: META */
-    final static int    OUT_META = 0;
-    /** default output file format */
-    final static int    DEFAULT_OUT_MODE = OUT_META;
-    /** Available modes for output format meta */
-    final static String[]   META_MODES = {
-        &quot;xml&quot;,
-        &quot;xml/gz&quot;
-    };
-    /** Mode for output format meta XML */
-    final static int    OUT_META_XML = 0;
-    /** Mode for output format meta XML gzip'd */
-    final static int    OUT_META_XMLGZ = 1;
-    /** default mode for output format meta */
-    final static int    DEFAULT_META_MODE = OUT_META_XML;
-
     /** default value for domain entry */
     final static String DEF_DOMAIN = &quot;openemm.org&quot;;
     /** default value for boundary entry */
@@ -77,7 +57,7 @@ public class Data {
     /** default value for EOL coding */
     final static String DEF_EOL = &quot;\r\n&quot;;
     /** default value for X-Mailer: header */
-    final static String DEF_MAILER = &quot;OpenEMM/Agnitas AG V5.1.1&quot;;
+    final static String DEF_MAILER = &quot;OpenEMM/Agnitas AG V5.5.1&quot;;
 
     /** Constant for onepixellog: no automatic insertion */
     final public static int OPL_NONE = 0;
@@ -114,21 +94,9 @@ public class Data {
     private String      sampleEmails = null;
     /** write a DB record after creating that number of receiver */
     private int     mailLogNumber = 0;
-    /** flag wether we need to update the mailing status */
-    private boolean     setMailingStatus = false;
-    /** flag if we should write the end message */
-    private boolean     writeEndMessage = true;
-    /** freetext start messages */
-    private String      startMessage = &quot;generating in progress&quot;;
-    /** freetext end message */
-    private String      endMessage = &quot;generating successfully ended&quot;;
     /** path to accounting logfile */
     private String      accLogfile = &quot;log/account.log&quot;;
 
-    /** the used output format */
-    public int      outMode = DEFAULT_OUT_MODE;
-    /** the used meta output format */
-    public int      metaMode = DEFAULT_META_MODE;
     /** the user_status for this query */
     public long     defaultUserStatus = BindingEntry.USER_STATUS_ACTIVE;
     /** in case of campaing mailing, send mail only to this customer */
@@ -137,6 +105,10 @@ public class Data {
     public long     campaignTransactionID = 0;
     /** for campaign mailings, use this user status in the binding table */
     public long     campaignUserStatus = BindingEntry.USER_STATUS_ACTIVE;
+    /** for preview mailings use this for matching the customer ID */
+    public long     previewCustomerID = 0;
+    /** for preview mailings store output */
+    public Hashtable    previewOutput = null;
     /** a counter to enforce uniqueness on compaign mails */
     public long     pass = 0;
     /** alternative campaign mailing selection */
@@ -239,7 +211,9 @@ public class Data {
     /** Bitfield of available media types in mailing */
     public long     availableMedias = 0;
     /** number of all subscriber of a mailing */
-    public long     totalSubscribers = -1;
+    public long             totalSubscribers = -1;
+    /** number of all subscriber of a mailing */
+    private BC      bigClause = null;
     /** all URLs from rdir_url_tbl */
     public Vector       URLlist = null;
     /** number of entries in URLlist */
@@ -258,8 +232,6 @@ public class Data {
     public String       company_name = null;
     /** name of mailtracking table */
     public String       mailtracking_table = null;
-    /** optional information to append to end message */
-    public String       extraEndMessage = null;
     /** for housekeeping of created files */
     private Vector      toRemove = null;
 
@@ -274,6 +246,10 @@ public class Data {
         return new DBase ((Data) me, conn);
     }
 
+    public Object mkBigClause () {
+        return new BC ();
+    }
+
     /**
      * setup database connection and retreive a list of all available
      * tables
@@ -452,22 +428,6 @@ public class Data {
     }
 
     /**
-     * Get query part for user_status
-     * @param full include table shortcut
-     * @return the where clause part for the user status
-     */
-    public String clauseForUserStatus (boolean full) {
-        String  st;
-
-        if (isCampaignMailing () &amp;&amp; (defaultUserStatus != campaignUserStatus)) {
-            st = &quot;user_status IN (&quot; + defaultUserStatus + &quot;, &quot; + campaignUserStatus + &quot;)&quot;;
-        } else {
-            st = &quot;user_status = &quot; + defaultUserStatus;
-        }
-        return (full ? &quot;bind.&quot; : &quot;&quot;) + st;
-    }
-
-    /**
      * query all basic information about this mailing
      * @param status_id the reference to the mailing
      */
@@ -478,38 +438,47 @@ public class Data {
 
         checkDatabase ();
         try {
-            maildrop_status_id = Long.parseLong (status_id);
-
-            // get the first information block from maildrop_status_tbl
-            rset = dbase.simpleQuery (&quot;SELECT company_id, mailing_id, status_field, senddate, step, blocksize, genstatus &quot; +
-                          &quot;FROM maildrop_status_tbl &quot; +
-                          &quot;WHERE status_id = &quot; + maildrop_status_id);
-            company_id = rset.getLong (1);
-            mailing_id = rset.getLong (2);
-            status_field = dbase.getValidString (rset, 3);
-            sendtimestamp = rset.getTimestamp (4);
-            st = rset.getInt (5);
-            bs = rset.getInt (6);
-            genstat = rset.getInt (7);
-            rset.close ();
-            if (status_field.equals (&quot;C&quot;))
-                status_field = &quot;E&quot;;
-            if (bs &gt; 0)
-                setBlockSize (bs);
-            setStepping (st);
-            if (genstat != 1)
-                throw new Exception (&quot;Generation state is not 1, but &quot; + genstat);
-            if (isAdminMailing () || isTestMailing () || isWorldMailing () || isRuleMailing () || isOnDemandMailing ()) {
-                int rowcount = 0;
-
-                try {
-                    rowcount = dbase.execUpdate (&quot;UPDATE maildrop_status_tbl SET genchange = &quot; + dbase.sysdate + &quot;, genstatus = 2 &quot; +
+            if (status_id.startsWith (&quot;preview:&quot;)) {
+                mailing_id = Long.parseLong (status_id.substring (status_id.indexOf (':') + 1));
+                rset = dbase.simpleQuery (&quot;SELECT company_id FROM mailing_tbl WHERE mailing_id = &quot; + mailing_id);
+                company_id = rset.getLong (1);
+                rset.close ();
+                status_field = &quot;P&quot;;
+                sendtimestamp = null;
+            } else {
+                maildrop_status_id = Long.parseLong (status_id);
+
+                // get the first information block from maildrop_status_tbl
+                rset = dbase.simpleQuery (&quot;SELECT company_id, mailing_id, status_field, senddate, step, blocksize, genstatus &quot; +
+                              &quot;FROM maildrop_status_tbl &quot; +
+                              &quot;WHERE status_id = &quot; + maildrop_status_id);
+                company_id = rset.getLong (1);
+                mailing_id = rset.getLong (2);
+                status_field = dbase.getValidString (rset, 3);
+                sendtimestamp = rset.getTimestamp (4);
+                st = rset.getInt (5);
+                bs = rset.getInt (6);
+                genstat = rset.getInt (7);
+                rset.close ();
+                if (status_field.equals (&quot;C&quot;))
+                    status_field = &quot;E&quot;;
+                if (bs &gt; 0)
+                    setBlockSize (bs);
+                setStepping (st);
+                if (genstat != 1)
+                    throw new Exception (&quot;Generation state is not 1, but &quot; + genstat);
+                if (isAdminMailing () || isTestMailing () || isWorldMailing () || isRuleMailing () || isOnDemandMailing ()) {
+                    int rowcount = 0;
+
+                    try {
+                        rowcount = dbase.execUpdate (&quot;UPDATE maildrop_status_tbl SET genchange = &quot; + dbase.sysdate + &quot;, genstatus = 2 &quot; +
                                      &quot;WHERE status_id = &quot; + maildrop_status_id + &quot; AND genstatus = 1&quot;);
-                } catch (Exception e) {
-                    throw new Exception (&quot;Unable to update generation state to 2: &quot; + e.toString ());
+                    } catch (Exception e) {
+                        throw new Exception (&quot;Unable to update generation state to 2: &quot; + e.toString ());
+                    }
+                    if (rowcount != 1)
+                        throw new Exception (&quot;Update of maildrop_status_tbl affects &quot; + rowcount + &quot; rows, not exactly one&quot;);
                 }
-                if (rowcount != 1)
-                    throw new Exception (&quot;Update of maildrop_status_tbl affects &quot; + rowcount + &quot; rows, not exactly one&quot;);
             }
             retreiveMailingInformation ();
 
@@ -626,15 +595,15 @@ public class Data {
             rset = dbase.execQuery (&quot;SELECT col_name, shortname FROM customer_field_tbl WHERE company_id = &quot; + company_id);
             while (rset.next ()) {
                 String  column = rset.getString (1).toLowerCase ();
-                
+
                 if (column != null) {
                     Column  c = (Column) cmap.get (column);
-                    
+
                     if (c != null)
                         c.setAlias (rset.getString (2));
                 }
             }
-            rset.close ();  
+            rset.close ();
 
             retreiveCompanyInfo ();
             if (rdirDomain != null) {
@@ -647,43 +616,6 @@ public class Data {
                 if (onePixelURL == null)
                     onePixelURL = rdirDomain + onePixelTag;
             }
-
-            //
-            // now count the total number of subscribers
-            if (isCampaignMailing () &amp;&amp; (campaignTransactionID == 0)) {
-                totalSubscribers = 1;
-            } else {
-                String  query, med, ref;
-
-                if ((! isCampaignMailing ()) &amp;&amp; (subselect == null)) {
-                    query = &quot;SELECT count(distinct(customer_id)) FROM customer_&quot; + company_id + &quot;_binding_tbl bind &quot; +
-                        &quot;WHERE &quot; +
-                        &quot;mailinglist_id = &quot; + mailinglist_id + &quot; AND &quot; + clauseForUserStatus (false);
-                } else {
-                    query = &quot;SELECT count(distinct(cust.customer_id)) FROM &quot;+
-                        &quot;customer_&quot; + company_id + &quot;_tbl cust, &quot; +
-                        &quot;customer_&quot; + company_id + &quot;_binding_tbl bind &quot; +
-                        &quot;WHERE &quot; +
-                        &quot;bind.customer_id = cust.customer_id AND &quot; +
-                        &quot;bind.mailinglist_id = &quot; + mailinglist_id + &quot; AND &quot; +
-                        clauseForUserStatus (true) + &quot; AND &quot; +
-                        &quot;(&quot; + subselect + &quot;)&quot;;
-                    if (isCampaignMailing ()) {
-                        query += &quot; AND cust.transaction_id = &quot; + campaignTransactionID;
-                    }
-                }
-                med = getMediaSubselect ();
-                if (med != null) {
-                    query += &quot; AND (&quot; + med + &quot;)&quot;;
-                }
-                ref = getReferenceSubselect ();
-                if (ref != null) {
-                    query += &quot; AND (&quot; + ref + &quot;)&quot;;
-                }
-                rset = dbase.simpleQuery (query);
-                totalSubscribers = rset.getLong (1);
-                rset.close ();
-            }
         } catch (SQLException e) {
             logging (Log.ERROR, &quot;init&quot;, &quot;SQLError in quering initial data: &quot; + e);
             throw new Exception (&quot;Data error/initial query: &quot; + e);
@@ -710,45 +642,6 @@ public class Data {
         step = newStep;
     }
 
-
-    /**
-     * Remove an existing old entry for mailing status and
-     * write a new record
-     */
-    private void setupMailingStatus () throws Exception {
-        setMailingStatus = false;
-        checkDatabase ();
-        try {
-            // delete old mailing id entry first
-            dbase.execUpdate (&quot;DELETE FROM mailing_status_tbl &quot; +
-                      &quot;WHERE mailing_id=&quot; + mailing_id);
-            // insert new status text for mailing id
-            dbase.execUpdate (&quot;INSERT INTO mailing_status_tbl (mailing_id, status_text) &quot; +
-                      &quot;VALUES ( &quot; + mailing_id + &quot; , '&quot; + startMessage + &quot;' )&quot;);
-            setMailingStatus = true;
-        } catch (Exception e) {
-            logging (Log.ERROR, &quot;init&quot;, &quot;Error in setup mailing status: &quot; + e);
-            throw new Exception (&quot;Unable to setup mailing status: &quot; + e);
-        }
-    }
-
-    /**
-     * Change the mailing status to a new status
-     * @param msg the new status
-     */
-    private void changeMailingStatus (String msg) throws Exception {
-        if (setMailingStatus) {
-            checkDatabase ();
-            try {
-                dbase.execUpdate (&quot;UPDATE mailing_status_tbl SET status_text = '&quot; + msg + &quot;' &quot; +
-                            &quot;WHERE mailing_id=&quot; + mailing_id);
-            } catch (Exception e) {
-                logging (Log.ERROR, &quot;data&quot;, &quot;Error in changing mailing status: &quot; + e);
-                throw new Exception (&quot;Unable to change mailing status: &quot; + e);
-            }
-        }
-    }
-
     /**
      * Validate all set variables and make a sanity check
      * on the database to avoid double triggering of a
@@ -776,7 +669,7 @@ public class Data {
                 ++cnt;
                 msg += &quot;\tunable to requery my status_id: &quot; + e.toString () + &quot;\n&quot;;
             }
-        if (maildrop_status_id &lt;= 0) {
+        if ((! isPreviewMailing ()) &amp;&amp; (maildrop_status_id &lt;= 0)) {
             ++cnt;
             msg += &quot;\tmaildrop_status_id is less than 1 (&quot; + maildrop_status_id + &quot;)\n&quot;;
         }
@@ -796,29 +689,13 @@ public class Data {
             (! isTestMailing ()) &amp;&amp;
             (! isCampaignMailing ()) &amp;&amp;
             (! isRuleMailing ()) &amp;&amp;
-           (! isOnDemandMailing ()) &amp;&amp;
-            (! isWorldMailing ())) {
+            (! isOnDemandMailing ()) &amp;&amp;
+            (! isWorldMailing ()) &amp;&amp;
+            (! isPreviewMailing ())) {
             ++cnt;
-            msg += &quot;\tstatus_field must be one of A, T, E, R, D or W (&quot; + status_field + &quot;)\n&quot;;
+            msg += &quot;\tstatus_field must be one of A, T, E, R, D, W or P (&quot; + status_field + &quot;)\n&quot;;
         }
 
-        //
-        // on admin/test mailing, generate the most
-        // user readable format according to outMode
-        if ((! isCampaignMailing ()) &amp;&amp;
-            (! isRuleMailing ()) &amp;&amp;
-           (! isOnDemandMailing ()) &amp;&amp;
-            (! isWorldMailing ()))
-            switch (outMode) {
-            case OUT_META:
-                metaMode = OUT_META_XML;
-                break;
-            default:
-                outMode = OUT_META;
-                metaMode = OUT_META_XML;
-                break;
-            }
-
         long    now = System.currentTimeMillis () / 1000;
         if (sendtimestamp != null)
             sendSeconds = sendtimestamp.getTime () / 1000;
@@ -867,16 +744,12 @@ public class Data {
             ++cnt;
             msg += &quot;\tlinelength is less than zero\n&quot;;
         }
-        if (totalSubscribers &lt;= 0) {
-//          ++cnt;
-            msg += &quot;\ttotal number of subscribers is less than 1 (&quot; + totalSubscribers + &quot;)\n&quot;;
-        }
         if (cnt &gt; 0) {
             logging (Log.ERROR, &quot;init&quot;, &quot;Error configuration report:\n&quot; + msg);
             throw new Exception (msg);
         }
         if (msg.length () &gt; 0)
-            logging (Log.WARNING, &quot;init&quot;, &quot;Configuration report:\n&quot; + msg);
+            logging (Log.INFO, &quot;init&quot;, &quot;Configuration report:\n&quot; + msg);
     }
 
     /** Setup logging interface
@@ -908,8 +781,6 @@ public class Data {
         logging (Log.DEBUG, &quot;init&quot;, &quot;\txmlValidate = &quot; + xmlValidate);
         logging (Log.DEBUG, &quot;init&quot;, &quot;\tsampleEmails = &quot; + sampleEmails);
         logging (Log.DEBUG, &quot;init&quot;, &quot;\tmailLogNumber = &quot; + mailLogNumber);
-        logging (Log.DEBUG, &quot;init&quot;, &quot;\tstartMessage = &quot; + startMessage);
-        logging (Log.DEBUG, &quot;init&quot;, &quot;\tendMessage = &quot; + endMessage);
         logging (Log.DEBUG, &quot;init&quot;, &quot;\taccLogfile = &quot; + accLogfile);
         logging (Log.DEBUG, &quot;init&quot;, &quot;\tdefaultUserStatus = &quot; + defaultUserStatus);
         logging (Log.DEBUG, &quot;init&quot;, &quot;\tdbase = &quot; + dbase);
@@ -953,7 +824,7 @@ public class Data {
         logging (Log.DEBUG, &quot;init&quot;, &quot;\tonepixlog = &quot; + onepixlog);
         logging (Log.DEBUG, &quot;init&quot;, &quot;\tpassword = &quot; + password);
         logging (Log.DEBUG, &quot;init&quot;, &quot;\trdirDomain = &quot; + rdirDomain);
-        logging (Log.DEBUG, &quot;init&quot;, &quot;\ttotalSubscribers = &quot; + totalSubscribers);
+//      logging (Log.DEBUG, &quot;init&quot;, &quot;\ttotalSubscribers = &quot; + totalSubscribers);
     }
 
     /*
@@ -996,8 +867,6 @@ public class Data {
         }
         mailer = cfg.cget (&quot;MAILER&quot;, mailer);
         mailLogNumber = cfg.cget (&quot;MAIL_LOG_NUMBER&quot;, mailLogNumber);
-        startMessage = cfg.cget (&quot;START_MESSAGE&quot;, startMessage);
-        endMessage = cfg.cget (&quot;END_MESSAGE&quot;, endMessage);
         accLogfile = cfg.cget (&quot;ACCOUNT_LOGFILE&quot;, accLogfile);
     }
 
@@ -1042,48 +911,11 @@ public class Data {
 
         int n;
 
-        logging (Log.DEBUG, &quot;init&quot;, &quot;Data read from &quot; + cfg.getSource () + &quot; for &quot; + status_id + &quot;:&quot; + (option == null ? &quot;default&quot; : option));
-        outMode = DEFAULT_OUT_MODE;
-        if ((n = option.indexOf (':')) != -1) {
-            String  omode;
-
-            omode = option.substring (0, n);
-            option = option.substring (n + 1);
-            outMode = -1;
-            for (n = 0; n &lt; OUT_MODES.length; ++n)
-                if (omode.equals (OUT_MODES[n])) {
-                    outMode = n;
-                    break;
-                }
-            if (outMode == -1) {
-                logging (Log.ERROR, &quot;init&quot;, &quot;Unknown output mode &quot; + omode);
-                throw new Exception (&quot;Unknown output mode &quot; + omode + &quot; specified&quot;);
-            }
-            logging (Log.DEBUG, &quot;init&quot;, &quot;Using output mode &quot; + outModeDescription ());
-        }
-        metaMode = -1;
-        switch (outMode) {
-        case OUT_META:
-            for (n = 0; n &lt; META_MODES.length; ++n)
-                if (option.equals (META_MODES[n])) {
-                    metaMode = n;
-                    break;
-                }
-            if (metaMode == -1) {
-                logging (Log.ERROR, &quot;init&quot;, &quot;Unknown meta output type &quot; + option);
-                throw new Exception (&quot;Unknwon metaoutput option type &quot; + option + &quot; specified&quot;);
-            }
-            logging (Log.DEBUG, &quot;init&quot;, &quot;Using meta output mode &quot; + metaModeDescription ());
-            break;
-        default:
-            logging (Log.ERROR, &quot;init&quot;, &quot;Unknown output mode &quot; + outMode);
-            throw new Exception (&quot;Unkown output Mode &quot; + outMode + &quot; found&quot;);
-        }
+        logging (Log.DEBUG, &quot;init&quot;, &quot;Data read from &quot; + cfg.getSource () + &quot; for &quot; + status_id);
         setupDatabase (conn);
         logging (Log.DEBUG, &quot;init&quot;, &quot;Initial database connection established&quot;);
         try {
             queryMailingInformations (status_id);
-            setupMailingStatus ();
         } catch (Exception e) {
             throw new Exception (&quot;Database failure: &quot; + e);
         }
@@ -1118,7 +950,7 @@ public class Data {
 //        if ((conn != null) &amp;&amp; (dbase != null))
 //            dbase.done ();
 
-        if (isCampaignMailing ())
+        if (isCampaignMailing () || isPreviewMailing ())
             closeDatabase ();
     }
 
@@ -1130,7 +962,7 @@ public class Data {
 //        if ((conn != null) &amp;&amp; (dbase != null))
 //            dbase.setConnection (conn);
 
-        if (isCampaignMailing ())
+        if (isCampaignMailing () || isPreviewMailing ())
             if (dbase == null) {
                 setupDatabase (conn);
             }
@@ -1145,18 +977,9 @@ public class Data {
 
         cnt = 0;
         msg = &quot;&quot;;
-        if (setMailingStatus &amp;&amp; writeEndMessage) {
-            logging (Log.DEBUG, &quot;deinit&quot;, &quot;Writing final report&quot;);
-            try {
-                String  emsg = endMessage;
-
-                if ((extraEndMessage != null) &amp;&amp; (extraEndMessage.length () &gt; 0))
-                    emsg += &quot; &quot; + extraEndMessage;
-                changeMailingStatus (emsg);
-            } catch (Exception e) {
-                ++cnt;
-                msg += &quot;\tFailed in final report: &quot; + e + &quot;\n&quot;;
-            }
+        if (bigClause != null) {
+            bigClause.done ();
+            bigClause = null;
         }
         if (dbase != null) {
             logging (Log.DEBUG, &quot;deinit&quot;, &quot;Shuting down database connection&quot;);
@@ -1194,29 +1017,43 @@ public class Data {
      * mailing
      */
     public void sanityCheck () throws Exception {
-        ResultSet   rset;
+        if (! isPreviewMailing ()) {
+            ResultSet   rset;
 
-        try {
-            long    cid, del;
+            try {
+                long    cid, del;
 
-            rset = dbase.simpleQuery (&quot;SELECT company_id, deleted FROM mailing_tbl WHERE mailing_id = &quot; + mailing_id);
-            cid = rset.getLong (1);
-            del = rset.getLong (2);
-            rset.close ();
-            if (cid != company_id)
-                throw new Exception (&quot;Original companyID &quot; + company_id + &quot; for mailing &quot; + mailing_id + &quot; does not match current company_id &quot; + cid);
-            if (del != 0) {
-                dbase.execUpdate (&quot;UPDATE maildrop_status_tbl SET genchange = &quot; + dbase.sysdate + &quot;, genstatus = 4 &quot; +
-                          &quot;WHERE status_id = &quot; + maildrop_status_id);
-                throw new Exception (&quot;Mailing &quot; + mailing_id + &quot; marked as deleted&quot;);
+                rset = dbase.simpleQuery (&quot;SELECT company_id, deleted FROM mailing_tbl WHERE mailing_id = &quot; + mailing_id);
+                cid = rset.getLong (1);
+                del = rset.getLong (2);
+                rset.close ();
+                if (cid != company_id)
+                    throw new Exception (&quot;Original companyID &quot; + company_id + &quot; for mailing &quot; + mailing_id + &quot; does not match current company_id &quot; + cid);
+                if (del != 0) {
+                    dbase.execUpdate (&quot;UPDATE maildrop_status_tbl SET genchange = &quot; + dbase.sysdate + &quot;, genstatus = 4 &quot; +
+                              &quot;WHERE status_id = &quot; + maildrop_status_id);
+                    throw new Exception (&quot;Mailing &quot; + mailing_id + &quot; marked as deleted&quot;);
+                }
+            } catch (Exception e) {
+                logging (Log.ERROR, &quot;sanity&quot;, &quot;Error in quering mailing_tbl: &quot; + e);
+                throw new Exception (&quot;Unable to find entry in mailing_tbl for &quot; + mailing_id + &quot;: &quot; + e);
             }
-        } catch (Exception e) {
-            logging (Log.ERROR, &quot;sanity&quot;, &quot;Error in quering mailing_tbl: &quot; + e);
-            throw new Exception (&quot;Unable to find entry in mailing_tbl for &quot; + mailing_id + &quot;: &quot; + e);
         }
     }
 
     /**
+     * Executed at start of mail generation
+     */
+    public void startExecution () throws Exception {
+        bigClause = (BC) mkBigClause ();
+        bigClause.setData (this);
+        if (! bigClause.prepareClause ()) {
+            throw new Exception (&quot;Failed to setup main clause&quot;);
+        }
+        totalSubscribers = bigClause.subscriber ();
+    }
+    
+    /**
      * Change generation state for the current mailing
      */
     public void updateGenerationState () {
@@ -1238,7 +1075,28 @@ public class Data {
             }
         }
     }
-
+    
+    /**
+     * Called when main generation starts
+     */
+    public Vector generationClauses () {
+        return bigClause.createClauses ();
+    }
+    
+    /**
+     * Save receivers to mailtracking table
+     */
+    public void toMailtrack () {
+        if (mailtracking_table != null) {
+            String  query = bigClause.mailtrackStatement (mailtracking_table);
+            try {
+                dbase.execUpdate (query);
+            } catch (Exception e) {
+                logging (Log.ERROR, &quot;execute&quot;, &quot;Unable to add mailtrack information using \&quot;&quot; + query + &quot;\&quot;: &quot; + e.toString ());
+            }
+        }
+    }
+    
     /**
      * Convert a given object to an integer
      * @param o the input object
@@ -1328,6 +1186,10 @@ public class Data {
             tmp = opts.get (&quot;user-status&quot;);
             if (tmp != null)
                 campaignUserStatus = obj2int (tmp, &quot;user-status&quot;);
+            tmp = opts.get (&quot;preview-for&quot;);
+            if (tmp != null)
+                previewCustomerID = obj2long (tmp, &quot;preview-for&quot;);
+            previewOutput = (Hashtable) opts.get (&quot;preview-output&quot;);
             tmp = opts.get (&quot;send-date&quot;);
             if (tmp != null) {
                 currentSendDate = obj2date (tmp, &quot;send-date&quot;);
@@ -1450,41 +1312,6 @@ public class Data {
     }
 
     /**
-     * Write a mailing status to the database, open the database
-     * temp., if not yet opened
-     * @param msg the new mailing status
-     */
-    public void report (String msg) throws Exception {
-        logging (Log.DEBUG, &quot;data&quot;, &quot;Write report: &quot; + msg);
-        try {
-            boolean tempOpened;
-
-            if (dbase == null) {
-                setupDatabase (null);
-                setMailingStatus = true;
-                tempOpened = true;
-            } else
-                tempOpened = false;
-            if (dbase != null) {
-                changeMailingStatus (msg);
-                writeEndMessage = false;
-                if (tempOpened == true)
-                    closeDatabase ();
-            }
-        } catch (Exception e) {
-            throw new Exception (&quot;Unable to report to MailingStatus: &quot; + e);
-        }
-    }
-
-    /**
-     * Write an error as mailing status
-     * @param msg the error message
-     */
-    public void error (String msg) throws Exception {
-        report (&quot;Error: &quot; + msg);
-    }
-
-    /**
      * Check for existance of a database table
      * @param table the table name
      * @return true, if the table exists
@@ -1649,20 +1476,6 @@ public class Data {
         return mailer;
     }
 
-    /** returns textual representation of output mode
-     * @return output mode as string
-     */
-    public String outModeDescription () {
-        return ((outMode &gt;= 0) &amp;&amp; (outMode &lt; OUT_MODES.length)) ? OUT_MODES[outMode] : null;
-    }
-
-    /** returns textual representation of meta file format
-     * @return file format as string
-     */
-    public String metaModeDescription () {
-        return ((metaMode &gt;= 0) &amp;&amp; (metaMode &lt; META_MODES.length)) ? META_MODES[metaMode] : null;
-    }
-
     /** if this is a admin mail
      * @return true, if admin mail
      */
@@ -1708,16 +1521,11 @@ public class Data {
         return status_field.equals (&quot;W&quot;);
     }
 
-    /**
-     * Add a message to the mailing status end message
-     * @param msg the message to add
+    /** if this is a preview
+     * @return true, if preview
      */
-    public void addToEndMessage (String msg) {
-        if ((msg != null) &amp;&amp; (msg.length () &gt; 0))
-            if (extraEndMessage != null)
-                extraEndMessage += &quot; &quot; + msg;
-            else
-                extraEndMessage = msg;
+    public boolean isPreviewMailing () {
+        return status_field.equals (&quot;P&quot;);
     }
 
     /**
@@ -1768,7 +1576,7 @@ public class Data {
         if (sanity != lusecount)
             logging (Log.ERROR, &quot;layout&quot;, &quot;Sanity check failed in setUsedFieldsInLayout&quot;);
     }
-    
+
     /** find a column by its alias
      * @param alias
      * @return the column on success, null otherwise
@@ -1776,13 +1584,13 @@ public class Data {
     public Column columnByAlias (String alias) {
         for (int n = 0; n &lt; lcount; ++n) {
             Column  c = (Column) layout.elementAt (n);
-            
+
             if ((c.alias != null) &amp;&amp; c.alias.equalsIgnoreCase (alias))
                 return c;
         }
         return null;
     }
-    
+
     /** find a column by its name
      * @param name
      * @return the column on success, null otherwise
@@ -1790,7 +1598,7 @@ public class Data {
     public Column columnByName (String name) {
         for (int n = 0; n &lt; lcount; ++n) {
             Column  c = (Column) layout.elementAt (n);
-            
+
             if (c.name.equalsIgnoreCase (name))
                 return c;
         }
@@ -1854,24 +1662,6 @@ public class Data {
         return ((Column) layout.elementAt (col)).inUse ();
     }
 
-    /** get the default output option
-     * @return the option string
-     */
-    public static String defaultOption () {
-        String  opt;
-
-        opt = OUT_MODES[DEFAULT_OUT_MODE] + &quot;:&quot;;
-        switch (DEFAULT_OUT_MODE) {
-        case OUT_META:
-            opt += META_MODES[DEFAULT_META_MODE];
-            break;
-        default:
-            opt += &quot;???&quot;;
-            break;
-        }
-        return opt;
-    }
-
     /** create a RFC compatible Date: line
      * @param ts the input time
      * @return the RFC representation</diff>
      <filename>src/java/org/agnitas/backend/Data.java</filename>
    </modified>
    <modified>
      <diff>@@ -592,57 +592,7 @@ public class EMMTag implements Sub.CB {
             }
             break;
         case TI_SUBSCRIBERCOUNT:
-            {
-                long    cnt = data.totalSubscribers;
-                String  format = null;
-                String  str;
-
-                if (((format = (String) mTagParameters.get (&quot;format&quot;)) == null) &amp;&amp;
-                    ((str = (String) mTagParameters.get (&quot;type&quot;)) != null)) {
-                    str = str.toLowerCase ();
-                    if (str.equals (&quot;us&quot;))
-                        format = &quot;#,###,###&quot;;
-                    else if (str.equals (&quot;de&quot;))
-                        format = &quot;#.###.###&quot;;
-                }
-                if ((str = (String) mTagParameters.get (&quot;round&quot;)) != null) {
-                    try {
-                        int round = Integer.parseInt (str);
-
-                        if (round &gt; 0)
-                            cnt = (cnt + round - 1) / round;
-                    } catch (NumberFormatException e) {
-                        ;
-                    }
-                }
-                if (format != null) {
-                    int len = format.length ();
-                    boolean first = true;
-                    int last = -1;
-                    mTagValue = &quot;&quot;;
-
-                    for (int n = len - 1; n &gt;= 0; --n)
-                        if (format.charAt (n) == '#')
-                            last = n;
-                    for (int n = len - 1; n &gt;= 0; --n)
-                        if (format.charAt (n) == '#') {
-                            if (first || (cnt != 0)) {
-                                if (n == last) {
-                                    str = Long.toString (cnt);
-                                    cnt = 0;
-                                } else {
-                                    str = Long.toString (cnt % 10);
-                                    cnt /= 10;
-                                }
-                                mTagValue = str + mTagValue;
-                                first = false;
-                            }
-                        } else if ((n &lt; last) || (cnt != 0))
-                            mTagValue = format.substring (n, n + 1) + mTagValue;
-                } else
-                    mTagValue = Long.toString (cnt);
-            }
-            fixedValue = true;
+            globalValue = true;
             break;
         case TI_DATE:
             {
@@ -794,7 +744,58 @@ public class EMMTag implements Sub.CB {
             break;
         case TI_MESSAGEID:      // is set before in MailWriter.writeMail()
         case TI_UID:            // is set before in MailWriter.writeMail()
-        case TI_SUBSCRIBERCOUNT:    // is set here in initializeInternalTag () from check_tags
+            break;
+        case TI_SUBSCRIBERCOUNT:
+            {
+                long    cnt = data.totalSubscribers;
+                String  format = null;
+                String  str;
+
+                if (((format = (String) mTagParameters.get (&quot;format&quot;)) == null) &amp;&amp;
+                    ((str = (String) mTagParameters.get (&quot;type&quot;)) != null)) {
+                    str = str.toLowerCase ();
+                    if (str.equals (&quot;us&quot;))
+                        format = &quot;#,###,###&quot;;
+                    else if (str.equals (&quot;de&quot;))
+                        format = &quot;#.###.###&quot;;
+                }
+                if ((str = (String) mTagParameters.get (&quot;round&quot;)) != null) {
+                    try {
+                        int round = Integer.parseInt (str);
+
+                        if (round &gt; 0)
+                            cnt = (cnt + round - 1) / round;
+                    } catch (NumberFormatException e) {
+                        ;
+                    }
+                }
+                if (format != null) {
+                    int len = format.length ();
+                    boolean first = true;
+                    int last = -1;
+                    mTagValue = &quot;&quot;;
+
+                    for (int n = len - 1; n &gt;= 0; --n)
+                        if (format.charAt (n) == '#')
+                            last = n;
+                    for (int n = len - 1; n &gt;= 0; --n)
+                        if (format.charAt (n) == '#') {
+                            if (first || (cnt != 0)) {
+                                if (n == last) {
+                                    str = Long.toString (cnt);
+                                    cnt = 0;
+                                } else {
+                                    str = Long.toString (cnt % 10);
+                                    cnt /= 10;
+                                }
+                                mTagValue = str + mTagValue;
+                                first = false;
+                            }
+                        } else if ((n &lt; last) || (cnt != 0))
+                            mTagValue = format.substring (n, n + 1) + mTagValue;
+                } else
+                    mTagValue = Long.toString (cnt);
+            }
             break;
         case TI_DATE:           // is prepared here in initializeInternalTag () from check_tags
             mTagValue = dateFormat.format (data.currentSendDate);</diff>
      <filename>src/java/org/agnitas/backend/EMMTag.java</filename>
    </modified>
    <modified>
      <diff>@@ -195,7 +195,7 @@ abstract public class MailWriter {
         
         if (data.isCampaignMailing ())
             unique = Long.toString (data.pass) + &quot;C&quot; + StringOps.format_number (Long.toString(data.campaignTransactionID &gt; 0 ? data.campaignTransactionID : data.campaignCustomerID), 8);
-        else if (data.isAdminMailing () || data.isTestMailing ())
+        else if (data.isAdminMailing () || data.isTestMailing () || data.isPreviewMailing ())
             unique = getUniqueNr (timestamp);
         else
             unique = StringOps.format_number (Long.toString (blockCount), 3);</diff>
      <filename>src/java/org/agnitas/backend/MailWriter.java</filename>
    </modified>
    <modified>
      <diff>@@ -10,14 +10,14 @@
  * Software distributed under the License is distributed on an &quot;AS IS&quot; basis,
  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
  * the specific language governing rights and limitations under the License.
- * 
+ *
  * The Original Code is OpenEMM.
  * The Original Developer is the Initial Developer.
  * The Initial Developer of the Original Code is AGNITAS AG. All portions of
  * the code written by AGNITAS AG are Copyright (c) 2007 AGNITAS AG. All Rights
  * Reserved.
- * 
- * Contributor(s): AGNITAS AG. 
+ *
+ * Contributor(s): AGNITAS AG.
  ********************************************************************************/
 package org.agnitas.backend;
 
@@ -31,7 +31,13 @@ import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Vector;
 import java.util.zip.GZIPOutputStream;
-
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+import org.w3c.dom.NamedNodeMap;
 import org.agnitas.util.Log;
 
 /** Implements writing of mailing information to
@@ -189,10 +195,10 @@ public class MailWriterMeta extends MailWriter {
      * @param output detailed output description
      * @param filename pathname to the XML file
      */
-    private void startXMLBack (String output, String filename) throws Exception {
+    private void startXMLBack (String options, String output, String filename) throws Exception {
         File    efile = File.createTempFile (&quot;error&quot;, null);
         String  eol = data.eol.equals (&quot;\n&quot;) ? &quot;l&quot; : &quot;&quot;;
-        String  cmd = data.xmlBack () + &quot; -vq&quot; + eol + &quot; -E &quot; + efile.getAbsolutePath () + &quot; -o &quot; + output + &quot; &quot; + filename;
+        String  cmd = data.xmlBack () + (options == null ? &quot;&quot; : &quot; &quot; + options) + &quot; -vq&quot; + eol + &quot; -E &quot; + efile.getAbsolutePath () + &quot; -o &quot; + output + &quot; &quot; + filename;
         int rc;
 
         data.markToRemove (efile);
@@ -249,7 +255,7 @@ public class MailWriterMeta extends MailWriter {
         pathname = null;
         out = null;
         buf = new StringBuffer ();
-        if (data.isAdminMailing () || data.isTestMailing () || data.isCampaignMailing ())
+        if (data.isAdminMailing () || data.isTestMailing () || data.isCampaignMailing () || data.isPreviewMailing ())
             blockSize = 0;
         else
             blockSize = data.blockSize ();
@@ -264,6 +270,9 @@ public class MailWriterMeta extends MailWriter {
     public String generateOptions () {
         return &quot;generate:temporary=true;syslog=false;account-logfile=&quot; + data.accLogfile () + &quot;;media=email;path=&quot; + data.mailDir ();
     }
+    public String previewOptions (String output) {
+        return &quot;preview:path=&quot; + output;
+    }
 
     /** Cleanup
      */
@@ -277,13 +286,58 @@ public class MailWriterMeta extends MailWriter {
 
                 String  gen = generateOptions ();
 
-                startXMLBack (gen, pathname);
+                startXMLBack (null, gen, pathname);
                 if (! keepATmails) {
                     if ((new File (pathname)).delete ()) {
                         data.unmarkToRemove (pathname);
                     }
                 }
             }
+        } else if (data.isPreviewMailing ()) {
+            if (pathname != null) {
+                File    output = File.createTempFile (&quot;preview&quot;, &quot;.xml&quot;);
+                String  path = output.getAbsolutePath ();
+                String  opts = previewOptions (path);
+                String  error = null;
+
+                data.markToRemove (pathname);
+                data.markToRemove (path);
+                try {
+                    startXMLBack (&quot;-r&quot;, opts, pathname);
+                } catch (Exception e) {
+                    error = e.toString ();
+                }
+                if (data.previewOutput != null) {
+                    try {
+                        DocumentBuilderFactory
+                                docBuilderFactory = DocumentBuilderFactory.newInstance ();
+                        DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder ();
+                        Document    doc = docBuilder.parse (output);
+                        Element     root = doc.getDocumentElement ();
+                        NodeList    nlist = root.getElementsByTagName (&quot;content&quot;);
+                        int     ncount = nlist.getLength ();
+                        
+                        for (int n = 0; n &lt; ncount; ++n) {
+                            Node        node = nlist.item (n);
+                            NamedNodeMap    attr = node.getAttributes ();
+                            Node        name = attr.getNamedItem (&quot;name&quot;);
+                        
+                            if (name != null) {
+                                Node    text = node.getFirstChild ();
+                            
+                                data.previewOutput.put (name.getNodeValue (), (text == null ? &quot;&quot; : text.getNodeValue ()));
+                            }
+                        }
+                    } catch (Exception e) {
+                        if (error != null)
+                            error += &quot;\n&quot; + e.toString ();
+                        else
+                            error = e.toString ();
+                    }
+                    if (error != null)
+                        data.previewOutput.put (&quot;__error__&quot;, error);
+                }
+            }
         } else if (fname != null)
             try {
                 FileOutputStream    temp;
@@ -466,17 +520,12 @@ public class MailWriterMeta extends MailWriter {
     public void startBlock () throws Exception {
         super.startBlock ();
         fname = data.metaDir () + dirSeparator + filenamePattern;
-        switch (data.metaMode) {
-        case Data.OUT_META_XML:
+        if (data.isAdminMailing () || data.isTestMailing ()) {
             pathname = fname + &quot;.xml&quot;;
             out = new FileOutputStream (pathname);
-            break;
-        case Data.OUT_META_XMLGZ:
+        } else {
             pathname = fname + &quot;.xml.gz&quot;;
             out = new GZIPOutputStream (new FileOutputStream (pathname));
-            break;
-        default:
-            throw new Exception (&quot;Unknown output mode &quot; + data.metaMode + &quot; specified&quot;);
         }
         buf.append (&quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;\n&quot; +
                 &quot;&lt;!DOCTYPE blockmail SYSTEM \&quot;blockmail.dtd\&quot;&gt;\n&quot;);
@@ -881,12 +930,12 @@ public class MailWriterMeta extends MailWriter {
 
             if (data.xmlValidate ()) {
                 data.logging (Log.INFO, &quot;writer/meta&quot;, &quot;Validating XML output&quot;);
-                startXMLBack (&quot;none&quot;, pathname);
+                startXMLBack (null, &quot;none&quot;, pathname);
                 data.logging (Log.INFO, &quot;writer/meta&quot;, &quot;Validation done&quot;);
             } else
                 data.logging (Log.INFO, &quot;writer/meta&quot;, &quot;Skip validation of XML document&quot;);
 
-            if (! (data.isAdminMailing () || data.isTestMailing ()))
+            if (! (data.isAdminMailing () || data.isTestMailing () || data.isPreviewMailing ()))
                 try {
                     FileOutputStream    temp;
                     String          msg;</diff>
      <filename>src/java/org/agnitas/backend/MailWriterMeta.java</filename>
    </modified>
    <modified>
      <diff>@@ -46,13 +46,6 @@ public interface Mailgun {
     void initializeMailgun (String status_id, Connection conn) throws Exception;
 
     /**
-     * Change report in database
-     * 
-     * @param msg the new message in the DB report
-     */
-    void dbReport(String msg) throws Exception;
-
-    /**
      * Execute an already setup mailgun
      * 
      * @param conn optional open database connection</diff>
      <filename>src/java/org/agnitas/backend/Mailgun.java</filename>
    </modified>
    <modified>
      <diff>@@ -38,7 +38,7 @@ import org.agnitas.util.Log;
  */
 public class MailgunImpl implements Mailgun {
     /** the status id for the maildrop_status_tbl */
-    public int statusID;
+//    public long statusID;
     /** Reference to configuration */
     private Data data;
     /** All content blocks */
@@ -58,7 +58,7 @@ public class MailgunImpl implements Mailgun {
      * must be followed by initializeMailung ()
      */
     public MailgunImpl () {
-        statusID = -1;
+//        statusID = -1;
         data = null;
     }
 
@@ -83,7 +83,6 @@ public class MailgunImpl implements Mailgun {
      * @param conn optional open database connection
      */
     public void initializeMailgun (String status_id, Connection conn) throws Exception {
-        statusID = Integer.parseInt (status_id);
         data = null;
         try {
             mkData (status_id, conn);
@@ -91,6 +90,7 @@ public class MailgunImpl implements Mailgun {
             done ();
             throw new Exception (&quot;Error reading ini file: &quot; + e);
         }
+//        statusID = data.maildrop_status_id;
         data.suspend (conn);
     }
 
@@ -144,18 +144,6 @@ public class MailgunImpl implements Mailgun {
         }
     }
 
-    /** Change report in database
-     * @param msg the new message in the DB report
-     */
-    public void dbReport (String msg) throws Exception {
-        if (data != null)
-            try {
-                data.report (msg);
-            } catch (Exception e) {
-                throw new Exception (e.toString ());
-            }
-    }
-
     /** Retreive blacklist from database
      */
     public void retreiveBlacklist () throws Exception {
@@ -176,15 +164,17 @@ public class MailgunImpl implements Mailgun {
      */
     private void readBlacklist () throws Exception {
         blist = new Blacklist ();
-        try {
-            retreiveBlacklist ();
-        } catch (Exception e) {
-            data.logging (Log.FATAL, &quot;readblist&quot;, &quot;Unable to get blacklist: &quot; + e.toString ());
-            throw new Exception (&quot;Unable to get blacklist: &quot; + e.toString ());
-        }
+        if (! data.isPreviewMailing ()) {
+            try {
+                retreiveBlacklist ();
+            } catch (Exception e) {
+                data.logging (Log.FATAL, &quot;readblist&quot;, &quot;Unable to get blacklist: &quot; + e.toString ());
+                throw new Exception (&quot;Unable to get blacklist: &quot; + e.toString ());
+            }
 
-        data.logging (Log.INFO, &quot;readblist&quot;, &quot;Found &quot; + blist.globalCount () + &quot; entr&quot; + Log.exty (blist.globalCount ()) + &quot; in global blacklist, &quot; +
-                                      blist.localCount () + &quot; entr&quot; + Log.exty (blist.localCount ()) + &quot; in local blacklist&quot;);
+            data.logging (Log.INFO, &quot;readblist&quot;, &quot;Found &quot; + blist.globalCount () + &quot; entr&quot; + Log.exty (blist.globalCount ()) + &quot; in global blacklist, &quot; +
+                                          blist.localCount () + &quot; entr&quot; + Log.exty (blist.localCount ()) + &quot; in local blacklist&quot;);
+        }
     }
 
     /** Check the sample email receiver if they should receive
@@ -314,30 +304,7 @@ public class MailgunImpl implements Mailgun {
     /** Write final data to database
      */
     public void finalizeMailingToDatabase (MailWriter mailer) throws Exception {
-        String  table = &quot;mailing_creation_tbl&quot;;
-        String  query;
-
-        if (data.tableExists (table)) {
-            query = &quot;INSERT INTO &quot; + table +
-                &quot; (mailing_id, company_id, status_field, block_count, block_size, start_time, end_time) VALUES (&quot; +
-                data.mailing_id + &quot;, &quot; + data.company_id + &quot;, '&quot; + data.status_field + &quot;', &quot; + mailer.blockCount + &quot;, &quot; + mailer.blockSize + &quot;, &quot; +
-                StringOps.sqlDate (mailer.startExecutionTime) + &quot;, &quot; + StringOps.sqlDate (mailer.endExecutionTime) + &quot;)&quot;;
-            try {
-                data.dbase.execUpdate (query);
-            } catch (Exception e) {
-                data.logging (Log.ERROR, &quot;execute&quot;, &quot;Unable to add mailcreation information using \&quot;&quot; + query + &quot;\&quot;: &quot; + e.toString ());
-            }
-        }
-        query = &quot;INSERT INTO &quot; + data.mailtracking_table +
-            &quot; (company_id, status_id, mailing_id, customer_id)&quot; +
-            &quot; SELECT &quot; + data.company_id + &quot;, &quot; + data.maildrop_status_id + &quot;, &quot; + data.mailing_id + &quot;, cust.customer_id &quot; +
-            getFromclause () + &quot; WHERE &quot; +
-            getWhereclause (true);
-        try {
-            data.dbase.execUpdate (query);
-        } catch (Exception e) {
-            data.logging (Log.ERROR, &quot;execute&quot;, &quot;Unable to add mailtrack information using \&quot;&quot; + query + &quot;\&quot;: &quot; + e.toString ());
-        }
+        data.toMailtrack ();
     }
 
     /** Execute a prepared mailgun
@@ -348,10 +315,10 @@ public class MailgunImpl implements Mailgun {
         data.resume (conn);
         data.options (opts, 2);
         data.sanityCheck ();
-
         data.pass++;
 
         // get constructed selectvalue based on tag names in Hashtable
+        data.startExecution ();
         selectQuery = getSelectvalue (tagNames, allBlocks, false);
         wSelectQuery = getSelectvalue (tagNames, allBlocks, true);
 
@@ -365,7 +332,6 @@ public class MailgunImpl implements Mailgun {
                 rset.close ();
                 if (count &gt; 0) {
                     data.logging (Log.FATAL, &quot;mailgun&quot;, &quot;Pure textmailing: &quot; + count + &quot; receiver has invalid mailtype (!= 0)&quot;);
-                    dbReport (&quot;Pure textmailing violation&quot;);
                     throw new Exception (&quot;Mailtype check failed for &quot; + count + &quot; customer&quot; + Log.exts (count));
                 }
             } catch (Exception e) {
@@ -374,17 +340,7 @@ public class MailgunImpl implements Mailgun {
             data.logging (Log.DEBUG, &quot;execute&quot;, &quot;No invalid mailtype detected&quot;);
         }
 
-        // instantiate new MailWriter. This creates filenames, boundaries and
-        // message ids
-        MailWriter mailer;
-
-        switch (data.outMode) {
-        case Data.OUT_META:
-            mailer = (MailWriter) mkMailWriterMeta (data, allBlocks, tagNames);
-            break;
-        default:
-            throw new Exception (&quot;Output mode &quot; + data.outModeDescription () + &quot; not supported&quot;);
-        }
+        MailWriter  mailer = (MailWriter) mkMailWriterMeta (data, allBlocks, tagNames);
 
         int columnCount = 0;
         Vector  email_tags = new Vector ();
@@ -420,29 +376,16 @@ public class MailgunImpl implements Mailgun {
         try {
             data.logging (Log.INFO, &quot;execute&quot;, &quot;Start creation of mails&quot;);
 
-            boolean needSamples = data.isWorldMailing () &amp;&amp; (data.sampleEmails () != null) &amp;&amp; ((data.availableMedias &amp; (1 &lt;&lt; Media.TYPE_EMAIL)) != 0);
-
-            HashSet seen = prepareCollection ();
+            boolean     needSamples = data.isWorldMailing () &amp;&amp; (data.sampleEmails () != null) &amp;&amp; ((data.availableMedias &amp; (1 &lt;&lt; Media.TYPE_EMAIL)) != 0);
+            Vector      clist = data.generationClauses ();
+            HashSet     seen = prepareCollection ();
 
-            for (int state = 0; state &lt; 2; ++state) {
-                String  query;
-
-                if (data.isWorldMailing ()) {
-                    if (state == 0) {
-                        query = selectQuery + &quot; AND bind.user_type IN ('A', 'T')&quot;;
-                    } else {
-                        query = wSelectQuery + &quot; AND bind.user_type = 'W'&quot;;
-                    }
-                } else {
-                    if (state == 0) {
-                        query = selectQuery;
-                    } else {
-                        query = null;
-                    }
-                }
-                if (query == null)
+            for (int state = 0; state &lt; clist.size (); ++state) {
+                String  clause = (String) clist.get (state);
+                if (clause == null)
                     continue;
-                query += &quot;)&quot; + getAdditionalClause (state + 1) + &quot;)&quot; + getOrder (state + 1);
+                
+                String  query = (state == 0 ? selectQuery : wSelectQuery) + &quot; &quot; + clause;
 
                 if ((mailer.blockSize &gt; 0) &amp;&amp; (mailer.inBlockCount &gt; 0))
                     mailer.checkBlock (true);
@@ -575,31 +518,33 @@ public class MailgunImpl implements Mailgun {
                         etag.mTagValue = cinfo.email;
                     }
 
-                    boolean     isblisted = false;
+                    if (! data.isPreviewMailing ()) {
+                        boolean     isblisted = false;
 
-                    for (int blstate = 0; blstate &lt; cinfo.checkForBlacklist; ++blstate) {
-                        String  check = cinfo.blacklistValue (blstate);
-                        String  what = cinfo.blacklistName (blstate);
+                        for (int blstate = 0; blstate &lt; cinfo.checkForBlacklist; ++blstate) {
+                            String  check = cinfo.blacklistValue (blstate);
+                            String  what = cinfo.blacklistName (blstate);
 
-                        if (check == null)
-                            continue;
+                            if (check == null)
+                                continue;
 
-                        Blackdata   bl = blist.isBlackListed (check);
-                        if (bl != null) {
-                            String  where;
+                            Blackdata   bl = blist.isBlackListed (check);
+                            if (bl != null) {
+                                String  where;
 
-                            if (bl.isGlobal ()) {
-                                where = &quot;global&quot;;
-                            } else {
-                                where = &quot;local&quot;;
+                                if (bl.isGlobal ()) {
+                                    where = &quot;global&quot;;
+                                } else {
+                                    where = &quot;local&quot;;
+                                }
+                                data.logging (Log.WARNING, &quot;mailgun&quot;, &quot;Found &quot; + what + &quot;: &quot; + check + &quot; (&quot; + cid + &quot;) in &quot; + where + &quot; blacklist, ignored&quot;);
+                                blist.writeBounce (data.mailing_id, cid);
+                                isblisted = true;
                             }
-                            data.logging (Log.WARNING, &quot;mailgun&quot;, &quot;Found &quot; + what + &quot;: &quot; + check + &quot; (&quot; + cid + &quot;) in &quot; + where + &quot; blacklist, ignored&quot;);
-                            blist.writeBounce (data.mailing_id, cid);
-                            isblisted = true;
                         }
+                        if (isblisted)
+                            continue;
                     }
-                    if (isblisted)
-                        continue;
 
                     String  mediatypes = getMediaTypes (cid);
                     if (mediatypes == null)
@@ -640,9 +585,10 @@ public class MailgunImpl implements Mailgun {
             throw new Exception(&quot;Error during main query or mail generation:&quot; + e);
         }
 
-        // do reporting and finalizing -- not to be omitted
         mailer.done ();
-        finalizeMailingToDatabase (mailer);
+        if (! data.isPreviewMailing ()) {
+            finalizeMailingToDatabase (mailer);
+        }
         data.updateGenerationState ();
 
         data.logging (Log.DEBUG, &quot;execute&quot;, &quot;Successful end&quot;);
@@ -671,7 +617,7 @@ public class MailgunImpl implements Mailgun {
             doExecute (null, opts);
             str = &quot;Success: Mailgun fired.&quot;;
         } catch (Exception e) {
-            dbReport (&quot;Creation failed, please consult administrativa&quot;);
+            data.logging (Log.ERROR, &quot;mailgun&quot;, &quot;Creation failed: &quot; + e.toString ());
             if ((data != null) &amp;&amp; (data.mailing_id &gt; 0)) {
                 Destroyer   d = (Destroyer) mkDestroyer ((int) data.mailing_id);
 
@@ -695,29 +641,6 @@ public class MailgunImpl implements Mailgun {
         return str;
     }
 
-    /** Build the from part for the big query
-     * @return the FROM part
-     */
-    public String getFromclause () {
-        return &quot;FROM customer_&quot; + data.company_id + &quot;_tbl cust, customer_&quot; + data.company_id + &quot;_binding_tbl bind&quot;;
-    }
-
-    /** Additional clause for main query
-     * @param state the query to build
-     * @return the additional clause or empty string
-     */
-    public String getAdditionalClause (int state) {
-        return &quot;&quot;;
-    }
-
-    /** Statement extension to optional order output
-     * @param state the query to build
-     * @return the order part for the statement
-     */
-    public String getOrder (int state) {
-        return &quot;&quot;;
-    }
-
     /** Optional add database hint
      * @return the hint
      */
@@ -725,66 +648,12 @@ public class MailgunImpl implements Mailgun {
         return &quot;&quot;;
     }
 
-    /** Build the where clause for the big query
-     * @param complete if we want to build the complete query
-     * @return the WHERE clause
-     */
-    public String getWhereclause (boolean complete) throws Exception {
-        String  where = &quot;bind.customer_id = cust.customer_id AND (&quot; +
-                &quot;bind.mailinglist_id = &quot; + data.mailinglist_id + &quot; AND (&quot; +
-        data.clauseForUserStatus (true);
-
-        String  extra;
-
-        if (data.isAdminMailing ())
-            extra = &quot;bind.user_type = 'A'&quot;;
-        else if (data.isTestMailing ())
-            extra = &quot;bind.user_type IN ('A', 'T')&quot;;
-        else if (data.isCampaignMailing ()) {
-            if (data.campaignTransactionID &gt; 0)
-                extra = &quot;cust.transaction_id = &quot; + data.campaignTransactionID;
-            else {
-                if (data.campaignCustomerID &lt;= 0)
-                    throw new Exception (&quot;Campaign mailing without customer-ID initiated&quot;);
-                extra = &quot;cust.customer_id = &quot; + data.campaignCustomerID;
-            }
-        } else {
-            if ((data.campaignCustomerID &gt; 0) || (data.campaignTransactionID &gt; 0))
-                throw new Exception (&quot;World mailing with set customer-ID or transaction-ID&quot;);
-            extra = null;
-        }
-
-        if ((extra != null) &amp;&amp; (extra.length () &gt; 0))
-            where += &quot; AND &quot; + extra;
-        if ((! data.isAdminMailing ()) &amp;&amp; (! data.isTestMailing ())) {
-            if (data.subselect != null)
-                where += &quot; AND (&quot; + data.subselect + &quot;)&quot;;
-        }
-        String  tmp = data.getCampaignSubselect ();
-        if (tmp != null)
-            where += &quot; AND (&quot; + tmp + &quot;)&quot;;
-        if (data.isWorldMailing () || data.isRuleMailing () || data.isOnDemandMailing ()) {
-            tmp = data.getReferenceSubselect ();
-            if (tmp != null)
-                where += &quot; AND (&quot; + tmp + &quot;)&quot;;
-        }
-        tmp = data.getMediaSubselect ();
-        if (tmp != null)
-            where += &quot; AND (&quot; + tmp + &quot;)&quot;;
-
-        if (complete)
-            where += &quot;)&quot; + getAdditionalClause (0) + &quot;)&quot; + getOrder (0);
-
-        return where;
-    }
-
     /** Build the complete big query
      * @param tagNames the tags
      * @param allBlocks all content information
      * @return the created query
      */
-    private String getSelectvalue (Hashtable tagNames,  BlockCollection allBlocks,
-                       boolean hint) throws Exception {
+    private String getSelectvalue (Hashtable tagNames, BlockCollection allBlocks, boolean hint) throws Exception {
         StringBuffer    select_string = new StringBuffer();
 
         select_string.append(&quot;SELECT &quot;);
@@ -813,11 +682,8 @@ public class MailgunImpl implements Mailgun {
                         select_string.append (&quot;,cust.&quot; + data.columnName (n));
             // remove last comma
             // select_string.deleteCharAt(select_string.length() - 1);
-         } else
-            select_string.append (&quot;count(distinct(cust.customer_id))&quot;);
-
-        select_string.append (&quot; &quot; + getFromclause () +
-                      &quot; WHERE &quot; + getWhereclause (false));
+        } else
+            select_string.append (&quot;count(distinct customer_id)&quot;);
 
         // turn stringbuffer into string
         String result = select_string.toString();</diff>
      <filename>src/java/org/agnitas/backend/MailgunImpl.java</filename>
    </modified>
    <modified>
      <diff>@@ -139,6 +139,8 @@ public interface Admin extends Serializable {
      * @return the date of last password change.
      */
     java.util.Date getLastPasswordChange();
+    
+    public String getPassword();
 
     /**
      * Getter for property passwordHash.</diff>
      <filename>src/java/org/agnitas/beans/Admin.java</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,6 @@ public interface Mailing extends java.io.Serializable {
     int INPUT_TYPE_TEXT = 0;
     int INPUT_TYPE_HTML = 1;
 
-
     int TARGET_MODE_AND = 1;
     int TARGET_MODE_OR = 0;
 </diff>
      <filename>src/java/org/agnitas/beans/Mailing.java</filename>
    </modified>
    <modified>
      <diff>@@ -30,7 +30,17 @@ import java.util.Map;
  * @author mhe
  */
 public interface Recipient extends org.springframework.context.ApplicationContextAware {
-    /**
+    
+	
+	public final static int MAILTYPE_TEXT = 0;
+	public final static int MAILTYPE_HTML = 1;
+	public final static int MAILTYPE_HTML_OFFLINE = 2;
+	
+	public final static int GENDER_FEMALE = 1; 
+	public final static int GENDER_MALE = 0;
+	public final static int GENDER_UNKNOWN = 2;
+	
+	/**
      * Checks if E-Mail-Adress given in customerData-Map is valid.
      *
      * @return true if E-Mail-Adress is valid</diff>
      <filename>src/java/org/agnitas/beans/Recipient.java</filename>
    </modified>
    <modified>
      <diff>@@ -27,12 +27,14 @@ import java.io.StringReader;
 import java.sql.Connection;
 import java.util.Collection;
 import java.util.Comparator;
+import java.util.Date;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.LinkedList;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
@@ -72,11 +74,13 @@ import org.apache.commons.lang.StringUtils;
 import org.springframework.context.ApplicationContext;
 import org.springframework.jdbc.datasource.DataSourceUtils;
 
+import com.ibm.icu.text.SimpleDateFormat;
+
 import bsh.Interpreter;
 
 /**
  *
- * @author Martin Helff
+ * @author Martin Helff, Nicole Serek
  */
 public class MailingImpl implements Mailing {
 
@@ -532,7 +536,6 @@ public class MailingImpl implements Mailing {
         return addComps;
     }
 
-
     public Vector scanForLinks(String aText1, ApplicationContext con) {
         String aLink = null;
         int start = 0;
@@ -1061,11 +1064,36 @@ public class MailingImpl implements Mailing {
         if(tagName.equals(&quot;agnONEPIXEL&quot;)) {
             return new String(&quot;&quot;); // return empty value in preview
         }
+        
+        if(tagName.equals(&quot;agnDATE&quot;)) {
+        	String lang = (String)allValues.get(&quot;language&quot;);
+        	if(lang == null) {
+        		lang = &quot;de&quot;;
+        	}
+        	
+        	String country = (String)allValues.get(&quot;country&quot;);
+        	if(country == null) {
+        		country = &quot;DE&quot;;
+        	}
+        	
+        	// look for &quot;type&quot; in tag. Default to 0 if no tag is found.
+        	int type = 0;
+        	if (allValues.get(&quot;type&quot;) != null) {
+        		// if we found a &quot;type&quot; Attribute, take it. 
+        		type = Integer.parseInt((String)allValues.get(&quot;type&quot;));	
+        	}         	
+        	MailingDao dao = (MailingDao) con.getBean(&quot;MailingDao&quot;);
+        	String format = dao.getFormat(type);
+            
+        	SimpleDateFormat sdf = new SimpleDateFormat(format, new Locale(lang, country));
+    		String date = sdf.format(new Date());
+    		return date;
+        }
 
         if (!aDetail.getTagName().equals(&quot;agnTITLE&quot;)
 				&amp;&amp; !aDetail.getTagName().equals(&quot;agnTITLEFULL&quot;)
 				&amp;&amp; !aDetail.getTagName().equals(&quot;agnTITLEFIRST&quot;)) {
-			MailingDao dao = (MailingDao) con.getBean(&quot;MailingDao&quot;);
+        	MailingDao dao = (MailingDao) con.getBean(&quot;MailingDao&quot;);
 			String[] values = dao.getTag(aDetail.getTagName(), companyID);
 
 			if (values != null) {</diff>
      <filename>src/java/org/agnitas/beans/impl/MailingImpl.java</filename>
    </modified>
    <modified>
      <diff>@@ -43,5 +43,5 @@ public interface CampaignDao extends ApplicationContextAware {
      */
     Campaign getCampaign(int campaignID, int companyID);
     
-    public Stats getStats(boolean useMailtracking, Locale aLocale, LinkedList mailingIDs, Campaign campaign, ApplicationContext con);
+    public Stats getStats(boolean useMailtracking, Locale aLocale, LinkedList mailingIDs, Campaign campaign, ApplicationContext con, String mailingSelection);
 }</diff>
      <filename>src/java/org/agnitas/dao/CampaignDao.java</filename>
    </modified>
    <modified>
      <diff>@@ -26,9 +26,9 @@ import java.util.List;
 import java.util.Map;
 
 import org.agnitas.beans.Mailing;
+import org.displaytag.pagination.PaginatedList;
 import org.springframework.context.ApplicationContextAware;
 
-
 /**
  *
  * @author mhe
@@ -60,10 +60,13 @@ public interface MailingDao extends ApplicationContextAware {
 
 	int	findLastNewsletter(int customerID, int companyID);
 
-	String[]	getTag(String name, int companyID);
+	String[] getTag(String name, int companyID);
 
     boolean deleteContentFromMailing(Mailing mailing, int contentID);
-	String	getAutoURL(int mailingID);
+	String getAutoURL(int mailingID);
 	String getAutoURL(int mailingID, int companyID);
-    
+	
+	public PaginatedList getMailingList(int companyID, String types, boolean isTemplate, String sort, String direction, int page, int rownums);
+	
+	public String getFormat(int type);
 }</diff>
      <filename>src/java/org/agnitas/dao/MailingDao.java</filename>
    </modified>
    <modified>
      <diff>@@ -28,6 +28,7 @@ import java.util.Map;
 import org.agnitas.beans.Recipient;
 import org.agnitas.beans.CustomerImportStatus;
 import org.agnitas.web.ImportWizardForm;
+import org.displaytag.pagination.PaginatedList;
 
 import org.springframework.context.ApplicationContextAware;
 
@@ -162,4 +163,16 @@ public interface RecipientDao extends ApplicationContextAware {
 	int sumOfRecipients(int companyID, String target);
 	
 	boolean deleteRecipients(int companyID, String target);
+	
+	/**
+	 * Select's only a certain page of recipients, used for paging in list views
+	 * @param sqlStatement - the sql statement
+	 * @param sort - column which is the sort criterion
+	 * @param direction - asc / desc
+	 * @param page - the page
+	 * @param rownums - number of rows a page has
+	 * @return a list of recipients
+	 */
+	public PaginatedList getRecipientList(String sqlStatement, String sort, String direction , int page, int rownums, int previousFullListSize)  throws IllegalAccessException, InstantiationException;
+	
 }</diff>
      <filename>src/java/org/agnitas/dao/RecipientDao.java</filename>
    </modified>
    <modified>
      <diff>@@ -57,10 +57,10 @@ public class AdminDaoImpl implements AdminDao {
 			AgnUtils.logger().error(&quot;fatal: &quot;+e);
 			return null;
 		}
-		if ( AgnUtils.isOracleDB() ) {
-			return (Admin) AgnUtils.getFirstResult(tmpl.find(&quot;from Admin where username=? and password=?&quot;, new Object [] { name, password }));
+		if (AgnUtils.isOracleDB()) {
+			return (Admin) AgnUtils.getFirstResult(tmpl.find(&quot;from Admin where username=? and password=?&quot;, new Object[] {name, password}));
 		} else {
-			return (Admin) AgnUtils.getFirstResult(tmpl.find(&quot;from Admin where username=? and pwd_hash=?&quot;, new Object [] { name, pwdHash }));
+			return (Admin) AgnUtils.getFirstResult(tmpl.find(&quot;from Admin where username=? and pwd_hash=?&quot;, new Object[] {name, pwdHash}));
 		}
 	}
 
@@ -69,7 +69,6 @@ public class AdminDaoImpl implements AdminDao {
     	
 		tmpl.saveOrUpdate(&quot;Admin&quot;, admin);
 	}
-    
 
 	/**
 	 * Holds value of property applicationContext.
@@ -84,4 +83,4 @@ public class AdminDaoImpl implements AdminDao {
         
 		this.applicationContext = applicationContext;
 	}
-}
+}
\ No newline at end of file</diff>
      <filename>src/java/org/agnitas/dao/impl/AdminDaoImpl.java</filename>
    </modified>
    <modified>
      <diff>@@ -52,15 +52,15 @@ import org.springframework.orm.hibernate3.HibernateTemplate;
  */
 public class CampaignDaoImpl implements CampaignDao {
     
-	private String mailingSelection = null;
+	// private String mailingSelection = null;
     
-    protected String getMailingSelection() {
-		return mailingSelection;
-	}
+    //protected String getMailingSelection() {
+	//	return mailingSelection;
+	//}
 
-    protected void setMailingSelection(String mailingSelection) {
-		this.mailingSelection = mailingSelection;
-	}
+//    protected void setMailingSelection(String mailingSelection) {
+//		this.mailingSelection = mailingSelection;
+//	}
 
 	public Campaign getCampaign(int campaignID, int companyID) {
         HibernateTemplate tmpl=new HibernateTemplate((SessionFactory)this.applicationContext.getBean(&quot;sessionFactory&quot;));
@@ -72,7 +72,7 @@ public class CampaignDaoImpl implements CampaignDao {
         return (Campaign) AgnUtils.getFirstResult(tmpl.find(&quot;from Campaign where id = ? and companyID = ?&quot;, new Object [] {new Integer(campaignID), new Integer(companyID)} ));
     }
     
-    public Stats getStats(boolean useMailtracking, Locale aLocale, LinkedList mailingIDs, Campaign campaign, ApplicationContext con) {
+    public Stats getStats(boolean useMailtracking, Locale aLocale, LinkedList mailingIDs, Campaign campaign, ApplicationContext con, String mailingSelection) {
         CampaignImpl.StatsImpl stats = new CampaignImpl.StatsImpl();
         String uniqueStr = &quot;&quot;;
         // boolean useMailtracking = req.getSession().getAttribute(&quot;use_mailtracking&quot;).equals(&quot;1&quot;);
@@ -85,6 +85,11 @@ public class CampaignDaoImpl implements CampaignDao {
 
         csv = &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;CampaignStats&quot;, aLocale) + &quot;\&quot;\r\n\r\n&quot;;
 
+        // if we dont have the mailingIDs as parameter, we need to get them.
+        if (mailingIDs == null) {        	
+        	mailingIDs = getMailingIDs(campaign.getCompanyID(), campaign.getId());
+        }
+        
         if(mailingIDs != null) {
             Iterator aIt = mailingIDs.iterator();
             Integer tmpInt = null;
@@ -100,10 +105,15 @@ public class CampaignDaoImpl implements CampaignDao {
                     mailIDs.append(&quot;, &quot; + tmpInt.intValue());
                 }
             }
+        } else {
+        	
         }
 
         if(mailIDs != null) {
-            setMailingSelection(new String(mailIDs.toString()));
+//            setMailingSelection(new String(mailIDs.toString()));
+        	mailingSelection = mailIDs.toString();
+        } else {        	
+        	mailingSelection= null;
         }
 
         // * * * * * * * * * * * *
@@ -128,10 +138,10 @@ public class CampaignDaoImpl implements CampaignDao {
             csv += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Unique_Clicks&quot;, aLocale) + &quot;\&quot;\r\n\r\n&quot;;
         }
 
-        stats = loadMailingNames(stats, campaign);
-        stats = loadClicks(stats, uniqueStr);
-        stats = loadOpenedMails(stats, campaign, aTarget, useMailtracking);
-        stats = loadOptout(stats, campaign, aTarget, useMailtracking);
+        stats = loadMailingNames(stats, campaign, mailingSelection);
+        stats = loadClicks(stats, uniqueStr, mailingSelection);
+        stats = loadOpenedMails(stats, campaign, aTarget, useMailtracking, mailingSelection);
+        stats = loadOptout(stats, campaign, aTarget, useMailtracking, mailingSelection);
 
         // get mailing_id's from Hashtable
         Enumeration keys = stats.getMailingData().keys();
@@ -181,13 +191,13 @@ public class CampaignDaoImpl implements CampaignDao {
         return stats;
     }
     
-    private CampaignImpl.StatsImpl loadMailingNames (CampaignImpl.StatsImpl stats, Campaign campaign) {
+    private CampaignImpl.StatsImpl loadMailingNames (CampaignImpl.StatsImpl stats, Campaign campaign, String mailingSelection) {
     	JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
     	CampaignStatEntry aktEntry = null;
     	StringBuffer mailIDs = null;
     	String sql = &quot;select mailing_id, shortname, description from mailing_tbl where company_id=&quot; + campaign.getCompanyID() + &quot; and campaign_id=&quot; + campaign.getId() + &quot; and deleted&lt;&gt;1 and is_template=0 order by mailing_id desc&quot;;
-        if(getMailingSelection() != null) {
-            sql=&quot;select mailing_id, shortname, description from mailing_tbl where company_id=&quot;+campaign.getCompanyID()+&quot; AND MAILING_ID IN (&quot;+getMailingSelection()+&quot;) order by mailing_id desc&quot;;
+        if(mailingSelection != null) {
+            sql=&quot;select mailing_id, shortname, description from mailing_tbl where company_id=&quot;+campaign.getCompanyID()+&quot; AND MAILING_ID IN (&quot;+mailingSelection+&quot;) order by mailing_id desc&quot;;
         }
         AgnUtils.logger().info(&quot;MailingNameQuery: &quot; + sql);
 
@@ -223,16 +233,17 @@ public class CampaignDaoImpl implements CampaignDao {
             AgnUtils.logger().error(&quot;MailingNameQuery error1: &quot; + e);
         }
 
-        if(getMailingSelection() == null) {
-        	setMailingSelection(new String(mailIDs.toString()));
+        // TODO was passiert mit mailingSelection an dieser Stelle?
+        if(mailingSelection == null) {
+        	mailingSelection = new String(mailIDs.toString() );
         }
         return stats;
     }
     
-    private CampaignImpl.StatsImpl loadClicks (CampaignImpl.StatsImpl stats, String uniqueStr) {
+    private CampaignImpl.StatsImpl loadClicks (CampaignImpl.StatsImpl stats, String uniqueStr, String mailingSelection) {
     	JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
     	CampaignStatEntry aktEntry = null;
-    	String sql = &quot;select rdir.mailing_id as mailing_id, count(&quot; + uniqueStr + &quot; rdir.customer_id) as amount from rdir_log_tbl rdir, rdir_url_tbl url where rdir.mailing_id in (&quot; + getMailingSelection() + &quot;) and rdir.url_id=url.url_id&quot;;
+    	String sql = &quot;select rdir.mailing_id as mailing_id, count(&quot; + uniqueStr + &quot; rdir.customer_id) as amount from rdir_log_tbl rdir, rdir_url_tbl url where rdir.mailing_id in (&quot; + mailingSelection + &quot;) and rdir.url_id=url.url_id&quot;;
         sql += &quot; and url.relevance=0 group by rdir.mailing_id&quot;;
         AgnUtils.logger().info(&quot;TotalClicksQuery: &quot; + sql);
 
@@ -266,14 +277,14 @@ public class CampaignDaoImpl implements CampaignDao {
         return stats;
     }
 
-    private CampaignImpl.StatsImpl loadOpenedMails (CampaignImpl.StatsImpl stats, Campaign campaign, Target aTarget, boolean useMailtracking) {
+    private CampaignImpl.StatsImpl loadOpenedMails (CampaignImpl.StatsImpl stats, Campaign campaign, Target aTarget, boolean useMailtracking, String mailingSelection) {
     	JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
     	CampaignStatEntry aktEntry = null;
     	String sql = &quot;select onepix.mailing_id as mailing_id, count(onepix.customer_id) as amount from onepixel_log_tbl onepix&quot;;
         if(useMailtracking &amp;&amp; campaign.getTargetID() != 0)
             sql += &quot;, customer_&quot; + campaign.getCompanyID() + &quot;_tbl cust&quot;;
 
-        sql += &quot; where onepix.mailing_id in (&quot; + getMailingSelection() + &quot;)&quot;;
+        sql += &quot; where onepix.mailing_id in (&quot; + mailingSelection + &quot;)&quot;;
         if(useMailtracking &amp;&amp; campaign.getTargetID() != 0)
             sql += &quot; and ((&quot; + aTarget.getTargetSQL() + &quot;) and cust.customer_id=onepix.customer_id)&quot;;
         sql += &quot; group by onepix.mailing_id&quot;;
@@ -308,13 +319,13 @@ public class CampaignDaoImpl implements CampaignDao {
         return stats;
 	}
 
-	private CampaignImpl.StatsImpl loadOptout (CampaignImpl.StatsImpl stats, Campaign campaign, Target aTarget, boolean useMailtracking) {
+	private CampaignImpl.StatsImpl loadOptout (CampaignImpl.StatsImpl stats, Campaign campaign, Target aTarget, boolean useMailtracking, String mailingSelection) {
 		JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
     	CampaignStatEntry aktEntry = null;
 		String sql = &quot;select bind.exit_mailing_id as mailing_id, count(bind.customer_id) as amount from customer_&quot; + campaign.getCompanyID() + &quot;_binding_tbl bind&quot;;
         if(useMailtracking &amp;&amp; campaign.getTargetID() != 0)
             sql += &quot;, customer_&quot; + campaign.getCompanyID() + &quot;_tbl cust&quot;;
-        sql += &quot; where bind.exit_mailing_id in (&quot;+getMailingSelection()+&quot;)&quot;;
+        sql += &quot; where bind.exit_mailing_id in (&quot;+mailingSelection+&quot;)&quot;;
         if(useMailtracking &amp;&amp; campaign.getTargetID() != 0)
             sql += &quot; and ((&quot; + aTarget.getTargetSQL() + &quot;) and cust.customer_id=bind.customer_id)&quot;;
         sql += &quot; and bind.user_status in (&quot; + BindingEntry.USER_STATUS_ADMINOUT + &quot;, &quot; + BindingEntry.USER_STATUS_OPTOUT + &quot;) group by bind.exit_mailing_id&quot;;
@@ -498,4 +509,33 @@ public class CampaignDaoImpl implements CampaignDao {
         this.applicationContext = applicationContext;
     }
     
+    // this helper method returns the mailing-IDs from a Campaign.
+    
+    private LinkedList getMailingIDs(int compID, int campID) {
+    	LinkedList mailingIDs = new LinkedList&lt;Integer&gt;();
+    	// get jdbc-Template
+    	JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+    	// StringBuffer mailIDs = null;
+    	
+    	String sql = &quot;select mailing_id, shortname, description from mailing_tbl where company_id=&quot; + compID + &quot; and campaign_id=&quot; + campID + &quot; and deleted&lt;&gt;1 and is_template=0 order by mailing_id desc&quot;;
+       
+        AgnUtils.logger().info(&quot;MailingNameQuery: &quot; + sql);
+        try {
+            List list = jdbc.queryForList(sql);
+            Iterator i = list.iterator();
+       
+            // mailIDs = new StringBuffer();
+            Map map = null;
+            while(i.hasNext()) {
+                map = (Map) i.next();
+                Integer id = new Integer(((Number) map.get(&quot;mailing_id&quot;)).intValue());
+                mailingIDs.add(id);             
+            }
+        } catch (Exception e) {
+        	AgnUtils.sendExceptionMail(&quot;sql:&quot; + sql, e);
+            AgnUtils.logger().error(&quot;MailingNameQuery error1: &quot; + e);
+        }
+    	return mailingIDs;
+    }
+    
 }</diff>
      <filename>src/java/org/agnitas/dao/impl/CampaignDaoImpl.java</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,9 @@
 
 package org.agnitas.dao.impl;
 
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -33,52 +36,53 @@ import org.agnitas.beans.Mailing;
 import org.agnitas.beans.MailingComponent;
 import org.agnitas.beans.Mediatype;
 import org.agnitas.beans.TrackableLink;
+import org.agnitas.beans.impl.DynaBeanPaginatedListImpl;
 import org.agnitas.dao.MailingDao;
 import org.agnitas.dao.TrackableLinkDao;
 import org.agnitas.util.AgnUtils;
+import org.apache.commons.beanutils.BasicDynaClass;
+import org.apache.commons.beanutils.DynaBean;
+import org.apache.commons.beanutils.DynaProperty;
+import org.displaytag.pagination.PaginatedList;
 import org.hibernate.SessionFactory;
 import org.springframework.context.ApplicationContext;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.orm.hibernate3.HibernateTemplate;
 
-
-
-
 /**
  *
- * @author mhe
+ * @author mhe, Nicole Serek
  */
 public class MailingDaoImpl implements MailingDao {
     
     public Mailing getMailing(int mailingID, int companyID) {
-        Mailing mailing=null;
-        HibernateTemplate tmpl=new HibernateTemplate((SessionFactory)this.applicationContext.getBean(&quot;sessionFactory&quot;));
-       
+        Mailing mailing = null;
+        HibernateTemplate tmpl = new HibernateTemplate((SessionFactory)this.applicationContext.getBean(&quot;sessionFactory&quot;));
         
-        mailing=(Mailing)AgnUtils.getFirstResult(tmpl.find(&quot;from Mailing where id = ? and companyID = ? and deleted &lt;&gt; 1&quot;, new Object [] {new Integer(mailingID), new Integer(companyID)} ));
+        mailing = (Mailing)AgnUtils.getFirstResult(tmpl.find(&quot;from Mailing where id = ? and companyID = ? and deleted &lt;&gt; 1&quot;, new Object [] {new Integer(mailingID), new Integer(companyID)} ));
         if(mailing != null) {
-            Map map=mailing.getMediatypes();
-            Iterator it=map.keySet().iterator();
+            Map map = mailing.getMediatypes();
+            Iterator it = map.keySet().iterator();
     
             while(it.hasNext()) {
-                Integer key=(Integer) it.next();
+                Integer key = (Integer) it.next();
             
                 if(map.get(key) instanceof org.agnitas.beans.impl.MediatypeImpl) {
-                    Mediatype mt=null;
-                    Mediatype src=(Mediatype) map.get(key);
+                    Mediatype mt = null;
+                    Mediatype src = (Mediatype) map.get(key);
             
                     switch(key.intValue()) {
-                        case 0: mt=(Mediatype) this.applicationContext.getBean(&quot;MediatypeEmail&quot;);
+                        case 0: mt = (Mediatype) this.applicationContext.getBean(&quot;MediatypeEmail&quot;);
                                 break;
-                        case 1: mt=(Mediatype) this.applicationContext.getBean(&quot;MediatypeFax&quot;);
+                        case 1: mt = (Mediatype) this.applicationContext.getBean(&quot;MediatypeFax&quot;);
                                 break;
-                        case 2: mt=(Mediatype) this.applicationContext.getBean(&quot;MediatypePrint&quot;);
+                        case 2: mt = (Mediatype) this.applicationContext.getBean(&quot;MediatypePrint&quot;);
                                 break;
-                        case 3: mt=(Mediatype) this.applicationContext.getBean(&quot;MediatypeMMS&quot;);
+                        case 3: mt = (Mediatype) this.applicationContext.getBean(&quot;MediatypeMMS&quot;);
                                 break;
-                        case 4: mt=(Mediatype) this.applicationContext.getBean(&quot;MediatypeSMS&quot;);
+                        case 4: mt = (Mediatype) this.applicationContext.getBean(&quot;MediatypeSMS&quot;);
                                 break;
-                        default: mt=(Mediatype) this.applicationContext.getBean(&quot;Mediatype&quot;);
+                        default: mt = (Mediatype) this.applicationContext.getBean(&quot;Mediatype&quot;);
                     }
                     mt.setPriority(src.getPriority()); 
                     mt.setStatus(src.getStatus()); 
@@ -97,27 +101,27 @@ public class MailingDaoImpl implements MailingDao {
     }
     
     public int saveMailing(Mailing mailing) {
-        int result=0;
+        int result = 0;
 
-        Mailing tmpMailing=null;
-        HibernateTemplate tmpl=new HibernateTemplate((SessionFactory)this.applicationContext.getBean(&quot;sessionFactory&quot;));
+        Mailing tmpMailing = null;
+        HibernateTemplate tmpl = new HibernateTemplate((SessionFactory)this.applicationContext.getBean(&quot;sessionFactory&quot;));
 
         if(mailing.getId()!=0) {
         	System.err.println(&quot;Clearing mailing&quot;);
-            tmpMailing=(Mailing)AgnUtils.getFirstResult(tmpl.find(&quot;from Mailing where id = ? and companyID = ? and deleted &lt;&gt; 1&quot;, new Object [] {new Integer(mailing.getId()), new Integer(mailing.getCompanyID())} ));
-            if(tmpMailing==null) {
+            tmpMailing = (Mailing) AgnUtils.getFirstResult(tmpl.find(&quot;from Mailing where id = ? and companyID = ? and deleted &lt;&gt; 1&quot;, new Object [] {new Integer(mailing.getId()), new Integer(mailing.getCompanyID())} ));
+            if(tmpMailing == null) {
                 mailing.setId(0);
             }
         }
 
-        Map map=mailing.getMediatypes();
-        Map dst=new HashMap();
-        Iterator i=map.keySet().iterator();
+        Map map = mailing.getMediatypes();
+        Map dst = new HashMap();
+        Iterator i = map.keySet().iterator();
 
         while(i.hasNext()) {
-            Integer idx=(Integer) i.next();
-            Mediatype mt=(Mediatype) map.get(idx);
-            Mediatype tgt=(Mediatype) this.applicationContext.getBean(&quot;Mediatype&quot;);
+            Integer idx = (Integer) i.next();
+            Mediatype mt = (Mediatype) map.get(idx);
+            Mediatype tgt = (Mediatype) this.applicationContext.getBean(&quot;Mediatype&quot;);
 
             try {
                 tgt.setPriority(mt.getPriority()); 
@@ -166,11 +170,11 @@ public class MailingDaoImpl implements MailingDao {
     }
     
     public boolean deleteMailing(int mailingID, int companyID) {
-        Mailing tmpMailing=null;
-        HibernateTemplate tmpl=new HibernateTemplate((SessionFactory)this.applicationContext.getBean(&quot;sessionFactory&quot;));
+        Mailing tmpMailing = null;
+        HibernateTemplate tmpl = new HibernateTemplate((SessionFactory)this.applicationContext.getBean(&quot;sessionFactory&quot;));
         
-        tmpMailing=this.getMailing(mailingID, companyID);
-        if(tmpMailing==null) {
+        tmpMailing = this.getMailing(mailingID, companyID);
+        if(tmpMailing == null) {
             return false;
         }
         
@@ -181,15 +185,13 @@ public class MailingDaoImpl implements MailingDao {
     }
 
     public List getMailingsForMLID(int companyID, int mailinglistID) {
-        HibernateTemplate tmpl=new HibernateTemplate((SessionFactory)this.applicationContext.getBean(&quot;sessionFactory&quot;));
-        
+        HibernateTemplate tmpl = new HibernateTemplate((SessionFactory)this.applicationContext.getBean(&quot;sessionFactory&quot;));
         return tmpl.find(&quot;from Mailing where companyID = ? and mailinglistID = ? and deleted = 0&quot;, new Object [] {new Integer(companyID), new Integer(mailinglistID)} );
-        
     }
     
     public Map&lt;String, String&gt; loadAction(int mailingID, int companyID) {
         Map&lt;String, String&gt; actions = new HashMap&lt;String, String&gt;();
-        JdbcTemplate jdbc=new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+        JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
     	
     	String stmt = &quot;select action_id, shortname, full_url from rdir_url_tbl where mailing_id = ? and company_id = ?&quot;;
     	try {
@@ -215,14 +217,11 @@ public class MailingDaoImpl implements MailingDao {
     		System.err.println(e.getMessage());
     		System.err.println(AgnUtils.getStackTrace(e));
     	}
-        
         return actions;
     }
     
     public boolean deleteContentFromMailing(Mailing mailing, int contentID){
-
     	JdbcTemplate jdbcTemplate = AgnUtils.getJdbcTemplate(this.applicationContext);
-
     	String deleteContentSQL = &quot;DELETE from dyn_content_tbl &quot; +
     			&quot;WHERE &quot; +
     			&quot; dyn_content_id = ? AND&quot; +
@@ -249,15 +248,15 @@ public class MailingDaoImpl implements MailingDao {
 	 * @param jdbc Template for SQL queries.
 	 * @return the resulting where clause.
 	 */
-	static String	getSQLExpression(String targetExpression, JdbcTemplate jdbc)	{	
-		StringBuffer	buf = new StringBuffer ();
+	static String getSQLExpression(String targetExpression, JdbcTemplate jdbc)	{	
+		StringBuffer buf = new StringBuffer ();
 		int	tlen = targetExpression.length ();
 
 		if (targetExpression == null) {
 			return null;
 		}
 		for (int n = 0; n &lt; tlen; ++n) {
-			char	ch = targetExpression.charAt (n);
+			char ch = targetExpression.charAt (n);
 
 			if ((ch == '(') || (ch == ')')) {
 				buf.append (ch);
@@ -271,17 +270,17 @@ public class MailingDaoImpl implements MailingDao {
 			} else if (ch == '!') {
 				buf.append (&quot; NOT&quot;);
 			} else if (Character.isDigit(ch)) {
-				String	temp=&quot;&quot;;
+				String	temp = &quot;&quot;;
 				int	first = n;
-				int	tid=(-1);
+				int	tid = (-1);
 
 				while(n &lt; tlen &amp;&amp; Character.isDigit(ch)) {
 					n++;
 				}
 				tid=Integer.parseInt(targetExpression.substring(first, n));
-				temp=(String) jdbc.queryForObject(&quot;select target_sql from dyn_target_tbl where target_id = ?&quot;, new Object[] {new Integer(tid)}, temp.getClass());
+				temp = (String) jdbc.queryForObject(&quot;select target_sql from dyn_target_tbl where target_id = ?&quot;, new Object[] {new Integer(tid)}, temp.getClass());
 				if (temp != null &amp;&amp; temp.trim().length() &gt; 2)
-					buf.append (&quot; (&quot; + temp + &quot;)&quot;);
+					buf.append(&quot; (&quot; + temp + &quot;)&quot;);
 			}
 		}
 		if (buf.length () &gt;= 3)
@@ -298,7 +297,7 @@ public class MailingDaoImpl implements MailingDao {
 	 *              sent to this recipient.
 	 */
 	public int	findLastNewsletter(int customerID, int companyID) {
-		JdbcTemplate jdbc=new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+		JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
 		String	sql=&quot;select m.mailing_id, m.target_expression, a.&quot;+AgnUtils.changeDateName()+&quot; from mailing_tbl m left join mailing_account_tbl a ON a.mailing_id=m.mailing_id where m.company_id=? and m.deleted&lt;&gt;1 and m.is_template=0 and a.status_field='W' order by a.&quot;+AgnUtils.changeDateName()+&quot; desc, m.mailing_id desc&quot;;
 
 		try {
@@ -326,28 +325,28 @@ System.err.println(&quot;SQL: &quot;+sql);
 	}
 	
 	public String[]	getTag(String name, int companyID) {
-        	JdbcTemplate jdbc=new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
-		String sql=&quot;select selectvalue, type from tag_tbl where tagname=? and (company_id=0 or company_id=?)&quot;;
-		String[] result=null;
+        JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+		String sql = &quot;select selectvalue, type from tag_tbl where tagname=? and (company_id=0 or company_id=?)&quot;;
+		String[] result = null;
 
 		try {
 			List list=jdbc.queryForList(sql, new Object[]{name, new Integer(companyID)});
 
 			if(list.size() &gt; 0) {
-				Map map=(Map) list.get(0);
+				Map map = (Map) list.get(0);
 
-				result=new String[]{ (String) map.get(&quot;selectvalue&quot;), (String) map.get(&quot;type&quot;) };
+				result = new String[]{ (String) map.get(&quot;selectvalue&quot;), (String) map.get(&quot;type&quot;) };
 			}
 		} catch (Exception e) {
 			AgnUtils.sendExceptionMail(&quot;sql:&quot; + sql + &quot;, &quot;+ name + &quot;, &quot; + companyID, e);
 			AgnUtils.logger().error(&quot;processTag: &quot;+e.getMessage());
-			result=null;
+			result = null;
 		}
 		return result;
 	}
 
 	public String	getAutoURL(int mailingID)	{
-        JdbcTemplate jdbc=new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+        JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
 		String	sql=&quot;select auto_url from mailing_tbl where mailing_id=?&quot;;
 
 		try	{
@@ -359,7 +358,7 @@ System.err.println(&quot;SQL: &quot;+sql);
 	}
 	
 	public String getAutoURL(int mailingID, int companyID) {
-		JdbcTemplate jdbc=new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+		JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
 		String rdirdomain = null;
 		String rdir_mailinglistquery = &quot;select  ml.RDIR_DOMAIN  FROM MAILINGLIST_TBL ml JOIN MAILING_TBL m ON ( ml.MAILINGLIST_ID = m.MAILINGLIST_ID) WHERE  m.MAILING_ID=?&quot;; 
 		rdirdomain = (String) jdbc.queryForObject(rdir_mailinglistquery, new Object[]{new Integer(mailingID)}, String.class );
@@ -369,13 +368,8 @@ System.err.println(&quot;SQL: &quot;+sql);
 		String rdir_companyquery = &quot;select RDIR_DOMAIN FROM COMPANY_TBL where company_id=?&quot;;
 		rdirdomain = (String) jdbc.queryForObject(rdir_companyquery, new Object[]{new Integer(companyID)}, String.class );
 			return rdirdomain;
-	
 	}
 	
-	
-	
-	
-
     /**
      * Holds value of property applicationContext.
      */
@@ -390,5 +384,96 @@ System.err.println(&quot;SQL: &quot;+sql);
         this.applicationContext = applicationContext;
     }
 
+	public PaginatedList getMailingList( int companyID, String types,
+			boolean isTemplate, String sort, String direction, int page, int rownums)  {
+	
+	      JdbcTemplate aTemplate = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+	      List&lt;String&gt;  charColumns = Arrays.asList(new String[]{&quot;shortname&quot;,&quot;description&quot;,&quot;mailinglist&quot; });
+		  
+	      int offset =  ( page - 1) * rownums;  
+          
+	      String mailingTypes = &quot;  AND  mailing_type in (&quot;+ types +&quot;) &quot;;
+	      if(isTemplate) {
+	     		mailingTypes = &quot; &quot;;
+	      }
+	      
+	    String orderby = null;	
+		String defaultorder = &quot; send_null ASC, senddate DESC, mailing_id DESC  &quot;; 
+		if( sort != null &amp;&amp; ! &quot;&quot;.equals(sort.trim())) {
+			orderby = getUpperSort(charColumns, sort);
+			orderby = orderby + &quot; &quot; +direction;
+		}
+		else {
+			orderby = defaultorder;
+		}
+		
+		String sqlStatement = 
+	    	  &quot; SELECT *, case when senddate is null then 0 else 1 end as send_null &quot; +
+	    	  &quot; FROM (   SELECT a.mailing_id , a.shortname  , a.description ,   min(c.&quot; + AgnUtils.changeDateName() + &quot;) senddate, m.shortname mailinglist &quot; +
+	    	  &quot; FROM  (mailing_tbl  a LEFT JOIN mailing_account_tbl c ON (a.mailing_id=c.mailing_id AND c.status_field='W')) &quot; + &quot; LEFT JOIN mailinglist_tbl m ON (  a.mailinglist_id=m.mailinglist_id AND  a.company_id=m.company_id) &quot; +
+			  &quot;  WHERE a.company_id = &quot; + companyID + &quot; AND a.deleted&lt;&gt;1 AND a.is_template=&quot; + (isTemplate?1:0)
+				+ mailingTypes + &quot;  GROUP BY  a.mailing_id, a.shortname, a.description, m.shortname ) openemm ORDER BY &quot; + orderby;
+	      
+  	 
+	     int totalsize = aTemplate.queryForInt(&quot;select count(*) from ( &quot; +sqlStatement + &quot;) agn&quot;);
+   	 
+	     sqlStatement = sqlStatement + &quot; LIMIT &quot; + offset + &quot; , &quot; + rownums;
+	     
+	     List&lt;Map&gt; tmpList = aTemplate.queryForList(sqlStatement);
+   	 
+   	 DynaProperty[] properties = new DynaProperty[] {
+	    		  new DynaProperty(&quot;mailingid&quot;, Long.class),
+	    		  new DynaProperty(&quot;shortname&quot;, String.class),
+	    		  new DynaProperty(&quot;description&quot;, String.class),
+	    		  new DynaProperty(&quot;mailinglist&quot;, String.class),
+	    		  new DynaProperty(&quot;senddate&quot;,Timestamp.class)   		  
+	      };
+	      BasicDynaClass dynaClass = new BasicDynaClass(&quot;mailing&quot;, null, properties);
+	      
+	      List&lt;DynaBean&gt; result = new ArrayList&lt;DynaBean&gt;();
+	      for(Map row:tmpList) {
+	    	  DynaBean newBean;
+			try {
+				newBean = dynaClass.newInstance();
+			  	
+	    	  newBean.set(&quot;mailingid&quot;, row.get(&quot;MAILING_ID&quot;));
+	    	  newBean.set(&quot;shortname&quot;, row.get(&quot;SHORTNAME&quot;));
+	    	  newBean.set(&quot;description&quot;, row.get(&quot;DESCRIPTION&quot;));
+	    	  newBean.set(&quot;mailinglist&quot;, row.get(&quot;MAILINGLIST&quot;));
+	    	  newBean.set(&quot;senddate&quot;,row.get(&quot;SENDDATE&quot;));
+	    	  result.add(newBean);
+			} catch (IllegalAccessException e) {
+				  AgnUtils.logger().error(&quot;IllegalAccessException: &quot;+e);
+                  AgnUtils.logger().error(AgnUtils.getStackTrace(e));
+				
+			} catch (InstantiationException e) {
+				  AgnUtils.logger().error(&quot;InstantiationException: &quot;+e);
+                  AgnUtils.logger().error(AgnUtils.getStackTrace(e));
+			}
+	      }    
+	   
+	      DynaBeanPaginatedListImpl paginatedList = new DynaBeanPaginatedListImpl(result, totalsize, rownums, page, sort, direction);
+	      
+	      return paginatedList;
+	}
 	
+	protected String getUpperSort(List&lt;String&gt; charColumns, String sort) {
+		String upperSort = sort;
+		if (charColumns.contains( sort )) {
+	    	upperSort = &quot;upper( &quot; +sort + &quot; )&quot;;
+	     }
+		return upperSort;
+	}
+
+	public String getFormat(int type) {
+		String format = &quot;d.M.yyyy&quot;;
+		JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+		try {
+            String sql = &quot;SELECT format FROM date_tbl WHERE type = ?&quot;;
+            format = (String) jdbc.queryForObject(sql, new Object[] {new Integer(type)}, String.class);
+        } catch (Exception e) {
+        	AgnUtils.logger().error(&quot;Query failed for data_tbl: &quot; + e);
+        }
+		return format;
+	}
 }</diff>
      <filename>src/java/org/agnitas/dao/impl/MailingDaoImpl.java</filename>
    </modified>
    <modified>
      <diff>@@ -80,6 +80,7 @@ public class MailinglistDaoImpl implements MailinglistDao  {
         }
         
         tmpl.saveOrUpdate(&quot;Mailinglist&quot;, list);
+        tmpl.flush();        
         result=list.getId();
         
         return result;</diff>
      <filename>src/java/org/agnitas/dao/impl/MailinglistDaoImpl.java</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,7 @@
 
 package org.agnitas.dao.impl;
 
+import java.math.BigDecimal;
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
@@ -29,43 +30,49 @@ import java.sql.Statement;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
 import java.util.GregorianCalendar;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
-import java.util.Enumeration;
+import java.util.ListIterator;
 import java.util.Map;
-import java.util.HashMap;
-import java.util.LinkedList;
 import java.util.Vector;
-import java.util.ListIterator;
-import java.util.ArrayList;
 
 import javax.sql.DataSource;
 
-import org.agnitas.util.CsvColInfo;
-import org.agnitas.web.ImportWizardForm;
+import org.agnitas.beans.BindingEntry;
+import org.agnitas.beans.CustomerImportStatus;
+import org.agnitas.beans.DatasourceDescription;
+import org.agnitas.beans.Recipient;
+import org.agnitas.beans.impl.DynaBeanPaginatedListImpl;
+import org.agnitas.dao.RecipientDao;
 import org.agnitas.util.AgnUtils;
+import org.agnitas.util.CsvColInfo;
 import org.agnitas.util.SafeString;
-import org.agnitas.beans.DatasourceDescription;
+import org.agnitas.web.ImportWizardForm;
+import org.apache.commons.beanutils.BasicDynaClass;
+import org.apache.commons.beanutils.DynaBean;
+import org.apache.commons.beanutils.DynaProperty;
+import org.apache.commons.collections.map.CaseInsensitiveMap;
+import org.apache.commons.lang.StringUtils;
+import org.displaytag.pagination.PaginatedList;
 import org.hibernate.SessionFactory;
 import org.hibernate.dialect.Dialect;
 import org.springframework.context.ApplicationContext;
-import org.springframework.orm.hibernate3.HibernateTemplate;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.datasource.DataSourceUtils;
 import org.springframework.jdbc.object.SqlUpdate;
 import org.springframework.jdbc.support.GeneratedKeyHolder;
-import org.agnitas.beans.BindingEntry;
-import org.agnitas.beans.CustomerImportStatus;
-import org.agnitas.beans.Recipient;
-import org.agnitas.dao.RecipientDao;
-import org.apache.commons.collections.map.CaseInsensitiveMap;
-import org.apache.commons.lang.StringUtils;
+import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate3.HibernateTransactionManager;
 import org.springframework.transaction.TransactionDefinition;
 import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.support.DefaultTransactionDefinition;
-import org.springframework.orm.hibernate3.HibernateTransactionManager;
 
 /**
  *
@@ -78,7 +85,7 @@ public class RecipientDaoImpl implements RecipientDao {
 		if(maxRecipient == null) {
 			synchronized(this) {
 				if(maxRecipient == null) {
-					maxRecipient=new Integer(AgnUtils.getDefaultIntValue(&quot;recipient.maxRows&quot;));
+					maxRecipient = new Integer(AgnUtils.getDefaultIntValue(&quot;recipient.maxRows&quot;));
 				}	
 			}
 		}
@@ -88,25 +95,25 @@ public class RecipientDaoImpl implements RecipientDao {
 		return maxRecipient.intValue();
 	}
 
-	public boolean	mayAdd(int companyID, int count) {
-                JdbcTemplate jdbc = new JdbcTemplate((DataSource)this.applicationContext.getBean(&quot;dataSource&quot;));
-                String sql = &quot;select count(customer_id) from customer_&quot; + companyID + &quot;_tbl&quot;;
-		int current=jdbc.queryForInt(sql);
-		int max=getMaxRecipient();
+	public boolean mayAdd(int companyID, int count) {
+		JdbcTemplate jdbc = new JdbcTemplate((DataSource)this.applicationContext.getBean(&quot;dataSource&quot;));
+        String sql = &quot;select count(customer_id) from customer_&quot; + companyID + &quot;_tbl&quot;;
+		int current = jdbc.queryForInt(sql);
+		int max = getMaxRecipient();
 
-		if(max == 0 || current+count &lt; max) {
+		if(max == 0 || current+count &lt;= max) {
 			return true;
 		}
 		return false;
 	}
 
 	public boolean	isNearLimit(int companyID, int count) {
-                JdbcTemplate jdbc = new JdbcTemplate((DataSource)this.applicationContext.getBean(&quot;dataSource&quot;));
-                String sql = &quot;select count(customer_id) from customer_&quot; + companyID + &quot;_tbl&quot;;
+		JdbcTemplate jdbc = new JdbcTemplate((DataSource)this.applicationContext.getBean(&quot;dataSource&quot;));
+        String sql = &quot;select count(customer_id) from customer_&quot; + companyID + &quot;_tbl&quot;;
 		int current=jdbc.queryForInt(sql);
 		int max=(int) (getMaxRecipient()*0.9);
 
-		if(max == 0 || current+count &lt; max) {
+		if(max == 0 || current+count &lt;= max) {
 			return false;
 		}
 		return true;
@@ -120,15 +127,14 @@ public class RecipientDaoImpl implements RecipientDao {
     public int getNewCustomerID(int companyID) {
         String sqlStatement = null;
         int customerID = 0;
-
         Dialect dialect = AgnUtils.getHibernateDialect();
 
-	if(companyID == 0) {
-		return customerID;
-	}
-	if(mayAdd(companyID, 1) == false) {
-		return customerID;
-	}
+        if(companyID == 0) {
+        	return customerID;
+        }
+        if(mayAdd(companyID, 1) == false) {
+        	return customerID;
+        }
         try {
             if(dialect.supportsSequences()) {
                 JdbcTemplate tmpl = new JdbcTemplate((DataSource)this.applicationContext.getBean(&quot;dataSource&quot;));
@@ -147,9 +153,7 @@ public class RecipientDaoImpl implements RecipientDao {
             System.err.println(&quot;Exception:&quot; + e);
             System.err.println(AgnUtils.getStackTrace(e));
         }
-
         AgnUtils.logger().debug(&quot;new customerID: &quot;+ customerID);
-
         return customerID;
     }
     
@@ -166,7 +170,7 @@ public class RecipientDaoImpl implements RecipientDao {
         String ColType = null;
         int intValue = 0;
         int day, month, year, hour, minute, second=0;
-        StringBuffer insertCust=new StringBuffer(&quot;INSERT INTO customer_&quot; + cust.getCompanyID() + &quot;_tbl &quot;);
+        StringBuffer insertCust = new StringBuffer(&quot;INSERT INTO customer_&quot; + cust.getCompanyID() + &quot;_tbl &quot;);
         boolean exitNow = false;
         boolean appendIt = false;
         boolean hasDefault = false;
@@ -175,17 +179,17 @@ public class RecipientDaoImpl implements RecipientDao {
         NumberFormat aFormat1 = null;
         NumberFormat aFormat2 = null;
 
-	if(mayAdd(cust.getCompanyID(), 1) == false) {
-		return 0;
-	}
+        if(mayAdd(cust.getCompanyID(), 1) == false) {
+        	return 0;
+        }
 
         if(cust.getCustDBStructure() == null) {
-		cust.loadCustDBStructure();
+        	cust.loadCustDBStructure();
         }
 
         int customerID = getNewCustomerID(cust.getCompanyID()); 
         if(customerID == 0) {
-		return 0;
+        	return 0;
         } else {
         	cust.setCustomerID(customerID);
         }
@@ -228,7 +232,6 @@ public class RecipientDaoImpl implements RecipientDao {
 								Map tmp = (Map) cust.getCustDBProfileStructure().get(aColumn);
 								if (tmp != null) {
 									String defaultValue = (String)tmp.get(&quot;default&quot;);
-								
 									if (!isBlank(defaultValue)) {
 										appendValue = &quot;'&quot; + defaultValue + &quot;'&quot;;
 										hasDefault = true;
@@ -369,11 +372,10 @@ public class RecipientDaoImpl implements RecipientDao {
         if(cust.getCustomerID() == 0) {
             AgnUtils.logger().info(&quot;updateInDB: creating new customer&quot;);
             if(this.insertNewCust(cust) == 0) {
-                result=false;
+                result = false;
             }
         } else {
             if(cust.isChangeFlag()) { // only if something has changed
-
                 Iterator&lt;String&gt; i = cust.getCustDBStructure().keySet().iterator();
                 while(i.hasNext()) {
                     aColumn = i.next();
@@ -391,9 +393,9 @@ public class RecipientDaoImpl implements RecipientDao {
                             aFormat2 = new DecimalFormat(&quot;0000&quot;);
                             try {
                                 if(!((String) cust.getCustParameters().get(aColumn + &quot;_DAY_DATE&quot;)).trim().equals(&quot;&quot;)) {
-                                	day = Integer.parseInt((String) cust.getCustParameters().get(aColumn+&quot;_DAY_DATE&quot;));
-                                    month = Integer.parseInt((String) cust.getCustParameters().get(aColumn+&quot;_MONTH_DATE&quot;));
-                                    year = Integer.parseInt((String) cust.getCustParameters().get(aColumn+&quot;_YEAR_DATE&quot;));
+                                	day = Integer.parseInt((String) cust.getCustParameters().get(aColumn + &quot;_DAY_DATE&quot;));
+                                    month = Integer.parseInt((String) cust.getCustParameters().get(aColumn + &quot;_MONTH_DATE&quot;));
+                                    year = Integer.parseInt((String) cust.getCustParameters().get(aColumn + &quot;_YEAR_DATE&quot;));
                                     if (AgnUtils.isOracleDB()) {
                                         appendValue = new String(aColumn.toLowerCase() + &quot;=to_date('&quot; + aFormat1.format(day) + &quot;-&quot; + aFormat1.format(month) + &quot;-&quot; + aFormat2.format(year) + &quot;', 'DD-MM-YYYY')&quot;);
                                     } else {
@@ -405,14 +407,14 @@ public class RecipientDaoImpl implements RecipientDao {
                                 	if (tmp != null) {
                                 		String defaultValue = (String)tmp.get(&quot;default&quot;);
                                 		if (!isBlank(defaultValue) &amp;&amp; !defaultValue.equals(&quot;null&quot;)) {
-                                            appendValue = aColumn.toLowerCase()+&quot;='&quot; + defaultValue + &quot;'&quot;;
+                                            appendValue = aColumn.toLowerCase() + &quot;='&quot; + defaultValue + &quot;'&quot;;
                                             hasDefault = true;
                                 		}
                                 	}
                                 	if (!hasDefault) {
-                                		appendValue=new String(aColumn.toLowerCase()+&quot;=null&quot;);
+                                		appendValue = new String(aColumn.toLowerCase()+&quot;=null&quot;);
                                 	}
-                                    appendIt=true;
+                                    appendIt = true;
                                 }
                             } catch (Exception e1) {
                                 AgnUtils.logger().error(&quot;updateInDB: Could not parse Date &quot;+aColumn + &quot; because of &quot;+e1.getMessage());
@@ -432,27 +434,25 @@ public class RecipientDaoImpl implements RecipientDao {
                             appendIt = true;
                         } else {
                         	Map tmp = (Map) cust.getCustDBProfileStructure().get( aColumn );
-                        	if ( tmp != null ) {
+                        	if (tmp != null) {
                         		String defaultValue = (String)tmp.get( &quot;default&quot; );
                         		if (!isBlank(defaultValue)) {
                                     appendValue = aColumn.toLowerCase()+&quot;=&quot; + defaultValue;
                                     hasDefault = true;
                         		}
                         	}
-                        	if ( !hasDefault ) {
-                        		appendValue=new String(aColumn.toLowerCase() + &quot;=null&quot;);
+                        	if (!hasDefault) {
+                        		appendValue = new String(aColumn.toLowerCase() + &quot;=null&quot;);
                         	}
-                            appendIt=true;
+                            appendIt = true;
                         }
-
                     } else if(colType.equalsIgnoreCase(&quot;DOUBLE&quot;)) {
                         double dValue;
-
                         aParameter = (String) cust.getCustParameters(aColumn);
                         if(!StringUtils.isEmpty(aParameter)){
                             try {
                                 dValue = Double.parseDouble(aParameter);
-                            } catch (Exception e1) {
+                            } catch(Exception e1) {
                                 dValue = 0;
                             }
                             appendValue = new String(aColumn.toLowerCase() + &quot;=&quot; + dValue);
@@ -471,7 +471,6 @@ public class RecipientDaoImpl implements RecipientDao {
                         	}
                             appendIt = true;
                         }
-
                     } else /* if(colType.equalsIgnoreCase(&quot;VARCHAR&quot;) || colType.equalsIgnoreCase(&quot;CHAR&quot;))*/ {
                         aParameter = (String) cust.getCustParameters(aColumn);
                         if(!StringUtils.isEmpty(aParameter)) {
@@ -479,20 +478,19 @@ public class RecipientDaoImpl implements RecipientDao {
                             appendIt = true;
                         } else {
                         	Map tmp = (Map) cust.getCustDBProfileStructure().get(aColumn);
-                        	if ( tmp != null ) {
+                        	if(tmp != null) {
                         		String defaultValue = (String)tmp.get( &quot;default&quot; );
-                        		if (!isBlank(defaultValue)) {
+                        		if(!isBlank(defaultValue)) {
                                     appendValue = aColumn.toLowerCase()+&quot;='&quot; + defaultValue + &quot;'&quot;;
                                     hasDefault = true;
                         		}
                         	}
-                        	if ( !hasDefault ) {
+                        	if(!hasDefault) {
                         		appendValue = new String(aColumn.toLowerCase() + &quot;=null&quot;);
                         	}
                             appendIt = true;
                         }
                     }
-
                     if(appendIt) {
                         updateCust.append(&quot;, &quot;);
                         updateCust.append(appendValue);
@@ -502,7 +500,7 @@ public class RecipientDaoImpl implements RecipientDao {
                 updateCust.append(&quot; WHERE customer_id=&quot; + cust.getCustomerID());
 
                 try {
-                    JdbcTemplate tmpl=new JdbcTemplate((DataSource)this.applicationContext.getBean(&quot;dataSource&quot;));
+                    JdbcTemplate tmpl = new JdbcTemplate((DataSource)this.applicationContext.getBean(&quot;dataSource&quot;));
                     AgnUtils.logger().info(&quot;updateInDB: &quot; + updateCust.toString());
                     tmpl.execute(updateCust.toString());
                     
@@ -511,27 +509,25 @@ public class RecipientDaoImpl implements RecipientDao {
                     	List list = tmpl.queryForList(sql, new Object[] {new Integer(cust.getCompanyID())});
                     	Iterator id = list.iterator();
                     	if(!id.hasNext()) {
-                    		aParameter=(String) cust.getCustParameters(&quot;DATASOURCE_ID&quot;);
+                    		aParameter = (String) cust.getCustParameters(&quot;DATASOURCE_ID&quot;);
                     		if(!StringUtils.isEmpty(aParameter)){
                     			try {
-                    				intValue=Integer.parseInt(aParameter);
+                    				intValue = Integer.parseInt(aParameter);
                     				sql = &quot;update customer_&quot; + cust.getCompanyID() + &quot;_tbl set datasource_id = &quot; + intValue + &quot; where customer_id = &quot; + cust.getCustomerID();
                     				tmpl.execute(sql);
                     			} catch (Exception e1) {}
                     		}
                     	}
                     }
-                } catch (Exception e3) {
+                } catch(Exception e3) {
                     // Util.SQLExceptionHelper(e3,dbConn);
                     AgnUtils.logger().error(&quot;updateInDB: &quot; + e3.getMessage());
                     result = false;
                 }
-
             } else {
                 AgnUtils.logger().info(&quot;updateInDB: nothing changed&quot;);
             }
         }
-
         return result;
     }
     
@@ -576,8 +572,7 @@ public class RecipientDaoImpl implements RecipientDao {
                 // cannot use queryForInt, because of possible existing doublettes
                 List&lt;Map&lt;String,Integer&gt;&gt; custList = (List&lt;Map&lt;String,Integer&gt;&gt;) tmpl.queryForList(getCust);
                 if(custList.size() &gt; 0) {
-                	Map  map=new CaseInsensitiveMap(custList.get(0));
-
+                	Map map = new CaseInsensitiveMap(custList.get(0));
                 	cust.setCustomerID(((Number) map.get(&quot;customer_id&quot;)).intValue());
                 } else {
                 	cust.setCustomerID(0);
@@ -589,7 +584,6 @@ public class RecipientDaoImpl implements RecipientDao {
             System.err.println(AgnUtils.getStackTrace(e));
             cust.setCustomerID(0);
         }
-
         return cust.getCustomerID();
     }
 
@@ -641,14 +635,14 @@ public class RecipientDaoImpl implements RecipientDao {
      * @param passValue Value for Password
      */
     public int findByUserPassword(int companyID, String userCol, String userValue, String passCol, String passValue) {
-        String getCust=null;
+        String getCust = null;
         int customerID = 0;
 
         if(userCol.toLowerCase().equals(&quot;email&quot;)) {
-            userValue=userValue.toLowerCase();
+            userValue = userValue.toLowerCase();
         }
 
-        getCust=&quot;SELECT customer_id FROM customer_&quot; + companyID + &quot;_tbl cust WHERE cust.&quot;+SafeString.getSQLSafeString(userCol, 30)+&quot;='&quot;+SafeString.getSQLSafeString(userValue)+&quot;' AND cust.&quot;+SafeString.getSQLSafeString(passCol, 30)+&quot;='&quot;+SafeString.getSQLSafeString(passValue)+&quot;'&quot;;
+        getCust = &quot;SELECT customer_id FROM customer_&quot; + companyID + &quot;_tbl cust WHERE cust.&quot;+SafeString.getSQLSafeString(userCol, 30)+&quot;='&quot;+SafeString.getSQLSafeString(userValue)+&quot;' AND cust.&quot;+SafeString.getSQLSafeString(passCol, 30)+&quot;='&quot;+SafeString.getSQLSafeString(passValue)+&quot;'&quot;;
 
         try {
             JdbcTemplate tmpl = new JdbcTemplate((DataSource)this.applicationContext.getBean(&quot;dataSource&quot;));
@@ -657,7 +651,6 @@ public class RecipientDaoImpl implements RecipientDao {
             customerID = 0;
             AgnUtils.logger().error(&quot;findByUserPassword: &quot; + e.getMessage());
         }
-
         return customerID;
     }
 
@@ -701,11 +694,11 @@ public class RecipientDaoImpl implements RecipientDao {
                         case java.sql.Types.TIMESTAMP:
                         case java.sql.Types.TIME:
                         case java.sql.Types.DATE:
-				try {
-					aTime = rset.getTimestamp(a);
-				} catch(Exception e) {
-					aTime=null;
-				}
+                        	try {
+                        		aTime = rset.getTimestamp(a);
+                        	} catch(Exception e) {
+                        		aTime = null;
+                        	}
                             if(aTime == null) {
                                 cust.getCustParameters().put(aName + &quot;_DAY_DATE&quot;, new String(&quot;&quot;));
                                 cust.getCustParameters().put(aName + &quot;_MONTH_DATE&quot;, new String(&quot;&quot;));
@@ -718,7 +711,7 @@ public class RecipientDaoImpl implements RecipientDao {
                                 GregorianCalendar aCal = new GregorianCalendar();
                                 aCal.setTime(aTime);
                                 cust.getCustParameters().put(aName + &quot;_DAY_DATE&quot;, Integer.toString(aCal.get(GregorianCalendar.DAY_OF_MONTH)));
-                                cust.getCustParameters().put(aName + &quot;_MONTH_DATE&quot;, Integer.toString(aCal.get(GregorianCalendar.MONTH)+1));
+                                cust.getCustParameters().put(aName + &quot;_MONTH_DATE&quot;, Integer.toString(aCal.get(GregorianCalendar.MONTH) + 1));
                                 cust.getCustParameters().put(aName + &quot;_YEAR_DATE&quot;, Integer.toString(aCal.get(GregorianCalendar.YEAR)));
                                 cust.getCustParameters().put(aName + &quot;_HOUR_DATE&quot;, Integer.toString(aCal.get(GregorianCalendar.HOUR_OF_DAY)));
                                 cust.getCustParameters().put(aName + &quot;_MINUTE_DATE&quot;, Integer.toString(aCal.get(GregorianCalendar.MINUTE)));
@@ -746,9 +739,7 @@ public class RecipientDaoImpl implements RecipientDao {
             AgnUtils.logger().error(&quot;getCustomerDataFromDb: &quot;+e.getMessage());
         }
         DataSourceUtils.releaseConnection(con, ds);
-
         cust.setChangeFlag(false);
-
         return cust.getCustParameters();
     }
     
@@ -784,7 +775,6 @@ public class RecipientDaoImpl implements RecipientDao {
         Hashtable mTable = new Hashtable(); // Media_ID as key, contains rest of data (user type, status etc.)
         String sqlGetLists = null;
         BindingEntry aEntry = null;
-
         int tmpMLID = 0;
 
         try {
@@ -799,7 +789,7 @@ public class RecipientDaoImpl implements RecipientDao {
                 int listID = ((Number) map.get(&quot;mailinglist_id&quot;)).intValue();
                 Integer mediaType = new Integer(((Number) map.get(&quot;mediatype&quot;)).intValue());
 
-                aEntry=(BindingEntry) applicationContext.getBean(&quot;BindingEntry&quot;);
+                aEntry = (BindingEntry) applicationContext.getBean(&quot;BindingEntry&quot;);
                 aEntry.setCustomerID(customerID);
                 aEntry.setMailinglistID(listID);
                 aEntry.setUserType((String) map.get(&quot;user_type&quot;));
@@ -822,15 +812,12 @@ public class RecipientDaoImpl implements RecipientDao {
                     mTable.put(mediaType.toString(), aEntry);
                 }
             }
-
             cust.getListBindings().put(new Integer(tmpMLID).toString() , mTable);
-
         } catch (Exception e) {
         	AgnUtils.sendExceptionMail(&quot;sql:&quot; + sqlGetLists, e);
-            AgnUtils.logger().error(&quot;loadAllListBindings: &quot;+e.getMessage());
+            AgnUtils.logger().error(&quot;loadAllListBindings: &quot; + e.getMessage());
             return null;
         }
-
         return cust.getListBindings();
     }
     
@@ -840,7 +827,7 @@ public class RecipientDaoImpl implements RecipientDao {
      * @return true if E-Mail-Adress is blacklisted
      */
     public boolean blacklistCheck(String email) {
-        boolean returnValue=false;
+        boolean returnValue = false;
         String sqlSelect = null;
         
         try {
@@ -865,7 +852,6 @@ public class RecipientDaoImpl implements RecipientDao {
         return returnValue;
     }
     
-    
     private boolean	isBlank(String s) {
 		if(StringUtils.isEmpty(s)) {
 			return true;
@@ -891,17 +877,16 @@ public class RecipientDaoImpl implements RecipientDao {
 		}
 	}
 
-	public String	getField(String selectVal, int recipientID, int companyID)	{
+	public String getField(String selectVal, int recipientID, int companyID)	{
 		JdbcTemplate jdbc = new JdbcTemplate((DataSource)this.applicationContext.getBean(&quot;dataSource&quot;));
-		String sql=&quot;SELECT &quot;+selectVal+&quot; value FROM customer_&quot;+companyID+&quot;_tbl cust WHERE cust.customer_id=?&quot;;
+		String sql = &quot;SELECT &quot; + selectVal + &quot; value FROM customer_&quot; + companyID + &quot;_tbl cust WHERE cust.customer_id=?&quot;;
 
 		try {
-			List list=jdbc.queryForList(sql, new Object[]{ new Integer(recipientID)});
+			List list = jdbc.queryForList(sql, new Object[]{ new Integer(recipientID)});
 
 			if(list.size() &gt; 0) {
-				Map map=(Map) list.get(0);
+				Map map = (Map) list.get(0);
 				Object temp = map.get(&quot;value&quot;);
-
 				if(temp != null) {
 					return temp.toString();
 				}
@@ -914,29 +899,29 @@ public class RecipientDaoImpl implements RecipientDao {
 		return &quot;&quot;;
 	}
 
-	public Map&lt;Integer, Map&gt;	getAllMailingLists(int customerID, int companyID) {
-		Map&lt;Integer, Map&gt;	result=new HashMap();
-		String sql=&quot;SELECT mailinglist_id, user_type, user_status, user_remark, &quot;+AgnUtils.changeDateName()+&quot;, mediatype FROM customer_&quot; + companyID + &quot;_binding_tbl WHERE customer_id=? ORDER BY mailinglist_id, mediatype&quot;;
-		JdbcTemplate jdbc=new JdbcTemplate((DataSource) this.applicationContext.getBean(&quot;dataSource&quot;));
-		AgnUtils.logger().info(&quot;getAllMailingLists: &quot;+sql);
+	public Map&lt;Integer, Map&gt; getAllMailingLists(int customerID, int companyID) {
+		Map&lt;Integer, Map&gt; result = new HashMap();
+		String sql = &quot;SELECT mailinglist_id, user_type, user_status, user_remark, &quot; + AgnUtils.changeDateName()+&quot;, mediatype FROM customer_&quot; + companyID + &quot;_binding_tbl WHERE customer_id=? ORDER BY mailinglist_id, mediatype&quot;;
+		JdbcTemplate jdbc = new JdbcTemplate((DataSource) this.applicationContext.getBean(&quot;dataSource&quot;));
+		AgnUtils.logger().info(&quot;getAllMailingLists: &quot; + sql);
 
 		try	{
-			List list=jdbc.queryForList(sql, new Object[]{new Integer(customerID)});
-			Iterator i=list.iterator();
-			BindingEntry entry=null;
+			List list = jdbc.queryForList(sql, new Object[]{new Integer(customerID)});
+			Iterator i = list.iterator();
+			BindingEntry entry = null;
 
 			while(i.hasNext()) {
-				Map map=(Map) i.next();
-				int listID=((Number) map.get(&quot;mailinglist_id&quot;)).intValue();
-				int mediaType=((Number) map.get(&quot;mediatype&quot;)).intValue();
-				Map sub=(Map) result.get(new Integer(listID));
+				Map map = (Map) i.next();
+				int listID = ((Number) map.get(&quot;mailinglist_id&quot;)).intValue();
+				int mediaType = ((Number) map.get(&quot;mediatype&quot;)).intValue();
+				Map sub = (Map) result.get(new Integer(listID));
 
 				if(sub == null) {
-					sub=new HashMap();
+					sub = new HashMap();
 				}
-				entry=(BindingEntry) applicationContext.getBean(&quot;BindingEntry&quot;);
+				entry = (BindingEntry) applicationContext.getBean(&quot;BindingEntry&quot;);
 				entry.setCustomerID(customerID);
-                                entry.setMailinglistID(listID);
+                entry.setMailinglistID(listID);
 				entry.setUserType((String) map.get(&quot;user_type&quot;));
 				entry.setUserStatus(((Number) map.get(&quot;user_status&quot;)).intValue());
 				entry.setUserRemark((String) map.get(&quot;user_remark&quot;));
@@ -947,37 +932,37 @@ public class RecipientDaoImpl implements RecipientDao {
 			}
 		} catch(Exception e) {
 			AgnUtils.sendExceptionMail(&quot;sql:&quot; + sql + &quot;, &quot; + customerID, e);
-			AgnUtils.logger().error(&quot;getAllMailingLists: &quot;+e.getMessage());
+			AgnUtils.logger().error(&quot;getAllMailingLists: &quot; + e.getMessage());
 		}
 		return result;
 	}
 
 	public boolean createImportTables(int companyID, int datasourceID, CustomerImportStatus status) {
-		JdbcTemplate jdbc=new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+		JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
 		String prefix = &quot;cust_&quot; + companyID + &quot;_tmp&quot;;
 		String tabName = prefix+datasourceID+&quot;_tbl&quot;;
 		String keyIdx = prefix+datasourceID+&quot;$KEYCOL$IDX&quot;;
 		String custIdx = prefix+datasourceID+&quot;$CUSTID$IDX&quot;;
-		String sql=null;
+		String sql = null;
 
 		try {
-			sql=&quot;create temporary table &quot;+tabName+&quot; as (select * from customer_&quot; + companyID + &quot;_tbl where 1=0)&quot;;
+			sql = &quot;create temporary table &quot; + tabName + &quot; as (select * from customer_&quot; + companyID + &quot;_tbl where 1=0)&quot;;
 			jdbc.execute(sql);
 
-			sql=&quot;alter table &quot;+tabName+&quot; modify change_date timestamp null default null&quot;;
+			sql = &quot;alter table &quot; + tabName + &quot; modify change_date timestamp null default null&quot;;
 			jdbc.execute(sql);
 
-			sql=&quot;alter table &quot;+tabName+&quot; modify creation_date timestamp null default current_timestamp&quot;;
+			sql = &quot;alter table &quot; + tabName + &quot; modify creation_date timestamp null default current_timestamp&quot;;
 			jdbc.execute(sql);
 
-			sql=&quot;create index &quot; + keyIdx + &quot; on &quot;+tabName+&quot; (&quot;+SafeString.getSQLSafeString(status.getKeycolumn())+&quot;)&quot;;
+			sql = &quot;create index &quot; + keyIdx + &quot; on &quot; + tabName + &quot; (&quot; + SafeString.getSQLSafeString(status.getKeycolumn()) + &quot;)&quot;;
 			jdbc.execute(sql);
 
-			sql=&quot;create index &quot; + custIdx +&quot; on &quot;+tabName+&quot; (customer_id)&quot;;
+			sql = &quot;create index &quot; + custIdx +&quot; on &quot; + tabName + &quot; (customer_id)&quot;;
 			jdbc.execute(sql);
 		}   catch (Exception e) {
-			AgnUtils.logger().error(&quot;createTemporaryTables: &quot;+e.getMessage());
-			AgnUtils.logger().error(&quot;Statement: &quot;+sql);
+			AgnUtils.logger().error(&quot;createTemporaryTables: &quot; + e.getMessage());
+			AgnUtils.logger().error(&quot;Statement: &quot; + sql);
 			e.printStackTrace();
 			return false;
 		}
@@ -985,15 +970,15 @@ public class RecipientDaoImpl implements RecipientDao {
 	}
 
 	public boolean deleteImportTables(int companyID, int datasourceID) {
-		JdbcTemplate jdbc=new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
-		String tabName = &quot;cust_&quot; + companyID + &quot;_tmp&quot;+datasourceID+&quot;_tbl&quot;;
+		JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+		String tabName = &quot;cust_&quot; + companyID + &quot;_tmp&quot; + datasourceID + &quot;_tbl&quot;;
 
 		if(AgnUtils.isOracleDB()) {
 			try {
 				jdbc.execute(&quot;drop table &quot;+tabName);
 			} catch (Exception e) {
-				AgnUtils.logger().error(&quot;deleteTemporaryTables: &quot;+e.getMessage());
-				AgnUtils.logger().error(&quot;Table: &quot;+tabName);
+				AgnUtils.logger().error(&quot;deleteTemporaryTables: &quot; + e.getMessage());
+				AgnUtils.logger().error(&quot;Table: &quot; + tabName);
 				e.printStackTrace();
 				return false;
 			}
@@ -1008,7 +993,7 @@ public class RecipientDaoImpl implements RecipientDao {
 	 * @param aContext
 	 */
 	private DatasourceDescription getNewDatasourceDescription(int companyID, String description) {
-		HibernateTemplate tmpl=new HibernateTemplate((SessionFactory)applicationContext.getBean(&quot;sessionFactory&quot;));
+		HibernateTemplate tmpl = new HibernateTemplate((SessionFactory)applicationContext.getBean(&quot;sessionFactory&quot;));
 		DatasourceDescription dsDescription=(DatasourceDescription) applicationContext.getBean(&quot;DatasourceDescription&quot;);
 
 		dsDescription.setId(0);
@@ -1036,77 +1021,76 @@ public class RecipientDaoImpl implements RecipientDao {
 	 * @param req The HttpServletRequest that caused this action
 	 */
 	public void writeContent(ImportWizardForm aForm, int companyID) {
-                JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
-		HibernateTransactionManager tm=(HibernateTransactionManager) (applicationContext.getBean(&quot;transactionManager&quot;));
-		String currentTimestamp=AgnUtils.getHibernateDialect().getCurrentTimestampSQLFunctionName();
-		StringBuffer usedColumnsString=new StringBuffer();
-		StringBuffer copyColumnsString=new StringBuffer();
-		DefaultTransactionDefinition tdef=new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED);
-		TransactionStatus ts=null;
-		ListIterator aIt=null;
-		CsvColInfo aInfo=null;
-		DatasourceDescription dsDescription=getNewDatasourceDescription(companyID, aForm.getCsvFile().getFileName());
-		
+        JdbcTemplate jdbc = new JdbcTemplate((DataSource) applicationContext.getBean(&quot;dataSource&quot;));
+		HibernateTransactionManager tm = (HibernateTransactionManager) (applicationContext.getBean(&quot;transactionManager&quot;));
+		String currentTimestamp = AgnUtils.getHibernateDialect().getCurrentTimestampSQLFunctionName();
+		StringBuffer usedColumnsString = new StringBuffer();
+		StringBuffer copyColumnsString = new StringBuffer();
+		DefaultTransactionDefinition tdef = new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED);
+		TransactionStatus ts = null;
+		ListIterator aIt = null;
+		CsvColInfo aInfo = null;
+		DatasourceDescription dsDescription = getNewDatasourceDescription(companyID, aForm.getCsvFile().getFileName());
+
 		aForm.getStatus().setDatasourceID(dsDescription.getId());
-		
 		tm.setDataSource(jdbc.getDataSource());
 		AgnUtils.logger().info(&quot;Starting transaction&quot;);
-		ts=tm.getTransaction(tdef);
+		ts = tm.getTransaction(tdef);
 		try {
 			this.createTemporaryTables(aForm, companyID);
 			
-			int errorsOnInsert=0;
-			StringBuffer errorLines=new StringBuffer();
+			int errorsOnInsert = 0;
+			StringBuffer errorLines = new StringBuffer();
 			
 			// CUSTOMER_XX_TBL inserts:
-			String customer_body = &quot;INSERT INTO cust_&quot; + companyID + &quot;_tmp&quot;+dsDescription.getId()+&quot;_tbl ( datasource_id, change_date, creation_date&quot;;
+			String customer_body = &quot;INSERT INTO cust_&quot; + companyID + &quot;_tmp&quot; + dsDescription.getId()+&quot;_tbl ( datasource_id, change_date, creation_date&quot;;
 			
-			ArrayList usedColumns=new ArrayList();
-			aIt=aForm.getCsvAllColumns().listIterator();
-			int numFields=0;
+			ArrayList usedColumns = new ArrayList();
+			aIt = aForm.getCsvAllColumns().listIterator();
+			int numFields = 0;
 			while (aIt.hasNext()) {
-				aInfo=(CsvColInfo)aIt.next();
+				aInfo = (CsvColInfo)aIt.next();
 				
 				if(aForm.getColumnMapping().containsKey(aInfo.getName())) {
-					String curCol=((CsvColInfo)aForm.getColumnMapping().get(aInfo.getName())).getName();
+					String curCol = ((CsvColInfo)aForm.getColumnMapping().get(aInfo.getName())).getName();
 					customer_body += &quot;, &quot; + curCol;
 					numFields++;
 					usedColumns.add(aInfo);
-					usedColumnsString.append(curCol+&quot;, &quot;);
+					usedColumnsString.append(curCol + &quot;, &quot;);
 					copyColumnsString.append(&quot;cust.&quot; + curCol + &quot;=temp.&quot; + curCol + &quot;, &quot;);
 				}
 			}
 			
-			customer_body += &quot; ) VALUES &quot; + &quot;(&quot; + aForm.getDatasourceID() + &quot;, &quot;+currentTimestamp+ &quot;, &quot;+currentTimestamp;
-			for(int a=1; a&lt;=numFields; a++) {
-				customer_body+=&quot;, ?&quot;;
+			customer_body += &quot; ) VALUES &quot; + &quot;(&quot; + aForm.getDatasourceID() + &quot;, &quot; + currentTimestamp + &quot;, &quot;+ currentTimestamp;
+			for(int a = 1; a &lt;= numFields; a++) {
+				customer_body += &quot;, ?&quot;;
 			}
-			customer_body+=&quot;)&quot;;
+			customer_body += &quot;)&quot;;
 			// values:
-			int x=0;
-			Object aVal=null;
+			int x = 0;
+			Object aVal = null;
 			try {
-				ListIterator contentIterator=aForm.getParsedContent().listIterator();
-				LinkedList aLine=null;
+				ListIterator contentIterator = aForm.getParsedContent().listIterator();
+				LinkedList aLine = null;
 				
 				while(contentIterator.hasNext()) {
 					try {
-						Vector params=new Vector();
+						Vector params = new Vector();
 						
-						aLine=(LinkedList)contentIterator.next();
-						for(int a=0; a&lt;numFields; a++) {
-							aInfo=(CsvColInfo)usedColumns.get(a);
-							aVal=aLine.get(a);
-							if(aInfo.getType()==CsvColInfo.TYPE_CHAR) {
+						aLine = (LinkedList)contentIterator.next();
+						for(int a = 0; a &lt; numFields; a++) {
+							aInfo = (CsvColInfo)usedColumns.get(a);
+							aVal = aLine.get(a);
+							if(aInfo.getType() == CsvColInfo.TYPE_CHAR) {
 								params.add((String)aVal);
-							} else if(aInfo.getType()==CsvColInfo.TYPE_NUMERIC) {
-								if(aVal!=null) {
+							} else if(aInfo.getType() == CsvColInfo.TYPE_NUMERIC) {
+								if(aVal != null) {
 									params.add(new Double(((Double)aVal).doubleValue()));
 								} else {
 									params.add(new Integer(0));
 								}
-							} else if(aInfo.getType()==CsvColInfo.TYPE_DATE) {
-								if(aVal!=null) {
+							} else if(aInfo.getType() == CsvColInfo.TYPE_DATE) {
+								if(aVal != null) {
 									params.add((java.util.Date)aVal);
 								} else {
 									params.add(new Integer(0));
@@ -1116,14 +1100,14 @@ public class RecipientDaoImpl implements RecipientDao {
 						jdbc.update(customer_body, params.toArray());
 					} catch (Exception e1) {
 						errorsOnInsert++;
-						AgnUtils.logger().error(&quot;writeContent: &quot;+e1);
+						AgnUtils.logger().error(&quot;writeContent: &quot; + e1);
 						e1.printStackTrace();
 					}
 					aForm.setDbInsertStatus((int)((((double)x)/aForm.getLinesOK())*100.0));
 					x++;
 				}
 			} catch (Exception e) {
-				AgnUtils.logger().error(&quot;writeContent: &quot;+e);
+				AgnUtils.logger().error(&quot;writeContent: &quot; + e);
 				e.printStackTrace();
 			}
 			
@@ -1131,13 +1115,13 @@ public class RecipientDaoImpl implements RecipientDao {
 			tm.commit(ts);
 		}   catch (Exception e) {
 			tm.rollback(ts);
-			AgnUtils.logger().error(&quot;writeContent: &quot;+e);
+			AgnUtils.logger().error(&quot;writeContent: &quot; + e);
 			e.printStackTrace();
 		}
 		
-		ts=tm.getTransaction(tdef);
+		ts = tm.getTransaction(tdef);
 		try {
-			String sql=null;
+			String sql = null;
 			
 			if(aForm.getStatus().getDoubleCheck() == CustomerImportStatus.DOUBLECHECK_FULL) {
 				try {
@@ -1147,8 +1131,8 @@ public class RecipientDaoImpl implements RecipientDao {
 					jdbc.execute(sql);
 					
 				} catch (Exception e) {
-					AgnUtils.logger().error(&quot;writeContent: &quot;+e);
-					AgnUtils.logger().error(&quot;Statement: &quot;+sql);
+					AgnUtils.logger().error(&quot;writeContent: &quot; + e);
+					AgnUtils.logger().error(&quot;Statement: &quot; + sql);
 					e.printStackTrace();
 				}
 				
@@ -1420,6 +1404,75 @@ public class RecipientDaoImpl implements RecipientDao {
         }
         return returnValue;
     }
+	
+	public PaginatedList getRecipientList( String sqlStatement, String sort, String direction , int page, int rownums, int previousFullListSize ) throws IllegalAccessException, InstantiationException {
+    	
+		List&lt;String&gt;  charColumns = Arrays.asList(new String[]{&quot;firstname&quot;,&quot;lastname&quot;,&quot;email&quot; });
+		String[] columns = new String[] {&quot;&quot;,&quot;firstname&quot;,&quot;lastname&quot;,&quot;email&quot;,&quot;&quot; };
+		String upperSort = getUpperSort(charColumns, sort); 
+		
+		// TODO use RecipientQueryBuilder inside DAO 
+    	JdbcTemplate aTemplate = new JdbcTemplate((DataSource)this.applicationContext.getBean(&quot;dataSource&quot;));
+    	int totalRows = aTemplate.queryForInt(&quot;SELECT count(*) FROM ( &quot; + sqlStatement + &quot; ) agn&quot; );
+     	if( previousFullListSize == 0 || previousFullListSize != totalRows ) {
+     		page = 1;
+     	}
+    	 
+    	
+     	int offset =  ( page - 1) * rownums;  
+ 	
+    	if ( AgnUtils.isMySQLDB()) {
+    		sqlStatement = sqlStatement + &quot; LIMIT  &quot; + offset + &quot; , &quot; + rownums;
+    	}
+    	
+    	if ( AgnUtils.isOracleDB()) {
+    		sqlStatement = &quot;SELECT * from ( select customer_id, gender, firstname,lastname, email ,rownum r from ( &quot; + sqlStatement + &quot; )  where 1=1 ) where r between &quot; + offset + &quot; and &quot; + ( offset+ rownums );
+    	}
+    	
+    	List&lt;Map&gt; tmpList = aTemplate.queryForList(sqlStatement);
+	     DynaProperty[] properties = new DynaProperty[] {
+	    		  new DynaProperty(&quot;customerid&quot;, Integer.class),
+	    		  new DynaProperty(&quot;gender&quot;, Integer.class),
+	    		  new DynaProperty(&quot;firstname&quot;, String.class),
+	    		  new DynaProperty(&quot;lastname&quot;, String.class),
+	    		  new DynaProperty(&quot;email&quot;,String.class)   		  
+	      };
+	     
+	      if( AgnUtils.isOracleDB()) {
+	    	  properties = new DynaProperty[] {
+		    		  new DynaProperty(&quot;customerid&quot;, BigDecimal.class),
+		    		  new DynaProperty(&quot;gender&quot;,BigDecimal.class),
+		    		  new DynaProperty(&quot;firstname&quot;, String.class),
+		    		  new DynaProperty(&quot;lastname&quot;, String.class),
+		    		  new DynaProperty(&quot;email&quot;,String.class) 
+	      };
+	      }
+	      
+	      BasicDynaClass dynaClass = new BasicDynaClass(&quot;recipient&quot;, null, properties);
+	      List&lt;DynaBean&gt; result = new ArrayList&lt;DynaBean&gt;();
+	      for(Map row:tmpList) {
+	    	  DynaBean newBean = dynaClass.newInstance();    	
+	    	  newBean.set(&quot;customerid&quot;, row.get(&quot;CUSTOMER_ID&quot;));
+	    	  newBean.set(&quot;gender&quot;, row.get(&quot;GENDER&quot;));
+	    	  newBean.set(&quot;firstname&quot;, row.get(&quot;FIRSTNAME&quot;));
+	    	  newBean.set(&quot;lastname&quot;, row.get(&quot;LASTNAME&quot;));
+	    	  newBean.set(&quot;email&quot;,row.get(&quot;EMAIL&quot;));
+	    	  result.add(newBean);
+	      }    
+	   
+	      DynaBeanPaginatedListImpl paginatedList = new DynaBeanPaginatedListImpl(result, totalRows, rownums, page, sort, direction );
+	      return paginatedList;    	
+    }
+	
+	private String getUpperSort(List&lt;String&gt; charColumns, String sort) {
+		String upperSort = sort;
+		if (charColumns.contains( sort )) {
+	    	upperSort =   &quot;upper( &quot; +sort + &quot; )&quot;;
+	     }
+		return upperSort;
+	}
+	
+	
 
 	/**
 	 * Holds value of property applicationContext.</diff>
      <filename>src/java/org/agnitas/dao/impl/RecipientDaoImpl.java</filename>
    </modified>
    <modified>
      <diff>@@ -95,8 +95,6 @@ public class MailingStatImpl implements MailingStat {
     protected LinkedList clickedUrls;
     protected LinkedList notRelevantUrls;
 
-    protected double revenue;
-
     /**
      * Holds value of property maxNRblue.
      */
@@ -1387,7 +1385,7 @@ public boolean getOpenTimeStatFromDB(ApplicationContext con, javax.servlet.http.
         startDate=aCal.getTime();
 
         // *  BUILD PROCEDURE: *
-        String sqlQuery = &quot;select &quot; + AgnUtils.sqlDateString(&quot;change_date&quot;, &quot;%h&quot;) + &quot;as time, count(customer_id) as total from onepixel_log_tbl where company_id=&quot; + companyID + &quot; and mailing_id=&quot; + mailingID + &quot; and &quot; + AgnUtils.sqlDateString(&quot;change_date&quot;, &quot;yyyymmdd&quot;) + &quot; = '&quot; + formatter.format(startDate) + &quot;' group by &quot; + AgnUtils.sqlDateString(&quot;change_date&quot;, &quot;%h&quot;);
+        String sqlQuery = &quot;select &quot; + AgnUtils.sqlDateString(&quot;change_date&quot;, &quot;%H&quot;) + &quot;as time, count(customer_id) as total from onepixel_log_tbl where company_id=&quot; + companyID + &quot; and mailing_id=&quot; + mailingID + &quot; and &quot; + AgnUtils.sqlDateString(&quot;change_date&quot;, &quot;yyyymmdd&quot;) + &quot; = '&quot; + formatter.format(startDate) + &quot;' group by &quot; + AgnUtils.sqlDateString(&quot;change_date&quot;, &quot;%h&quot;);
         																																															
         // CALL PROCEDURE:
         // don't bother about zero clicks on a particular day: checking is performed in JSP</diff>
      <filename>src/java/org/agnitas/stat/impl/MailingStatImpl.java</filename>
    </modified>
    <modified>
      <diff>@@ -56,22 +56,18 @@ public class DBColumnAlias extends BodyBase {
      * lists shortnames
      */
     public int doStartTag() throws JspTagException {
-
         ApplicationContext aContext=WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
         JdbcTemplate jdbc=AgnUtils.getJdbcTemplate(aContext);
         String result=new String(this.column);
         String sql=&quot;SELECT shortname FROM customer_field_tbl WHERE company_id=&quot;+this.getCompanyID()+&quot; AND col_name=? AND (admin_id=? OR admin_id=0) ORDER BY admin_id DESC&quot;;
         
         try {
-        	
-        	List l=jdbc.queryForList(sql, new Object[] {this.column, new Integer(((Admin)this.pageContext.getAttribute(&quot;emm.admin&quot;, PageContext.SESSION_SCOPE)).getAdminID())}, String.class);
+        	List l=jdbc.queryForList(sql, new Object[] {this.column, new Integer(((Admin)this.pageContext.getAttribute(&quot;emm.admin&quot;, PageContext.SESSION_SCOPE)).getAdminID())});
 
             if(l !=null &amp;&amp; l.size() &gt; 0) {
                 Map row=(Map)l.get(0);
-
                 result=(String) row.get(&quot;shortname&quot;);
             }
-            
         } catch (Exception e) {
         	AgnUtils.sendExceptionMail(&quot;sql:&quot; + sql + &quot;, &quot; + column + &quot;, &quot; + ((Admin)this.pageContext.getAttribute(&quot;emm.admin&quot;, PageContext.SESSION_SCOPE)).getAdminID(), e);
             AgnUtils.logger().error(&quot;doStartTag: &quot;+e.getMessage());
@@ -83,7 +79,6 @@ public class DBColumnAlias extends BodyBase {
         return SKIP_BODY;
     }
     private void writeResult( String result ) {
-        
     	try {
     		JspWriter out=null;
     		out=pageContext.getOut();</diff>
      <filename>src/java/org/agnitas/taglib/DBColumnAlias.java</filename>
    </modified>
    <modified>
      <diff>@@ -177,6 +177,7 @@ public class ShowSubscriberStat extends BodyBase {
                         break;
 
                     case BindingEntry.USER_STATUS_OPTOUT:
+                    case BindingEntry.USER_STATUS_ADMINOUT:
                         tmpValue=rset.getInt(3);
                         this.allOptouts.put(rset.getString(1), new Integer(tmpValue));
                         if(this.maxOptout&lt;tmpValue)</diff>
      <filename>src/java/org/agnitas/taglib/ShowSubscriberStat.java</filename>
    </modified>
    <modified>
      <diff>@@ -113,7 +113,8 @@ public class TargetNodeDate extends TargetNode implements Serializable {
             if(this.primaryValue.startsWith(AgnUtils.getSQLCurrentTimestampName())) {
                 tmpSQL.append(&quot; &quot; + AgnUtils.sqlDateString(this.primaryValue, this.dateFormat));
             } else {
-                tmpSQL.append(&quot; &quot; + AgnUtils.sqlDateString(this.primaryValue, this.dateFormat));
+                //tmpSQL.append(&quot; &quot; + AgnUtils.sqlDateString(this.primaryValue, this.dateFormat));
+                tmpSQL.append(&quot;'&quot;+this.primaryValue+&quot;' &quot;);
             }
         }
 </diff>
      <filename>src/java/org/agnitas/target/impl/TargetNodeDate.java</filename>
    </modified>
    <modified>
      <diff>@@ -143,7 +143,11 @@ public class TargetNodeString extends TargetNode implements Serializable {
                 tmpBsh.append(&quot;AgnUtils.match(AgnUtils.toLowerCase(\&quot;&quot;);
                 tmpBsh.append(this.primaryValue);
                 tmpBsh.append(&quot;\&quot;), AgnUtils.toLowerCase(&quot;);
-              	tmpBsh.append(this.primaryField);
+              	if( AgnUtils.isOracleDB() ) {
+                	tmpBsh.append(this.primaryField.toUpperCase());
+                } else {                
+                	tmpBsh.append(this.primaryField);
+                }
                 tmpBsh.append(&quot;))&quot;);
                 break;
                 </diff>
      <filename>src/java/org/agnitas/target/impl/TargetNodeString.java</filename>
    </modified>
    <modified>
      <diff>@@ -88,7 +88,7 @@ public class AgnUtils {
 	 * @return version the current version
 	 */
 	public static String getCurrentVersion() {
-		return isOracleDB() ? &quot;6.0&quot; : &quot;5.5.0&quot;;
+		return isOracleDB() ? &quot;6.1&quot; : &quot;5.5.1&quot;;
 	}
 	
     /** </diff>
      <filename>src/java/org/agnitas/util/AgnUtils.java</filename>
    </modified>
    <modified>
      <diff>@@ -15,14 +15,14 @@ import org.displaytag.tags.TableTagParameters;
 import org.displaytag.util.ParamEncoder;
 import org.springframework.context.ApplicationContext;
 
+import bsh.commands.dir;
+
 /**
  * Helper-class for building the sql-query in /recipient/list.jsp 
  * @author ms
  *
  */
-
 public class RecipientQueryBuilder {
-	
 	/**
 	 * construct a sql query from all the provided parameters
 	 * @param request
@@ -30,34 +30,33 @@ public class RecipientQueryBuilder {
 	 * @return
 	 */
 	public static String getSQLStatement(HttpServletRequest request, ApplicationContext context, RecipientForm aForm) {
-		
 		 // helps displaytag-sorting
 		 List&lt;Integer&gt;  charColumns = Arrays.asList(new Integer[]{1,2,3 });
-		 String[] columns = new String[] {&quot;&quot;,&quot;cust.firstname&quot;,&quot;cust.lastname&quot;,&quot;cust.email&quot;,&quot;&quot; };
-		 
-	     int sortcolumnindex = 3; 
-	     if( request.getParameter(new ParamEncoder(&quot;recipient&quot;).encodeParameterName(TableTagParameters.PARAMETER_SORT)) != null ) {
-	    	sortcolumnindex = Integer.parseInt(request.getParameter(new ParamEncoder(&quot;recipient&quot;).encodeParameterName(TableTagParameters.PARAMETER_SORT))); 
-	     }	
-	     
-	     String sort =  columns[sortcolumnindex];
-	     if (charColumns.contains(sortcolumnindex)) {
-	    	 sort =   &quot;upper( &quot; +sort + &quot; )&quot;;
-	     }
-	     
-	     int order = 1; 
-	     if( request.getParameter(new ParamEncoder(&quot;recipient&quot;).encodeParameterName(TableTagParameters.PARAMETER_ORDER)) != null ) {
-	    	 order = new Integer(request.getParameter(new ParamEncoder(&quot;recipient&quot;).encodeParameterName(TableTagParameters.PARAMETER_ORDER)));
-	     }
-		 
+		 String[] columns = new String[] {&quot;&quot;,&quot;firstname&quot;,&quot;lastname&quot;,&quot;email&quot;,&quot;&quot; };
+
+		 String sort = request.getParameter(&quot;sort&quot;);
+		 if(sort == null) {
+			 sort = aForm.getSort();
+		 }
+		
+		 String upperSort = sort;
+		 if(charColumns.contains(sort)) {
+	    	upperSort =   &quot;upper( &quot; +sort + &quot; )&quot;;
+	     }		 
+     	
+      	String direction = request.getParameter(&quot;dir&quot;);
+		if(direction == null) {
+			direction = aForm.getOrder();
+		}
+      	
 		// stuff from JSP &lt;%...%&gt;
 		int mailingListID = 0;
 	    int targetID;
 	    String user_type = null;
 	    int user_status = 0;
 	        	
-	    if( request.getParameter(&quot;listID&quot;) != null) {
-	    		aForm.setListID( Integer.parseInt(request.getParameter(&quot;listID&quot;)));
+	    if(request.getParameter(&quot;listID&quot;) != null) {
+	    	aForm.setListID( Integer.parseInt(request.getParameter(&quot;listID&quot;)));
 	    }
 	    mailingListID = aForm.getListID();
 
@@ -66,28 +65,28 @@ public class RecipientQueryBuilder {
 	    }
 	    targetID = aForm.getTargetID();
 
-	    if(request.getParameter(&quot;user_type&quot;)!=null){   
+	    if(request.getParameter(&quot;user_type&quot;)!=null) {   
 	       aForm.setUser_type(request.getParameter(&quot;user_type&quot;));
 	    }	
 	    user_type = aForm.getUser_type();
 	    
-	    if(request.getParameter(&quot;user_status&quot;)!=null){
+	    if(request.getParameter(&quot;user_status&quot;)!=null) {
 	        aForm.setUser_status(Integer.parseInt(request.getParameter(&quot;user_status&quot;)));
 	    } 
 	    user_status = aForm.getUser_status();
 	    
 	    RecipientForm rec = (RecipientForm) request.getSession().getAttribute(&quot;recipientForm&quot;);
-	    TargetRepresentation targetRep=rec.getTarget();
-		Vector  condition=new Vector();
+	    TargetRepresentation targetRep = rec.getTarget();
+		Vector  condition = new Vector();
 		
 		String userType = (String)(request.getParameter(&quot;user_type&quot;));
 		if((userType != null) &amp;&amp; (userType.compareTo(&quot;E&quot;) != 0 )) {
-			condition.add(&quot;bind.USER_TYPE ='&quot;+userType+&quot;'&quot;);
+			condition.add(&quot;bind.USER_TYPE ='&quot; + userType + &quot;'&quot;);
 		}
 		
 		int userStatus = 0;
 		userType = (String)(request.getParameter(&quot;user_status&quot;));
-		if (userType != null) { 
+		if(userType != null) { 
 			try {
 				userStatus = Integer.parseInt(userType);
 			} catch (Exception e) {
@@ -100,14 +99,13 @@ public class RecipientQueryBuilder {
 		
 		if(targetID != 0) {
 			TargetDao dao = (TargetDao) context.getBean(&quot;TargetDao&quot;);
-			Target target = dao.getTarget(targetID,
-						AgnUtils.getCompanyID(request));
+			Target target = dao.getTarget(targetID,	AgnUtils.getCompanyID(request));
 		
 			condition.add(target.getTargetSQL());
 		}
 		
 		if(mailingListID != 0) {
-			condition.add(&quot;bind.mailinglist_id=&quot; + mailingListID);
+			condition.add(&quot;bind.mailinglist_id=&quot;+mailingListID);
 		}
 
 		if(targetRep.generateSQL().length() &gt; 0 &amp;&amp; targetRep.checkBracketBalance()) {
@@ -117,17 +115,17 @@ public class RecipientQueryBuilder {
 		String sql=&quot;select cust.customer_id, cust.gender, cust.firstname, cust.lastname, cust.email FROM customer_&quot; + AgnUtils.getCompanyID(request) + &quot;_tbl cust&quot;;
 		
 		if(condition.size() &gt; 0) {
-			Iterator i=condition.iterator();
+			Iterator i = condition.iterator();
 			String  custWhere = &quot;&quot;;
 			String  bindWhere = &quot;&quot;;
 		
 			while(i.hasNext()) {
-				String  s=(String) i.next();
+				String s = (String) i.next();
 		
-				if(s.indexOf(&quot;bind.&quot;)!=-1) {
-					bindWhere += &quot; and &quot;+ s;
+				if(s.indexOf(&quot;bind.&quot;) != -1) {
+					bindWhere += &quot; and &quot; + s;
 				} else {
-					custWhere += &quot; and &quot;+ s;
+					custWhere += &quot; and &quot; + s;
 				}
 			}
 			sql += &quot; where &quot;;
@@ -142,21 +140,15 @@ public class RecipientQueryBuilder {
 				sql += bindWhere.substring(5);
 				sql += &quot;)&quot;;
 			}
-
 		}
 				
 		String sqlStatement = sql;
-	        sqlStatement = sqlStatement.replaceAll(&quot;cust[.]bind&quot;, &quot;bind&quot;);
-	    
-	    sqlStatement += &quot; ORDER BY &quot; + sort + &quot; &quot; + (order == 1 ?&quot;ASC&quot;:&quot;DESC&quot;);     
-	        
-	    // TODO limit rows for Oracle and MySQL 
-	    if( AgnUtils.isOracleDB()) {
-	    	
+	    sqlStatement = sqlStatement.replaceAll(&quot;cust[.]bind&quot;, &quot;bind&quot;);
+	    	        
+	    if(sort != null &amp;&amp; !&quot;&quot;.equals(sort.trim())) {
+	    	sqlStatement += &quot; ORDER BY &quot; + upperSort + &quot; &quot; + direction;
 	    }
 	    
 	    return sqlStatement; 
-	        
 	}
-
 }</diff>
      <filename>src/java/org/agnitas/util/RecipientQueryBuilder.java</filename>
    </modified>
    <modified>
      <diff>@@ -35,6 +35,7 @@ import org.agnitas.dao.AdminDao;
 import org.agnitas.dao.AdminGroupDao;
 import org.agnitas.dao.CompanyDao;
 import org.agnitas.util.AgnUtils;
+import org.agnitas.web.forms.AdminForm;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
@@ -49,7 +50,7 @@ import org.springframework.orm.hibernate3.HibernateTemplate;
  * @author Andreas Rehak, Martin Helff
  */
 
-public final class AdminAction extends StrutsActionBase {
+public class AdminAction extends StrutsActionBase {
 
     public static final int ACTION_VIEW_RIGHTS    = ACTION_LAST+1;
     public static final int ACTION_SAVE_RIGHTS    = ACTION_LAST+2;
@@ -78,23 +79,23 @@ public final class AdminAction extends StrutsActionBase {
             HttpServletResponse res)
             throws IOException, ServletException {
 
-        ApplicationContext aContext=this.getWebApplicationContext();
-        AdminForm aForm=null;
+        ApplicationContext aContext = this.getWebApplicationContext();
+        AdminForm aForm = null;
         ActionMessages errors = new ActionMessages();
-        ActionForward destination=null;
+        ActionForward destination = null;
 
         if(!this.checkLogon(req)) {
             return mapping.findForward(&quot;logon&quot;);
         }
 
-        if(form!=null) {
-            aForm=(AdminForm)form;
+        if(form != null) {
+            aForm = (AdminForm)form;
         } else {
-            aForm=new AdminForm();
+            aForm = new AdminForm();
         }
 
-        AgnUtils.logger().info(&quot;Action: &quot;+aForm.getAction());
-        if(req.getParameter(&quot;delete.x&quot;)!=null) {
+        AgnUtils.logger().info(&quot;Action: &quot; + aForm.getAction());
+        if(req.getParameter(&quot;delete.x&quot;) != null) {
             aForm.setAction(ACTION_CONFIRM_DELETE);
         }
 
@@ -102,7 +103,7 @@ public final class AdminAction extends StrutsActionBase {
             switch(aForm.getAction()) {
                 case AdminAction.ACTION_LIST:
                     if(allowed(&quot;admin.show&quot;, req)) {
-                        destination=mapping.findForward(&quot;list&quot;);
+                        destination = mapping.findForward(&quot;list&quot;);
                     } else {
                         errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
                     }
@@ -110,14 +111,13 @@ public final class AdminAction extends StrutsActionBase {
 
                 case AdminAction.ACTION_VIEW:
                     if(allowed(&quot;admin.show&quot;, req)) {
-                        if(aForm.getAdminID()!=0) {
-
+                        if(aForm.getAdminID() != 0) {
                             aForm.setAction(AdminAction.ACTION_SAVE);
                             loadAdmin(aForm, aContext, req);
                         } else {
                             aForm.setAction(AdminAction.ACTION_NEW);
                         }
-                        destination=mapping.findForward(&quot;view&quot;);
+                        destination = mapping.findForward(&quot;view&quot;);
                     } else {
                         errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
                     }
@@ -125,26 +125,26 @@ public final class AdminAction extends StrutsActionBase {
 
                 case AdminAction.ACTION_SAVE:
                     if(allowed(&quot;admin.change&quot;, req)) {
-                        if(req.getParameter(&quot;save.x&quot;)!=null) {
+                        if(req.getParameter(&quot;save.x&quot;) != null) {
                             saveAdmin(aForm, aContext, req);
                         }
                     } else {
                         errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
                     }
-                    destination=mapping.findForward(&quot;view&quot;);
+                    destination = mapping.findForward(&quot;view&quot;);
                     break;
 
                 case AdminAction.ACTION_VIEW_RIGHTS:
                     loadAdmin(aForm, aContext, req);
                     aForm.setAction(AdminAction.ACTION_SAVE_RIGHTS);
-                    destination=mapping.findForward(&quot;rights&quot;);
+                    destination = mapping.findForward(&quot;rights&quot;);
                     break;
 
                 case AdminAction.ACTION_SAVE_RIGHTS:
                     saveAdminRights(aForm, aContext, req);
                     loadAdmin(aForm, aContext, req);
                     aForm.setAction(AdminAction.ACTION_SAVE_RIGHTS);
-                    destination=mapping.findForward(&quot;rights&quot;);
+                    destination = mapping.findForward(&quot;rights&quot;);
                     break;
 
                 case AdminAction.ACTION_NEW:
@@ -157,7 +157,7 @@ public final class AdminAction extends StrutsActionBase {
                                 errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.admin.save&quot;));
                             }
                             aForm.setAction(AdminAction.ACTION_LIST);
-                            destination=mapping.findForward(&quot;list&quot;);
+                            destination = mapping.findForward(&quot;list&quot;);
                         }
                     } else {
                         errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
@@ -167,29 +167,27 @@ public final class AdminAction extends StrutsActionBase {
                 case AdminAction.ACTION_CONFIRM_DELETE:
                     loadAdmin(aForm, aContext, req);
                     aForm.setAction(AdminAction.ACTION_DELETE);
-                    destination=mapping.findForward(&quot;delete&quot;);
+                    destination = mapping.findForward(&quot;delete&quot;);
                     break;
 
                 case AdminAction.ACTION_DELETE:
-                    if(req.getParameter(&quot;kill.x&quot;)!=null) {
+                    if(req.getParameter(&quot;kill.x&quot;) != null) {
                         if(allowed(&quot;admin.delete&quot;, req)) {
                             deleteAdmin(aForm, aContext, req);
                         } else {
                             errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
                         }
                         aForm.setAction(AdminAction.ACTION_LIST);
-                        destination=mapping.findForward(&quot;list&quot;);
+                        destination = mapping.findForward(&quot;list&quot;);
                     }
                     break;
 
                 default:
                     aForm.setAction(AdminAction.ACTION_LIST);
-                    destination=mapping.findForward(&quot;list&quot;);
+                    destination = mapping.findForward(&quot;list&quot;);
             }
-
-
         } catch (Exception e) {
-            AgnUtils.logger().error(&quot;execute: &quot;+e+&quot;\n&quot;+AgnUtils.getStackTrace(e));
+            AgnUtils.logger().error(&quot;execute: &quot; + e + &quot;\n&quot; + AgnUtils.getStackTrace(e));
             errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.exception&quot;));
             throw new ServletException(e);
         }
@@ -211,10 +209,10 @@ public final class AdminAction extends StrutsActionBase {
      * @param req the Servlet Request (needed to get the company id)
      */
     protected void loadAdmin(AdminForm aForm, ApplicationContext aContext, HttpServletRequest req) {
-        int adminID=aForm.getAdminID();
+        int adminID = aForm.getAdminID();
         int compID = getCompanyID(req);
         AdminDao adminDao=(AdminDao) getBean(&quot;AdminDao&quot;);
-        Admin admin=adminDao.getAdmin(adminID, compID);
+        Admin admin = adminDao.getAdmin(adminID, compID);
 
         if(admin != null) {
             aForm.setUsername(admin.getUsername());
@@ -228,12 +226,12 @@ public final class AdminAction extends StrutsActionBase {
             aForm.setGroupID(admin.getGroup().getGroupID());
             aForm.setUserRights(admin.getAdminPermissions());
             aForm.setGroupRights(admin.getGroup().getGroupPermissions());
-            aForm.setNumberofRows( admin.getPreferredListSize());
-            AgnUtils.logger().info(&quot;loadAdmin: admin &quot;+aForm.getAdminID()+&quot; loaded&quot;);
+            aForm.setNumberofRows(admin.getPreferredListSize());
+            AgnUtils.logger().info(&quot;loadAdmin: admin &quot; + aForm.getAdminID() + &quot; loaded&quot;);
         } else {
             aForm.setAdminID(0);
             aForm.setCompanyID(this.getCompanyID(req));
-            AgnUtils.logger().warn(&quot;loadAdmin: admin &quot;+aForm.getAdminID()+&quot; could not be loaded&quot;);
+            AgnUtils.logger().warn(&quot;loadAdmin: admin &quot; + aForm.getAdminID() + &quot; could not be loaded&quot;);
         }
     }
 
@@ -246,33 +244,31 @@ public final class AdminAction extends StrutsActionBase {
      * @param req the Servlet Request (needed to get the company id)
      */
     protected void saveAdmin(AdminForm aForm, ApplicationContext aContext, HttpServletRequest req) {
-        HibernateTemplate tmpl=getHibernateTemplate();
+        HibernateTemplate tmpl = getHibernateTemplate();
         int adminID = aForm.getAdminID();
         int compID = aForm.getCompanyID();
         int groupID = aForm.getGroupID();
-        AdminDao adminDao=(AdminDao) getBean(&quot;AdminDao&quot;);
-        Admin admin=adminDao.getAdmin(adminID, compID);
+        AdminDao adminDao = (AdminDao) getBean(&quot;AdminDao&quot;);
+        Admin admin = adminDao.getAdmin(adminID, compID);
 
-System.err.println(&quot;Saving to Companyid: &quot;+compID);
         if(admin == null) {
-            CompanyDao companyDao=(CompanyDao) getBean(&quot;CompanyDao&quot;);
+            CompanyDao companyDao = (CompanyDao) getBean(&quot;CompanyDao&quot;);
 
-            admin=(Admin) getBean(&quot;Admin&quot;);
+            admin = (Admin) getBean(&quot;Admin&quot;);
             admin.setCompanyID(compID);
             admin.setCompany(companyDao.getCompany(compID));
             admin.setLayoutID(0);
-            
         }
 
-        AdminGroupDao groupDao=(AdminGroupDao) getBean(&quot;AdminGroupDao&quot;);
-        AdminGroup group=(AdminGroup) groupDao.getAdminGroup(groupID);
+        AdminGroupDao groupDao = (AdminGroupDao) getBean(&quot;AdminGroupDao&quot;);
+        AdminGroup group = (AdminGroup) groupDao.getAdminGroup(groupID);
 
         admin.setAdminID(aForm.getAdminID());
         admin.setUsername(aForm.getUsername());
-        if(aForm.getPassword()!=null &amp;&amp; aForm.getPassword().trim().length()!=0) {
+        if(aForm.getPassword() != null &amp;&amp; aForm.getPassword().trim().length() != 0) {
             admin.setPassword(aForm.getPassword());
         }
-        AgnUtils.logger().error(&quot;Username: &quot;+aForm.getUsername()+&quot; Password: &quot;+aForm.getPassword());
+        AgnUtils.logger().error(&quot;Username: &quot; + aForm.getUsername() + &quot; Password: &quot; + aForm.getPassword());
 
         admin.setFullname(aForm.getFullname());
         admin.setAdminCountry(aForm.getAdminLocale().getCountry());
@@ -283,7 +279,7 @@ System.err.println(&quot;Saving to Companyid: &quot;+compID);
 
         tmpl.saveOrUpdate(&quot;Admin&quot;, admin);
         tmpl.flush();
-        AgnUtils.logger().info(&quot;saveAdmin: admin &quot;+aForm.getAdminID());
+        AgnUtils.logger().info(&quot;saveAdmin: admin &quot; + aForm.getAdminID());
     }
 
     /**
@@ -298,8 +294,8 @@ System.err.println(&quot;Saving to Companyid: &quot;+compID);
     protected void saveAdminRights(AdminForm aForm, ApplicationContext aContext, HttpServletRequest req) {
         int adminID = aForm.getAdminID();
         int compID = getCompanyID(req);
-        AdminDao adminDao=(AdminDao) getBean(&quot;AdminDao&quot;);
-        Admin admin=adminDao.getAdmin(adminID, compID);
+        AdminDao adminDao = (AdminDao) getBean(&quot;AdminDao&quot;);
+        Admin admin = adminDao.getAdmin(adminID, compID);
 
         admin.setAdminPermissions(aForm.getUserRights());
         getHibernateTemplate().saveOrUpdate(&quot;Admin&quot;, admin);
@@ -316,8 +312,8 @@ System.err.println(&quot;Saving to Companyid: &quot;+compID);
     protected void deleteAdmin(AdminForm aForm, ApplicationContext aContext, HttpServletRequest req) {
         int adminID = aForm.getAdminID();
         int compID = getCompanyID(req);
-        AdminDao adminDao=(AdminDao) getBean(&quot;AdminDao&quot;);
-        Admin admin=adminDao.getAdmin(adminID, compID);
+        AdminDao adminDao = (AdminDao) getBean(&quot;AdminDao&quot;);
+        Admin admin = adminDao.getAdmin(adminID, compID);
 
         if(admin != null) {
             getHibernateTemplate().delete(admin);</diff>
      <filename>src/java/org/agnitas/web/AdminAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -26,9 +26,18 @@ import java.io.IOException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
 
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletException;
@@ -38,9 +47,15 @@ import javax.sql.DataSource;
 
 import org.agnitas.beans.Campaign;
 import org.agnitas.beans.Company;
+import org.agnitas.beans.MaildropEntry;
+import org.agnitas.beans.Mailing;
 import org.agnitas.dao.CampaignDao;
 import org.agnitas.dao.CompanyDao;
+import org.agnitas.dao.MailingDao;
+import org.agnitas.service.CampaignQueryWorker;
 import org.agnitas.util.AgnUtils;
+import org.agnitas.web.forms.CampaignForm;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.commons.beanutils.BasicDynaClass;
 import org.apache.commons.beanutils.DynaBean;
 import org.apache.commons.beanutils.DynaProperty;
@@ -55,7 +70,7 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.jdbc.core.JdbcTemplate;
 
 
-public class CampaignAction extends StrutsActionBase {
+public class CampaignAction extends StrutsActionBase { 
     
     public static final int ACTION_STAT = ACTION_LAST+1;
     public static final int ACTION_SPLASH = ACTION_LAST+2;
@@ -82,24 +97,22 @@ public class CampaignAction extends StrutsActionBase {
             HttpServletResponse res)
             throws IOException, ServletException {
         
-        // Validate the request parameters specified by the user
-        
+    	ApplicationContext aContext  = this.getWebApplicationContext();	// our application Context
+    	
+        // Validate the request parameters specified by the user        
         CampaignForm aForm=null;
         ActionMessages errors = new ActionMessages();
-        ActionForward destination=null;
-        //System.err.println( req.getParameter( &quot;action&quot; ) );
-        
+        ActionForward destination=null;        
         
         if(!this.checkLogon(req)) {
             return mapping.findForward(&quot;logon&quot;);
-        }
-        
+        }       
         if(form!=null) {
             aForm=(CampaignForm)form;
         } else {
             aForm=new CampaignForm();
-        }
-    
+        }       
+        
         AgnUtils.logger().info(&quot;Action: &quot;+aForm.getAction());
         
         if(req.getParameter(&quot;delete.x&quot;)!=null) {
@@ -111,13 +124,16 @@ public class CampaignAction extends StrutsActionBase {
                 case CampaignAction.ACTION_LIST:
                     if(allowed(&quot;campaign.show&quot;, req)) {
                         destination=mapping.findForward(&quot;list&quot;);
+                        aForm.reset(mapping, req);                       
+                        aForm.setAction(CampaignAction.ACTION_LIST);	// reset Action!
                     }
                     break;
                     
                 case CampaignAction.ACTION_VIEW:
                     if(allowed(&quot;campaign.show&quot;, req)) {
+                    	aForm.reset(mapping, req);
                         loadCampaign(aForm, req);
-                        aForm.setAction(CampaignAction.ACTION_SAVE);
+                        aForm.setAction(CampaignAction.ACTION_SAVE);                        
                         destination=mapping.findForward(&quot;view&quot;);
                     } else {
                         errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
@@ -164,42 +180,59 @@ public class CampaignAction extends StrutsActionBase {
                     break;
                     
                 case CampaignAction.ACTION_STAT:
-                    loadCampaign(aForm, req);
-                    if(aForm.isStatInProgress()==false) {
-                        if(aForm.isStatReady()) {
-                            destination=mapping.findForward(&quot;stat&quot;);
-                            aForm.setStatReady(false);
-                            break;
-                        } else {
-                            // display splash in browser
-                            RequestDispatcher dp=req.getRequestDispatcher(mapping.findForward(&quot;splash&quot;).getPath());
-                            dp.forward(req, res);
-                            res.flushBuffer();
-                            destination=null;
-                            // get stats
-                            aForm.setStatInProgress(true);
-                            loadCampaignStats(aForm, req);
-                            aForm.setStatInProgress(false);
-                            aForm.setStatReady(true);
-                            break;
-                        }
-                    }
+                	destination = mapping.findForward(&quot;splash&quot;);	// default is splash-screen.
+            		aForm.setAction(CampaignAction.ACTION_SPLASH);
+            		setNumberOfRows(req,(StrutsFormBase)form);   // could change till next call on this variable is done.
+            		loadCampaign(aForm, req);
+            		try {     			               		
+                		// look if we have a Future, if not, get one. 
+                		if (aForm.getCurrentFuture() == null) {     
+                			
+                			aForm.setCurrentFuture(getCampaignListFuture(req, aContext, aForm));               				
+                		}     
+                		// look if we are already done. 
+                		if (aForm.getCurrentFuture().isDone() ) {//                			
+                				Campaign.Stats stat = (Campaign.Stats) aForm.getCurrentFuture().get();	// get the results.                				
+                				if(stat != null) {
+                					setFormStat(aForm, stat);                					
+                				}        		
+                				setSortedMailingList(stat, req, aForm);
+                				aForm.setStatReady(true);
+                				aForm.setAction(CampaignAction.ACTION_STAT);
+                				destination = mapping.findForward(&quot;stat&quot;);	// set destination to Statistic-page.
+                				aForm.setCurrentFuture(null);	// reset Future because we are already done.
+                				aForm.setRefreshMillis(RecipientForm.DEFAULT_REFRESH_MILLIS); // set refresh-time to default.                				
+//                			}
+                		} else {       
+                			// increment Refresh-Rate. if it is a very long request,
+                			// we dont have to refresh every 250ms, then 1 second is enough.
+                			if( aForm.getRefreshMillis() &lt; 1000 ) { // raise the refresh time
+                				aForm.setRefreshMillis( aForm.getRefreshMillis() + 50 );
+                			}
+                			
+                		}   
+        			} catch (NullPointerException e) {
+        				AgnUtils.logger().error(&quot;getCampaignList: &quot;+e+&quot;\n&quot;+AgnUtils.getStackTrace(e));
+        	            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.exception&quot;));
+        			} 
+        			
+        			break;                  
                     
                 case CampaignAction.ACTION_SPLASH:
-                    loadCampaign(aForm, req);
-                    if(aForm.isStatReady()) {
-                        aForm.setAction(CampaignAction.ACTION_STAT);
-                        destination=mapping.findForward(&quot;stat&quot;);
-                        break;
-                    }
-                    // just display splash
-                    destination=mapping.findForward(&quot;splash&quot;);
-                    break;
+                    
+                	if (aForm.getCurrentFuture() != null &amp;&amp; aForm.getCurrentFuture().isDone()) {
+                		aForm.setAction(CampaignAction.ACTION_STAT);
+                		destination=mapping.findForward(&quot;stat&quot;);
+                	} else  {
+                		loadCampaign(aForm, req);
+                		aForm.setAction(CampaignAction.ACTION_SPLASH);
+                		destination=mapping.findForward(&quot;splash&quot;);
+                	}
+                	break;
                     
                 default:
                     aForm.setAction(CampaignAction.ACTION_LIST);
-                    destination=mapping.findForward(&quot;list&quot;);
-                    
+                    destination=mapping.findForward(&quot;list&quot;);                    
             }
             
         } catch (Exception e) {
@@ -216,8 +249,7 @@ public class CampaignAction extends StrutsActionBase {
 	            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.exception&quot;));
 			} 
         }
-        
-        
+       
         // Report any errors we have discovered back to the original form
         if (!errors.isEmpty()) {
             saveErrors(req, errors);
@@ -226,7 +258,79 @@ public class CampaignAction extends StrutsActionBase {
         return destination;
     }
 
+
+    /*
+     * this method sets the Form-Stats. It would be good, if stat is not null
+     */
+	private void setFormStat(CampaignForm aForm, Campaign.Stats stat) {
+		if (stat != null) {
+			aForm.setOpened(stat.getOpened());
+			aForm.setOptouts(stat.getOptouts());
+			aForm.setBounces(stat.getBounces());
+			aForm.setSubscribers(stat.getSubscribers());
+			aForm.setClicks(stat.getClicks());			
+			aForm.setMaxClicks(stat.getMaxClicks());
+			aForm.setMaxOpened(stat.getMaxOpened());
+			aForm.setMaxOptouts(stat.getMaxOptouts());
+			aForm.setMaxSubscribers(stat.getMaxSubscribers());
+			aForm.setMaxBounces(stat.getMaxBounces());
+			aForm.setMailingData(stat.getMailingData());			
+		}
+	}
 	
+	/*
+	 * this method creates a List with all Mailing-IDs in a sorted order an writes it into the
+	 * CampaignForm.
+	 */
+	private void setSortedMailingList(Campaign.Stats stat, HttpServletRequest req, CampaignForm aForm) {
+		LinkedList&lt;Number&gt; resultList = new LinkedList&lt;Number&gt;();
+		MailingDao mailDao = (MailingDao) getBean(&quot;MailingDao&quot;);
+		
+		// this hashmap contains the mapping from a Date back to the Mail-ID.
+		HashMap&lt;Date, Number&gt; tmpDate2MailIDMapping = new HashMap&lt;Date, Number&gt;();
+		LinkedList&lt;Date&gt; sortedMailingList = new LinkedList&lt;Date&gt;();
+		
+		Hashtable map = stat.getMailingData();	// holds the complete mailing Data
+		map.keySet();	// all keys for the mailingData (mailIDs)
+		
+		Number tmpMailID = null;	
+		MaildropEntry tmpEntry = null;
+		Mailing tmpMailing = null;
+		
+		// loop over all keys.
+		Iterator it = map.keySet().iterator();		
+		while (it.hasNext()) {
+			LinkedList&lt;Date&gt; sortDates = new LinkedList&lt;Date&gt;();
+			tmpMailID = (Number)it.next();	// get the mailID	
+			// get one Mailing with tmpMailID
+			tmpMailing = (Mailing)mailDao.getMailing(tmpMailID.intValue(), getCompanyID(req));
+			// check if it is a World-Mailing. We have testmailings and dont care about them!
+			if (tmpMailing.isWorldMailingSend() == true) {
+				// loop over all tmpMailingdropStatus.
+				// we look over all mails and take the first send mailing Time.
+				// unfortunately is the set not sorted, so we have to sort it ourself.
+				Iterator it2 = tmpMailing.getMaildropStatus().iterator();
+				while(it2.hasNext()) {
+					tmpEntry=(MaildropEntry)it2.next();		            
+					sortDates.add(tmpEntry.getSendDate());		            		            
+				}			 
+				// check if sortDates has entries and put the one into the Hashmap.
+				if (sortDates.size() != 0) {
+					Collections.sort(sortDates);
+					tmpDate2MailIDMapping.put(sortDates.get(0), tmpMailID);
+					sortedMailingList.add(sortDates.get(0));
+				}			 
+			}
+		}
+		// at this point, we have a Hashmap with all Dates and Mailing ID's and a List with all Date's.
+		// now we sort this List and put the result into the Form (sort with reverse Order ;-) ).
+		Collections.sort(sortedMailingList, Collections.reverseOrder());
+		// loop over the List and put the corresponding MailID into the List.
+		for (int i=0; i &lt; sortedMailingList.size(); i++) {
+			resultList.add(tmpDate2MailIDMapping.get(sortedMailingList.get(i)));
+		}		
+		aForm.setSortedKeys(resultList);
+	}
     
     /**
      * Loads campaign.
@@ -246,46 +350,6 @@ public class CampaignAction extends StrutsActionBase {
     }
     
     /**
-     * Loads campaign statistics.
-     */
-    protected void loadCampaignStats(CampaignForm aForm, HttpServletRequest req) {
-        int campaignID=aForm.getCampaignID();
-        int companyID = getCompanyID(req);
-        CampaignDao campaignDao = (CampaignDao) getBean(&quot;CampaignDao&quot;);
-        Campaign campaign = campaignDao.getCampaign(campaignID, companyID);
-
-        CompanyDao compDao = (CompanyDao) getBean(&quot;CompanyDao&quot;);
-        Company comp = (Company) compDao.getCompany(companyID);
-        int mailtracking = comp.getMailtracking();
-        boolean useMailtracking = false;
-        // TODO: fix in EMM
-        if(mailtracking == 1) {
-        	useMailtracking = true;
-        }
-        Locale aLoc = (Locale) req.getSession().getAttribute(org.apache.struts.Globals.LOCALE_KEY);
-        campaign.setTargetID( aForm.getTargetID() );
-        campaign.setNetto( aForm.isNetto() );
-        Campaign.Stats stat = campaignDao.getStats(useMailtracking, aLoc, null, campaign, getWebApplicationContext());
-        
-
-        if(stat != null) {
-        	aForm.setOpened(stat.getOpened());
-            aForm.setOptouts(stat.getOptouts());
-            aForm.setBounces(stat.getBounces());
-            aForm.setSubscribers(stat.getSubscribers());
-            aForm.setClicks(stat.getClicks());
-            aForm.setMailingData(stat.getMailingData());
-            aForm.setMaxClicks(stat.getMaxClicks());
-            aForm.setMaxOpened(stat.getMaxOpened());
-            aForm.setMaxOptouts(stat.getMaxOptouts());
-            aForm.setMaxSubscribers(stat.getMaxSubscribers());
-            aForm.setMaxBounces(stat.getMaxBounces());
-        }
-
-        System.out.println(&quot;campaign stats loaded.&quot;);
-    }
-    
-    /**
      * Saves campaign.
      */    
     protected void saveCampaign(CampaignForm aForm, HttpServletRequest req) {
@@ -385,7 +449,31 @@ public class CampaignAction extends StrutsActionBase {
 	    	  result.add(newBean);
 	    	  
 	      } 
-	      return result;
+	      return result;    	
+    }
+    
+    /*
+     * returns a Future for asynchronous computation of the CampaignStats.
+     */
+    public Future getCampaignListFuture( HttpServletRequest req, ApplicationContext aContext, CampaignForm aForm  ) throws NumberFormatException, IllegalAccessException, InstantiationException, InterruptedException, ExecutionException {  	
     	
+    	CampaignDao campaignDao = (CampaignDao) aContext.getBean(&quot;CampaignDao&quot;);
+    	CompanyDao compDao = (CompanyDao) getBean(&quot;CompanyDao&quot;);
+        Company comp = (Company) compDao.getCompany(AgnUtils.getCompanyID(req));
+        Locale aLoc = (Locale) req.getSession().getAttribute(org.apache.struts.Globals.LOCALE_KEY);
+        boolean mailtracking;
+        // i dont know why mailtracking returns an int here, but i use boolean though its not handsome but it works (hopefully).
+        if (comp.getMailtracking() == 0) {
+        	mailtracking = false;
+        } else {
+        	mailtracking = true;
+        }          	
+        
+     	// now we start get the data. But we start that as background job.
+        // the result is available via future.get().
+     	ExecutorService service = (ExecutorService) aContext.getBean(&quot;workerExecutorService&quot;);     	
+     	Future future = service.submit(	new CampaignQueryWorker(campaignDao, aLoc, aForm, req, mailtracking, aContext));
+     	
+    	return future;  
     }
 }</diff>
      <filename>src/java/org/agnitas/web/CampaignAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -38,7 +38,7 @@ import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;
 
 
-public final class CompareMailingForm extends ActionForm {
+public class CompareMailingForm extends ActionForm {
     
     private static final long serialVersionUID = 8456061813681855065L;
 	private int targetID;
@@ -49,9 +49,10 @@ public final class CompareMailingForm extends ActionForm {
     private int biggestOpened;      // biggest value from opened[]      - for the correct graphical representation in the JSP
     private int biggestRecipients;  // biggest value from recipients[]  - for the correct graphical representation in the JSP
     private int biggestClicks;      // biggest value from clicks[]      - for the correct graphical representation in the JSP
-    
+        
     private String cvsfile;
     
+ 
     /** 
      * Holds value of property numOpen. 
      */
@@ -60,7 +61,7 @@ public final class CompareMailingForm extends ActionForm {
     /**
      * Holds value of property mailings. 
      */
-    private LinkedList mailings;
+    protected LinkedList mailings;
     
     /**
      * Holds value of property numBounce. 
@@ -92,6 +93,7 @@ public final class CompareMailingForm extends ActionForm {
      */
     private Hashtable mailingDescription;
     
+      
     /**
      * Reset all properties to their default values.
      *
@@ -101,16 +103,20 @@ public final class CompareMailingForm extends ActionForm {
     public void reset(ActionMapping mapping, HttpServletRequest request) {
         
         if(mailings==null) {
-            mailings=new LinkedList();
-            mailingDescription=new Hashtable();
-            mailingName=new Hashtable();
-            numBounce=new Hashtable();
-            numClicks=new Hashtable();
-            numOpen=new Hashtable();
-            numOptout=new Hashtable();
-            numRecipients=new Hashtable();
+            resetHashTables();          
         }
     }
+
+	protected void resetHashTables() {
+		mailings=new LinkedList();
+		mailingDescription=new Hashtable();
+		mailingName=new Hashtable();
+		numBounce=new Hashtable();
+		numClicks=new Hashtable();
+		numOpen=new Hashtable();
+		numOptout=new Hashtable();
+		numRecipients=new Hashtable();
+	}
     
     /**
      * Validate the properties that have been set from this HTTP request,
@@ -132,22 +138,19 @@ public final class CompareMailingForm extends ActionForm {
             Integer tmpInt=null;
             boolean isFirst=true;
             
+            // get all Parameters from Form.
             Enumeration params = request.getParameterNames();
             while(params.hasMoreElements() ) {
                 curr=(String)params.nextElement();
-                if(curr.startsWith(&quot;MailCompID_&quot;) ) {
+                if(curr.startsWith(&quot;MailCompID_&quot;) ) {	// Form uses &quot;MailCompID_&quot; for storing properties.
                     if(isFirst) { // if selection done, reset lists first
                         this.mailings=null;
                         this.reset(mapping, request);
                         isFirst=false;
                     }
                     tmpInt=new Integer(curr.substring(11, curr.length()));
-                    this.mailings.add(tmpInt);
-                    this.numBounce.put(tmpInt, new Integer(0));
-                    this.numClicks.put(tmpInt, new Integer(0));
-                    this.numOpen.put(tmpInt, new Integer(0));
-                    this.numOptout.put(tmpInt, new Integer(0));
-                    this.numRecipients.put(tmpInt, new Integer(0));
+                    validateCleanUp(tmpInt);
+                   
                 }
             }
 
@@ -161,28 +164,46 @@ public final class CompareMailingForm extends ActionForm {
         return errors;
     }
 
+	protected void validateCleanUp(Integer tmpInt) {
+		this.mailings.add(tmpInt);
+		this.numBounce.put(tmpInt, new Integer(0));
+		this.numClicks.put(tmpInt, new Integer(0));
+		this.numOpen.put(tmpInt, new Integer(0));
+		this.numOptout.put(tmpInt, new Integer(0));
+		this.numRecipients.put(tmpInt, new Integer(0));
+	}
+
     /**
      * Clear results from previous run.
      */
-    public void resetResults() {
-    
+    public void resetResults() {    
         Iterator aIt=this.mailings.iterator();
 
         while(aIt.hasNext()) {
             Integer id=(Integer) aIt.next();
-
-            numBounce.put(id, new Integer(0));
-            numClicks.put(id, new Integer(0));
-            numOpen.put(id, new Integer(0));
-            numOptout.put(id, new Integer(0));
-            numRecipients.put(id, new Integer(0));
+            resetNumResults(id);            
         }
-        biggestBounce=0;
+        
+        resetBiggestResults();        
+    }
+
+	protected void resetBiggestResults() {
+		biggestBounce=0;
         biggestClicks=0;
         biggestOpened=0;
         biggestOptouts=0;
         biggestRecipients=0;
-    }
+	}
+
+	protected void resetNumResults(Integer id) {
+		numBounce.put(id, new Integer(0));
+		numClicks.put(id, new Integer(0));
+		numOpen.put(id, new Integer(0));
+		numOptout.put(id, new Integer(0));
+		numRecipients.put(id, new Integer(0));
+	}
+    
+    
     
     /**
      * Getter for property targetID.
@@ -472,6 +493,8 @@ public final class CompareMailingForm extends ActionForm {
         this.mailingDescription = mailingDescription;
     }
     
+   
+    
     private class CompareDescending implements Comparator {
         public int compare(Object o1, Object o2) {
             Integer a,b;
@@ -483,5 +506,5 @@ public final class CompareMailingForm extends ActionForm {
             
             return (b.intValue()-a.intValue());
         }
-    }
+    }   
 }</diff>
      <filename>src/java/org/agnitas/web/CompareMailingForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -39,7 +39,7 @@ import org.apache.struts.action.ActionMessages;
 import org.springframework.web.context.WebApplicationContext;
 
 
-public final class DomainStatAction extends StrutsActionBase {
+public class DomainStatAction extends StrutsActionBase {
 
     public static final int ACTION_STAT = 1;
     public static final int ACTION_SPLASH = 2;</diff>
      <filename>src/java/org/agnitas/web/DomainStatAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -26,11 +26,12 @@ import java.util.LinkedList;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 
 
-public final class DomainStatForm extends StrutsFormBase {
+public class DomainStatForm extends StrutsFormBase {
 
     private static final long serialVersionUID = 7400928630109355568L;
 	private int listID;
@@ -97,10 +98,6 @@ public final class DomainStatForm extends StrutsFormBase {
         return errors;
     }
 
-
-    
-
-
     /**
      * Setter for property listID.
      *</diff>
      <filename>src/java/org/agnitas/web/DomainStatForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,6 @@ package org.agnitas.web;
 
 import java.io.IOException;
 import java.math.BigDecimal;
-import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -40,6 +39,7 @@ import org.agnitas.actions.ActionOperation;
 import org.agnitas.actions.EmmAction;
 import org.agnitas.dao.EmmActionDao;
 import org.agnitas.util.AgnUtils;
+import org.agnitas.web.forms.EmmActionForm;
 import org.apache.commons.beanutils.BasicDynaClass;
 import org.apache.commons.beanutils.DynaBean;
 import org.apache.commons.beanutils.DynaProperty;
@@ -62,22 +62,15 @@ import org.springframework.jdbc.core.JdbcTemplate;
 public class EmmActionAction extends StrutsActionBase {
     
     public static final int ACTION_LIST = 1;
-    
     public static final int ACTION_VIEW = 2;
-    
     public static final int ACTION_SAVE = 4;
-    
     public static final int ACTION_NEW = 6;
-    
     public static final int ACTION_DELETE = 7;
-    
     public static final int ACTION_CONFIRM_DELETE = 8;
-    
     public static final int ACTION_ADD_MODULE = 9;
     
     // --------------------------------------------------------- Public Methods
     
-    
     /**
      * Process the specified HTTP request, and create the corresponding HTTP
      * response (or forward to another web component that will create it).
@@ -121,7 +114,6 @@ public class EmmActionAction extends StrutsActionBase {
                         errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
                     }
                     break;
-                    
                 case EmmActionAction.ACTION_VIEW:
                     if(allowed(&quot;actions.show&quot;, req)) {
                         if(aForm.getActionID()!=0) {
@@ -136,7 +128,6 @@ public class EmmActionAction extends StrutsActionBase {
                         destination=mapping.findForward(&quot;list&quot;);
                     }
                     break;
-                    
                 case EmmActionAction.ACTION_SAVE:
                     if(allowed(&quot;actions.change&quot;, req)) {
                         saveAction(aForm, req);
@@ -145,13 +136,11 @@ public class EmmActionAction extends StrutsActionBase {
                     }
                     destination=mapping.findForward(&quot;success&quot;);
                     break;
-                    
                 case EmmActionAction.ACTION_CONFIRM_DELETE:
                     loadAction(aForm, req);
                     destination=mapping.findForward(&quot;delete&quot;);
                     aForm.setAction(EmmActionAction.ACTION_DELETE);
                     break;
-                    
                 case EmmActionAction.ACTION_DELETE:
                     if(allowed(&quot;actions.delete&quot;, req)) {
                         deleteAction(aForm, req);
@@ -161,7 +150,6 @@ public class EmmActionAction extends StrutsActionBase {
                     aForm.setAction(EmmActionAction.ACTION_LIST);
                     destination=mapping.findForward(&quot;list&quot;);
                     break;
-                    
                 case EmmActionAction.ACTION_ADD_MODULE:
                     ActionOperation aMod=(ActionOperation) getBean(aForm.getNewModule());
                     ArrayList actions=aForm.getActions();
@@ -173,12 +161,10 @@ public class EmmActionAction extends StrutsActionBase {
                     aForm.setAction(EmmActionAction.ACTION_SAVE);
                     destination=mapping.findForward(&quot;success&quot;);
                     break;
-                    
                 default:
                     destination=mapping.findForward(&quot;list&quot;);
                     break;
             }
-            
         } catch (Exception e) {
             AgnUtils.logger().error(&quot;execute: &quot;+e+&quot;\n&quot;+AgnUtils.getStackTrace(e));
             errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.exception&quot;));
@@ -191,7 +177,6 @@ public class EmmActionAction extends StrutsActionBase {
 			} catch (Exception e) {
 				AgnUtils.logger().error(&quot;getActionList: &quot;+e+&quot;\n&quot;+AgnUtils.getStackTrace(e));
 	            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.exception&quot;));
-				
 			}
         }
         
@@ -201,16 +186,13 @@ public class EmmActionAction extends StrutsActionBase {
             saveErrors(req, errors);
             return (new ActionForward(mapping.getInput()));
         }
-        
         return destination;
-        
     }
     
     /**
      * Loads an action.
      */
     protected void loadAction(EmmActionForm aForm, HttpServletRequest req) throws Exception {
-        
         EmmActionDao dao=(EmmActionDao) getBean(&quot;EmmActionDao&quot;);
         EmmAction aAction=dao.getEmmAction(aForm.getActionID(), getCompanyID(req));
         
@@ -229,7 +211,6 @@ public class EmmActionAction extends StrutsActionBase {
      * Saves an action.
      */
     protected void saveAction(EmmActionForm aForm, HttpServletRequest req) throws Exception {
-        
         EmmAction aAction=(EmmAction) getBean(&quot;EmmAction&quot;);
         EmmActionDao dao=(EmmActionDao) getBean(&quot;EmmActionDao&quot;);
         
@@ -269,7 +250,6 @@ public class EmmActionAction extends StrutsActionBase {
                 ops.put(key, name);
             }
         }
-        
         return ops;
     }
     
@@ -283,7 +263,6 @@ public class EmmActionAction extends StrutsActionBase {
      */
     
     protected void loadActionUsed(EmmActionForm aForm, HttpServletRequest req) throws Exception {
-     
         EmmActionDao dao=(EmmActionDao) getBean(&quot;EmmActionDao&quot;);
         Map used = dao.loadUsed(this.getCompanyID(req));
         aForm.setUsed(used);
@@ -296,20 +275,19 @@ public class EmmActionAction extends StrutsActionBase {
 		  String[] columns = new String[] { &quot;r.shortname&quot;,&quot;r.description&quot;,&quot;&quot;, &quot;&quot; };
 	      
 		  int sortcolumnindex = 0; 
-		     if( request.getParameter(new ParamEncoder(&quot;emmaction&quot;).encodeParameterName(TableTagParameters.PARAMETER_SORT)) != null ) {
-		    	sortcolumnindex = Integer.parseInt(request.getParameter(new ParamEncoder(&quot;emmaction&quot;).encodeParameterName(TableTagParameters.PARAMETER_SORT))); 
-		     }	
+		  if(request.getParameter(new ParamEncoder(&quot;emmaction&quot;).encodeParameterName(TableTagParameters.PARAMETER_SORT)) != null ) {
+			  sortcolumnindex = Integer.parseInt(request.getParameter(new ParamEncoder(&quot;emmaction&quot;).encodeParameterName(TableTagParameters.PARAMETER_SORT))); 
+		  }	
 		     
-		     String sort =  columns[sortcolumnindex];
-		     if (charColumns.contains(sortcolumnindex)) {
-		    	 sort =   &quot;upper( &quot; +sort + &quot; )&quot;;
-		     }
+		  String sort =  columns[sortcolumnindex];
+		  if(charColumns.contains(sortcolumnindex)) {
+		  	 sort =   &quot;upper( &quot; +sort + &quot; )&quot;;
+		  }
 		     
-		     int order = 1; 
-		     if( request.getParameter(new ParamEncoder(&quot;emmaction&quot;).encodeParameterName(TableTagParameters.PARAMETER_ORDER)) != null ) {
-		    	 order = new Integer(request.getParameter(new ParamEncoder(&quot;emmaction&quot;).encodeParameterName(TableTagParameters.PARAMETER_ORDER)));
-		     }
-		  
+		  int order = 1; 
+		  if(request.getParameter(new ParamEncoder(&quot;emmaction&quot;).encodeParameterName(TableTagParameters.PARAMETER_ORDER)) != null ) {
+		   	 order = new Integer(request.getParameter(new ParamEncoder(&quot;emmaction&quot;).encodeParameterName(TableTagParameters.PARAMETER_ORDER)));
+		  }
 	      
 	      String sqlStatement = &quot;SELECT r.action_id, r.shortname, r.description, count(u.form_id) used &quot; +
 	      		&quot; FROM rdir_action_tbl r LEFT JOIN userform_tbl u ON (u.startaction_id = r.action_id or u.endaction_id = r.action_id) &quot; +
@@ -344,11 +322,7 @@ public class EmmActionAction extends StrutsActionBase {
 	    	  newBean.set(&quot;description&quot;, row.get(&quot;DESCRIPTION&quot;));
 	    	  newBean.set(&quot;used&quot;, row.get(&quot;USED&quot;));
 	    	  result.add(newBean);
-	    	  
 	      }    
-	      
 	      return result;
-    	
     }
-    
-}
+}
\ No newline at end of file</diff>
      <filename>src/java/org/agnitas/web/EmmActionAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,7 @@ import java.util.LinkedList;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;</diff>
      <filename>src/java/org/agnitas/web/ExportWizardForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,7 @@ import java.util.LinkedList;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 </diff>
      <filename>src/java/org/agnitas/web/IPStatForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -24,9 +24,12 @@ package org.agnitas.web;
 
 import java.io.BufferedWriter;
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.io.LineNumberReader;
+import java.io.StringReader;
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.Enumeration;
@@ -34,6 +37,7 @@ import java.util.Hashtable;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.ListIterator;
+import java.util.Locale;
 import java.util.Map;
 import java.util.TimeZone;
 import java.util.Vector;
@@ -54,12 +58,12 @@ import org.agnitas.util.AgnUtils;
 import org.agnitas.util.CsvColInfo;
 import org.agnitas.util.EmmCalendar;
 import org.agnitas.util.SafeString;
-import org.apache.struts.upload.FormFile;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;
 import org.apache.struts.action.ActionMessages;
+import org.apache.struts.upload.FormFile;
 import org.hibernate.SessionFactory;
 import org.springframework.context.ApplicationContext;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -117,6 +121,8 @@ public class ImportWizardAction extends StrutsActionBase {
     
     public static final int ACTION_GET_ERROR_BLACKLIST = 19;
     
+    public static final int ACTION_CHECK_FIELDS = 20;
+    
     
     // --------------------------------------------------------- Public Methods
     
@@ -141,7 +147,8 @@ public class ImportWizardAction extends StrutsActionBase {
             HttpServletRequest req,
             HttpServletResponse res)
             throws IOException, ServletException {
-        
+ 
+    	
         // Validate the request parameters specified by the user
         ImportWizardForm aForm=null;
         ActionMessages errors = new ActionMessages();
@@ -181,12 +188,24 @@ public class ImportWizardAction extends StrutsActionBase {
                     break;
                     
                 case ImportWizardAction.ACTION_CSV:
-                    aForm.setAction(ImportWizardAction.ACTION_PARSE);
-                    destination=mapping.findForward(&quot;mapping&quot;);
+                    aForm.setAction(ImportWizardAction.ACTION_CHECK_FIELDS);
+                    destination=mapping.findForward(&quot;mapping&quot;);                   
                     break;
                     
+                case ImportWizardAction.ACTION_CHECK_FIELDS:    
+                	aForm.setAction(ImportWizardAction.ACTION_PRESCAN);
+                	aForm.doParse( req );
+                	destination=mapping.findForward(&quot;verify&quot;);
+                	if( aForm.getMode() == ImportWizardForm.MODE_ADD || aForm.getMode() == ImportWizardForm.MODE_ADD_UPDATE || aForm.getMode() == ImportWizardForm.MODE_ONLY_UPDATE ) {
+                		if( aForm.isGenderMissing() || aForm.isMailingTypeMissing()  ) {
+                			destination=mapping.findForward(&quot;verifymissingfields&quot;);
+                			aForm.setAction(ImportWizardAction.ACTION_PARSE);
+                		}
+                	}
+                	break;
+                    
                 case ImportWizardAction.ACTION_PARSE:
-                    aForm.setAction(ImportWizardAction.ACTION_PRESCAN);
+                 	aForm.setAction(ImportWizardAction.ACTION_PRESCAN);  
                     destination=mapping.findForward(&quot;verify&quot;);
                     break;
                     
@@ -199,6 +218,9 @@ public class ImportWizardAction extends StrutsActionBase {
                 case ImportWizardAction.ACTION_PRESCAN:
                     aForm.setAction(ImportWizardAction.ACTION_MLISTS);
                     destination=mapping.findForward(&quot;prescan&quot;);
+                    aForm.setMailingTypeMissing(false);
+                    aForm.setGenderMissing(false);
+                    aForm.setLinesOK(aForm.getLinesOKFromFile(req));
                     break;
                     
                 case ImportWizardAction.ACTION_MLISTS:
@@ -413,9 +435,7 @@ public class ImportWizardAction extends StrutsActionBase {
             String fileName=new String(this.getCompanyID(req)+&quot;-&quot;+System.currentTimeMillis());
             
             tmpFile=File.createTempFile(fileName, &quot;.csv&quot;, new File(AgnUtils.getDefaultValue(&quot;system.upload_archive&quot;)));
-            FileOutputStream aOut=new FileOutputStream(tmpFile);
-            aOut.write(aForm.getCsvFile().getFileData());
-            aOut.close();
+            writeToTmpFile(aForm, tmpFile);
         } catch (Exception e) {
             AgnUtils.logger().error(&quot;writeContent: &quot;+e);
             e.printStackTrace();
@@ -447,7 +467,10 @@ public class ImportWizardAction extends StrutsActionBase {
             String customer_body = &quot;INSERT INTO cust_&quot; + companyID + &quot;_tmp&quot;+dsDescription.getId()+&quot;_tbl ( datasource_id, change_date, creation_date&quot;;
             
             ArrayList usedColumns=new ArrayList();
-            aIt=aForm.getCsvAllColumns().listIterator();
+            ArrayList csvAllColumns = aForm.getCsvAllColumns();
+            
+            aIt= csvAllColumns.listIterator();
+            
             int numFields=0;
             while (aIt.hasNext()) {
                 aInfo=(CsvColInfo)aIt.next();
@@ -467,51 +490,54 @@ public class ImportWizardAction extends StrutsActionBase {
                 customer_body+=&quot;, ?&quot;;
             }
             customer_body+=&quot;)&quot;;
+            
             // values:
-            int x=0;
-            Object aVal=null;
-            try {
-                ListIterator contentIterator=aForm.getParsedContent().listIterator();
-                LinkedList aLine=null;
-                
-                while(contentIterator.hasNext()) {
-                    try {
-                        Vector params=new Vector();
-                        
-                        aLine=(LinkedList)contentIterator.next();
-                        for(int a=0; a&lt;numFields; a++) {
-                            aInfo=(CsvColInfo)usedColumns.get(a);
-                            aVal=aLine.get(a);
-                            if(aInfo.getType()==CsvColInfo.TYPE_CHAR) {
-                                params.add((String)aVal);
-                            } else if(aInfo.getType()==CsvColInfo.TYPE_NUMERIC) {
-                                if(aVal!=null) {
-                                    params.add(new Double(((Double)aVal).doubleValue()));
-                                } else {
-                                    params.add(new Integer(0));
-                                }
-                            } else if(aInfo.getType()==CsvColInfo.TYPE_DATE) {
-                                if(aVal!=null) {
-                                    params.add((java.util.Date)aVal);
-                                } else {
-                                    params.add(new Integer(0));
-                                }
-                            }
-                        }
-                        jdbc.update(customer_body, params.toArray());
-                    } catch (Exception e1) {
-                        errorsOnInsert++;
-                        AgnUtils.logger().error(&quot;writeContent: &quot;+e1);
-                        e1.printStackTrace();
-                    }
-                    aForm.setDbInsertStatus((int)((((double)x)/aForm.getLinesOK())*100.0));
-                    x++;
-                }
-            } catch (Exception e) {
-                AgnUtils.logger().error(&quot;writeContent: &quot;+e);
-                e.printStackTrace();
+            // write the first block which has been already read in the parsecontent() call of the form  to the database
+            writeParsedContent(aForm, jdbc, errorsOnInsert, customer_body,usedColumns, numFields);
+            writeToTmpFile(aForm, tmpFile);
+	        clearBlocks(aForm);
+            
+            // 'fast forward' to the last read line
+            
+            String csvString =  new String(aForm.getCsvFile().getFileData(), aForm.getStatus()
+					.getCharset());
+            LineNumberReader aReader = new LineNumberReader(new StringReader(
+    				csvString));
+            int i=0;
+            while( aReader.readLine() != null &amp;&amp; i &lt; aForm.getReadlines()) {
+            	i++;
+            	// do nothing
             }
             
+        	String myline = &quot;&quot;;
+			LinkedList aLineContent = null;
+			
+			aForm.getUniqueValues().clear();
+			
+			while ((myline = aReader.readLine()) != null ) { 
+				if (myline.trim().length() &gt; 0) {
+					aLineContent = aForm.parseLine(myline, (Locale) req
+							.getSession().getAttribute(
+									org.apache.struts.Globals.LOCALE_KEY));
+					if (aLineContent != null) {
+						aForm.getParsedContent().add(aLineContent);
+						aForm.getParsedData().append(myline + &quot;\n&quot;);
+					}						
+				}
+				if ( aForm.getParsedContent().size() % ImportWizardForm.BLOCK_SIZE == 0  ) {
+					writeParsedContent(aForm, jdbc, errorsOnInsert, customer_body,
+							usedColumns, numFields);
+					writeToTmpFile(aForm, tmpFile);
+			        clearBlocks(aForm);
+				}		
+			}
+			aReader.close();
+			// if the last block is smaller than the the BLOCK_SIZE the modulo division wouldn't match
+			if( aForm.getParsedContent().size() &gt; 0 ) {
+				writeParsedContent(aForm, jdbc, errorsOnInsert, customer_body, usedColumns, numFields);
+				writeToTmpFile(aForm, tmpFile);
+			}
+            
             aForm.setError(ImportWizardForm.DBINSERT_ERROR, errorLines.toString());
             tm.commit(ts);
         }   catch (Exception e) {
@@ -568,9 +594,16 @@ public class ImportWizardAction extends StrutsActionBase {
                 if(aForm.getStatus().getIgnoreNull()==ImportWizardForm.MODE_DONT_IGNORE_NULL_VALUES) {
                     try {
                     	String tempSubTabName = &quot;cust_&quot; + companyID + &quot;_tmp2_sub&quot; + aForm.getDatasourceID() + &quot;_tbl&quot;;
+                    	 
                     	sql=&quot;CREATE TEMPORARY TABLE &quot;+tempSubTabName+&quot; AS (SELECT * from cust_&quot; + companyID + &quot;_tmp&quot;+aForm.getDatasourceID()+&quot;_tbl tmp WHERE tmp.datasource_id=0)&quot;;
                         jdbc.execute(sql);
-                        
+                        // reset bounces when email has been changed and customer_id is key column
+//	                    if( !&quot;email&quot;.equalsIgnoreCase(aForm.getStatus().getKeycolumn())) {         
+//                        	sql = &quot;UPDATE customer_&quot;+ companyID +&quot;_binding_tbl SET user_status = 1, user_remark = 'reaktivierung durch import ',  change_date = now() &quot; +
+//                        	&quot; WHERE user_status = 2 AND customer_id IN (SELECT cust.customer_id FROM &quot;+ tempSubTabName +&quot; tmp join customer_&quot;+  companyID + &quot;_tbl cust on (tmp.customer_id = cust.customer_id ) where cust.email != tmp.email  ) AND user_type ='W' &quot;;
+//                        	jdbc.execute(sql);
+//                    	}
+                        //
                     	sql = &quot;UPDATE &quot; +
                         			&quot;customer_&quot; + companyID + &quot;_tbl cust, &quot; +
                         			&quot;cust_&quot; + companyID + &quot;_tmp&quot;+aForm.getDatasourceID()+&quot;_tbl temp &quot; +
@@ -775,6 +808,71 @@ public class ImportWizardAction extends StrutsActionBase {
         
         tmpl.saveOrUpdate(&quot;CustomerImportStatus&quot;, aForm.getStatus());
     }
+
+	private void clearBlocks(ImportWizardForm aForm) {
+		aForm.setParsedData( new StringBuffer() ); 
+		aForm.getParsedContent().clear(); // reset the block
+	}
+
+	private void writeToTmpFile(ImportWizardForm aForm, File tmpFile)
+			throws FileNotFoundException, IOException {
+		FileOutputStream aOut=new FileOutputStream(tmpFile);
+		    aOut.write(aForm.getCsvFile().getFileData());
+		    aOut.close();
+	}
+
+	private void writeParsedContent(ImportWizardForm aForm, JdbcTemplate jdbc,
+			int errorsOnInsert, String customer_body, ArrayList usedColumns,
+			int numFields) {
+		CsvColInfo aInfo;
+		int x=0;
+		Object aVal=null;
+		try {
+		    ListIterator contentIterator=aForm.getParsedContent().listIterator();
+		    LinkedList aLine=null;
+		    
+		    while(contentIterator.hasNext()) {
+		        try {
+		            Vector params=new Vector();
+		            
+		            aLine=(LinkedList)contentIterator.next();
+		            for(int a=0; a&lt;numFields; a++) {
+		                aInfo=(CsvColInfo)usedColumns.get(a);
+		                aVal=aLine.get(a);
+		                boolean continueProcessing = true;
+		               
+		                if(continueProcessing ) {
+		                if(aInfo.getType()==CsvColInfo.TYPE_CHAR) {
+		                    params.add((String)aVal);
+		                } else if(aInfo.getType()==CsvColInfo.TYPE_NUMERIC) {
+		                    if(aVal!=null) {
+		                        params.add(new Double(((Double)aVal).doubleValue()));
+		                    } else {
+		                        params.add(new Integer(0));
+		                    }
+		                } else if(aInfo.getType()==CsvColInfo.TYPE_DATE) {
+		                    if(aVal!=null) {
+		                        params.add((java.util.Date)aVal);
+		                    } else {
+		                        params.add(new Integer(0));
+		                    }
+		                }
+		                }                         
+		            }
+		            jdbc.update(customer_body, params.toArray());
+		        } catch (Exception e1) {
+		            errorsOnInsert++;
+		            AgnUtils.logger().error(&quot;writeContent: &quot;+e1);
+		            e1.printStackTrace();
+		        }
+		        aForm.setDbInsertStatus((int)((((double)x)/aForm.getLinesOK())*100.0));
+		        x++;
+		    }
+		} catch (Exception e) {
+		    AgnUtils.logger().error(&quot;writeContent: &quot;+e);
+		    e.printStackTrace();
+		}
+	}
     
     /**
      * Retrieves new Datasource-ID for newly imported Subscribers
@@ -838,4 +936,8 @@ public class ImportWizardAction extends StrutsActionBase {
         
         return data;
     }
+    
+  
+    
+    
 }</diff>
      <filename>src/java/org/agnitas/web/ImportWizardAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,7 @@
 
 package org.agnitas.web;
 
+import java.io.IOException;
 import java.io.LineNumberReader;
 import java.io.StringReader;
 import java.sql.Connection;
@@ -45,10 +46,12 @@ import javax.servlet.http.HttpServletRequest;
 import javax.sql.DataSource;
 
 import org.agnitas.beans.CustomerImportStatus;
+import org.agnitas.beans.Recipient;
 import org.agnitas.util.AgnUtils;
 import org.agnitas.util.CsvColInfo;
 import org.agnitas.util.CsvTokenizer;
 import org.agnitas.util.SafeString;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.commons.collections.map.CaseInsensitiveMap;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
@@ -65,6 +68,15 @@ import org.springframework.jdbc.support.rowset.SqlRowSet;
  */
 public class ImportWizardForm extends StrutsFormBase {
 
+
+	public static final int BLOCK_SIZE = 1000;
+
+	public static final String MAILTYPE_KEY = &quot;mailtype&quot;;
+
+	public static final String GENDER_KEY = &quot;gender&quot;;
+
+	public static final String PARSE_ERRORS = &quot;parseErrors&quot;;
+
 	private static final long serialVersionUID = 7563170467003097523L;
 
 	private CustomerImportStatus status = null;
@@ -128,9 +140,9 @@ public class ImportWizardForm extends StrutsFormBase {
 
 	public static final String EMAILDOUBLE_ERROR = &quot;emailDouble&quot;;
 
-	public static final String GENDER_ERROR = &quot;gender&quot;;
+	public static final String GENDER_ERROR = GENDER_KEY;
 
-	public static final String MAILTYPE_ERROR = &quot;mailtype&quot;;
+	public static final String MAILTYPE_ERROR = MAILTYPE_KEY;
 
 	public static final String NUMERIC_ERROR = &quot;numeric&quot;;
 
@@ -168,6 +180,12 @@ public class ImportWizardForm extends StrutsFormBase {
 	 * Holds value of property linesOK.
 	 */
 	private int linesOK;
+	
+	/**
+	 * number of read lines
+	 */
+	private int readlines;
+	
 
 	/**
 	 * Holds value of property dbInsertStatus.
@@ -214,7 +232,18 @@ public class ImportWizardForm extends StrutsFormBase {
 	 * Holds value of property previewOffset.
 	 */
 	private int previewOffset;
+	
+	
+	/**
+	 * user may choose a default mailing-type in case of no column for mailing-type has been assigned
+	 */
 
+	private String manualAssignedMailingType =  Integer.toString(Recipient.MAILTYPE_HTML); 
+	private String manualAssignedGender = Integer.toString(Recipient.GENDER_UNKNOWN); 
+	
+	private boolean mailingTypeMissing = false;
+	private boolean genderMissing = false;
+	
 	/**
 	 * Validate the properties that have been set from this HTTP request, and
 	 * return an &lt;code&gt;ActionMessages&lt;/code&gt; object that encapsulates any
@@ -233,9 +262,9 @@ public class ImportWizardForm extends StrutsFormBase {
 			HttpServletRequest request) {
 		ApplicationContext aContext = this.getWebApplicationContext();
 		ActionErrors errors = new ActionErrors();
-
+			
 		AgnUtils.logger().info(&quot;validate: &quot; + this.action);
-
+		
 		switch (this.action) {
 
 		case ImportWizardAction.ACTION_START:
@@ -246,29 +275,29 @@ public class ImportWizardForm extends StrutsFormBase {
 			if (request.getParameter(&quot;mode_back.x&quot;) != null) {
 				this.action = ImportWizardAction.ACTION_START;
 			} else {
+				
 				errors = parseFirstline(request);
+				
 			}
 			break;
+		
+		case ImportWizardAction.ACTION_CHECK_FIELDS:
+			mapColumns(request); // map columns		
+			break;
 
 		case ImportWizardAction.ACTION_PARSE:
 			try {
 				if (request.getParameter(&quot;mapping_back.x&quot;) != null) {
 					this.action = ImportWizardAction.ACTION_MODE;
 				} else {
-					// do column mapping:
-					mapColumns(request);
-					// start at the top of the csv file:
-					this.previewOffset = 0;
-					// change this to process the column name mapping from
-					// previous action:
-					errors = this.parseContent(request);
-					// we have too many rows:
-					if (this.linesOK &gt; Integer.parseInt(AgnUtils
+					doParse(request);	
+					setLinesOK(getLinesOKFromFile(request));
+					if (getLinesOK() &gt; Integer.parseInt(AgnUtils
 							.getDefaultValue(&quot;import.maxrows&quot;))) {
 						errors.add(&quot;global&quot;, new ActionMessage(
-								&quot;error.import.too_many_records&quot;));
+								&quot;error.import.too_many_records&quot; , AgnUtils.getDefaultValue(&quot;import.maxrows&quot;)));
 						this.action = ImportWizardAction.ACTION_MODE;
-					}
+					 }
 				}
 			} catch (Exception e) {
 				System.err.println(&quot;Exception caught: &quot; + e);
@@ -323,11 +352,18 @@ public class ImportWizardForm extends StrutsFormBase {
 				this.previewOffset = 0;
 			}
 			break;
-
 		}
 		return errors;
 	}
 
+	public void doParse(HttpServletRequest request) {
+		// start at the top of the csv file:
+		this.previewOffset = 0;
+		// change this to process the column name mapping from
+		// previous action:
+		this.parseContent(request);
+	}
+
 	private void initStatus(ApplicationContext aContext) {
 		status = (CustomerImportStatus) aContext
 				.getBean(&quot;CustomerImportStatus&quot;);
@@ -653,7 +689,7 @@ public class ImportWizardForm extends StrutsFormBase {
 	 * csv column information Checks email / email adress / email adress on
 	 * blacklist.
 	 */
-	protected LinkedList parseLine(String input, Locale locale) {
+	public LinkedList parseLine(String input, Locale locale) {
 		// EnhStringTokenizer aLine = null;
 		CsvTokenizer aLine = null;
 		int j = 0;
@@ -671,7 +707,10 @@ public class ImportWizardForm extends StrutsFormBase {
 
 		aLine = new CsvTokenizer(input, status.getSeparator(), status
 				.getDelimiter());
+		
 		try {
+			boolean addedGenderDummyValue = false;
+			boolean addedMailtypeDummyValue = false;
 			while ((aValue = aLine.nextToken()) != null) {
 				aCsvInfo = (CsvColInfo) this.csvAllColumns.get(j);
 
@@ -723,14 +762,14 @@ public class ImportWizardForm extends StrutsFormBase {
 							AgnUtils.logger().error(&quot;Blacklisted: &quot; + input);
 							return null;
 						}
-					} else if (aInfo.getName().equalsIgnoreCase(&quot;mailtype&quot;)) {
+					} else if (aInfo.getName().equalsIgnoreCase(MAILTYPE_KEY)) {
 						try {
 							tmp = Integer.parseInt(aValue);
 							if (tmp &lt; 0 || tmp &gt; 2) {
 								throw new Exception(&quot;Invalid mailtype&quot;);
 							}
 						} catch (Exception e) {
-							if (aInfo.getName().equalsIgnoreCase(&quot;mailtype&quot;)) {
+							if (aInfo.getName().equalsIgnoreCase(MAILTYPE_KEY)) {
 								if (!aValue.equalsIgnoreCase(&quot;text&quot;)
 										&amp;&amp; !aValue.equalsIgnoreCase(&quot;txt&quot;)
 										&amp;&amp; !aValue.equalsIgnoreCase(&quot;html&quot;)
@@ -742,14 +781,14 @@ public class ImportWizardForm extends StrutsFormBase {
 								}
 							}
 						}
-					} else if (aInfo.getName().equalsIgnoreCase(&quot;gender&quot;)) {
+					} else if (aInfo.getName().equalsIgnoreCase(GENDER_KEY)) {
 						try {
 							tmp = Integer.parseInt(aValue);
 							if (tmp &lt; 0 || tmp &gt; 5) {
 								throw new Exception(&quot;Invalid gender&quot;);
 							}
 						} catch (Exception e) {
-							if (aInfo.getName().equalsIgnoreCase(&quot;gender&quot;)) {
+							if (aInfo.getName().equalsIgnoreCase(GENDER_KEY)) {
 								if (!aValue.equalsIgnoreCase(&quot;Herr&quot;)
 										&amp;&amp; !aValue.equalsIgnoreCase(&quot;Herrn&quot;)
 										&amp;&amp; !aValue.equalsIgnoreCase(&quot;m&quot;)
@@ -786,7 +825,7 @@ public class ImportWizardForm extends StrutsFormBase {
 									valueList.add(Double.valueOf(aValue));
 								} catch (Exception e) {
 									if (aInfo.getName().equalsIgnoreCase(
-											&quot;gender&quot;)) {
+											GENDER_KEY) &amp;&amp; !columnMapping.containsKey(GENDER_KEY+&quot;_dummy&quot;)) {
 										if (aValue.equalsIgnoreCase(&quot;Herr&quot;)
 												|| aValue
 														.equalsIgnoreCase(&quot;Herrn&quot;)
@@ -796,11 +835,12 @@ public class ImportWizardForm extends StrutsFormBase {
 												.equalsIgnoreCase(&quot;Frau&quot;)
 												|| aValue.equalsIgnoreCase(&quot;w&quot;)) {
 											valueList.add(Double.valueOf(1));
-										} else {
+										} 		
+										else {
 											valueList.add(Double.valueOf(2));
 										}
 									} else if (aInfo.getName().equalsIgnoreCase(
-											&quot;mailtype&quot;)) {
+											MAILTYPE_KEY) &amp;&amp;  ! columnMapping.containsKey(MAILTYPE_KEY+&quot;_dummy&quot;)) {
 										if (aValue.equalsIgnoreCase(&quot;text&quot;)
 												|| aValue
 														.equalsIgnoreCase(&quot;txt&quot;)) {
@@ -811,7 +851,7 @@ public class ImportWizardForm extends StrutsFormBase {
 										} else if (aValue
 												.equalsIgnoreCase(&quot;offline&quot;)) {
 											valueList.add(Double.valueOf(2));
-										}
+										} 
 									} else {
 										setError(
 												NUMERIC_ERROR,
@@ -848,12 +888,26 @@ public class ImportWizardForm extends StrutsFormBase {
 						}
 					}
 				}
+				
+				
+				
 				j++;
 			}
+			if (this.getColumnMapping().containsKey(GENDER_KEY+&quot;_dummy&quot; ) &amp;&amp; ! addedGenderDummyValue ) {
+				valueList.add(getManualAssignedGender());
+				addedGenderDummyValue = true;
+			}
+			if (this.getColumnMapping().containsKey(MAILTYPE_KEY+&quot;_dummy&quot; ) &amp;&amp; ! addedMailtypeDummyValue ) {
+				valueList.add(getManualAssignedMailingType());
+				addedMailtypeDummyValue = true;
+			}
+			
+			
 		} catch (Exception e) {
 			setError(STRUCTURE_ERROR, input + &quot;\n&quot;);
 			AgnUtils.logger().error(&quot;parseLine: &quot; + e);
 			return null;
+		
 		}
 
 		if (this.csvMaxUsedColumn != j) {
@@ -870,7 +924,6 @@ public class ImportWizardForm extends StrutsFormBase {
 	 * Maps columns from database.
 	 */
 	protected void mapColumns(HttpServletRequest req) {
-
 		int i = 1;
 		CsvColInfo aCol = null;
 
@@ -901,6 +954,45 @@ public class ImportWizardForm extends StrutsFormBase {
 				}
 			}
 		}
+		
+		if ( ! columnIsMapped(GENDER_KEY) ) {
+			CsvColInfo genderCol = new CsvColInfo();
+			genderCol.setName(GENDER_KEY);
+			genderCol.setType(CsvColInfo.TYPE_CHAR);
+			columnMapping.put(GENDER_KEY+&quot;_dummy&quot;, genderCol );
+			setGenderMissing(true);
+		}
+		
+		if ( ! columnIsMapped(MAILTYPE_KEY) ) {
+			CsvColInfo mailtypeCol = new CsvColInfo();
+			mailtypeCol.setName(MAILTYPE_KEY);
+			mailtypeCol.setType(CsvColInfo.TYPE_CHAR);			
+			columnMapping.put(MAILTYPE_KEY+&quot;_dummy&quot;, mailtypeCol );
+			setMailingTypeMissing(true);
+		}
+		
+		// check if the mailtype/ gender is allready in columnmapping , if we find only a dummy -&gt; add a dummy to csvAllColumns too 
+		if( getColumnMapping().containsKey(GENDER_KEY+&quot;_dummy&quot;)) {
+			CsvColInfo mailtypeDummy = new CsvColInfo();
+			mailtypeDummy.setName(GENDER_KEY+&quot;_dummy&quot;);
+			mailtypeDummy.setActive(true);
+			mailtypeDummy.setType(CsvColInfo.TYPE_CHAR);
+			csvAllColumns.add(mailtypeDummy);
+		}
+		
+		
+		if( getColumnMapping().containsKey(MAILTYPE_KEY+&quot;_dummy&quot;)) {
+			CsvColInfo mailtypeDummy = new CsvColInfo();
+			mailtypeDummy.setName(MAILTYPE_KEY+&quot;_dummy&quot;);
+			mailtypeDummy.setActive(true);
+			mailtypeDummy.setType(CsvColInfo.TYPE_CHAR);
+			csvAllColumns.add(mailtypeDummy);
+		}
+		
+		 
+		
+		
+		
 	}
 
 	/**
@@ -935,9 +1027,12 @@ public class ImportWizardForm extends StrutsFormBase {
 		LineNumberReader aReader = new LineNumberReader(new StringReader(
 				csvString));
 
+		
 		try {
 			// read first line:
 			if ((firstline = aReader.readLine()) != null) {
+				aReader.close(); // 
+				
 				// split line into tokens:
 				CsvTokenizer st = new CsvTokenizer(firstline, status
 						.getSeparator(), status.getDelimiter());
@@ -966,7 +1061,7 @@ public class ImportWizardForm extends StrutsFormBase {
 					this.csvMaxUsedColumn = colNum;
 				}
 			}
-
+			
 		} catch (Exception e) {
 			AgnUtils.logger().error(&quot;parseFirstline: &quot; + e);
 		}
@@ -1024,16 +1119,21 @@ public class ImportWizardForm extends StrutsFormBase {
 		// and eventually for gender and mailtype:
 		String aKey = &quot;&quot;;
 		CsvColInfo aCol = null;
+			
+	
+			
 		Enumeration aMapEnu = this.columnMapping.keys();
+		
 		while (aMapEnu.hasMoreElements()) {
 			aKey = (String) aMapEnu.nextElement();
 			aCol = (CsvColInfo) this.columnMapping.get(aKey);
 
-			if (aCol.getName().equalsIgnoreCase(&quot;gender&quot;)) {
+									
+			if (aCol.getName().equalsIgnoreCase(GENDER_KEY) ) {
 				hasGENDER = true;
 			}
 
-			if (aCol.getName().equalsIgnoreCase(&quot;mailtype&quot;)) {
+			if (aCol.getName().equalsIgnoreCase(MAILTYPE_KEY)) {
 				hasMAILTYPE = true;
 			}
 
@@ -1082,7 +1182,10 @@ public class ImportWizardForm extends StrutsFormBase {
 			// StringTokenizer file = new StringTokenizer(csvString, &quot;\n&quot;);
 
 			if (errors.isEmpty()) {
-				while ((myline = aReader.readLine()) != null) {
+				readlines = 0;
+				int maxrows = BLOCK_SIZE;
+				this.linesOK = 0;
+				while ((myline = aReader.readLine()) != null &amp;&amp; this.linesOK &lt; maxrows) { // Bug-Fix just read the first 1000 lines to avoid trouble with heap space 
 					if (myline.trim().length() &gt; 0) {
 						aLineContent = parseLine(myline, (Locale) req
 								.getSession().getAttribute(
@@ -1091,9 +1194,12 @@ public class ImportWizardForm extends StrutsFormBase {
 							parsedContent.add(aLineContent);
 							this.parsedData.append(myline + &quot;\n&quot;);
 							this.linesOK++;
-						}
+						}						
 					}
+					readlines++;
 				}
+				
+				aReader.close();
 			}
 		} catch (Exception e) {
 			AgnUtils.logger().error(&quot;parseContent: &quot; + e);
@@ -1101,6 +1207,17 @@ public class ImportWizardForm extends StrutsFormBase {
 		return errors;
 	}
 
+	private boolean columnIsMapped( String key ) {
+		Enumeration&lt;CsvColInfo&gt; elements = columnMapping.elements();
+		while( elements.hasMoreElements()) {
+			CsvColInfo colInfo = elements.nextElement();
+			if(key.equalsIgnoreCase(colInfo.getName())) {
+				return true;
+			}			
+		}
+		return false;
+	}
+
 	/**
 	 * Gets mailing lists from request.
 	 */
@@ -1342,4 +1459,66 @@ public class ImportWizardForm extends StrutsFormBase {
 	public void setErrorId(String errorId) {
 		this.errorId = errorId;
 	}
+
+	public String getManualAssignedMailingType() {
+		return manualAssignedMailingType;
+	}
+
+	public void setManualAssignedMailingType(String manualAssignedMailingType) {
+		this.manualAssignedMailingType = manualAssignedMailingType;
+	}
+
+	public String getManualAssignedGender() {
+		return manualAssignedGender;
+	}
+
+	public void setManualAssignedGender(String manualAssignedGender) {
+		this.manualAssignedGender = manualAssignedGender;
+	}
+
+	public boolean isMailingTypeMissing() {
+		return mailingTypeMissing;
+	}
+
+	public void setMailingTypeMissing(boolean mailingTypeMissing) {
+		this.mailingTypeMissing = mailingTypeMissing;
+	}
+
+	public boolean isGenderMissing() {
+		return genderMissing;
+	}
+
+	public void setGenderMissing(boolean genderMissing) {
+		this.genderMissing = genderMissing;
+	}
+
+	public int getReadlines() {
+		return readlines;
+	}	
+	
+	 /**
+     * read all lines of the file
+     * @param aForm
+     * @param req
+     * @return
+     * @throws IOException
+     */
+    public int getLinesOKFromFile( HttpServletRequest req ) throws IOException {
+    	String csvString =  new String(this.getCsvFile().getFileData(), this.getStatus().getCharset());
+      	LineNumberReader aReader = new LineNumberReader(new StringReader(csvString));
+        String myline = &quot;&quot;;
+		int linesOK = 0;
+		this.getUniqueValues().clear();	
+		aReader.readLine(); // skip header
+		while ((myline = aReader.readLine()) != null ) { 
+			if (myline.trim().length() &gt; 0) {
+				if(  this.parseLine(myline, (Locale) req.getSession().getAttribute(org.apache.struts.Globals.LOCALE_KEY)) != null) {
+					linesOK++;
+				}						
+			}
+		}
+		aReader.close();
+		return linesOK;
+     }
+	
 }</diff>
      <filename>src/java/org/agnitas/web/ImportWizardForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -55,7 +55,7 @@ import org.apache.struts.action.ActionMessages;
  * @author Martin Helff
  */
 
-public final class LogonAction extends StrutsActionBase {
+public class LogonAction extends StrutsActionBase {
     
     public static final int ACTION_LOGON = 1;
     public static final int ACTION_LOGOFF = 2;
@@ -200,7 +200,7 @@ public final class LogonAction extends StrutsActionBase {
 		return true;
 	}
 
-	private String	checkPassword(HttpServletRequest req)	{
+	protected String	checkPassword(HttpServletRequest req)	{
         	HttpSession	session=req.getSession();
 		Admin		admin=(Admin) session.getAttribute(&quot;emm.admin&quot;);
 		Date		lastChange=admin.getLastPasswordChange();</diff>
      <filename>src/java/org/agnitas/web/LogonAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,7 @@ package org.agnitas.web;
 import javax.servlet.http.HttpServletRequest;
 
 import org.agnitas.util.AgnUtils;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;</diff>
      <filename>src/java/org/agnitas/web/LogonForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,7 @@ package org.agnitas.web;
 import javax.servlet.http.HttpServletRequest;
 
 import org.agnitas.dao.TargetDao;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.upload.FormFile;</diff>
      <filename>src/java/org/agnitas/web/MailingAttachmentsForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -27,12 +27,15 @@ import java.math.BigDecimal;
 import java.sql.SQLException;
 import java.sql.Timestamp;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
 
 import javax.mail.internet.InternetAddress;
 import javax.servlet.ServletException;
@@ -44,11 +47,14 @@ import org.agnitas.beans.Admin;
 import org.agnitas.beans.Mailing;
 import org.agnitas.beans.MailingComponent;
 import org.agnitas.beans.MediatypeEmail;
+import org.agnitas.beans.impl.DynaBeanPaginatedListImpl;
 import org.agnitas.dao.AdminDao;
 import org.agnitas.dao.MailingDao;
 import org.agnitas.dao.MailinglistDao;
+import org.agnitas.service.MailingsQueryWorker;
 import org.agnitas.util.AgnUtils;
 import org.agnitas.util.SafeString;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.commons.beanutils.BasicDynaClass;
 import org.apache.commons.beanutils.DynaBean;
 import org.apache.commons.beanutils.DynaProperty;
@@ -58,6 +64,7 @@ import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;
 import org.apache.struts.action.ActionMessages;
+import org.displaytag.pagination.PaginatedList;
 import org.springframework.context.ApplicationContext;
 import org.springframework.jdbc.core.JdbcTemplate;
 
@@ -264,17 +271,34 @@ public class MailingBaseAction extends StrutsActionBase {
         
         if(destination != null &amp;&amp;  &quot;list&quot;.equals(destination.getName())) {
         	try {
-        		req.setAttribute(&quot;mailinglist&quot;,getMailingList(req, aForm.getTypes(), aForm.isIsTemplate()));
-				setNumberOfRows(req,(StrutsFormBase)form);
-			} catch (Exception e) {
-				AgnUtils.logger().error(&quot;getMailingList: &quot;+e+&quot;\n&quot;+AgnUtils.getStackTrace(e));
-	            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.exception&quot;));
-			} 
+         	   setNumberOfRows(req, aForm);
+         	   destination = mapping.findForward(&quot;loading&quot;);
+         	   
+         	   if( aForm.getCurrentFuture() == null ) {
+         		  aForm.setCurrentFuture(getMailingListFuture(req,aForm.getTypes(), aForm.isIsTemplate(), aForm ));
+         	   }   	   
+         	   
+         	   if ( aForm.getCurrentFuture() != null &amp;&amp; aForm.getCurrentFuture().isDone()) {
+         		   
+         		   req.setAttribute(&quot;mailinglist&quot;, aForm.getCurrentFuture().get());
+         		   destination = mapping.findForward(&quot;list&quot;);
+         		   aForm.setCurrentFuture(null);
+         		   aForm.setRefreshMillis(RecipientForm.DEFAULT_REFRESH_MILLIS);
+         	   }
+         	   else {
+         		   if( aForm.getRefreshMillis() &lt; 1000 ) { // raise the refresh time
+         			   aForm.setRefreshMillis( aForm.getRefreshMillis() + 50 );
+         		   }
+         		   aForm.setError(false);
+         	  }
+         	   			
+            } catch (Exception e) {
+         	   AgnUtils.logger().error(&quot;getMailingList: &quot;+e+&quot;\n&quot;+AgnUtils.getStackTrace(e));
+                errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.exception&quot;));
+                aForm.setError(true); // do not refresh when an error has been occurred
+            } 
         }  
         
-        
-        
-        
         // Report any errors we have discovered back to the original form
         if (!errors.isEmpty()) {
             saveErrors(req, errors);
@@ -391,7 +415,8 @@ public class MailingBaseAction extends StrutsActionBase {
                 aForm.setTargetMode(aTemplate.getTargetMode());
                 aForm.setTargetGroups(aTemplate.getTargetGroups());
                 aForm.setMediatypes(aTemplate.getMediatypes());
-                aForm.setArchived( aTemplate.getArchived() != 0 );
+                aForm.setArchived(aTemplate.getArchived() != 0);
+                aForm.setCampaignID(aTemplate.getCampaignID());
                 
                 // load template for this mailing
                 if((tmpComp=aTemplate.getHtmlTemplate())!=null) {
@@ -503,59 +528,54 @@ public class MailingBaseAction extends StrutsActionBase {
     /** 
      * load the data for the list view
      */
-    public List&lt;DynaBean&gt; getMailingList(HttpServletRequest req , String types, boolean isTemplate ) throws IllegalAccessException, InstantiationException {
-		  ApplicationContext aContext= getWebApplicationContext();
-	      JdbcTemplate aTemplate=new JdbcTemplate( (DataSource)aContext.getBean(&quot;dataSource&quot;));
-	    
-	      // Optimize: Limit number of rows , deliver only a special page
-//	      String sqlStatement = 
-//	    	  &quot;select *, case when senddate is null then 0 else 1 end as send_null &quot; +
-//	    	  &quot;from ( SELECT a.mailing_id, a.shortname, a.description, a.mailinglist_id,&quot; +
-//	    	  &quot; ( SELECT min( c.&quot;+AgnUtils.changeDateName()+&quot; ) FROM mailing_account_tbl c WHERE a.mailing_id =c.mailing_id AND c.status_field = 'W' ) AS senddate,&quot; +
-//	    	  &quot; ( SELECT  shortname FROM mailinglist_tbl m WHERE a.mailinglist_id=m.mailinglist_id AND  a.company_id=m.company_id ) AS mailinglist &quot; +
-//	    	  &quot;FROM mailing_tbl a WHERE a.company_id = &quot;+AgnUtils.getCompanyID(req)+&quot; AND a.deleted &lt;&gt; 1 AND a.is_template = &quot;+isTemplate+&quot; and mailing_type in (&quot; + types + &quot;))&quot; +
-//	    	  &quot; te ORDER BY send_null ASC, senddate DESC, mailing_id DESC&quot;;
-//	      
-	      
-	   
-	      String mailingTypes = &quot;  AND  mailing_type in (&quot;+ types +&quot;) &quot;;
-	      if(isTemplate) {
-	    	  mailingTypes = &quot; &quot;;
-	      }
-	      
-		  String sqlStatement = 
-	    	  &quot; SELECT *, case when senddate is null then 0 else 1 end as send_null &quot; +
-	    	  &quot; FROM (   SELECT a.mailing_id , a.shortname  , a.description ,   min(c.&quot; + AgnUtils.changeDateName() + &quot;) senddate, m.shortname mailinglist &quot; +
-	    	  &quot; FROM  (mailing_tbl  a LEFT JOIN mailing_account_tbl c ON (a.mailing_id=c.mailing_id AND c.status_field='W')) &quot; + &quot; LEFT JOIN mailinglist_tbl m ON (  a.mailinglist_id=m.mailinglist_id AND  a.company_id=m.company_id) &quot; +
-			  &quot;  WHERE a.company_id = &quot; + AgnUtils.getCompanyID(req) + &quot; AND a.deleted&lt;&gt;1 AND a.is_template=&quot; + (isTemplate?1:0)
-				+ mailingTypes + &quot;  GROUP BY  a.mailing_id, a.shortname, a.description, m.shortname ) openemm &quot; + &quot;   ORDER BY send_null ASC, senddate DESC, mailing_id DESC &quot;;
-	      		
-    		List&lt;Map&gt; tmpList = aTemplate.queryForList(sqlStatement);
-	      DynaProperty[] properties = new DynaProperty[] {
-	    		  new DynaProperty(&quot;mailingid&quot;, Long.class),
-	    		  new DynaProperty(&quot;shortname&quot;, String.class),
-	    		  new DynaProperty(&quot;description&quot;, String.class),
-	    		  new DynaProperty(&quot;mailinglist&quot;, String.class),
-	    		  new DynaProperty(&quot;senddate&quot;,Timestamp.class)   		  
-	      };
-	      BasicDynaClass dynaClass = new BasicDynaClass(&quot;mailing&quot;, null, properties);
-	      
-	      List&lt;DynaBean&gt; result = new ArrayList&lt;DynaBean&gt;();
-	      for(Map row:tmpList) {
-	    	  DynaBean newBean = dynaClass.newInstance();    	
-	    	  newBean.set(&quot;mailingid&quot;, row.get(&quot;MAILING_ID&quot;));
-	    	  newBean.set(&quot;shortname&quot;, row.get(&quot;SHORTNAME&quot;));
-	    	  newBean.set(&quot;description&quot;, row.get(&quot;DESCRIPTION&quot;));
-	    	  newBean.set(&quot;mailinglist&quot;, row.get(&quot;MAILINGLIST&quot;));
-	    	  newBean.set(&quot;senddate&quot;,row.get(&quot;SENDDATE&quot;));
-	    	  result.add(newBean);
-	    	  
-	      }    
-	      
-	      return result;
+    public Future getMailingListFuture(HttpServletRequest req , String types, boolean isTemplate, MailingBaseForm mailingBaseForm ) throws IllegalAccessException, InstantiationException {
+
+    	String sort = getSort(req, mailingBaseForm);
+     	
+     	String direction = req.getParameter(&quot;dir&quot;);
+     	if( direction == null ) {
+     		direction = mailingBaseForm.getOrder();     		
+     	} else {
+     		mailingBaseForm.setOrder(direction);
+     	}
+     	
+     	String pageStr  = req.getParameter(&quot;page&quot;);
+     	if ( pageStr == null || &quot;&quot;.equals(pageStr.trim()) ) {
+     		if ( mailingBaseForm.getPage() == null || &quot;&quot;.equals(mailingBaseForm.getPage().trim())) {
+     			mailingBaseForm.setPage(&quot;1&quot;);
+     		}
+     		pageStr = mailingBaseForm.getPage();
+     		
+     	}
+     	else {
+     		mailingBaseForm.setPage(pageStr);
+     	}
+     	
+     	if( mailingBaseForm.isNumberOfRowsChanged() ) {
+     		mailingBaseForm.setPage(&quot;1&quot;);
+     		mailingBaseForm.setNumberOfRowsChanged(false);
+     		pageStr = &quot;1&quot;;
+     	}
+     	
+     	int page = Integer.parseInt(pageStr);
+     	
+     	int rownums = mailingBaseForm.getNumberofRows();
+     	MailingDao mDao=(MailingDao) getBean(&quot;MailingDao&quot;);
+     	ExecutorService service = (ExecutorService) getWebApplicationContext().getBean(&quot;workerExecutorService&quot;);
+    	Future future = service.submit(new MailingsQueryWorker(mDao, AgnUtils.getCompanyID(req), types, isTemplate, sort, direction, page, rownums ));
+     	return future; 
+    	
+    }
+
+	protected String getSort(HttpServletRequest request, MailingBaseForm aForm) {
+		String sort = request.getParameter(&quot;sort&quot;);  
+		 if( sort == null ) {
+			 sort = aForm.getSort();			 
+		 } else {
+			 aForm.setSort(sort);
+		 }
+		return sort;
 	}
-    
-    
    
     
 }</diff>
      <filename>src/java/org/agnitas/web/MailingBaseAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -35,13 +35,14 @@ import org.agnitas.beans.Mailing;
 import org.agnitas.beans.Mediatype;
 import org.agnitas.beans.MediatypeEmail;
 import org.agnitas.util.AgnUtils;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;
 
 /**
  *
- * @author  mhe
+ * @author  mhe, Nicole Serek
  */
 public class MailingBaseForm extends StrutsFormBase {
     
@@ -60,7 +61,7 @@ public class MailingBaseForm extends StrutsFormBase {
     /**
      * Holds value of property shortname. 
      */
-    protected String shortname=&quot;&quot;;
+    protected String shortname = &quot;&quot;;
     
     /**
      * Holds value of property description. 
@@ -154,9 +155,6 @@ public class MailingBaseForm extends StrutsFormBase {
     
     protected Map&lt;String, String&gt; actions;
     
-   
-   
-
 	/** 
      * Creates a new instance of TemplateForm 
      */
@@ -167,31 +165,31 @@ public class MailingBaseForm extends StrutsFormBase {
      * Initialization.
      */
     public void clearData(int companyID, int defaultMediaType) throws Exception {
+        this.targetID = 0;
+        this.mailinglistID = 0;
+        this.templateID = 0;
+        this.campaignID = 0;
+        this.mailingType = Mailing.TYPE_NORMAL;
         
-        this.targetID=0;
-        this.mailinglistID=0;
-        this.templateID=0;
-        this.mailingType=Mailing.TYPE_NORMAL;
-        
-        this.shortname=new String(&quot;&quot;);
-        this.description=new String(&quot;&quot;);
+        this.shortname = new String(&quot;&quot;);
+        this.description = new String(&quot;&quot;);
        
-        mediatypes=new HashMap();
-        Mediatype mt=(Mediatype) getWebApplicationContext().getBean(&quot;MediatypeEmail&quot;);
+        mediatypes = new HashMap();
+        Mediatype mt = (Mediatype) getWebApplicationContext().getBean(&quot;MediatypeEmail&quot;);
         mt.setStatus(Mediatype.STATUS_ACTIVE);
         mediatypes.put(new Integer(0), mt); 
-        this.emailReplytoEmail=&quot;&quot;;
-        this.emailReplytoFullname=&quot;&quot;;
-        this.emailCharset=&quot;UTF-8&quot;;
-        this.emailLinefeed=72;
+        this.emailReplytoEmail = &quot;&quot;;
+        this.emailReplytoFullname = &quot;&quot;;
+        this.emailCharset = &quot;UTF-8&quot;;
+        this.emailLinefeed = 72;
         
-        this.worldMailingSend=false;
-        this.targetGroups=null;
-        this.showTemplate=false;
-        this.copyFlag=false;
-        this.archived=false;
-        this.needsTarget=false;
-        this.targetMode=Mailing.TARGET_MODE_OR;
+        this.worldMailingSend = false;
+        this.targetGroups = null;
+        this.showTemplate = false;
+        this.copyFlag = false;
+        this.archived = false;
+        this.needsTarget = false;
+        this.targetMode = Mailing.TARGET_MODE_OR;
     }
     
     @Override
@@ -200,7 +198,6 @@ public class MailingBaseForm extends StrutsFormBase {
     	super.reset(map, request);
     }
     
-    
     /**
      * Validate the properties that have been set from this HTTP request,
      * and return an &lt;code&gt;ActionErrors&lt;/code&gt; object that encapsulates any
@@ -216,48 +213,44 @@ public class MailingBaseForm extends StrutsFormBase {
             HttpServletRequest request) {
         
         ActionErrors errors = new ActionErrors();
-        
-        Mailing aMailing=null;
+        Mailing aMailing = null;
 
-        if(action==MailingBaseAction.ACTION_SAVE) {
-        	
-        	if(this.mailinglistID==0) {
+        if(action == MailingBaseAction.ACTION_SAVE) {
+        	if(this.mailinglistID == 0) {
         		errors.add(&quot;global&quot;, new ActionMessage(&quot;error.mailing.noMailinglist&quot;));
         	}
-        	
             
-            if(request.getParameter(&quot;addtarget.x&quot;)!=null) {
+            if(request.getParameter(&quot;addtarget.x&quot;) != null) {
                 //this.action=MailingBaseAction.ACTION_VIEW_WITHOUT_LOAD;
-                if(this.targetID!=0) {
-                    if(this.targetGroups==null) {
-                        this.targetGroups=new HashSet();
+                if(this.targetID != 0) {
+                    if(this.targetGroups == null) {
+                        this.targetGroups = new HashSet();
                     }
                     this.targetGroups.add(new Integer(this.targetID));
                 }
             }
             
-            Enumeration allNames=request.getParameterNames();
-            String aName=null;
-            int tmpTarget=0;
+            Enumeration allNames = request.getParameterNames();
+            String aName = null;
+            int tmpTarget = 0;
             while(allNames.hasMoreElements()) {
-                aName=(String)allNames.nextElement();
+                aName = (String)allNames.nextElement();
                 if(aName.startsWith(&quot;removetarget&quot;)) {
                     try {
-                        tmpTarget=Integer.parseInt(aName.substring(12, aName.indexOf('.')));
+                        tmpTarget = Integer.parseInt(aName.substring(12, aName.indexOf('.')));
                     } catch (Exception e) {
                         AgnUtils.logger().error(&quot;validate: &quot;+e.getMessage());
                     }
                 }
             }
-            if(tmpTarget!=0) {
-                this.targetID=tmpTarget;
-                this.action=MailingBaseAction.ACTION_REMOVE_TARGET;
+            if(tmpTarget != 0) {
+                this.targetID = tmpTarget;
+                this.action = MailingBaseAction.ACTION_REMOVE_TARGET;
             }
         }
         
-        if(action==MailingBaseAction.ACTION_SAVE) {
-            
-            if((this.isIsTemplate()==false) &amp;&amp; this.isNeedsTarget() &amp;&amp; this.targetGroups==null) {
+        if(action == MailingBaseAction.ACTION_SAVE) {
+            if((this.isIsTemplate() == false) &amp;&amp; this.isNeedsTarget() &amp;&amp; this.targetGroups == null) {
                 errors.add(&quot;global&quot;, new ActionMessage(&quot;error.mailing.rulebased_without_target&quot;));
             }
 
@@ -265,57 +258,42 @@ public class MailingBaseForm extends StrutsFormBase {
                 errors.add(&quot;shortname&quot;, new ActionMessage(&quot;error.nameToShort&quot;));
             }
             
-            
             // NEW CODE (to be inserted):
-            if(this.emailReplytoFullname!=null &amp;&amp; this.emailReplytoFullname.length()&gt;255) {
+            if(this.emailReplytoFullname != null &amp;&amp; this.emailReplytoFullname.length() &gt; 255) {
                 errors.add(&quot;replyFullname&quot;, new ActionMessage(&quot;error.reply_fullname_too_long&quot;));
             }
-            if(getSenderFullname()!=null &amp;&amp; getSenderFullname().length()&gt;255) {
+            if(getSenderFullname() != null &amp;&amp; getSenderFullname().length() &gt; 255) {
                 errors.add(&quot;senderFullname&quot;, new ActionMessage(&quot;error.sender_fullname_too_long&quot;));
             }
-            if(this.emailReplytoFullname!=null &amp;&amp; this.emailReplytoFullname.trim().length()==0) {
-                this.emailReplytoFullname=getSenderFullname();
+            if(this.emailReplytoFullname != null &amp;&amp; this.emailReplytoFullname.trim().length() == 0) {
+                this.emailReplytoFullname = getSenderFullname();
             }
             
-            
-            
-            if(this.targetGroups==null &amp;&amp; this.mailingType==Mailing.TYPE_DATEBASED) {
+            if(this.targetGroups == null &amp;&amp; this.mailingType == Mailing.TYPE_DATEBASED) {
                 errors.add(&quot;global&quot;, new ActionMessage(&quot;error.mailing.rulebased_without_target&quot;));
             }
             
-            
             // NEW CODE (to be inserted):
-            if(getMediaEmail().getFromEmail().length()&lt;3)
+            if(getMediaEmail().getFromEmail().length() &lt; 3)
                 errors.add(&quot;shortname&quot;, new ActionMessage(&quot;error.invalid.email&quot;));
             
-            if(getEmailSubject().length()&lt;2) {
+            if(getEmailSubject().length() &lt; 2) {
                 errors.add(&quot;subject&quot;, new ActionMessage(&quot;error.mailing.subject.too_short&quot;));
             }
-           
-/* 
-            if(this.textTemplate.trim().length()==0) {
-                errors.add(&quot;template&quot;, new ActionMessage(&quot;error.mailing.no_text_template&quot;));
-            }
-            
-            if(this.htmlTemplate.trim().length()==0) {
-                errors.add(&quot;template&quot;, new ActionMessage(&quot;error.mailing.no_html_template&quot;));
-            }
-*/
-            
             
             try {
-                InternetAddress adr=new InternetAddress(getMediaEmail().getFromEmail());
-                if(adr.getAddress().indexOf(&quot;@&quot;)==-1) {
+                InternetAddress adr = new InternetAddress(getMediaEmail().getFromEmail());
+                if(adr.getAddress().indexOf(&quot;@&quot;) == -1) {
                     errors.add(&quot;sender&quot;, new ActionMessage(&quot;error.mailing.sender_adress&quot;));
                 }              
             } catch (Exception e) {
-                if(getMediaEmail().getFromEmail().indexOf(&quot;[agn&quot;)==-1) {
+                if(getMediaEmail().getFromEmail().indexOf(&quot;[agn&quot;) == -1) {
                     errors.add(&quot;sender&quot;, new ActionMessage(&quot;error.mailing.sender_adress&quot;));
                 }
             }
             
             try {
-                aMailing=(Mailing) getWebApplicationContext().getBean(&quot;Mailing&quot;);
+                aMailing = (Mailing) getWebApplicationContext().getBean(&quot;Mailing&quot;);
                 aMailing.setCompanyID(this.getCompanyID(request));
                 aMailing.findDynTagsInTemplates(new String(this.getEmailSubject()), this.getWebApplicationContext());
                 aMailing.findDynTagsInTemplates(new String(this.getSenderFullname()), this.getWebApplicationContext());
@@ -325,7 +303,7 @@ public class MailingBaseForm extends StrutsFormBase {
             }
             
             try {
-                aMailing=(Mailing) getWebApplicationContext().getBean(&quot;Mailing&quot;);
+                aMailing = (Mailing) getWebApplicationContext().getBean(&quot;Mailing&quot;);
                 aMailing.setCompanyID(this.getCompanyID(request));
                 aMailing.personalizeText(new String(this.getEmailSubject()), 0, this.getWebApplicationContext());
                 aMailing.personalizeText(new String(this.getSenderFullname()), 0, this.getWebApplicationContext());
@@ -333,9 +311,9 @@ public class MailingBaseForm extends StrutsFormBase {
                 errors.add(&quot;subject&quot;, new ActionMessage(&quot;error.personalization_tag&quot;));
             }
             
-            if(getTextTemplate().length()!=0) {
+            if(getTextTemplate().length() != 0) {
                 // Just a syntax-check, no MailingID required
-                aMailing=(Mailing) getWebApplicationContext().getBean(&quot;Mailing&quot;);
+                aMailing = (Mailing) getWebApplicationContext().getBean(&quot;Mailing&quot;);
                 aMailing.setCompanyID(this.getCompanyID(request));
                 
                 try {
@@ -352,9 +330,9 @@ public class MailingBaseForm extends StrutsFormBase {
                 
             }
             
-            if(getHtmlTemplate().length()!=0) {
+            if(getHtmlTemplate().length() != 0) {
                 // Just a syntax-check, no MailingID required
-                aMailing=(Mailing) getWebApplicationContext().getBean(&quot;Mailing&quot;);
+                aMailing = (Mailing) getWebApplicationContext().getBean(&quot;Mailing&quot;);
                 aMailing.setCompanyID(this.getCompanyID(request));
                 
                 try {
@@ -370,13 +348,10 @@ public class MailingBaseForm extends StrutsFormBase {
                     errors.add(&quot;texttemplate&quot;, new ActionMessage(&quot;error.template.dyntags&quot;));
                 }
             }
-            
         }
-        
         return errors;
     }
     
-    
     /**
      * Getter for property templateID.
      *
@@ -1027,5 +1002,4 @@ public class MailingBaseForm extends StrutsFormBase {
 		}
 		return types;
 	}
-	
 }</diff>
      <filename>src/java/org/agnitas/web/MailingBaseForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,7 @@ import java.net.URLEncoder;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;</diff>
      <filename>src/java/org/agnitas/web/MailingComponentsForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -25,6 +25,7 @@ package org.agnitas.web;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 </diff>
      <filename>src/java/org/agnitas/web/MailingContentForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletRequest;
 import org.agnitas.beans.Mailing;
 import org.agnitas.stat.DeliveryStat;
 import org.agnitas.util.AgnUtils;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 </diff>
      <filename>src/java/org/agnitas/web/MailingSendForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -28,6 +28,7 @@ import java.util.LinkedList;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 
@@ -573,7 +574,8 @@ public class MailingStatForm extends StrutsFormBase {
     
     /**
      * Getter for property statInProgress.
-     *
+     * This Method checks, if the statistic is generated at the moment.
+     * If true, you will have to wait until its ready.     
      * @return Value of property statInProgress.
      */
     public boolean isStatInProgress() {</diff>
      <filename>src/java/org/agnitas/web/MailingStatForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -54,7 +54,7 @@ import org.apache.struts.action.ActionMessages;
  * @author Martin Helff, Nicole Serek, Andreas Rehak
  */
 
-public final class MailingWizardAction extends StrutsDispatchActionBase {
+public class MailingWizardAction extends StrutsDispatchActionBase {
 
 	public static final String ACTION_START = &quot;start&quot;;
 
@@ -164,34 +164,6 @@ public final class MailingWizardAction extends StrutsDispatchActionBase {
 		Mailing mailing = aForm.getMailing();
 
 		if (aForm.getMailing().getMailTemplateID() == 0) {
-/*
-			Mailing newMailing = (Mailing) getBean(&quot;Mailing&quot;);
-
-			newMailing.init(getCompanyID(req), getWebApplicationContext());
-			newMailing.setShortname(mailing.getShortname());
-			newMailing.setDescription(mailing.getDescription());
-			newMailing.setIsTemplate(false);
-			newMailing.setCompanyID(aForm.getCompanyID(req));
-
-			Map mediatypes = newMailing.getMediatypes();
-
-			Mediatype type = (Mediatype) mediatypes.get(0);
-			if (type != null) {
-				type.setStatus(Mediatype.STATUS_ACTIVE);
-			} else {
-				// should not happen
-				MediatypeEmail paramEmail = newMailing
-						.getEmailParam(getWebApplicationContext());
-
-				paramEmail.setCharset(&quot;iso-8859-1&quot;);
-				paramEmail.setMailFormat(1);
-				paramEmail.setLinefeed(0);
-				paramEmail.setPriority(1);
-				paramEmail.setStatus(Mediatype.STATUS_ACTIVE);
-				mediatypes.put(0, paramEmail);
-			}
-			aForm.setMailing(newMailing);
-*/
 			mailing.setIsTemplate(false);
 
 			Map mediatypes = mailing.getMediatypes();
@@ -212,9 +184,7 @@ public final class MailingWizardAction extends StrutsDispatchActionBase {
 				mediatypes.put(0, paramEmail);
 			}
 		} else {
-			Mailing template = mDao.getMailing(
-					aForm.getMailing().getMailTemplateID(),
-					getCompanyID(req));
+			Mailing template = mDao.getMailing(aForm.getMailing().getMailTemplateID(), getCompanyID(req));
 
 			if (template != null) {
 				Mailing newMailing = (Mailing) template
@@ -229,7 +199,8 @@ public final class MailingWizardAction extends StrutsDispatchActionBase {
 				newMailing.setMediatypes(template.getMediatypes());
 				newMailing.setMailTemplateID(template.getId());
 				newMailing.setCompanyID(aForm.getCompanyID(req));
-				newMailing.setArchived( template.getArchived() );
+				newMailing.setMailinglistID(template.getMailinglistID());
+				newMailing.setArchived(template.getArchived());
 
 				Map mediatypes = newMailing.getMediatypes();
 </diff>
      <filename>src/java/org/agnitas/web/MailingWizardAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -31,6 +31,7 @@ import org.agnitas.beans.TrackableLink;
 import org.agnitas.beans.DynamicTag;
 import org.agnitas.beans.DynamicTagContent;
 import org.agnitas.util.AgnUtils;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;
@@ -65,8 +66,8 @@ public class MailingWizardForm extends StrutsFormBase {
             HttpServletRequest request) {
     	ActionErrors errors = new ActionErrors();
 
-    	if( mailing != null  &amp;&amp; ( MailingWizardAction.ACTION_TARGET.equalsIgnoreCase(action)  ||  MailingWizardAction.ACTION_FINISH.equalsIgnoreCase(action)) ) {    	
-    	  if( (mailing.getTargetGroups()==null || mailing.getTargetGroups().isEmpty() ) &amp;&amp; getTargetID()== 0  &amp;&amp; mailing.getMailingType()==Mailing.TYPE_DATEBASED ) {
+    	if(mailing != null  &amp;&amp; (MailingWizardAction.ACTION_TARGET.equalsIgnoreCase(action)  ||  MailingWizardAction.ACTION_FINISH.equalsIgnoreCase(action))) {    	
+    	  if((mailing.getTargetGroups()==null || mailing.getTargetGroups().isEmpty() ) &amp;&amp; getTargetID()== 0  &amp;&amp; mailing.getMailingType()==Mailing.TYPE_DATEBASED) {
               errors.add(&quot;global&quot;, new ActionMessage(&quot;error.mailing.rulebased_without_target&quot;));
           }
     	}</diff>
      <filename>src/java/org/agnitas/web/MailingWizardForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -42,6 +42,7 @@ import org.agnitas.dao.TargetDao;
 import org.agnitas.target.Target;
 import org.agnitas.dao.BindingEntryDao;
 import org.agnitas.util.AgnUtils;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.commons.beanutils.BasicDynaClass;
 import org.apache.commons.beanutils.DynaBean;
 import org.apache.commons.beanutils.DynaProperty;
@@ -147,7 +148,7 @@ public final class MailinglistAction extends StrutsActionBase {
                     	if(req.getParameter(&quot;save.x&quot;)!=null) {
                             if(saveMailinglist(aForm, req)) {
                             	
-                            	req.setAttribute(&quot;mailinglistList&quot;, getMailinglist(req));
+                            	//req.setAttribute(&quot;mailinglistList&quot;, getMailinglist(req));
                                 //list(aForm, req);
                                 destination=mapping.findForward(&quot;list&quot;);
                             } else {</diff>
      <filename>src/java/org/agnitas/web/MailinglistAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,7 @@ import java.util.Locale;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;</diff>
      <filename>src/java/org/agnitas/web/MailinglistForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,7 @@ import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;</diff>
      <filename>src/java/org/agnitas/web/MailloopForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -90,13 +90,24 @@ public class OnePixelCount extends HttpServlet {
 				AgnUtils.logger().warn(&quot;uid invalid: &quot;+param);
 				return;
 			}
-			if(pixelDao.writePixel((int) uid.getCompanyID(), (int) uid.getCustomerID(), (int) uid.getMailingID(), req.getRemoteAddr())) {
-				AgnUtils.logger().info(&quot;Onepixel: cust: &quot;+uid.getCustomerID()+&quot; mi: &quot;+uid.getMailingID()+&quot; ci: &quot;+uid.getCompanyID());
-			}
+			persistLog(req, pixelDao, uid);
+			
 		} catch (Exception e) {
 			AgnUtils.logger().error(e.getMessage());
 			AgnUtils.logger().error(AgnUtils.getStackTrace(e));
 			return;
 		}
 	}
+	
+	protected void persistLog(HttpServletRequest req, OnepixelDao pixelDao,
+			UID uid) {
+		if(writePixelLogToDB(req, pixelDao, uid)) {
+			AgnUtils.logger().info(&quot;Onepixel: cust: &quot;+uid.getCustomerID()+&quot; mi: &quot;+uid.getMailingID()+&quot; ci: &quot;+uid.getCompanyID());
+		}
+	}
+
+	protected boolean writePixelLogToDB(HttpServletRequest req,
+			OnepixelDao pixelDao, UID uid) {
+		return pixelDao.writePixel((int) uid.getCompanyID(), (int) uid.getCustomerID(), (int) uid.getMailingID(), req.getRemoteAddr());
+	}
 }</diff>
      <filename>src/java/org/agnitas/web/OnePixelCount.java</filename>
    </modified>
    <modified>
      <diff>@@ -28,6 +28,7 @@ import java.net.URLEncoder;
 import javax.servlet.http.HttpServletRequest;
 
 import org.agnitas.util.AgnUtils;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;</diff>
      <filename>src/java/org/agnitas/web/ProfileFieldForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -23,34 +23,31 @@
 package org.agnitas.web;
 
 import java.io.IOException;
-import java.math.BigDecimal;
-import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.sql.DataSource;
 
 import org.agnitas.beans.BindingEntry;
 import org.agnitas.beans.Recipient;
 import org.agnitas.dao.RecipientDao;
+import org.agnitas.service.RecipientQueryBuilder;
+import org.agnitas.service.RecipientQueryWorker;
 import org.agnitas.target.TargetRepresentation;
 import org.agnitas.util.AgnUtils;
-import org.agnitas.util.RecipientQueryBuilder;
-import org.apache.commons.beanutils.BasicDynaClass;
-import org.apache.commons.beanutils.DynaBean;
-import org.apache.commons.beanutils.DynaProperty;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;
 import org.apache.struts.action.ActionMessages;
+import org.displaytag.pagination.PaginatedList;
 import org.springframework.context.ApplicationContext;
-import org.springframework.jdbc.core.JdbcTemplate;
 
 /**
  * Handles all actions on profile fields.
@@ -81,23 +78,24 @@ public class RecipientAction extends StrutsActionBase {
     HttpServletResponse res)
     throws IOException, ServletException {
 
+    	  	
         // Validate the request parameters specified by the user
-        RecipientForm aForm=null;
+        RecipientForm aForm = null;
         ActionMessages errors = new ActionErrors();
-        ActionForward destination=null;
-        ApplicationContext aContext=this.getWebApplicationContext();
-
+        ActionForward destination = null;
+        ApplicationContext aContext = this.getWebApplicationContext();
+        
         if(!this.checkLogon(req)) {
             return mapping.findForward(&quot;logon&quot;);
         }
 
-        if(form!=null) {
-            aForm=(RecipientForm)form;
+        if(form != null) {
+            aForm = (RecipientForm)form;
         } else {
-            aForm=new RecipientForm();
+            aForm = new RecipientForm();
         }
 
-        if(req.getParameter(&quot;delete.x&quot;)!=null) {
+        if(req.getParameter(&quot;delete.x&quot;) != null) {
             aForm.setAction(ACTION_CONFIRM_DELETE);
         }
 
@@ -105,8 +103,8 @@ public class RecipientAction extends StrutsActionBase {
             switch(aForm.getAction()) {
                 case ACTION_LIST:
                     if(allowed(&quot;recipient.show&quot;, req)) {
-                        TargetRepresentation targetRep=aForm.getTarget();
-                        destination=mapping.findForward(&quot;list&quot;);
+                        TargetRepresentation targetRep = aForm.getTarget();
+                        destination = mapping.findForward(&quot;list&quot;);
                         if(!targetRep.checkBracketBalance()) {
                             errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.target.bracketbalance&quot;));
                         }
@@ -117,14 +115,14 @@ public class RecipientAction extends StrutsActionBase {
 
                 case ACTION_VIEW:
                     if(allowed(&quot;recipient.show&quot;, req)) {
-                        if(req.getParameter(&quot;recipientID&quot;)!=null) {
+                        if(req.getParameter(&quot;recipientID&quot;) != null) {
                             loadRecipient(aContext, aForm, req);
                             aForm.setAction(RecipientAction.ACTION_SAVE);
                         } else {
                             loadDefaults(aContext, aForm, req);
                             aForm.setAction(RecipientAction.ACTION_NEW);
                         }
-                        destination=mapping.findForward(&quot;view&quot;);
+                        destination = mapping.findForward(&quot;view&quot;);
                     } else {
                         errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
                     }
@@ -132,10 +130,10 @@ public class RecipientAction extends StrutsActionBase {
 
                 case ACTION_SAVE:
                     if(allowed(&quot;recipient.change&quot;, req)) {
-                        if(req.getParameter(&quot;save.x&quot;)!=null) {
+                        if(req.getParameter(&quot;save.x&quot;) != null) {
                             saveRecipient(aContext, aForm, req);
                             aForm.setAction(RecipientAction.ACTION_LIST);
-                            destination=mapping.findForward(&quot;list&quot;);
+                            destination = mapping.findForward(&quot;list&quot;);
                         }
                     } else {
                         errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
@@ -144,15 +142,15 @@ public class RecipientAction extends StrutsActionBase {
 
                 case ACTION_NEW:
                     if(allowed(&quot;recipient.new&quot;, req)) {
-                       if(req.getParameter(&quot;save.x&quot;)!=null) {
+                       if(req.getParameter(&quot;save.x&quot;) != null) {
                             aForm.setRecipientID(0);
                             if(saveRecipient(aContext, aForm, req)){
                                 aForm.setAction(RecipientAction.ACTION_LIST);
-                                destination=mapping.findForward(&quot;list&quot;);
+                                destination = mapping.findForward(&quot;list&quot;);
                             } else {
                                 errors.add(&quot;NewRecipient&quot;, new ActionMessage(&quot;error.subscriber.insert_in_db_error&quot;));
                                 aForm.setAction(RecipientAction.ACTION_VIEW);
-                                destination=mapping.findForward(&quot;view&quot;);
+                                destination = mapping.findForward(&quot;view&quot;);
                             }
                         }
                     } else {
@@ -163,7 +161,7 @@ public class RecipientAction extends StrutsActionBase {
                 case ACTION_CONFIRM_DELETE:
                     if(allowed(&quot;recipient.delete&quot;, req)) {
                         loadRecipient(aContext, aForm, req);
-                        destination=mapping.findForward(&quot;delete&quot;);
+                        destination = mapping.findForward(&quot;delete&quot;);
                     } else {
                         errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
                     }
@@ -171,10 +169,10 @@ public class RecipientAction extends StrutsActionBase {
 
                 case ACTION_DELETE:
                     if(allowed(&quot;recipient.delete&quot;, req)) {
-                        if(req.getParameter(&quot;kill.x&quot;)!=null) {
+                        if(req.getParameter(&quot;kill.x&quot;) != null) {
                             deleteRecipient(aContext, aForm, req);
                             aForm.setAction(RecipientAction.ACTION_LIST);
-                            destination=mapping.findForward(&quot;list&quot;);
+                            destination = mapping.findForward(&quot;list&quot;);
                         }
                     } else {
                         errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.permissionDenied&quot;));
@@ -183,32 +181,49 @@ public class RecipientAction extends StrutsActionBase {
 
                 default:
                     aForm.setAction(RecipientAction.ACTION_LIST);
-                    destination=mapping.findForward(&quot;list&quot;);
+                    destination = mapping.findForward(&quot;list&quot;);
             }
 
         } catch (Exception e) {
-            AgnUtils.logger().error(&quot;execute: &quot;+e+&quot;\n&quot;+AgnUtils.getStackTrace(e));
+            AgnUtils.logger().error(&quot;execute: &quot; + e + &quot;\n&quot; + AgnUtils.getStackTrace(e));
             errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.exception&quot;));
         }
 
         if( &quot;list&quot;.equals(destination.getName())) {
            try {
-			req.setAttribute(&quot;recipientList&quot;, getRecipientList(req, getWebApplicationContext(),aForm ));
-			setNumberOfRows(req, aForm);
+        	   setNumberOfRows(req, aForm);
+        	   destination = mapping.findForward(&quot;loading&quot;);
+        	   
+        	   if( aForm.getCurrentFuture() == null ) {
+        		aForm.setCurrentFuture(getRecipientListFuture(req , aContext, aForm));
+        	   }   	   
+        	   
+        	   if ( aForm.getCurrentFuture() != null &amp;&amp; aForm.getCurrentFuture().isDone()) {
+        		   req.setAttribute(&quot;recipientList&quot;, aForm.getCurrentFuture().get());
+        		   destination = mapping.findForward(&quot;list&quot;);
+        		   aForm.setAll(((PaginatedList)aForm.getCurrentFuture().get()).getFullListSize());
+        		   aForm.setCurrentFuture(null);
+        		   aForm.setRefreshMillis(RecipientForm.DEFAULT_REFRESH_MILLIS);
+        	   }
+        	   else {
+        		   if( aForm.getRefreshMillis() &lt; 1000 ) { // raise the refresh time
+        			   aForm.setRefreshMillis( aForm.getRefreshMillis() + 50 );
+        		   }
+        		   aForm.setError(false);
+        	  }
+        	   			
            } catch (Exception e) {
-        	   AgnUtils.logger().error(&quot;recipientList: &quot;+e+&quot;\n&quot;+AgnUtils.getStackTrace(e));
+        	   AgnUtils.logger().error(&quot;recipientList: &quot; + e + &quot;\n&quot; + AgnUtils.getStackTrace(e));
                errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(&quot;error.exception&quot;));
+               aForm.setError(true); // do not refresh when an error has been occurred
            } 
         }
         
-        
-        
         // Report any errors we have discovered back to the original form
         if (!errors.isEmpty()) {
             saveErrors(req, errors);
             // return new ActionForward(mapping.getForward());
         }
-
         return destination;
     }
 
@@ -216,18 +231,17 @@ public class RecipientAction extends StrutsActionBase {
      * Loads recipient.
      */
     protected void loadRecipient(ApplicationContext aContext, RecipientForm aForm, HttpServletRequest req) {
-        Recipient cust=(Recipient) aContext.getBean(&quot;Recipient&quot;);
+        Recipient cust = (Recipient) aContext.getBean(&quot;Recipient&quot;);
         RecipientDao dao = (RecipientDao) aContext.getBean(&quot;RecipientDao&quot;);
-        Map data=null;
-        Iterator i=null;
+        Map data = null;
+        Iterator i = null;
 
         cust.setCompanyID(this.getCompanyID(req));
         cust.setCustomerID(aForm.getRecipientID());
-        data=dao.getCustomerDataFromDb(cust.getCompanyID(), cust.getCustomerID());
-        i=data.keySet().iterator();
+        data = dao.getCustomerDataFromDb(cust.getCompanyID(), cust.getCustomerID());
+        i = data.keySet().iterator();
         while(i.hasNext()) {
             String key=(String) i.next();
-
             if(key.equals(&quot;gender&quot;)) {
                 try {
                 	aForm.setGender(Integer.parseInt((String) data.get(&quot;gender&quot;)));
@@ -258,16 +272,15 @@ public class RecipientAction extends StrutsActionBase {
      * Loads recipient.
      */
     protected void loadDefaults(ApplicationContext aContext, RecipientForm aForm, HttpServletRequest req) {
-        Map tmp=null;
+        Map tmp = null;
 
         try {
             Map tmp2 = org.agnitas.taglib.ShowColumnInfoTag.getColumnInfo(aContext, this.getCompanyID(req), &quot;%&quot;);
 
-            Iterator it=tmp2.values().iterator();
+            Iterator it = tmp2.values().iterator();
             while(it.hasNext()) {
-                tmp=(Map)it.next();
-                String column=(String) tmp.get(&quot;column&quot;);
-
+                tmp = (Map) it.next();
+                String column = (String) tmp.get(&quot;column&quot;);
                 aForm.setColumn(column, tmp.get(&quot;default&quot;));
              }
         } catch (Exception e) { }
@@ -316,7 +329,7 @@ public class RecipientAction extends StrutsActionBase {
         Map data = null;
         Map column = null;
         Iterator i = null;
-	int companyID=aForm.getCompanyID(req);
+        int companyID = aForm.getCompanyID(req);
 
         cust.setCompanyID(this.getCompanyID(req));
         if(aForm.getRecipientID() != 0) {
@@ -328,7 +341,6 @@ public class RecipientAction extends StrutsActionBase {
             while(i.hasNext()) {
                 String key = (String) i.next();
                 String value = (String) column.get(key);
-
                 data.put(key, value);
             }
             data.put(&quot;gender&quot;, new Integer(aForm.getGender()).toString());
@@ -340,9 +352,9 @@ public class RecipientAction extends StrutsActionBase {
             cust.setCustParameters(data);
             dao.updateInDB(cust);
         } else {
-		if(dao.mayAdd(companyID, 1) == false) {
-			return false;
-		}
+        	if(dao.mayAdd(companyID, 1) == false) {
+        		return false;
+        	}
 
             data = dao.getCustomerDataFromDb(companyID, aForm.getRecipientID());
             column = aForm.getColumnMap();
@@ -374,50 +386,49 @@ public class RecipientAction extends StrutsActionBase {
      * Updates customer bindings.
      */
     public boolean updateCustBindingsFromAdminReq(Recipient cust, ApplicationContext aContext, HttpServletRequest req) {
-
-        String aKey=null;
-        String newKey=null;
-        String aParam=null;
+        String aKey = null;
+        String newKey = null;
+        String aParam = null;
         int aMailinglistID;
         int oldSubStatus, newSubStatus;
-        String tmpUT=null;
-        String tmpOrgUT=null;
-        Iterator aEnum=req.getParameterMap().keySet().iterator();
-        BindingEntry aEntry=(BindingEntry) aContext.getBean(&quot;BindingEntry&quot;);
+        String tmpUT = null;
+        String tmpOrgUT = null;
+        Iterator aEnum = req.getParameterMap().keySet().iterator();
+        BindingEntry aEntry = (BindingEntry) aContext.getBean(&quot;BindingEntry&quot;);
 
         while(aEnum.hasNext()) {
-            aKey=(String)aEnum.next();
+            aKey = (String)aEnum.next();
             if(aKey.startsWith(&quot;AGN_0_ORG_MT&quot;)) {
                 oldSubStatus = Integer.parseInt((String) req.getParameter(aKey));
-                aMailinglistID=Integer.parseInt(aKey.substring(12));
-                newKey=new String(&quot;AGN_0_MTYPE&quot; + aMailinglistID);
-                aParam=(String) req.getParameter(newKey);
-                if(aParam!=null) {
-                    newSubStatus=1;
+                aMailinglistID = Integer.parseInt(aKey.substring(12));
+                newKey = new String(&quot;AGN_0_MTYPE&quot; + aMailinglistID);
+                aParam = (String) req.getParameter(newKey);
+                if(aParam != null) {
+                    newSubStatus = 1;
                 } else {
-                    newSubStatus=0;
+                    newSubStatus = 0;
                 }
 
-                newKey=new String(&quot;AGN_0_MLUT&quot; + aMailinglistID);
-                tmpUT=(String) req.getParameter(newKey);
-                newKey=new String(&quot;AGN_0_ORG_UT&quot; + aMailinglistID);
-                tmpOrgUT=(String) req.getParameter(newKey);
+                newKey = new String(&quot;AGN_0_MLUT&quot; + aMailinglistID);
+                tmpUT = (String) req.getParameter(newKey);
+                newKey = new String(&quot;AGN_0_ORG_UT&quot; + aMailinglistID);
+                tmpOrgUT = (String) req.getParameter(newKey);
 
-                if((newSubStatus!=oldSubStatus) || (tmpUT.compareTo(tmpOrgUT)!=0)) {
+                if((newSubStatus != oldSubStatus) || (tmpUT.compareTo(tmpOrgUT) != 0)) {
                     aEntry.setMediaType(0);
                     aEntry.setCustomerID(cust.getCustomerID());
                     aEntry.setMailinglistID(aMailinglistID);
                     aEntry.setUserType(tmpUT);
-                    if(newSubStatus==0) { // Opt-Out
+                    if(newSubStatus == 0) { // Opt-Out
                         aEntry.setUserStatus(BindingEntry.USER_STATUS_ADMINOUT);
               //          aEntry.setUserRemark(&quot;Opt-Out by ADMIN&quot;);
                     } else { // Opt-In
                         aEntry.setUserStatus(BindingEntry.USER_STATUS_ACTIVE);
               //          aEntry.setUserRemark(&quot;Opt-In by ADMIN&quot;);
                     }
-                    if(aEntry.updateBindingInDB(cust.getCompanyID())==false) {
+                    if(aEntry.updateBindingInDB(cust.getCompanyID()) == false) {
                         // aEntry.setUserType(BindingEntry.USER_TYPE_WORLD); // Bei Neu-Eintrag durch User entsprechenden Typ setzen
-                        if(newSubStatus==1) {
+                        if(newSubStatus == 1) {
                             aEntry.insertNewBindingInDB(cust.getCompanyID());
                         }
                     }
@@ -431,7 +442,7 @@ public class RecipientAction extends StrutsActionBase {
      * Removes recipient.
      */
     protected void deleteRecipient(ApplicationContext aContext, RecipientForm aForm, HttpServletRequest req) {
-        Recipient cust=(Recipient) aContext.getBean(&quot;Recipient&quot;);
+        Recipient cust = (Recipient) aContext.getBean(&quot;Recipient&quot;);
         RecipientDao dao = (RecipientDao) aContext.getBean(&quot;RecipientDao&quot;);
 
         cust.setCompanyID(this.getCompanyID(req));
@@ -440,47 +451,70 @@ public class RecipientAction extends StrutsActionBase {
     }
     
     /**
+     *
      * Get a list of recipients according to your filters
-     * @throws InstantiationException 
-     * @throws IllegalAccessException 
+     * @param request
+     * @param aContext
+     * @param aForm
+     * @return
+     * @throws NumberFormatException
+     * @throws IllegalAccessException
+     * @throws InstantiationException
+     * @throws ExecutionException 
+     * @throws InterruptedException 
      */
-    public List&lt;DynaBean&gt; getRecipientList(HttpServletRequest request, ApplicationContext aContext, RecipientForm aForm) throws IllegalAccessException, InstantiationException {
-    	String sqlStatement = RecipientQueryBuilder.getSQLStatement(request, aContext, aForm);
-    	JdbcTemplate aTemplate=new JdbcTemplate( (DataSource)aContext.getBean(&quot;dataSource&quot;));
-    	List&lt;Map&gt; tmpList = aTemplate.queryForList(sqlStatement);
-	     DynaProperty[] properties = new DynaProperty[] {
-	    		  new DynaProperty(&quot;customerid&quot;, Integer.class),
-	    		  new DynaProperty(&quot;gender&quot;, Integer.class),
-	    		  new DynaProperty(&quot;firstname&quot;, String.class),
-	    		  new DynaProperty(&quot;lastname&quot;, String.class),
-	    		  new DynaProperty(&quot;email&quot;,String.class)   		  
-	      };
-	     
-	      if( AgnUtils.isOracleDB()) {
-	    	  properties = new DynaProperty[] {
-		    		  new DynaProperty(&quot;customerid&quot;, BigDecimal.class),
-		    		  new DynaProperty(&quot;gender&quot;,BigDecimal.class),
-		    		  new DynaProperty(&quot;firstname&quot;, String.class),
-		    		  new DynaProperty(&quot;lastname&quot;, String.class),
-		    		  new DynaProperty(&quot;email&quot;,String.class) 
-	      };
-	      }
-	      
-	      BasicDynaClass dynaClass = new BasicDynaClass(&quot;recipient&quot;, null, properties);
-	      List&lt;DynaBean&gt; result = new ArrayList&lt;DynaBean&gt;();
-	      for(Map row:tmpList) {
-	    	  DynaBean newBean = dynaClass.newInstance();    	
-	    	  newBean.set(&quot;customerid&quot;, row.get(&quot;CUSTOMER_ID&quot;));
-	    	  newBean.set(&quot;gender&quot;, row.get(&quot;GENDER&quot;));
-	    	  newBean.set(&quot;firstname&quot;, row.get(&quot;FIRSTNAME&quot;));
-	    	  newBean.set(&quot;lastname&quot;, row.get(&quot;LASTNAME&quot;));
-	    	  newBean.set(&quot;email&quot;,row.get(&quot;EMAIL&quot;));
-	    	  result.add(newBean);
-	      }    
-	      return result;
-    	
-    	
-    }
+    
+	public Future getRecipientListFuture( HttpServletRequest request, ApplicationContext aContext, RecipientForm aForm  ) throws NumberFormatException, IllegalAccessException, InstantiationException, InterruptedException, ExecutionException {
+		
+		RecipientDao recipientDao = (RecipientDao) aContext.getBean(&quot;RecipientDao&quot;);
+		String sqlStatement = RecipientQueryBuilder.getSQLStatement(request, aContext, aForm );
+	    String sort = getSort(request, aForm);
+     	String direction = request.getParameter(&quot;dir&quot;);
+
+     	int rownums = aForm.getNumberofRows();	
+     	if( direction == null ) {
+     		direction = aForm.getOrder();     		
+     	} else {
+     		aForm.setOrder(direction);
+     	}
+     	
+     	String pageStr = request.getParameter(&quot;page&quot;);
+     	if ( pageStr == null || &quot;&quot;.equals(pageStr.trim()) ) {
+     		if ( aForm.getPage() == null || &quot;&quot;.equals(aForm.getPage().trim())) {
+     				aForm.setPage(&quot;1&quot;);
+     		} 
+     		pageStr = aForm.getPage();
+     	}
+     	else {
+     		aForm.setPage(pageStr);
+     	}
+     	
+     	if( aForm.isNumberOfRowsChanged() ) {
+     		aForm.setPage(&quot;1&quot;);
+     		aForm.setNumberOfRowsChanged(false);
+     		pageStr = &quot;1&quot;;
+     	}
+     	
+     	ExecutorService service = (ExecutorService) aContext.getBean(&quot;workerExecutorService&quot;);
+     	Future future = service.submit(new RecipientQueryWorker(recipientDao,sqlStatement, sort, direction, Integer.parseInt(pageStr), rownums, aForm.getAll() ));
+     	
+     	return future;
+     	
+	}
+    
+
+	protected String getSort(HttpServletRequest request, RecipientForm aForm) {
+		String sort = request.getParameter(&quot;sort&quot;);  
+		 if( sort == null ) {
+			 sort = aForm.getSort();			 
+		 } else {
+			 aForm.setSort(sort);
+		 }
+		return sort;
+	}
+	
+	
+	
     
     
 }</diff>
      <filename>src/java/org/agnitas/web/RecipientAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -25,6 +25,7 @@ package org.agnitas.web;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.List;
+import java.util.concurrent.Future;
 
 import javax.servlet.http.HttpServletRequest;
 
@@ -34,6 +35,7 @@ import org.agnitas.target.TargetRepresentation;
 import org.agnitas.target.impl.TargetNodeDate;
 import org.agnitas.target.impl.TargetNodeNumeric;
 import org.agnitas.target.impl.TargetNodeString;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.commons.collections.map.CaseInsensitiveMap;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMessage;
@@ -42,24 +44,25 @@ import org.apache.struts.action.ActionMapping;
 public class RecipientForm extends StrutsFormBase {
     private static final long serialVersionUID = 3876045401212665105L;
 	private int action;
-    private int recipientID=0;
+    private int recipientID = 0;
     private int gender;
     private int mailtype;
     private int user_status;
     private int listID;
-    private String title=new String(&quot;&quot;);
-    private String firstname=new String(&quot;&quot;);
-    private String lastname=new String(&quot;&quot;);
-    private String email=new String(&quot;&quot;);
-    private String user_type=new String(&quot;E&quot;);
-    private Map column=new CaseInsensitiveMap();
-    private TargetRepresentation target=null;
-    protected Map mailing=new HashMap();
+    private int all;
+    
+    private String title = new String(&quot;&quot;);
+    private String firstname = new String(&quot;&quot;);
+    private String lastname = new String(&quot;&quot;);
+    private String email = new String(&quot;&quot;);
+    private String user_type = new String(&quot;E&quot;);
+    
+    private Map column = new CaseInsensitiveMap();
+    private TargetRepresentation target =null;
+    protected Map mailing = new HashMap();
     
     private int targetID;
 
-   
-
     /**
      * Validate the properties that have been set from this HTTP request,
      * and return an &lt;code&gt;ActionErrors&lt;/code&gt; object that encapsulates any
@@ -74,85 +77,92 @@ public class RecipientForm extends StrutsFormBase {
     public ActionErrors validate(ActionMapping mapping,
     HttpServletRequest request) {
         ActionErrors errors = new ActionErrors();
-        TargetNode aNode=null;
-        int index=1;
-        String name=null;
-        String type=null;
-        String colAndType=null;
-
-        if(request.getParameter(&quot;trgt_clear&quot;)!=null) {
-            this.target=null;
+        TargetNode aNode = null;
+        int index = 1;
+        String name = null;
+        String type = null;
+        String colAndType = null;
+
+        if(request.getParameter(&quot;trgt_clear&quot;) != null) {
+            this.target = null;
             setRecipientID(0);
+            if( getCurrentFuture() == null ){ // reset filter fields only if there is no future running
+            	setUser_status(0);
+            	setUser_type(&quot;E&quot;);
+            	setTargetID(0);
+               	setListID(0);
+            }
         }
+        
         if(this.target == null) {
-            this.target=(TargetRepresentation) getWebApplicationContext().getBean(&quot;TargetRepresentation&quot;);
+            this.target = (TargetRepresentation) getWebApplicationContext().getBean(&quot;TargetRepresentation&quot;);
             if(action == RecipientAction.ACTION_VIEW
                    &amp;&amp; getRecipientID() == 0) {
-                this.column=new CaseInsensitiveMap();
-                gender=0;
-                mailtype=1;
-                user_status=0;
-                listID=0;
-                title=new String(&quot;&quot;);
-                firstname=new String(&quot;&quot;);
-                lastname=new String(&quot;&quot;);
-                email=new String(&quot;&quot;);
+                this.column = new CaseInsensitiveMap();
+                gender = 0;
+                mailtype = 1;
+                user_status = 0;
+                listID = 0;
+                title = new String(&quot;&quot;);
+                firstname = new String(&quot;&quot;);
+                lastname = new String(&quot;&quot;);
+                email = new String(&quot;&quot;);
             }
         }
-        while(index!=-1) {
-            name=new String(&quot;trgt_column&quot;+index);
-            if((colAndType=request.getParameter(name))!=null) {
-                type=colAndType.substring(colAndType.indexOf('#')+1);
-                if(index&gt;0 &amp;&amp; request.getParameter(&quot;trgt_remove&quot;+index+&quot;.x&quot;)!=null) {
+        while(index != -1) {
+            name = new String(&quot;trgt_column&quot;+index);
+            if((colAndType = request.getParameter(name))!=null) {
+                type = colAndType.substring(colAndType.indexOf('#')+1);
+                if(index&gt;0 &amp;&amp; request.getParameter(&quot;trgt_remove&quot;+index+&quot;.x&quot;) != null) {
                 	target.deleteNode(index-1);
-                } else if(index==0 &amp;&amp; request.getParameter(&quot;trgt_add.x&quot;)!=null) {
+                } else if(index == 0 &amp;&amp; request.getParameter(&quot;trgt_add.x&quot;) != null) {
                     if(type.equalsIgnoreCase(&quot;VARCHAR&quot;) || type.equalsIgnoreCase(&quot;CHAR&quot;)) {
-                        aNode=createStringNode(request, index, errors);
+                        aNode = createStringNode(request, index, errors);
                     }
                     if(type.equalsIgnoreCase(&quot;INTEGER&quot;) || type.equalsIgnoreCase(&quot;DOUBLE&quot;)) {
-                        aNode=createNumericNode(request, index, errors);
+                        aNode = createNumericNode(request, index, errors);
                     }
                     if(type.equalsIgnoreCase(&quot;DATE&quot;)) {
-                        aNode=createDateNode(request, index, errors);
+                        aNode = createDateNode(request, index, errors);
                     }
                     target.addNode(aNode);
                 }
                 index++;
-                if(index==1) {
-                    index=-1;
+                if(index == 1) {
+                    index = -1;
                 }
             } else {
-                if(index&gt;0) {
-                    index=0;
+                if(index &gt; 0) {
+                    index = 0;
                 } else {
-                    index=-1;
+                    index = -1;
                 }
             }
         }
 
-        if(request.getParameter(&quot;trgt_save.x&quot;)!=null) {
+        if(request.getParameter(&quot;trgt_save.x&quot;) != null) {
 System.err.println(&quot;In save&quot;);
 		if(!this.target.checkBracketBalance()) {
 			errors.add(&quot;brackets&quot;, new ActionMessage(&quot;error.target.bracketbalance&quot;));
 		}
         
-		List	list=this.target.getAllNodes();
+		List list = this.target.getAllNodes();
 
 		if(list == null || list.isEmpty()) {
 			errors.add(&quot;norule&quot;, new ActionMessage(&quot;error.target.norule&quot;));
 		} else {
-			for(index=1; index &lt;= list.size(); index++) {
-				name=new String(&quot;trgt_column&quot;+index);
-				if((colAndType=request.getParameter(name))!=null) {
-					type=colAndType.substring(colAndType.indexOf('#')+1);
+			for(index = 1; index &lt;= list.size(); index++) {
+				name = new String(&quot;trgt_column&quot;+index);
+				if((colAndType = request.getParameter(name)) != null) {
+					type = colAndType.substring(colAndType.indexOf('#') + 1);
 					if(type.equalsIgnoreCase(&quot;VARCHAR&quot;) || type.equalsIgnoreCase(&quot;CHAR&quot;)) {
-						aNode=createStringNode(request, index, errors);
+						aNode = createStringNode(request, index, errors);
 					}
 					if(type.equalsIgnoreCase(&quot;INTEGER&quot;) || type.equalsIgnoreCase(&quot;DOUBLE&quot;)) {
-						aNode=createNumericNode(request, index, errors);
+						aNode = createNumericNode(request, index, errors);
 					}
 					if(type.equalsIgnoreCase(&quot;DATE&quot;)) {
-						aNode=createDateNode(request, index, errors);
+						aNode = createDateNode(request, index, errors);
 					}
 					list.set(index-1, aNode);
 				}
@@ -166,7 +176,7 @@ System.err.println(&quot;In save&quot;);
      * Creates nodes (String)
      */
     TargetNode createStringNode(HttpServletRequest req, int index, ActionErrors errors) {
-        TargetNodeString aNode=(TargetNodeString) getWebApplicationContext().getBean(&quot;TargetNodeString&quot;);
+        TargetNodeString aNode = (TargetNodeString) getWebApplicationContext().getBean(&quot;TargetNodeString&quot;);
 
         aNode.setChainOperator(Integer.parseInt(req.getParameter(&quot;trgt_chainop&quot;+index)));
         aNode.setOpenBracketBefore(req.getParameter(&quot;trgt_bracketopen&quot;+index).equals(&quot;1&quot;));
@@ -183,7 +193,7 @@ System.err.println(&quot;In save&quot;);
      * Creates nodes (numeric)
      */
     TargetNode createNumericNode(HttpServletRequest req, int index, ActionErrors errors) {
-        TargetNodeNumeric aNode=(TargetNodeNumeric) getWebApplicationContext().getBean(&quot;TargetNodeNumeric&quot;);
+        TargetNodeNumeric aNode = (TargetNodeNumeric) getWebApplicationContext().getBean(&quot;TargetNodeNumeric&quot;);
 
         aNode.setChainOperator(Integer.parseInt(req.getParameter(&quot;trgt_chainop&quot;+index)));
         aNode.setOpenBracketBefore(req.getParameter(&quot;trgt_bracketopen&quot;+index).equals(&quot;1&quot;));
@@ -192,7 +202,7 @@ System.err.println(&quot;In save&quot;);
         aNode.setPrimaryOperator(Integer.parseInt(req.getParameter(&quot;trgt_operator&quot;+index)));
         aNode.setPrimaryValue(req.getParameter(&quot;trgt_value&quot;+index));
         aNode.setCloseBracketAfter(req.getParameter(&quot;trgt_bracketclose&quot;+index).equals(&quot;1&quot;));
-        if(aNode.getPrimaryOperator()==TargetNode.OPERATOR_MOD) {
+        if(aNode.getPrimaryOperator() == TargetNode.OPERATOR_MOD) {
             try {
                 aNode.setSecondaryOperator(Integer.parseInt(req.getParameter(&quot;trgt_sec_operator&quot;+index)));
             } catch (Exception e) {
@@ -204,7 +214,6 @@ System.err.println(&quot;In save&quot;);
                 aNode.setSecondaryValue(0);
             }
         }
-
         return aNode;
     }
 
@@ -532,4 +541,12 @@ System.err.println(&quot;In save&quot;);
 	public void setTargetID(int targetID) {
 		this.targetID = targetID;
 	}
+
+	public int getAll() {
+		return all;
+	}
+
+	public void setAll(int all) {
+		this.all = all;
+	}
 }</diff>
      <filename>src/java/org/agnitas/web/RecipientForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -197,9 +197,6 @@ public final class RecipientStatAction extends StrutsActionBase {
                             break;
                             
                         case BindingEntry.USER_STATUS_OPTOUT:
-                            numOptOut += rset.getInt(1);
-                            break;
-                            
                         case BindingEntry.USER_STATUS_ADMINOUT:
                             numOptOut += rset.getInt(1);
                             break;</diff>
      <filename>src/java/org/agnitas/web/RecipientStatAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -32,6 +32,7 @@ import javax.sql.DataSource;
 
 import org.agnitas.beans.Admin;
 import org.agnitas.util.AgnUtils;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.hibernate.Session;
 import org.hibernate.SessionFactory;
 import org.springframework.orm.hibernate3.HibernateTemplate;</diff>
      <filename>src/java/org/agnitas/web/StrutsActionBase.java</filename>
    </modified>
    <modified>
      <diff>@@ -35,7 +35,6 @@ import org.agnitas.dao.RecipientDao;
 import org.agnitas.target.Target;
 import org.agnitas.util.AgnUtils;
 import org.agnitas.util.SafeString;
-import org.apache.commons.beanutils.DynaBean;
 import org.apache.struts.Globals;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
@@ -46,7 +45,7 @@ import org.apache.struts.action.ActionMessages;
 /**
  * Implementation of &lt;strong&gt;Action&lt;/strong&gt; that handles Targets
  * 
- * @author Martin Helff
+ * @author Martin Helff, Nicole Serek
  */
 
 public class TargetAction extends StrutsActionBase {
@@ -58,7 +57,9 @@ public class TargetAction extends StrutsActionBase {
 	public static final int ACTION_DELETE_RECIPIENTS_CONFIRM = ACTION_LAST + 3;
 	
 	public static final int ACTION_DELETE_RECIPIENTS = ACTION_LAST + 4;
-
+	
+	public static final int ACTION_BACK_TO_MAILINGWIZARD = ACTION_LAST + 5;
+	
 	// --------------------------------------------------------- Public Methods
 
 	/**
@@ -179,6 +180,10 @@ public class TargetAction extends StrutsActionBase {
 				destination = mapping.findForward(&quot;list&quot;);
 				break;
 				
+			case ACTION_BACK_TO_MAILINGWIZARD:
+				destination = mapping.findForward(&quot;back_mailingwizard&quot;);
+				break;
+				
 			default:
 				destination = mapping.findForward(&quot;list&quot;);
 				break;</diff>
      <filename>src/java/org/agnitas/web/TargetAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -32,6 +32,7 @@ import org.agnitas.target.TargetRepresentation;
 import org.agnitas.target.impl.TargetNodeDate;
 import org.agnitas.target.impl.TargetNodeNumeric;
 import org.agnitas.target.impl.TargetNodeString;
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessage;</diff>
      <filename>src/java/org/agnitas/web/TargetForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -44,11 +44,18 @@ public class TextFileDownload extends HttpServlet {
                       throws IOException, ServletException {
 
         response.setContentType(&quot;text/plain&quot;);
-        Hashtable map = (Hashtable)(req.getSession().getAttribute(&quot;map&quot;));
-        String outfile = (String)map.get(req.getParameter(&quot;key&quot;));
-
-        response.setHeader(&quot;Content-Disposition&quot;, &quot;attachment; filename=\&quot;&quot; + req.getParameter(&quot;key&quot;) + &quot;.csv\&quot;;&quot;);
+        Hashtable map;
+        map = (Hashtable)(req.getSession().getAttribute(&quot;map&quot;));       
+      
+        String outFileName = &quot;&quot;;	// contains the Filename, build from the timestamp
+        String outFile = &quot;&quot;;		// contains the actual data.
+      	
+        outFileName = (String) req.getParameter(&quot;key&quot;);       
+        outFile = (String)map.get(req.getParameter(&quot;key&quot;));	// get the key from the Hashmap.
+
+        // build filepath (timestamp + .csv) and return it.
+        response.setHeader(&quot;Content-Disposition&quot;, &quot;attachment; filename=\&quot;&quot; + outFileName + &quot;.csv\&quot;;&quot;);
         ServletOutputStream ostream = response.getOutputStream();
-        ostream.print(outfile);
+        ostream.print(outFile);
     }
 }</diff>
      <filename>src/java/org/agnitas/web/TextFileDownload.java</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,7 @@ import java.util.Collection;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionMapping;
 </diff>
      <filename>src/java/org/agnitas/web/TrackableLinkForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -25,6 +25,7 @@ package org.agnitas.web;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.agnitas.web.forms.StrutsFormBase;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionMapping;</diff>
      <filename>src/java/org/agnitas/web/UserFormEditForm.java</filename>
    </modified>
    <modified>
      <diff>@@ -97,8 +97,14 @@ public class rdir extends HttpServlet {
                 return;
             }
 
-            // send redirect 
-            res.sendRedirect(fullUrl);
+            if(AgnUtils.getDefaultValue(&quot;redirection.status&quot;) == null || AgnUtils.getDefaultIntValue(&quot;redirection.status&quot;) == 302) {
+            	res.sendRedirect(fullUrl);
+                //res.sendRedirect(aLink.getFullUrl());
+            } else {
+            	res.setStatus(AgnUtils.getDefaultIntValue(&quot;redirection.status&quot;));
+            	res.setHeader(&quot;Location&quot;, fullUrl);
+            	res.flushBuffer();
+            }
 
             // log click in db
             if(aLink.logClickInDB((int)uid.getCustomerID(), req.getRemoteAddr(), con)==false) {</diff>
      <filename>src/java/org/agnitas/web/rdir.java</filename>
    </modified>
    <modified>
      <diff>@@ -36,6 +36,7 @@ import org.agnitas.beans.*;
 import org.agnitas.dao.*;
 import org.agnitas.util.*;
 import org.apache.axis.MessageContext;
+import org.apache.commons.collections.map.CaseInsensitiveMap;
 import org.hibernate.*;
 import org.springframework.context.ApplicationContext;
 import org.springframework.orm.hibernate3.*;
@@ -407,7 +408,7 @@ public class EmmWebservice extends WebServiceBase implements EmmWebService_Port
      */
     public int addSubscriber(java.lang.String username, java.lang.String password, boolean doubleCheck, java.lang.String keyColumn, boolean overwrite, StringArrayType paramNames, StringArrayType paramValues) {
         ApplicationContext con = getWebApplicationContext();
-        Hashtable allParams = new Hashtable();
+        CaseInsensitiveMap allParams=new CaseInsensitiveMap();
         int returnValue = 0;
         int tmpCustID = 0;
         MessageContext msct = MessageContext.getCurrentContext();
@@ -512,12 +513,14 @@ public class EmmWebservice extends WebServiceBase implements EmmWebService_Port
      * @return CustomerID of the first matching record
      */
     public int findSubscriber(java.lang.String username, java.lang.String password, java.lang.String keyColumn, java.lang.String value) {
-        ApplicationContext con = getWebApplicationContext();
+    	System.out.println(&quot;soap prob find subscriber:...&quot;);
+    	ApplicationContext con = getWebApplicationContext();
         int returnValue = 0;
         MessageContext msct = MessageContext.getCurrentContext();
         
         if(!authenticateUser(msct, username, password, 1)) {
-            return returnValue;
+        	System.out.println(&quot;soap prob find subscriber: wrong credentials &quot; +username + &quot; &quot; +password);
+        	return returnValue;
         }
         
         try {
@@ -529,8 +532,7 @@ public class EmmWebservice extends WebServiceBase implements EmmWebService_Port
             System.out.println(&quot;soap prob find subscriber: &quot;+e);
             returnValue = 0;
         }
-        
-        
+               
         return returnValue;
     }
     </diff>
      <filename>src/java/org/agnitas/webservice/EmmWebservice.java</filename>
    </modified>
    <modified>
      <diff>@@ -254,39 +254,9 @@
     &lt;bean id=&quot;SendMailing&quot; class=&quot;org.agnitas.actions.ops.SendMailing&quot; singleton=&quot;false&quot;/&gt;
 
     &lt;!-- Scheduler for Date-Based Mailings --&gt;
-    &lt;bean id=&quot;Ruler&quot; class=&quot;org.agnitas.backend.RulerImpl&quot;&gt;
+   
+   
+    &lt;bean id=&quot;workerExecutorService&quot; class=&quot;java.util.concurrent.ScheduledThreadPoolExecutor&quot; &gt;
+    	&lt;constructor-arg  value=&quot;10&quot; type=&quot;int&quot;/&gt;
     &lt;/bean&gt;
-
-    &lt;bean id=&quot;dateBasedMailingsJob&quot; class=&quot;org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean&quot;&gt;
-        &lt;property name=&quot;targetObject&quot; ref=&quot;Ruler&quot;/&gt;
-        &lt;property name=&quot;targetMethod&quot; value=&quot;kickOffSimple&quot;/&gt;
-        &lt;property name=&quot;concurrent&quot; value=&quot;false&quot;/&gt;
-    &lt;/bean&gt;
-
-    &lt;bean id=&quot;delayedMailingsJob&quot; class=&quot;org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean&quot;&gt;
-        &lt;property name=&quot;targetObject&quot; ref=&quot;Ruler&quot;/&gt;
-        &lt;property name=&quot;targetMethod&quot; value=&quot;kickOffDelayed&quot;/&gt;
-        &lt;property name=&quot;concurrent&quot; value=&quot;false&quot;/&gt;
-    &lt;/bean&gt;
-
-
-    &lt;bean id=&quot;dateBasedMailingsCronTrigger&quot; class=&quot;org.springframework.scheduling.quartz.CronTriggerBean&quot;&gt;
-        &lt;property name=&quot;jobDetail&quot; ref=&quot;dateBasedMailingsJob&quot;/&gt;
-        &lt;property name=&quot;cronExpression&quot; value=&quot;${dateBasedMailings.cronExpression}&quot;/&gt;
-    &lt;/bean&gt;
-
-    &lt;bean id=&quot;delayedMailingsCronTrigger&quot; class=&quot;org.springframework.scheduling.quartz.CronTriggerBean&quot;&gt;
-        &lt;property name=&quot;jobDetail&quot; ref=&quot;delayedMailingsJob&quot;/&gt;
-        &lt;property name=&quot;cronExpression&quot; value=&quot;${delayedMailings.cronExpression}&quot;/&gt;
-    &lt;/bean&gt;
-
-    &lt;bean class=&quot;org.springframework.scheduling.quartz.SchedulerFactoryBean&quot;&gt;
-        &lt;property name=&quot;triggers&quot;&gt;
-            &lt;list&gt;
-                &lt;ref bean=&quot;dateBasedMailingsCronTrigger&quot;/&gt;
-                &lt;ref bean=&quot;delayedMailingsCronTrigger&quot;/&gt;
-            &lt;/list&gt;
-        &lt;/property&gt;
-    &lt;/bean&gt;
-
 &lt;/beans&gt;</diff>
      <filename>src/jsp/WEB-INF/applicationContext.xml</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ paging.banner.placement=bottom
 export.types=csv excel xml pdf 
 export.decorated=false
 paging.banner.placement=both
+paging.banner.onepage=&lt;span class=&quot;pagelinks&quot;&gt;&amp;nbsp;&lt;/span&gt;
 paging.banner.full=&lt;div class=&quot;pagelinks&quot; align=&quot;center&quot;&gt;&lt;a href={1}&gt;&lt;img src=&quot;images/displaytag/first.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href={2}&gt;&lt;img src=&quot;images/displaytag/prev.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;{0}&lt;a href={3}&gt;&lt;img src=&quot;images/displaytag/next.gif&quot;  border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href={4}&gt;&lt;img src=&quot;images/displaytag/last.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/div&gt;
 paging.banner.first=&lt;div class=&quot;pagelinks&quot; align=&quot;center&quot;&gt;&lt;a href={1}&gt;&lt;img src=&quot;images/displaytag/first.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href={2}&gt;&lt;img src=&quot;images/displaytag/prev.gif&quot;border=&quot;0&quot;&gt;&lt;/a&gt; {0} &lt;a href={3}&gt;&lt;img src=&quot;images/displaytag/next.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href={4}&gt;&lt;img src=&quot;images/displaytag/last.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/div&gt;
 paging.banner.last=&lt;div class=&quot;pagelinks&quot; align=&quot;center&quot;&gt;&lt;a href={1}&gt;&lt;img src=&quot;images/displaytag/first.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href={2}&gt;&lt;img src=&quot;images/displaytag/prev.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt; {0} &lt;a href={3}&gt;&lt;img src=&quot;images/displaytag/next.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href={4}&gt;&lt;img src=&quot;images/displaytag/last.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;/div&gt;
\ No newline at end of file</diff>
      <filename>src/jsp/WEB-INF/conf/displaytag.properties</filename>
    </modified>
    <modified>
      <diff>@@ -66,6 +66,10 @@ dateBasedMailings.cronExpression=0 0 * * * ?
 archive.maxCache=200
 archive.maxCacheTimeMillis=300000
 
+bounce.maxRemain=90
+
+deleteBounce.cronExpression=0 0 4 * * ?
+
 ################################################################################
 # LOG4J settings
 ################################################################################
@@ -128,4 +132,4 @@ mailgun.ini.xmlvalidate=False
 mailgun.ini.domain=openemm.invalid
 mailgun.ini.mail_log_number=400
 mailgun.ini.eol=LF
-mailgun.ini.mailer=OpenEMM V5.5.0
+mailgun.ini.mailer=OpenEMM V5.5.1</diff>
      <filename>src/jsp/WEB-INF/conf/emm.properties.default</filename>
    </modified>
    <modified>
      <diff>@@ -139,6 +139,7 @@ IPStats=IP statistics
 Import=Import
 ImportWizStep_1_of_7=Step 1 of 7
 ImportWizStep_2_of_7=Step 2 of 7
+ImportWizStep_3_fields_of_7=Step 3 of 7 fields are missing
 ImportWizStep_3_of_7=Step 3 of 7
 ImportWizStep_4_of_7=Step 4 of 7
 ImportWizStep_5_of_7=Step 5 of 7
@@ -563,11 +564,12 @@ error.import.exception=Error during import.
 error.import.maxCount=The maximum number of records was reached.
 error.import.no_file=The file was empty or not found!
 error.import.no_gender_mapping=No mapping to required column &quot;GENDER&quot;!
+error.import.no_gender_mapping.solution=&quot;GENDER&quot; will be set to 'unkown'
 error.import.no_keycolumn_mapping=No mapping to key column!
 error.import.no_mailinglist=Please choose a mailinglist.
 error.import.no_mailtype_mapping=No mapping to required column &quot;MAILTYPE&quot;!
 error.import.sql_failed=Could not update data.&lt;br&gt;Error: 
-error.import.too_many_records=Too many records for import, maximum 60000!
+error.import.too_many_records=Too many records for import, maximum {0}!
 error.invalid.email=E-Mail address is not valid&lt;br&gt;
 error.login=Wrong username/password&lt;br&gt;
 error.mailing.hosted_image_filename=Filename invalid: Please use only characters 'a' through 'z', 'A' through 'Z', '0' through '9', and &quot;.&quot;, &quot;-&quot;, &quot;*&quot;, &quot;_&quot;!&lt;br&gt;
@@ -702,9 +704,11 @@ import.update_status=Updating mailing list informations
 insecure=insecure
 iso-8859-1=ISO 8859-1
 iso-8859-15=ISO 8859-15
+loading=loading...
+loading.stopped=loading ... stopped
 logon.login=Login
 logon.password=Password
-logon.title=AGNITAS OpenEMM 5.5.0
+logon.title=AGNITAS OpenEMM 5.5.1
 logon.username=Username
 mailing.activate_event_explain=Your mailing is now ready for sending.&lt;br&gt;You may test it with the following&lt;br&gt;two links or activate it.
 mailing.activate_rule_explain=Your mailing is now ready for sending.&lt;br&gt;You may test it with the following&lt;br&gt;two links or activate it to start daily delivery &lt;br&gt;of the mailing to the selected target group.
@@ -741,6 +745,10 @@ password=Password
 process=Process
 profile.hint=0 for numeric fields means default length of 32 bit - not changeable
 recipient.confirm_delete=Do you really want to delete this recipient?
+recipient.mailingtype=recipients  mailing type
+recipient.mailingtype.html=html
+recipient.mailingtype.htmloffline=offline-html
+recipient.mailingtype.text=Text
 recipient.search=Search for recipient
 report.single_mailing=Single Mailing
 secure=secure</diff>
      <filename>src/jsp/WEB-INF/conf/messages.properties</filename>
    </modified>
    <modified>
      <diff>@@ -139,6 +139,7 @@ IPStats=IP-Statistik
 Import=Import
 ImportWizStep_1_of_7=Schritt 1 von 7
 ImportWizStep_2_of_7=Schritt 2 von 7
+ImportWizStep_3_fields_of_7=Schritt 3 von 7 fehlende Felder
 ImportWizStep_3_of_7=Schritt 3 von 7
 ImportWizStep_4_of_7=Schritt 4 von 7
 ImportWizStep_5_of_7=Schritt 5 von 7
@@ -563,11 +564,12 @@ error.import.exception=Fehler beim Import.
 error.import.maxCount=Die maximale Anzahl erlaubter Datens\u00E4tze wurde erreicht.
 error.import.no_file=Die Datei ist leer oder wurde nicht gefunden!
 error.import.no_gender_mapping=Systemspalte &quot;GENDER&quot; nicht zugewiesen!
+error.import.no_gender_mapping.solution=&quot;GENDER&quot; wird auf 'unbekannt' gesetzt
 error.import.no_keycolumn_mapping=Schl\u00FCsselspalte nicht zugewiesen!
 error.import.no_mailinglist=Bitte w\u00E4hlen Sie die  Mailingliste aus.
 error.import.no_mailtype_mapping=Systemspalte &quot;MAILTYPE&quot; nicht zugewiesen!
 error.import.sql_failed=Daten konnten nicht aktualisiert werden.&lt;br&gt;Fehler: 
-error.import.too_many_records=Zuviele Empf\u00E4nger zum importieren, maximal 60000!
+error.import.too_many_records=Zuviele Empf\u00E4nger zum importieren, maximal {0}!
 error.invalid.email=E-Mail-Adresse ist ung\u00FCltig&lt;br&gt;
 error.login=Falscher Benutzername/Passwort&lt;br&gt;
 error.mailing.hosted_image_filename=Dateiname ung\u00FCltig: Bitte verwenden Sie nur die Zeichen 'a' bis 'z', 'A' bis 'Z', '0' bis '9', und &quot;.&quot;, &quot;-&quot;, &quot;*&quot;, &quot;_&quot;!&lt;br&gt;
@@ -702,9 +704,11 @@ import.update_status=Aktualisiere Mailinglisten
 insecure=Unsicher
 iso-8859-1=ISO 8859-1
 iso-8859-15=ISO 8859-15
+loading=Seite wird geladen...
+loading.stopped=Laden der Seite wurde abgebrochen
 logon.login=Anmelden
 logon.password=Passwort
-logon.title=AGNITAS OpenEMM 5.5.0
+logon.title=AGNITAS OpenEMM 5.5.1
 logon.username=Benutzer-Name
 mailing.activate_event_explain=Ihr Mailing ist bereit zum Versand.&lt;br&gt;Sie k\u00F6nnen das Mailing nun mit dem beiden&lt;br&gt;folgenden Links testen oder das Mailing aktivieren.
 mailing.activate_rule_explain=Ihr Mailing ist bereit zum Versand.&lt;br&gt;Sie k\u00F6nnen das Mailing nun mit dem beiden&lt;br&gt;folgenden Links testen oder das Mailing aktivieren&lt;br&gt;um den t\u00E4glichen Versand an die eingestellte Zielgruppe zu starten.
@@ -741,6 +745,10 @@ password=Passwort
 process=Einlesen
 profile.hint=0 f\u00FCr numerische Felder bedeutet die Standardl\u00E4nge von 32 Bit - nicht \u00E4nderbar
 recipient.confirm_delete=Wollen Sie diesen Empf\u00E4nger wirklich l\u00F6schen?
+recipient.mailingtype=Mail-Typ des Empf\u00E4ngers
+recipient.mailingtype.html=Html
+recipient.mailingtype.htmloffline=Offline-Html
+recipient.mailingtype.text=Text
 recipient.search=Empf\u00E4nger suchen
 report.single_mailing=Mailing-Statistik
 secure=Sicher</diff>
      <filename>src/jsp/WEB-INF/conf/messages_de.properties</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,7 @@ Change=Change
 Characters=Characters
 Charset=Charset
 Charsets=Charsets
-ChooseTemplateMsg=You can choose a predefined mailing template&lt;br&gt;for your mailing\:
+ChooseTemplateMsg=You can choose a predefined mailing template&lt;br&gt;for your mailing:
 ChooseThenPressSave=Please choose your settings and confirm&lt;br&gt;by pressing the &quot;Save&quot; button
 ClickFinishMsg=Please click the &quot;Finish&quot; button&lt;br&gt;to exit to the mailing page
 Clicks=Clicks
@@ -139,6 +139,7 @@ IPStats=IP statistics
 Import=Import
 ImportWizStep_1_of_7=Step 1 of 7
 ImportWizStep_2_of_7=Step 2 of 7
+ImportWizStep_3_fields_of_7=Step 3 of 7 missing fields
 ImportWizStep_3_of_7=Step 3 of 7
 ImportWizStep_4_of_7=Step 4 of 7
 ImportWizStep_5_of_7=Step 5 of 7
@@ -168,7 +169,7 @@ MWizardStep_7_of_11=Step 7 of 11
 MWizardStep_8_of_11=Step 8 of 11
 MWizardStep_9_of_11=Step 9 of 11
 MailStat=Mailing statistics
-MailTypeMessage=Please choose a format for the mailing\:
+MailTypeMessage=Please choose a format for the mailing:
 Mailing=Mailing
 MailingActivate=Activate mailing
 MailingDeactivate=Deactivate mailing
@@ -217,7 +218,7 @@ Mime_Type=MIME type
 MissShort=Miss
 MissesShort=Mrs.
 MisterShort=Mr.
-MlistTargetMsg=Please choose a mailinglist, the target group(s) and&lt;br&gt;optionally a campaign for your mailing\:
+MlistTargetMsg=Please choose a mailinglist, the target group(s) and&lt;br&gt;optionally a campaign for your mailing:
 Mode=Mode
 MonthlyStat=Monthly overview
 More_Profile_Data=More profile data
@@ -278,7 +279,7 @@ PleaseEnterShortnameMsg=Please enter a name and a short description (optional)&lt;b
 Portugues=Portuguese
 Preview=Preview
 Proceed=Proceed
-ProfileFieldErrorMsg=Profile field cannot be deleted because there are target groups depending from it. The target groups affected are\:
+ProfileFieldErrorMsg=Profile field cannot be deleted because there are target groups depending from it. The target groups affected are:
 Profile_DB=Edit profile fields
 Profile_Database=Profile database
 RdirLinkDecode=Decode link
@@ -561,37 +562,38 @@ error.import.charset=Could not convert file to selected charset!&lt;br&gt;
 error.import.column=Import error.&lt;br&gt;One column could not be imported twice.
 error.import.exception=Error during import.
 error.import.maxCount=The maximum number of records was reached.
-error.import.no_file=The file was empty or not found\!
-error.import.no_gender_mapping=No mapping to required column &quot;GENDER&quot;\!
-error.import.no_keycolumn_mapping=No mapping to key column\!
+error.import.no_file=The file was empty or not found!
+error.import.no_gender_mapping=No mapping to required column &quot;GENDER&quot;!
+error.import.no_gender_mapping.solution=&quot;GENDER&quot; will be set to 'unkown'.
+error.import.no_keycolumn_mapping=No mapping to key column!
 error.import.no_mailinglist=Please choose a mailinglist.
-error.import.no_mailtype_mapping=No mapping to required column &quot;MAILTYPE&quot;\!
+error.import.no_mailtype_mapping=No mapping to required column &quot;MAILTYPE&quot;!
 error.import.sql_failed=Could not update data.&lt;br&gt;Error: 
-error.import.too_many_records=Too many records for import, maximum 60000\!
+error.import.too_many_records=Too many records for import, maximum {0}!
 error.invalid.email=Email address is not valid&lt;br&gt;
 error.login=Wrong username/password&lt;br&gt;
-error.mailing.hosted_image_filename=Filename invalid\: Please use only characters 'a' through 'z', 'A' through 'Z', '0' through '9', and &quot;.&quot;, &quot;-&quot;, &quot;*&quot;, &quot;_&quot;\!&lt;br&gt;
+error.mailing.hosted_image_filename=Filename invalid: Please use only characters 'a' through 'z', 'A' through 'Z', '0' through '9', and &quot;.&quot;, &quot;-&quot;, &quot;*&quot;, &quot;_&quot;!&lt;br&gt;
 error.mailing.noMailinglist=No mailinglist existent. Please create a mailinglist first!
-error.mailing.no_html_template=Error\: No HTML-template present&lt;br&gt;
-error.mailing.no_html_version=Error\: No HTML-version available\!&lt;br&gt;
-error.mailing.no_subscribers=Number of recipients is zero\!&lt;br&gt;
-error.mailing.no_text_template=Error\: No Text-template present
-error.mailing.no_text_version=Error\: No Plain-text-version available\!&lt;br&gt;
-error.mailing.rulebased_without_target=You have to choose a target-group\!&lt;br&gt;
+error.mailing.no_html_template=Error: No HTML-template present&lt;br&gt;
+error.mailing.no_html_version=Error: No HTML-version available!&lt;br&gt;
+error.mailing.no_subscribers=Number of recipients is zero!&lt;br&gt;
+error.mailing.no_text_template=Error: No Text-template present
+error.mailing.no_text_version=Error: No Plain-text-version available!&lt;br&gt;
+error.mailing.rulebased_without_target=You have to choose a target-group!&lt;br&gt;
 error.mailing.sender_adress=Error in sender address!&lt;br&gt;
 error.mailing.subject.too_short=Subject line is too short!&lt;br&gt;
 error.mailinglist.cannot_delete=You can't delete this mailinglist!&lt;br&gt;There are mailings or templates depending from it.&lt;br&gt;Please alter mailings or templates first.
 error.nameToShort=Name is too short&lt;br&gt;
-error.old_password_required=Please enter your old password\!
+error.old_password_required=Please enter your old password!
 error.password.mismatch=Passwords don't match!&lt;br&gt;
 error.password.required=Please enter your password!&lt;br&gt;
 error.password.tooShort=Password too short!&lt;br&gt;
-error.password_must_differ=The new password must differ from the old one\!
+error.password_must_differ=The new password must differ from the old one!
 error.permissionDenied=You don't have the required permissions for this action.
 error.personalization_tag=Error in personalization tag, please check!&lt;br&gt;
 error.personalization_tag_parameter=Error in personalization tag parameter, please check!&lt;br&gt;
 error.profiledb.exists=This field already exists.
-error.profiledb.fieldname=Fieldname in db invalid. Please use  only characters 'A' through 'Z', '0' through '9', and &quot;.&quot;, &quot;-&quot;, &quot;*&quot;, &quot;_&quot;\!&lt;br&gt;
+error.profiledb.fieldname=Fieldname in db invalid. Please use  only characters 'A' through 'Z', '0' through '9', and &quot;.&quot;, &quot;-&quot;, &quot;*&quot;, &quot;_&quot;!&lt;br&gt;
 error.profiledb.fieldname_too_short=Fieldname in db should be at least 3 characters long.
 error.profiledb.insert_in_db_error=The field could not be created. Please check the values you entered.
 error.profiledb.shortname_too_short=Fieldname should be at least 3 characters long.
@@ -600,7 +602,7 @@ error.sender_fullname_too_long=Sender fullname must not be longer than 50 charac
 error.subscriber.insert_in_db_error=An error occured while saving the recipient.
 error.target.bracketbalance=Brackets are not balanced, please check!&lt;br&gt;
 error.target.norule=No rule defined, please define at least on rule for target-selection&lt;br&gt;
-error.template.dyntags=Error in dyn tags\!&lt;br&gt;
+error.template.dyntags=Error in dyn tags!&lt;br&gt;
 error.username.required=Please enter your username!&lt;br&gt;
 errors.footer=&lt;/font&gt;
 errors.header=&lt;font color=&quot;red&quot;&gt;
@@ -702,9 +704,11 @@ import.update_status=Updating mailing list informations
 insecure=insecure
 iso-8859-1=ISO 8859-1
 iso-8859-15=ISO 8859-15
+loading=loading...
+loading.stopped=loading ... stopped
 logon.login=Login
 logon.password=Password
-logon.title=AGNITAS OpenEMM 5.5.0
+logon.title=AGNITAS OpenEMM 5.5.1
 logon.username=Username
 mailing.activate_event_explain=Your mailing is now ready for sending.&lt;br&gt;You may test it with the following&lt;br&gt;two links or activate it.
 mailing.activate_rule_explain=Your mailing is now ready for sending.&lt;br&gt;You may test it with the following&lt;br&gt;two links or activate it to start daily delivery &lt;br&gt;of the mailing to the selected target group.
@@ -741,6 +745,10 @@ password=Password
 process=Process
 profile.hint=0 for numeric fields means default length of 32 bit - not changeable
 recipient.confirm_delete=Do you really want to delete this recipient?
+recipient.mailingtype=recipients  mailing type
+recipient.mailingtype.html=html
+recipient.mailingtype.htmloffline=offline-html
+recipient.mailingtype.text=Text
 recipient.search=Search for recipient
 report.single_mailing=Single mailing
 secure=secure</diff>
      <filename>src/jsp/WEB-INF/conf/messages_en.properties</filename>
    </modified>
    <modified>
      <diff>@@ -139,6 +139,7 @@ IPStats=Estad\u00EDsticas IP
 Import=Importar
 ImportWizStep_1_of_7=Etapa 1 de 7
 ImportWizStep_2_of_7=Etapa 2 de 7
+ImportWizStep_3_fields_of_7=Etapa 3 de 7
 ImportWizStep_3_of_7=Etapa 3 de 7
 ImportWizStep_4_of_7=Etapa 4 de 7
 ImportWizStep_5_of_7=Etapa 5 de 7
@@ -263,6 +264,7 @@ OK=OK
 OfflineHTML=Offline HTML
 Only_HTML_Version=S\u00F3lo versi\u00F3n HTML
 Only_Text_Version=S\u00F3lo versi\u00F3n texto
+OpenTime=Open rate over time
 Opened_Mails=E-mails abertos
 OptOutAdmin=Out-Out por administrador
 OptOutUser=Opt-Out por destinatario
@@ -557,13 +559,16 @@ error.export.file_not_ready=Ning\u00FAn archivo disponible para descargar!
 error.export.no_columns_selected=Seleccione por los menos una columna base para la exportaci\u00F3n!
 error.import.charset=No fue posible convertir el archivo para los caracteres seleccionados! &lt;br&gt;
 error.import.column=Error al importar. &lt;br&gt; Una coluna no puede ser importada dos vezes.
+error.import.exception=Error during import.
+error.import.maxCount=The maximum number of records was reached.
 error.import.no_file=El archivo est\u00E1 vacio o no fue encontrado !
 error.import.no_gender_mapping=En el mapeo es exigido la columna &quot;G\u00C9NERO/GENDER&quot; !
+error.import.no_gender_mapping.solution=&quot;GENDER&quot; will be set to 'unkown'
 error.import.no_keycolumn_mapping=Mapeo para la columna clave !
 error.import.no_mailinglist=Escoja una lista.
 error.import.no_mailtype_mapping=Columna &quot;TIPO DE E-MAIL/MAILTYPE&quot; exigida para el mapeo !
 error.import.sql_failed=No foi posible actualizar los datos. &lt;br&gt; Error:
-error.import.too_many_records=Muchos registros para la importaci\u00F3n, m\u00E1ximo 60000!
+error.import.too_many_records=Muchos registros para la importaci\u00F3n, m\u00E1ximo {0}!
 error.invalid.email=Direcci\u00F3n de e-mail inv\u00E1lido&lt;br&gt;
 error.login=Nombre de usuario o password inv\u00E1lido&lt;br&gt;
 error.mailing.hosted_image_filename=Archivo inv\u00E1lido: Por favor, use s\u00F3lo los siguientes caracteres 'a' - 'z', 'A' - 'Z', '0' - '9', y &quot;.&quot;, &quot;-&quot;, &quot;*&quot;, &quot;_&quot;!&lt;br&gt;
@@ -698,9 +703,11 @@ import.update_status=Atualizando informaciones de la lista de e-mails
 insecure=Inseguro
 iso-8859-1=ISO 8859-1
 iso-8859-15=ISO 8859-15
+loading=loading...
+loading.stopped=loading ... stopped
 logon.login=Login
 logon.password=Clave
-logon.title=AGNITAS OpenEMM 5.5.0
+logon.title=AGNITAS OpenEMM 5.5.1
 logon.username=Nombre de Usuario
 mailing.activate_event_explain=Sus e-mails ahora est\u00E1n listos para ser enviados. &lt;br&gt; Usted puede  testarlo con los siguientes &lt;br&gt; dos links.
 mailing.activate_rule_explain=Sus e-mails ahora est\u00E1n listos para ser enviados. &lt;br&gt; Usted pode test\u00E1-lo con los siguientes &lt;br&gt; dos links o activarlos para iniciar la distribuici\u00F3n diaria &lt;br&gt; del mailing seleccionado para el grupo-seleccionado.
@@ -737,6 +744,10 @@ password=Password
 process=Procesar
 profile.hint=0 para la longitud a voluntad
 recipient.confirm_delete=Usted realmente desea excluir este destinatario?
+recipient.mailingtype=recipients  mailing type
+recipient.mailingtype.html=html
+recipient.mailingtype.htmloffline=offline-html
+recipient.mailingtype.text=Text
 recipient.search=Buscar destinatario
 report.single_mailing=Single Mailing
 secure=Seguro</diff>
      <filename>src/jsp/WEB-INF/conf/messages_es.properties</filename>
    </modified>
    <modified>
      <diff>@@ -138,6 +138,7 @@ IPStats=Statistiques IP
 Import=Import
 ImportWizStep_1_of_7=Etape 1 de 7
 ImportWizStep_2_of_7=Etape 2 de 7
+ImportWizStep_3_fields_of_7=Etape 3 de 7
 ImportWizStep_3_of_7=Etape 3 de 7
 ImportWizStep_4_of_7=Etape 4 de 7
 ImportWizStep_5_of_7=Etape 5 de 7
@@ -262,6 +263,7 @@ OK=OK
 OfflineHTML=HTML hors connexion
 Only_HTML_Version=version HTML seulement
 Only_Text_Version=version texte seulement
+OpenTime=Open rate over time
 Opened_Mails=Mails ouverts
 OptOutAdmin=D\u00E9sabonn\u00E9 par l'administrateur
 OptOutUser=D\u00E9sabonn\u00E9 par l'abonn\u00E9
@@ -557,13 +559,16 @@ error.export.file_not_ready=Aucun fichier disponible pour le t\u00E9l\u00E9charg
 error.export.no_columns_selected=S\u00E9lectionnez au moins une colonne de la base de donn\u00E9e pour l'export
 error.import.charset=le ficheir ne peux pas etre converti dans ce charset&lt;br&gt;
 error.import.column=Import error.&lt;br&gt;One column could not be imported twice.
+error.import.exception=Error during import.
+error.import.maxCount=The maximum number of records was reached.
 error.import.no_file=Le fichier \u00E9tait vide ou n'a pas \u00E9t\u00E9 trouv\u00E9!
 error.import.no_gender_mapping=Aucune correspondance pour la colonne obligatoire &quot;SEXE&quot;!
+error.import.no_gender_mapping.solution=&quot;GENDER&quot; will be set to 'unkown'
 error.import.no_keycolumn_mapping=Aucune correspondance pour la colonne primaire!
 error.import.no_mailinglist=Choissisez une liste de diffusion.
 error.import.no_mailtype_mapping=Aucune correspondance pour la colonne obligatoire &quot;MAILTYPE&quot;!
 error.import.sql_failed=N' actualiser par les donn\u00E9es.&lt;br&gt;Erreur:
-error.import.too_many_records=Trop de lignes \u00E0 importer, maximum 60000!
+error.import.too_many_records=Trop de lignes \u00E0 importer, maximum {0}!
 error.invalid.email=l'adresse email n'est pas valide&lt;br&gt;
 error.login=Erreur dans l'utisateur / mot de passe&lt;br&gt;
 error.mailing.hosted_image_filename=Nom de fichier invalide: Utilisez seulement les caract\u00E8res 'a' \u00E0 'z', 'A' \u00E0 'Z', '0' \u00E0 '9', et &quot;.&quot;, &quot;-&quot;, &quot;*&quot;, &quot;_&quot;!&lt;br&gt;
@@ -697,9 +702,11 @@ import.update_status=Information de la liste de diffusion mise \u00E0 jour
 insecure=insecure
 iso-8859-1=ISO 8859-1
 iso-8859-15=ISO 8859-15
+loading=loading...
+loading.stopped=loading ... stopped
 logon.login=Connexion
 logon.password=Mot de passe
-logon.title=AGNITAS OpenEMM 5.5.0
+logon.title=AGNITAS OpenEMM 5.5.1
 logon.username=Nom utilisateur
 mailing.activate_event_explain=Votre mailing est pret \u00E0 \u00E9tre envoy\u00E9.&lt;br&gt;vous pouvez le tester avec les liens suivants&lt;br&gt;ou bien l'activer.
 mailing.activate_rule_explain=Votre mailing est pret \u00E0 \u00E9tre envoy\u00E9.&lt;br&gt;vous pouvez le tester avec les liens suivants&lt;br&gt;ou bien l'activer quotidiennement &lt;br&gt;pour le sous groupe dynamique.
@@ -736,6 +743,10 @@ password=Mot de passe
 process=En cours
 profile.hint=0 pour long au choix
 recipient.confirm_delete=Voulez vous vraiment supprimer ce abonn\u00E9?
+recipient.mailingtype=recipients  mailing type
+recipient.mailingtype.html=html
+recipient.mailingtype.htmloffline=offline-html
+recipient.mailingtype.text=Text
 recipient.search=Rechercher le abonn\u00E9
 report.single_mailing=Mailing seul
 secure=secure</diff>
      <filename>src/jsp/WEB-INF/conf/messages_fr.properties</filename>
    </modified>
    <modified>
      <diff>@@ -139,6 +139,7 @@ IPStats=Estat\u00EDsticas IP
 Import=Importar
 ImportWizStep_1_of_7=Etapa 1 de 7
 ImportWizStep_2_of_7=Etapa 2 de 7
+ImportWizStep_3_fields_of_7=Etapa 3 de 7
 ImportWizStep_3_of_7=Etapa 3 de 7
 ImportWizStep_4_of_7=Etapa 4 de 7
 ImportWizStep_5_of_7=Etapa 5 de 7
@@ -263,6 +264,7 @@ OK=OK
 OfflineHTML=Offline HTML
 Only_HTML_Version=S\u00F3 vers\u00E3o HTML
 Only_Text_Version=S\u00F3 vers\u00E3o texto
+OpenTime=Open rate over time
 Opened_Mails=E-mails abertos
 OptOutAdmin=Out-Out por administrador
 OptOutUser=Opt-Out por destinat\u00E1rio
@@ -557,13 +559,16 @@ error.export.file_not_ready=Nenhum arquivo dispon\u00EDvel para download!
 error.export.no_columns_selected=Selecione pelo menos uma coluna base para exporta\u00E7\u00E3o!
 error.import.charset=N\u00E3o foi poss\u00EDvel converter arquivo para os caracteres seleccionados! &lt;br&gt;
 error.import.column=Erro ao importar. &lt;br&gt; Uma coluna n\u00E3o poderia ser importada duas vezes.
+error.import.exception=Error during import.
+error.import.maxCount=The maximum number of records was reached.
 error.import.no_file=O arquivo esta vazio ou n\u00E3o foi encontrado !
 error.import.no_gender_mapping=No mapeamento \u00E9 exigido a coluna &quot;GENDER&quot; !
+error.import.no_gender_mapping.solution=&quot;GENDER&quot; will be set to 'unkown'
 error.import.no_keycolumn_mapping=Mapeamento para a coluna chave !
 error.import.no_mailinglist=Escolha uma lista.
 error.import.no_mailtype_mapping=Coluna &quot;MAILTYPE&quot; exigida para mapeamento !
 error.import.sql_failed=N\u00E3o foi poss\u00EDvel atualizar os dados. &lt;br&gt; Erro:
-error.import.too_many_records=Muitos registros para importa\u00E7\u00E3o, m\u00E1ximo 60000!
+error.import.too_many_records=Muitos registros para importa\u00E7\u00E3o, m\u00E1ximo {0}!
 error.invalid.email=Endere\u00E7o de e-mail inv\u00E1lido&lt;br&gt;
 error.login=Nome de usu\u00E1rio ou password inv\u00E1lido&lt;br&gt;
 error.mailing.hosted_image_filename=Arquivo invalido: Por favor, use s\u00F3 os seguintes caracteres 'a' - 'z', 'A' - 'Z', '0' - '9', y &quot;.&quot;, &quot;-&quot;, &quot;*&quot;, &quot;_&quot;!&lt;br&gt;
@@ -697,9 +702,11 @@ import.update_status=Atualizando informa\u00E7\u00F5es da lista de e-mails
 insecure=nseguro
 iso-8859-1=ISO 8859-1
 iso-8859-15=ISO 8859-15
+loading=loading...
+loading.stopped=loading ... stopped
 logon.login=Login
 logon.password=Senha
-logon.title=AGNITAS OpenEMM 5.5.0
+logon.title=AGNITAS OpenEMM 5.5.1
 logon.username=Username
 mailing.activate_event_explain=Seu e-mails agora est\u00E1 pronto para envio. &lt;br&gt; Voc\u00EA pode test\u00E1-lo com os seguintes &lt;br&gt; dois links.
 mailing.activate_rule_explain=Seu e-mails agora est\u00E1 pronto para envio. &lt;br&gt; Voc\u00EA pode test\u00E1-lo com os seguintes &lt;br&gt; dois links ou activ\u00E1-lo para iniciar a distribui\u00E7\u00E3o di\u00E1ria &lt;br&gt; do mailing selecionado para o grupo-alvo.
@@ -736,6 +743,10 @@ password=Password
 process=Processar
 profile.hint=0 para la longitud a voluntad
 recipient.confirm_delete=Voc\u00EA realmente deseja excluir este destinat\u00E1rio?
+recipient.mailingtype=recipients  mailing type
+recipient.mailingtype.html=html
+recipient.mailingtype.htmloffline=offline-html
+recipient.mailingtype.text=Text
 recipient.search=Buscar destinat\u00E1rio
 report.single_mailing=Single Mailing
 secure=Seguro</diff>
      <filename>src/jsp/WEB-INF/conf/messages_pt.properties</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,4 @@
 # Sample ResourceBundle properties file
-href_1=/mailinglist.do?action=1
-href_2=/mailinglist.do?action=2&amp;mailinglistID=0
-token_2=mailinglist.new
+href_1=/mailinglist.do?action\=1
 token_1=mailinglist.show
-msg_2=NewMailinglist
-msg_1=Mailinglists
+msg_1=Mailinglist</diff>
      <filename>src/jsp/WEB-INF/conf/navigation/mailinglists.properties</filename>
    </modified>
    <modified>
      <diff>@@ -64,6 +64,14 @@
         &lt;property name=&quot;concurrent&quot; value=&quot;false&quot;/&gt;
     &lt;/bean&gt;
     
+    &lt;bean id=&quot;Bounce&quot; class=&quot;org.agnitas.dao.impl.BounceDaoImpl&quot;&gt;
+    &lt;/bean&gt;
+    
+    &lt;bean id=&quot;deleteBounceJob&quot; class=&quot;org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean&quot;&gt;
+        &lt;property name=&quot;targetObject&quot; ref=&quot;Bounce&quot;/&gt;
+        &lt;property name=&quot;targetMethod&quot; value=&quot;cleanup&quot;/&gt;
+        &lt;property name=&quot;concurrent&quot; value=&quot;false&quot;/&gt;
+    &lt;/bean&gt;
     
     &lt;bean id=&quot;dateBasedMailingsCronTrigger&quot; class=&quot;org.springframework.scheduling.quartz.CronTriggerBean&quot;&gt;
         &lt;property name=&quot;jobDetail&quot; ref=&quot;dateBasedMailingsJob&quot;/&gt;
@@ -75,11 +83,17 @@
         &lt;property name=&quot;cronExpression&quot; value=&quot;${delayedMailings.cronExpression}&quot;/&gt;
     &lt;/bean&gt;
     
+    &lt;bean id=&quot;deleteBounceCronTrigger&quot; class=&quot;org.springframework.scheduling.quartz.CronTriggerBean&quot;&gt;
+        &lt;property name=&quot;jobDetail&quot; ref=&quot;deleteBounceJob&quot;/&gt;
+        &lt;property name=&quot;cronExpression&quot; value=&quot;${deleteBounce.cronExpression}&quot;/&gt;
+    &lt;/bean&gt;
+    
     &lt;bean class=&quot;org.springframework.scheduling.quartz.SchedulerFactoryBean&quot;&gt;
         &lt;property name=&quot;triggers&quot;&gt;
             &lt;list&gt;
                 &lt;ref bean=&quot;dateBasedMailingsCronTrigger&quot;/&gt;
                 &lt;ref bean=&quot;delayedMailingsCronTrigger&quot;/&gt;
+                &lt;ref bean=&quot;deleteBounceCronTrigger&quot;/&gt;
             &lt;/list&gt;
         &lt;/property&gt;
     &lt;/bean&gt;</diff>
      <filename>src/jsp/WEB-INF/cronContext.xml</filename>
    </modified>
    <modified>
      <diff>@@ -3,369 +3,516 @@
 &quot;-//Apache Software Foundation//DTD Struts Configuration 1.1//EN&quot;
 &quot;http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd&quot;&gt;
 &lt;struts-config&gt;
-    &lt;!-- ========== Form Bean Definitions =================================== --&gt;
-    &lt;form-beans type=&quot;org.apache.struts.action.ActionFormBean&quot;&gt;
-
-        &lt;form-bean name=&quot;logonForm&quot; type=&quot;org.agnitas.web.LogonForm&quot; /&gt;
-        
-        &lt;form-bean name=&quot;updateForm&quot; type=&quot;org.agnitas.web.UpdateForm&quot; /&gt;
-
-        &lt;form-bean name=&quot;campaignForm&quot; type=&quot;org.agnitas.web.CampaignForm&quot; /&gt;
-
-        &lt;form-bean name=&quot;profileFieldForm&quot; type=&quot;org.agnitas.web.ProfileFieldForm&quot; /&gt;
-
-        &lt;form-bean name=&quot;recipientForm&quot; type=&quot;org.agnitas.web.RecipientForm&quot; /&gt;
-
-        &lt;form-bean name=&quot;salutationForm&quot; type=&quot;org.agnitas.web.SalutationForm&quot; /&gt;
-
-        &lt;form-bean name=&quot;adminForm&quot; type=&quot;org.agnitas.web.AdminForm&quot; /&gt;
-
-        &lt;form-bean name=&quot;targetForm&quot; type=&quot;org.agnitas.web.TargetForm&quot; /&gt;
-    
-        &lt;form-bean name=&quot;ipStatForm&quot; type=&quot;org.agnitas.web.IPStatForm&quot; /&gt;
-    
-        &lt;form-bean name=&quot;domainStatForm&quot; type=&quot;org.agnitas.web.DomainStatForm&quot; /&gt;
-
-        &lt;form-bean name=&quot;mailingBaseForm&quot; type=&quot;org.agnitas.web.MailingBaseForm&quot; /&gt;
-    
-        &lt;form-bean name=&quot;mailingContentForm&quot; type=&quot;org.agnitas.web.MailingContentForm&quot; /&gt;
-    
-        &lt;form-bean name=&quot;emmActionForm&quot; type=&quot;org.agnitas.web.EmmActionForm&quot; /&gt;
-    
-        &lt;form-bean name=&quot;mailinglistForm&quot; type=&quot;org.agnitas.web.MailinglistForm&quot; /&gt;
-        
-        &lt;form-bean name=&quot;mailingStatForm&quot; type=&quot;org.agnitas.web.MailingStatForm&quot; /&gt;
-        
-        &lt;form-bean name=&quot;mailingComponentsForm&quot; type=&quot;org.agnitas.web.MailingComponentsForm&quot; /&gt;
-        
-        &lt;form-bean name=&quot;mailingAttachmentsForm&quot; type=&quot;org.agnitas.web.MailingAttachmentsForm&quot; /&gt;
-        
-        &lt;form-bean name=&quot;mailingSendForm&quot; type=&quot;org.agnitas.web.MailingSendForm&quot; /&gt;
-        
-        &lt;form-bean name=&quot;mailloopForm&quot; type=&quot;org.agnitas.web.MailloopForm&quot; /&gt;
-        
-        &lt;form-bean name=&quot;mailingWizardForm&quot; type=&quot;org.agnitas.web.MailingWizardForm&quot; /&gt;
-
-        &lt;form-bean name=&quot;compareMailingForm&quot; type=&quot;org.agnitas.web.CompareMailingForm&quot; /&gt;
-        
-        &lt;form-bean name=&quot;trackableLinkForm&quot; type=&quot;org.agnitas.web.TrackableLinkForm&quot; /&gt;
-    
-        &lt;form-bean name=&quot;userFormEditForm&quot; type=&quot;org.agnitas.web.UserFormEditForm&quot; /&gt;
-        &lt;form-bean name=&quot;userFormExecuteForm&quot; type=&quot;org.agnitas.web.UserFormExecuteForm&quot; /&gt;
-
-        &lt;form-bean name=&quot;importWizardForm&quot; type=&quot;org.agnitas.web.ImportWizardForm&quot; /&gt;
-
-        &lt;form-bean name=&quot;exportWizardForm&quot; type=&quot;org.agnitas.web.ExportWizardForm&quot; /&gt;
-        &lt;form-bean name=&quot;recipientStatForm&quot; type=&quot;org.agnitas.web.RecipientStatForm&quot; /&gt;
-  
-    &lt;/form-beans&gt;
-
-    &lt;!-- ========== Global Forward Definitions ============================== --&gt;
-    &lt;global-forwards type=&quot;org.apache.struts.action.ActionForward&quot;&gt;
-        &lt;forward name=&quot;logoff&quot; path=&quot;/logon.do?action=2&quot; /&gt;
-        &lt;forward name=&quot;logon&quot; path=&quot;/logon.do?action=0&quot; /&gt;
-        &lt;forward name=&quot;success&quot; path=&quot;/start.jsp&quot; /&gt;
-    &lt;/global-forwards&gt;
-
-    &lt;!-- ========== Action Mapping Definitions ============================== --&gt;
-    &lt;action-mappings type=&quot;org.apache.struts.action.ActionMapping&quot;&gt;
-
-        &lt;!-- Process a user logon --&gt;
-        &lt;action path=&quot;/logon&quot; type=&quot;org.agnitas.web.LogonAction&quot; name=&quot;logonForm&quot; scope=&quot;request&quot; input=&quot;/logon.jsp&quot;&gt;
-            &lt;forward name=&quot;start_page&quot; path=&quot;/start.jsp&quot; /&gt;
-            &lt;forward name=&quot;view_logon&quot; path=&quot;/logon.jsp&quot; /&gt;
-            &lt;forward name=&quot;change_pwd_info&quot; path=&quot;/change_pwd_info.jsp&quot; /&gt;
-        &lt;/action&gt;
-        
-        &lt;!-- Process a update --&gt;
-        &lt;action path=&quot;/update&quot; type=&quot;org.agnitas.web.UpdateAction&quot; name=&quot;updateForm&quot; scope=&quot;request&quot; input=&quot;/start.jsp&quot;&gt;
-            &lt;forward name=&quot;success&quot; path=&quot;/update/update.jsp&quot; /&gt;
-            &lt;forward name=&quot;question&quot; path=&quot;/update/update_question.jsp&quot; /&gt;
-            &lt;forward name=&quot;error&quot; path=&quot;/update/update_error.jsp&quot; /&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/splash_settings.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Process a campaign --&gt;
-        &lt;action path=&quot;/campaign&quot; type=&quot;org.agnitas.web.CampaignAction&quot; name=&quot;campaignForm&quot; scope=&quot;session&quot; input=&quot;/campaign/list.jsp&quot;&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/campaign/list.jsp&quot;/&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/campaign/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/campaign/delete.jsp&quot; /&gt;
-            &lt;forward name=&quot;new&quot; path=&quot;/campaign/new.jsp&quot; /&gt;
-            &lt;forward name=&quot;stat&quot; path=&quot;/campaign/stat.jsp&quot; /&gt;
-            &lt;forward name=&quot;splash&quot; path=&quot;/campaign/splash.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Process an admin --&gt;
-        &lt;action path=&quot;/admin&quot; type=&quot;org.agnitas.web.AdminAction&quot; name=&quot;adminForm&quot; scope=&quot;request&quot; input=&quot;/settings/admin/view.jsp&quot;&gt;
-            &lt;forward name=&quot;failure&quot; path=&quot;/settings/admin/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/settings/admin/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/settings/admin/list.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/settings/admin/delete.jsp&quot; /&gt;
-            &lt;forward name=&quot;rights&quot; path=&quot;/settings/admin/rights.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Process a salutation --&gt;
-        &lt;action path=&quot;/salutation&quot; type=&quot;org.agnitas.web.SalutationAction&quot; name=&quot;salutationForm&quot; scope=&quot;request&quot; input=&quot;/settings/salutation/view.jsp&quot;&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/settings/salutation/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/settings/salutation/list.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/settings/salutation/delete.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Process a blacklist --&gt;
-        &lt;action path=&quot;/blacklist&quot; type=&quot;org.agnitas.web.BlacklistAction&quot; name=&quot;blacklistForm&quot; scope=&quot;request&quot; input=&quot;/settings/blacklist/list.jsp&quot;&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/settings/blacklist/list.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/settings/blacklist/delete.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Process profile_db fields --&gt;
-        &lt;action path=&quot;/profiledb&quot; type=&quot;org.agnitas.web.ProfileFieldAction&quot; name=&quot;profileFieldForm&quot; scope=&quot;request&quot; input=&quot;/settings/profile_field/view.jsp&quot;&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/settings/profile_field/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/settings/profile_field/list.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/settings/profile_field/delete.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete_error&quot; path=&quot;/settings/profile_field/delete_error.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Process recipients --&gt;
-        &lt;action path=&quot;/recipient&quot; type=&quot;org.agnitas.web.RecipientAction&quot; name=&quot;recipientForm&quot; scope=&quot;session&quot; input=&quot;/recipient/list.jsp&quot;&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/recipient/list.jsp&quot; /&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/recipient/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/recipient/delete.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Process target groups --&gt;
-        &lt;action path=&quot;/target&quot; type=&quot;org.agnitas.web.TargetAction&quot; name=&quot;targetForm&quot; scope=&quot;request&quot; input=&quot;/targets/view.jsp&quot;&gt;
-            &lt;forward name=&quot;failure&quot; path=&quot;/targets/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;success&quot; path=&quot;/targets/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/targets/list.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/targets/delete.jsp&quot; /&gt;
-            &lt;forward name=&quot;create_ml&quot; path=&quot;/targets/new_ml.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete_recipients&quot; path=&quot;/targets/delete_recipients.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Display Recipient Statistics --&gt;
-        &lt;action path=&quot;/recipient_stats&quot; type=&quot;org.agnitas.web.RecipientStatAction&quot; name=&quot;recipientStatForm&quot; scope=&quot;request&quot; input=&quot;/stats/recipient/select.jsp&quot;&gt;
-            &lt;forward name=&quot;select&quot; path=&quot;/stats/recipient/select.jsp&quot; /&gt;
-            &lt;forward name=&quot;display&quot; path=&quot;/stats/recipient/display.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- compare two up to n mailing response statistics --&gt;
-        &lt;action path=&quot;/mailing_compare&quot; type=&quot;org.agnitas.web.CompareMailingAction&quot; name=&quot;compareMailingForm&quot; input=&quot;/stats/mailing_comp/select.jsp&quot; scope=&quot;session&quot;&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/stats/mailing_comp/select.jsp&quot; /&gt;
-            &lt;forward name=&quot;compare&quot; path=&quot;/stats/mailing_comp/view.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- process Subscriber IP Statistics --&gt;
-        &lt;action path=&quot;/ip_stats&quot; type=&quot;org.agnitas.web.IPStatAction&quot; name=&quot;ipStatForm&quot; scope=&quot;session&quot; input=&quot;/stats/ip_stats.jsp&quot;&gt;
-            &lt;forward name=&quot;stat&quot; path=&quot;/stats/ip_stats.jsp&quot; /&gt;
-            &lt;forward name=&quot;splash&quot; path=&quot;/stats/ip_splash.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- pisplay Subscriber Domain Statistics --&gt;
-        &lt;action path=&quot;/domain_stats&quot; type=&quot;org.agnitas.web.DomainStatAction&quot; name=&quot;domainStatForm&quot; scope=&quot;session&quot; input=&quot;/stats/domain_stats.jsp&quot;&gt;
-            &lt;forward name=&quot;stat&quot; path=&quot;/stats/domain_stats.jsp&quot; /&gt;
-            &lt;forward name=&quot;splash&quot; path=&quot;/stats/domain_splash.jsp&quot; /&gt;
-        &lt;/action&gt;
-    
-        &lt;!-- Process a mailing base information --&gt;
-        &lt;action path=&quot;/mailingbase&quot; type=&quot;org.agnitas.web.MailingBaseAction&quot; name=&quot;mailingBaseForm&quot; scope=&quot;session&quot; input=&quot;/mailing/view_base.jsp&quot;&gt;
-            &lt;forward name=&quot;failure&quot; path=&quot;/mailing/view_base.jsp&quot; /&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/mailing/view_base.jsp&quot; /&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/mailing/list.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/mailing/delete.jsp&quot; /&gt;
-            &lt;forward name=&quot;action&quot; path=&quot;/mailing/action.jsp&quot; /&gt;
-        &lt;/action&gt;
-    
-        &lt;!-- Process a mailing content request --&gt;
-        &lt;action path=&quot;/mailingcontent&quot; type=&quot;org.agnitas.web.MailingContentAction&quot; name=&quot;mailingContentForm&quot; scope=&quot;session&quot; input=&quot;/mailing/content_list.jsp&quot;&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/mailing/content_list.jsp&quot; /&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/mailing/content_view.jsp&quot; /&gt;
-        &lt;/action&gt;
-        
-        &lt;!-- Process a mailing attachment request --&gt;
-        &lt;action path=&quot;/mailingattachments&quot; type=&quot;org.agnitas.web.MailingAttachmentsAction&quot; name=&quot;mailingAttachmentsForm&quot; scope=&quot;request&quot; input=&quot;/mailing/attachments.jsp&quot;&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/mailing/attachments.jsp&quot; /&gt;
-        &lt;/action&gt;
-        
-        &lt;!-- Process a mailing send/preview request --&gt;
-        &lt;action path=&quot;/mailingsend&quot; type=&quot;org.agnitas.web.MailingSendAction&quot; name=&quot;mailingSendForm&quot; scope=&quot;request&quot; input=&quot;/mailing/send.jsp&quot;&gt;
-            &lt;forward name=&quot;send&quot; path=&quot;/mailing/send.jsp&quot; /&gt;
-            &lt;forward name=&quot;send2&quot; path=&quot;/mailing/send2.jsp&quot; /&gt;
-            &lt;forward name=&quot;send_confirm&quot; path=&quot;/mailing/send_confirm.jsp&quot; /&gt;
-            &lt;forward name=&quot;preview_select&quot; path=&quot;/mailing/preview_select.jsp&quot; /&gt;
-            &lt;forward name=&quot;preview_header&quot; path=&quot;/mailing/preview_header.jsp&quot; /&gt;
-            &lt;forward name=&quot;preview.0&quot; path=&quot;/mailing/preview_text.jsp&quot; /&gt;
-            &lt;forward name=&quot;preview.1&quot; path=&quot;/mailing/preview_html.jsp&quot; /&gt;
-            &lt;forward name=&quot;cancel_generation_question&quot; path=&quot;/mailing/cancel_generation_question.jsp&quot; /&gt;
-            &lt;forward name=&quot;cancel_generation_deny&quot; path=&quot;/mailing/cancel_generation_deny.jsp&quot; /&gt;
-            &lt;forward name=&quot;view_delstatbox&quot; path=&quot;/mailing/delivery_stat.jsp&quot; /&gt;
-        &lt;/action&gt;
-        
-        &lt;!-- Process a mailing statistics request --&gt;
-        &lt;action path=&quot;/mailing_stat&quot; type=&quot;org.agnitas.web.MailingStatAction&quot; name=&quot;mailingStatForm&quot; scope=&quot;session&quot; input=&quot;/stats/mailing_stats.jsp&quot;&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/stats/mailing_stats.jsp&quot; /&gt;
-            &lt;forward name=&quot;mailing_stat&quot; path=&quot;/stats/mailing_stat.jsp&quot; /&gt;
-            &lt;forward name=&quot;week_stat&quot; path=&quot;/stats/mailing_stat_week.jsp&quot; /&gt;
-            &lt;forward name=&quot;day_stat&quot; path=&quot;/stats/mailing_stat_day.jsp&quot; /&gt;
-            &lt;forward name=&quot;clean_question&quot; path=&quot;/stats/stat_clean_question.jsp&quot; /&gt;
-            &lt;forward name=&quot;splash&quot; path=&quot;/stats/mailstat_splash.jsp&quot; /&gt;
-            &lt;forward name=&quot;opened_stat&quot; path=&quot;/stats/mailing_stat_opened.jsp&quot; /&gt;
-            &lt;forward name=&quot;bounce_stat&quot; path=&quot;/stats/mailing_stat_bounce.jsp&quot; /&gt;
-	        &lt;forward name=&quot;bounce&quot; path=&quot;/stats/mailing_bounce.jsp&quot; /&gt;
-	        &lt;forward name=&quot;open_week&quot; path=&quot;/stats/mailing_open_week.jsp&quot; /&gt;
-	        &lt;forward name=&quot;open_day&quot; path=&quot;/stats/mailing_open_day.jsp&quot; /&gt;
-        &lt;/action&gt;
-    
-        &lt;!-- Process actions --&gt;
-        &lt;action path=&quot;/action&quot; type=&quot;org.agnitas.web.EmmActionAction&quot; name=&quot;emmActionForm&quot; scope=&quot;session&quot; input=&quot;/actions/view.jsp&quot;&gt;
-            &lt;forward name=&quot;failure&quot; path=&quot;/actions/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;success&quot; path=&quot;/actions/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/actions/list.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/actions/delete.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Process a mailinglist --&gt;
-        &lt;action path=&quot;/mailinglist&quot; type=&quot;org.agnitas.web.MailinglistAction&quot; name=&quot;mailinglistForm&quot; scope=&quot;request&quot; input=&quot;/mailinglists/view.jsp&quot;&gt;
-            &lt;forward name=&quot;failure&quot; path=&quot;/mailinglists/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/mailinglists/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/mailinglists/list.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/mailinglists/delete.jsp&quot; /&gt;
-        &lt;/action&gt;     
-
-        &lt;!-- Process a userform --&gt;
-        &lt;action path=&quot;/userform&quot; type=&quot;org.agnitas.web.UserFormEditAction&quot; name=&quot;userFormEditForm&quot; scope=&quot;request&quot; input=&quot;/userform/view.jsp&quot;&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/userform/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/userform/list.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/userform/delete.jsp&quot; /&gt;
-        &lt;/action&gt;
-    
-        &lt;!-- Process MailingComponents --&gt;
-        &lt;action path=&quot;/mcomponents&quot; type=&quot;org.agnitas.web.MailingComponentsAction&quot; name=&quot;mailingComponentsForm&quot; scope=&quot;request&quot; input=&quot;/mailing/components.jsp&quot;&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/mailing/components.jsp&quot; /&gt;
-            &lt;forward name=&quot;component_edit&quot; path=&quot;/mailing/component_upload.jsp&quot; /&gt;
-        &lt;/action&gt;
-    
-        &lt;!-- Process a userform (execute) --&gt;
-        &lt;action path=&quot;/form&quot; type=&quot;org.agnitas.web.UserFormExecuteAction&quot; name=&quot;userFormExecuteForm&quot; scope=&quot;request&quot;&gt;
-        &lt;/action&gt;
-        
-        &lt;!-- Process a trackable link --&gt;
-        &lt;action path=&quot;/tracklink&quot; type=&quot;org.agnitas.web.TrackableLinkAction&quot; name=&quot;trackableLinkForm&quot; scope=&quot;request&quot;&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/mailing/trackablelink_view.jsp&quot;/&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/mailing/trackablelink_list.jsp&quot;/&gt;
-        &lt;/action&gt;
-     
-        &lt;!-- Process an import wizard --&gt;
-        &lt;action path=&quot;/importwizard&quot; type=&quot;org.agnitas.web.ImportWizardAction&quot; name=&quot;importWizardForm&quot; scope=&quot;session&quot; input=&quot;/importwizard/start.jsp&quot;&gt;
-            &lt;forward name=&quot;start&quot; path=&quot;/importwizard/start.jsp&quot;/&gt;
-            &lt;forward name=&quot;mode&quot; path=&quot;/importwizard/mode.jsp&quot; /&gt;
-            &lt;forward name=&quot;mapping&quot; path=&quot;/importwizard/mapping.jsp&quot; /&gt;
-            &lt;forward name=&quot;verify&quot; path=&quot;/importwizard/verify.jsp&quot; /&gt;
-            &lt;forward name=&quot;prescan&quot; path=&quot;/importwizard/prescan.jsp&quot; /&gt;
-            &lt;forward name=&quot;mlists&quot; path=&quot;/importwizard/mlists.jsp&quot; /&gt;
-            &lt;forward name=&quot;view_status&quot; path=&quot;/importwizard/upload_status.jsp&quot; /&gt;
-            &lt;forward name=&quot;view_status_window&quot; path=&quot;/importwizard/upload_window.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Process a export through a wizard--&gt;
-        &lt;action path=&quot;/exportwizard&quot; type=&quot;org.agnitas.web.ExportWizardAction&quot; name=&quot;exportWizardForm&quot; scope=&quot;session&quot; input=&quot;/exportwizard/query.jsp&quot;&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/exportwizard/list.jsp&quot;/&gt;
-            &lt;forward name=&quot;query&quot; path=&quot;/exportwizard/query.jsp&quot;/&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/exportwizard/view.jsp&quot; /&gt;
-            &lt;forward name=&quot;view_status&quot; path=&quot;/exportwizard/view_window.jsp&quot; /&gt;
-            &lt;forward name=&quot;savemask&quot; path=&quot;/exportwizard/savemask.jsp&quot; /&gt;
-            &lt;forward name=&quot;delete_question&quot; path=&quot;/exportwizard/delete.jsp&quot; /&gt;
-        &lt;/action&gt;
-
-        &lt;!-- Process a mailloop --&gt;
-        &lt;action path=&quot;/mailloop&quot; type=&quot;org.agnitas.web.MailloopAction&quot; name=&quot;mailloopForm&quot; scope=&quot;request&quot; input=&quot;/settings/mailloop/view.jsp&quot;&gt;
-            &lt;forward name=&quot;list&quot; path=&quot;/settings/mailloop/list.jsp&quot;/&gt;
-            &lt;forward name=&quot;view&quot; path=&quot;/settings/mailloop/view.jsp&quot;/&gt;
-            &lt;forward name=&quot;delete&quot; path=&quot;/settings/mailloop/delete.jsp&quot;/&gt;
-        &lt;/action&gt;
-        
-        &lt;!-- Mailing-Wizard mappings --&gt;
-        &lt;action path=&quot;/mwStart&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/start.jsp&quot;&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/name.jsp&quot;/&gt;
-        &lt;/action&gt;        
-        
-        &lt;action path=&quot;/mwName&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/name.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/start.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/template.jsp&quot;/&gt;
-        &lt;/action&gt;
-        
-        &lt;action path=&quot;/mwTemplate&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/template.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/name.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/type.jsp&quot;/&gt;
-        &lt;/action&gt;
-
-        &lt;action path=&quot;/mwType&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/type.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/template.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/sendaddress.jsp&quot;/&gt;
-        &lt;/action&gt;
-
-        &lt;action path=&quot;/mwSendaddress&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/sendaddress.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/type.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/mailtype.jsp&quot;/&gt;
-        &lt;/action&gt;
-
-        &lt;action path=&quot;/mwMailtype&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/mailtype.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/sendaddress.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/subject.jsp&quot;/&gt;
-        &lt;/action&gt;
-
-        &lt;action path=&quot;/mwSubject&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/subject.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/mailtype.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/target.jsp&quot;/&gt;
-        &lt;/action&gt;
-
-        &lt;action path=&quot;/mwTarget&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/target.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/subject.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/textmodules.jsp&quot;/&gt;
-            &lt;forward name=&quot;finish&quot; path=&quot;/mailing/wizard/finish.jsp&quot;/&gt;
-        &lt;/action&gt;
-
-        &lt;action path=&quot;/mwTextmodules&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/textmodules.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/target.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/textmodule.jsp&quot;/&gt;
-            &lt;forward name=&quot;skip&quot; path=&quot;/mailing/wizard/links.jsp&quot;/&gt;
-            &lt;forward name=&quot;finish&quot; path=&quot;/mailing/wizard/finish.jsp&quot;/&gt;
-        &lt;/action&gt;
-
-        &lt;action path=&quot;/mwTextmodule&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/textmodule.jsp&quot;&gt;
-            &lt;forward name=&quot;add&quot; path=&quot;/mailing/wizard/textmodule.jsp&quot;/&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/textmodules.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/textmodule.jsp&quot;/&gt;
-            &lt;forward name=&quot;skip&quot; path=&quot;/mailing/wizard/links.jsp&quot;/&gt;
-            &lt;forward name=&quot;finish&quot; path=&quot;/mailing/wizard/finish.jsp&quot;/&gt;
-        &lt;/action&gt;
-
-        &lt;action path=&quot;/mwLinks&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/links.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/textmodules.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/link.jsp&quot;/&gt;
-            &lt;forward name=&quot;skip&quot; path=&quot;/mailing/wizard/attachment.jsp&quot;/&gt;
-            &lt;forward name=&quot;finish&quot; path=&quot;/mailing/wizard/finish.jsp&quot;/&gt;
-        &lt;/action&gt;
-
-        &lt;action path=&quot;/mwLink&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/link.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/links.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/link.jsp&quot;/&gt;
-            &lt;forward name=&quot;skip&quot; path=&quot;/mailing/wizard/attachment.jsp&quot;/&gt;
-        &lt;/action&gt;
-        
-        &lt;action path=&quot;/mwAttachment&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/attachment.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/links.jsp&quot;/&gt;
-            &lt;forward name=&quot;save&quot; path=&quot;/mailing/wizard/attachment.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/attachment.jsp&quot;/&gt;
-            &lt;forward name=&quot;finish&quot; path=&quot;/mailing/wizard/finish.jsp&quot;/&gt;
-        &lt;/action&gt;
-
-        &lt;action path=&quot;/mwFinish&quot; type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot; scope=&quot;session&quot; parameter=&quot;action&quot; input=&quot;/mailing/wizard/finish.jsp&quot;&gt;
-            &lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/attachment.jsp&quot;/&gt;
-            &lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/finish.jsp&quot;/&gt;
-        &lt;/action&gt;
-        
-    &lt;/action-mappings&gt;
-
-    &lt;message-resources parameter=&quot;messages&quot; /&gt;
+	&lt;!-- ========== Form Bean Definitions =================================== --&gt;
+	&lt;form-beans type=&quot;org.apache.struts.action.ActionFormBean&quot;&gt;
+
+		&lt;form-bean name=&quot;logonForm&quot; type=&quot;org.agnitas.web.LogonForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;updateForm&quot; type=&quot;org.agnitas.web.UpdateForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;campaignForm&quot;
+			type=&quot;org.agnitas.web.forms.CampaignForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;profileFieldForm&quot;
+			type=&quot;org.agnitas.web.ProfileFieldForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;recipientForm&quot;
+			type=&quot;org.agnitas.web.RecipientForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;salutationForm&quot;
+			type=&quot;org.agnitas.web.SalutationForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;adminForm&quot;
+			type=&quot;org.agnitas.web.forms.AdminForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;targetForm&quot; type=&quot;org.agnitas.web.TargetForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;ipStatForm&quot; type=&quot;org.agnitas.web.IPStatForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;domainStatForm&quot;
+			type=&quot;org.agnitas.web.DomainStatForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;mailingBaseForm&quot;
+			type=&quot;org.agnitas.web.MailingBaseForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;mailingContentForm&quot;
+			type=&quot;org.agnitas.web.MailingContentForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;emmActionForm&quot;
+			type=&quot;org.agnitas.web.forms.EmmActionForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;mailinglistForm&quot;
+			type=&quot;org.agnitas.web.MailinglistForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;mailingStatForm&quot;
+			type=&quot;org.agnitas.web.MailingStatForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;mailingComponentsForm&quot;
+			type=&quot;org.agnitas.web.MailingComponentsForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;mailingAttachmentsForm&quot;
+			type=&quot;org.agnitas.web.MailingAttachmentsForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;mailingSendForm&quot;
+			type=&quot;org.agnitas.web.MailingSendForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;mailloopForm&quot;
+			type=&quot;org.agnitas.web.MailloopForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;mailingWizardForm&quot;
+			type=&quot;org.agnitas.web.MailingWizardForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;compareMailingForm&quot;
+			type=&quot;org.agnitas.web.CompareMailingForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;trackableLinkForm&quot;
+			type=&quot;org.agnitas.web.TrackableLinkForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;userFormEditForm&quot;
+			type=&quot;org.agnitas.web.UserFormEditForm&quot; /&gt;
+		&lt;form-bean name=&quot;userFormExecuteForm&quot;
+			type=&quot;org.agnitas.web.UserFormExecuteForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;importWizardForm&quot;
+			type=&quot;org.agnitas.web.ImportWizardForm&quot; /&gt;
+
+		&lt;form-bean name=&quot;exportWizardForm&quot;
+			type=&quot;org.agnitas.web.ExportWizardForm&quot; /&gt;
+		&lt;form-bean name=&quot;recipientStatForm&quot;
+			type=&quot;org.agnitas.web.RecipientStatForm&quot; /&gt;
+
+	&lt;/form-beans&gt;
+
+	&lt;!-- ========== Global Forward Definitions ============================== --&gt;
+	&lt;global-forwards type=&quot;org.apache.struts.action.ActionForward&quot;&gt;
+		&lt;forward name=&quot;logoff&quot; path=&quot;/logon.do?action=2&quot; /&gt;
+		&lt;forward name=&quot;logon&quot; path=&quot;/logon.do?action=0&quot; /&gt;
+		&lt;forward name=&quot;success&quot; path=&quot;/start.jsp&quot; /&gt;
+	&lt;/global-forwards&gt;
+
+	&lt;!-- ========== Action Mapping Definitions ============================== --&gt;
+	&lt;action-mappings type=&quot;org.apache.struts.action.ActionMapping&quot;&gt;
+
+		&lt;!-- Process a user logon --&gt;
+		&lt;action path=&quot;/logon&quot; type=&quot;org.agnitas.web.LogonAction&quot;
+			name=&quot;logonForm&quot; scope=&quot;request&quot; input=&quot;/logon.jsp&quot;&gt;
+			&lt;forward name=&quot;start_page&quot; path=&quot;/start.jsp&quot; /&gt;
+			&lt;forward name=&quot;view_logon&quot; path=&quot;/logon.jsp&quot; /&gt;
+			&lt;forward name=&quot;change_pwd_info&quot; path=&quot;/change_pwd_info.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a update --&gt;
+		&lt;action path=&quot;/update&quot; type=&quot;org.agnitas.web.UpdateAction&quot;
+			name=&quot;updateForm&quot; scope=&quot;request&quot; input=&quot;/start.jsp&quot;&gt;
+			&lt;forward name=&quot;success&quot; path=&quot;/update/update.jsp&quot; /&gt;
+			&lt;forward name=&quot;question&quot; path=&quot;/update/update_question.jsp&quot; /&gt;
+			&lt;forward name=&quot;error&quot; path=&quot;/update/update_error.jsp&quot; /&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/splash_settings.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a campaign --&gt;
+		&lt;action path=&quot;/campaign&quot; type=&quot;org.agnitas.web.CampaignAction&quot;
+			name=&quot;campaignForm&quot; scope=&quot;session&quot; input=&quot;/campaign/list.jsp&quot;&gt;			
+			&lt;forward name=&quot;list&quot; path=&quot;/campaign/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/campaign/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot; path=&quot;/campaign/delete.jsp&quot; /&gt;
+			&lt;forward name=&quot;new&quot; path=&quot;/campaign/new.jsp&quot; /&gt;
+			&lt;forward name=&quot;stat&quot; path=&quot;/campaign/stat.jsp&quot; /&gt;
+			&lt;forward name=&quot;splash&quot; path=&quot;/campaign/splash.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process an admin --&gt;
+		&lt;action path=&quot;/admin&quot; type=&quot;org.agnitas.web.AdminAction&quot;
+			name=&quot;adminForm&quot; scope=&quot;request&quot; input=&quot;/settings/admin/view.jsp&quot;&gt;
+			&lt;forward name=&quot;failure&quot; path=&quot;/settings/admin/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/settings/admin/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/settings/admin/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot; path=&quot;/settings/admin/delete.jsp&quot; /&gt;
+			&lt;forward name=&quot;rights&quot; path=&quot;/settings/admin/rights.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a salutation --&gt;
+		&lt;action path=&quot;/salutation&quot;
+			type=&quot;org.agnitas.web.SalutationAction&quot; name=&quot;salutationForm&quot;
+			scope=&quot;request&quot; input=&quot;/settings/salutation/view.jsp&quot;&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/settings/salutation/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/settings/salutation/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot;
+				path=&quot;/settings/salutation/delete.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a blacklist --&gt;
+		&lt;action path=&quot;/blacklist&quot; type=&quot;org.agnitas.web.BlacklistAction&quot;
+			name=&quot;blacklistForm&quot; scope=&quot;request&quot;
+			input=&quot;/settings/blacklist/list.jsp&quot;&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/settings/blacklist/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot;
+				path=&quot;/settings/blacklist/delete.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process profile_db fields --&gt;
+		&lt;action path=&quot;/profiledb&quot;
+			type=&quot;org.agnitas.web.ProfileFieldAction&quot; name=&quot;profileFieldForm&quot;
+			scope=&quot;request&quot; input=&quot;/settings/profile_field/view.jsp&quot;&gt;
+			&lt;forward name=&quot;view&quot;
+				path=&quot;/settings/profile_field/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;list&quot;
+				path=&quot;/settings/profile_field/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot;
+				path=&quot;/settings/profile_field/delete.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete_error&quot;
+				path=&quot;/settings/profile_field/delete_error.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process recipients --&gt;
+		&lt;action path=&quot;/recipient&quot; type=&quot;org.agnitas.web.RecipientAction&quot;
+			name=&quot;recipientForm&quot; scope=&quot;session&quot; input=&quot;/recipient/list.jsp&quot;&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/recipient/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/recipient/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot; path=&quot;/recipient/delete.jsp&quot; /&gt;
+			&lt;forward name=&quot;loading&quot; path=&quot;/recipient/loading.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process target groups --&gt;
+		&lt;action path=&quot;/target&quot; type=&quot;org.agnitas.web.TargetAction&quot;
+			name=&quot;targetForm&quot; scope=&quot;request&quot; input=&quot;/targets/view.jsp&quot;&gt;
+			&lt;forward name=&quot;failure&quot; path=&quot;/targets/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;success&quot; path=&quot;/targets/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/targets/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot; path=&quot;/targets/delete.jsp&quot; /&gt;
+			&lt;forward name=&quot;create_ml&quot; path=&quot;/targets/new_ml.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete_recipients&quot;
+				path=&quot;/targets/delete_recipients.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Display Recipient Statistics --&gt;
+		&lt;action path=&quot;/recipient_stats&quot;
+			type=&quot;org.agnitas.web.RecipientStatAction&quot; name=&quot;recipientStatForm&quot;
+			scope=&quot;request&quot; input=&quot;/stats/recipient/select.jsp&quot;&gt;
+			&lt;forward name=&quot;select&quot; path=&quot;/stats/recipient/select.jsp&quot; /&gt;
+			&lt;forward name=&quot;display&quot; path=&quot;/stats/recipient/display.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- compare two up to n mailing response statistics --&gt;
+		&lt;action path=&quot;/mailing_compare&quot;
+			type=&quot;org.agnitas.web.CompareMailingAction&quot; name=&quot;compareMailingForm&quot;
+			input=&quot;/stats/mailing_comp/select.jsp&quot; scope=&quot;session&quot;&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/stats/mailing_comp/select.jsp&quot; /&gt;
+			&lt;forward name=&quot;compare&quot; path=&quot;/stats/mailing_comp/view.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- process Subscriber IP Statistics --&gt;
+		&lt;action path=&quot;/ip_stats&quot; type=&quot;org.agnitas.web.IPStatAction&quot;
+			name=&quot;ipStatForm&quot; scope=&quot;session&quot; input=&quot;/stats/ip_stats.jsp&quot;&gt;
+			&lt;forward name=&quot;stat&quot; path=&quot;/stats/ip_stats.jsp&quot; /&gt;
+			&lt;forward name=&quot;splash&quot; path=&quot;/stats/ip_splash.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- pisplay Subscriber Domain Statistics --&gt;
+		&lt;action path=&quot;/domain_stats&quot;
+			type=&quot;org.agnitas.web.DomainStatAction&quot; name=&quot;domainStatForm&quot;
+			scope=&quot;session&quot; input=&quot;/stats/domain_stats.jsp&quot;&gt;
+			&lt;forward name=&quot;stat&quot; path=&quot;/stats/domain_stats.jsp&quot; /&gt;
+			&lt;forward name=&quot;splash&quot; path=&quot;/stats/domain_splash.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a mailing base information --&gt;
+		&lt;action path=&quot;/mailingbase&quot;
+			type=&quot;org.agnitas.web.MailingBaseAction&quot; name=&quot;mailingBaseForm&quot;
+			scope=&quot;session&quot; input=&quot;/mailing/view_base.jsp&quot;&gt;
+			&lt;forward name=&quot;failure&quot; path=&quot;/mailing/view_base.jsp&quot; /&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/mailing/view_base.jsp&quot; /&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/mailing/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot; path=&quot;/mailing/delete.jsp&quot; /&gt;
+			&lt;forward name=&quot;action&quot; path=&quot;/mailing/action.jsp&quot; /&gt;
+			&lt;forward name=&quot;loading&quot; path=&quot;/mailing/loading.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a mailing content request --&gt;
+		&lt;action path=&quot;/mailingcontent&quot;
+			type=&quot;org.agnitas.web.MailingContentAction&quot; name=&quot;mailingContentForm&quot;
+			scope=&quot;session&quot; input=&quot;/mailing/content_list.jsp&quot;&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/mailing/content_list.jsp&quot; /&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/mailing/content_view.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a mailing attachment request --&gt;
+		&lt;action path=&quot;/mailingattachments&quot;
+			type=&quot;org.agnitas.web.MailingAttachmentsAction&quot;
+			name=&quot;mailingAttachmentsForm&quot; scope=&quot;request&quot;
+			input=&quot;/mailing/attachments.jsp&quot;&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/mailing/attachments.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a mailing send/preview request --&gt;
+		&lt;action path=&quot;/mailingsend&quot;
+			type=&quot;org.agnitas.web.MailingSendAction&quot; name=&quot;mailingSendForm&quot;
+			scope=&quot;request&quot; input=&quot;/mailing/send.jsp&quot;&gt;
+			&lt;forward name=&quot;send&quot; path=&quot;/mailing/send.jsp&quot; /&gt;
+			&lt;forward name=&quot;send2&quot; path=&quot;/mailing/send2.jsp&quot; /&gt;
+			&lt;forward name=&quot;send_confirm&quot;
+				path=&quot;/mailing/send_confirm.jsp&quot; /&gt;
+			&lt;forward name=&quot;preview_select&quot;
+				path=&quot;/mailing/preview_select.jsp&quot; /&gt;
+			&lt;forward name=&quot;preview_header&quot;
+				path=&quot;/mailing/preview_header.jsp&quot; /&gt;
+			&lt;forward name=&quot;preview.0&quot; path=&quot;/mailing/preview_text.jsp&quot; /&gt;
+			&lt;forward name=&quot;preview.1&quot; path=&quot;/mailing/preview_html.jsp&quot; /&gt;
+			&lt;forward name=&quot;cancel_generation_question&quot;
+				path=&quot;/mailing/cancel_generation_question.jsp&quot; /&gt;
+			&lt;forward name=&quot;cancel_generation_deny&quot;
+				path=&quot;/mailing/cancel_generation_deny.jsp&quot; /&gt;
+			&lt;forward name=&quot;view_delstatbox&quot;
+				path=&quot;/mailing/delivery_stat.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a mailing statistics request --&gt;
+		&lt;action path=&quot;/mailing_stat&quot;
+			type=&quot;org.agnitas.web.MailingStatAction&quot; name=&quot;mailingStatForm&quot;
+			scope=&quot;session&quot; input=&quot;/stats/mailing_stats.jsp&quot;&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/stats/mailing_stats.jsp&quot; /&gt;
+			&lt;forward name=&quot;mailing_stat&quot; path=&quot;/stats/mailing_stat.jsp&quot; /&gt;
+			&lt;forward name=&quot;week_stat&quot;
+				path=&quot;/stats/mailing_stat_week.jsp&quot; /&gt;
+			&lt;forward name=&quot;day_stat&quot; path=&quot;/stats/mailing_stat_day.jsp&quot; /&gt;
+			&lt;forward name=&quot;clean_question&quot;
+				path=&quot;/stats/stat_clean_question.jsp&quot; /&gt;
+			&lt;forward name=&quot;splash&quot; path=&quot;/stats/mailstat_splash.jsp&quot; /&gt;
+			&lt;forward name=&quot;opened_stat&quot;
+				path=&quot;/stats/mailing_stat_opened.jsp&quot; /&gt;
+			&lt;forward name=&quot;bounce_stat&quot;
+				path=&quot;/stats/mailing_stat_bounce.jsp&quot; /&gt;
+			&lt;forward name=&quot;bounce&quot; path=&quot;/stats/mailing_bounce.jsp&quot; /&gt;
+			&lt;forward name=&quot;open_week&quot;
+				path=&quot;/stats/mailing_open_week.jsp&quot; /&gt;
+			&lt;forward name=&quot;open_day&quot; path=&quot;/stats/mailing_open_day.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process actions --&gt;
+		&lt;action path=&quot;/action&quot; type=&quot;org.agnitas.web.EmmActionAction&quot;
+			name=&quot;emmActionForm&quot; scope=&quot;session&quot; input=&quot;/actions/view.jsp&quot;&gt;
+			&lt;forward name=&quot;failure&quot; path=&quot;/actions/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;success&quot; path=&quot;/actions/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/actions/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot; path=&quot;/actions/delete.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a mailinglist --&gt;
+		&lt;action path=&quot;/mailinglist&quot;
+			type=&quot;org.agnitas.web.MailinglistAction&quot; name=&quot;mailinglistForm&quot;
+			scope=&quot;request&quot; input=&quot;/mailinglists/view.jsp&quot;&gt;
+			&lt;forward name=&quot;failure&quot; path=&quot;/mailinglists/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/mailinglists/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/mailinglists/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot; path=&quot;/mailinglists/delete.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a userform --&gt;
+		&lt;action path=&quot;/userform&quot;
+			type=&quot;org.agnitas.web.UserFormEditAction&quot; name=&quot;userFormEditForm&quot;
+			scope=&quot;request&quot; input=&quot;/userform/view.jsp&quot;&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/userform/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/userform/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot; path=&quot;/userform/delete.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process MailingComponents --&gt;
+		&lt;action path=&quot;/mcomponents&quot;
+			type=&quot;org.agnitas.web.MailingComponentsAction&quot;
+			name=&quot;mailingComponentsForm&quot; scope=&quot;request&quot;
+			input=&quot;/mailing/components.jsp&quot;&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/mailing/components.jsp&quot; /&gt;
+			&lt;forward name=&quot;component_edit&quot;
+				path=&quot;/mailing/component_upload.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a userform (execute) --&gt;
+		&lt;action path=&quot;/form&quot;
+			type=&quot;org.agnitas.web.UserFormExecuteAction&quot;
+			name=&quot;userFormExecuteForm&quot; scope=&quot;request&quot;&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a trackable link --&gt;
+		&lt;action path=&quot;/tracklink&quot;
+			type=&quot;org.agnitas.web.TrackableLinkAction&quot; name=&quot;trackableLinkForm&quot;
+			scope=&quot;request&quot;&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/mailing/trackablelink_view.jsp&quot; /&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/mailing/trackablelink_list.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process an import wizard --&gt;
+		&lt;action path=&quot;/importwizard&quot;
+			type=&quot;org.agnitas.web.ImportWizardAction&quot; name=&quot;importWizardForm&quot;
+			scope=&quot;session&quot; input=&quot;/importwizard/start.jsp&quot;&gt;
+			&lt;forward name=&quot;start&quot; path=&quot;/importwizard/start.jsp&quot; /&gt;
+			&lt;forward name=&quot;mode&quot; path=&quot;/importwizard/mode.jsp&quot; /&gt;
+			&lt;forward name=&quot;mapping&quot; path=&quot;/importwizard/mapping.jsp&quot; /&gt;
+			&lt;forward name=&quot;verifymissingfields&quot;
+				path=&quot;/importwizard/verifymissingfields.jsp&quot; /&gt;
+			&lt;forward name=&quot;verify&quot; path=&quot;/importwizard/verify.jsp&quot; /&gt;
+			&lt;forward name=&quot;prescan&quot; path=&quot;/importwizard/prescan.jsp&quot; /&gt;
+			&lt;forward name=&quot;mlists&quot; path=&quot;/importwizard/mlists.jsp&quot; /&gt;
+			&lt;forward name=&quot;view_status&quot;
+				path=&quot;/importwizard/upload_status.jsp&quot; /&gt;
+			&lt;forward name=&quot;view_status_window&quot;
+				path=&quot;/importwizard/upload_window.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Process a export through a wizard--&gt;
+		&lt;action path=&quot;/exportwizard&quot;
+			type=&quot;org.agnitas.web.ExportWizardAction&quot; name=&quot;exportWizardForm&quot;
+			scope=&quot;session&quot; input=&quot;/exportwizard/query.jsp&quot;&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/exportwizard/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;query&quot; path=&quot;/exportwizard/query.jsp&quot; /&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/exportwizard/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;view_status&quot;
+				path=&quot;/exportwizard/view_window.jsp&quot; /&gt;
+			&lt;forward name=&quot;savemask&quot; path=&quot;/exportwizard/savemask.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete_question&quot;
+				path=&quot;/exportwizard/delete.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+
+		&lt;!-- Process a mailloop --&gt;
+		&lt;action path=&quot;/mailloop&quot; type=&quot;org.agnitas.web.MailloopAction&quot;
+			name=&quot;mailloopForm&quot; scope=&quot;request&quot;
+			input=&quot;/settings/mailloop/view.jsp&quot;&gt;
+			&lt;forward name=&quot;list&quot; path=&quot;/settings/mailloop/list.jsp&quot; /&gt;
+			&lt;forward name=&quot;view&quot; path=&quot;/settings/mailloop/view.jsp&quot; /&gt;
+			&lt;forward name=&quot;delete&quot; path=&quot;/settings/mailloop/delete.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;!-- Mailing-Wizard mappings --&gt;
+		&lt;action path=&quot;/mwStart&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/start.jsp&quot;&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/name.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwName&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/name.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/start.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/template.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwTemplate&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/template.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/name.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/type.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwType&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/type.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot;
+				path=&quot;/mailing/wizard/template.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/sendaddress.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwSendaddress&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/sendaddress.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/type.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/mailtype.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwMailtype&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/mailtype.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot;
+				path=&quot;/mailing/wizard/sendaddress.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/subject.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwSubject&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/subject.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot;
+				path=&quot;/mailing/wizard/mailtype.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/target.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwTarget&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/target.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/subject.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/textmodules.jsp&quot; /&gt;
+			&lt;forward name=&quot;finish&quot; path=&quot;/mailing/wizard/finish.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwTextmodules&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/textmodules.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/target.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/textmodule.jsp&quot; /&gt;
+			&lt;forward name=&quot;skip&quot; path=&quot;/mailing/wizard/links.jsp&quot; /&gt;
+			&lt;forward name=&quot;finish&quot; path=&quot;/mailing/wizard/finish.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwTextmodule&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/textmodule.jsp&quot;&gt;
+			&lt;forward name=&quot;add&quot; path=&quot;/mailing/wizard/textmodule.jsp&quot; /&gt;
+			&lt;forward name=&quot;previous&quot;
+				path=&quot;/mailing/wizard/textmodules.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/textmodule.jsp&quot; /&gt;
+			&lt;forward name=&quot;skip&quot; path=&quot;/mailing/wizard/links.jsp&quot; /&gt;
+			&lt;forward name=&quot;finish&quot; path=&quot;/mailing/wizard/finish.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwLinks&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/links.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot;
+				path=&quot;/mailing/wizard/textmodules.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/link.jsp&quot; /&gt;
+			&lt;forward name=&quot;skip&quot; path=&quot;/mailing/wizard/attachment.jsp&quot; /&gt;
+			&lt;forward name=&quot;finish&quot; path=&quot;/mailing/wizard/finish.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwLink&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/link.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/links.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/link.jsp&quot; /&gt;
+			&lt;forward name=&quot;skip&quot; path=&quot;/mailing/wizard/attachment.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwAttachment&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/attachment.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot; path=&quot;/mailing/wizard/links.jsp&quot; /&gt;
+			&lt;forward name=&quot;save&quot; path=&quot;/mailing/wizard/attachment.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/attachment.jsp&quot; /&gt;
+			&lt;forward name=&quot;finish&quot; path=&quot;/mailing/wizard/finish.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+		&lt;action path=&quot;/mwFinish&quot;
+			type=&quot;org.agnitas.web.MailingWizardAction&quot; name=&quot;mailingWizardForm&quot;
+			scope=&quot;session&quot; parameter=&quot;action&quot;
+			input=&quot;/mailing/wizard/finish.jsp&quot;&gt;
+			&lt;forward name=&quot;previous&quot;
+				path=&quot;/mailing/wizard/attachment.jsp&quot; /&gt;
+			&lt;forward name=&quot;next&quot; path=&quot;/mailing/wizard/finish.jsp&quot; /&gt;
+		&lt;/action&gt;
+
+	&lt;/action-mappings&gt;
+
+	&lt;message-resources parameter=&quot;messages&quot; /&gt;
 
 &lt;/struts-config&gt;</diff>
      <filename>src/jsp/WEB-INF/struts-config.xml</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,15 @@
         &lt;param-value&gt;/WEB-INF/applicationContext.xml /WEB-INF/dataAccessContext.xml /WEB-INF/cronContext.xml&lt;/param-value&gt;
         &lt;description&gt;spring context&lt;/description&gt;
     &lt;/context-param&gt;
+    &lt;!--
+    &lt;listener&gt;     
+    &lt;listener-class&gt;com.caucho.jsp.JspPrecompileListener&lt;/listener-class&gt;
+    &lt;init&gt;
+      &lt;extension&gt;jsp&lt;/extension&gt;
+    &lt;/init&gt;
+  &lt;/listener&gt;
+    --&gt;
+    
     &lt;listener&gt;
         &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
     &lt;/listener&gt;
@@ -40,18 +49,36 @@
 
     &lt;filter&gt;
     	&lt;filter-name&gt;SerializeRequestFilter&lt;/filter-name&gt;
-    	&lt;filter-class&gt;org.agnitas.dao.impl.SerializeRequestFilter&lt;/filter-class&gt;
+    	&lt;filter-class&gt;org.agnitas.web.filter.SerializeRequestFilter&lt;/filter-class&gt;
     &lt;/filter&gt;
     &lt;filter-mapping&gt;
         &lt;filter-name&gt;SerializeRequestFilter&lt;/filter-name&gt;
         &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
     &lt;/filter-mapping&gt;
 
+   &lt;filter&gt;
+        &lt;filter-name&gt;AjaxAnywhere&lt;/filter-name&gt;
+        &lt;filter-class&gt;org.ajaxanywhere.AAFilter&lt;/filter-class&gt;
+    &lt;/filter&gt;
+
+    &lt;filter-mapping&gt;
+        &lt;filter-name&gt;AjaxAnywhere&lt;/filter-name&gt;
+        &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;
+    &lt;/filter-mapping&gt;
+    &lt;filter-mapping&gt;
+        &lt;filter-name&gt;AjaxAnywhere&lt;/filter-name&gt;
+        &lt;url-pattern&gt;*.do&lt;/url-pattern&gt; &lt;!-- default Struts mapping --&gt;
+    &lt;/filter-mapping&gt;
+    &lt;filter-mapping&gt;
+        &lt;filter-name&gt;AjaxAnywhere&lt;/filter-name&gt;
+        &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt; &lt;!-- other framewords mapping--&gt;
+    &lt;/filter-mapping&gt;
+  
     
         
     &lt;filter&gt;
         &lt;filter-name&gt;OpenSessionInView&lt;/filter-name&gt;
-        &lt;filter-class&gt;org.agnitas.dao.impl.OpenSessionInViewFilter&lt;/filter-class&gt;
+        &lt;filter-class&gt;org.agnitas.web.filter.OpenSessionInViewFilter&lt;/filter-class&gt;
     &lt;/filter&gt;
     
     &lt;filter-mapping&gt;
@@ -225,6 +252,12 @@
         &lt;taglib-location&gt;/WEB-INF/struts-logic.tld&lt;/taglib-location&gt;
     &lt;/taglib&gt;
 
+	&lt;!-- ajax-anywhere --&gt;
+	 &lt;taglib&gt;
+        &lt;taglib-uri&gt;/WEB-INF/ajaxanywhere.tld&lt;/taglib-uri&gt;
+        &lt;taglib-location&gt;/WEB-INF/ajaxanywhere.tld&lt;/taglib-location&gt;
+    &lt;/taglib&gt;
+
     &lt;mime-mapping&gt;
         &lt;extension&gt;xsd&lt;/extension&gt;
         &lt;mime-type&gt;text/xml&lt;/mime-type&gt;</diff>
      <filename>src/jsp/WEB-INF/web.xml</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*&quot; %&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.web.forms.*&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
@@ -29,7 +29,7 @@
 
 &lt;agn:Permission token=&quot;actions.delete&quot;/&gt;
 
-&lt;% 
+&lt;%
 int tmpActionID=0;
 String tmpShortname=new String(&quot;&quot;);
 </diff>
      <filename>src/jsp/actions/delete.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.beans.*, java.util.*&quot; %&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.beans.*, java.util.*, org.agnitas.web.forms.*&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
@@ -42,11 +42,12 @@
 
 &lt;%@include file=&quot;/header.jsp&quot;%&gt;
 
-&lt;% 	EmmActionForm aForm = null;
+&lt;%
+	EmmActionForm aForm = null;
 	if(session.getAttribute(&quot;emmActionForm&quot;)!=null) {
 		aForm = (EmmActionForm) session.getAttribute(&quot;emmActionForm&quot;);
-	}	
- %&gt;
+	}
+%&gt;
 
               &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; width=&quot;100%&quot;&gt;
                 &lt;tr&gt;</diff>
      <filename>src/jsp/actions/list.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.actions.*, java.util.*, org.springframework.web.context.support.*&quot; %&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.actions.*, java.util.*, org.springframework.web.context.support.*, org.agnitas.web.forms.*&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
@@ -29,15 +29,15 @@
 
 &lt;agn:Permission token=&quot;actions.change&quot;/&gt;	 
 
-&lt;% 
-int tmpActionID=0;
-String tmpShortname=new String(&quot;&quot;);
+&lt;%
+	 int tmpActionID=0;
+	 String tmpShortname=new String(&quot;&quot;);
 
-if(session.getAttribute(&quot;emmActionForm&quot;)!=null) {
-    tmpActionID=((EmmActionForm)session.getAttribute(&quot;emmActionForm&quot;)).getActionID();
-    tmpShortname=((EmmActionForm)session.getAttribute(&quot;emmActionForm&quot;)).getShortname();
-}
-%&gt;
+	 if(session.getAttribute(&quot;emmActionForm&quot;)!=null) {
+	     tmpActionID=((EmmActionForm)session.getAttribute(&quot;emmActionForm&quot;)).getActionID();
+	     tmpShortname=((EmmActionForm)session.getAttribute(&quot;emmActionForm&quot;)).getShortname();
+	 }
+	 %&gt;
 
 &lt;% pageContext.setAttribute(&quot;sidemenu_active&quot;, new String(&quot;Actions&quot;)); %&gt;
 &lt;% pageContext.setAttribute(&quot;sidemenu_sub_active&quot;, new String(&quot;New_Action&quot;)); %&gt;</diff>
      <filename>src/jsp/actions/view.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.beans.*&quot; %&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.web.forms.*, org.agnitas.beans.*&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
@@ -31,9 +31,9 @@
 
 &lt;% int tmpCampaignID=0;
    String tmpShortname=new String(&quot;&quot;);
-   if(session.getAttribute(&quot;campaignForm&quot;)!=null) {
-      tmpCampaignID=((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getCampaignID();
-      tmpShortname=((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getShortname();
+   if(request.getAttribute(&quot;campaignForm&quot;)!=null) {
+      tmpCampaignID=((CampaignForm)request.getAttribute(&quot;campaignForm&quot;)).getCampaignID();    
+      tmpShortname=((CampaignForm)request.getAttribute(&quot;campaignForm&quot;)).getShortname();
    }
 %&gt;
 </diff>
      <filename>src/jsp/campaign/delete.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.beans.*&quot; %&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.web.forms.*, org.agnitas.beans.*&quot; %&gt;
  &lt;%@page import=&quot;org.apache.commons.beanutils.DynaBean&quot;%&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
@@ -47,13 +47,9 @@
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-logic.tld&quot; prefix=&quot;logic&quot; %&gt;
 &lt;%@ taglib uri=&quot;http://ajaxtags.org/tags/ajax&quot; prefix=&quot;ajax&quot; %&gt;
 
-
 &lt;%@include file=&quot;/header.jsp&quot;%&gt;
 &lt;html:errors/&gt;
-
-  
       &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
-        
         &lt;tr&gt;
         	&lt;td&gt;
         	&lt;html:form action=&quot;/campaign&quot;&gt;
@@ -62,16 +58,11 @@
 				&lt;td&gt;&lt;bean:message key=&quot;Admin.numberofrows&quot;/&gt;&lt;/td&gt; 
 				&lt;td&gt;									
 					&lt;html:select property=&quot;numberofRows&quot;&gt;
-                		&lt;%
-                			String[] sizes={&quot;20&quot;,&quot;50&quot;,&quot;100&quot;};
+                		&lt;%	String[] sizes={&quot;20&quot;,&quot;50&quot;,&quot;100&quot;};
                 			for( int i=0;i&lt; sizes.length; i++ )
-                			{
-                					 %&gt;
+                			{ %&gt;
                 				&lt;html:option value=&quot;&lt;%= sizes[i] %&gt;&quot;&gt;&lt;%= sizes[i] %&gt;&lt;/html:option&gt;	
-                			&lt;%
-                			}                			
-                			%&gt;		 
-                					 
+              			&lt;%  } %&gt;		 
                 	&lt;/html:select&gt;
 				&lt;/td&gt;
         	&lt;/tr&gt;
@@ -85,7 +76,7 @@
         	&lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr&gt;&lt;td&gt;
-         &lt;ajax:displayTag id=&quot;campaignTable&quot; ajaxFlag=&quot;displayAjax&quot; tableClass=&quot;dataTable&quot; &gt;
+         &lt;ajax:displayTag id=&quot;campaignTable&quot; ajaxFlag=&quot;displayAjax&quot;&gt;
          	&lt;display:table class=&quot;dataTable&quot;  id=&quot;campaign&quot; name=&quot;campaignlist&quot; pagesize=&quot;${campaignForm.numberofRows}&quot;  requestURI=&quot;/campaign.do?action=${ACTION_LIST}&quot; excludedParams=&quot;*&quot; sort=&quot;external&quot;&gt;
          		&lt;display:column headerClass=&quot;head_name&quot; class=&quot;name&quot; titleKey=&quot;Campaign&quot;  maxLength=&quot;20&quot; property=&quot;shortname&quot; sortable=&quot;true&quot; paramId=&quot;campaignID&quot; paramProperty=&quot;campaignId&quot;  url=&quot;/campaign.do?action=${ACTION_VIEW}&quot; /&gt;
          	    &lt;display:column headerClass=&quot;head_description&quot; class=&quot;description&quot; titleKey=&quot;Description&quot;  maxLength=&quot;20&quot; property=&quot;description&quot; sortable=&quot;true&quot; paramId=&quot;campaignID&quot; paramProperty=&quot;campaignId&quot;  url=&quot;/campaign.do?action=${ACTION_VIEW}&quot; /&gt;
@@ -96,12 +87,9 @@
                     &lt;agn:ShowByPermission token=&quot;campaign.change&quot;&gt;
                         &lt;html:link page=&quot;/campaign.do?action=${ACTION_VIEW}&amp;campaignID=${campaign.campaignId}&quot;&gt;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;bearbeiten.gif&quot; alt=&quot;&lt;bean:message key=&quot;Edit&quot;/&gt;&quot; border=&quot;0&quot;&gt;&lt;/html:link&gt;
                     &lt;/agn:ShowByPermission&gt;
-         		
          		&lt;/display:column&gt;
          	&lt;/display:table&gt;
          &lt;/ajax:displayTag&gt;
         &lt;/td&gt;&lt;/tr&gt;
-   
       &lt;/table&gt;
- 
-&lt;%@include file=&quot;/footer.jsp&quot;%&gt;
+&lt;%@include file=&quot;/footer.jsp&quot;%&gt;
\ No newline at end of file</diff>
      <filename>src/jsp/campaign/list.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,11 +20,15 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*,java.util.*&quot;%&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.web.forms.*, java.util.*&quot;%&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-logic.tld&quot; prefix=&quot;logic&quot; %&gt;
+&lt;%@ taglib uri=&quot;/WEB-INF/ajaxanywhere.tld&quot; prefix=&quot;aa&quot; %&gt;
+
+
+
 
 &lt;agn:CheckLogon/&gt;
 
@@ -32,33 +36,80 @@
 
 &lt;% int tmpCampaignID=0;
    String tmpShortname=new String(&quot;&quot;);
-   if(session.getAttribute(&quot;campaignForm&quot;)!=null) {
-      tmpCampaignID=((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getCampaignID();
-      tmpShortname=((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getShortname();
-   }
-%&gt;
+	  
+	if(session.getAttribute(&quot;campaignForm&quot;)!=null) {
+		CampaignForm campaignForm = (CampaignForm) session.getAttribute(&quot;campaignForm&quot;);	
+		tmpCampaignID = campaignForm.getCampaignID();
+		tmpShortname = campaignForm.getShortname();
+		campaignForm.setAction(CampaignAction.ACTION_STAT);
+		
+
+//      tmpCampaignID=((CampaignForm)request.getAttribute(&quot;campaignForm&quot;)).getCampaignID();
+//      tmpShortname=((CampaignForm)request.getAttribute(&quot;campaignForm&quot;)).getShortname();     
+//      tmpIsReady=((CampaignForm)request.getAttribute(&quot;campaignForm&quot;)).isStatReady();
+}
 
-&lt;%
  pageContext.setAttribute(&quot;agnSubtitleKey&quot;, new String(&quot;Campaign&quot;)); 
  pageContext.setAttribute(&quot;agnSubtitleValue&quot;, tmpShortname); 
  pageContext.setAttribute(&quot;agnNavigationKey&quot;, new String(&quot;Campaign&quot;));
  pageContext.setAttribute(&quot;agnHighlightKey&quot;, new String(&quot;Campaign&quot;));
  pageContext.setAttribute(&quot;sidemenu_sub_active&quot;, new String(&quot;NewCampaign&quot;)); 
-  %&gt;
 
-&lt;% pageContext.setAttribute(&quot;sidemenu_active&quot;, new String(&quot;Campaigns&quot;)); %&gt;
 
-&lt;% pageContext.setAttribute(&quot;agnTitleKey&quot;, new String(&quot;Campaigns&quot;)); %&gt;
-&lt;% pageContext.setAttribute(&quot;agnNavHrefAppend&quot;, new String(&quot;&amp;campaignID=&quot;+tmpCampaignID)); %&gt;
-&lt;% pageContext.setAttribute(&quot;agnRefresh&quot;, new String(&quot;2&quot;)); %&gt;
+ pageContext.setAttribute(&quot;sidemenu_active&quot;, new String(&quot;Campaigns&quot;)); 
+
+ pageContext.setAttribute(&quot;agnTitleKey&quot;, new String(&quot;Campaigns&quot;)); 
+ pageContext.setAttribute(&quot;agnNavHrefAppend&quot;, new String(&quot;&amp;campaignID=&quot;+tmpCampaignID)); 
+ %&gt;
+&lt;%-- pageContext.setAttribute(&quot;agnRefresh&quot;, new String(&quot;2&quot;)); --%&gt;
+
+
 
 &lt;%@include file=&quot;/header.jsp&quot;%&gt;
 
-&lt;html:errors/&gt;
+&lt;!--  The following part is for reloading the page and as soon as possible move
+on to the Result-Page of the Database request. --&gt;
+&lt;script&gt;	
+	/* calls the submit-procedure */
+    function go() {
+        document.getElementsByName('campaignForm')[0].submit();
+    }
+
+	/* this method returns the zones which shall be reloaded. */
+    ajaxAnywhere.getZonesToReload = function () {
+        return &quot;loading&quot;
+    };
 
-  &lt;html:form action=&quot;/campaign.do&quot;&gt;
+	/* this method is our starting-point */
+    ajaxAnywhere.onAfterResponseProcessing = function () {	       	
+		if(! ${campaignForm.error } ) {		
+    		window.setTimeout(&quot;go();&quot;, ${campaignForm.refreshMillis});
+    	} else {
+    		System.err.println(&quot;Fehler: &quot; + campaignForm.error);
+    	}   		
+    }
+    
+    /* We do not have any loading message */
+    ajaxAnywhere.showLoadingMessage = function(){};
+
+	/* call it.*/
+	ajaxAnywhere.onAfterResponseProcessing();  
+&lt;/script&gt;
+
+&lt;aa:zone name=&quot;loading&quot; &gt;	&lt;!-- all within these tags will be reloaded, nothing more --&gt;
+&lt;html:errors/&gt;
+  &lt;html:form action=&quot;/campaign&quot;&gt;
     &lt;html:hidden property=&quot;action&quot;/&gt;
     &lt;html:hidden property=&quot;campaignID&quot;/&gt;
+    &lt;html:hidden property=&quot;error&quot;/&gt;
+
+&lt;% 
+// CampaignForm campaignForm = null;
+// if ((CampaignForm)session.getAttribute(&quot;campaignForm&quot;) != null) {
+// 	campaignForm=(CampaignForm)session.getAttribute(&quot;campaignForm&quot;);		
+//	campaignForm.setAction(CampaignAction.ACTION_STAT);
+// } 
+%&gt;
 
         &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; width=&quot;400&quot;&gt;
             &lt;tr&gt;
@@ -67,7 +118,7 @@
                 &lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
-                &lt;td&gt;
+                &lt;td&gt;                	
                     &lt;img border=&quot;0&quot; width=&quot;44&quot; height=&quot;48&quot; src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;wait.gif&quot;/&gt;
                 &lt;/td&gt;
             &lt;/tr&gt;
@@ -80,16 +131,16 @@
                 &lt;td&gt;
                     &lt;b&gt;&lt;bean:message key=&quot;StatSplashMessage&quot;/&gt;&lt;b&gt;
                 &lt;/td&gt;
-            &lt;/tr&gt;
-            &lt;tr&gt;
+            &lt;/tr&gt;           
+            &lt;tr&gt; 
                 &lt;td&gt;
                     &lt;b&gt;&amp;nbsp;&lt;b&gt;
-                &lt;/td&gt;
+                &lt;/td&gt; 
             &lt;/tr&gt;
 
         &lt;/table&gt;
 
   &lt;/html:form&gt;
-                        
+&lt;/aa:zone&gt;      
                      
 &lt;%@include file=&quot;/footer.jsp&quot;%&gt;</diff>
      <filename>src/jsp/campaign/splash.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.beans.*, org.agnitas.stat.*, java.util.*, org.springframework.context.*, org.springframework.web.context.support.WebApplicationContextUtils&quot; %&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.web.forms.*, org.agnitas.beans.*, org.agnitas.stat.*, java.util.*, org.springframework.context.*, org.springframework.web.context.support.WebApplicationContextUtils&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
@@ -32,10 +32,10 @@
 
 &lt;% int tmpCampaignID=0;
    String tmpShortname=new String(&quot;&quot;);
-   int tmpTargetID=0;
+   int tmpTargetID=0;   
    if(session.getAttribute(&quot;campaignForm&quot;)!=null) {
       tmpCampaignID=((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getCampaignID();
-      tmpShortname=((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getShortname();
+      tmpShortname=((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getShortname();      
       // tmpTargetID=((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getTargetID();
    }
    String file = &quot;&quot;;
@@ -57,25 +57,37 @@
  pageContext.setAttribute(&quot;agnTitleKey&quot;, new String(&quot;Campaigns&quot;));
  pageContext.setAttribute(&quot;agnNavHrefAppend&quot;, new String(&quot;&amp;campaignID=&quot;+tmpCampaignID));
 
-      // csv download stuff:
+
+	  // csv download stuff: 
+		  
       org.agnitas.util.EmmCalendar my_calendar = new EmmCalendar(java.util.TimeZone.getDefault());
       TimeZone zone=TimeZone.getTimeZone(((Admin)session.getAttribute(&quot;emm.admin&quot;)).getAdminTimezone());
 
       my_calendar.changeTimeWithZone(zone);
       java.util.Date my_time = my_calendar.getTime();
       String Datum = my_time.toString();
+
       timekey = Long.toString(my_time.getTime());
       pageContext.setAttribute(&quot;time_key&quot;, timekey);
       my_map = null;
-      if(pageContext.getSession().getAttribute(&quot;map&quot;) == null)
+      
+      if(pageContext.getSession().getAttribute(&quot;map&quot;) == null)	// original line
       {
           my_map = new java.util.Hashtable();
           pageContext.getSession().setAttribute(&quot;map&quot;,my_map);
+          // pageContext.setAttribute(&quot;map&quot;,my_map);
       } else {
+          // my_map = (java.util.Hashtable)(pageContext.getAttribute(&quot;map&quot;));
           my_map = (java.util.Hashtable)(pageContext.getSession().getAttribute(&quot;map&quot;));
       }
 
       file = ((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getCsvfile();
+      
+//    put csv file in pagecontext:	
+     // my_map.put(timekey,  file);
+      // pageContext.setAttribute(&quot;map&quot;, my_map);
+      //request.setAttribute(&quot;map&quot;, my_map);     
+
 } %&gt;
 
 &lt;%  pageContext.setAttribute(&quot;sidemenu_active&quot;, new String(&quot;Campaigns&quot;)); %&gt;
@@ -100,7 +112,8 @@
                 &lt;html:select property=&quot;targetID&quot;&gt;
                    &lt;html:option value=&quot;0&quot;&gt;&lt;bean:message key=&quot;All_Subscribers&quot;/&gt;&lt;/html:option&gt;
                      &lt;agn:ShowTable id=&quot;agntbl3&quot; sqlStatement=&quot;&lt;%= new String(&quot;SELECT target_id, target_shortname FROM dyn_target_tbl WHERE company_id=&quot;+AgnUtils.getCompanyID(request)) %&gt;&quot; maxRows=&quot;500&quot;&gt;
-                   		&lt;html:option value=&quot;&lt;%= (String)(pageContext.getAttribute(&quot;_agntbl3_target_id&quot;)) %&gt;&quot;&gt;&lt;%= pageContext.getAttribute(&quot;_agntbl3_target_shortname&quot;) %&gt;&lt;/html:option&gt;
+						&lt;html:option value=&quot;&lt;%= (String)(session.getAttribute(&quot;_agntbl3_target_id&quot;)) %&gt;&quot;&gt;&lt;%= session.getAttribute(&quot;_agntbl3_target_shortname&quot;) %&gt;&lt;/html:option&gt;
+                 
                      &lt;/agn:ShowTable&gt;
                 &lt;/html:select&gt;&lt;br&gt;&lt;br&gt;
             &lt;/td&gt;
@@ -123,13 +136,13 @@
 &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
 
     &lt;tr&gt;&lt;td colspan=&quot;11&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
-&lt;%
-    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Mailing&quot;, (Locale)session.getAttribute(&quot;messages_lang&quot;)) + &quot;\&quot;;&quot;;
-    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Opened_Mails&quot;, (Locale)session.getAttribute(&quot;messages_lang&quot;)) + &quot;\&quot;;&quot;;
-    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Opt_Outs&quot;, (Locale)session.getAttribute(&quot;messages_lang&quot;)) + &quot;\&quot;;&quot;;
-    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Bounces&quot;, (Locale)session.getAttribute(&quot;messages_lang&quot;)) + &quot;\&quot;;&quot;;
-    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Recipients&quot;, (Locale)session.getAttribute(&quot;messages_lang&quot;)) + &quot;\&quot;;&quot;;
-    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Clicks&quot;, (Locale)session.getAttribute(&quot;messages_lang&quot;)) + &quot;\&quot;&quot;;
+&lt;% 
+    file = &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Mailing&quot;, (Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)) + &quot;\&quot;;&quot;;
+    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Opened_Mails&quot;, (Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)) + &quot;\&quot;;&quot;;
+    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Opt_Outs&quot;, (Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)) + &quot;\&quot;;&quot;;
+    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Bounces&quot;, (Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)) + &quot;\&quot;;&quot;;
+    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Recipients&quot;, (Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)) + &quot;\&quot;;&quot;;
+    file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Clicks&quot;, (Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)) + &quot;\&quot;&quot;;
     file += &quot;\r\n&quot;;
 %&gt;
 
@@ -149,18 +162,24 @@
 
     &lt;tr&gt;&lt;td colspan=&quot;11&quot;&gt;&lt;hr&gt;&lt;/td&gt;&lt;/tr&gt;
 
-&lt;%  Hashtable mailingData = ((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getMailingData();
+&lt;%  CampaignForm aForm = (CampaignForm)session.getAttribute(&quot;campaignForm&quot;);
+	// Hashtable mailingData = ((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getMailingData();
+	Hashtable mailingData = aForm.getMailingData();
     if(mailingData == null) {
         mailingData=new Hashtable();
     }
-    Enumeration keys = mailingData.keys();
+    // Enumeration keys = mailingData.keys();
+    Iterator&lt;Number&gt; keys = aForm.getSortedKeys().iterator();
     ApplicationContext aContext=WebApplicationContextUtils.getWebApplicationContext(application);
-    CampaignStatEntry aktEntry = (CampaignStatEntry) aContext.getBean(&quot;CampaignStatEntry&quot;);
+    // CampaignStatEntry aktEntry = (CampaignStatEntry) aContext.getBean(&quot;CampaignStatEntry&quot;);
+    CampaignStatEntry aktEntry = null;
+    
     int aktKey = 0;
 
-    while(keys.hasMoreElements()) {
-        aktKey = ((Number)(keys.nextElement())).intValue();
+    while(keys.hasNext()) {
+        aktKey = (keys.next()).intValue();
         aktEntry = (CampaignStatEntry)(mailingData.get(new Integer(aktKey)));
+        
 %&gt;
     &lt;tr&gt;
         &lt;td&gt;&lt;html:link page=&quot;&lt;%= new String(&quot;/mailing_stat.do?action=&quot; + MailingStatAction.ACTION_MAILINGSTAT + &quot;&amp;mailingID=&quot; + aktKey) %&gt;&quot;&gt;&lt;b&gt;&lt;nobr&gt;&lt;% if(aktEntry.getShortname().length() &gt; 25) { %&gt;&lt;%= aktEntry.getShortname().substring(0,24) %&gt;&lt;% } else { %&gt;&lt;%= aktEntry.getShortname() %&gt;&lt;% } %&gt;&amp;nbsp;&lt;/nobr&gt;&lt;/b&gt;&lt;/html:link&gt;&lt;/td&gt;
@@ -197,7 +216,7 @@
 
     &lt;tr&gt;
         &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;Total&quot;/&gt;&lt;/b&gt;&lt;/td&gt;
-        &lt;% file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Total&quot;, (Locale)session.getAttribute(&quot;messages_lang&quot;)) + &quot;\&quot;;&quot;; %&gt;
+        &lt;% file += &quot;\&quot;&quot; + SafeString.getLocaleString(&quot;Total&quot;, (Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)) + &quot;\&quot;;&quot;; %&gt;
         &lt;td background=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;border_06.gif&quot;&gt;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;one_pixel.gif&quot; width=&quot;10&quot; height=&quot;10&quot; border=&quot;0&quot;&gt;&lt;/td&gt;
         &lt;td align=&quot;right&quot;&gt;
             &lt;b&gt;&lt;%= ((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getOpened() %&gt;&amp;nbsp;&lt;/b&gt;
@@ -236,9 +255,10 @@
 &lt;/table&gt;
 &lt;% } %&gt;
 
-&lt;%   // put csv file in session:
+&lt;%   // put csv file in request-Context.
      my_map.put(timekey,  file);
      pageContext.getSession().setAttribute(&quot;map&quot;, my_map);
+     // pageContext.getSession().setAttribute(&quot;map&quot;, timekey);    
 %&gt;
 
   &lt;/html:form&gt;</diff>
      <filename>src/jsp/campaign/stat.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.beans.*, java.text.*, java.util.*&quot; %&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.forms.*, org.agnitas.web.*, org.agnitas.beans.*, java.text.*, java.util.*&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
@@ -30,15 +30,15 @@
 
 &lt;agn:Permission token=&quot;campaign.show&quot;/&gt; 
 
-&lt;% int tmpCampaignID=0;
-   String tmpShortname=new String(&quot;&quot;);
-   if(session.getAttribute(&quot;campaignForm&quot;)!=null) {
-      tmpCampaignID=((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getCampaignID();
-      tmpShortname=((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getShortname();
-   }
-%&gt;
+&lt;%  int tmpCampaignID = 0;
+    String tmpShortname = new String(&quot;&quot;);
+    if(session.getAttribute(&quot;campaignForm&quot;)!=null) {
+       tmpCampaignID = ((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getCampaignID();
+       tmpShortname = ((CampaignForm)session.getAttribute(&quot;campaignForm&quot;)).getShortname();
+    }
+ %&gt;
 
-&lt;% if(tmpCampaignID!=0) {
+&lt;% if(tmpCampaignID != 0) {
  pageContext.setAttribute(&quot;agnSubtitleKey&quot;, new String(&quot;Campaign&quot;)); 
  pageContext.setAttribute(&quot;agnSubtitleValue&quot;, tmpShortname); 
  pageContext.setAttribute(&quot;agnNavigationKey&quot;, new String(&quot;Campaign&quot;));
@@ -47,28 +47,25 @@
  pageContext.setAttribute(&quot;agnSubtitleKey&quot;, new String(&quot;NewCampaign&quot;));
  pageContext.setAttribute(&quot;agnNavigationKey&quot;, new String(&quot;CampaignNew&quot;)); 
  pageContext.setAttribute(&quot;agnHighlightKey&quot;, new String(&quot;NewCampaign&quot;));
-}pageContext.setAttribute(&quot;sidemenu_sub_active&quot;, new String(&quot;NewCampaign&quot;)); 
+}
+pageContext.setAttribute(&quot;sidemenu_sub_active&quot;, new String(&quot;NewCampaign&quot;)); 
   %&gt;
 
 &lt;% pageContext.setAttribute(&quot;sidemenu_active&quot;, new String(&quot;Campaigns&quot;)); %&gt;
-
 &lt;% pageContext.setAttribute(&quot;agnTitleKey&quot;, new String(&quot;Campaigns&quot;)); %&gt;
-&lt;% pageContext.setAttribute(&quot;agnNavHrefAppend&quot;, new String(&quot;&amp;campaignID=&quot;+tmpCampaignID)); %&gt;
+&lt;% pageContext.setAttribute(&quot;agnNavHrefAppend&quot;, new String(&quot;&amp;campaignID=&quot; + tmpCampaignID)); %&gt;
 
 &lt;% SimpleDateFormat parsedate=new SimpleDateFormat(&quot;yyyyMMdd&quot;);
-   DateFormat showdate=DateFormat.getDateInstance(DateFormat.MEDIUM, (Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY));
-   String aDate=new String(&quot;&quot;);
-   Date tmpDate=null;
+   DateFormat showdate = DateFormat.getDateInstance(DateFormat.MEDIUM, (Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY));
+   String aDate = new String(&quot;&quot;);
+   Date tmpDate = null;
 %&gt;
 
 &lt;%@include file=&quot;/header.jsp&quot;%&gt;
 &lt;html:errors/&gt;
-
   &lt;html:form action=&quot;/campaign.do&quot;&gt;
     &lt;html:hidden property=&quot;action&quot;/&gt;
     &lt;html:hidden property=&quot;campaignID&quot;/&gt;
-
-
     &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
         &lt;tr&gt; 
           &lt;td&gt;&lt;bean:message key=&quot;Name&quot;/&gt;:&amp;nbsp;&lt;/td&gt;
@@ -76,53 +73,38 @@
             &lt;html:text property=&quot;shortname&quot; maxlength=&quot;99&quot; size=&quot;42&quot;/&gt;
           &lt;/td&gt;
         &lt;/tr&gt;
-
         &lt;tr&gt; 
           &lt;td&gt;&lt;bean:message key=&quot;Description_opt&quot;/&gt;:&amp;nbsp;&lt;/td&gt;
           &lt;td&gt; 
             &lt;html:textarea property=&quot;description&quot; rows=&quot;5&quot; cols=&quot;32&quot;/&gt;
           &lt;/td&gt;
         &lt;/tr&gt;
-
         &lt;tr&gt;
             &lt;td colspan=2&gt;&amp;nbsp;&lt;/td&gt;
         &lt;/tr&gt;
-
         &lt;tr&gt;
             &lt;td colspan=2&gt;
-
               &lt;agn:ShowByPermission token=&quot;campaign.change&quot;&gt;  
                   &lt;html:image src=&quot;button?msg=Save&quot; border=&quot;0&quot; property=&quot;save&quot; value=&quot;save&quot;/&gt;&amp;nbsp;
               &lt;/agn:ShowByPermission&gt;
-    
               &lt;logic:notEqual name=&quot;campaignForm&quot; property=&quot;campaignID&quot; value=&quot;0&quot;&gt;
                   &lt;agn:ShowByPermission token=&quot;campaign.delete&quot;&gt;    
-                      &lt;html:link page=&quot;&lt;%= new String(&quot;/campaign.do?action=&quot; + CampaignAction.ACTION_CONFIRM_DELETE) %&gt;&quot;&gt;&lt;html:img src=&quot;button?msg=Delete&quot; border=&quot;0&quot;/&gt;&lt;/html:link&gt;    
+                      &lt;html:link page=&quot;&lt;%= new String(&quot;/campaign.do?action=&quot; + CampaignAction.ACTION_CONFIRM_DELETE + &quot;&amp;campaignID=&quot; + tmpCampaignID ) %&gt;&quot;&gt;&lt;html:img src=&quot;button?msg=Delete&quot; border=&quot;0&quot;/&gt;&lt;/html:link&gt;    
                   &lt;/agn:ShowByPermission&gt;
               &lt;/logic:notEqual&gt;
-              
-
             &lt;/td&gt;
         &lt;/tr&gt;
-
     &lt;/table&gt;
-    
-   
-    
-&lt;% if(tmpCampaignID!=0) { %&gt;
 
+&lt;% if(tmpCampaignID != 0) { %&gt;
     &lt;br&gt;&lt;br&gt;
-
     &lt;span class=&quot;head3&quot;&gt;&lt;bean:message key=&quot;Mailings&quot;/&gt;:&lt;/span&gt;
-                               &lt;!-- MailingBaseAction.ACTION_VIEW --&gt;
+        &lt;!-- MailingBaseAction.ACTION_VIEW --&gt;
       &lt;agn:ShowByPermission token=&quot;mailing.new&quot;&gt;
-      	&lt;br&gt;&lt;br&gt;&lt;html:link page=&quot;&lt;%= new String(&quot;/mailingbase.do?action=&quot; + MailingBaseAction.ACTION_NEW+&quot;&amp;mailingID=0&amp;campaignID=&quot;+tmpCampaignID) %&gt;&quot;&gt;&lt;bean:message key=&quot;New_Mailing&quot;/&gt;...&lt;/html:link&gt;
+      	&lt;br&gt;&lt;br&gt;&lt;html:link page=&quot;&lt;%= new String(&quot;/mailingbase.do?action=&quot; + MailingBaseAction.ACTION_NEW + &quot;&amp;mailingID=0&amp;campaignID=&quot; + tmpCampaignID) %&gt;&quot;&gt;&lt;bean:message key=&quot;New_Mailing&quot;/&gt;...&lt;/html:link&gt;
       &lt;/agn:ShowByPermission&gt;
       &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
-      
-
         &lt;tr&gt;&lt;td colspan=&quot;4&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
-
         &lt;tr&gt;
             &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;Mailing&quot;/&gt;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
             &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;Description&quot;/&gt;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
@@ -132,18 +114,16 @@
         &lt;/tr&gt;
         &lt;tr&gt;&lt;td colspan=&quot;5&quot;&gt;&lt;hr&gt;&lt;/td&gt;&lt;/tr&gt;
         &lt;% int rows = 0; %&gt;
-        
-        
         &lt;agn:ShowTable id=&quot;agnTbl&quot; sqlStatement=&quot;&lt;%= new String(&quot;SELECT a.mailing_id, a.shortname, a.description, b.shortname AS listname, (SELECT &quot;+AgnUtils.sqlDateString(&quot;min(c.&quot;+AgnUtils.changeDateName()+&quot;)&quot;, &quot;yyyymmdd&quot;)+&quot; FROM mailing_account_tbl c WHERE a.mailing_id=c.mailing_id AND c.status_field='W') AS senddate FROM mailing_tbl a, mailinglist_tbl b WHERE a.company_id=&quot;+AgnUtils.getCompanyID(request)+ &quot; AND a.campaign_id=&quot; + tmpCampaignID + &quot; AND a.deleted&lt;&gt;1 AND a.is_template=0 AND a.mailinglist_id=b.mailinglist_id ORDER BY senddate DESC, mailing_id DESC&quot;)%&gt;&quot; startOffset=&quot;&lt;%= request.getParameter(&quot;startWith&quot;) %&gt;&quot; maxRows=&quot;50&quot; encodeHtml=&quot;0&quot;&gt;
             &lt;tr&gt; &lt;!-- MailingBaseAction.ACTION_VIEW --&gt;
                 &lt;td&gt;&lt;html:link page=&quot;&lt;%= new String(&quot;/mailingbase.do?action=&quot; + MailingBaseAction.ACTION_VIEW + &quot;&amp;mailingID=&quot; + pageContext.getAttribute(&quot;_agnTbl_mailing_id&quot;)) %&gt;&quot;&gt;&lt;b&gt;&lt;%= pageContext.getAttribute(&quot;_agnTbl_shortname&quot;) %&gt;&lt;/b&gt;&lt;/html:link&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
                 &lt;td&gt;&lt;html:link page=&quot;&lt;%= new String(&quot;/mailingbase.do?action=&quot; + MailingBaseAction.ACTION_VIEW + &quot;&amp;mailingID=&quot; + pageContext.getAttribute(&quot;_agnTbl_mailing_id&quot;)) %&gt;&quot;&gt;&lt;%= SafeString.cutLength((String)pageContext.getAttribute(&quot;_agnTbl_description&quot;), 40) %&gt;&lt;/html:link&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
                 &lt;td&gt;&lt;%= pageContext.getAttribute(&quot;_agnTbl_listname&quot;) %&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
                         &lt;% try{
-                             tmpDate=parsedate.parse((String)pageContext.getAttribute(&quot;_agnTbl_senddate&quot;));
-                             aDate=showdate.format(tmpDate);
+                             tmpDate = parsedate.parse((String)pageContext.getAttribute(&quot;_agnTbl_senddate&quot;));
+                             aDate = showdate.format(tmpDate);
                             } catch (Exception e) {
-                                 aDate=new String(&quot;&quot;);
+                                 aDate = new String(&quot;&quot;);
                             }
                         %&gt;
                 &lt;td&gt;&lt;%= aDate %&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
@@ -156,7 +136,7 @@
             &lt;/tr&gt;
             &lt;% rows++; %&gt;
         &lt;/agn:ShowTable&gt;
-        &lt;% if(rows==0) { %&gt;
+        &lt;% if(rows == 0) { %&gt;
         &lt;tr&gt;&lt;td colspan=&quot;5&quot;&gt;&lt;b&gt;&lt;bean:message key=&quot;NoMailingsInCampaign&quot;/&gt;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
         &lt;% } %&gt;
 
@@ -176,9 +156,5 @@
 
       &lt;/table&gt;
 &lt;% } %&gt;
-
-
-
-
   &lt;/html:form&gt;
-&lt;%@include file=&quot;/footer.jsp&quot;%&gt;
+&lt;%@include file=&quot;/footer.jsp&quot;%&gt;
\ No newline at end of file</diff>
      <filename>src/jsp/campaign/view.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
  --%&gt;&lt;%@ page language=&quot;java&quot; import=&quot;org.agnitas.util.*, java.util.*, org.agnitas.web.*&quot; contentType=&quot;text/javascript; charset=utf-8&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
 
-&lt;% int tmpMailingID=Integer.parseInt(request.getParameter(&quot;mailingID&quot;)); %&gt;
+&lt;% int tmpMailingID=Integer.parseInt(request.getParameter(&quot;mailingID&quot;));%&gt;
 
 /*
  * FCKeditor - The text editor for internet
@@ -43,7 +43,6 @@
  * 		Frederico Caldeira Knabben (fredck@fckeditor.net)
  */
 
-
 FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
 
 FCKConfig.DocType = '&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;' ;
@@ -153,7 +152,7 @@ FCKConfig.LinkUploadAllowedExtensions	= &quot;&quot; ;			// empty for all
 FCKConfig.LinkUploadDeniedExtensions	= &quot;.(php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi)$&quot; ;	// empty for no one
 
 FCKConfig.ImageUpload = true ;
-FCKConfig.ImageUploadURL = '&lt;html:rewrite page=&quot;&lt;%= &quot;/mcomponents.do?action=12&amp;mailingID=&quot;+tmpMailingID %&gt;&quot;/&gt;' ;
+FCKConfig.ImageUploadURL = '&lt;html:rewrite page=&quot;&lt;%= &quot;/mcomponents.do?action=&quot;+ MailingComponentsAction.ACTION_SAVE_COMPONENTS + &quot;&amp;mailingID=&quot;+tmpMailingID %&gt;&quot;/&gt;' ;
 // PHP // FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/php/upload.php?Type=Image' ;
 FCKConfig.ImageUploadAllowedExtensions	= &quot;.(jpg|gif|jpeg|png)$&quot; ;		// empty for all
 FCKConfig.ImageUploadDeniedExtensions	= &quot;&quot; ;							// empty for no one
@@ -169,6 +168,9 @@ FCKConfig.SmileyImages	= ['regular_smile.gif','sad_smile.gif','wink_smile.gif','
 FCKConfig.SmileyColumns = 8 ;
 FCKConfig.SmileyWindowWidth		= 320 ;
 FCKConfig.SmileyWindowHeight	= 240 ;
-FCKConfig.ProtectedSource.Add(/&lt;img[\s\S]*?&gt;/gi); 
+FCKConfig.ProtectedSource.Add( /&lt;img[^&gt;]*src=&quot;\[agn[^&gt;]*&gt;/gi  ); 
+
+
+
 
 if( window.console ) window.console.log( 'Config is loaded!' ) ;	// @Packager.Compactor.RemoveLine
\ No newline at end of file</diff>
      <filename>src/jsp/fckeditor2.5/emmconfig.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -51,6 +51,7 @@
 &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;%=request.getContextPath()%&gt;/js/ajax/ajaxtags.js&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;%=request.getContextPath()%&gt;/js/ajax/ajaxtags_controls.js&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;%=request.getContextPath()%&gt;/js/ajax/ajaxtags_parser.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;%=request.getContextPath()%&gt;/js/aa.js&quot;&gt;&lt;/script&gt;
   &lt;body&gt;
     &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; height=&quot;100%&quot; width=&quot;100%&quot;&gt;
       &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;</diff>
      <filename>src/jsp/header.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -91,7 +91,7 @@
                 &lt;br&gt;&lt;b&gt;&lt;bean:message key=&quot;import.keycolumn&quot;/&gt;:&lt;/b&gt;&lt;br&gt;
                 &lt;html:select property=&quot;status.keycolumn&quot; size=&quot;1&quot;&gt;
                     &lt;agn:ShowColumnInfo id=&quot;agnTbl&quot; table=&quot;&lt;%= AgnUtils.getCompanyID(request) %&gt;&quot;&gt;
-                        &lt;html:option value=&quot;&lt;%= (String) pageContext.getAttribute(&quot;_agnTbl_shortname&quot;) %&gt;&quot;&gt;&lt;/html:option&gt;
+                        &lt;html:option value=&quot;&lt;%= (String) pageContext.getAttribute(&quot;_agnTbl_column_name&quot;) %&gt;&quot;&gt;&lt;%= (String) pageContext.getAttribute(&quot;_agnTbl_shortname&quot;) %&gt;&lt;/html:option&gt;
                     &lt;/agn:ShowColumnInfo&gt;
                 &lt;/html:select&gt;
             &lt;/td&gt;</diff>
      <filename>src/jsp/importwizard/mode.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -2,13 +2,13 @@
 &lt;html&gt;
 
   &lt;head&gt;
-    &lt;title&gt;Welcome to OpenEMM 5.5.0&lt;/title&gt;
+    &lt;title&gt;Welcome to OpenEMM 5.5.1&lt;/title&gt;
 	&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
   &lt;/head&gt;
 
   &lt;body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; link=&quot;#2A5682&quot; vlink=&quot;#2A5682&quot; alink=&quot;#96B9DC&quot; style=&quot;font-family:Tahoma, Arial, Helvetica, sans-serif&quot;&gt;
     &lt;img src=&quot;images/emm/logo_ul.gif&quot; border=&quot;0&quot; style=&quot;margin:10px&quot;&gt;
-    &lt;h1 style=&quot;color:#3974AF&quot;&gt;OpenEMM 5.5.0&lt;/h1&gt;
+    &lt;h1 style=&quot;color:#3974AF&quot;&gt;OpenEMM 5.5.1&lt;/h1&gt;
     &lt;hr style=&quot;border:1px solid #3974AF&quot;&gt;
     &lt;p&gt;&lt;b&gt;Welcome to OpenEMM! This server is now running OpenEMM and ready for the launch of your email campaigns.&lt;/b&gt;
     &lt;br&gt;</diff>
      <filename>src/jsp/index.html</filename>
    </modified>
    <modified>
      <diff>@@ -92,22 +92,16 @@
     &lt;html:hidden property=&quot;contentID&quot;/&gt;
     &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
         &lt;tr&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;span class=&quot;head3&quot;&gt;&lt;bean:message key=&quot;Text_Module&quot;/&gt;:&amp;nbsp;&lt;%= aForm.getDynName() %&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
-        &lt;%  String prepareSave = &quot; &quot;; %&gt;
+       
         &lt;logic:iterate id=&quot;dyncontent&quot; name=&quot;mailingContentForm&quot; property=&quot;content&quot;&gt;
             &lt;% Map.Entry ent2=(Map.Entry)pageContext.getAttribute(&quot;dyncontent&quot;);
             tagContent=(DynamicTagContent)ent2.getValue();
             index=(String)ent2.getKey(); 
-            prepareSave +=  &quot;\n// If the textarea isn't visible update the content from the editor.\n &quot;+
-            		&quot;if ( document.getElementById( 'Textarea&quot;+tagContent.getId()+&quot;' ).style.display == 'none' ){\n  &quot; +         		
-        			&quot; var oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor&quot;+tagContent.getId()+&quot;' ) ;\n&quot; +
-        			&quot; document.getElementById( 'content_&quot;+index+&quot;_.dynContent' ).value = oEditor.GetXHTML() ;\n&quot; +
-        			&quot; } \n &quot;;
-            %&gt;
+           %&gt;
             &lt;script type=&quot;text/javascript&quot;&gt;
                 
-                 // have a look @ sample13.html from the fckeditor docs
-            
-        var isFCKEditorActive&lt;%= tagContent.getId() %&gt; = false;                    
+        	// have a look @ sample13.html from the fckeditor docs
+	        var isFCKEditorActive&lt;%= tagContent.getId() %&gt; = false;                    
 		
 		function Toggle&lt;%= tagContent.getId() %&gt;()
 		{
@@ -188,11 +182,10 @@
 	// editor instance is completely loaded and available for API interactions.
 	function FCKeditor_OnComplete( editorInstance )
 	{
-		// Switch Image ??
 	}
 
 	function save&lt;%= tagContent.getId() %&gt;() {
-		if(isFCKEditorActive&lt;%= tagContent.getId() %&gt;== true) {
+		if(isFCKEditorActive&lt;%= tagContent.getId() %&gt;== true || document.getElementById( 'Textarea&quot;+tagContent.getId()+&quot;' ).style.display == 'none' ) {
 			var oEditor =  FCKeditorAPI.GetInstance( 'DataFCKeditor&lt;%= tagContent.getId() %&gt;' ) ;
 			document.getElementById('content_&lt;%= index %&gt;_.dynContent').value = oEditor.GetXHTML() ;
 		}
@@ -315,26 +308,8 @@
 		
 		
 	}
-
-	// The FCKeditor_OnComplete function is a special function called everytime an
-	// editor instance is completely loaded and available for API interactions.
-	function FCKeditor_OnComplete( editorInstance )
-	{
-		// Switch Image ??
-	}
-
-	function PrepareSave()
-	{
-		// If the textarea isn't visible update the content from the editor.
-		if ( document.getElementById( 'Textarea' ).style.display == 'none' )
-		{
-			var oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
-			document.getElementById( 'newContent' ).value = oEditor.GetXHTML() ;
-		}
-		&lt;%= prepareSave %&gt;
-	}
-	function save() {
-		if(isFCKEditorActive== true)  {
+		function save() {
+		if(isFCKEditorActive== true || document.getElementById( 'Textarea' ).style.display == 'none')  {
 			var oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
 			document.getElementById('newContent').value = oEditor.GetXHTML() ;
 		}</diff>
      <filename>src/jsp/mailing/content_view.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -68,8 +68,16 @@
 &lt;% } %&gt;
 
 &lt;%@include file=&quot;/header.jsp&quot;%&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+&lt;!--
+	function parametersChanged(){
+		document.getElementsByName('mailingBaseForm')[0].numberOfRowsChanged.value = true;
+	}
+//--&gt;
+&lt;/script&gt;
 &lt;html:errors/&gt;
 &lt;html:form action=&quot;/mailingbase&quot;&gt;
+	&lt;html:hidden property=&quot;numberOfRowsChanged&quot; /&gt;   
 	&lt;% if(isTemplate==0) { %&gt;
 		&lt;table&gt;
 			&lt;tr&gt;
@@ -77,14 +85,14 @@
 					&lt;html:hidden property=&quot;__STRUTS_CHECKBOX_mailingTypeNormal&quot; value=&quot;false&quot;/&gt;
 					&lt;html:hidden property=&quot;__STRUTS_CHECKBOX_mailingTypeEvent&quot; value=&quot;false&quot;/&gt;
 					&lt;html:hidden property=&quot;__STRUTS_CHECKBOX_mailingTypeDate&quot; value=&quot;false&quot;/&gt;
-					&lt;html:checkbox property=&quot;mailingTypeNormal&quot;&gt;&lt;bean:message key=&quot;Mailing_normal_show&quot;/&gt;&lt;/html:checkbox&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
-					&lt;html:checkbox property=&quot;mailingTypeEvent&quot;&gt;&lt;bean:message key=&quot;Mailing_event_show&quot;/&gt;&lt;/html:checkbox&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
-					&lt;html:checkbox property=&quot;mailingTypeDate&quot;&gt;&lt;bean:message key=&quot;Mailing_date_show&quot;/&gt;&lt;/html:checkbox&gt;&amp;nbsp;
+					&lt;html:checkbox property=&quot;mailingTypeNormal&quot; onchange=&quot;parametersChanged()&quot;&gt;&lt;bean:message key=&quot;Mailing_normal_show&quot;/&gt;&lt;/html:checkbox&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
+					&lt;html:checkbox property=&quot;mailingTypeEvent&quot; onchange=&quot;parametersChanged()&quot;&gt;&lt;bean:message key=&quot;Mailing_event_show&quot;/&gt;&lt;/html:checkbox&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
+					&lt;html:checkbox property=&quot;mailingTypeDate&quot; onchange=&quot;parametersChanged()&quot;&gt;&lt;bean:message key=&quot;Mailing_date_show&quot;/&gt;&lt;/html:checkbox&gt;&amp;nbsp;
 				&lt;/td&gt;
 			&lt;/tr&gt;
 			&lt;tr&gt;
 				&lt;td&gt;&lt;bean:message key=&quot;Admin.numberofrows&quot;/&gt;&amp;nbsp;									
-					&lt;html:select property=&quot;numberofRows&quot;&gt;
+					&lt;html:select property=&quot;numberofRows&quot; onchange=&quot;parametersChanged()&quot;&gt;
                 		&lt;%
                 			String[] sizes={&quot;20&quot;,&quot;50&quot;,&quot;100&quot;};
                 			for( int i=0;i&lt; sizes.length; i++ )
@@ -140,9 +148,7 @@
  %&gt;         
  	&lt;tr&gt;
  		&lt;td&gt;
- 		 &lt;ajax:displayTag id=&quot;mailingTable&quot; ajaxFlag=&quot;displayAjax&quot;&gt;
- 		
- 			&lt;display:table class=&quot;dataTable&quot;  id=&quot;mailing&quot; name=&quot;mailinglist&quot; pagesize=&quot;${mailingBaseForm.numberofRows}&quot; requestURI=&quot;/mailingbase.do?action=${mailingBaseForm.action}&amp;isTemplate=${mailingBaseForm.isTemplate}&quot; excludedParams=&quot;*&quot;&gt;
+ 			&lt;display:table class=&quot;dataTable&quot;  id=&quot;mailing&quot; name=&quot;mailinglist&quot; pagesize=&quot;${mailingBaseForm.numberofRows}&quot; requestURI=&quot;/mailingbase.do?action=${mailingBaseForm.action}&amp;isTemplate=${mailingBaseForm.isTemplate}&quot; excludedParams=&quot;*&quot; partialList=&quot;true&quot; size=&quot;${mailinglist.fullListSize}&quot; sort=&quot;external&quot;&gt;
 				&lt;logic:equal name=&quot;mailingBaseForm&quot; property=&quot;isTemplate&quot; value=&quot;false&quot;&gt;
 				&lt;display:column headerClass=&quot;head_action&quot; class=&quot;action&quot;&gt;
 					&lt;html:link page=&quot;/mailingbase.do?action=${ACTION_USED_ACTIONS}&amp;mailingID=${mailing.mailingid}&quot;&gt;&lt;img border=&quot;0&quot; title=&quot;&lt;bean:message key=&quot;action_link&quot; /&gt;&quot; src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;extlink.gif&quot;&gt;&lt;/html:link&gt;&amp;nbsp;&amp;nbsp;                   
@@ -164,23 +170,13 @@
 		&lt;display:column headerClass=&quot;head_mailinglist&quot; class=&quot;mailinglist&quot; titleKey=&quot;Mailinglist&quot; property=&quot;mailinglist&quot; sortable=&quot;true&quot;/&gt;
 		&lt;display:column class=&quot;edit&quot;&gt;
 		&lt;agn:ShowByPermission token=&quot;mailing.delete&quot;&gt;
-        		     &lt;html:link page=&quot;/mailingbase.do?action=${ACTION_CONFIRM_DELETE}&amp;mailingID=${mailing.mailingid}&quot;&gt;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;delete.gif&quot; alt=&quot;&lt;bean:message key=&quot;Delete&quot;/&gt;&quot; border=&quot;0&quot;&gt;&lt;/html:link&gt;
-        &lt;/agn:ShowByPermission&gt;
+        		     &lt;html:link page=&quot;/mailingbase.do?action=6&amp;mailingID=${mailing.mailingid}&quot;&gt;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;delete.gif&quot; alt=&quot;&lt;bean:message key=&quot;Delete&quot;/&gt;&quot; border=&quot;0&quot;&gt;&lt;/html:link&gt;
+         		&lt;/agn:ShowByPermission&gt;
              		&lt;html:link page=&quot;/mailingbase.do?action=${ACTION_VIEW}&amp;mailingID=${mailing.mailingid}&quot;&gt;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;bearbeiten.gif&quot; alt=&quot;&lt;bean:message key=&quot;Edit&quot;/&gt;&quot; border=&quot;0&quot;&gt;&lt;/html:link&gt;
  	   	&lt;/display:column&gt; 	
- 	   		
- 	   				
-   	&lt;/logic:equal&gt;
- 	   
- 	   
+	   	&lt;/logic:equal&gt;
 	 &lt;/display:table&gt;
- 	 &lt;/ajax:displayTag&gt;
- 		 &lt;/td&gt;
+		 &lt;/td&gt;
  	&lt;/tr&gt;
-
-
-              &lt;/table&gt;
-
-
-
+ &lt;/table&gt;
 &lt;%@include file=&quot;/footer.jsp&quot;%&gt;</diff>
      <filename>src/jsp/mailing/list.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -268,28 +268,112 @@
                   &lt;/td&gt;
                 &lt;/tr&gt;
             &lt;script type=&quot;text/javascript&quot;&gt;
-                &lt;!--
-                   var oFCKeditorHtml=null;
-                   function editHtmlHtml() {
-                     if(oFCKeditorHtml==null) {
-                       oFCKeditorHtml = new FCKeditor( 'htmlTemplate' ) ;
-                       oFCKeditorHtml.Config[ &quot;AutoDetectLanguage&quot; ] = false ;
-                       oFCKeditorHtml.Config[ &quot;DefaultLanguage&quot; ] = &quot;&lt;%= aLocale.getLanguage() %&gt;&quot; ;
-                       oFCKeditorHtml.Config[ &quot;BaseHref&quot; ] = baseUrl+&quot;/fckeditor2.5/&quot; ;
-                       oFCKeditorHtml.Config[ &quot;CustomConfigurationsPath&quot; ] = &quot;&lt;html:rewrite page=&quot;&lt;%= new String(&quot;/fckeditor2.5/emmconfig.jsp?mailingID=&quot;+tmpMailingID) %&gt;&quot;/&gt;&quot; ;
-                       oFCKeditorHtml.ToolbarSet = &quot;emm&quot; ;
-                       oFCKeditorHtml.BasePath = baseUrl+&quot;/fckeditor2.5/&quot; ;
-                       oFCKeditorHtml.Height = &quot;400&quot; ; // 400 pixels
-                       oFCKeditorHtml.Width = 650 ; // 400 pixels
-                       oFCKeditorHtml.ReplaceTextarea();
-                     }
-                     return true;
-                   }
-                  //--&gt;
-                  &lt;/script&gt;
+                  
+            var isFCKEditorActive=false;
+        function Toggle()
+		{
+				// Try to get the FCKeditor instance, if available.
+			var oEditor ;
+			if ( typeof( FCKeditorAPI ) != 'undefined' )
+				oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
+
+			// Get the _Textarea and _FCKeditor DIVs.
+			var eTextareaDiv	= document.getElementById( 'Textarea' ) ;
+			var eFCKeditorDiv	= document.getElementById( 'FCKeditor' ) ;
+
+			// If the _Textarea DIV is visible, switch to FCKeditor.
+			if ( eTextareaDiv.style.display != 'none' )
+			{
+			// If it is the first time, create the editor.
+			if ( !oEditor )
+			{
+				CreateEditor() ;
+			}
+			else
+			{
+				// Set the current text in the textarea to the editor.
+				oEditor.SetData( document.getElementById('newContent').value ) ;
+			}
+
+			// Switch the DIVs display.
+			eTextareaDiv.style.display = 'none' ;
+			eFCKeditorDiv.style.display = '' ;
+
+			// This is a hack for Gecko 1.0.x ... it stops editing when the editor is hidden.
+			if ( oEditor &amp;&amp; !document.all )
+			{
+				if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
+				oEditor.MakeEditable() ;
+			}
+			isFCKEditorActive=true;
+		}
+		else
+		{
+			// Set the textarea value to the editor value.
+			document.getElementById('newContent').value = oEditor.GetXHTML() ;
+
+			// Switch the DIVs display.
+			eTextareaDiv.style.display = '' ;
+			eFCKeditorDiv.style.display = 'none' ;
+			isFCKEditorActive=false;
+		}
+	}
+
+	function CreateEditor()
+	{
+		// Copy the value of the current textarea, to the textarea that will be used by the editor.
+		document.getElementById('DataFCKeditor').value = document.getElementById('newContent').value ;
+
+		// Automatically calculates the editor base path based on the _samples directory.
+		// This is usefull only for these samples. A real application should use something like this:
+		// oFCKeditor.BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
+	
+		// Create an instance of FCKeditor (using the target textarea as the name).
+		
+		oFCKeditorNew = new FCKeditor( 'DataFCKeditor' ) ;
+        oFCKeditorNew.Config[ &quot;AutoDetectLanguage&quot; ] = false ;
+        oFCKeditorNew.Config[ &quot;DefaultLanguage&quot; ] = &quot;&lt;%= ((Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)).getLanguage() %&gt;&quot; ;
+        oFCKeditorNew.Config[ &quot;BaseHref&quot; ] = baseUrl+&quot;/fckeditor2.5/&quot; ;
+        oFCKeditorNew.Config[ &quot;CustomConfigurationsPath&quot; ] = &quot;&lt;html:rewrite page=&quot;&lt;%= new String(&quot;/fckeditor2.5/emmconfig.jsp?mailingID=&quot;+tmpMailingID) %&gt;&quot;/&gt;&quot; ;
+        oFCKeditorNew.ToolbarSet = &quot;emm&quot; ;
+        oFCKeditorNew.BasePath = baseUrl+&quot;/fckeditor2.5/&quot; ;
+        oFCKeditorNew.Height = &quot;400&quot; ; // 400 pixels
+        oFCKeditorNew.Width = &quot;650&quot; ;
+        oFCKeditorNew.ReplaceTextarea();
+	}
+
+	// The FCKeditor_OnComplete function is a special function called everytime an
+	// editor instance is completely loaded and available for API interactions.
+	function FCKeditor_OnComplete( editorInstance )
+	{
+		// Switch Image ??
+	}
+
+	function PrepareSave()
+	{
+		// If the textarea isn't visible update the content from the editor.
+		if ( document.getElementById( 'Textarea' ).style.display == 'none' )
+		{
+			var oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
+			document.getElementById( 'newContent' ).value = oEditor.GetXHTML() ;
+		}
+		
+	}
+	function save() {
+		if(isFCKEditorActive== true)  {
+			var oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
+			document.getElementById('newContent').value = oEditor.GetXHTML() ;
+		}
+	}
+   &lt;/script&gt;
                 &lt;tr&gt;
-                  &lt;td colspan=&quot;2&quot;&gt;&lt;br&gt;&lt;b&gt;&lt;bean:message key=&quot;HTML_Version&quot;/&gt;:&lt;/b&gt;&amp;nbsp;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;edit.gif&quot; border=&quot;0&quot; onclick=&quot;editHtmlHtml();&quot; alt=&quot;&lt;bean:message key=&quot;htmled.title&quot;/&gt;&quot;&gt;&lt;br&gt;
-                    &lt;html:textarea property=&quot;htmlTemplate&quot; rows=&quot;14&quot; cols=&quot;75&quot;/&gt;
+                  &lt;td colspan=&quot;2&quot;&gt;&lt;br&gt;&lt;b&gt;&lt;bean:message key=&quot;HTML_Version&quot;/&gt;:&lt;/b&gt;&amp;nbsp;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;edit.gif&quot; border=&quot;0&quot; onclick=&quot;Toggle();&quot; alt=&quot;&lt;bean:message key=&quot;htmled.title&quot;/&gt;&quot;&gt;&lt;br&gt;
+                    &lt;div id=&quot;Textarea&quot;&gt;
+        					&lt;html:textarea property=&quot;htmlTemplate&quot; styleId=&quot;newContent&quot; rows=&quot;14&quot; cols=&quot;75&quot;/&gt;&amp;nbsp;
+        			&lt;/div&gt;
+        			&lt;div id=&quot;FCKeditor&quot; style=&quot;display: none&quot;&gt;
+        				&lt;textarea  id=&quot;DataFCKeditor&quot; rows=&quot;14&quot; cols=&quot;75&quot;&gt;&lt;/textarea&gt;
+        			&lt;/div&gt;             
                   &lt;/td&gt;
                 &lt;/tr&gt;
 &lt;% } %&gt;
@@ -317,7 +401,7 @@
                    permToken=&quot;mailing.change&quot;;
                 } %&gt;
                 &lt;agn:ShowByPermission token=&quot;&lt;%= permToken %&gt;&quot;&gt;
-                  &lt;html:image src=&quot;button?msg=Save&quot; border=&quot;0&quot; property=&quot;save&quot; value=&quot;save&quot;/&gt;
+                  &lt;html:image src=&quot;button?msg=Save&quot; border=&quot;0&quot; property=&quot;save&quot; value=&quot;save&quot; onclick=&quot;save();&quot;/&gt;
                 &lt;/agn:ShowByPermission&gt;
                 &lt;% if(tmpMailingID!=0) { %&gt;
 </diff>
      <filename>src/jsp/mailing/view_base.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -81,27 +81,7 @@
             &lt;% Map.Entry ent2=(Map.Entry)pageContext.getAttribute(&quot;dyncontent&quot;);
                 tagContent=(DynamicTagContent)ent2.getValue();
                 index=(String)ent2.getKey(); %&gt;
-            &lt;script type=&quot;text/javascript&quot;&gt;
-                &lt;!-- 
-                var oFCKeditor&lt;%= tagContent.getId() %&gt;=null;
-                function editHtml&lt;%= tagContent.getId() %&gt;() {
-                if(oFCKeditor&lt;%= tagContent.getId() %&gt;==null) {
-                oFCKeditor&lt;%= tagContent.getId() %&gt; = new FCKeditor( 'content(&lt;%= index %&gt;).dynContent' ) ;
-                oFCKeditor&lt;%= tagContent.getId() %&gt;.Config[ &quot;AutoDetectLanguage&quot; ] = false ;
-                oFCKeditor&lt;%= tagContent.getId() %&gt;.Config[ &quot;DefaultLanguage&quot; ] = &quot;&lt;%= ((Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)).getLanguage() %&gt;&quot; ;
-                oFCKeditor&lt;%= tagContent.getId() %&gt;.Config[ &quot;BaseHref&quot; ] = baseUrl+&quot;/fckeditor2.5/&quot; ;
-                oFCKeditor&lt;%= tagContent.getId() %&gt;.Config[ &quot;CustomConfigurationsPath&quot; ] = &quot;&lt;html:rewrite page=&quot;&lt;%= new String(&quot;/fckeditor2.5/emmconfig.jsp?mailingID=&quot;+mailing.getId()) %&gt;&quot;/&gt;&quot; ;
-                oFCKeditor&lt;%= tagContent.getId() %&gt;.ToolbarSet = &quot;emm&quot; ;
-                oFCKeditor&lt;%= tagContent.getId() %&gt;.BasePath = baseUrl+&quot;/fckeditor2.5/&quot; ;
-                oFCKeditor&lt;%= tagContent.getId() %&gt;.Height = &quot;400&quot; ; // 400 pixels
-                oFCKeditor&lt;%= tagContent.getId() %&gt;.Width = 650 ; // 400 pixels
-                oFCKeditor&lt;%= tagContent.getId() %&gt;.ReplaceTextarea();
-                }
-                return true;
-                }
-                //--&gt;
-            &lt;/script&gt;
-
+          
             &lt;tr&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;a name=&quot;${dyncontent.getId()}&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
             
             &lt;tr&gt;&lt;td&gt;&lt;bean:message key=&quot;Content&quot;/&gt;:&amp;nbsp;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;edit.gif&quot; border=&quot;0&quot; onclick=&quot;editHtml&lt;%= tagContent.getId() %&gt;();&quot; alt=&quot;&lt;bean:message key=&quot;htmled.title&quot;/&gt;&quot;&gt;&lt;/td&gt;
@@ -134,29 +114,120 @@
             &lt;html:image src=&quot;button?msg=Delete&quot; border=&quot;0&quot; property=&quot;delete&quot; onclick=&quot;&lt;%= &quot;document.getElementById('contentform').action.value=&quot;+MailingContentAction.ACTION_DELETE_TEXTBLOCK +&quot;;document.getElementById('contentform').contentID.value=&quot;+tagContent.getId() %&gt;&quot;/&gt;
         &lt;/logic:iterate&gt;
         &lt;tr&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;a name=&quot;0&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;span class=&quot;head3&quot;&gt;&lt;bean:message key=&quot;New_Content&quot;/&gt;&lt;/span&gt;&lt;/a&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
-        &lt;script type=&quot;text/javascript&quot;&gt;
-            &lt;!--
-            var oFCKeditorNew=null;
-            function editHtmlNew() {
-            if(oFCKeditorNew==null) {
-            oFCKeditorNew = new FCKeditor( 'new_dyn_content' ) ;
-            oFCKeditorNew.Config[ &quot;AutoDetectLanguage&quot; ] = false ;
-            oFCKeditorNew.Config[ &quot;DefaultLanguage&quot; ] = &quot;&lt;%= ((Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)).getLanguage() %&gt;&quot; ;
-            oFCKeditorNew.Config[ &quot;BaseHref&quot; ] = baseUrl+&quot;/fckeditor2.5/&quot; ;
-            oFCKeditorNew.Config[ &quot;CustomConfigurationsPath&quot; ] = &quot;&lt;html:rewrite page=&quot;&lt;%= new String(&quot;/fckeditor2.5/emmconfig.jsp?mailingID=&quot;+mailing.getId()) %&gt;&quot;/&gt;&quot; ;
-            oFCKeditorNew.ToolbarSet = &quot;emm&quot; ;
-            oFCKeditorNew.BasePath = baseUrl+&quot;/fckeditor2.5/&quot; ;
-            oFCKeditorNew.Height = &quot;400&quot; ; // 400 pixels
-            oFCKeditorNew.Width = &quot;650&quot; ;
-            oFCKeditorNew.ReplaceTextarea();
-            }
-            return true;
-            }
-            //--&gt;
+      &lt;script type=&quot;text/javascript&quot;&gt;
+       var isFCKEditorActive=false;
+       function Toggle()
+		{
+				// Try to get the FCKeditor instance, if available.
+			var oEditor ;
+			if ( typeof( FCKeditorAPI ) != 'undefined' )
+				oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
+
+			// Get the _Textarea and _FCKeditor DIVs.
+			var eTextareaDiv	= document.getElementById( 'Textarea' ) ;
+			var eFCKeditorDiv	= document.getElementById( 'FCKeditor' ) ;
+
+			// If the _Textarea DIV is visible, switch to FCKeditor.
+			if ( eTextareaDiv.style.display != 'none' )
+			{
+			// If it is the first time, create the editor.
+			if ( !oEditor )
+			{
+				CreateEditor() ;
+			}
+			else
+			{
+				// Set the current text in the textarea to the editor.
+				oEditor.SetData( document.getElementById('newContent').value ) ;
+			}
+
+			// Switch the DIVs display.
+			eTextareaDiv.style.display = 'none' ;
+			eFCKeditorDiv.style.display = '' ;
+
+			// This is a hack for Gecko 1.0.x ... it stops editing when the editor is hidden.
+			if ( oEditor &amp;&amp; !document.all )
+			{
+				if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
+				oEditor.MakeEditable() ;
+			}
+			isFCKEditorActive=true;
+		}
+		else
+		{
+			// Set the textarea value to the editor value.
+			document.getElementById('newContent').value = oEditor.GetXHTML() ;
+
+			// Switch the DIVs display.
+			eTextareaDiv.style.display = '' ;
+			eFCKeditorDiv.style.display = 'none' ;
+			isFCKEditorActive=false;
+		}
+	}
+
+	function CreateEditor()
+	{
+		// Copy the value of the current textarea, to the textarea that will be used by the editor.
+		document.getElementById('DataFCKeditor').value = document.getElementById('newContent').value ;
+
+		// Automatically calculates the editor base path based on the _samples directory.
+		// This is usefull only for these samples. A real application should use something like this:
+		// oFCKeditor.BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
+	
+		// Create an instance of FCKeditor (using the target textarea as the name).
+		
+		oFCKeditorNew = new FCKeditor( 'DataFCKeditor' ) ;
+        oFCKeditorNew.Config[ &quot;AutoDetectLanguage&quot; ] = false ;
+        oFCKeditorNew.Config[ &quot;DefaultLanguage&quot; ] = &quot;&lt;%= ((Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)).getLanguage() %&gt;&quot; ;
+        oFCKeditorNew.Config[ &quot;BaseHref&quot; ] = baseUrl+&quot;/fckeditor2.5/&quot; ;
+        oFCKeditorNew.Config[ &quot;CustomConfigurationsPath&quot; ] = &quot;&lt;html:rewrite page=&quot;&lt;%= new String(&quot;/fckeditor2.5/emmconfig.jsp?mailingID=&quot;+mailing.getId()) %&gt;&quot;/&gt;&quot; ;
+        oFCKeditorNew.ToolbarSet = &quot;emm&quot; ;
+        oFCKeditorNew.BasePath = baseUrl+&quot;/fckeditor2.5/&quot; ;
+        oFCKeditorNew.Height = &quot;400&quot; ; // 400 pixels
+        oFCKeditorNew.Width = &quot;650&quot; ;
+        oFCKeditorNew.ReplaceTextarea();
+			
+		
+	}
+
+	// The FCKeditor_OnComplete function is a special function called everytime an
+	// editor instance is completely loaded and available for API interactions.
+	function FCKeditor_OnComplete( editorInstance )
+	{
+		// Switch Image ??
+	}
+
+	function PrepareSave()
+	{
+		// If the textarea isn't visible update the content from the editor.
+		if ( document.getElementById( 'Textarea' ).style.display == 'none' )
+		{
+			var oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
+			document.getElementById( 'newContent' ).value = oEditor.GetXHTML() ;
+		}
+		
+	}
+	function save() {
+		if(isFCKEditorActive== true)  {
+			var oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
+			document.getElementById('newContent').value = oEditor.GetXHTML() ;
+		}
+	}
+	
+	
         &lt;/script&gt;
-        &lt;tr&gt;&lt;td&gt;&lt;bean:message key=&quot;Content&quot;/&gt;:&amp;nbsp;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;edit.gif&quot; border=&quot;0&quot; onclick=&quot;editHtmlNew();&quot; alt=&quot;&lt;bean:message key=&quot;htmled.title&quot;/&gt;&quot;&gt;&lt;/td&gt;
+       
+       
+       
+       
+        &lt;tr&gt;&lt;td&gt;&lt;bean:message key=&quot;Content&quot;/&gt;:&amp;nbsp;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;edit.gif&quot; border=&quot;0&quot; onclick=&quot;Toggle();&quot; alt=&quot;&lt;bean:message key=&quot;htmled.title&quot;/&gt;&quot;&gt;&lt;/td&gt;
         &lt;td&gt;
-            &lt;html:textarea property=&quot;newContent&quot; rows=&quot;20&quot; cols=&quot;85&quot;/&gt;&amp;nbsp;
+            &lt;div id=&quot;Textarea&quot;&gt;
+        		&lt;html:textarea property=&quot;newContent&quot; styleId=&quot;newContent&quot; rows=&quot;20&quot; cols=&quot;85&quot;/&gt;&amp;nbsp;
+        	&lt;/div&gt;
+        	&lt;div id=&quot;FCKeditor&quot; style=&quot;display: none&quot;&gt;
+        		&lt;textarea  id=&quot;DataFCKeditor&quot; rows=&quot;20&quot; cols=&quot;85&quot;&gt;&lt;/textarea&gt;
+        	&lt;/div&gt;
         &lt;/td&gt;
         &lt;td&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
         &lt;tr&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
@@ -168,7 +239,7 @@
             &lt;/logic:iterate&gt;
         &lt;/html:select&gt;&lt;/td&gt;&lt;/tr&gt;
         &lt;tr&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
-        &lt;tr&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;html:image src=&quot;button?msg=Add&quot; border=&quot;0&quot; property=&quot;insert&quot; onclick=&quot;&lt;%= &quot;document.mailingWizardForm.action.value='&quot; + MailingWizardAction.ACTION_TEXTMODULE_ADD + &quot;'&quot; %&gt;&quot;/&gt;
+        &lt;tr&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;html:image src=&quot;button?msg=Add&quot; border=&quot;0&quot; property=&quot;insert&quot; onclick=&quot;&lt;%= &quot;save();document.mailingWizardForm.action.value='&quot; + MailingWizardAction.ACTION_TEXTMODULE_ADD + &quot;'&quot; %&gt;&quot;/&gt;
     &lt;/table&gt;
     
     &lt;br&gt;</diff>
      <filename>src/jsp/mailing/wizard/textmodule.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -43,7 +43,7 @@
 &lt;% pageContext.setAttribute(&quot;agnTitleKey&quot;, new String(&quot;Mailinglist&quot;)); %&gt;
 &lt;% pageContext.setAttribute(&quot;agnSubtitleKey&quot;, new String(&quot;Mailinglist&quot;)); %&gt;
 &lt;% pageContext.setAttribute(&quot;agnSubtitleValue&quot;, tmpShortname); %&gt;
-&lt;% pageContext.setAttribute(&quot;agnNavigationKey&quot;, new String(&quot;show_mailinglist&quot;)); %&gt;
+&lt;% pageContext.setAttribute(&quot;agnNavigationKey&quot;, new String(&quot;mailinglists&quot;)); %&gt;
 &lt;% pageContext.setAttribute(&quot;agnHighlightKey&quot;, new String(&quot;Mailinglist&quot;)); %&gt;
 &lt;% pageContext.setAttribute(&quot;agnNavHrefAppend&quot;, new String(&quot;&amp;mailinglistID=&quot;+tmpMailinglistID)); %&gt;
 &lt;%@include file=&quot;/header.jsp&quot;%&gt;</diff>
      <filename>src/jsp/mailinglists/delete.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -41,7 +41,7 @@
 &lt;% pageContext.setAttribute(&quot;sidemenu_active&quot;, new String(&quot;Mailinglists&quot;)); %&gt;
 &lt;% if(tmpMailinglistID!=0) {
      pageContext.setAttribute(&quot;sidemenu_sub_active&quot;, new String(&quot;none&quot;));
-     pageContext.setAttribute(&quot;agnNavigationKey&quot;, new String(&quot;show_mailinglist&quot;));
+     pageContext.setAttribute(&quot;agnNavigationKey&quot;, new String(&quot;mailinglists&quot;));
      pageContext.setAttribute(&quot;agnHighlightKey&quot;, new String(&quot;Mailinglist&quot;));
      pageContext.setAttribute(&quot;agnTitleKey&quot;, new String(&quot;Mailinglist&quot;));
      pageContext.setAttribute(&quot;agnSubtitleKey&quot;, new String(&quot;Mailinglist&quot;));</diff>
      <filename>src/jsp/mailinglists/view.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -42,76 +42,60 @@
 &lt;% pageContext.setAttribute(&quot;ACTION_VIEW&quot;, RecipientAction.ACTION_VIEW ); %&gt;
 
 &lt;%@include file=&quot;/header.jsp&quot;%&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+&lt;!--
+	function parametersChanged(){
+		document.getElementsByName('recipientForm')[0].numberOfRowsChanged.value = true;
+	}
+//--&gt;
+&lt;/script&gt;
 
 &lt;html:errors/&gt;
 &lt;%  
-	EmmLayout aLayout=(EmmLayout)session.getAttribute(&quot;emm.layout&quot;);
+	EmmLayout aLayout = (EmmLayout)session.getAttribute(&quot;emm.layout&quot;);
     int mailingListID;
     int targetID;
-    String user_type=null;
-    int user_status=0;
-
-    try {
-        mailingListID=Integer.parseInt(request.getParameter(&quot;listID&quot;));
-    } catch (Exception e) {
-        mailingListID=0;
-    }
-    
-    try {
-		targetID=Integer.parseInt(request.getParameter(&quot;targetID&quot;));
-	} catch(Exception e) {
-		targetID=0;
-	} 
-
-    
-
-    if(request.getParameter(&quot;user_type&quot;)==null){   
-        user_type=new String(&quot;E&quot;);
-    } else {
-        user_type=new String(request.getParameter(&quot;user_type&quot;));
-    }
-    if(request.getParameter(&quot;user_status&quot;)==null){  
-        user_status=0;
-    } else {
-        try {
-            user_status=Integer.parseInt(request.getParameter(&quot;user_status&quot;));
-        } catch (Exception e) {
-            user_status=0;
-        }
-    }
-    int index=0;
-    boolean isFirst=true;
-    RecipientForm rec=(RecipientForm) session.getAttribute(&quot;recipientForm&quot;);
-    TargetRepresentation targetRep=rec.getTarget();
+    String user_type = null;
+    int user_status = 0;
+	
+    RecipientForm aForm = (RecipientForm) session.getAttribute(&quot;recipientForm&quot;);
+    mailingListID =aForm.getListID();
+	targetID = aForm.getTargetID();
+   	user_type = aForm.getUser_type();
+    user_status = aForm.getUser_status();
+    int index = 0;
+    boolean isFirst = true;
+    TargetRepresentation targetRep = aForm.getTarget();
 %&gt;
 
 &lt;agn:ShowColumnInfo id=&quot;colsel&quot; table=&quot;&lt;%= AgnUtils.getCompanyID(request) %&gt;&quot;/&gt;
 
 &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
     &lt;html:form action=&quot;&lt;%= new String(&quot;/recipient.do?action=&quot;+RecipientAction.ACTION_LIST) %&gt;&quot;&gt;
+    	 &lt;html:hidden property=&quot;numberOfRowsChanged&quot; /&gt;   
     &lt;tr&gt;&lt;td colspan=&quot;5&quot;&gt;&lt;b&gt;&lt;bean:message key=&quot;recipient.search&quot;/&gt;:&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;&lt;td colspan=&quot;5&quot;&gt;
         &lt;table border=&quot;0&quot; cellspacing=&quot;2&quot; cellpadding=&quot;0&quot;&gt;
         &lt;logic:iterate id=&quot;aNode1&quot; name=&quot;recipientForm&quot; property=&quot;target.allNodes&quot;&gt;
-            &lt;% TargetNode aNode=(TargetNode)pageContext.getAttribute(&quot;aNode1&quot;);
-               String className=aNode.getClass().getName(); 
+            &lt;% TargetNode aNode = (TargetNode)pageContext.getAttribute(&quot;aNode1&quot;);
+               String className = aNode.getClass().getName(); 
                index++;
             %&gt;
             &lt;tr&gt;
                 &lt;!-- AND/OR --&gt;
                 &lt;td&gt;
                     &lt;% if(!isFirst) { %&gt;
-                        &lt;select name=&quot;trgt_chainop&lt;%= index %&gt;&quot; size=&quot;1&quot; &gt;
-                            &lt;option value=&quot;1&quot; &lt;% if(aNode.getChainOperator()==1) { %&gt;selected&lt;% } %&gt;&gt;&lt;bean:message key=&quot;and&quot;/&gt;&lt;/option&gt;
-                            &lt;option value=&quot;2&quot; &lt;% if(aNode.getChainOperator()==2) { %&gt;selected&lt;% } %&gt;&gt;&lt;bean:message key=&quot;or&quot;/&gt;&lt;/option&gt;
+                        &lt;select name=&quot;trgt_chainop&lt;%= index %&gt;&quot; size=&quot;1&quot; onchange=&quot;parametersChanged()&quot;&gt;
+                            &lt;option value=&quot;1&quot; &lt;% if(aNode.getChainOperator() == 1) { %&gt;selected&lt;% } %&gt;&gt;&lt;bean:message key=&quot;and&quot;/&gt;&lt;/option&gt;
+                            &lt;option value=&quot;2&quot; &lt;% if(aNode.getChainOperator() == 2) { %&gt;selected&lt;% } %&gt;&gt;&lt;bean:message key=&quot;or&quot;/&gt;&lt;/option&gt;
                         &lt;/select&gt;
                     &lt;% } else { %&gt;
                          &amp;nbsp;&lt;input type=&quot;hidden&quot; name=&quot;trgt_chainop&lt;%= index %&gt;&quot; value=&quot;0&quot;&gt;
-                    &lt;% isFirst=false; } %&gt;
+                    &lt;% isFirst = false; } %&gt;
                 &lt;/td&gt;
                 &lt;!-- Bracket-Open Y/N --&gt;
                 &lt;td&gt;
-                    &lt;select name=&quot;trgt_bracketopen&lt;%= index %&gt;&quot; size=&quot;1&quot;&gt;
+                    &lt;select name=&quot;trgt_bracketopen&lt;%= index %&gt;&quot; size=&quot;1&quot; onchange=&quot;parametersChanged()&quot; &gt;
                         &lt;option value=&quot;0&quot; &lt;% if(!aNode.isOpenBracketBefore()) { %&gt;selected&lt;% } %&gt;&gt;&amp;nbsp;&lt;/option&gt;
                         &lt;option value=&quot;1&quot; &lt;% if(aNode.isOpenBracketBefore()) { %&gt;selected&lt;% } %&gt;&gt;(&lt;/option&gt;
                     &lt;/select&gt;
@@ -124,7 +108,7 @@
                     &lt;% } else if(aNode.getPrimaryField().equals(&quot;bind.change_date&quot;)) { %&gt;
                          ml.change_date
                     &lt;% } else {
-                           TreeMap tm=(TreeMap) pageContext.getAttribute(&quot;__colsel_colmap&quot;);
+                           TreeMap tm = (TreeMap) pageContext.getAttribute(&quot;__colsel_colmap&quot;);
                            if(tm != null &amp;&amp; tm.get(aNode.getPrimaryField()) != null) { %&gt;
                                &lt;%= ((Map) tm.get(aNode.getPrimaryField())).get(&quot;shortname&quot;) %&gt;
                         &lt;% }
@@ -132,7 +116,7 @@
                 &lt;/td&gt;
                 &lt;!-- Operator-Select --&gt;
                 &lt;td&gt;
-                    &lt;select name=&quot;trgt_operator&lt;%= index %&gt;&quot; style=&quot;width:100%&quot;&gt; size=&quot;1&quot;&gt;
+                    &lt;select name=&quot;trgt_operator&lt;%= index %&gt;&quot; style=&quot;width:100%&quot; size=&quot;1&quot; onchange=&quot;parametersChanged()&quot;&gt;
                         &lt;%
                            int idx=1;
                            String aOp=null;
@@ -155,7 +139,7 @@
                 &lt;td&gt;
                     &lt;% if(className.equals(&quot;org.agnitas.target.impl.TargetNodeDate&quot;) &amp;&amp; (aNode.getPrimaryOperator()!=TargetNode.OPERATOR_IS)) { %&gt;
                         &lt;nobr&gt;&lt;input type=&quot;text&quot; style=&quot;width:53%&quot; name=&quot;trgt_value&lt;%= index %&gt;&quot; value=&quot;&lt;%= aNode.getPrimaryValue() %&gt;&quot;&gt;
-                        &lt;select name=&quot;trgt_dateformat&lt;%= index %&gt;&quot; style=&quot;width:45%&quot; size=&quot;1&quot;&gt;
+                        &lt;select name=&quot;trgt_dateformat&lt;%= index %&gt;&quot; style=&quot;width:45%&quot; size=&quot;1&quot; onchange=&quot;parametersChanged()&quot;&gt;
                            &lt;option value=&quot;yyyymmdd&quot;&lt;% if(((TargetNodeDate)aNode).getDateFormat().equals(&quot;yyyymmdd&quot;)){%&gt; selected&lt;%}%&gt;&gt;&lt;bean:message key=&quot;date.format.YYYYMMDD&quot;/&gt;&lt;/option&gt;
                             &lt;option value=&quot;mmdd&quot;&lt;% if(((TargetNodeDate)aNode).getDateFormat().equals(&quot;mmdd&quot;)){%&gt; selected&lt;%}%&gt;&gt;&lt;bean:message key=&quot;date.format.MMDD&quot;/&gt;&lt;/option&gt;
                             &lt;option value=&quot;yyyymm&quot;&lt;% if(((TargetNodeDate)aNode).getDateFormat().equals(&quot;yyyymm&quot;)){%&gt; selected&lt;%}%&gt;&gt;&lt;bean:message key=&quot;date.format.YYYYMM&quot;/&gt;&lt;/option&gt;
@@ -166,14 +150,14 @@
                     &lt;% } 
                        if(className.equals(&quot;org.agnitas.target.impl.TargetNodeNumeric&quot;) &amp;&amp; (aNode.getPrimaryOperator()!=TargetNode.OPERATOR_MOD) &amp;&amp; (aNode.getPrimaryOperator()!=TargetNode.OPERATOR_IS)) { 
                            if(aNode.getPrimaryField().equalsIgnoreCase(&quot;MAILTYPE&quot;)) { %&gt;
-                               &lt;select name=&quot;trgt_value&lt;%= index %&gt;&quot; size=&quot;1&quot; style=&quot;width:100%&quot;&gt;
+                               &lt;select name=&quot;trgt_value&lt;%= index %&gt;&quot; size=&quot;1&quot; style=&quot;width:100%&quot; onchange=&quot;parametersChanged()&quot;&gt;
                                    &lt;option value=&quot;0&quot;&lt;% if(aNode.getPrimaryValue().equals(&quot;0&quot;)){%&gt; selected&lt;%}%&gt;&gt;&lt;bean:message key=&quot;Text&quot;/&gt;&lt;/option&gt;
                                    &lt;option value=&quot;1&quot;&lt;% if(aNode.getPrimaryValue().equals(&quot;1&quot;)){%&gt; selected&lt;%}%&gt;&gt;&lt;bean:message key=&quot;HTML&quot;/&gt;&lt;/option&gt;
                                    &lt;option value=&quot;2&quot;&lt;% if(aNode.getPrimaryValue().equals(&quot;2&quot;)){%&gt; selected&lt;%}%&gt;&gt;&lt;bean:message key=&quot;OfflineHTML&quot;/&gt;&lt;/option&gt;
                                &lt;/select&gt;
                         &lt;% } else {
                                if(aNode.getPrimaryField().equalsIgnoreCase(&quot;GENDER&quot;)) { %&gt;
-                                   &lt;select name=&quot;trgt_value&lt;%= index %&gt;&quot; size=&quot;1&quot; style=&quot;width:100%&quot;&gt;
+                                   &lt;select name=&quot;trgt_value&lt;%= index %&gt;&quot; size=&quot;1&quot; style=&quot;width:100%&quot; onchange=&quot;parametersChanged()&quot;&gt;
                                        &lt;option value=&quot;0&quot; &lt;% if(aNode.getPrimaryValue().equals(&quot;0&quot;)) { %&gt; selected &lt;% } %&gt;&gt;&lt;bean:message key=&quot;gender.0.short&quot;/&gt;&lt;/option&gt;
                                        &lt;option value=&quot;1&quot; &lt;% if(aNode.getPrimaryValue().equals(&quot;1&quot;)) { %&gt; selected &lt;% } %&gt;&gt;&lt;bean:message key=&quot;gender.1.short&quot;/&gt;&lt;/option&gt;
                                        &lt;agn:ShowByPermission token=&quot;use_extended_gender&quot;&gt;
@@ -184,13 +168,13 @@
                                        &lt;option value=&quot;2&quot; &lt;% if(aNode.getPrimaryValue().equals(&quot;2&quot;)) { %&gt; selected &lt;% } %&gt;&gt;&lt;bean:message key=&quot;gender.2.short&quot;/&gt;&lt;/option&gt;
                                    &lt;/select&gt;
                             &lt;% } else { %&gt;
-                                &lt;input type=&quot;text&quot; style=&quot;width:100%&quot; size=&quot;60&quot; name=&quot;trgt_value&lt;%= index %&gt;&quot; value=&quot;&lt;%= aNode.getPrimaryValue() %&gt;&quot;&gt;
+                                &lt;input type=&quot;text&quot; style=&quot;width:100%&quot; size=&quot;60&quot; name=&quot;trgt_value&lt;%= index %&gt;&quot; value=&quot;&lt;%= aNode.getPrimaryValue() %&gt;&quot; onchange=&quot;parametersChanged()&quot;&gt;
                             &lt;% }
                            }
                        } %&gt;
                     &lt;% if(className.equals(&quot;org.agnitas.target.impl.TargetNodeNumeric&quot;) &amp;&amp; (aNode.getPrimaryOperator()==TargetNode.OPERATOR_MOD)) { %&gt;
                         &lt;input type=&quot;text&quot; style=&quot;width:38%&quot; name=&quot;trgt_value&lt;%= index %&gt;&quot; value=&quot;&lt;%= aNode.getPrimaryValue() %&gt;&quot;&gt;
-                         &lt;select style=&quot;width:20%&quot; name=&quot;trgt_sec_operator&lt;%= index %&gt;&quot;&gt;
+                         &lt;select style=&quot;width:20%&quot; name=&quot;trgt_sec_operator&lt;%= index %&gt;&quot; onchange=&quot;parametersChanged()&quot;&gt;
                            &lt;% String aOp2=null;
                               Iterator aIt2=(Arrays.asList(TargetNode.ALL_OPERATORS)).iterator();
                               for(int b=1; b&lt;=4; b++) {
@@ -202,13 +186,13 @@
                                &lt;% } 
                               } %&gt;
                         &lt;/select&gt;
-                        &lt;input style=&quot;width:38%&quot; type=&quot;text&quot; name=&quot;trgt_sec_value&lt;%= index %&gt;&quot; value=&quot;&lt;%= ((TargetNodeNumeric)aNode).getSecondaryValue() %&gt;&quot;&gt;
+                        &lt;input style=&quot;width:38%&quot; type=&quot;text&quot; name=&quot;trgt_sec_value&lt;%= index %&gt;&quot; value=&quot;&lt;%= ((TargetNodeNumeric)aNode).getSecondaryValue() %&gt;&quot; onchange=&quot;parametersChanged()&quot;&gt;
                     &lt;% }
                        if(className.equals(&quot;org.agnitas.target.impl.TargetNodeString&quot;) &amp;&amp; (aNode.getPrimaryOperator()!=TargetNode.OPERATOR_IS)) { %&gt;
-                        &lt;input type=&quot;text&quot; style=&quot;width:100%&quot; name=&quot;trgt_value&lt;%= index %&gt;&quot; value=&quot;&lt;%= aNode.getPrimaryValue() %&gt;&quot;&gt;
+                        &lt;input type=&quot;text&quot; style=&quot;width:100%&quot; name=&quot;trgt_value&lt;%= index %&gt;&quot; value=&quot;&lt;%= aNode.getPrimaryValue() %&gt;&quot; onchange=&quot;parametersChanged()&quot;&gt;
                     &lt;% } %&gt;
                     &lt;% if(aNode.getPrimaryOperator()==TargetNode.OPERATOR_IS) { %&gt;
-                        &lt;select name=&quot;trgt_value&lt;%= index %&gt;&quot; size=&quot;1&quot; style=&quot;width:100%&quot;&gt;
+                        &lt;select name=&quot;trgt_value&lt;%= index %&gt;&quot; size=&quot;1&quot; style=&quot;width:100%&quot; onchange=&quot;parametersChanged()&quot;&gt;
                             &lt;option value=&quot;null&quot; &lt;% if(aNode.getPrimaryValue().equals(&quot;null&quot;)){ %&gt;selected&lt;%}%&gt;&gt;null&lt;/option&gt;
                             &lt;option value=&quot;not null&quot; &lt;% if(aNode.getPrimaryValue().equals(&quot;not null&quot;)){ %&gt;selected&lt;%}%&gt;&gt;not null&lt;/option&gt;
                         &lt;/select&gt;
@@ -216,7 +200,7 @@
                 &lt;/td&gt;
                 &lt;!-- Bracket-Close Y/N --&gt;
                 &lt;td&gt;
-                    &lt;select name=&quot;trgt_bracketclose&lt;%= index %&gt;&quot; size=&quot;1&quot;&gt;
+                    &lt;select name=&quot;trgt_bracketclose&lt;%= index %&gt;&quot; size=&quot;1&quot; onchange=&quot;parametersChanged()&quot;&gt;
                         &lt;option value=&quot;0&quot; &lt;% if(!aNode.isCloseBracketAfter()) { %&gt;selected&lt;% } %&gt;&gt;&amp;nbsp;&lt;/option&gt;
                         &lt;option value=&quot;1&quot; &lt;% if(aNode.isCloseBracketAfter()) { %&gt;selected&lt;% } %&gt;&gt;)&lt;/option&gt;
                     &lt;/select&gt;
@@ -231,7 +215,7 @@
             &lt;!-- AND/OR --&gt;
             &lt;td&gt;
                 &lt;% if(!isFirst) { %&gt;
-                    &lt;select name=&quot;trgt_chainop0&quot; size=&quot;1&quot;&gt;
+                    &lt;select name=&quot;trgt_chainop0&quot; size=&quot;1&quot; onchange=&quot;parametersChanged()&quot;&gt;
                         &lt;option value=&quot;1&quot; selected&gt;&lt;bean:message key=&quot;and&quot;/&gt;&lt;/option&gt;
                         &lt;option value=&quot;2&quot;&gt;&lt;bean:message key=&quot;or&quot;/&gt;&lt;/option&gt;
                     &lt;/select&gt;
@@ -241,14 +225,14 @@
             &lt;/td&gt;
             &lt;!-- Bracket-Open Y/N --&gt;
             &lt;td&gt;
-                &lt;select name=&quot;trgt_bracketopen0&quot; size=&quot;1&quot;&gt;
+                &lt;select name=&quot;trgt_bracketopen0&quot; size=&quot;1&quot; onchange=&quot;parametersChanged()&quot;&gt;
                     &lt;option value=&quot;0&quot; selected&gt;&amp;nbsp;&lt;/option&gt;
                     &lt;option value=&quot;1&quot;&gt;(&lt;/option&gt;
                 &lt;/select&gt;
             &lt;/td&gt;
             &lt;!-- Column-Select --&gt;
             &lt;td&gt;
-                &lt;select name=&quot;trgt_column0&quot; size=&quot;1&quot;&gt;
+                &lt;select name=&quot;trgt_column0&quot; size=&quot;1&quot; onchange=&quot;parametersChanged()&quot;&gt;
                     &lt;agn:ShowColumnInfo id=&quot;colsel&quot; table=&quot;&lt;%= AgnUtils.getCompanyID(request) %&gt;&quot;&gt;
                         &lt;% if(pageContext.getAttribute(&quot;_colsel_shortname&quot;).equals(&quot;email&quot;)) { %&gt;
                             &lt;option value=&quot;&lt;%= pageContext.getAttribute(&quot;_colsel_column_name&quot;) %&gt;#&lt;%= pageContext.getAttribute(&quot;_colsel_data_type&quot;) %&gt;&quot; selected&gt;&lt;%= pageContext.getAttribute(&quot;_colsel_shortname&quot;) %&gt;&lt;/option&gt;
@@ -262,7 +246,7 @@
             &lt;/td&gt;
             &lt;!-- Operator-Select --&gt;
             &lt;td&gt;
-                &lt;select name=&quot;trgt_operator0&quot; size=&quot;1&quot;&gt;
+                &lt;select name=&quot;trgt_operator0&quot; size=&quot;1&quot; onchange=&quot;parametersChanged()&quot;&gt;
                     &lt;%
                        int idx=1;
                        String aOp=null;
@@ -280,11 +264,11 @@
             &lt;/td&gt;
             &lt;!-- Value-Input --&gt;
             &lt;td&gt;
-                &lt;input type=&quot;text&quot; style=&quot;width:200px&quot; name=&quot;trgt_value0&quot; value=&quot;&quot;&gt;
+                &lt;input type=&quot;text&quot; style=&quot;width:200px&quot; name=&quot;trgt_value0&quot; value=&quot;&quot; onchange=&quot;parametersChanged()&quot;&gt;
             &lt;/td&gt;
             &lt;!-- Bracket-Close Y/N --&gt;
             &lt;td&gt;
-                &lt;select name=&quot;trgt_bracketclose0&quot; size=&quot;1&quot;&gt;
+                &lt;select name=&quot;trgt_bracketclose0&quot; size=&quot;1&quot; onchange=&quot;parametersChanged()&quot;&gt;
                     &lt;option value=&quot;0&quot; selected&gt;&amp;nbsp;&lt;/option&gt;
                     &lt;option value=&quot;1&quot;&gt;)&lt;/option&gt;
                 &lt;/select&gt;
@@ -308,7 +292,7 @@
                 &lt;tr&gt;&lt;td colspan=5&gt;&lt;br&gt;&lt;hr&gt;&lt;/td&gt;&lt;/tr&gt;
                 &lt;tr&gt;
                     &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;Mailinglist&quot;/&gt;:&lt;/b&gt;&lt;br&gt;
-                    &lt;select name=&quot;listID&quot;&gt;
+                    &lt;select name=&quot;listID&quot; onchange=&quot;parametersChanged()&quot;&gt;
                         &lt;option value=&quot;0&quot; &lt;%if(mailingListID==0) {%&gt; selected &lt;%}%&gt; &gt;&lt;bean:message key=&quot;All_Mailinglists&quot;/&gt;&lt;/option&gt;
                         &lt;agn:ShowTable id=&quot;agntbl2&quot; sqlStatement=&quot;&lt;%= new String(&quot;SELECT mailinglist_id, shortname FROM mailinglist_tbl WHERE company_id=&quot;+AgnUtils.getCompanyID(request)) %&gt;&quot; maxRows=&quot;100&quot;&gt;
                            &lt;option value=&quot;&lt;%= pageContext.getAttribute(&quot;_agntbl2_mailinglist_id&quot;) %&gt;&quot; &lt;%if(Integer.toString(mailingListID).equals(pageContext.getAttribute(&quot;_agntbl2_mailinglist_id&quot;))) {%&gt; selected &lt;%}%&gt; &gt;&lt;%= pageContext.getAttribute(&quot;_agntbl2_shortname&quot;) %&gt;&lt;/option&gt;
@@ -317,7 +301,7 @@
                   &lt;/td&gt;
                   
                  &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;Target&quot;/&gt;:&lt;/b&gt;&lt;br&gt;
-                    &lt;select name=&quot;targetID&quot;&gt;
+                    &lt;select name=&quot;targetID&quot; onchange=&quot;parametersChanged()&quot;&gt;
                         &lt;option value=&quot;0&quot; &lt;%if(targetID==0) {%&gt; selected &lt;%}%&gt; &gt;&lt;bean:message key=&quot;All&quot;/&gt;&lt;/option&gt;
                         &lt;agn:ShowTable id=&quot;agntbl3&quot; sqlStatement=&quot;&lt;%= new String(&quot;SELECT target_id, target_shortname FROM dyn_target_tbl WHERE company_id=&quot;+AgnUtils.getCompanyID(request)) %&gt;&quot; maxRows=&quot;200&quot;&gt;
                            &lt;option value=&quot;&lt;%= pageContext.getAttribute(&quot;_agntbl3_target_id&quot;) %&gt;&quot; &lt;%if(Integer.toString(targetID).equals(pageContext.getAttribute(&quot;_agntbl3_target_id&quot;))) {%&gt; selected &lt;%}%&gt; &gt;&lt;%= pageContext.getAttribute(&quot;_agntbl3_target_shortname&quot;) %&gt;&lt;/option&gt;
@@ -328,7 +312,7 @@
                   
 
                   &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;RecipientType&quot;/&gt;:&lt;/b&gt;&lt;br&gt;
-                    &lt;select name=&quot;user_type&quot;&gt;  &lt;!-- usr type; 'E' for everybody --&gt;
+                    &lt;select name=&quot;user_type&quot; onchange=&quot;parametersChanged()&quot;&gt;  &lt;!-- usr type; 'E' for everybody --&gt;
                         &lt;option value=&quot;E&quot; &lt;%if(user_type.equals(&quot;E&quot;)) {%&gt; selected &lt;%}%&gt; &gt;&lt;bean:message key=&quot;All&quot;/&gt;&lt;/option&gt;
                         &lt;option value=&quot;A&quot; &lt;%if(user_type.equals(&quot;A&quot;)) {%&gt; selected &lt;%}%&gt; &gt;&lt;bean:message key=&quot;Administrator&quot;/&gt;&lt;/option&gt;
                         &lt;option value=&quot;T&quot; &lt;%if(user_type.equals(&quot;T&quot;)) {%&gt; selected &lt;%}%&gt; &gt;&lt;bean:message key=&quot;TestSubscriber&quot;/&gt;&lt;/option&gt;
@@ -337,7 +321,7 @@
                   &lt;/td&gt;
                   
                   &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;RecipientStatus&quot;/&gt;:&lt;/b&gt;&lt;br&gt;
-                    &lt;select name=&quot;user_status&quot;&gt;  &lt;!-- usr status; '0' is for everybody --&gt;
+                    &lt;select name=&quot;user_status&quot; onchange=&quot;parametersChanged()&quot;&gt;  &lt;!-- usr status; '0' is for everybody --&gt;
                         &lt;option value=&quot;0&quot; &lt;%if(user_status==0) {%&gt; selected &lt;%}%&gt; &gt;&lt;bean:message key=&quot;All&quot;/&gt;&lt;/option&gt;
                         &lt;option value=&quot;1&quot; &lt;%if(user_status==1) {%&gt; selected &lt;%}%&gt; &gt;&lt;bean:message key=&quot;Active&quot;/&gt;&lt;/option&gt;
                         &lt;option value=&quot;2&quot; &lt;%if(user_status==2) {%&gt; selected &lt;%}%&gt; &gt;&lt;bean:message key=&quot;Bounced&quot;/&gt;&lt;/option&gt;
@@ -357,7 +341,7 @@
         		&lt;tr&gt;       	
 				&lt;td&gt;&lt;bean:message key=&quot;Admin.numberofrows&quot;/&gt;&lt;/td&gt; 
 				&lt;td&gt;									
-					&lt;html:select property=&quot;numberofRows&quot;&gt;
+					&lt;html:select property=&quot;numberofRows&quot; onchange=&quot;parametersChanged()&quot;&gt;
                 		&lt;%
                 			String[] sizes={&quot;20&quot;,&quot;50&quot;,&quot;100&quot;};
                 			for( int i=0;i&lt; sizes.length; i++ )
@@ -375,9 +359,8 @@
         &lt;/td&gt;
         &lt;/tr&gt;	
     &lt;/html:form&gt;
-    &lt;tr&gt;&lt;td colspan=5&gt;
-    &lt;ajax:displayTag id=&quot;recipientTable&quot; tableClass=&quot;dataTable&quot; ajaxFlag=&quot;displayAjax&quot; parameters=&quot;listID,action,targetID,user_type,user_status&quot;&gt;
-    &lt;display:table class=&quot;dataTable&quot; pagesize=&quot;${recipientForm.numberofRows}&quot; id=&quot;recipient&quot; name=&quot;recipientList&quot; sort=&quot;external&quot; requestURI=&quot;/recipient.do?action=${ACTION_LIST}&quot; excludedParams=&quot;*&quot; &gt;
+    &lt;tr&gt;&lt;td colspan=&quot;5&quot;&gt;
+    &lt;display:table class=&quot;dataTable&quot; pagesize=&quot;${recipientForm.numberofRows}&quot; id=&quot;recipient&quot; name=&quot;recipientList&quot; sort=&quot;external&quot; requestURI=&quot;/recipient.do?action=${ACTION_LIST}&quot; excludedParams=&quot;*&quot; partialList=&quot;true&quot; size=&quot;${recipientList.fullListSize}&quot;&gt;
     	&lt;display:column class=&quot;name&quot; headerClass=&quot;head_name&quot; titleKey=&quot;Salutation&quot; &gt;    	
     		&lt;bean:message key=&quot;gender.${recipient.gender}.short&quot;/&gt; 
     	&lt;/display:column&gt;
@@ -393,7 +376,7 @@
         &lt;/agn:ShowByPermission&gt;	
     	&lt;/display:column&gt;    
     &lt;/display:table&gt;
-     &lt;/ajax:displayTag&gt;
     &lt;/td&gt;&lt;/tr&gt;
+    &lt;tr&gt;&lt;td colspan=&quot;5&quot;&gt;&lt;bean:message key=&quot;Total&quot;/&gt;&amp;nbsp;&lt;bean:message key=&quot;Recipients&quot;/&gt;:&amp;nbsp;&lt;%= aForm.getAll() %&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt;
 &lt;%@include file=&quot;/footer.jsp&quot;%&gt;</diff>
      <filename>src/jsp/recipient/list.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -74,6 +74,7 @@ if(recipient.getRecipientID()!=0) {
     &lt;html:hidden property=&quot;user_type&quot;/&gt;
     &lt;html:hidden property=&quot;user_status&quot;/&gt;
     &lt;html:hidden property=&quot;listID&quot;/&gt;
+    &lt;html:hidden property=&quot;targetID&quot;/&gt;
 
     &lt;tr&gt;
        &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;Salutation&quot;/&gt;:&lt;/b&gt;&lt;/td&gt;</diff>
      <filename>src/jsp/recipient/view.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, java.util.*&quot; contentType=&quot;text/html; charset=utf-8&quot; buffer=&quot;32kb&quot; errorPage=&quot;/error.jsp&quot;%&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.web.forms.*, java.util.*&quot; contentType=&quot;text/html; charset=utf-8&quot; buffer=&quot;32kb&quot; errorPage=&quot;/error.jsp&quot;%&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
@@ -28,7 +28,8 @@
 
 &lt;agn:CheckLogon/&gt;
 
-&lt;% int tmpAdminID=0;
+&lt;%
+   int tmpAdminID=0;
    String tmpUsername=new String(&quot;&quot;);
    if(request.getAttribute(&quot;adminForm&quot;)!=null) {
       tmpAdminID=((AdminForm)request.getAttribute(&quot;adminForm&quot;)).getAdminID();</diff>
      <filename>src/jsp/settings/admin/delete.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.beans.*&quot; errorPage=&quot;/error.jsp&quot;%&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.web.forms.*, org.agnitas.beans.*&quot; errorPage=&quot;/error.jsp&quot;%&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;</diff>
      <filename>src/jsp/settings/admin/list.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.beans.Admin, java.util.*&quot; contentType=&quot;text/html; charset=utf-8&quot; buffer=&quot;64kb&quot; errorPage=&quot;/error.jsp&quot;%&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.web.forms.*, org.agnitas.beans.Admin, java.util.*&quot; contentType=&quot;text/html; charset=utf-8&quot; buffer=&quot;64kb&quot; errorPage=&quot;/error.jsp&quot;%&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
@@ -30,7 +30,8 @@
 
 &lt;agn:Permission token=&quot;admin.show&quot;/&gt;
 
-&lt;% int tmpAdminID = 0;
+&lt;%
+   int tmpAdminID = 0;
    int tmpCompID = 0;
    String tmpUser = &quot;&quot;;
    int i=1;
@@ -43,7 +44,8 @@
       tmpAdminID=((AdminForm)request.getAttribute(&quot;adminForm&quot;)).getAdminID();
       userrights=((AdminForm)request.getAttribute(&quot;adminForm&quot;)).getUserRights();
       grouprights=((AdminForm)request.getAttribute(&quot;adminForm&quot;)).getGroupRights();
-   } %&gt;
+   }
+%&gt;
 
 &lt;% pageContext.setAttribute(&quot;agnSubtitleKey&quot;, new String(&quot;Admin&quot;)); %&gt;              &lt;!-- ueber rechte Seite --&gt;
 &lt;% pageContext.setAttribute(&quot;sidemenu_active&quot;, new String(&quot;Settings&quot;)); %&gt;          &lt;!-- links Button --&gt;</diff>
      <filename>src/jsp/settings/admin/rights.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  * 
  * Contributor(s): AGNITAS AG. 
  ********************************************************************************/
- --%&gt;&lt;%@ page language=&quot;java&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.beans.Admin, java.util.*&quot; contentType=&quot;text/html; charset=utf-8&quot; errorPage=&quot;/error.jsp&quot;%&gt;
+ --%&gt;&lt;%@ page language=&quot;java&quot; import=&quot;org.agnitas.util.*, org.agnitas.web.*, org.agnitas.web.forms.*, org.agnitas.beans.Admin, java.util.*&quot; contentType=&quot;text/html; charset=utf-8&quot; errorPage=&quot;/error.jsp&quot;%&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/agnitas-taglib.tld&quot; prefix=&quot;agn&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %&gt;
 &lt;%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %&gt;
@@ -30,7 +30,8 @@
 
 &lt;agn:Permission token=&quot;admin.show&quot;/&gt;
 
-&lt;% int tmpAdminID=0;
+&lt;%
+   int tmpAdminID=0;
    String tmpUsername=new String(&quot;&quot;);
    int tmpCompanyID=0;
    if(request.getAttribute(&quot;adminForm&quot;)!=null) {</diff>
      <filename>src/jsp/settings/admin/view.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -160,39 +160,124 @@
               &lt;/td&gt;
           &lt;/tr&gt;
   
-            &lt;script type=&quot;text/javascript&quot;&gt;
-                &lt;!--
-                   var oFCKeditorHtml=null;
-                   function editHtmlHtml() {
-                     if(oFCKeditorHtml==null) {
-                       oFCKeditorHtml = new FCKeditor( 'arHtml' ) ;
-                       oFCKeditorHtml.Config[ &quot;AutoDetectLanguage&quot; ] = false ;
-                       oFCKeditorHtml.Config[ &quot;DefaultLanguage&quot; ] = &quot;&lt;%= aLocale.getLanguage() %&gt;&quot; ;
-                       oFCKeditorHtml.Config[ &quot;BaseHref&quot; ] = baseUrl+&quot;/fckeditor2.5/&quot; ;
-                       oFCKeditorHtml.Config[ &quot;CustomConfigurationsPath&quot; ] = &quot;&lt;html:rewrite page=&quot;/fckeditor2.5/emmconfig.jsp?mailingID=0&quot;/&gt;&quot; ;
-                       oFCKeditorHtml.ToolbarSet = &quot;emm&quot; ;
-                       oFCKeditorHtml.BasePath = baseUrl+&quot;/fckeditor2.5/&quot; ;
-                       oFCKeditorHtml.Height = &quot;400&quot; ; // 400 pixels
-                       oFCKeditorHtml.Width = 650 ; // 400 pixels
-                       oFCKeditorHtml.ReplaceTextarea();
-                     }
-                     return true;
-                   }
-                  //--&gt;
-                  &lt;/script&gt;
-               
+   &lt;script type=&quot;text/javascript&quot;&gt;
+       var isFCKEditorActive=false;
+       function Toggle()
+		{
+				// Try to get the FCKeditor instance, if available.
+			var oEditor ;
+			if ( typeof( FCKeditorAPI ) != 'undefined' )
+				oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
+
+			// Get the _Textarea and _FCKeditor DIVs.
+			var eTextareaDiv	= document.getElementById( 'Textarea' ) ;
+			var eFCKeditorDiv	= document.getElementById( 'FCKeditor' ) ;
+
+			// If the _Textarea DIV is visible, switch to FCKeditor.
+			if ( eTextareaDiv.style.display != 'none' )
+			{
+			// If it is the first time, create the editor.
+			if ( !oEditor )
+			{
+				CreateEditor() ;
+			}
+			else
+			{
+				// Set the current text in the textarea to the editor.
+				oEditor.SetData( document.getElementById('newContent').value ) ;
+			}
+
+			// Switch the DIVs display.
+			eTextareaDiv.style.display = 'none' ;
+			eFCKeditorDiv.style.display = '' ;
+
+			// This is a hack for Gecko 1.0.x ... it stops editing when the editor is hidden.
+			if ( oEditor &amp;&amp; !document.all )
+			{
+				if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
+				oEditor.MakeEditable() ;
+			}
+			isFCKEditorActive=true;
+		}
+		else
+		{
+			// Set the textarea value to the editor value.
+			document.getElementById('newContent').value = oEditor.GetXHTML() ;
+
+			// Switch the DIVs display.
+			eTextareaDiv.style.display = '' ;
+			eFCKeditorDiv.style.display = 'none' ;
+			isFCKEditorActive=false;
+		}
+	}
+
+	function CreateEditor()
+	{
+		// Copy the value of the current textarea, to the textarea that will be used by the editor.
+		document.getElementById('DataFCKeditor').value = document.getElementById('newContent').value ;
+
+		// Automatically calculates the editor base path based on the _samples directory.
+		// This is usefull only for these samples. A real application should use something like this:
+		// oFCKeditor.BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
+	
+		// Create an instance of FCKeditor (using the target textarea as the name).
+		
+		oFCKeditorNew = new FCKeditor( 'DataFCKeditor' ) ;
+        oFCKeditorNew.Config[ &quot;AutoDetectLanguage&quot; ] = false ;
+        oFCKeditorNew.Config[ &quot;DefaultLanguage&quot; ] = &quot;&lt;%= ((Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY)).getLanguage() %&gt;&quot; ;
+        oFCKeditorNew.Config[ &quot;BaseHref&quot; ] = baseUrl+&quot;/fckeditor2.5/&quot; ;
+        oFCKeditorNew.Config[ &quot;CustomConfigurationsPath&quot; ] = &quot;&lt;html:rewrite page=&quot;&lt;%= new String(&quot;/fckeditor2.5/emmconfig.jsp?mailingID=0&quot;) %&gt;&quot;/&gt;&quot; ;
+        oFCKeditorNew.ToolbarSet = &quot;emm&quot; ;
+        oFCKeditorNew.BasePath = baseUrl+&quot;/fckeditor2.5/&quot; ;
+        oFCKeditorNew.Height = &quot;400&quot; ; // 400 pixels
+        oFCKeditorNew.Width = &quot;650&quot; ;
+        oFCKeditorNew.ReplaceTextarea();
+			
+		
+	}
+
+	// The FCKeditor_OnComplete function is a special function called everytime an
+	// editor instance is completely loaded and available for API interactions.
+	function FCKeditor_OnComplete( editorInstance )
+	{
+		// Switch Image ??
+	}
+
+	function PrepareSave()
+	{
+		// If the textarea isn't visible update the content from the editor.
+		if ( document.getElementById( 'Textarea' ).style.display == 'none' )
+		{
+			var oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
+			document.getElementById( 'newContent' ).value = oEditor.GetXHTML() ;
+		}
+		
+	}
+	function save() {
+		if(isFCKEditorActive== true)  {
+			var oEditor = FCKeditorAPI.GetInstance( 'DataFCKeditor' ) ;
+			document.getElementById('newContent').value = oEditor.GetXHTML() ;
+		}
+	}
+	
+	
+        &lt;/script&gt;
           &lt;tr&gt; 
               &lt;td&gt;&lt;bean:message key=&quot;HTML_Version&quot;/&gt;:&amp;nbsp;&lt;/td&gt;
               &lt;td&gt;
-                  &lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;edit.gif&quot; border=&quot;0&quot; onclick=&quot;editHtmlHtml();&quot; alt=&quot;&lt;bean:message key=&quot;htmled.title&quot;/&gt;&quot;&gt;&lt;br&gt;
-                  &lt;html:textarea property=&quot;arHtml&quot; rows=&quot;14&quot; cols=&quot;75&quot;/&gt;
+                  &lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;edit.gif&quot; border=&quot;0&quot; onclick=&quot;Toggle();&quot; alt=&quot;&lt;bean:message key=&quot;htmled.title&quot;/&gt;&quot;&gt;&lt;br&gt;
+                  &lt;div id=&quot;Textarea&quot;&gt;
+        				&lt;html:textarea property=&quot;arHtml&quot; styleId=&quot;newContent&quot; rows=&quot;14&quot; cols=&quot;75&quot;/&gt;&amp;nbsp;
+        		&lt;/div&gt;
+        		&lt;div id=&quot;FCKeditor&quot; style=&quot;display: none&quot;&gt;
+        			&lt;textarea  id=&quot;DataFCKeditor&quot; rows=&quot;14&quot; cols=&quot;75&quot;&gt;&lt;/textarea&gt;
               &lt;/td&gt;
           &lt;/tr&gt;
  
           &lt;tr&gt;
               &lt;td colspan=2&gt;
 
-                  &lt;html:image src=&quot;button?msg=Save&quot; border=&quot;0&quot; property=&quot;save&quot; value=&quot;save&quot;/&gt;&amp;nbsp;
+                  &lt;html:image src=&quot;button?msg=Save&quot; border=&quot;0&quot; property=&quot;save&quot; value=&quot;save&quot; onclick=&quot;save();&quot;/&gt;&amp;nbsp;
               
               
                   &lt;logic:notEqual name=&quot;mailloopForm&quot; property=&quot;mailloopID&quot; value=&quot;0&quot;&gt;</diff>
      <filename>src/jsp/settings/mailloop/view.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -37,29 +37,28 @@
 &lt;%@include file=&quot;/header.jsp&quot;%&gt;
 &lt;% int i=1; %&gt;
 &lt;html:errors/&gt;
-                     &lt;table border=&quot;0&quot; cellspacing=&quot;10&quot; cellpadding=&quot;0&quot;&gt;
-                        &lt;tr&gt;
-                        &lt;agn:ShowNavigation navigation=&quot;SettingsSub&quot; highlightKey=&quot;&quot;&gt;
-                           &lt;agn:ShowByPermission token=&quot;&lt;%= _navigation_token %&gt;&quot;&gt;
-                            &lt;td&gt; &lt;table width=&quot;300&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
-                               &lt;tr&gt;
-                              &lt;td width =&quot;40&quot;&gt;&lt;html:link page=&quot;&lt;%= _navigation_href %&gt;&quot;&gt;&lt;img border=&quot;0&quot; width=&quot;40&quot; height=&quot;38&quot; src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;splash_settings_&lt;%= _navigation_navMsg.toLowerCase().replace('.', '_') %&gt;.gif&quot; alt=&quot;&lt;bean:message key=&quot;&lt;%= _navigation_navMsg %&gt;&quot;/&gt;&quot;&gt;&lt;/html:link&gt;&lt;/td&gt;
-                             &lt;td class=&quot;boxhead&quot; width=&quot;250&quot;&gt;&lt;html:link page=&quot;&lt;%= _navigation_href %&gt;&quot;&gt;&lt;span class=&quot;head1&quot;&gt;&lt;bean:message key=&quot;&lt;%= _navigation_navMsg %&gt;&quot;/&gt;&lt;/span&gt;&lt;/html:link&gt;&lt;/td&gt;
-                                 &lt;td width=&quot;10&quot;&gt;&lt;img width=&quot;10&quot; height=&quot;38&quot; src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;box_topright.gif&quot;&gt;&lt;/td&gt;
-                                  &lt;/tr&gt;
-                                  &lt;tr&gt;
-                                  &lt;td colspan=3 class=&quot;boxmiddle&quot; height=&quot;80&quot; width=&quot;300&quot;&gt;&lt;img src=&quot;images/emm/one_pixel.gif&quot; width=1 height=60 align=&quot;left&quot;&gt;&lt;html:link page=&quot;&lt;%= _navigation_href %&gt;&quot;&gt;&lt;bean:message key=&quot;&lt;%= new String(&quot;splash.settings.&quot;+_navigation_navMsg) %&gt;&quot;/&gt;&lt;/html:link&gt;&lt;/td&gt;
-                                  &lt;/tr&gt;
-                                  &lt;tr&gt;
-                                  &lt;td width=&quot;40&quot;&gt;&lt;img width=&quot;40&quot; height=&quot;10&quot; src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;box_bottomleft.gif&quot; alt=&quot;&lt;bean:message key=&quot;&lt;%= _navigation_navMsg %&gt;&quot;/&gt;&quot;&gt;&lt;/td&gt;
-                                 &lt;td class=&quot;boxbottom&quot;&gt;&lt;/td&gt;
-                                 &lt;td width=&quot;10&quot;&gt;&lt;img width=&quot;10&quot; height=&quot;10&quot; src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;box_bottomright.gif&quot;&gt;&lt;/td&gt;
-                                  &lt;/tr&gt;
-                              &lt;/table&gt;
-                            &lt;/td&gt;
-                            &lt;% if(i==2) { %&gt; &lt;/tr&gt;&lt;tr&gt; &lt;% i=0; } i++; %&gt;
-                           &lt;/agn:ShowByPermission&gt;
-                        &lt;/agn:ShowNavigation&gt;
-                        &lt;/tr&gt;
-                     &lt;/table&gt;
-&lt;%@include file=&quot;/footer.jsp&quot;%&gt;
+	&lt;table border=&quot;0&quot; cellspacing=&quot;10&quot; cellpadding=&quot;0&quot;&gt;
+		&lt;tr&gt;
+			&lt;agn:ShowNavigation navigation=&quot;SettingsSub&quot; highlightKey=&quot;&quot;&gt;
+				&lt;agn:ShowByPermission token=&quot;&lt;%= _navigation_token %&gt;&quot;&gt;
+					&lt;td&gt; &lt;table width=&quot;300&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
+						&lt;tr&gt;
+							&lt;td width =&quot;40&quot;&gt;&lt;html:link page=&quot;&lt;%= _navigation_href %&gt;&quot;&gt;&lt;img border=&quot;0&quot; width=&quot;40&quot; height=&quot;38&quot; src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;splash_settings_&lt;%= _navigation_navMsg.toLowerCase().replace('.', '_') %&gt;.gif&quot; alt=&quot;&lt;bean:message key=&quot;&lt;%= _navigation_navMsg %&gt;&quot;/&gt;&quot;&gt;&lt;/html:link&gt;&lt;/td&gt;
+							&lt;td class=&quot;boxhead&quot; width=&quot;250&quot;&gt;&lt;html:link page=&quot;&lt;%= _navigation_href %&gt;&quot;&gt;&lt;span class=&quot;head1&quot;&gt;&lt;bean:message key=&quot;&lt;%= _navigation_navMsg %&gt;&quot;/&gt;&lt;/span&gt;&lt;/html:link&gt;&lt;/td&gt;
+							&lt;td width=&quot;10&quot;&gt;&lt;img width=&quot;10&quot; height=&quot;38&quot; src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;box_topright.gif&quot;&gt;&lt;/td&gt;
+						&lt;/tr&gt;
+						&lt;tr&gt;
+							&lt;td colspan=3 class=&quot;boxmiddle&quot; height=&quot;80&quot; width=&quot;300&quot;&gt;&lt;img src=&quot;images/emm/one_pixel.gif&quot; width=1 height=60 align=&quot;left&quot;&gt;&lt;html:link page=&quot;&lt;%= _navigation_href %&gt;&quot;&gt;&lt;bean:message key=&quot;&lt;%= new String(&quot;splash.settings.&quot;+_navigation_navMsg) %&gt;&quot;/&gt;&lt;/html:link&gt;&lt;/td&gt;
+						&lt;/tr&gt;
+						&lt;tr&gt;
+							&lt;td width=&quot;40&quot;&gt;&lt;img width=&quot;40&quot; height=&quot;10&quot; src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;box_bottomleft.gif&quot; alt=&quot;&lt;bean:message key=&quot;&lt;%= _navigation_navMsg %&gt;&quot;/&gt;&quot;&gt;&lt;/td&gt;
+							&lt;td class=&quot;boxbottom&quot;&gt;&lt;/td&gt;
+							&lt;td width=&quot;10&quot;&gt;&lt;img width=&quot;10&quot; height=&quot;10&quot; src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;box_bottomright.gif&quot;&gt;&lt;/td&gt;
+						&lt;/tr&gt;
+					&lt;/table&gt;&lt;/td&gt;
+				&lt;% if(i==2) { %&gt; &lt;/tr&gt;&lt;tr&gt; &lt;% i=0; } i++; %&gt;
+				&lt;/agn:ShowByPermission&gt;
+			&lt;/agn:ShowNavigation&gt;
+		&lt;/tr&gt;
+	&lt;/table&gt;
+&lt;%@include file=&quot;/footer.jsp&quot;%&gt;
\ No newline at end of file</diff>
      <filename>src/jsp/splash_settings.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -78,7 +78,7 @@
                 &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
                     &lt;tr&gt;
                         &lt;td valign=bottom&gt;
-                            &lt;bean:message key=&quot;Clicks&quot;/&gt;:&amp;nbsp;
+                            &lt;bean:message key=&quot;Opened_Mails&quot;/&gt;:&amp;nbsp;
                             &lt;hr size=&quot;1&quot; noshade&gt;
                             &lt;bean:message key=&quot;Time&quot;/&gt;:&amp;nbsp;
                             &lt;/a&gt;
@@ -130,7 +130,7 @@
         &lt;tr&gt;
             &lt;td&gt;              
                 &lt;hr size=&quot;1&quot; noshade&gt;
-                &lt;b&gt;&lt;bean:message key=&quot;Total&quot;/&gt;:&lt;/b&gt;&amp;nbsp;&lt;%= ((MailingStatForm)session.getAttribute(&quot;mailingStatForm&quot;)).getClicks()  %&gt;&amp;nbsp;&lt;bean:message key=&quot;Clicks&quot;/&gt;
+                &lt;b&gt;&lt;bean:message key=&quot;Total&quot;/&gt;:&lt;/b&gt;&amp;nbsp;&lt;%= ((MailingStatForm)session.getAttribute(&quot;mailingStatForm&quot;)).getClicks()  %&gt;&amp;nbsp;&lt;bean:message key=&quot;Opened_Mails&quot;/&gt;
                 &lt;html:link page=&quot;&lt;%= new String(&quot;/mailing_stat.do?action=&quot; + MailingStatAction.ACTION_MAILINGSTAT + &quot;&amp;mailingID=&quot; + tmpMailingID) %&gt;&quot;&gt;&lt;html:img src=&quot;button?msg=Back&quot; border=&quot;0&quot;/&gt;&lt;/html:link&gt;
             &lt;/td&gt;
         &lt;/tr&gt;</diff>
      <filename>src/jsp/stats/mailing_open_day.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -84,7 +84,7 @@
                 &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
                     &lt;tr&gt;
                         &lt;td width=&quot;80&quot; valign=bottom&gt;
-                            &lt;bean:message key=&quot;Clicks&quot;/&gt;:
+                            &lt;bean:message key=&quot;Opened_Mails&quot;/&gt;:
                             &lt;hr size=&quot;1&quot; noshade&gt;
                             &lt;bean:message key=&quot;Date&quot;/&gt;:
                             &lt;/a&gt;
@@ -172,7 +172,7 @@
         &lt;tr&gt;
             &lt;td&gt;              
                 &lt;hr size=&quot;1&quot; noshade&gt;
-                &lt;B&gt;&lt;bean:message key=&quot;Total&quot;/&gt;:&lt;/B&gt;&amp;nbsp;&lt;%= ((MailingStatForm)session.getAttribute(&quot;mailingStatForm&quot;)).getClicks()  %&gt;&amp;nbsp;&lt;bean:message key=&quot;Clicks&quot;/&gt;
+                &lt;B&gt;&lt;bean:message key=&quot;Total&quot;/&gt;:&lt;/B&gt;&amp;nbsp;&lt;%= ((MailingStatForm)session.getAttribute(&quot;mailingStatForm&quot;)).getClicks()  %&gt;&amp;nbsp;&lt;bean:message key=&quot;Opened_Mails&quot;/&gt;
                 &lt;html:link page=&quot;&lt;%= new String(&quot;/mailing_stat.do?action=&quot; + MailingStatAction.ACTION_MAILINGSTAT + &quot;&amp;mailingID=&quot; + tmpMailingID + &quot;&amp;targetID=&quot; + tmpTargetID) %&gt;&quot;&gt;&lt;html:img src=&quot;button?msg=Back&quot; border=&quot;0&quot;/&gt;&lt;/html:link&gt;
             &lt;/td&gt;
         &lt;/tr&gt;</diff>
      <filename>src/jsp/stats/mailing_open_week.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,6 @@
       tmpMailingID=aForm.getMailingID();
       tmpShortname=aForm.getMailingShortname();
    }
-    
 %&gt;
 
 &lt;% pageContext.setAttribute(&quot;sidemenu_active&quot;, new String(&quot;Mailings&quot;)); %&gt;
@@ -84,36 +83,30 @@ if(pageContext.getSession().getAttribute(&quot;map&quot;) == null) {
     &lt;html:hidden property=&quot;action&quot;/&gt;
     
 &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; width=&quot;100%&quot;&gt;
-    
     &lt;tr&gt;
         &lt;td&gt;&lt;span class=&quot;head3&quot;&gt;&lt;bean:message key=&quot;Opened_Mails&quot;/&gt;&lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;/td&gt;
         &lt;td align=&quot;right&quot;&gt;
         &amp;nbsp;
-        
             &lt;html:link page=&quot;&lt;%= new String(&quot;/file_download?key=&quot; + timekey) %&gt;&quot;&gt;&lt;img src=&quot;&lt;bean:write name=&quot;emm.layout&quot; property=&quot;baseUrl&quot; scope=&quot;session&quot;/&gt;icon_save.gif&quot; border=&quot;0&quot;&gt;&lt;/html:link&gt;
-        
        &lt;/td&gt;
     &lt;/tr&gt;
-
 &lt;/table&gt;
 
-
-
-
 &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
-
-
+	&lt;tr&gt;
+		&lt;td colspan=&quot;2&quot;&gt;&lt;html:link page=&quot;&lt;%= new String(&quot;/mailing_stat.do?action=&quot; + MailingStatAction.ACTION_OPEN_TIME + &quot;&amp;mailingID=&quot; + tmpMailingID) %&gt;&quot;&gt;&lt;b&gt;&lt;bean:message key=&quot;OpenTime&quot;/&gt;&lt;/b&gt;&lt;/html:link&gt;&lt;/td&gt;
+	&lt;/tr&gt;	
+	&lt;tr&gt;
+       &lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;
+    &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;domain&quot;/&gt;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
        &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;Opened_Mails&quot;/&gt;&lt;/b&gt;&lt;/td&gt;
-
     &lt;/tr&gt;
-
     &lt;tr&gt;
        &lt;td colspan=&quot;2&quot;&gt;&lt;hr&gt;&lt;/td&gt;
     &lt;/tr&gt;
 
-
 &lt;% Hashtable values = aForm.getValues();
    int i = 1;
    while (values.containsKey(new Integer(i))) { 
@@ -143,7 +136,6 @@ if(pageContext.getSession().getAttribute(&quot;map&quot;) == null) {
     &lt;tr&gt;
        &lt;td colspan=&quot;2&quot;&gt;&lt;hr&gt;&lt;/td&gt;
     &lt;/tr&gt;
-
     &lt;tr&gt;
        &lt;td&gt;&lt;b&gt;&lt;bean:message key=&quot;Total&quot;/&gt;&lt;/b&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
        &lt;td align=&quot;right&quot;&gt;&lt;b&gt;&lt;%=totalOp %&gt;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
@@ -153,20 +145,13 @@ if(pageContext.getSession().getAttribute(&quot;map&quot;) == null) {
    my_map.put(timekey,  file);
    pageContext.getSession().setAttribute(&quot;map&quot;, my_map);
  %&gt;
-
     &lt;tr&gt;
        &lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;
     &lt;/tr&gt;
-    &lt;tr&gt;
-		&lt;td colspan=&quot;2&quot;&gt;&lt;html:link page=&quot;&lt;%= new String(&quot;/mailing_stat.do?action=&quot; + MailingStatAction.ACTION_OPEN_TIME + &quot;&amp;mailingID=&quot; + tmpMailingID) %&gt;&quot;&gt;&lt;b&gt;&lt;bean:message key=&quot;OpenTime&quot;/&gt;&lt;/b&gt;&lt;/html:link&gt;&lt;/td&gt;
-	&lt;/tr&gt;
 	&lt;tr&gt;&lt;td&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;
        &lt;td colspan=&quot;2&quot;&gt;&lt;html:link page=&quot;&lt;%= new String(&quot;/mailing_stat.do?action=&quot; + MailingStatAction.ACTION_MAILINGSTAT) %&gt;&quot;&gt;&lt;html:img src=&quot;button?msg=Back&quot; border=&quot;0&quot;/&gt;&lt;/html:link&gt;&lt;/td&gt;
     &lt;/tr&gt;
-    
 &lt;/table&gt;
-
 &lt;/html:form&gt;
-
-&lt;%@include file=&quot;/footer.jsp&quot;%&gt;
+&lt;%@include file=&quot;/footer.jsp&quot;%&gt;
\ No newline at end of file</diff>
      <filename>src/jsp/stats/mailing_stat_opened.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 
-.dataTable {  text-align: left;  }
+.dataTable {  text-align: left;}
 .head_action {  width: 15px; padding-left: 5px;}
 .head_status {  width: 60px; padding-left: 5px;}
 .head_mailing {  width: 160px; padding-left: 5px;}
@@ -8,8 +8,7 @@
 .head_name {  width: 160px; padding-left: 5px;}
 .head_senddate {  width: 120px; padding-left: 5px;}
 .head_edit {  width: 60px; padding-left: 5px;}
-.head_firstname {  width: 120px; padding-left: 5px;}
-.head_lastname {  width: 120px; padding-left: 5px;}
+.head_email {  width: 350px; padding-left: 5px;}
 
 .action {  width: 15px; padding-left: 5px;}
 .status {  width: 60px; padding-left: 5px;}
@@ -19,8 +18,7 @@
 .name {  width: 160px; padding-left: 5px;}
 .senddate {  width: 120px; padding-left: 5px;}
 .edit {  width: 60px; padding-left: 5px;}
-.firstname {  width: 120px; padding-left: 5px;}
-.lastname {  width: 120px; padding-left: 5px;}
+.email {  width: 350px; padding-left: 5px;}
 
 thead tr {
 background-color:#D9E6F3;</diff>
      <filename>src/jsp/styles/displaytag.css</filename>
    </modified>
    <modified>
      <diff>@@ -152,6 +152,8 @@ cp = []
 # Optional commands
 if len (sys.argv) &gt; 1:
 	os.chdir (home)
+	versionTable = '__version'
+	curversion = '5.5.1'
 	if sys.argv[1] == 'setup':
 		show ('setup:\n')
 		show ('Setup database, please enter the super user password defined during MySQL instllation:\n')
@@ -161,6 +163,15 @@ if len (sys.argv) &gt; 1:
 		if os.system ('mysql -u root -p -e &quot;source USR_SHARE\\openemm.sql&quot; openemm'):
 			error ('Failed to setup database')
 		show ('Database setup completed.\n')
+		db = agn.DBase ()
+		if not db is None:
+			cursor = db.cursor ()
+			if not cursor is None:
+				cursor.execute ('CREATE TABLE %s (version varchar(50))' % versionTable)
+				cursor.execute ('INSERT INTO %s VALUES (:version)' % versionTable, {'version': curversion})
+				cursor.sync ()
+				cursor.close ()
+			db.close ()
 	if sys.argv[1] in ('setup', 'config'):
 		db = agn.DBase ()
 		if not db:
@@ -218,17 +229,16 @@ if len (sys.argv) &gt; 1:
 		i = db.cursor ()
 		if not i:
 			error ('Failed to connect to database')
-		table = '__version_tbl'
 		found = False
 		for r in i.query ('SHOW TABLES'):
-			if r[0] == table:
+			if r[0] == versionTable:
 				found = True
 				break
 		if not found:
 			version = '5.1.0'
 			tempfile = 'version.sql'
 			fd = open (tempfile, 'w')
-			fd.write ('CREATE TABLE %s (version varchar(50));\n' % table)
+			fd.write ('CREATE TABLE %s (version varchar(50));\n' % versionTable)
 			fd.close ()
 			show ('Database update, please enter your database super user password now\n')
 			st = os.system ('mysql -u root -p -e &quot;source %s&quot; openemm' % tempfile)
@@ -238,11 +248,11 @@ if len (sys.argv) &gt; 1:
 				pass
 			if st:
 				error ('Failed to setup database')
-			i.update ('INSERT INTO %s VALUES (:version)' % table, {'version': version })
+			i.update ('INSERT INTO %s VALUES (:version)' % versionTable, {'version': version })
 			db.commit ()
 		else:
 			version = None
-			for r in i.query ('SELECT version FROM %s' % table):
+			for r in i.query ('SELECT version FROM %s' % versionTable):
 				version = r[0]
 			if version is None:
 				error ('Found version table, but no content in table')
@@ -253,7 +263,6 @@ if len (sys.argv) &gt; 1:
 		ans = prompt ('It looks like your previous version is &quot;%s&quot;, is this corrent? [no] ' % version)
 		if not ans or not ans[0] in 'Yy':
 			error ('Version conflict!')
-		curversion = '5.5.0'
 		updates = []
 		for fname in os.listdir ('USR_SHARE'):
 			if fname.endswith ('.usql'):
@@ -282,7 +291,7 @@ if len (sys.argv) &gt; 1:
 						show ('No database update from %s to %s required\n' % (version, upd[1]))
 					version = upd[1]
 					seen.append (upd[2])
-					i.update ('UPDATE %s SET version = :version' % table, {'version': version})
+					i.update ('UPDATE %s SET version = :version' % versionTable, {'version': version})
 					db.commit ()
 					found = True
 					break</diff>
      <filename>src/script/control/openemm.py</filename>
    </modified>
    <modified>
      <diff>@@ -25,10 +25,11 @@
 **********************************************************************************
 Support routines for general and company specific purposes:
 	class struct:     general empty class for temp. structured data
-	class AgnError:   general exception thrown by this module (deprectated)
 	class error:	  new version for general execption
 	def chop:         removes trailing newlines
-	def atob:         converts a string to a boolean value  
+	def atob:         converts a string to a boolean value
+	def numfmt:       converts a number to pretty printed version
+	def validate:     validates an input string
 	def filecount:    counts files matching a pattern in a directory
 	def which:        finds program in path
 	def mkpath:       creates a path from path components
@@ -94,7 +95,14 @@ try:
 except ImportError:
 	database = None
 #
-version = ('2.0.1', '2008-06-17 10:46:41 CEST', 'ud')
+changelog = [
+	('2.0.0', '2008-04-18', 'Initial version of redesigned code', 'ud@agnitas.de'),
+	('2.0.1', '2008-07-01', 'Added autocommitment', 'ud@agnitas.de'),
+	('2.0.3', '2008-07-31', 'Template with inclusing support', 'ud@agnitas.de'),
+	('2.0.4', '2008-08-07', 'Added numfmt', 'ud@agnitas.de'),
+	('2.0.5', '2008-08-11', 'Added validate', 'ud@agnitas.de'),
+]
+version = (changelog[-1][0], '2008-08-21 16:03:52 CEST', 'ud')
 #
 verbose = 1
 system = platform.system ().lower ()
@@ -167,7 +175,6 @@ This is a general exception thrown by this module.&quot;&quot;&quot;
 	def __init__ (self, message = None):
 		Exception.__init__ (self, message)
 		self.msg = message
-AgnError = error
 
 def require (checkversion, checklicence = None):
 	if cmp (checkversion, version[0]) &gt; 0:
@@ -188,11 +195,71 @@ removes any trailing LFs and CRs.&quot;&quot;&quot;
 def atob (s):
 	&quot;&quot;&quot;def atob (s):
 
-tries to interpret the incoming string as a boolean value&quot;&quot;&quot;
+tries to interpret the incoming string as a boolean value.&quot;&quot;&quot;
 	if s and len (s) &gt; 0 and s[0] in [ '1', 'T', 't', 'Y', 'y', '+' ]:
 		return True
 	return False
 
+def numfmt (n, separator = '.'):
+	&quot;&quot;&quot;def numfmt (n, separator = '.'):
+
+convert the number to a more readble form using separator.&quot;&quot;&quot;
+	if n == 0:
+		return '0'
+	if n &lt; 0:
+		prefix = '-'
+		n = -n
+	else:
+		prefix = ''
+	rc = ''
+	while n &gt; 0:
+		if n &gt;= 1000:
+			rc = '%s%03d%s' % (separator, n % 1000, rc)
+		else:
+			rc = '%d%s' % (n, rc)
+		n /= 1000
+	return prefix + rc
+
+def validate (s, pattern, *funcs, **kw):
+	&quot;&quot;&quot;def validate (s, pattern *funcs):
+
+pattern is a regular expression where s is matched against.
+Each group element is validated against a function found in funcs.&quot;&quot;&quot;
+	if not pattern.startswith ('^'):
+		pattern = '^' + pattern
+	if not pattern.endswith ('$') or pattern.endswith ('\\$'):
+		pattern += '$'
+	try:
+		reflags = kw['flags']
+	except KeyError:
+		reflags = 0
+	try:
+		pat = re.compile (pattern, reflags)
+	except Exception, e:
+		raise error ('Failed to compile regular expression &quot;%s&quot;: %s' % (pattern, e.args[0]))
+	mtch = pat.match (s)
+	if mtch is None:
+		raise error ('No match')
+	if len (funcs) &gt; 0:
+		flen = len (funcs)
+		n = 0
+		report = []
+		grps = mtch.groups ()
+		if not grps:
+			grps = [mtch.group ()]
+		for elem in grps:
+			if n &lt; flen:
+				if type (funcs[n]) in (types.ListType, types.TupleType):
+					(func, reason) = funcs[n]
+				else:
+					func = funcs[n]
+					reason = '%r' % func
+				if not func (elem):
+					report.append ('Failed in group #%d: %s' % (n + 1, reason))
+			n += 1
+		if report:
+			raise error ('Validation failed: %s' % ', '.join (report))
+
 def filecount (directory, pattern):
 	&quot;&quot;&quot;def filecount (directory, pattern):
 
@@ -305,16 +372,21 @@ prints s with a newline appended to stderr.&quot;&quot;&quot;
 
 def transformSQLwildcard (s):
 	r = ''
+	needFinal = True
 	for ch in s:
+		needFinal = True
 		if ch in '$^*?()+[{]}|\\.':
 			r += '\\%s' % ch
 		elif ch == '%':
 			r += '.*'
+			needFinal = False
 		elif ch == '_':
 			r += '.'
 		else:
 			r += ch
-	return r + '$'
+	if needFinal:
+		r += '$'
+	return r
 def compileSQLwildcard (s, reFlags = 0):
 	return re.compile (transformSQLwildcard (s), reFlags)
 
@@ -898,6 +970,8 @@ def mailsend (relay, sender, receivers, headers, body,
 		return (rc, 'Missing relay\n')
 	if not sender:
 		return (rc, 'Missing sender\n')
+	if type (receivers) in types.StringTypes:
+		receivers = [receivers]
 	if len (receivers) == 0:
 		return (rc, 'Missing receivers\n')
 	if not body:
@@ -909,29 +983,30 @@ def mailsend (relay, sender, receivers, headers, body,
 		if codetype (code) != 2:
 			raise smtplib.SMTPResponseException (code, 'HELO ' + myself + ': ' + detail)
 		else:
-			report = report + 'HELO ' + myself + ' sent\n'
+			report += 'HELO %s sent\n%d %s recvd\n' % (myself, code, detail)
 		(code, detail) = s.mail (sender)
 		if codetype (code) != 2:
 			raise smtplib.SMTPResponseException (code, 'MAIL FROM:&lt;' + sender + '&gt;: ' + detail)
 		else:
-			report = report + 'MAIL FROM:&lt;' + sender + '&gt; sent\n'
+			report += 'MAIL FROM:&lt;%s&gt; sent\n%d %s recvd\n' % (sender, code, detail)
 		for r in receivers:
 			(code, detail) = s.rcpt (r)
 			if codetype (code) != 2:
 				raise smtplib.SMTPResponseException (code, 'RCPT TO:&lt;' + r + '&gt;: ' + detail)
 			else:
-				report = report + 'RCPT TO:&lt;' + r + '&gt; sent\n'
+				report += 'RCPT TO:&lt;%s&gt; sent\n%d %s recvd\n' % (r, code, detail)
 		mail = ''
 		hsend = False
 		hrecv = False
-		for h in headers:
-			if len (h) &gt; 0 and h[-1] != '\n':
-				h += '\n'
-			if not hsend and len (h) &gt; 5 and h[:5].lower () == 'from:':
-				hsend = True
-			elif not hrecv and len (h) &gt; 3 and h[:3].lower () == 'to:':
-				hrecv = True
-			mail = mail + h
+		if headers:
+			for h in headers:
+				if len (h) &gt; 0 and h[-1] != '\n':
+					h += '\n'
+				if not hsend and len (h) &gt; 5 and h[:5].lower () == 'from:':
+					hsend = True
+				elif not hrecv and len (h) &gt; 3 and h[:3].lower () == 'to:':
+					hrecv = True
+				mail = mail + h
 		if not hsend:
 			mail += 'From: ' + sender + '\n'
 		if not hrecv:
@@ -946,20 +1021,20 @@ def mailsend (relay, sender, receivers, headers, body,
 		if codetype (code) != 2:
 			raise smtplib.SMTPResponseException (code, 'DATA: ' + detail)
 		else:
-			report = report + 'DATA sent\n'
+			report += 'DATA sent\n%d %s recvd\n' % (code, detail)
 		s.quit ()
-		report = report + 'QUIT sent\n'
+		report += 'QUIT sent\n'
 		rc = True
 	except smtplib.SMTPConnectError, e:
-		report = report + 'Unable to connect to %s, got %d %s response\n' % (relay, e.smtp_code, e.smtp_error)
+		report += 'Unable to connect to %s, got %d %s response\n' % (relay, e.smtp_code, e.smtp_error)
 	except smtplib.SMTPServerDisconnected:
-		report = report + 'Server connection lost\n'
+		report += 'Server connection lost\n'
 	except smtplib.SMTPResponseException, e:
-		report = report + 'Invalid response: %d %s\n' % (e.smtp_code, e.smtp_error)
+		report += 'Invalid response: %d %s\n' % (e.smtp_code, e.smtp_error)
 	except socket.error, e:
-		report = report + 'General socket error: %s\n' % `e.args`
+		report += 'General socket error: %s\n' % `e.args`
 	except Exception, e:
-		report = report + 'General problems during mail sending: %s, %s\n' % (`type (e)`, `e.args`)
+		report += 'General problems during mail sending: %s, %s\n' % (`type (e)`, `e.args`)
 	return (rc, report)
 #}}}
 #
@@ -1134,8 +1209,9 @@ if database:
 			return record
 
 	class DBCursor:
-		def __init__ (self, db):
+		def __init__ (self, db, autocommit):
 			self.db = db
+			self.autocommit = autocommit
 			self.curs = None
 			self.desc = False
 			self.rfparse = re.compile (':[A-Za-z0-9_]+|%')
@@ -1177,10 +1253,6 @@ if database:
 				return self.curs.description
 			return None
 
-		#
-		# new interface using iterators and support for named
-		# parameter
-		#
 
 		def __reformat (self, req, parm):
 			try:
@@ -1285,7 +1357,7 @@ if database:
 				self.__error (e)
 				raise error ('update failed: ' + self.lastError ())
 			rows = self.curs.rowcount
-			if rows &gt; 0 and commit:
+			if rows &gt; 0 and (commit or self.autocommit):
 				if not self.sync ():
 					raise error ('commit failed: ' + self.lastError ())
 			self.desc = False
@@ -1353,16 +1425,21 @@ if database:
 			if self.db:
 				try:
 					curs = self.db.cursor ()
+					try:
+						if curs.arraysize &lt; 100:
+							curs.arraysize = 100
+					except AttributeError:
+						pass
 				except database.Error, err:
 					self.__error (err)
 			return curs
 
-		def cursor (self):
+		def cursor (self, autocommit = False):
 			c = None
 			if not self.db:
 				self.open ()
 			if self.db:
-				c = DBCursor (self)
+				c = DBCursor (self, autocommit)
 			return c
 		
 		def query (self, req):
@@ -1446,6 +1523,7 @@ are mostly transformed directly into a python construct:
 ## ...                      this introduces a comment up to end of line
 #property(expr)             this sets a property of the template
 #pragma(expr)               alias for property
+#include(expr)              inclusion of file, subclass must realize this
 #if(pyexpr)             --&gt; if pyexpr:
 #elif(pyexpr)           --&gt; elif pyexpr:
 #else                   --&gt; else
@@ -1496,7 +1574,7 @@ Dies ist ein Beispiel.
 &quot;&quot;&quot;
 	codeStart = re.compile ('^[ \t]*#code[^\n]*\n', re.IGNORECASE)
 	codeEnd = re.compile ('(^|\n)[ \t]*#end[^\n]*(\n|$)', re.IGNORECASE | re.MULTILINE)
-	token = re.compile ('((^|\n)[ \t]*#(#|property|pragma|if|elif|else|do|pass|break|continue|for|while|try|except|finally|with|end|stop)|\\$(\\$|[0-9a-z_]+(\\.[0-9a-z_]+)*|\\{[^}]*\\}))', re.IGNORECASE | re.MULTILINE)
+	token = re.compile ('((^|\n)[ \t]*#(#|property|pragma|include|if|elif|else|do|pass|break|continue|for|while|try|except|finally|with|end|stop)|\\$(\\$|[0-9a-z_]+(\\.[0-9a-z_]+)*|\\{[^}]*\\}))', re.IGNORECASE | re.MULTILINE)
 	rplc = re.compile ('\\\\|&quot;|\'|\n|\r|\t|\f|\v', re.MULTILINE)
 	rplcMap = {'\n': '\\n', '\r': '\\r', '\t': '\\t', '\f': '\\f', '\v': '\\v'}
 	langID = re.compile ('^([ \t]*)([a-z][a-z]):', re.IGNORECASE)
@@ -1662,8 +1740,17 @@ Dies ist ein Beispiel.
 					if token == '#':
 						while pos &lt; clen and self.content[pos] != '\n':
 							pos += 1
+						if pos &lt; clen:
+							pos += 1
 					elif token in ('property', 'pragma'):
 						self.__setProperty (arg)
+					elif token in ('include', ):
+						try:
+							included = self.include (arg)
+							if included:
+								self.content = self.content[:pos] + included + self.content[pos:]
+						except error, e:
+							self.__compileError (tstart, 'Failed to include &quot;%s&quot;: %s' % (arg, e.msg))
 					elif token in ('if', 'else', 'elif', 'for', 'while', 'try', 'except', 'finally', 'with'):
 						if token in ('else', 'elif', 'except', 'finally'):
 							if self.indent &gt; 0:
@@ -1715,6 +1802,9 @@ Dies ist ein Beispiel.
 					self.code += '\n'
 				self.code += self.postcode
 			self.compiled = compile (self.code, '&lt;template&gt;', 'exec')
+	
+	def include (self, arg):
+		raise error ('Subclass responsible for implementing &quot;include&quot;')
 
 	def property (self, var):
 		try:</diff>
      <filename>src/script/lib/agn.py</filename>
    </modified>
    <modified>
      <diff>@@ -30,6 +30,15 @@ import	agn
 agn.require ('2.0.0')
 agn.loglevel = agn.LV_INFO
 #
+
+if not agn.iswin:
+	try:
+		import	smenable
+	except ImportError:
+		smenable = None
+else:
+	smenable = None
+#
 delay = 180
 
 configFilename = agn.base + os.sep + 'var' + os.sep + 'spool' + os.sep + 'bav' + os.sep + 'bav.conf'
@@ -133,6 +142,16 @@ class Data:
 		self.last = ''
 		self.autoresponder = []
 		self.mtdom = {}
+
+		self.sendmailFree = False
+		if agn.iswin:
+			self.sendmailFree = True
+		else:
+			if not smenable is None:
+				sm = smenable.SMCtrl ()
+				if sm.valid and not sm.enabled ():
+					self.sendmailFree = True
+				sm.done ()
 		self.readMailertable ()
 		try:
 			files = os.listdir (arDirectory)
@@ -148,11 +167,20 @@ class Data:
 		self.domains = []
 		self.mtdom = {}
 
-		if agn.iswin:
+		if self.sendmailFree:
 			self.domains = [self.fixdomain]
 			me = socket.getfqdn ()
 			if me:
 				self.domains.append (me)
+			db = agn.DBase ()
+			if not db is None:
+				c = db.cursor ()
+				if not c is None:
+					for r in c.query ('SELECT mailloop_domain FROM company_tbl'):
+						if r[0] and not r[0] in self.domains:
+							self.domains.append (r[0])
+					c.close ()
+				db.close ()
 			return
 		try:
 			for line in fileReader (mailBase + '/mailertable'):
@@ -189,7 +217,7 @@ class Data:
 	def readMailFiles (self):
 		rc = ''
 
-		if agn.iswin:
+		if self.sendmailFree:
 			return rc
 		try:
 			for line in fileReader (mailBase + '/local-host-names'):
@@ -267,7 +295,8 @@ class Data:
 									domains.append (cdomain)
 
 								else:
-									agn.log (agn.LV_ERROR, 'data', 'Companys domain &quot;%s&quot; not found in mailertable' % cdomain)
+
+									agn.log (agn.LV_WARNING, 'data', 'Domain &quot;%s&quot; not known' % cdomain)
 							except KeyError:
 								agn.log (agn.LV_DEBUG, 'data', 'No domain for company found, further processing')
 						if domains is None:</diff>
      <filename>src/script/process/bav-update.py</filename>
    </modified>
    <modified>
      <diff>@@ -666,7 +666,7 @@ class BAV:
 		else:
 			parm = 'sent'
 		self.saveMessage (parm)
-		if match is None:
+		if parm == 'sent':
 			while self.msg.has_key (BAV.x_agn):
 				del self.msg[BAV.x_agn]
 			if self.parm.has_key ('fwd'):</diff>
      <filename>src/script/process/bavd.py</filename>
    </modified>
    <modified>
      <diff>@@ -102,4 +102,6 @@ def main (pgm, args):
 	ctrl.done ()
 	if not fail is None:
 		agn.die (s = fail)
-main (sys.argv[0], sys.argv[1:])
+#
+if __name__ == '__main__':
+	main (sys.argv[0], sys.argv[1:])</diff>
      <filename>src/script/process/smenable.py</filename>
    </modified>
    <modified>
      <diff>@@ -127,7 +127,7 @@ try:
 	else:
 		max_mailtrack_id = data[0]
 
-	iquery = 'INSERT INTO softbounce_email_tbl (company_id, email, bnccnt, mailing_id, creation_date) VALUES (:company, :email, 1, :mailing, now())'
+	iquery = 'INSERT INTO softbounce_email_tbl (company_id, email, bnccnt, mailing_id, creation_date, change_date) VALUES (:company, :email, 1, :mailing, now(), now())'
 	icurs = db.cursor ()
 
 	uquery = 'UPDATE softbounce_email_tbl SET mailing_id = :mailing, change_date = now(), bnccnt=bnccnt+1 WHERE company_id = :company AND email = :email'</diff>
      <filename>src/script/process/softbounce.py</filename>
    </modified>
    <modified>
      <diff>@@ -25,7 +25,7 @@
 #
 import	sys, os, getopt, time, signal, re
 import	agn
-agn.require ('2.0.0')
+agn.require ('2.0.4')
 agn.loglevel = agn.LV_INFO
 #
 delay = 30
@@ -57,6 +57,9 @@ class Update: #{{{
 		for o in nopts:
 			self.opts[o[0]] = o[1]
 	
+	def done (self):
+		pass
+	
 	def shouldRun (self):
 		return True
 
@@ -195,6 +198,7 @@ class UpdateBounce (Update): #{{{
 		self.ustatus = agn.UserStatus ()
 		self.mailingMap = {}
 		self.dsnparse = re.compile ('^([0-9])\\.([0-9])\\.([0-9])$')
+		self.igcount = None
 		self.sucount = None
 		self.sbcount = None
 		self.hbcount = None
@@ -260,13 +264,15 @@ class UpdateBounce (Update): #{{{
 		else:
 			return self.mailingMap[mailing]
 	def updateStart (self, inst):
+		self.igcount = 0
 		self.sucount = 0
 		self.sbcount = 0
 		self.hbcount = 0
 		return True
 	
 	def updateEnd (self, inst):
-		agn.log (agn.LV_INFO, 'udpBounce', 'Found %d hardbounces, %d softbounces, %d successes in %d lines' % (self.hbcount, self.sbcount, self.sucount, self.lineno))
+
+		agn.log (agn.LV_INFO, 'udpBounce', 'Found %d hardbounces, %d softbounces, %d successes, %d ignored in %d lines' % (self.hbcount, self.sbcount, self.sucount, self.igcount, self.lineno))
 		return True
 		
 	def updateLine (self, inst, line):
@@ -294,9 +300,9 @@ class UpdateBounce (Update): #{{{
 			agn.log (agn.LV_WARNING, 'updBounce', 'Cannot map mailing %d to company for line: %s' % (mailing, line))
 			return False
 
-		logMode = 1
+		logging = True
 		rc = True
-		if logMode &amp; 1 == 1:
+		if logging:
 			if detail == 200:
 				self.sucount += 1
 			else:
@@ -310,7 +316,7 @@ class UpdateBounce (Update): #{{{
 
 					inst.update ('INSERT INTO bounce_tbl (company_id, customer_id, detail, mailing_id, dsn, change_date) VALUES (:company, :customer, :detail, :mailing, :dsn, now())', data)
 				except agn.error, e:
-					agn.log (agn.LV_ERROR, 'updBounce', 'Unable to add %s to database: %s' % (`data`, e.msg))
+					agn.log (agn.LV_ERROR, 'updBounce', 'Unable to add bounce %s to database: %s' % (`data`, e.msg))
 					rc = False
 				if detail in (510, 511, 512) or bouncetype in (3, 4, 6):
 					self.hbcount += 1
@@ -330,6 +336,8 @@ class UpdateBounce (Update): #{{{
 					self.sbcount += 1
 					if self.sbcount % 1000 == 0:
 						inst.sync ()
+		else:
+			self.igcount += 1
 		return rc
 #}}}
 class UpdateAccount (Update): #{{{
@@ -479,13 +487,15 @@ while not term:
 		db.close ()
 	#
 	# Zzzzz....
-	count = delay
-	while count &gt; 0 and not term:
+	countDelay = delay
+	while countDelay &gt; 0 and not term:
 
 		if agn.iswin and agn.winstop ():
 			term = True
 			break
 		time.sleep (1)
-		count -= 1
+		countDelay -= 1
+for upd in updates:
+	upd.done ()
 agn.log (agn.LV_INFO, 'main', 'Going down')
 agn.unlock ()</diff>
      <filename>src/script/process/update.py</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>src/java/org/agnitas/dao/impl/OpenSessionInViewFilter.java</filename>
    </removed>
    <removed>
      <filename>src/java/org/agnitas/dao/impl/SerializeRequestFilter.java</filename>
    </removed>
    <removed>
      <filename>src/java/org/agnitas/web/AdminForm.java</filename>
    </removed>
    <removed>
      <filename>src/java/org/agnitas/web/CampaignForm.java</filename>
    </removed>
    <removed>
      <filename>src/java/org/agnitas/web/EmmActionForm.java</filename>
    </removed>
    <removed>
      <filename>src/java/org/agnitas/web/StrutsFormBase.java</filename>
    </removed>
    <removed>
      <filename>src/jsp/WEB-INF/conf/navigation/ProfileDbSub.properties</filename>
    </removed>
    <removed>
      <filename>src/jsp/WEB-INF/conf/navigation/templates.properties</filename>
    </removed>
    <removed>
      <filename>src/jsp/fckeditor2.5/editor/dtd/fck_dtd_test.html</filename>
    </removed>
    <removed>
      <filename>src/jsp/fckeditor2.5/editor/filemanager/connectors/test.html</filename>
    </removed>
    <removed>
      <filename>src/jsp/fckeditor2.5/editor/filemanager/connectors/uploadtest.html</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>7b5b4d6b49c43cc033ba10263d1dca834097e913</id>
    </parent>
  </parents>
  <author>
    <name>Nicolas Marchildon</name>
    <email>nicolas@marchildon.net</email>
  </author>
  <url>http://github.com/elecnix/openemm/commit/cdc73107446d5a4ab63f3ab673c22f79d689a891</url>
  <id>cdc73107446d5a4ab63f3ab673c22f79d689a891</id>
  <committed-date>2008-10-23T08:15:18-07:00</committed-date>
  <authored-date>2008-10-23T08:15:18-07:00</authored-date>
  <message>Imported OpenEMM-5.5.1-src.tar.gz</message>
  <tree>555094be67acb2565932c999955c42ed5da4940c</tree>
  <committer>
    <name>Nicolas Marchildon</name>
    <email>nicolas@marchildon.net</email>
  </committer>
</commit>
