[Zope] Getting records X to X+20 of catalog search

2008-05-12 Thread Sinang, Danny
Dear All,
 
How do we get records X to X+20 of a catalog search ?
 
We're aware of the limit parameter of the search () function, but this
only gives us the top Z rows. 
 
If I want to show records 90 to 100, I'm trying to avoid having to fetch
records 1 to 89.
 
Regards,
Danny
 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Making Zope stop storing old object versions

2008-05-08 Thread Sinang, Danny
Thanks Jonathan. But I thought you were referring to a way to make
Catalog writes transparently write to MySQL.

The article you're pointing to teaches how to use use ZSQLMethods, which
we're already doing.

But the product we're using to do workflows (OpenFlow) uses the
Zcatalog. So we either rewrite it to use MySQL, or we find a way to make
Catalogs write to MySQL.

Regards,
Danny 

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 08, 2008 10:08 PM
To: Sinang, Danny
Cc: zope@zope.org
Subject: Re: [Zope] Making Zope stop storing old object versions


snip
- Original Message -
From: Sinang, Danny [EMAIL PROTECTED]
To: Jonathan [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Thursday, May 08, 2008 10:03 AM
Subject: RE: [Zope] Making Zope stop storing old object versions


How do I go about replacing a Catalog using MySQL ? This is the first
time I've heard this.
/snip

Here's the relevant chapter in the Zope Book: 
http://plope.com/Books/2_7Edition/RelationalDatabases.stx



Jonathan 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Making Zope stop storing old object versions

2008-05-08 Thread Sinang, Danny
How do I go about replacing a Catalog using MySQL ? This is the first
time I've heard this. 

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 08, 2008 7:16 PM
To: Sinang, Danny
Cc: zope@zope.org
Subject: Re: [Zope] Making Zope stop storing old object versions

 Sinang, Danny wrote:
 Hello,

 We've got lots of Catalog reads and writes and our Data.fs is growing

 at an immense rate.

 Is there a way we can tell Zope to stop storing old object versions 
 to limit the growth and not have to pack that often ?

Well in fact it (Filestorage) does only store new object versions.
What it does not is removing the old version - this is done during
packing.

When you have many Catalog writes or other parts of your object tree 
experiences many writes, try to mount an extra ZODB (and storage)
there.

You can also try some of the other storages like relstorage (where it 
depends on the RDBMS how it handles writes)

Alternatively, you could just replace your Catalog with an external db
such as MySQL (using zmysql database connections).


Jonathan 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Making Zope stop storing old object versions

2008-05-07 Thread Sinang, Danny
Hello,
 
We've got lots of Catalog reads and writes and our Data.fs is growing at
an immense rate. 
 
Is there a way we can tell Zope to stop storing old object versions to
limit the growth and not have to pack that often ?
 
Regards,
Danny
 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Turning back system clock

2008-05-05 Thread Sinang, Danny
Dear All,
 
The system clock of our Zope 2.7 machine accidentally got set to 2009.
We noticed this mistake 6 hours later and we decided to set back the
clock to 2008. 
 
How does this affect the integrity of Data.fs ?
 
From our observation :
 
1. Session write errors suddenly began to appear
 
2. Data.fs.index won't grow anymore and its timestamp remained at the
time we set back the clock
 
3. Packing the database (which was 8 GB at the time) took too long
without any signs of any Data.fs.pack file in the var folder. We decided
to restart Zope after a few minutes.
 
4. There seem to be some catalog indexing problems as our catalog
searches on a certain field doesn't work as reliably as it did before.
We tried reindexing the field and even the catalog, but it timed out on
us (lots of objects in the database).
 
Has anyone here had any similar experiences ? How do I go about fixing
this ?
 
Using repozo.py last night, I made a full backup of Data.fs, copied it
to a new instance, was able to create a new Data.fs.index, and
eventually succeeded in packing the 8 GB database to just 2.4 GB. But it
took quite a while - like 10 or 15 minutes before any Data.fs.pack
appeared. 
 
I haven't checked yet if the catalog indexing problem has gone away.
 
Regards,
Danny
 
 
 
 
 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] How to stop packing ?

2008-05-05 Thread Sinang, Danny
Hi All,
 
Is it possible to stop an ongoing ZODB packing operation without
restarting Zope ?
 
