Commit 36404d25 authored by Casey Duncan's avatar Casey Duncan

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.
parent c34256f9
...@@ -6,6 +6,9 @@ Zope Changes ...@@ -6,6 +6,9 @@ Zope Changes
Bugs Fixed Bugs Fixed
- Collector #446: Fixed management security assertions on
ZCatalogIndexes class.
- The BTree module functions weightedIntersection() and - The BTree module functions weightedIntersection() and
weightedUnion() now treat negative weights as documented. It's weightedUnion() now treat negative weights as documented. It's
hard to explain what their effects were before this fix, as hard to explain what their effects were before this fix, as
...@@ -37,6 +40,12 @@ Zope Changes ...@@ -37,6 +40,12 @@ Zope Changes
Features Added Features Added
- ZCatalog index management ui is now integrated into ZCatalog rather
than being a subobject managment screen with different tabs.
- ZCTextIndexes can now be instantiated without constructing a silly
"extra" record object if desired.
- SimpleItem class now passes a new argument "error_log_url" to - SimpleItem class now passes a new argument "error_log_url" to
the standard_error_message template on error. If the site contains the standard_error_message template on error. If the site contains
an error log object, this will contain the url to the applicable log an error log object, this will contain the url to the applicable log
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
############################################################################## ##############################################################################
"""Constant definitions for built-in Zope permissions""" """Constant definitions for built-in Zope permissions"""
__version__='$Revision: 1.2 $'[11:-2] __version__='$Revision: 1.3 $'[11:-2]
access_contents_information='Access contents information' access_contents_information='Access contents information'
...@@ -48,6 +48,7 @@ join_leave_versions='Join/leave Versions' ...@@ -48,6 +48,7 @@ join_leave_versions='Join/leave Versions'
manage_vocabulary='Manage Vocabulary' manage_vocabulary='Manage Vocabulary'
manage_zclasses='Manage Z Classes' manage_zclasses='Manage Z Classes'
manage_zcatalog_entries='Manage ZCatalog Entries' manage_zcatalog_entries='Manage ZCatalog Entries'
manage_zcatalog_indexes='Manage ZCatalogIndex Entries'
manage_properties='Manage properties' manage_properties='Manage properties'
manage_users='Manage users' manage_users='Manage users'
open_close_database_connection='Open/Close Database Connection' open_close_database_connection='Open/Close Database Connection'
......
...@@ -21,6 +21,7 @@ from OFS.SimpleItem import SimpleItem ...@@ -21,6 +21,7 @@ from OFS.SimpleItem import SimpleItem
from Globals import DTMLFile, InitializeClass from Globals import DTMLFile, InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.Permissions import manage_zcatalog_indexes, search_zcatalog
from Products.PluginIndexes.common.PluggableIndex import \ from Products.PluginIndexes.common.PluggableIndex import \
PluggableIndexInterface PluggableIndexInterface
...@@ -38,9 +39,6 @@ from Products.ZCTextIndex.OkapiIndex import OkapiIndex ...@@ -38,9 +39,6 @@ from Products.ZCTextIndex.OkapiIndex import OkapiIndex
index_types = {'Okapi BM25 Rank':OkapiIndex, index_types = {'Okapi BM25 Rank':OkapiIndex,
'Cosine Measure':CosineIndex} 'Cosine Measure':CosineIndex}
IndexMgmtPerm = 'Manage ZCatalogIndex Entries'
IndexSearchPerm = 'Search ZCatalogIndex'
class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem): class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem):
"""Persistent TextIndex""" """Persistent TextIndex"""
...@@ -57,21 +55,27 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem): ...@@ -57,21 +55,27 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem):
query_options = ['query'] query_options = ['query']
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(IndexMgmtPerm) security.declareObjectProtected(manage_zcatalog_indexes)
## Constructor ## ## Constructor ##
def __init__(self, id, extra, caller, index_factory=None): def __init__(self, id, extra=None, caller=None, index_factory=None,
field_name=None, lexicon_id=None):
self.id = id self.id = id
self._fieldname = extra.doc_attr
lexicon = getattr(caller, extra.lexicon_id, None) # Arguments can be passed directly to the constructor or
# via the silly "extra" record.
self._fieldname = field_name or getattr(extra, 'doc_attr', '') or id
lexicon_id = lexicon_id or extra.lexicon_id
lexicon = getattr(caller, lexicon_id, None)
if lexicon is None: if lexicon is None:
raise LookupError, 'Lexicon "%s" not found' % extra.lexicon_id raise LookupError, 'Lexicon "%s" not found' % extra.lexicon_id
if not ILexicon.isImplementedBy(lexicon): if not ILexicon.isImplementedBy(lexicon):
raise ValueError, \ raise ValueError, \
'Object "%s" does not implement lexicon interface' \ 'Object "%s" does not implement ZCTextIndex Lexicon interface' \
% lexicon.getId() % lexicon.getId()
self.lexicon = lexicon self.lexicon = lexicon
...@@ -88,7 +92,7 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem): ...@@ -88,7 +92,7 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem):
## External methods not in the Pluggable Index API ## ## External methods not in the Pluggable Index API ##
security.declareProtected('query', IndexSearchPerm) security.declareProtected('query', search_zcatalog)
def query(self, query, nbest=10): def query(self, query, nbest=10):
"""Return pair (mapping from docids to scores, num results). """Return pair (mapping from docids to scores, num results).
...@@ -175,6 +179,10 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem): ...@@ -175,6 +179,10 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem):
"""Return indexed attribute name""" """Return indexed attribute name"""
return self._fieldname return self._fieldname
def getLexiconId(self):
"""Return the id of the lexicon used by the index"""
return self.lexicon.getId()
InitializeClass(ZCTextIndex) InitializeClass(ZCTextIndex)
def manage_addZCTextIndex(self, id, extra=None, REQUEST=None, def manage_addZCTextIndex(self, id, extra=None, REQUEST=None,
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</p> </p>
<p class="form-help"> <p class="form-help">
ZCTextIndex Lexicon used: ZCTextIndex Lexicon used:
<em><dtml-var expr="lexicon.getId()"></em> <em><dtml-var getLexiconId></em>
</p> </p>
<p class="form-help"> <p class="form-help">
<em>Note:</em> You cannot change the lexicon assigned to a ZCTextIndex. <em>Note:</em> You cannot change the lexicon assigned to a ZCTextIndex.
......
...@@ -85,7 +85,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -85,7 +85,7 @@ class ZCatalog(Folder, Persistent, Implicit):
'action': 'manage_propertiesForm', 'action': 'manage_propertiesForm',
'help': ('OFSP','Properties.stx')}, 'help': ('OFSP','Properties.stx')},
{'label': 'Indexes', # TAB: Indexes {'label': 'Indexes', # TAB: Indexes
'action': 'Indexes/manage_workspace', 'action': 'manage_catalogIndexes',
'help': ('ZCatalog','ZCatalog_Indexes.stx')}, 'help': ('ZCatalog','ZCatalog_Indexes.stx')},
{'label': 'Metadata', # TAB: Metadata {'label': 'Metadata', # TAB: Metadata
'action': 'manage_catalogSchema', 'action': 'manage_catalogSchema',
...@@ -347,7 +347,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -347,7 +347,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.addIndex(name, type,extra) self.addIndex(name, type,extra)
if REQUEST and RESPONSE: if REQUEST and RESPONSE:
RESPONSE.redirect(URL1 + '/manage_main?manage_tabs_message=Index%20Added') RESPONSE.redirect(URL1 + '/manage_catalogIndexes?manage_tabs_message=Index%20Added')
def manage_deleteIndex(self, ids=None, REQUEST=None, RESPONSE=None, def manage_deleteIndex(self, ids=None, REQUEST=None, RESPONSE=None,
...@@ -371,7 +371,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -371,7 +371,7 @@ class ZCatalog(Folder, Persistent, Implicit):
if not ids: if not ids:
return MessageDialog(title='No items specified', return MessageDialog(title='No items specified',
message='No items were specified!', message='No items were specified!',
action = "./manage_main",) action = "./manage_catalogIndexes",)
if isinstance(ids, types.StringType): if isinstance(ids, types.StringType):
ids = (ids,) ids = (ids,)
...@@ -380,7 +380,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -380,7 +380,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.delIndex(name) self.delIndex(name)
if REQUEST and RESPONSE: if REQUEST and RESPONSE:
RESPONSE.redirect(URL1 + '/manage_main?manage_tabs_message=Index%20Deleted') RESPONSE.redirect(URL1 + '/manage_catalogIndexes?manage_tabs_message=Index%20Deleted')
def manage_clearIndex(self, ids=None, REQUEST=None, RESPONSE=None, def manage_clearIndex(self, ids=None, REQUEST=None, RESPONSE=None,
...@@ -389,7 +389,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -389,7 +389,7 @@ class ZCatalog(Folder, Persistent, Implicit):
if not ids: if not ids:
return MessageDialog(title='No items specified', return MessageDialog(title='No items specified',
message='No items were specified!', message='No items were specified!',
action = "./manage_main",) action = "./manage_catalogIndexes",)
if isinstance(ids, types.StringType): if isinstance(ids, types.StringType):
ids = (ids,) ids = (ids,)
...@@ -398,7 +398,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -398,7 +398,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.clearIndex(name) self.clearIndex(name)
if REQUEST and RESPONSE: if REQUEST and RESPONSE:
RESPONSE.redirect(URL1 + '/manage_main?manage_tabs_message=Index%20Cleared') RESPONSE.redirect(URL1 + '/manage_catalogIndexes?manage_tabs_message=Index%20Cleared')
def reindexIndex(self,name,REQUEST): def reindexIndex(self,name,REQUEST):
...@@ -418,7 +418,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -418,7 +418,7 @@ class ZCatalog(Folder, Persistent, Implicit):
if not ids: if not ids:
return MessageDialog(title='No items specified', return MessageDialog(title='No items specified',
message='No items were specified!', message='No items were specified!',
action = "./manage_main",) action = "./manage_catalogIndexes",)
if isinstance(ids, types.StringType): if isinstance(ids, types.StringType):
ids = (ids,) ids = (ids,)
...@@ -427,7 +427,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -427,7 +427,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.reindexIndex(name, REQUEST) self.reindexIndex(name, REQUEST)
if REQUEST and RESPONSE: if REQUEST and RESPONSE:
RESPONSE.redirect(URL1 + '/manage_main?manage_tabs_message=Reindexing%20Performed') RESPONSE.redirect(URL1 + '/manage_catalogIndexes?manage_tabs_message=Reindexing%20Performed')
def availableSplitters(self): def availableSplitters(self):
......
...@@ -11,8 +11,12 @@ ...@@ -11,8 +11,12 @@
# #
############################################################################## ##############################################################################
"""$Id: ZCatalogIndexes.py,v 1.7 2002/06/28 17:25:23 caseman Exp $
"""
from Globals import DTMLFile, InitializeClass from Globals import DTMLFile, InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.Permissions import delete_objects, manage_zcatalog_indexes
import Globals import Globals
from OFS.Folder import Folder from OFS.Folder import Folder
from OFS.FindSupport import FindSupport from OFS.FindSupport import FindSupport
...@@ -25,7 +29,6 @@ import os, sys, time ...@@ -25,7 +29,6 @@ import os, sys, time
from Acquisition import Implicit from Acquisition import Implicit
from Persistence import Persistent from Persistence import Persistent
from zLOG import LOG, ERROR from zLOG import LOG, ERROR
from Products.PluginIndexes.common.PluggableIndex import PluggableIndexInterface from Products.PluginIndexes.common.PluggableIndex import PluggableIndexInterface
_marker = [] _marker = []
...@@ -37,39 +40,22 @@ class ZCatalogIndexes (IFAwareObjectManager, Folder, Persistent, Implicit): ...@@ -37,39 +40,22 @@ class ZCatalogIndexes (IFAwareObjectManager, Folder, Persistent, Implicit):
# The interfaces we want to show up in our object manager # The interfaces we want to show up in our object manager
_product_interfaces = (PluggableIndexInterface, ) _product_interfaces = (PluggableIndexInterface, )
meta_type="ZCatalogIndex" meta_type = "ZCatalogIndex"
# icon="misc_/ZCatalog/www/index.gif" manage_options = ()
manage_options = (
ObjectManager.manage_options +
Historical.manage_options +
SimpleItem.manage_options
)
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected('Manage ZCatalogIndex Entries')
manage_main = DTMLFile('dtml/manageIndex',globals()) security.declareObjectProtected(manage_zcatalog_indexes)
security.setPermissionDefault(manage_zcatalog_indexes, ('Manager',))
security.declareProtected(manage_zcatalog_indexes, 'addIndexForm')
addIndexForm= DTMLFile('dtml/addIndexForm',globals()) addIndexForm= DTMLFile('dtml/addIndexForm',globals())
__ac_permissions__ = ( # You no longer manage the Indexes here, they are managed from ZCatalog
def manage_main(self, REQUEST, RESPONSE):
('Manage ZCatalogIndex Entries', """Redirect to the parent where the management screen now lives"""
['manage_foobar',], RESPONSE.redirect('../manage_catalogIndexes')
['Manager']
),
('Search ZCatalogIndex',
['searchResults', '__call__', 'all_meta_types',
'valid_roles', 'getobject'],
['Anonymous', 'Manager']
),
('Manage ZCatalogIndex Entries', ('',)),
)
manage_workspace = manage_main
# #
# Object Manager methods # Object Manager methods
...@@ -93,6 +79,7 @@ class ZCatalogIndexes (IFAwareObjectManager, Folder, Persistent, Implicit): ...@@ -93,6 +79,7 @@ class ZCatalogIndexes (IFAwareObjectManager, Folder, Persistent, Implicit):
if default is _marker: return indexes.get(id) if default is _marker: return indexes.get(id)
return indexes.get(id, default) return indexes.get(id, default)
security.declareProtected(manage_zcatalog_indexes, 'objectIds')
def objectIds(self, spec=None): def objectIds(self, spec=None):
indexes = self.aq_parent._catalog.indexes indexes = self.aq_parent._catalog.indexes
......
<dtml-var manage_page_header> <dtml-var manage_page_header>
<dtml-var manage_tabs> <dtml-var manage_tabs>
<p class="form-help"> <p class="form-help">
This list defines what indexes the Catalog will contain. When objects This list defines what indexes the Catalog will contain. When objects
get cataloged, the values of any attributes they may have which match get cataloged, the values of any attributes which match
an index in this list will get indexed. Indexes come in three flavors, an index in this list will get indexed.
Text Indexes, Field Indexes and Keyword Indexes.
</p> </p>
<p class="form-help"> <script type="text/javascript">
<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>
<p class="form-help"> isSelected = false;
<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>
<p class="form-help"> function toggleSelect() {
<strong>Keyword Indexes</strong> index a sequence of objects that act as if (isSelected == false) {
'keywords' for an object. A Keyword Index will return any objects for (i = 0; i < document.objectItems.length; i++)
that have one or more keywords specified in a search query. document.objectItems.elements[i].checked = true ;
</p> 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;
}
}
<form action="<dtml-var URL1>" method="post"> //-->
<dtml-in index_objects sort=id> </script>
<dtml-if name="sequence-start">
<table width="100%" cellspacing="0" cellpadding="2" border="0"> <dtml-unless skey><dtml-call expr="REQUEST.set('skey', 'id')"></dtml-unless>
<tr class="list-header"> <dtml-unless rkey><dtml-call expr="REQUEST.set('rkey', '')"></dtml-unless>
<td width="1%" align="right" valign="top">&nbsp;</td>
<td width="64%" align="left" valign="top"> <dtml-with Indexes>
<div class="list-item">Index Name</div></td>
<td width="20%" align="left" valign="top"> <!-- Add object widget -->
<div class="list-item">Index Type</div></td> <br />
</tr> <dtml-if filtered_meta_types>
</dtml-if> <table width="100%" cellspacing="0" cellpadding="0" border="0">
<dtml-if name="sequence-odd"><tr class="row-normal"> <tr>
<dtml-else><tr class="row-hilite"></dtml-if> <td align="left" valign="top">&nbsp;</td>
<td align="right" valign="top"> <td align="right" valign="top">
<input type="checkbox" name="ids:list" value="<dtml-var <div class="form-element">
id html_quote>" /> <form action="&dtml-absolute_url;" method="get">
</td> <dtml-if "_.len(filtered_meta_types) > 1">
<td width="60%" align="left" valign="top"> <select class="form-element" name=":action"
<div class="list-item"> onChange="location.href='&dtml-URL1;/'+this.options[this.selectedIndex].value">
&dtml-id; <option value="manage_workspace" disabled>Select type to add...</option>
</div> <dtml-in filtered_meta_types mapping sort=name>
</td> <option value="&dtml.url_quote-action;">&dtml-name;</option>
<td width="20%" align="left" valign="top"> </dtml-in>
<div class="list-item">&dtml-meta_type;</div></td> </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>
</form>
</div> </div>
</td> </td>
</tr> </tr>
</dtml-in> </table>
<tr> </dtml-if>
<td align="left" valign="top">
<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>
<td align="left" valign="top"> <td width="30%" align="left"><div class="list-item"><a
<div class="form-element"> href="./manage_catalogIndexes?skey=id<dtml-if
<input class="form-element" type="submit" name="manage_delIndex:method" "rkey == ''">&rkey=id</dtml-if>"
value="Delete" /> onMouseOver="window.status='Sort objects by name'; return true"
</div> 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>
</tr>
</table>
<br /> <td width="20%" align="left"><div class="list-item"><a
<table cellspacing="0" cellpadding="2" border="0"> href="./manage_catalogIndexes?skey=numObjects<dtml-if
<tr> "rkey == ''">&rkey=numObjects</dtml-if
<td align="left" valign="top"> >"
<div class="form-label"> onMouseOver="window.status='Sort objects by number of indexed objects'; return true"
Add Index onMouseOut="window.status=''; return true"><dtml-if
</div> "skey == 'numObjects' or rkey == 'numObjects'"
><strong># objects</strong><dtml-else># objects</dtml-if></a></div>
</td> </td>
<td align="left" valign="top">
<input type="text" name="name" size="20" /> <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>
</tr>
<tr>
<td align="left" valign="top"> <td align="left" valign="top">
<div class="form-label"> <div class="list-item">
Of Type <a href="Indexes/&dtml.url_quote-sequence-key;/manage_workspace">
&dtml-sequence-key; <dtml-if title>(&dtml-title;)</dtml-if>
</a>
</div> </div>
</td> </td>
<td align="left" valign="top">
<div class="form-element"> <dtml-with sequence-key>
<select name="type">
<option value="TextIndex" selected>TextIndex</option> <td>
<option value="FieldIndex">FieldIndex</option> <div class="list-item">
<option value="KeywordIndex">KeywordIndex</option> <dtml-if "_.string.find(_.str(_.getattr(this(),'__implements__','old')),'PluggableIndexInterface')>-1">
</select> <dtml-var meta_type>
<dtml-else>
<dtml-call "REQUEST.set('oldidx',1)">
(pre-2.4 index)
<dtml-var meta_type>
</dtml-if>
</div> </div>
</td> </td>
</tr>
<tr> <td>
<td align="left" valign="top"> <div class="list-item">
<dtml-var numObjects missing="n/a">
</div>
</td> </td>
<td align="left" valign="top">
<div class="form-element"> <td>
<input class="form-element" type="submit" name="manage_addIndex:method" <div class="list-item">
value=" Add " /> <dtml-var bobobase_modification_time fmt="%Y-%m-%d %H:%M">
</div> </div>
</td> </td>
</tr>
</table>
</form>
<dtml-var manage_page_footer> </dtml-with>
</tr>
</dtml-in>
</table>
<table cellspacing="0" cellpadding="2" border="0">
<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>
<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>
<dtml-var manage_page_header>
<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 which match
an index in this list will get indexed.
</p>
<script type="text/javascript">
<!--
isSelected = false;
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>
<dtml-unless skey><dtml-call expr="REQUEST.set('skey', 'id')"></dtml-unless>
<dtml-unless rkey><dtml-call expr="REQUEST.set('rkey', '')"></dtml-unless>
<!-- 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>
</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_main?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_main?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_main?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_main?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="&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>
<div class="list-item">
<dtml-var numObjects missing="n/a">
</div>
</td>
<td>
<div class="list-item">
<dtml-var bobobase_modification_time fmt="%Y-%m-%d %H:%M">
</div>
</td>
</dtml-with>
</tr>
</dtml-in>
</table>
<table cellspacing="0" cellpadding="2" border="0">
<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>
<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-var manage_page_footer>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment