[Zope-Checkins] CVS: Zope/lib/python/Products/ZCatalog/dtml - catalogIndexes.dtml:1.7 manageIndex.dtml:NONE

Casey Duncan casey@zope.com
Fri, 28 Jun 2002 13:25:25 -0400


Update of /cvs-repository/Zope/lib/python/Products/ZCatalog/dtml
In directory cvs.zope.org:/tmp/cvs-serv3905/lib/python/Products/ZCatalog/dtml

Modified Files:
	catalogIndexes.dtml 
Removed Files:
	manageIndex.dtml 
Log Message:
ZCatalog Fixup:

  * Collector #446 - Index managment permissions fixed

  * Index managment ui is now integrated into ZCatalog rather than being
    a tab leading to the Indexes subobject manage_main

ZCTextIndex fixed to work under this management scheme and now can be instantiated without that silly "extra" record thingy.


=== Zope/lib/python/Products/ZCatalog/dtml/catalogIndexes.dtml 1.6 => 1.7 ===
 <dtml-var manage_tabs>
 
+
 <p class="form-help"> 
 This list defines what indexes the Catalog will contain.  When objects 
-get cataloged, the values of any attributes they may have which match 
-an index in this list will get indexed.  Indexes come in three flavors, 
-Text Indexes, Field Indexes and Keyword Indexes.
+get cataloged, the values of any attributes which match 
+an index in this list will get indexed.
 </p>
 
-<p class="form-help">
-<strong>Text Indexes</strong> break text up into individual words, and 
-are often referred to as full-text indexes. Text indexes 
-sort results by score meaning they return hits in order 
-from the most relevant to the lest relevant.
-</p>
+<script type="text/javascript">
+<!-- 
 
-<p class="form-help">
-<strong>Field Indexes</strong> treat the value of an objects attributes 
-atomically, and can be used, for example, to track only a certain subset 
-of object values, such as 'meta_type'.
-</p>
+isSelected = false;
 
-<p class="form-help">
-<strong>Keyword Indexes</strong> index a sequence of objects that act as 
-'keywords' for an object.  A Keyword Index will return any objects 
-that have one or more keywords specified in a search query.
-</p>
+function toggleSelect() {
+  if (isSelected == false) {
+    for (i = 0; i < document.objectItems.length; i++)
+      document.objectItems.elements[i].checked = true ;
+      isSelected = true;
+      document.objectItems.selectButton.value = "Deselect All";
+      return isSelected;
+  }
+  else {
+    for (i = 0; i < document.objectItems.length; i++)
+      document.objectItems.elements[i].checked = false ;
+      isSelected = false;
+      document.objectItems.selectButton.value = "Select All";
+      return isSelected;       
+  }
+}
+
+//-->
+</script>
 
-<form action="<dtml-var URL1>" method="post">
-<dtml-in index_objects sort=id>
-  <dtml-if name="sequence-start">
-    <table width="100%" cellspacing="0" cellpadding="2" border="0">
-      <tr class="list-header">
-        <td width="1%" align="right"  valign="top">&nbsp;</td>
-        <td width="64%" align="left" valign="top">
-          <div class="list-item">Index Name</div></td>
-        <td width="20%" align="left" valign="top">
-          <div class="list-item">Index Type</div></td>
-      </tr>
+<dtml-unless skey><dtml-call expr="REQUEST.set('skey', 'id')"></dtml-unless>
+<dtml-unless rkey><dtml-call expr="REQUEST.set('rkey', '')"></dtml-unless>
+
+<dtml-with Indexes>
+
+<!-- Add object widget -->
+<br />
+<dtml-if filtered_meta_types>
+  <table width="100%" cellspacing="0" cellpadding="0" border="0">
+  <tr>
+  <td align="left" valign="top">&nbsp;</td>
+  <td align="right" valign="top">
+  <div class="form-element">
+  <form action="&dtml-absolute_url;" method="get">
+  <dtml-if "_.len(filtered_meta_types) > 1">
+    <select class="form-element" name=":action" 
+     onChange="location.href='&dtml-URL1;/'+this.options[this.selectedIndex].value">
+    <option value="manage_workspace" disabled>Select type to add...</option>
+    <dtml-in filtered_meta_types mapping sort=name>
+    <option value="&dtml.url_quote-action;">&dtml-name;</option>
+    </dtml-in>
+    </select>
+    <input class="form-element" type="submit" name="submit" value=" Add " />
+  <dtml-else>
+    <dtml-in filtered_meta_types mapping sort=name>
+    <input type="hidden" name=":method" value="&dtml.url_quote-action;" />
+    <input class="form-element" type="submit" name="submit" value=" Add &dtml-name;" />
+    </dtml-in>
   </dtml-if>
