Commit 3b64fa0a authored by 's avatar

Readded Find support that got overwritten somehow

parent 12d7d6f5
__doc__="""Copy interface"""
__version__='$Revision: 1.18 $'[11:-2]
__version__='$Revision: 1.19 $'[11:-2]
import sys, Globals, Moniker, rPickle, tempfile
from cPickle import loads, dumps
import sys, Globals, Moniker, tempfile
from marshal import loads, dumps
from urllib import quote, unquote
from zlib import compress, decompress
from App.Dialogs import MessageDialog
......@@ -24,7 +25,7 @@ class CopyContainer:
m=Moniker.Moniker(ob)
oblist.append((m.jar, m.ids))
cp=(1, oblist)
cp=quote(dumps(cp))
cp=_cb_encode(cp)
if REQUEST is not None:
resp=REQUEST['RESPONSE']
resp.setCookie('__cp', cp, path='%s' % REQUEST['SCRIPT_NAME'])
......@@ -43,7 +44,7 @@ class CopyContainer:
m=Moniker.Moniker(ob)
oblist.append((m.jar, m.ids))
cp=(0, oblist)
cp=quote(dumps(cp))
cp=_cb_encode(cp)
if REQUEST is not None:
resp=REQUEST['RESPONSE']
resp.setCookie('__cp', cp, path='%s' % REQUEST['SCRIPT_NAME'])
......@@ -64,7 +65,7 @@ class CopyContainer:
if cp is None:
raise CopyError, eNoData
try: cp=rPickle.loads(unquote(cp))
try: cp=_cb_decode(cp)
except: raise CopyError, eInvalid
oblist=[]
......@@ -176,12 +177,12 @@ class CopyContainer:
def cb_dataValid(self):
# Return true if clipboard data seems valid.
try: data=rPickle.loads(unquote(self.REQUEST['__cp']))
try: cp=_cb_decode(self.REQUEST['__cp'])
except: return 0
return 1
def cb_dataItems(self):
try: cp=rPickle.loads(unquote(self.REQUEST['__cp']))
try: cp=_cb_decode(self.REQUEST['__cp'])
except: return []
oblist=[]
m=Moniker.Moniker()
......@@ -305,6 +306,15 @@ def _get_id(ob, id):
def _cb_encode(d):
return quote(compress(dumps(d), 9))
def _cb_decode(s):
return loads(decompress(unquote(s)))
fMessageDialog=Globals.HTML("""
<HTML>
<HEAD>
......@@ -372,6 +382,9 @@ eNotSupported=fMessageDialog(
##############################################################################
#
# $Log: CopySupport.py,v $
# Revision 1.19 1998/08/14 20:54:44 brian
# Readded Find support that got overwritten somehow
#
# Revision 1.18 1998/08/14 16:46:35 brian
# Added multiple copy, paste, rename
#
......
__doc__="""Principia Find support"""
__version__='$Revision: 1.2 $'[11:-2]
__version__='$Revision: 1.3 $'[11:-2]
import sys, os, string, time, Globals
from DocumentTemplate.DT_Util import Eval, expr_globals
from AccessControl.Permission import name_trans
from Globals import HTMLFile
from cDocumentTemplate import *
from DateTime import DateTime
from string import find
......@@ -13,6 +14,13 @@ from string import find
class FindSupport:
"""Find support for Principia Folders"""
manage_findFrame=HTMLFile('findFrame', globals())
manage_findForm=HTMLFile('findForm', globals())
manage_findAdv=HTMLFile('findAdv', globals())
manage_findResult=HTMLFile('findResult', globals())
manage_findOpt=HTMLFile('findOpt', globals())
def PrincipiaFind(self, obj, obj_ids=None, obj_metatypes=None,
obj_searchterm=None, obj_expr=None,
obj_mtime=None, obj_mspec=None,
......@@ -172,6 +180,9 @@ def p_name(name):
##############################################################################
#
# $Log: FindSupport.py,v $
# Revision 1.3 1998/08/14 20:54:44 brian
# Readded Find support that got overwritten somehow
#
# Revision 1.2 1998/08/13 13:48:16 brian
# Added find in all subfolders option
#
"""Folder object
$Id: Folder.py,v 1.51 1998/08/14 16:46:35 brian Exp $"""
$Id: Folder.py,v 1.52 1998/08/14 20:54:44 brian Exp $"""
__version__='$Revision: 1.51 $'[11:-2]
__version__='$Revision: 1.52 $'[11:-2]
from Globals import HTMLFile
from ObjectManager import ObjectManager
from CopySupport import CopyContainer
from FindSupport import FindSupport
from Image import Image, File
from Document import DocumentHandler
from AccessControl.Role import RoleManager
......@@ -36,7 +37,7 @@ def manage_addFolder(self,id,title='',createPublic=0,createUserF=0,
if REQUEST is not None: return self.manage_main(self,REQUEST,update_menu=1)
class Folder(ObjectManager,RoleManager,DocumentHandler,
SimpleItem.Item,CopyContainer):
SimpleItem.Item,CopyContainer,FindSupport):
"""
The basic container object in Principia. Folders can hold almost all
other Principia objects.
......
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