Am using Zope 2.7.6-final.
 
- Danny
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Turning back system clock

2008-05-05 Thread Sinang, Danny
Thanks.

Is there a way to spot these data inconsistencies in Data.fs and remove
or fix them ?

Regards,
Danny 

-Original Message-
From: Andreas Jung [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 06, 2008 12:31 PM
To: Sinang, Danny; zope@zope.org
Subject: Re: [Zope] Turning back system clock



--On 6. Mai 2008 10:28:29 +0800 Sinang, Danny [EMAIL PROTECTED]
wrote:

 Dear All,

 The system clock of our Zope 2.7 machine accidentally got set to 2009.
 We noticed this mistake 6 hours later and we decided to set back the 
 clock to 2008.

 How does this affect the integrity of Data.fs ?

 From our observation :

 1. Session write errors suddenly began to appear

 2. Data.fs.index won't grow anymore and its timestamp remained at the 
 time we set back the clock

 3. Packing the database (which was 8 GB at the time) took too long 
 without any signs of any Data.fs.pack file in the var folder. We 
 decided to restart Zope after a few minutes.

 4. There seem to be some catalog indexing problems as our catalog 
 searches on a certain field doesn't work as reliably as it did before.
 We tried reindexing the field and even the catalog, but it timed out 
 on us (lots of objects in the database).

 Has anyone here had any similar experiences ? How do I go about fixing

 this ?

Turning the clock back is known to result in data inconsistencies.
It is is best-practice having NTP installed on all Zope machines.

-aj
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Referencing authenticated user

2007-01-30 Thread Sinang, Danny
Hello,
 
I need to  modify a Zope product to record the authenticated user
executing a method.
 
How do I refer to the authenticated user ?
 
Regards,
Danny
 
 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] URL referencing

2007-01-25 Thread Sinang, Danny
Hello,
 
I've got a script located in /wms/Ccp/Main/TeamLead/Scripts and it needs
to reference a workflow object in /wms/Ccp/Main/Workflows/Ccp/ .
 
Currently, we do this by issuing this line :
 
wf = context.Workflows.Ccp.ccp_agro_article
 
But everytime we run this, a username/password prompt comes up, and no
matter what we enter (even if we use a Manager account), nothing works.
 
I'm thinking maybe I should refer to the workflow object using a
full-path approach. Question is, how ? Do I say :
 
wf = wms.Ccp.Main.Workflows.Ccp.ccp_agro_article 
 
?
 
I tried it and got a global name 'wms' is not defined message.

Hope somebody here could shed some light.
 
Regards,
Danny
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Checking in pages, scripts, and sql methods to SVN

2006-11-16 Thread Sinang, Danny
Hello,
 
Is there a Zope product out there that would allow me to check into SVN
my Zope objects (i.e. TAL pages, Python scripts, and ZSQLMethods) ?
 
If not, can anyone here show me some skeleton code to :
 
1. Enumerate these objects
2. Reference them as files 
 
so I can programmatically check them into SVN ?
 
Regards,
Danny
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Password expiration

2006-11-14 Thread Sinang, Danny



Hello,

"Out of the box", is 
Zope able to do password-expiration ?

Or do I needan 
authentication product to do this ? Will this external product be 
able to effectpassword expirationon existing acl_user folder users 
?


Regards,

Danny

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Programmatically logging out a user

2006-10-03 Thread Sinang, Danny



Hello,

How do I 
programmatically log out a user from Zope ?

I've asked this 
question before, but was told to :

1. Redirect the user 
to a page that always raises Unauthenticated. 
Seemanage_zmi_logout.
2. from AccessControl.SecurityManagement import 
noSecurityManagernoSecurityManager()
Are there any other 
ways out there ?

Regards,Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Log in as another user

2006-10-01 Thread Sinang, Danny



Hello,

In Unix, there's the 
"su" command which admins can use to log in as another user.

Is there a similar 
facility in Zope ?

If not, is there a 
way for admins to view the passwords of their users ?

Regards,Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] ZEO and Data.fs

2006-09-18 Thread Sinang, Danny



Hello,

We're currently not 
using ZEO, but may do so in the future.

Question is, do we 
need to export or convertour Data.fs toa ZEO-capableformat 
?