-  <dtml-if name="sequence-odd"><tr class="row-normal">
-  <dtml-else><tr class="row-hilite"></dtml-if>
-    <td align="right" valign="top">
-    <input type="checkbox" name="ids:list" value="<dtml-var 
-     id html_quote>" />
+  </form>
+  </div>
+  </td>
+  </tr>
+  </table>
+</dtml-if>
+
+
+
+<form action="&dtml-URL1;/" name="objectItems" method="post">
+<dtml-if objectItems>
+<table width="100%" cellspacing="0" cellpadding="2" border="0">
+<tr class="list-header">
+  <td>&nbsp;
+  </td>
+  <td width="30%" align="left"><div class="list-item"><a 
+   href="./manage_catalogIndexes?skey=id<dtml-if 
+   "rkey == ''">&rkey=id</dtml-if>"
+   onMouseOver="window.status='Sort objects by name'; return true"
+   onMouseOut="window.status=''; return true"><dtml-if 
+   "skey == 'id' or rkey == 'id'"
+   ><strong>Name</strong><dtml-else>Name</dtml-if></a></div>
+  </td>
+  <td width="30%" align="left"><div class="list-item"><a 
+   href="./manage_catalogIndexes?skey=meta_type<dtml-if 
+   "rkey == ''">&rkey=meta_type</dtml-if
+   >"
+   onMouseOver="window.status='Sort objects by type'; return true"
+   onMouseOut="window.status=''; return true"><dtml-if 
+   "skey == 'meta_type' or rkey == 'meta_type'"
+   ><strong>Index type</strong><dtml-else>Index type</dtml-if></a></div>
+  </td>
+
+  <td width="20%" align="left"><div class="list-item"><a 
+   href="./manage_catalogIndexes?skey=numObjects<dtml-if 
+   "rkey == ''">&rkey=numObjects</dtml-if
+   >"
+   onMouseOver="window.status='Sort objects by number of indexed objects'; return true"
+   onMouseOut="window.status=''; return true"><dtml-if 
+   "skey == 'numObjects' or rkey == 'numObjects'"
+   ><strong># objects</strong><dtml-else># objects</dtml-if></a></div>
+  </td>
+
+  <td width="20%" align="left"><div class="list-item"><a 
+   href="./manage_catalogIndexes?skey=bobobase_modification_time<dtml-if 
+   "rkey == ''">&rkey=bobobase_modification_time</dtml-if
+   >"
+   onMouseOver="window.status='Sort objects by modification time'; return true"
+   onMouseOut="window.status=''; return true"><dtml-if 
+   "skey == 'bobobase_modification_time' or rkey == 'bobobase_modification_time'"
+   ><strong>Last&nbsp;modified</strong><dtml-else>Last&nbsp;modified</dtml-if></a></div>
+  </td>
+
+</tr>
+
+<dtml-call "REQUEST.set('oldidx',0)">
+
+<dtml-in objectItems sort_expr="skey" reverse_expr="rkey">
+<dtml-if sequence-odd>
+<tr class="row-normal">
+<dtml-else>
+<tr class="row-hilite">
+</dtml-if>
+  <td align="left" valign="top" width="16">
+  <input type="checkbox" name="ids:list" value="&dtml-sequence-key;" />
+  </td>
+  <td align="left" valign="top">
+  <div class="list-item">
+  <a href="Indexes/&dtml.url_quote-sequence-key;/manage_workspace">
+  &dtml-sequence-key; <dtml-if title>(&dtml-title;)</dtml-if>
+  </a>
+  </div>
+
+   </td>
+
+  <dtml-with sequence-key>
+
+    <td>
+    <div class="list-item">
+      <dtml-if "_.string.find(_.str(_.getattr(this(),'__implements__','old')),'PluggableIndexInterface')>-1">
+        <dtml-var meta_type>
+      <dtml-else>
+         <dtml-call "REQUEST.set('oldidx',1)">
+         (pre-2.4 index)
+         <dtml-var meta_type>
+      </dtml-if>
+    </div>
     </td>
-    <td width="60%" align="left" valign="top">
+
+    <td>
       <div class="list-item">
-      &dtml-id;
+        <dtml-var numObjects missing="n/a">
       </div>
     </td>
-    <td width="20%" align="left" valign="top">
-      <div class="list-item">&dtml-meta_type;</div></td>
+
+    <td>
+      <div class="list-item">
+        <dtml-var bobobase_modification_time fmt="%Y-%m-%d %H:%M">
       </div>
     </td>
-  </tr>
+
+  </dtml-with>
+
+</tr>
 </dtml-in>
-  <tr>
-    <td align="left" valign="top">
-    </td>
-    <td align="left" valign="top">
-    <div class="form-element">
-    <input class="form-element" type="submit" name="manage_delIndex:method" 
-     value="Delete" /> 
-    </div>
-    </td>
-  </tr>
 </table>
 
-<br />
 <table cellspacing="0" cellpadding="2" border="0">
-  <tr>
-    <td align="left" valign="top">
-    <div class="form-label">
-    Add Index
-    </div>
-    </td>
-    <td align="left" valign="top">
-    <input type="text" name="name" size="20" />
-    </td>
-  </tr>
-  <tr>
-    <td align="left" valign="top">
-    <div class="form-label">
-    Of Type
-    </div>
-    </td>
-    <td align="left" valign="top">
-    <div class="form-element">
-    <select name="type">
-    <option value="TextIndex" selected>TextIndex</option>
-    <option value="FieldIndex">FieldIndex</option>
-    <option value="KeywordIndex">KeywordIndex</option>
-    </select>
-    </div>
-    </td>
-  </tr>
-  <tr>
-    <td align="left" valign="top">
-    </td>
-    <td align="left" valign="top">
-    <div class="form-element">
-    <input class="form-element" type="submit" name="manage_addIndex:method" 
-     value=" Add " /> 
-    </div>
-    </td>
-  </tr>
+<tr>
+  <td align="left" valign="top" width="16"></td>
+  <td align="left" valign="top">
+  <div class="form-element">
+
+  <input class="form-element" type="submit" name="manage_delIndex:method"     value="Remove index">
+  <input class="form-element" type="submit" name="manage_reindexIndex:method" value="Reindex">
+  <input class="form-element" type="submit" name="manage_clearIndex:method"   value="Clear index">
+  <dtml-if oldidx>
+    <input class="form-element" type="submit" name="manage_convertIndex:method" value="Convert index">
+  </dtml-if>
+<script type="text/javascript">
+<!-- 
+if (document.forms[0]) {
+  document.write('<input class="form-element" type="submit" name="selectButton" value="Select All" onClick="toggleSelect(); return false">')
+  }
+//-->
+</script>
+  </div>
+  </td>
+</tr>
 </table>
-</form>
-
-<dtml-var manage_page_footer>
-
-
-
 
+<dtml-else>
+<table cellspacing="0" cellpadding="2" border="0">
+<tr>
+<td>
+<div class="std-text">
+<em>There are currently no indexes</em>
+<br /><br />
+</div>
+</td>
+</tr>
+</table>
+</dtml-if>
+</form>
 
+<dtml-if update_menu>
+<script type="text/javascript">
+<!--
+window.parent.update_menu();
+//-->
+</script>
+</dtml-if>
+</dtml-with>
 
+<dtml-var manage_page_footer>

=== Removed File Zope/lib/python/Products/ZCatalog/dtml/manageIndex.dtml ===