[Zope-Checkins] SVN: Zope/branches/2.9/ Issue #2296: Fix broken import of ZClass products.

2007-03-22 Thread Tres Seaver
Log message for revision 73455:
  Issue #2296:  Fix broken import of ZClass products.

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/App/Product.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===
--- Zope/branches/2.9/doc/CHANGES.txt   2007-03-22 15:32:47 UTC (rev 73454)
+++ Zope/branches/2.9/doc/CHANGES.txt   2007-03-22 15:44:16 UTC (rev 73455)
@@ -8,6 +8,10 @@
 
Bugs fixed
 
+  - Collector #2296: Fixed import of ZClass products, broken by removal
+of BBB support for pasting objects whose meta_type info was
+permission-free.
+
   - Collector #2294: Protected DOS-able ControlPanel methods with the
 same 'requestmethod' wrapper.
 

Modified: Zope/branches/2.9/lib/python/App/Product.py
===
--- Zope/branches/2.9/lib/python/App/Product.py 2007-03-22 15:32:47 UTC (rev 
73454)
+++ Zope/branches/2.9/lib/python/App/Product.py 2007-03-22 15:44:16 UTC (rev 
73455)
@@ -45,6 +45,7 @@
 from OFS.Folder import Folder
 from HelpSys.HelpSys import ProductHelp
 from AccessControl import Unauthorized
+from AccessControl.Permissions import manage_zclasses
 
 from Factory import Factory
 from Permission import PermissionManager
@@ -60,7 +61,8 @@
 meta_type ='Product Management'
 icon='p_/ProductFolder_icon'
 
-all_meta_types={'name': 'Product', 'action': 'manage_addProductForm'},
+all_meta_types={'name': 'Product', 'action': 'manage_addProductForm',
+'permission': manage_zclasses},
 meta_types=all_meta_types
 
 # This prevents subobjects from being owned!

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.10/ Issue #2296: fix broken ZClass product import.

2007-03-22 Thread Tres Seaver
Log message for revision 73456:
  Issue #2296:  fix broken ZClass product import.

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/App/Product.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2007-03-22 15:44:16 UTC (rev 73455)
+++ Zope/branches/2.10/doc/CHANGES.txt  2007-03-22 15:51:29 UTC (rev 73456)
@@ -8,6 +8,10 @@
 
 Bugs fixed
 
+  - Collector #2296: Fixed import of ZClass products, broken by removal
+of BBB support for pasting objects whose meta_type info was
+permission-free.
+
   - Collector #2294: Protected DOS-able ControlPanel methods with the
 same 'requestmethod' wrapper.
 

Modified: Zope/branches/2.10/lib/python/App/Product.py
===
--- Zope/branches/2.10/lib/python/App/Product.py2007-03-22 15:44:16 UTC 
(rev 73455)
+++ Zope/branches/2.10/lib/python/App/Product.py2007-03-22 15:51:29 UTC 
(rev 73456)
@@ -47,6 +47,7 @@
 from HelpSys.HelpSys import ProductHelp
 from AccessControl import Unauthorized
 from AccessControl import ClassSecurityInfo
+from AccessControl.Permissions import manage_zclasses
 
 from Factory import Factory
 from Permission import PermissionManager
@@ -73,7 +74,8 @@
 meta_type ='Product Management'
 icon='p_/ProductFolder_icon'
 
-all_meta_types={'name': 'Product', 'action': 'manage_addProductForm'},
+all_meta_types={'name': 'Product', 'action': 'manage_addProductForm',
+'permission': manage_zclasses},
 meta_types=all_meta_types
 
 # This prevents subobjects from being owned!

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ Issue #2296: Fix broken ZClass product import.

2007-03-22 Thread Tres Seaver
Log message for revision 73460:
  Issue #2296: Fix broken ZClass product import.

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/App/Product.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-03-22 15:58:08 UTC (rev 73459)
+++ Zope/trunk/doc/CHANGES.txt  2007-03-22 15:59:23 UTC (rev 73460)
@@ -88,6 +88,10 @@
 
 Bugs Fixed
 
+  - Collector #2296: Fixed import of ZClass products, broken by removal
+of BBB support for pasting objects whose meta_type info was
+permission-free.
+
   - Collector #2294: Protected DOS-able ControlPanel methods with the
 same 'requestmethod' wrapper.
   

Modified: Zope/trunk/lib/python/App/Product.py
===
--- Zope/trunk/lib/python/App/Product.py2007-03-22 15:58:08 UTC (rev 
73459)
+++ Zope/trunk/lib/python/App/Product.py2007-03-22 15:59:23 UTC (rev 
73460)
@@ -47,6 +47,7 @@
 from HelpSys.HelpSys import ProductHelp
 from AccessControl import Unauthorized
 from AccessControl import ClassSecurityInfo
+from AccessControl.Permissions import manage_zclasses
 
 from Factory import Factory
 from Permission import PermissionManager
@@ -73,7 +74,8 @@
 meta_type ='Product Management'
 icon='p_/ProductFolder_icon'
 
-all_meta_types={'name': 'Product', 'action': 'manage_addProductForm'},
+all_meta_types={'name': 'Product', 'action': 'manage_addProductForm',
+'permission': manage_zclasses},
 meta_types=all_meta_types
 
 # This prevents subobjects from being owned!

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Zope Tests: 5 OK

2007-03-22 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Wed Mar 21 12:00:00 2007 UTC to Thu Mar 22 12:00:00 2007 UTC.
There were 5 messages: 5 from Zope Unit Tests.


Tests passed OK
---

Subject: OK : Zope-2.7 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Wed Mar 21 21:52:50 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007478.html

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Wed Mar 21 21:54:20 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007479.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Wed Mar 21 21:55:50 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007480.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Wed Mar 21 21:57:20 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007481.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Wed Mar 21 21:58:50 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007482.html

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


[Zope-dev] buildbot failure in Zope branches 2.9 2.4 Linux zc-buildbot

2007-03-22 Thread buildbot
The Buildbot has detected a failed build of Zope branches 2.9 2.4 Linux 
zc-buildbot.

Buildbot URL: http://buildbot.zope.org/

Build Reason: The web-page 'force build' button was pressed by '': 

Build Source Stamp: None
Blamelist: 

BUILD FAILED: failed test

sincerely,
 -The Buildbot

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


[Zope-dev] buildbot failure in Zope branches 2.9 2.4 Linux zc-buildbot

2007-03-22 Thread buildbot
The Buildbot has detected a failed build of Zope branches 2.9 2.4 Linux 
zc-buildbot.

Buildbot URL: http://buildbot.zope.org/

Build Reason: The web-page 'force build' button was pressed by '': 

Build Source Stamp: None
Blamelist: 

BUILD FAILED: failed test

sincerely,
 -The Buildbot

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


[Zope-dev] buildbot failure in Zope branches 2.10 2.4 Linux zc-buildbot

2007-03-22 Thread buildbot
The Buildbot has detected a failed build of Zope branches 2.10 2.4 Linux 
zc-buildbot.

Buildbot URL: http://buildbot.zope.org/

Build Reason: The web-page 'force build' button was pressed by '': 

Build Source Stamp: None
Blamelist: 

BUILD FAILED: failed test

sincerely,
 -The Buildbot

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


[Zope-dev] buildbot failure in Zope trunk 2.4 Linux zc-buildbot

2007-03-22 Thread buildbot
The Buildbot has detected a failed build of Zope trunk 2.4 Linux zc-buildbot.

Buildbot URL: http://buildbot.zope.org/

Build Reason: The web-page 'force build' button was pressed by '': 

Build Source Stamp: None
Blamelist: 

BUILD FAILED: failed test

sincerely,
 -The Buildbot

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


[Zope] dtml Z SQL doubt

2007-03-22 Thread Remil Mathew

Hi all,

I need to insert a row to mysql table if the corresponding  data not exist,
if it exist i need to update the row.

Can we do it using a single Z SQL method.

Many thanks
Anz
___
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] dtml Z SQL doubt

2007-03-22 Thread Maciej Wisniowski

 Hi all,

 I need to insert a row to mysql table if the corresponding  data not
 exist, if it exist i need to update the row.

 Can we do it using a single Z SQL method.
Yes, if your ZSQL will call stored procedure that will handle this logic.
Otherwise, I think you can't (but I might be wrong).

-- 
Maciej Wisniowski
___
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] mass editing timeout problem

2007-03-22 Thread Allen Huang
I made a python product for a photo album and I have store a lot of pictures.
But the problem arise when I have too many pictures of high resoution that 
taken up too much hdd space so I have written some codes in dtml and python to 
resize and reduces each image size in zodb without download any pictures.

I written my code so it informs me on dos command prompt about what picture it 
is processing and how long it took until starts the next one. The process 
started fast, but it gradually slows down and eventually my web browser (my 
interface to start the process) timeout  but the command prompt is still 
running. I waited until the command prompt finish all the picture and click 
open the picture in zope and no action was done on any pictures that was 
supposely to be resized. 

I try the same process but targeted only one folder (less pictures)and the 
process worked fine and all the picture were resized accordingly and the web 
browser didn't timeout.

How come nothing happened when the browser timeout??


 

Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html ___
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] dtml Z SQL doubt

2007-03-22 Thread Tino Wildenhain

Remil Mathew schrieb:

Hi all,

I need to insert a row to mysql table if the corresponding  data not 
exist, if it exist i need to update the row.


Can we do it using a single Z SQL method.


Well thats not business of ZSQL methods but rather
stuff you do with the instruments of your database.
Say SQL (or whatever SQL like mysql has there)

IIRC, mysql has some kind of UPSERT which should
handle it. If not, stored procedure or trigger
etc could do it.

Regards
Tino
___
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] Addressbook Product

2007-03-22 Thread Frank-braucht-Hilfe

Hi,

tahnk you for your answer Mihamina.

hmm, i've seen this product you proposed, but i looked somewhat to basic to
me and I am running cps and havent found anything about combining cps and
plone yet, so I had no easy test possibility.

LDAP sounds great, the more I look for an solution the more often I see the
word LDAP. My impression is, that the integration of zope and LDAP is not
quite easy (in order to have a nice addressbook) and many people want to
have it, but few already succeeded.
I found the LDAP Directory Manager (zope product) it sounds quite nice, but
hasent been updatend for years, though.

Any experiences and suggestions for a nice LDAP-solution?

Thx Frank



Mihamina (R12y) Rakotomandimby wrote:
 
 On Tuesday 20 March 2007 11:39, Frank Drews wrote:
 Hi,

 I have realy searched for a nice addressbook product for a couple two
 days now. I dont find anything suitable. I need it for a collaboration
 plattform running on zope, cmf. I like zope very much and am looking for
 a shared addressbook.
 Anybody any experiences or suggestions?
 What would be realy great, but no must-have feature for me would be an
 integration of the user-data and some permission features to set (who
 can view/write which addresses)..

 Imho a shared addressbook (both for userdata and external contacts) is
 the most important missing feature to make zope a very powerfull
 groupware-portal (forums, mails, calender, documents, workflow, wiki,
 chat ... all already very nice).
 
 What's wrong with this?
 http://plone.org/products/myaddressbook
 
 Anyway, while CPS was not turned to Java it had a nice basic addressbook.
 Ithink you could also consider setting up an LDAP directory and then put
 any 
 LDAP backend to query it.
 
 ___
 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 )
 
 

-- 
View this message in context: 
http://www.nabble.com/Addressbook-Product-tf3432864.html#a9610940
Sent from the Zope - General mailing list archive at Nabble.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] Re: mass editing timeout problem

2007-03-22 Thread Laurence Rowe

Use Firefox, it won't time out.

Nothing happened when the browser timed out because the web server had 
no way of knowing the browser had timed out.


Laurence


Allen Huang wrote:
I made a python product for a photo album and I have store a lot of 
pictures.
But the problem arise when I have too many pictures of high resoution 
that taken up too much hdd space so I have written some codes in dtml 
and python to resize and reduces each image size in zodb without 
download any pictures.
 
I written my code so it informs me on dos command prompt about what 
picture it is processing and how long it took until starts the next one. 
The process started fast, but it gradually slows down and eventually my 
web browser (my interface to start the process) timeout  but the command 
prompt is still running. I waited until the command prompt finish all 
the picture and click open the picture in zope and no action was done on 
any pictures that was supposely to be resized.
 
I try the same process but targeted only one folder (less pictures)and 
the process worked fine and all the picture were resized accordingly and 
the web browser didn't timeout.
 
How come nothing happened when the browser timeout??



Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! 
Games. http://us.rd.yahoo.com/evt=49936/*http://videogames.yahoo.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 )


[Zope] open image in a fitted new window

2007-03-22 Thread Alan

Dears,

I was wondering how to once clicking on a image (thumbnail) I would
get the full-size image in a fitted new window, without buttons,
address field etc. I can realise how to do it with javascript but I
don't know, if it's the only way, how to integrate javascript in a
zpt. A example/tutorial would be very welcome so.

If it can be done without javascript, just with zope tools, that would
be very appreciated.

Many thanks in advance.
Cheers,
Alan
___
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] dtml Z SQL doubt

2007-03-22 Thread Allen Schmidt Sr.

Just use REPLACE instead of INSERT.
If REPLACE statement is able to determine a unique value for a row and 
sees that that unique value exists for a row, the valued will be 
updated. If it does not exist, a new row will be inserted. This is what 
I use with MySQL.


Allen


Tino Wildenhain wrote:

Remil Mathew schrieb:


Hi all,

I need to insert a row to mysql table if the corresponding  data not 
exist, if it exist i need to update the row.


Can we do it using a single Z SQL method.



Well thats not business of ZSQL methods but rather
stuff you do with the instruments of your database.
Say SQL (or whatever SQL like mysql has there)

IIRC, mysql has some kind of UPSERT which should
handle it. If not, stored procedure or trigger
etc could do it.

Regards
Tino
___
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] mass editing timeout problem

2007-03-22 Thread Jonathan


- Original Message - 
From: Allen Huang [EMAIL PROTECTED]

To: Zope zope@zope.org
Sent: Thursday, March 22, 2007 5:06 AM
Subject: [Zope] mass editing timeout problem


I made a python product for a photo album and I have store a lot of 
pictures.
But the problem arise when I have too many pictures of high resoution that 
taken up too much hdd space so I have written some codes in dtml and 
python to resize and reduces each image size in zodb without download any 
pictures.


I written my code so it informs me on dos command prompt about what 
picture it is processing and how long it took until starts the next one. 
The process started fast, but it gradually slows down and eventually my 
web browser (my interface to start the process) timeout  but the command 
prompt is still running. I waited until the command prompt finish all the 
picture and click open the picture in zope and no action was done on any 
pictures that was supposely to be resized.


I try the same process but targeted only one folder (less pictures)and the 
process worked fine and all the picture were resized accordingly and the 
web browser didn't timeout.


How come nothing happened when the browser timeout??


Try using a utility like wget.


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] open image in a fitted new window

2007-03-22 Thread Maciej Wisniowski

 I was wondering how to once clicking on a image (thumbnail) I would
 get the full-size image in a fitted new window, without buttons,
 address field etc. I can realise how to do it with javascript but I
 don't know, if it's the only way, how to integrate javascript in a
 zpt. A example/tutorial would be very welcome so.
What you're asking for? How to insert javascript code into html page?

-- 
Maciej Wisniowski
___
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] open image in a fitted new window

2007-03-22 Thread Alan

The answer to your question is Yes if there's no other way of clicking
on a link and open an image in a fitted new window of my browser that
zope can cope without using javascript.

But putting in other words what I really would like to know: does zope
have its own way of clicking on a link and open an image in a fitted
new window without buttons, address field etc.?

Cheers,
Alan

On 22/03/07, Maciej Wisniowski [EMAIL PROTECTED] wrote:


 I was wondering how to once clicking on a image (thumbnail) I would
 get the full-size image in a fitted new window, without buttons,
 address field etc. I can realise how to do it with javascript but I
 don't know, if it's the only way, how to integrate javascript in a
 zpt. A example/tutorial would be very welcome so.
What you're asking for? How to insert javascript code into html page?

--
Maciej Wisniowski




--
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.

http://www.bio.cam.ac.uk/~awd28

___
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] open image in a fitted new window

2007-03-22 Thread Jonathan


- Original Message - 
From: Alan [EMAIL PROTECTED]

To: Maciej Wisniowski [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Thursday, March 22, 2007 9:01 AM
Subject: Re: [Zope] open image in a fitted new window



The answer to your question is Yes if there's no other way of clicking
on a link and open an image in a fitted new window of my browser that
zope can cope without using javascript.

But putting in other words what I really would like to know: does zope
have its own way of clicking on a link and open an image in a fitted
new window without buttons, address field etc.?


Zope only performs server-side actions.  What you are describing are actions 
that occur on the client-side (ie. on the user's pc/browser), therefore you 
must use client-side tools (ie. javascript).



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] open image in a fitted new window

2007-03-22 Thread Alan

Thanks Jonathan, I can understand your point. So I will google for a
way (example/tutorial) of how integrating javascript in a zpt.

Cheers,
Alan

On 22/03/07, Jonathan [EMAIL PROTECTED] wrote:


- Original Message -
From: Alan [EMAIL PROTECTED]
To: Maciej Wisniowski [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Thursday, March 22, 2007 9:01 AM
Subject: Re: [Zope] open image in a fitted new window


 The answer to your question is Yes if there's no other way of clicking
 on a link and open an image in a fitted new window of my browser that
 zope can cope without using javascript.

 But putting in other words what I really would like to know: does zope
 have its own way of clicking on a link and open an image in a fitted
 new window without buttons, address field etc.?

Zope only performs server-side actions.  What you are describing are actions
that occur on the client-side (ie. on the user's pc/browser), therefore you
must use client-side tools (ie. javascript).


Jonathan





--
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.

http://www.bio.cam.ac.uk/~awd28

___
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: open image in a fitted new window

2007-03-22 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Alan wrote:
 Thanks Jonathan, I can understand your point. So I will google for a
 way (example/tutorial) of how integrating javascript in a zpt.
 
 Cheers,
 Alan
 
 On 22/03/07, Jonathan [EMAIL PROTECTED] wrote:
 - Original Message -
 From: Alan [EMAIL PROTECTED]
 To: Maciej Wisniowski [EMAIL PROTECTED]
 Cc: zope@zope.org
 Sent: Thursday, March 22, 2007 9:01 AM
 Subject: Re: [Zope] open image in a fitted new window


 The answer to your question is Yes if there's no other way of clicking
 on a link and open an image in a fitted new window of my browser that
 zope can cope without using javascript.

 But putting in other words what I really would like to know: does zope
 have its own way of clicking on a link and open an image in a fitted
 new window without buttons, address field etc.?
 Zope only performs server-side actions.  What you are describing are actions
 that occur on the client-side (ie. on the user's pc/browser), therefore you
 must use client-side tools (ie. javascript).

The only trick here is to get the javascript to include the dynamic
URL;  everything else is not specific to Zope or ZPT.  Here is the hack
I usually use for that::

  !-- assumes that 'image' is bound to an actual Zope image object --
  script type=text/javascript lang=JavaScript
  tal:define=img_url image/absolute_url
  tal:content=string:var img_url='${img_url}';/script

Your popup javascript can then refer to the 'img_url' JS variable to set
the window location.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGAoJb+gerLs4ltQ4RAjCXAJ9KJ+RELcq5iTNkfUSWMYy8D9mDDwCfVLNE
/Bo+E5mRc5Ntft8f0dB7IG0=
=fizE
-END PGP SIGNATURE-

___
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] Re: open image in a fitted new window

2007-03-22 Thread Tino Wildenhain

Tres Seaver schrieb:
...

The only trick here is to get the javascript to include the dynamic
URL;  everything else is not specific to Zope or ZPT.  Here is the hack
I usually use for that::

  !-- assumes that 'image' is bound to an actual Zope image object --
  script type=text/javascript lang=JavaScript
  tal:define=img_url image/absolute_url
  tal:content=string:var img_url='${img_url}';/script

Your popup javascript can then refer to the 'img_url' JS variable to set
the window location.



A little bit cleaner approach would be to have an ordinary link:

a class=magnify href=path/to/big/imageimg src=path/to/thumbnail 
width, height ... //a



and have a general javascript which scans thru the DOM after load,
finds the a-objects with class-attribute magnify and installs
an handler for mouse click which overrides the usual link action
and either pops up a window or uses layers the big view on top
with little DOM action (preferred). You dont even net buzzy Ajax
for this. The URL for the big picture is just encoded in the HTML
already, so you can use the usual tal: attributes to define in
ZPT.

The result is clean xhtml code which works in any case and only
is improved in case of javascript beeing available.

Regards
Tino
___
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] dtml Z SQL doubt

2007-03-22 Thread Paul Winkler
On Thu, Mar 22, 2007 at 08:11:21AM -0400, Allen Schmidt Sr. wrote:
 Just use REPLACE instead of INSERT.
 If REPLACE statement is able to determine a unique value for a row and 
 sees that that unique value exists for a row, the valued will be 
 updated. If it does not exist, a new row will be inserted. This is what 
 I use with MySQL.

Or, depending on what you want, the INSERT...ON DUPLICATE KEY UPDATE
syntax can be used.
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html

Note that both of these idioms are specific to MySQL and not portable
to other databases.

-PW


-- 

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] How can I reset zope time???

2007-03-22 Thread flem
Through a zwiki a spammer proxied some information though a zope server using 
zwiki's comments (be aware!). The spammer had dated his ip-packets 11/12-2007. 
And all my changes got the same date! So, I couldn't shrink all the undo 
actions though the database shrinker (later I found out that should just use 
-300). To get rid of 10 GB of undo history, I changed the computers time to 
12/12-2007 and then undoed and gave the computer the right time again. Fine! 

But, now, not only have all my changes the date 12/12-2007 in the undo history, 
every object I have changed gets this date as well! Apparently, zope won't 
accept to go backward in time.

How do I reset the zope's time? 

DateTime().Date() gives the right time.

Flemming
___
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] context.user at ImplPython.py

2007-03-22 Thread Garito

Hi!
I debug ImplPython.py to try to understand why my code don't work ok

If you remember my last threat I wonder why some actions marked as Manager
execute ok but other not
You could refresh your mind about it at:
http://archives.free.net.ph/message/20070312.184003.211597ad.en.html

When validate (line 237) try to evaluate if the user is autenthicated and
has right roles (line 436) the self._authenticated is set to TRUE but
context.user is Anonymous User even when I'm authenticated to Garito

Is this normal? (this is what causes the error for me)

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito
___
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] CorpCalendar 1.4 and 1.7 issues

2007-03-22 Thread Thomas Bennett
Long story short:

Is it appropriate to change 
  self.REQUEST.AUTHENTICATED_USER.name
to
  self.REQUEST.REMOTE_USER
?

It appears to work but I'm not sure if there may be repercussions on this.

Thomas


Long story:

I had to make the change in getUserVariable(self, key, default=None) to view 
events CorpCalender 1.4 that was exported from Zope 2.6.1 and make the change 
in rememberUserVariable(self, key, value) to be able to add events in 
CorpCalendar 1.7 newly created calendars in Zope 2.9.6.
 
I can't manage/edit any events in the imported CorpCalendar but I'm not real 
concerned about that because we can add the new calendars to carry on from 
the last dates on the old ones.


Current configuration on server I am moving to:

Zope Version(Zope 2.9.6-final, python 2.4.4, linux2) 
Python Version  2.4.4 (#1, Oct 23 2006, 13:58:00) [GCC 4.1.1 20061011 (Red Hat 
4.1.1-30)] 
System Platform linux2 
Using ZEO

I am moving CorpCalendar 1.4 calendars from Zope 2.6.1 to CorpCalendar 1.7 on 
Zope 2.9.6

Traceback said 'name' was not an attribute of AUTHENTICATED_USER
when trying to view events or add events

The change I made was
from
user = self.REQUEST.AUTHENTICATED_USER
username = user.name
to
user = self.REQUEST.AUTHENTICATED_USER
username = self.REQUEST.REMOTE_USER

in the functions 
   def rememberUserVariable(self, key, value):
and 
   def getUserVariable(self, key, default=None):

as shown below. 


def rememberUserVariable(self, key, value):
 set in stone 
cookiekey = '__corpcal_%s'%key.replace(' ','')
user = self.REQUEST.AUTHENTICATED_USER
username = self.REQUEST.REMOTE_USER
#username = user.name
# cookie
then = DateTime()+300
then = then.rfc822()
response = self.REQUEST.RESPONSE
response.setCookie(cookiekey, value, expires=then, path='/')
if username.lower().replace(' ','') != 'anonymoususer':
_user_vs = self._user_variables
if not self._user_variables.has_key(username):
_user_vs[username] = {}
_user_vs[key] = value
self._user_variables = _user_vs


def getUserVariable(self, key, default=None):
 get from stone 
cookiekey = '__corpcal_%s'%key.replace(' ','')
user = self.REQUEST.AUTHENTICATED_USER
username = self.REQUEST.REMOTE_USER
#username = user.name
# cookie
if self.REQUEST.cookies.has_key(cookiekey):
return self.REQUEST.cookies.get(cookiekey)
if username.lower().replace(' ','') != 'anonymoususer':
if self._user_variables.has_key(username):
if self._user_variables[username].has_key(key):
return self._user_variables[username][key]

return default


Thomas
 
-- 

Thomas McMillan Grant Bennett   Appalachian State University
Computer Consultant III P O Box 32026
University Library  Boone, North Carolina 28608
(828) 262 6587

If it's not as simple as possible to try it, then the barrier to entry is too 
high.

Library Systems Help Desk: http://www.library.appstate.edu/help/

___
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] CorpCalendar 1.4 and 1.7 issues

2007-03-22 Thread Andreas Jung



--On 22. März 2007 14:09:00 -0400 Thomas Bennett [EMAIL PROTECTED] 
wrote:



Long story short:

Is it appropriate to change
  self.REQUEST.AUTHENTICATED_USER.name
to
  self.REQUEST.REMOTE_USER
?



Using AUTHENTICATED_USER isn't recommended (since ages). You should always
use the SecurityManager API:

from AccessControl import getSecurityManager

user = getSecurityManager().getUser()
username = user.getUserName()

Changing request parameters as a workaround for stinking code is
unlikely a good choice. Better fix the related code instead of messing
up the REQUEST.

-aj

pgpanj4ocGZcM.pgp
Description: PGP signature
___
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] CorpCalendar 1.4 and 1.7 issues

2007-03-22 Thread Thomas Bennett
Thanks,  that even now lets me edit and also add to the CorpCalendars I 
exported from the older Zope and CC product. 

Now I just need to look at the Zope Book to see what the changes to the 
security declarations are so the lines below will quit showing up in my 
event.log.  

In the meantime I'm going to look into other calendars that have additional 
features.

Thomas

--
2007-03-22T14:10:44 WARNING Init Class 
Products.CorpCalendar.CorpCalendar.CorpCalendar has a security declaration 
for nonexistent method 'addEvent'
--
2007-03-22T14:10:44 WARNING Init Class 
Products.CorpCalendar.CorpCalendar.CorpCalendar has a security declaration 
for nonexistent method 'index_html'
--
2007-03-22T14:10:44 WARNING Init Class 
Products.CorpCalendar.CorpCalendar.CorpCalendar has a security declaration 
for nonexistent method 'standard_html_footer'
--
2007-03-22T14:10:44 WARNING Init Class 
Products.CorpCalendar.CorpCalendar.CorpCalendar has a security declaration 
for nonexistent method 'styles.css'
--
2007-03-22T14:10:44 WARNING Init Class 
Products.CorpCalendar.CorpCalendar.CorpCalendar has a security declaration 
for nonexistent method 'standard_html_header'
--
2007-03-22T14:10:44 WARNING Init Class 
Products.CorpCalendar.CorpCalendar.CorpEvent has a security declaration for 
nonexistent method 'edit'
--
2007-03-22T14:10:44 WARNING Init Class 
Products.CorpCalendar.CorpCalendar.CorpEvent has a security declaration for 
nonexistent method 'move'
--
2007-03-22T14:10:44 WARNING Init Class 
Products.CorpCalendar.CorpCalendar.CorpEvent has a security declaration for 
nonexistent method 'delete'
--
2007-03-22T14:10:44 WARNING Init Class 
Products.CorpCalendar.CorpCalendar.CorpEvent has a security declaration for 
nonexistent method 'index_html'
--



On Thursday 22 March 2007 13:26, Andreas Jung wrote:
 --On 22. März 2007 14:09:00 -0400 Thomas Bennett [EMAIL PROTECTED]

 wrote:
  Long story short:
 
  Is it appropriate to change
self.REQUEST.AUTHENTICATED_USER.name
  to
self.REQUEST.REMOTE_USER
  ?

 Using AUTHENTICATED_USER isn't recommended (since ages). You should always
 use the SecurityManager API:

 from AccessControl import getSecurityManager

 user = getSecurityManager().getUser()
 username = user.getUserName()

 Changing request parameters as a workaround for stinking code is
 unlikely a good choice. Better fix the related code instead of messing
 up the REQUEST.

 -aj

-- 

Thomas McMillan Grant Bennett   Appalachian State University
Computer Consultant III P O Box 32026
University Library  Boone, North Carolina 28608
(828) 262 6587

If it's not as simple as possible to try it, then the barrier to entry is too 
high.

Library Systems Help Desk: http://www.library.appstate.edu/help/

___
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: CorpCalendar 1.4 and 1.7 issues

2007-03-22 Thread Josef Meile
Now I just need to look at the Zope Book to see what the changes to the 
security declarations are so the lines below will quit showing up in my 
event.log.  


--
2007-03-22T14:10:44 WARNING Init Class 
Products.CorpCalendar.CorpCalendar.CorpCalendar has a security declaration 
for nonexistent method 'addEvent'

--
Well the security declarations are the same. The only thing that changed 
is that the zope develolpers added this wonderful warning when one adds 
a security declaration for an inexistent method. In older zope versions 
you could do this and no warning was shown in the log. So, you could 
waste lots of time trying to figure out that your method raised an 
Unathorized Exception because of a typo in the security declaration.


Regards,
Josef
___
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] can I use incremental search without managable Indexes ?

2007-03-22 Thread Dieter Maurer
joachim wrote at 2007-3-21 19:06 +0100:
 ...
I want to use Dieter Maurers incremental search. Can I do this without
using his managable indexes ?

You need to use indexes that are willing to use IncrementalSearch
(you should use IncrementalSearch2 in fact, as the or is too
slow for IncrementalSearch).

Usually, an index works like this:

 It fetches the IITreeSet containing the set of documents ids
 indexed under the search term.

 In the simple case (just one search term), it returns the result.

 In more complex cases (e.g. a range search or a set of search terms),
 it combines the sets from several look ups via intersection
 or multi_union and returns this result.

 The catalog framework combines all these results with intersection.

This behaviour needs to change in order for IncrementalSearch2 to
have an effect:

 The IITreeSet for a search term is 
 wrapped by an IBTree. The IBTree behaves like an intelligent
 cursor which can either use the tree like access structure
 or the linkage of the leaf nodes to quickly move through the
 tree able to skip large parts of it without loading from storage.

 In case, that partial results need to be combined,
 IAnd and IOr need to be used (rather than intersection
 and multi_union).

 If you are interested in the final result, the asSet method
 needs to be called.

As you see from the decription, it is not difficult for an
index (and the querying framework) to use IncrementalSearch2
but it must be done.

Up to now, I only know of Managable Index that they do this.

By the way: there is no need that all indexes are Managable Indexes.
AdvancedQuery can use IncrementalSearch[2] with indexes that support
them and work as usual with other indexes. Of course, you will get
fewer gains when some indexes cannot work incrementally.



-- 
Dieter
___
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 can I get all roles defined

2007-03-22 Thread Josh Burvill

Hi everyone,

I need to get all the roles that are defined in the security tab of a
particular folder.

I know how to get all roles that a user has got, but cannot find the above.

Thanks, Josh
___
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] Re: How can I get all roles defined

2007-03-22 Thread Josh Burvill

def get_roles():
 from AccessControl.Role import RoleManager

 rs=RoleManager().userdefined_roles()

 return rs

i tried this in an external method but i only get:
('Anonymous', 'Authenticated', 'Manager', 'Owner')

and not all the roles i have defined in the folder.

I also tried the methods:
get_local_roles
and
valid_roles

I'm probably not using the right method, or doing something wrong. Any
further tips?

Thanks, Josh

On 23/03/07, Tres Seaver [EMAIL PROTECTED] wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Josh Burvill wrote:
 Hi everyone,

 I need to get all the roles that are defined in the security tab of a
 particular folder.

 I know how to get all roles that a user has got, but cannot find the
above.

 Thanks, Josh

AccessControl/Role.py is your friend.  The mix-in class is a RoleManager.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGAxgw+gerLs4ltQ4RAvaKAJ9mp8UqlIDbbRuohTXIKAaWOCN/kgCg2DjW
AVvfKLoA21KgGkVdwONtDmg=
=BsoS
-END PGP SIGNATURE-

___
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] How can I reset zope time???

2007-03-22 Thread Flemming Bjerke
On Thu, 22 Mar 2007 17:46:31 +0100
Jens Vagelpohl [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 
 On 22 Mar 2007, at 17:11, flem wrote:
 
  Through a zwiki a spammer proxied some information though a zope  
  server using zwiki's comments (be aware!). The spammer had dated  
  his ip-packets 11/12-2007. And all my changes got the same date!  
  So, I couldn't shrink all the undo actions though the database  
  shrinker (later I found out that should just use -300). To get rid  
  of 10 GB of undo history, I changed the computers time to  
  12/12-2007 and then undoed and gave the computer the right time  
  again. Fine!
 
  But, now, not only have all my changes the date 12/12-2007 in the  
  undo history, every object I have changed gets this date as well!  
  Apparently, zope won't accept to go backward in time.
 
  How do I reset the zope's time?
 
 Undo is transactional, meaning an undo is actually a new transaction  
 instead of removing an old transaction. What you are trying to do is  
 not possible, unless you physically truncate the database.

I am not absolutely sure I understand you. I succeeded in undoing. My problem 
is that zope keeps on with the date 12/12-07. The zodb does not seem to accept 
a timestamp that is earlier than the last ... 

Flemming
___
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-DB] Re: DCOracle2 TIMESTAMP DataType Issue

2007-03-22 Thread Matthew T. Kromer
The type table just registers the known Oracle data types and whether  
or not there are type converters registered,

TYPEENTRY has no converter,
TYPOENTRY has a registered output converter,
CTYPOENTRY has a coercion output converter, where oracle is asked to  
return the result as a different type, or where size data has to be  
provided.


Its entirely possible you could change the type table entry for a  
timestamp to be


CTYPOENTRY(SQLT_TIMESTAMP,SQLT_DAT,7)

and then copy (don't rename) the whole CONVERTOUTF(SQLT_DAT) function  
to be CONVERTOUTF(SQLT_TIMESTAMP).


I don't know if Oracle can convert a timestamp into a date though.   
It probably can  :)  This may lose data doing the conversion.  You  
could also ask for it to always be converted to a string in the  
converter, or anything else -- the second parameter to CTYPOENTRY  
tells it what to return the type as, and the 3rd is the size.  The  
output conversion routine is named on the first parameter, but its  
input arguments will be based on the 2nd and 3rd.


On Mar 21, 2007, at 5:04 AM, Maan M. Hamze wrote:

I checked dco2.c yesterday and I did notice that there is no  
converter for SQLT_TIMESTAMP:

COVERTOUTF(SQLT_TIMESTAMP)

I wanted to study the code further, so that I do not sound like an  
idiot :-D
I noticed the following which discouraged me from making more  
comments about it:

In

struct TypeTableStruct TypeTable[]

There is CTYPOENTRY. TYPEENTRY, and TYPOENTRY
We have for example:

/* I */ TYPOENTRY(SQLT_DAT), /* Date */
TYPEENTRY(SQLT_TIMESTAMP), /* Time stamp */

Where *I* means internal Oracle type
So the suggestion is that SQLT_TIMESTAMP is not an internal oracle  
type, and it is an argument of TYPEENTRY while SQLT_DAT is internal  
oracle type and is an argument of TYPOENTRY.


I do not know if this makes a difference related to writing:
COVERTOUTF(SQLT_TIMESTAMP)

You wtire:
Take a look at the function CONVERTOUTF(SQLT_DAT) -- although  
that  might also be where the segfault comes from.  That function  
hops  around on one leg a bit to try to get the C library mktime  
and gmtime  system time conversion routines to do the heavy lifting.


DCOracle2 on Windows XP comes back with the error message that an  
unknown datatype of SQLT_TIMESTAMP is encontered (not a segfault).   
I'll run it again today on Windows XP to see which line is  
producing the error.  Maybe then we would know if CONVERTOUTF 
(SQLT_DAT) is producing error or simply the absence of CONVERTOUTF 
(SQLT_TIMESTAMP) is causing it.


Maan



- Original Message - From: Matthew T. Kromer  
[EMAIL PROTECTED]

To: Maan M. Hamze [EMAIL PROTECTED]
Cc: zope-db@zope.org
Sent: Tuesday, March 20, 2007 8:32 PM
Subject: Re: [Zope-DB] DCOracle2 with a Stored Procedure that  
Returns REFCURSOR / ORA TIMESTAMP DataType Issue



Chances are good that the C code that is trying to construct the
timestamp doesn't know how to convert it...

A quick peek into the source code hints the code doesn't have a type
converter for SQLT_TIMESTAMP, although there is a converter for
SQLT_DAT (date).

Putting a converter into the C code shouldn't be all that tough, if
you need to do it you can probably figure it out :)

Take a look at the function CONVERTOUTF(SQLT_DAT) -- although that
might also be where the segfault comes from.  That function hops
around on one leg a bit to try to get the C library mktime and gmtime
system time conversion routines to do the heavy lifting.

On Mar 20, 2007, at 8:53 AM, Maan M. Hamze wrote:


To give an update:
To run a stored procedure which returns a ref cursor, I tried:
c1 = db.cursor()
c2 = db.cursor()
sql = storedProcedureName(:inparam1, :inparam2, etccc, :outparam)
options = (inparam1, inparam2, et, c2)
c1.execute(sql, options)
As recommended below.
This did not work.

However, this worked:
c1 = db.cursor()
c2 = db.cursor()
c2 = c1.procedures.storedProcedureName(INparam1, INparam2, etc..)
Only the INparams are given as arguments.  c2 is returned as a cursor
OUTparam.
Then,
r = c2.fetchall(), or
r = c2.fetchone()
Etc.

This was causing a segmentation fault on a Sun Solaris box.
On Windows, I got an actual error message.  While fetching, the  
cursor
has a field of ora datatype TimeStamp.  This was crashing   
DCOracle2.  a

to_char solved the issue.
I am using DCOracle2 and Oracle 10 on Solaris (and Windows XP).
Did anyone run into issues of handling TimeStamp oracle data type  
with

DCOracle2?
Maan


-Original Message-
From: Maan M. Hamze [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 17, 2007 5:32 PM
To: zope-db@zope.org
Subject: Re: [Zope-DB] DCOracle2 with a Stored Procedure that Returns
REFCURSOR

m.banaouas [EMAIL PROTECTED]:
options = (2714,  + ' +  + ', + 36, 1, c2)

it's wrong!
you must give a sequence as second parameter of execute method.

So you do like this:
options = (2714, '',36, 1, c2)
c1.execute(sql, options)
--
I tried it both ways.
With what you suggest:
Import DCOracle2
db = 

[Zope-DB] RE: DCOracle2 TIMESTAMP DataType Issue - Resolved :-)

2007-03-22 Thread Maan M. Hamze
Matt -
IT WORKED :-D
I tried it with both, SQLT_DAT, and SQLT_STR:
I started by adding:
a.  CONVERTOUTF(SQLT_TIMESTAMP); //Add to list of CONVERTOUTF at the top
of file
Then:
I:  With SQLT_DAT
I replaced TYPEENTRY(SQLT_TIMESTAMP) in TypeTable[] with
a.  CONVERTOUTF(SQLT_TIMESTAMP, SQLT_DAT,7) // changing number 7 did not

//make any difference with
the 
//result
b.  I COPIED CONVERTOUTF(SQLT_DAT) into CONVERTOUF(SQLT_TIMESTAMP)
 //without changing the body of the function

I recompiled, and selected a timestamp field (without recasting it of
course).
Result:  OracleDate with -mm-dd hh:mm:ss
So, Seconds granuality is lost (tenths, hundredths, and thousandth)
Which is expected, but for all practical purposes, it does not matter.

Then,
II: with SQLT_STR
I replaced TYPEENTRY(SQLT_TIMESTAMP) in TypeTable[] with
a.  CONVERTOUTF(SQLT_TIMESTAMP, SQLT_STR,50) // changing length affected
 //length of resulting
string
b.  I COPIED CONVERTOUTF(SQLT_STR) into CONVERTOUF(SQLT_TIMESTAMP)
 //without changing the body of the function

Result:  Full timestamp value as a string,
Such as:  03-MAY-06 12.00.00.00 AM

Along with other changes to dco2.c it may be time to coordinate a new
package release.
However, I need to add some WIN32 defs to the code in order to make one
platform independent package.  This mainly affects the _decl statement
for windows, and the dword issue.
I also need to add a define for ORACLE10G into dco2.c, and a way of
detecting oracle10g in oratest.  However, I still do not know what to
detect using nm.
Whatever the case is:  DCOracle2 is FINE into Oracle10 and with time
stamps.
As far as I am concerned, this is great news.

You know, I love your implementation with these converters.  This dco2.c
is a gem of a code piece of writing.
Thanks for your help,
Maan 

-Original Message-
From: Matthew T. Kromer [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 22, 2007 5:42 AM
To: Maan M. Hamze
Cc: zope-db@zope.org
Subject: Re: DCOracle2 TIMESTAMP DataType Issue

The type table just registers the known Oracle data types and whether  
or not there are type converters registered,
TYPEENTRY has no converter,
TYPOENTRY has a registered output converter,
CTYPOENTRY has a coercion output converter, where oracle is asked to  
return the result as a different type, or where size data has to be  
provided.

Its entirely possible you could change the type table entry for a  
timestamp to be

CTYPOENTRY(SQLT_TIMESTAMP,SQLT_DAT,7)

and then copy (don't rename) the whole CONVERTOUTF(SQLT_DAT) function  
to be CONVERTOUTF(SQLT_TIMESTAMP).

I don't know if Oracle can convert a timestamp into a date though.   
It probably can  :)  This may lose data doing the conversion.  You  
could also ask for it to always be converted to a string in the  
converter, or anything else -- the second parameter to CTYPOENTRY  
tells it what to return the type as, and the 3rd is the size.  The  
output conversion routine is named on the first parameter, but its  
input arguments will be based on the 2nd and 3rd.

On Mar 21, 2007, at 5:04 AM, Maan M. Hamze wrote:

 I checked dco2.c yesterday and I did notice that there is no  
 converter for SQLT_TIMESTAMP:
 COVERTOUTF(SQLT_TIMESTAMP)

 I wanted to study the code further, so that I do not sound like an  
 idiot :-D
 I noticed the following which discouraged me from making more  
 comments about it:
 In

 struct TypeTableStruct TypeTable[]

 There is CTYPOENTRY. TYPEENTRY, and TYPOENTRY
 We have for example:

 /* I */ TYPOENTRY(SQLT_DAT), /* Date */
 TYPEENTRY(SQLT_TIMESTAMP), /* Time stamp */

 Where *I* means internal Oracle type
 So the suggestion is that SQLT_TIMESTAMP is not an internal oracle  
 type, and it is an argument of TYPEENTRY while SQLT_DAT is internal  
 oracle type and is an argument of TYPOENTRY.

 I do not know if this makes a difference related to writing:
 COVERTOUTF(SQLT_TIMESTAMP)

 You wtire:
 Take a look at the function CONVERTOUTF(SQLT_DAT) -- although  
 that  might also be where the segfault comes from.  That function  
 hops  around on one leg a bit to try to get the C library mktime  
 and gmtime  system time conversion routines to do the heavy lifting.

 DCOracle2 on Windows XP comes back with the error message that an  
 unknown datatype of SQLT_TIMESTAMP is encontered (not a segfault).   
 I'll run it again today on Windows XP to see which line is  
 producing the error.  Maybe then we would know if CONVERTOUTF 
 (SQLT_DAT) is producing error or simply the absence of CONVERTOUTF 
 (SQLT_TIMESTAMP) is causing it.

 Maan



 - Original Message - From: Matthew T. Kromer  
 [EMAIL PROTECTED]
 To: Maan M. Hamze [EMAIL PROTECTED]
 Cc: zope-db@zope.org
 Sent: Tuesday, March 20, 2007 8:32 PM
 Subject: Re: [Zope-DB] DCOracle2 with a Stored Procedure that  
 Returns REFCURSOR / ORA TIMESTAMP DataType Issue


 

[Zope-DB] DCOracle2 and x86_64

2007-03-22 Thread Maan M. Hamze
Maceij -
You got the following:
gcc -pthread -shared  ./dco2.o  -L/opt/oracle/client.9/product/lib32/
-lclntsh -Wl,-rpath,/opt/oracle/client.9/product/lib  -o ./dco2.so
 
BOTH oracle lib directories should be lib32.  In the above, you have one
pointing to lib32 and the other one to lib.  Change the MAKE file to
reflect this.
Also, make sure that you actually have the 32-bit libs in the lib32.
The point is this:  the paths should be to the location of the 32-bit
libs wherever they are, and the paths above should be set to these
32-bit paths.  Also, LD_LIBRARY_PATH should point to the 32-bit lib
path.
Link, and then point your LD_LIBRARY_PATH to the oracle 64-bit lib path.
This has worked with me without fail with DCOracle2 and other programs
too that use oracle libs.  I use Solaris.
Hi
 
Anybody uses DCOracle2 under 64 bit machine?
Any problems with that?
 
We have some problems under RHEL4 and 64
bit Operton CPU. Under heavy load our Zope
is just restarting. /var/log/messages says:
(...) kernel: python[10526]: segfault at a0084c10 rip
002a959041a0 rsp 002a9ff828d8 error 4
 
We're trying to realize what may cause this. I don't
expect that it is something with Zope, so
maybe DCOracle2? We are using this with Oracle9.
 
Anybody knows whether DCOracle2 should or shouldn't
work with x86_64 architecture? Any hints how it should be
configured/installed under such architecture?
 
I've found some messages on mailing list about
changing paths to lib32/ in some DCOracle2 files:
http://mail.python.org/pipermail/python-list/2004-August/276891.html
 
I tried this but I get:
 
gcc -pthread -shared  ./dco2.o  -L/opt/oracle/client.9/product/lib32/
-lclntsh -Wl,-rpath,/opt/oracle/client.9/product/lib  -o ./dco2.so
/usr/bin/ld: skipping incompatible
/opt/oracle/client.9/product/lib32//libclntsh.so when searching for
-lclntsh
/usr/bin/ld: cannot find -lclntsh
collect2: ld returned 1 exit status
make[1]: *** [dco2.so] Error 1
make[1]: Leaving directory
`/opt/Zope/instancje/kfk_kw_testa/Products/DCOracle2/src'
 
 
-- 
Maciej Wisniowski

 

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] DCOracle2 and x86_64

2007-03-22 Thread Maciej Wisniowski
 Maceij -
 You got the following:
 gcc -pthread -shared  ./dco2.o  -L/opt/oracle/client.9/product/lib32/
 -lclntsh -Wl,-rpath,/opt/oracle/client.9/product/lib  -o ./dco2.so
  
 BOTH oracle lib directories should be lib32.  In the above, you have one
 pointing to lib32 and the other one to lib.  Change the MAKE file to
 reflect this.
 Also, make sure that you actually have the 32-bit libs in the lib32.
 The point is this:  the paths should be to the location of the 32-bit
 libs wherever they are, and the paths above should be set to these
 32-bit paths.  Also, LD_LIBRARY_PATH should point to the 32-bit lib
 path.
 Link, and then point your LD_LIBRARY_PATH to the oracle 64-bit lib path.
 This has worked with me without fail with DCOracle2 and other programs
 too that use oracle libs.  I use Solaris.
Thanks for the hints! Currently I can't check this (we've installed 32 bit
systems on our servers in order to avoid segfaults :) ) but I'll try
when it'll be possible.

-- 
Maciej Wisniowski
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db