small wishes and fixes
authorzapata <zapata>
Mon, 23 Jun 2003 19:29:54 +0000 (19:29 +0000)
committerzapata <zapata>
Mon, 23 Jun 2003 19:29:54 +0000 (19:29 +0000)
bundles/admin_en.properties
source/mircoders/global/JobQueue.java
templates/admin/FUNCTIONS.template
templates/admin/comment.template
templates/admin/commentlist.template
templates/admin/messagelist.template
templates/admin/start_admin.template

index 3c20519..6cc5919 100755 (executable)
@@ -1,6 +1,6 @@
 ########## admin ##########
 # language: english
-# $Id: admin_en.properties,v 1.48.2.3 2003/06/23 15:24:06 zapata Exp $
+# $Id: admin_en.properties,v 1.48.2.4 2003/06/23 19:29:54 zapata Exp $
 
 languagename=English
 
@@ -285,7 +285,8 @@ start.htmltitle=admin
 
 start.content.new=new article
 start.show=show
-start.open_by_id=open id
+start.comment.open_by_id=open comment #
+start.content.open_by_id=open article #
 
 start.content.hidden=produce all hidden articles
 start.content.not_published=not (yet) published articles
index 4fafe7f..8c5b10a 100755 (executable)
@@ -51,6 +51,7 @@ public class JobQueue {
   private JobQueueRunner queueRunner;
   private Thread thread;
   private LoggerWrapper logger;
+  private long lastCleanup;
 
   public static final int STATUS_CREATED = -1;
   public static final int STATUS_PENDING = 0;
@@ -70,13 +71,22 @@ public class JobQueue {
     jobHandlers = new Vector();
     identifierToJobHandler = new HashMap();
     nrJobs = 0;
-    jobCleanupTreshold = 1000;
+    lastCleanup = 0;
+    jobCleanupTreshold = 9000; // seconds
     queueRunner = new JobQueueRunner(logger);
     thread = new Thread(queueRunner);
     thread.start();
   }
 
   public String appendJob(Job aJob, String aDescription) {
+    try {
+      if (System.currentTimeMillis() - lastCleanup > 60000)
+        cleanupJobList();
+    }
+    catch (Throwable t) {
+      logger.error("error while cleaning up joblist: " + t.toString());
+    }
+
     synchronized (jobHandlers) {
       JobHandler jobHandler = new JobHandler(aJob, Integer.toString(nrJobs), aDescription);
       nrJobs++;
@@ -120,6 +130,8 @@ public class JobQueue {
         }
       }
     }
+
+    lastCleanup = System.currentTimeMillis();
   }
 
   private JobHandler acquirePendingJob() {
index 0d09621..c890d53 100755 (executable)
@@ -1,10 +1,14 @@
 <comment>creates a full table incl. edit/delete entry.id</comment>
-<function ListTable(contentlist, data_keys, column_head_texts, column_head_CSS, listrow1CSS, listrow2CSS, footer_css, module_name)>
+<function ListTable(contentlist, data_keys, aHeaders, column_head_CSS, listrow1CSS, listrow2CSS, footer_css, module_name)>
+  <assign nrColumns="1">
+  <list aHeaders as h>
+    <assign nrColumns=utility.increment(nrColumns)>
+  </list>
 
 <table cellspacing="2" border="0">
   
-  <tr>
-    <list column_head_texts as indexVariable>
+  <tr class="${column_head_CSS}">
+    <list aHeaders as indexVariable>
       <td class="${column_head_CSS}">
         <b>${indexVariable}</b> 
       </td>
@@ -38,7 +42,7 @@
   
   
   <tr>    
-    <td colspan="${column_nr}" class="table-foot">
+    <td colspan="${nrColumns}" class="table-foot">
       ${data.count} ${lang("records")} / ${lang("show_from_to", data.from, data.to)}
     </td>
   </tr>
 </function>
 
 <assign TABLE_HEAD_CLASS          "table-head">
-<assign TABLE_FOOT_CLASS          "table-head">
+<assign TABLE_FOOT_CLASS          "table-foot">
 <assign LIST_ROW_CLASS             "listrow1">
 <assign LIST_ROW_CLASS_ALTERNATIVE "listrow2">
 
 <function EntityTable(anEntityList, aDataKeys, aHeaders, aFrom, aTo, aCount, aShowDelete, aShowEdit, aModuleName)>
+  <assign nrColumns="0">
+  <list aHeaders as h>
+    <assign nrColumns=utility.increment(nrColumns)>
+  </list>
+  <if aShowDelete == "1" || aShowEdit == "1" >
+    <assign nrColumns=utility.increment(nrColumns)>
+  </if>
+
   <table cellspacing="2" border="0">
     <tr>
       <list aHeaders as i>
     
     
     <tr>    
-      <td colspan="${column_nr}" class="${TABLE_HEAD_CLASS}">
+      <td colspan="${nrColumns}" class="${TABLE_FOOT_CLASS}">
         ${aCount} ${lang("records")} / ${lang("show_from_to", aFrom, aTo)}
       </td>
     </tr>
index 9d2b339..8a6575c 100755 (executable)
     <tr><td colspan="2" class="table-head">${lang("comment.htmltitle")}</td></tr>
     
     
+      <tr>
+        <td align="right" class="table-left">
+          id # :
+        </td>
+        <td class="listrow2">
+          ${comment.id}
+        </td>
+      </tr>
+      
     <tr> 
           <td align="right" class="table-left">
             ${lang("comment.date")}
index f8d5639..4ad64df 100755 (executable)
             </if>
   
         
-        <b>${entry.title}</b> &nbsp;
+        <b>${entry.title}</b> (${entry.id})&nbsp;
         <if entry.creator>
           ${lang("by")}: ${entry.creator}
         </if>
index 42cb181..b151b25 100755 (executable)
@@ -7,6 +7,7 @@
 <body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
 
 <include "head.template">
+<include "FUNCTIONS.template">
 
 <p>
   <a class="link-box" href="${config.actionRoot}?module=Message&do=add">[+] ${lang("add")}</a> &nbsp;
 </p>
 
 <if data.contentlist>
+  <assign prevurl="">
+  <assign nexturl="">
+  <if data.prev>
+    <assign prevurl="module=Message&amp;do=list&amp;where="+data.where+"&amp;offset="+data.prev>
+  </if>
+  <if data.next>
+    <assign nexturl="module=Message&amp;do=list&amp;where="+data.where+"&amp;offset="+data.next>
+  </if>
 
-<table border="0" cellpadding="2" cellspacing="1" width="70%">
+  <call showPrevNextLinks (prevurl, nexturl, "left")>
+  
+<table border="0" cellpadding="2" cellspacing="1">
   <tr>
     <td class="table-head">
     ${lang("message.date")}</td>
 </table>
 
 <P>
-  <if data.prev>
-    <a class="majorcommand" href="${config.actionRoot}?module=Message&do=list&where=${data.where}&offset=${data.prev}">[&nbsp;${lang("list.previous")}&nbsp;]</a>&nbsp;
-  </if>
-  <if data.next>
-    <a class="majorcommand" href="${config.actionRoot}?module=Message&do=list&where=${data.where}&offset=${data.next}">[&nbsp;${lang("list.next")}&nbsp;]</a>
-  </if>
+  <call showPrevNextLinks (prevurl, nexturl, "left")>
 
 <else>
   <P align="center">${lang("no_matches_found")}</p>
index 903f410..cd18f18 100755 (executable)
       <list administeroperations as a>
           <a href="${config.actionRoot}?${a.url}">${lang("start.administer."+a.name)}</a><br>
       </list>
-<!--      
-      <a href="${config.actionRoot}?module=Content&do=list&where=is_published%3d'1'%20and%20to_article_type%3D0&order=webdb_create%20desc">&gt; ${lang("start.allarticlesoftype", lang("articletypes.openposting"))}</a>  
-      <br>
-      <a href="${config.actionRoot}?module=Comment&do=list">
-        &gt; ${lang("start.content.comments")}
-      </a>
--->     
     </p>
 
     <p class="box-head"><b>${lang("start.list.title")}</b></p>  
       <form>
         <input type="hidden" name="module" value="Content">
         <input type="hidden" name="do" value="edit">
-        ${lang("start.open_by_id")}: 
+        ${lang("start.content.open_by_id")}: 
+        <input type="text" name="id" value="" size="7">
+        <input type="submit" value=" &gt; ">
+      </form>
+      <form>
+        <input type="hidden" name="module" value="Comment">
+        <input type="hidden" name="do" value="edit">
+        ${lang("start.comment.open_by_id")}: 
         <input type="text" name="id" value="" size="7">
         <input type="submit" value=" &gt; ">
       </form>