Regards,
Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Turning off authentication for a zpt page

2006-09-15 Thread Sinang, Danny



Hello,

I'm using a Zope 
product called OpenFlowEditor and I modified one of its .zpt pages 
(view_process.zpt).

All is well, except 
that I now want to allow Anonymous users to view this zpt page. 


I tried doing so by 
checking the "Anonymous" checkbox for the "View" privilege in http://myserver/OpenFlowEditor/view_process/manage_access 
, but still no success. Am still being asked for a username and 
password.

Any idea on how to 
get this working ?

Regards,
Danny

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] How to reference an object under a given folder

2006-09-07 Thread Sinang, Danny



Hello,

I want to reference 
an object named "Es"foundin the directory /apps/wms 
.

I'd normally create 
a script in /apps/wms and issue the command obj = getattr(context,"Es") 
.

But how do I do so 
from a script located elsewhere ?

Regards,
Danny

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Zope hands when database takes too long to respond

2006-09-06 Thread Sinang, Danny



Hello,

We wrote an 
application (on Zope v2.7.6-final) that queries a MySQL database via ZMySQLDA 
v2.0.8.

Whenever the MySQL 
server experiences heavy load, Zope seems to hang, such that we can't even 
access the ZMI.

Is this a bug in 
version 2.7.6 or ZMySQLDA ?

Or are there some 
settings I can tweak to adjust some database connection timeout value 
?

Regards,
Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Zope hangs when database takes too long to respond

2006-09-06 Thread Sinang, Danny



Sorry for the typo error. 

The subject should read "hangs", not "hands" 
.


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Sinang, DannySent: 
Wednesday, September 06, 2006 10:56 PMTo: 
zope@zope.orgSubject: [Zope] Zope hands when database takes too long 
to respond

Hello,

We wrote an 
application (on Zope v2.7.6-final) that queries a MySQL database via ZMySQLDA 
v2.0.8.

Whenever the MySQL 
server experiences heavy load, Zope seems to hang, such that we can't even 
access the ZMI.

Is this a bug in 
version 2.7.6 or ZMySQLDA ?

Or are there some 
settings I can tweak to adjust some database connection timeout value 
?

Regards,
Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] RE: Zope hangs when database takes too long to respond

2006-09-06 Thread Sinang, Danny


 It is a known limitation of Zope, which has a set number of worker
threads available to service user requests.  If a worker thread blocks
(e.g., waiting for MySQL), it is not able to do any work for other
pending requests.

 You can tweak the number of threads in your zope.conf file, via the
'zserver-threads' directive (the default value is 4).  If you do
increase this value, you also need to increase the number of database
connections avialble (via 'pool-size') which will increase the RAM
required by your appserver.


Thanks Tres.

I found 'zserver-threads' in zope.conf, but couldn't find 'pool-size'.
Am using Zope 2.7.6.

Is this something available on higher versions of Zope ?

Regards,
Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Zope hangs when database takes too long to respond

2006-09-06 Thread Sinang, Danny
 Seems that all your Zope threads are busy (they're waiting for
database response). There is no more threads to serve next requests so
they're waiting (you may say that zope hangs in this situation, but in
fact all it's threads are waiting for DB).
You may install DeadlockDebugger product and you'll be able to see what
your's Zope threads are really doing.

Thanks.

Besides DeadlockDebugger, is there a way to see just how many threads
Zope is currently using ?

Regards,
Danny

 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] custom_zodb.py

2006-09-06 Thread Sinang, Danny



In the Zope Book 
v2.6, it says :

"Each database connection maintains its own cache (see above, "Database 
Cache"), so bumping the number of 
connections up increases memory requirements. Only change this setting if 
you're sure you have the memory to spare.

To change this setting, create a 
file called "custom_zodb.py" in your Zope installation directory. In this file, 
put the following code:"
Am 
not sure which directory "Zope installation directory" pertains 
to.
Is 
this the fresh directory from the Zope.tar.gz file 
?
Or is 
this thealready-installed directory ? Or would it be the instance 
directory ? If so,which subdirectorydo I place 
custom_zodb.py ? 
Regards,Danny
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] custom_zodb.py

2006-09-06 Thread Sinang, Danny
 
Per http://www.plope.com/Books/2_7Edition/MaintainingZope.stx#2-27 , it
still says write your own custom_zodb.py .

Can you point me to the exact location ?

Regards,
Danny

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Paul Winkler
Sent: Thursday, September 07, 2006 9:16 AM
To: zope@zope.org
Subject: Re: [Zope] custom_zodb.py

Unless you are using Zope 2.6, don't do that.

For Zope 2.7 or later, see the 2.7 version of the book at plope.com.
Some chapters were never updated from the 2.6 version but even so it's
much improved.

For zope 2.7 or later, what you want to do is now done by editing
zope.conf.

On Thu, Sep 07, 2006 at 08:44:08AM +0800, Sinang, Danny wrote:
 In the Zope Book v2.6, it says :
  
 Each database connection maintains its own cache (see above, 
 Database Cache), so bumping the number of connections up increases 
 memory requirements. Only change this setting if you're sure you have 
 the memory to spare.
 
 To change this setting, create a file called custom_zodb.py in your 
 Zope installation directory. In this file, put the following code:
 
 Am not sure which directory Zope installation directory pertains to.
 
 Is this the fresh directory from the Zope .tar.gz file ?
 
 Or is this the already-installed directory ? Or would it be the 
 instance directory ? If so, which subdirectory do I place
custom_zodb.py ?
 
 Regards,
 Danny
 

 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )


-- 

Paul Winkler
http://www.slinkp.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] The id s5/begin contains characters illegal in URLs

2006-08-10 Thread Sinang, Danny
 Because '/' is a reserved character since it is used in URLs as path
separator.

Any workarounds ? 

Is there a way to refer to the said objects without using the '/' ?
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] The id s5/begin contains characters illegal in URLs

2006-08-10 Thread Sinang, Danny
 
 Huh? Usually you have  no chance to create a Zope object with such an
id.
 So there is no need to rename something that can't exist be definition
:-)

Exactly. 

The said object, s5/Begin, is the Begin activity of the s5 process
found in the GeneralWorkflow workflow - which is an OpenFlow (
www.openflow.it ) object.

I was able to rename my processes (S5, S100, S200) to their lowercase
counterparts since all I had to do was do :

///

wf = container.GeneralWorkflow
catalog = wf.Catalog

processes = catalog.ZopeFind(wf, obj_metatypes=['Process'],
search_sub=1)

for p in processes:
wf.manage_renameObject(p[0], p[0].lower())  

///


When I try to rename the activities found in those processes, I try to
do likewise, but the ZopeFind results come out like this :

('S100/Begin', activity at /dev/danny/wms/GeneralWorkflow/S100/Begin)
('S100/RECEIPT_OF_SOURCE_DOCUMENTS', activity at
/dev/danny/wms/GeneralWorkflow/S100/RECEIPT_OF_SOURCE_DOCUMENTS)
('S100/CHECK_MS_BATCHING', activity at
/dev/danny/wms/GeneralWorkflow/S100/CHECK_MS_BATCHING)

To call manage_renameObject (), I have to supply it with the object
name.

If I use result[0], I get the illegal characters in URL error. 

And if I use result[1].id, I get :

Error Type: AttributeError
Error Value: Begin

This is probably because there is no Begin object under the wf
container from which I'm calling manage_renameObject().

So my question is, how do I refer to the Begin object found in the
S100 workflow ?

Regards,
Danny

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] The id s5/begin contains characters illegal in URLs

2006-08-10 Thread Sinang, Danny

 You must call manage_renameObject on the object *container*, passing
the old name and the new name. Something like this:

   object = result[1]
   container = object.aq_parent
   container.manage_renameObject(object.id, object.id.lower())

Thanks Gabriel.

I did exactly as you suggested, but ran into this error :

/
The id begin is invalid - it is already in use.
/

Begin is the first activity. It could be some reserved word within
OpenFlow or Zope - not really sure. 

In any case, I tried skipping it, but ran into another error message
saying :

///
The object RECEIPT_OF_SOURCE_DOCUMENTS does not support this operation.
///

My code looks like this :


/

wf = container.GeneralWorkflow
catalog = wf.Catalog

results = catalog.ZopeFind(wf, obj_metatypes=['Activity'], search_sub=1)


for result in results:
print result[1].id
if result[1].id  'Begin':
   object = result[1]
   container = object.aq_parent
   container.manage_renameObject(object.id, object.id.lower())

return printed 


/


Regards,
Danny

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Programatically logging out of Zope

2006-08-03 Thread Sinang, Danny



Hello,

Would anyone here 
know how to programmatically log out of Zope ?

Regards,
Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Finding and Mass-renaming objects

2006-07-31 Thread Sinang, Danny



Hello,

We need to find some 
objects in Zope and rename them to their lower-case equivalents. 


Is there a way to do 
this either via the ZMI or programmatically ?

Regards,
Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Finding and Mass-renaming objects

2006-07-31 Thread Sinang, Danny


 Look at the ZopeFind() and/or ZopeFindAndApply() methods as defined in
OFS.FindSupport.

I've tried ZopeFind() and it can indeed find the objects I'm looking
for.

Am now trying to use ZopeFindAndApply() to find and rename the objects
found using manage_renameObject(). 

However, since manage_renameObject() renames subobjects, I think I need
to determine the parent-object or container of the found objects.

Would anyone here know how to do so or suggest an alternate way of
renaming these objects ?

Regards,
Danny

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Recreating catalog contents

2006-07-17 Thread Sinang, Danny



Hello,

Am using Zope 
2.7.6-final.

We accidentally 
clicked on the "Clear Catalog" button and all the catalog contents were 
zapped.

However, the folder 
containing the said catalog still has the information we 
need.

We can still list 
down the once-cataloged list of workflow processes using the object_values() 
function.

Can anyone here 
guide me on how to recatalog these objects ?


Regards,

Danny 
Sinang
Senior Software Architect
PublishingSPi 
T:632 855 9469M:63 918 9178020E: [EMAIL PROTECTED]www.spi-bpo.com

The contents of this e-mail message may be privileged and 
onfidential. Therefore, if this message has been received in error, please 
delete it without reading it. Your receipt of this message is not intended to 
waive any applicable privilege. Please do not disseminate this message without 
the permission of the author.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Recreating catalog contents

2006-07-17 Thread Sinang, Danny
Already tried, but we're getting multiple-undo errors. 

-Original Message-
From: Andreas Jung [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 17, 2006 4:55 PM
To: Sinang, Danny; zope@zope.org
Subject: Re: [Zope] Recreating catalog contents



--On 17. Juli 2006 16:51:06 +0800 Sinang, Danny [EMAIL PROTECTED]
wrote:

 Hello,

 Am using Zope 2.7.6-final.

 We accidentally clicked on the Clear Catalog button and all the 
 catalog contents were zapped.

 However, the folder containing the said catalog still has the 
 information we need.

 We can still list down the once-cataloged list of workflow processes 
 using the object_values() function.

 Can anyone here guide me on how to recatalog these objects ?



Try Undo, try using the Find tab.

-aj
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Recreating catalog contents

2006-07-17 Thread Sinang, Danny
It worked.

Thanks AJ. 

-Original Message-
From: Andreas Jung [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 17, 2006 5:03 PM
To: Sinang, Danny; Andreas Jung
Cc: zope@zope.org
Subject: RE: [Zope] Recreating catalog contents

Then use the Find tab.

-aj

--On 17. Juli 2006 16:57:18 +0800 Sinang, Danny [EMAIL PROTECTED]
wrote:

 Already tried, but we're getting multiple-undo errors.

 -Original Message-
 From: Andreas Jung [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 17, 2006 4:55 PM
 To: Sinang, Danny; zope@zope.org
 Subject: Re: [Zope] Recreating catalog contents



 --On 17. Juli 2006 16:51:06 +0800 Sinang, Danny 
 [EMAIL PROTECTED]
 wrote:

 Hello,

 Am using Zope 2.7.6-final.

 We accidentally clicked on the Clear Catalog button and all the 
 catalog contents were zapped.

 However, the folder containing the said catalog still has the 
 information we need.

 We can still list down the once-cataloged list of workflow processes 
 using the object_values() function.

 Can anyone here guide me on how to recatalog these objects ?



 Try Undo, try using the Find tab.

 -aj



--
ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376 
E-Publishing, Python, Zope  Plone development, Consulting
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Zope performance experiences

2006-07-14 Thread Sinang, Danny



Dear 
All,

Can anyone share 
their experiences on Zope's performance, what your hardware / Zope configs are, 
and how you plan to scale ?

Regards,
Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Searching for and displaying properties

2006-06-25 Thread Sinang, Danny
 manage_addProperty does not trigger recataloguing of the object even
if its a subclass of CatalogAwareness. You should ?  either call
 obj.reindex_object() or at least obj.index_object(), if your class has
the CatalogAwareness-Mixin or you use the catalog  API:

 yourcatalog.catalog_object(obj,obj.absolute_url_path())

 After that, your metadata should show up nicely w/o indexing the whole
object tree.

Thanks Tino.

I'd like to try your suggestion, but I don't know how to refer to the
object that needs recataloguing. Can you help ? Again, here's my code
that calls manage_addProperty.

code

wf = context.GeneralWorkflow
instance_id = wf.addInstance( process_id=process, customer=jobname,
comments=comment, title=subject, activation=1)
wf.getInstance(instance_id).manage_addProperty('jobname', 'ABC12345',
'string')

/code

- Danny
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Searching for and displaying properties

2006-06-24 Thread Sinang, Danny


 'jobname' is added as *metadata* to your catalog?

Not sure if using manage_addProperty () to add jobname is equivalent to
adding it as *metadata* .

code

manage_addProperty('jobname', 'ABC12345', 'string')

/code

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Searching for and displaying properties

2006-06-24 Thread Sinang, Danny
 
 This add a property to an object but it has nothing to do with adding
 *metadata* to a ZCatalog instance. Please read the ZCatalog chapter of
the Zope Book 2.7 edition. It carefully explains  what *metadata* in
the ZCatalog context means. The short version: a Zcatalog search returns
 *proxy* objects and the attrs of the proxy object contain only the
values of the original object where you have  
 configured a metadata in the Zcatalog.

Having read the Zope 2.7 ZCatalog chapter, I think I can say there's
always been a metadata column called jobname.

So going back to my original question, is there a way for me not to have
to mass-refresh my entire catalog just to be able to display my
properties ?

Regards,
Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Searching for and displaying properties

2006-06-24 Thread Sinang, Danny
 

 Click on update catalog in the Advanced tab or use the
refreshCatalog() 
 method of the ZCatalog (described in its interfaces.py file).

refreshCatalog() is exactly what I was forced to use in the first place.

I was wondering if there exists an alternative function / method that
won't require refreshing / reindexing the entire Catalog.

Regards,
Danny

 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Searching for and displaying properties

2006-06-24 Thread Sinang, Danny
 That's the official ZCatalog API. Otherwise find your objects through
a catalog search and reindex them individually.

I already did the reindexing just before the search and it didn't work.
In any case, I may have found a workaround by using getObject().

According to
http://www.plope.com/Books/2_7Edition/SearchingZCatalog.stx#2-10 : 

getObject() Returns the actual zope object from the result object. This
is useful if you want to examine or show an attribute or method of the
object that isn't in the metadata--once we have the actual object, we
can get any normal attribute or method of it. However, be careful not to
use this instead of defining metadata. Metadata, being stored in the
catalog, is pre-calculated and quickly accessed; getting the same type
of information by using getObject().attribute_name requires actually
pulling your real object from the ZODB and may be a good deal slower. On
the other hand, stuffing everything you might ever need into metadata
will slow down all querying of your catalog, so you'll want to strike a
balance. A good idea is to list in metadata those things that would
normally appear on a tabular search results form; other things that
might be needed less commonly (and for fewer result objects at a time)
can be retried with getObject.

I tried it and it works. My code now looks like this :

code

wf = context.GeneralWorkflow
cat = wf.Catalog

jobs = cat.searchResults({'jobname':'ABC12345'})
for j in jobs:
print j.getObject().jobname

return printed

/code

My only question now is ... How much slower is this solution than using
the jobname metadata (assuming it worked).

- Danny
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Streaming files

2005-08-10 Thread Sinang, Danny



Dear 
List,

Am a newbie so 
please bear with me. 

I need Zope to 
stream files to my users when they click on a link.

Exactly how is this 
done ? Is it by the use of the Request.Write () method ? If so, canyou 
give me sample code and some reference links ?

Thanks.
Danny


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )