Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
a65084fb
Commit
a65084fb
authored
Jun 24, 1999
by
Michel Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added folderability, and help screens.
parent
03220598
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
135 additions
and
12 deletions
+135
-12
lib/python/Products/ZCatalog/Catalog.py
lib/python/Products/ZCatalog/Catalog.py
+87
-0
lib/python/Products/ZCatalog/ZCatalog.py
lib/python/Products/ZCatalog/ZCatalog.py
+8
-6
lib/python/Products/ZCatalog/__init__.py
lib/python/Products/ZCatalog/__init__.py
+11
-4
lib/python/Products/ZCatalog/catalogIndexes.dtml
lib/python/Products/ZCatalog/catalogIndexes.dtml
+9
-0
lib/python/Products/ZCatalog/catalogSchema.dtml
lib/python/Products/ZCatalog/catalogSchema.dtml
+20
-2
No files found.
lib/python/Products/ZCatalog/Catalog.py
View file @
a65084fb
##############################################################################
#
# Zope Public License (ZPL) Version 1.0
# -------------------------------------
#
# Copyright (c) Digital Creations. All rights reserved.
#
# This license has been certified as Open Source(tm).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions in source code must retain the above copyright
# notice, this list of conditions, and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions, and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# 3. Digital Creations requests that attribution be given to Zope
# in any manner possible. Zope includes a "Powered by Zope"
# button that is installed by default. While it is not a license
# violation to remove this button, it is requested that the
# attribution remain. A significant investment has been put
# into Zope, and this effort will continue if the Zope community
# continues to grow. This is one way to assure that growth.
#
# 4. All advertising materials and documentation mentioning
# features derived from or use of this software must display
# the following acknowledgement:
#
# "This product includes software developed by Digital Creations
# for use in the Z Object Publishing Environment
# (http://www.zope.org/)."
#
# In the event that the product being advertised includes an
# intact Zope distribution (with copyright and license included)
# then this clause is waived.
#
# 5. Names associated with Zope or Digital Creations must not be used to
# endorse or promote products derived from this software without
# prior written permission from Digital Creations.
#
# 6. Modified redistributions of any form whatsoever must retain
# the following acknowledgment:
#
# "This product includes software developed by Digital Creations
# for use in the Z Object Publishing Environment
# (http://www.zope.org/)."
#
# Intact (re-)distributions of any official Zope release do not
# require an external acknowledgement.
#
# 7. Modifications are encouraged but must be packaged separately as
# patches to official Zope releases. Distributions that do not
# clearly separate the patches from the original work must be clearly
# labeled as unofficial distributions. Modifications which do not
# carry the name Zope may be packaged in any form, as long as they
# conform to all of the clauses above.
#
#
# Disclaimer
#
# THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY
# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#
# This software consists of contributions made by Digital Creations and
# many individuals on behalf of Digital Creations. Specific
# attributions are listed in the accompanying credits file.
#
##############################################################################
from
Persistence
import
Persistent
import
Acquisition
import
BTree
,
OIBTree
,
IOBTree
...
...
@@ -5,6 +90,7 @@ from SearchIndex import UnIndex, UnTextIndex, Query
import
regex
,
pdb
import
Record
from
Missing
import
MV
from
DateTime
import
DateTime
from
Lazy
import
LazyMap
,
LazyFilter
,
LazyCat
...
...
@@ -60,6 +146,7 @@ class Catalog(Persistent, Acquisition.Implicit):
self
.
data
=
BTree
.
BTree
()
# mapping of rid to meta_data
self
.
uids
=
OIBTree
.
BTree
()
# mapping of uid to rid
self
.
paths
=
IOBTree
.
BTree
()
# mapping of rid to uid
self
.
dates
=
IOBTree
.
BTree
()
# mapping of rid to date indexed
if
brains
is
not
None
:
self
.
_v_brains
=
brains
...
...
lib/python/Products/ZCatalog/ZCatalog.py
View file @
a65084fb
...
...
@@ -89,7 +89,7 @@ A Catalog object provides an inteface to index objects.
from
Globals
import
HTMLFile
,
MessageDialog
import
Globals
from
OFS.
SimpleItem
import
SimpleItem
from
OFS.
Folder
import
Folder
from
OFS.FindSupport
import
FindSupport
from
SearchIndex
import
Query
import
string
,
regex
,
urlparse
,
urllib
,
os
,
sys
...
...
@@ -111,17 +111,20 @@ def manage_addZCatalog(self,id,title,REQUEST=None):
return
self
.
manage_main
(
self
,
REQUEST
)
class
ZCatalog
(
SimpleItem
,
FindSupport
,
Persistent
,
Implicit
):
class
ZCatalog
(
Folder
,
FindSupport
,
Persistent
,
Implicit
):
"""ZCatalog object"""
meta_type
=
"ZCatalog"
manage_options
=
(
{
'label'
:
'Contents'
,
'action'
:
'manage_catalogView'
,
{
'label'
:
'Contents'
,
'action'
:
'manage_main'
,
'target'
:
'manage_main'
},
{
'label'
:
'Cataloged Objects'
,
'action'
:
'manage_catalogView'
,
'target'
:
'manage_main'
},
{
'label'
:
'Find Items to ZCatalog'
,
'action'
:
'manage_catalogFind'
,
'target'
:
'manage_main'
},
{
'label'
:
'
Schema
'
,
'action'
:
'manage_catalogSchema'
,
{
'label'
:
'
MetaData Table
'
,
'action'
:
'manage_catalogSchema'
,
'target'
:
'manage_main'
},
{
'label'
:
'Indexes'
,
'action'
:
'manage_catalogIndexes'
,
'target'
:
'manage_main'
},
...
...
@@ -152,8 +155,7 @@ class ZCatalog(SimpleItem, FindSupport, Persistent, Implicit):
manage_catalogIndexes
=
HTMLFile
(
'catalogIndexes'
,
globals
())
manage_catalogStatus
=
HTMLFile
(
'catalogStatus'
,
globals
())
manage_main
=
HTMLFile
(
'catalogView'
,
globals
())
def
__init__
(
self
,
id
,
title
=
None
):
self
.
id
=
id
self
.
title
=
title
...
...
lib/python/Products/ZCatalog/__init__.py
View file @
a65084fb
##############################################################################
#
# Zope Public License (ZPL) Version
0.9.7
# -------------------------------------
--
# Zope Public License (ZPL) Version
1.0
# -------------------------------------
#
# Copyright (c) Digital Creations. All rights reserved.
#
...
...
@@ -82,10 +82,10 @@
# attributions are listed in the accompanying credits file.
#
##############################################################################
"""Site Index product"""
import
ZCatalog
"""Site Index product"""
import
ZCatalog
,
Catalog
def
initialize
(
context
):
context
.
registerClass
(
...
...
@@ -95,6 +95,13 @@ def initialize(context):
ZCatalog
.
manage_addZCatalog
),
icon
=
'www/ZCatalog.gif'
,
)
context
.
registerBaseClass
(
ZCatalog
.
ZCatalog
)
lib/python/Products/ZCatalog/catalogIndexes.dtml
View file @
a65084fb
...
...
@@ -5,6 +5,15 @@
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->
<p> 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
two flavors, TextIndexes and FieldIndexes. TextIndexes break text up
into individual words, and are often refered to as 'full text
indexes'. Field indexes treat the value of an objects attribute
atomically, and can be used, for example, to track only a certain
subset of object values, such as 'meta_type'.</p>
<form action="<!--#var URL1-->">
<ul>
...
...
lib/python/Products/ZCatalog/catalogSchema.dtml
View file @
a65084fb
...
...
@@ -5,6 +5,23 @@
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->
<p>This list defines what per object meta data the Catalog will store.
When objects get cataloged, the values of any attributes they may have
which match a name in this list will get stored in a table in the
Catalog. The Catalog then uses this information to create result
objects that are returned whenever the catalog is searched. It is
important to understand that when the Catalog is searched, it returns
a list of result objects, <i>not the cataloged objects themselves</i>,
so if you want to use the value of an object's attribute in the result
of a search, that attribute must be in this list</p>
<p>It is generally a good idea to keep this list lightweight. It is
useful, for example, to keep the 'summary' meta data of a text
document (like the first 200 characters) but <i>not</i> the text
content in it's entirety (it is useful in this example to <i>index</i>
the text contents, which is configured in the <b>Indexes</b> View
tab). This way, the summary data may be show in the search results.</p>
<form action="<!--#var URL1-->">
<ul>
...
...
@@ -15,8 +32,9 @@
<!--#/in-->
</ul>
<br>
<input name="manage_delColumns:method" type=submit value=" Delete "><br>
Add column: <input name="name">
<input name="manage_delColumns:method" type=submit value=" Delete ">
column from Meta Data table.<br><br>
Add column to the Meta Data table:<br> <input name="name">
<input name="manage_addColumn:method" type=submit value=" Add ">
</form>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment