Re: [Zope-dev] Re: Adding Batch Factory to ZMI Add menu OK?

2002-05-29 Thread Robert Rottermann

Would it not be possible to have undo for the Zope portion of the object
meaning what is stored in in the ZODB can be undone, what is stored in the
fs is as it is.
Like that we would have most of what undo offers for a normal element.
Robert
- Original Message -
From: Andy McKay [EMAIL PROTECTED]
To: Leonardo Rochael Almeida [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, May 28, 2002 6:45 PM
Subject: [Zope-dev] Re: Adding Batch Factory to ZMI Add menu OK?


 My current project is a product called ZFS and I just got an initial beta
 working last night and since this project came up. Essentially im hoping
this
 can be a replacement for LocalFS and all External* products. But this
sounds
 very similar to your work...

 ZFS is folderish object that points to a file system and hacks the storage
 level of Zope so that when an object is saved, part of it is diverted to
 the file system. Meaning the textarea part of a DTML Document is saved
to
 the file system. Because it hacks the storage level, this object appears
to
 be a normal object (so you can do all the usual things to, for example
pasting
 it from ZFS to a normal folder means it becomes a normal object. This
approach
 has many advantages and I hope to be able to allow all standard objects
 (DTML *, Python Scripts, Images, Files) to work in this manner.

 If running in debug mode, it syncs automatically to the file system,
meaning
 you can create and edit objects on the FS and they sync straight into
Zope.
 If in production mode, you call it manually to update, thus getting much
 better performance.

 You obviously lose some features (Undo) and there are still many issues to
be
 fixed, but I need to get it done so expect a release soon.

 On 27/05/02 18:38 -0300, Leonardo Rochael Almeida wrote:
 gt; Hello Craeg
 gt;
 gt; I particularly prefer the factory aproach. Zope users are already
used
 gt; to that approach because of the Z Search Interface. I think you
 gt; shouldn't need a dummy class just to be able to create such a
factory,
 gt; but right now I don't know how you'd go about creating a factory
without
 gt; a class.
 gt;
 gt; As for an ExternalFileFolder, it would be useful if it automatically
 gt; created objects when they are added to the respective directory
 gt; (automatically as in, it checks for new objects when you look at the
 gt; object list (manage_main), or when you try to access a previously
 gt; inexistant (sp.) object. Although, because of Data.fs write-on-read
 gt; concerns, you might want this automation to be configurable on a
folder
 gt; by folder basis). An ExternalFolder might also provide a view or tab
to
 gt; configure default attributes of newly discovered objects. The objects
 gt; created this way would obviously be regular ExternalFile objects, and
 gt; you could copy/cut and paste them outside of the ExternalFileFolder
 gt; object.
 gt;
 gt; Cheers, Leo
 gt;
 gt; On Mon, 2002-05-27 at 17:32, Craeg K Strong wrote:
 gt;  Hello:
 gt; 
 gt;  I am about to release a new version of the ExternalFile and CVSFile
products
 gt; 
 gt;  http://www.zope.org/Members/arielpartners/ExternalFile
 gt;  [...]
 gt;
 gt; --
 gt; Ideas don't stay in some minds very long because they don't like
 gt; solitary confinement.
 gt;
 gt;
 gt;
 gt; ___
 gt; Zope-Dev maillist  -  [EMAIL PROTECTED]
 gt; http://lists.zope.org/mailman/listinfo/zope-dev
 gt; **  No cross posts or HTML encoding!  **
 gt; (Related lists -
 gt;  http://lists.zope.org/mailman/listinfo/zope-announce
 gt;  http://lists.zope.org/mailman/listinfo/zope )

 --
   Andy McKay


 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] DT_Var modifier

2002-05-29 Thread Christian Theune

Hi.

I am currently hacking the DTMLTeX product, (maybe gonna make a relase of it ...) which
seems unmaintained, as the old owner isn't responding anymore.

What i needed for that, was a new modifier for dtml-var, called tex_quote, that I 
implemented
by monkeypatching DT_Var.Var .

My question now: Would it be possible to modify the DT_Var.Var.__init__, so it can call
the parse_params in a way, that I only have to path the DT_Var.modifiers? I think that 
wouldn't be 
a big change, but i wouldn't need to monkeypatch the __init__ ...

I am willing to provide the changed code for that, if this gets accepted.

Greetings

Christian

-- 
Christian Theune - [EMAIL PROTECTED]
gocept gmbh  co.kg - schalaunische strasse 6 - 06366 koethen/anhalt
tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981

reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b'])


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] access to ZCatalog-data via xmlrpc

2002-05-29 Thread Joachim Schmitz

Hi,

I want to acces a ZCatalog via xmlrpc, but

server=xmlrpclib.Server(http://myserver.aixtraware.de;
,BasicAuthTransport(username=user,password=pw))
r = server.Catalog()

results in

Fault -1: Unexpected Zope exception: cannot marshal type 'IOBTreeItems' 
objects

What is to do, to enable marshalling of those types ?

Mit freundlichen Grüßen  Joachim Schmitz

AixtraWare Ingenieurbüro für Internetanwendungen
Hüsgenstr. 33a, D-52457 Aldenhoven
Telefon: +49-2464-8851, FAX: +49-2464-905163

Key fingerprint = DA10 CC82 62F8 1DBB 39A1  1EDC 725B 3317 A8D7 C3A6
Keyserver: http://www.keyserver.net/en/


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] access to ZCatalog-data via xmlrpc

2002-05-29 Thread Toby Dickenson

On Wednesday 29 May 2002 3:24 pm, Joachim Schmitz wrote:
 Hi,

 I want to acces a ZCatalog via xmlrpc, but

 server=xmlrpclib.Server(http://myserver.aixtraware.de;
 ,BasicAuthTransport(username=user,password=pw))
 r = server.Catalog()

 results in

 Fault -1: Unexpected Zope exception: cannot marshal type 'IOBTreeItems'
 objects

 What is to do, to enable marshalling of those types ?

You could hack xmlrpclib to marshall those object, but I dont recommend it. 
Those objects can be big (but lazily evaluated), and you would be opening a 
significant denial of service vulnerability in your server.

I suggest you create a method (Python Script?) that makes the catalog query, 
sanitizes the response by making sure it is not too big, and returns a 
vanilla list or dictionary



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] DT_Var modifier

2002-05-29 Thread Christian Theune

Hi. 
* Adrian Hungate [EMAIL PROTECTED] [020529 18:20]:
 If I understand what you are asking, this is something I need as well. I am
 trying to create an entity_encode and entity_decode modifier (Like the html
 encode and html decode modifiers) that will encode (decode) all characters
 in the string that are special or illegal in XML.
 
 If there is an easy (Or even not so easy) way of adding this without a nasty
 patch (i.e. replacing an entire method in DT_Var) I would love to hear about
 it. If there isn't I would like to propose that this be changed (i.e.
 added).

Ok. There already is something like a small registry (it's only a list) where
you need to add your filter function, but the __init__ patch is bad.

If someone would tell me to go on, I would start a small refactoring of this
to allow that become more easy to introduce new filters ...

Regards

Christian

-- 
Christian Theune - [EMAIL PROTECTED]
gocept gmbh  co.kg - schalaunische strasse 6 - 06366 koethen/anhalt
tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981

reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b'])


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] ZODB, Catalog and actually using it

2002-05-29 Thread Nicholas Henke

Hello~~
I am playing with using the Catalog class in ZCatalog along with CatalogQuery 
to create a generic object layer on top of ZODB. I can index and search til I 
am blue in the face, and I always get the correct answers. Now for the 
problems...

Say I have the following obj:
class test(Persistent):
variable = 1
def function(self):
print self.__dict__

now if I do:
catalog = Catalog()
catalog.addIndex('variable', Fieldindex('variable'))
catalog.addColumn('variable')
obj = test()
catalog.catalogObject(obj, id(obj))

catalog_query = CatalogQuery(catalog, variable==1)
results = catalog_query()
for r in results:
print r.variable  # ok
print r.getRID() # ok
print r.function # NameError

...so I can get an object (a mybrains instance )back that allows me to print 
r.variable, but I cannot get r.function(). 
How does one do this? Is there a mapping between RIDs in the catalog and real 
objects somewhere? Do I need to do that mapping in an IOBtree (it would make 
the most sense since I am using id(obj) as the uid in the catalog)? Is there 
somewhere in Zope/google/web that does this?

Thanks for any help!!
Nic 



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] ZODB, Catalog and actually using it

2002-05-29 Thread Casey Duncan

try:

  ob = r.getObject()
  ob.function()

or if that doesn't work:

  ob = catalog.getobject(r.data_record_id_)
  ob.function()

Bear in mind that getObject traverses to the object which is expensive both in 
time and memory if the number of results is large.

hth,

-Casey

On Wednesday 29 May 2002 04:05 pm, Nicholas Henke wrote:
 Hello~~
   I am playing with using the Catalog class in ZCatalog along with 
CatalogQuery 
 to create a generic object layer on top of ZODB. I can index and search til 
I 
 am blue in the face, and I always get the correct answers. Now for the 
 problems...
 
 Say I have the following obj:
 class test(Persistent):
   variable = 1
   def function(self):
   print self.__dict__
 
 now if I do:
 catalog = Catalog()
 catalog.addIndex('variable', Fieldindex('variable'))
 catalog.addColumn('variable')
 obj = test()
 catalog.catalogObject(obj, id(obj))
 
 catalog_query = CatalogQuery(catalog, variable==1)
 results = catalog_query()
 for r in results:
   print r.variable  # ok
   print r.getRID() # ok
   print r.function # NameError
 
 ...so I can get an object (a mybrains instance )back that allows me to print 
 r.variable, but I cannot get r.function(). 
 How does one do this? Is there a mapping between RIDs in the catalog and 
real 
 objects somewhere? Do I need to do that mapping in an IOBtree (it would make 
 the most sense since I am using id(obj) as the uid in the catalog)? Is there 
 somewhere in Zope/google/web that does this?
 
 Thanks for any help!!
 Nic 
 
 
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )
 



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] ZODB, Catalog and actually using it

2002-05-29 Thread Nicholas Henke

On Wednesday 29 May 2002 04:20 pm, Casey Duncan wrote:
 try:

   ob = r.getObject()
   ob.function()

ob gets returned as None -- I think this is due to 
AbstractCatalogBrain::getObject(). I don't believe self.aq_parent is set 
correctly -- how is it supposed to be set ?


 or if that doesn't work:

   ob = catalog.getobject(r.data_record_id_)
AttributeError -- getobject doesnt exist?

   ob.function()

 Bear in mind that getObject traverses to the object which is expensive both
 in time and memory if the number of results is large.

OK -- is there a better way to do all of this ?  What I am trying to do is 
have ZODB store objects and Catalog maintain indexes on them. Now I can come 
back and do a 'SELECT' on the objects, say for variable != 1, and somehow get 
access to the original objects if I wish to. Is there somewhere that 
documents using Catalog and PluginIndexes without all of the other Zope 
stuff? Any documents on using it with the Zope stuff ?

Nic


 hth,

 -Casey

 On Wednesday 29 May 2002 04:05 pm, Nicholas Henke wrote:
  Hello~~
  I am playing with using the Catalog class in ZCatalog along with

 CatalogQuery

  to create a generic object layer on top of ZODB. I can index and search
  til

 I

  am blue in the face, and I always get the correct answers. Now for the
  problems...
 
  Say I have the following obj:
  class test(Persistent):
  variable = 1
  def function(self):
  print self.__dict__
 
  now if I do:
  catalog = Catalog()
  catalog.addIndex('variable', Fieldindex('variable'))
  catalog.addColumn('variable')
  obj = test()
  catalog.catalogObject(obj, id(obj))
 
  catalog_query = CatalogQuery(catalog, variable==1)
  results = catalog_query()
  for r in results:
  print r.variable  # ok
  print r.getRID() # ok
  print r.function # NameError
 
  ...so I can get an object (a mybrains instance )back that allows me to
  print r.variable, but I cannot get r.function().
  How does one do this? Is there a mapping between RIDs in the catalog and

 real

  objects somewhere? Do I need to do that mapping in an IOBtree (it would
  make the most sense since I am using id(obj) as the uid in the catalog)?
  Is there somewhere in Zope/google/web that does this?
 
  Thanks for any help!!
  Nic
 
 
 
  ___
  Zope-Dev maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope )



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] ZODB, Catalog and actually using it

2002-05-29 Thread Casey Duncan

[removed zodb-dev, don't cross post!]

If you are using plain catalogs then you need to store the path to the object 
somewhere (as metadata or as Zope does as the uid of the catalog record). 
Then traverse to it based on this path. In Zope you use (restrictedTraverse 
(or unrestrictedTraverse) to do this). You might need to roll your own 
traverser, but it shouldn't be too hard.

hth,

Casey

On Wednesday 29 May 2002 04:30 pm, Nicholas Henke wrote:
 On Wednesday 29 May 2002 04:20 pm, Casey Duncan wrote:
  try:
 
ob = r.getObject()
ob.function()
 
 ob gets returned as None -- I think this is due to 
 AbstractCatalogBrain::getObject(). I don't believe self.aq_parent is set 
 correctly -- how is it supposed to be set ?
 
 
  or if that doesn't work:
 
ob = catalog.getobject(r.data_record_id_)
 AttributeError -- getobject doesnt exist?
 
ob.function()
 
  Bear in mind that getObject traverses to the object which is expensive 
both
  in time and memory if the number of results is large.
 
 OK -- is there a better way to do all of this ?  What I am trying to do is 
 have ZODB store objects and Catalog maintain indexes on them. Now I can come 
 back and do a 'SELECT' on the objects, say for variable != 1, and somehow 
get 
 access to the original objects if I wish to. Is there somewhere that 
 documents using Catalog and PluginIndexes without all of the other Zope 
 stuff? Any documents on using it with the Zope stuff ?
 
 Nic


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Re: [ZODB-Dev] ZODB, Catalog and actually using it

2002-05-29 Thread Andreas Jung

I think you must call getObject() on the mybrains instance first
to get the object!

Andreas
- Original Message -
From: Nicholas Henke [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, May 29, 2002 16:05
Subject: [ZODB-Dev] ZODB, Catalog and actually using it


Hello~~
I am playing with using the Catalog class in ZCatalog along with
CatalogQuery
to create a generic object layer on top of ZODB. I can index and search til
I
am blue in the face, and I always get the correct answers. Now for the
problems...

Say I have the following obj:
class test(Persistent):
variable = 1
def function(self):
print self.__dict__

now if I do:
catalog = Catalog()
catalog.addIndex('variable', Fieldindex('variable'))
catalog.addColumn('variable')
obj = test()
catalog.catalogObject(obj, id(obj))

catalog_query = CatalogQuery(catalog, variable==1)
results = catalog_query()
for r in results:
print r.variable  # ok
print r.getRID() # ok
print r.function # NameError

...so I can get an object (a mybrains instance )back that allows me to print
r.variable, but I cannot get r.function().
How does one do this? Is there a mapping between RIDs in the catalog and
real
objects somewhere? Do I need to do that mapping in an IOBtree (it would make
the most sense since I am using id(obj) as the uid in the catalog)? Is there
somewhere in Zope/google/web that does this?

Thanks for any help!!
Nic



___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zodb-dev





___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Zope logic

2002-05-29 Thread Wei He

Hi all,

I have tried Zope for a week and found a logic problem.

An object (say index_html) is inherited by child objects of the site say 
Document to make http://www.domain.com/Document share the upper 
level index_html. This sounds good but acutally not I think.

People will be really confused to see such results:

http://www.zope.org/Documentation/ZopeBook/Documentation
http://www.zope.org/Images

Is there a way to setup an object to be uninheritable or as private to 
avoid this logic? Or maybe we should workout a way to do so.

Wei He



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Zope logic

2002-05-29 Thread Chris Withers

Hi,

Wei He wrote:
 
 An object (say index_html) is inherited by child objects of the site say
 Document to make http://www.domain.com/Document share the upper
 level index_html. This sounds good but acutally not I think.

So do a lot of other people, but not for your reasons ;-)

 People will be really confused to see such results:
 
 http://www.zope.org/Documentation/ZopeBook/Documentation
 http://www.zope.org/Images

Why would they see such URLs?

 Is there a way to setup an object to be uninheritable or as private to
 avoid this logic? Or maybe we should workout a way to do so.

If you're interested, take a look at Zope 3. However, in your case, you probably
need to worry more about why you're generating URLs like the ones above rather
than the fact that it is possible to do so.

cheers,

Chris


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )