Re: [Zope] __getitem__ and returning a PageTemplateFile instance
Anders Bruun Olsen wrote: On Tue, Oct 18, 2005 at 03:30:42PM -0500, J Cameron Cooper wrote: error_log is by default set to ignore three common types of exceptions. You should remove NotFound from the list if you're getting NotFound exceptions and want to see them. Ahhh.. Thanks, now I have a traceback, unfortunately it didn't make it any more clear to me what the problem is. Traceback (innermost last): Module ZPublisher.Publish, line 104, in publish Module ZPublisher.BaseRequest, line 355, in traverse Module ZPublisher.HTTPResponse, line 651, in debugError In Zope 2.7, I see that line raising a debug error. Why it doesn't get through I don't know, but here's what it says:: "The object at %s has an empty or missing " \ "docstring. Objects must have a docstring to be " \ "published." % URL That should help you, I think. All Zope objects that are to be published to the web must have a docstring. --jcc -- "Building Websites with Plone" http://plonebook.packtpub.com/ Enfold Systems, LLC http://www.enfoldsystems.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 )
Re: [Zope] __getitem__ and returning a PageTemplateFile instance
On Tue, Oct 18, 2005 at 03:30:42PM -0500, J Cameron Cooper wrote: > error_log is by default set to ignore three common types of exceptions. > You should remove NotFound from the list if you're getting NotFound > exceptions and want to see them. Ahhh.. Thanks, now I have a traceback, unfortunately it didn't make it any more clear to me what the problem is. Traceback (innermost last): Module ZPublisher.Publish, line 104, in publish Module ZPublisher.BaseRequest, line 355, in traverse Module ZPublisher.HTTPResponse, line 651, in debugError NotFound: Site Error An error was encountered while publishing this resource. Debugging Notice Zope has encountered a problem publishing your object. Cannot locate object at: http://localhost:8080/vitester/asonhe Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to error log. If the error persists please contact the site maintainer. Thank you for your patience. -- Anders -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS/O d--@ s:+ a-- C++ UL+++$ P++ L+++ E- W+ N(+) o K? w O-- M- V PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b++ DI+++ D+ G e- h !r y? --END GEEK CODE BLOCK-- PGPKey: http://random.sks.keyserver.penguin.de:11371/pks/lookup?op=get&search=0xD4DEFED0 ___ 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] __getitem__ and returning a PageTemplateFile instance
Anders Bruun Olsen wrote: On Sun, Oct 16, 2005 at 06:50:09PM +0200, Dieter Maurer wrote: I am trying to make a product where-in I want to be able to return a page based on the url, think something like /product/username which would return a page with the users details. For this purpose I am using __getitem__, but when I return a PageTemplateFile instance it just tells me it has encountered a problem publishing the object. I such a case, you look at the traceback (which you can find in the "error_log" object in your Zope "Root Folder" (ZMI)). It just says "No exceptions logged." So it does not log any errors in error_log. The error message I am getting is: Site Error An error was encountered while publishing this resource. Debugging Notice Zope has encountered a problem publishing your object. Cannot locate object at: http://localhost:8080/vitester/asonhe If it does not solve the problem directly, you include the full error information (at least "Error Type", "Error Value" *AND* "traceback") in your post. If there had been a better error description I would of course have included it, but the thing that has made this difficult to understand is that I haven't been able to find any real error messages. I have enabled debug-mode and am running Zope in the foreground, but it reports no errors at all. error_log is by default set to ignore three common types of exceptions. You should remove NotFound from the list if you're getting NotFound exceptions and want to see them. --jcc -- "Building Websites with Plone" http://plonebook.packtpub.com/ Enfold Systems, LLC http://www.enfoldsystems.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 )
Re: [Zope] write file to FS (LocalFS?)
> http://www.zope.org/Members/asterisk/ZFSPath/ That one is OK for my use. Thank you! -- Administration & Formation à l'administration de serveurs dédiés: http://www.google.fr/search?q=aspo+infogerance+serveur ___ 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] now learning zpt
You can find this information in the Zope Book: http://www.plope.com/Books/2_7Edition/ScriptingZope.stx#1-6 Zenrique.2005/10/18, Garry Saddington <[EMAIL PROTECTED]>: Having had a bit of a lambasting over my use of dtml, I have started tolearn zpt. However, I am curious about the following:How do you do the equivalent of name="comp.name:records" to submitmultiple values to zsql or to a python script, especially when the initial list is generated dynamically.regardsGarry___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] write file to FS (LocalFS?)
These may help: http://www.zope.org/Members/jfarr/HowTo/DTML_with_LocalFS http://www.zope.org/Members/asterisk/ZFSPath/ hth Jonathan - Original Message - From: "Rakotomandimby Mihamina" <[EMAIL PROTECTED]> To: Sent: Tuesday, October 18, 2005 2:00 PM Subject: [Zope] write file to FS (LocalFS?) Hi, I am on a unix-like operating system, Zope 2.8, CMF, CPS (SVN Trunk). I would like users to be abble to write some file on the filesystem. I know there is LocalFS but I did not find a way to easy learn it. Do you have? -- Administration & Formation à l'administration de serveurs dédiés: http://www.google.fr/search?q=aspo+infogerance+serveur ___ 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] now learning zpt
Having had a bit of a lambasting over my use of dtml, I have started to learn zpt. However, I am curious about the following: How do you do the equivalent of name="comp.name:records" to submit multiple values to zsql or to a python script, especially when the initial list is generated dynamically. regards Garry ___ 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] write file to FS (LocalFS?)
Hi, I am on a unix-like operating system, Zope 2.8, CMF, CPS (SVN Trunk). I would like users to be abble to write some file on the filesystem. I know there is LocalFS but I did not find a way to easy learn it. Do you have? -- Administration & Formation à l'administration de serveurs dédiés: http://www.google.fr/search?q=aspo+infogerance+serveur ___ 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 2.8.3 released
Hi all, on behalf of Zope Corporation and the Zope community I am pleased to announce the release of Zope 2.8.3. You can download Zope 2.8.2 from http://www.zope.org/Products/Zope/2.8.3/ This version obsoletes Zope 2.8.2 which shipped with an older Docutils version as expected. For security reasons you should update to Zope 2.8.3. Some new features of Zope 2.8: - ZODB 3.4 with MVCC (multi version concurrency control) support. MVCC solves nearly every problem with ZODB read-conflict errors which is very important for high-traffic Zope sites. - Extension Classes were rewritten as Python new-style classes making all features of Python new-style classes available in Zope objects. This includes support for cyclic garbage collection. - Integration of Zope 3 technologies through Five (see http://codespeak.net/z3/five/) For more information on what is new in this release, see the CHANGES.txt files for the release: http://www.zope.org/Products/Zope/2.8.3/CHANGES.txt See also: http://www.zope.org/Wikis/DevSite/Projects/Zope2.8/OverView Please bring all the bugs you have found to the Zope bugtracker: http://collector.zope.org/Zope":http://collector.zope.org/Zope For more information on the available Zope releases, guidance for selecting the right distribution and installation instructions, please see: http://www.plope.com/Books/2_7Edition/InstallingZope.stx Please also keep in mind that Zope 2.8.2 requires Python 2.3.5. Zope 2.8.2 is not certified for any Python 2.4.x versions. So using Python 2.4 is neither recommended nor supported and any related questions or problems are likely to be ignored until 2.4 is an officially supported Python version for Zope. -- Andreas Jung(andreas at zopyx dot com) pgpEnCwZXFQWw.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] fine grained, dynamic permissions based on attribute values
On Tue, 2005-10-18 at 11:05, Chris Crownhart wrote: > Good day, > > I am wondering if/how I could control the permissions on an object based > on the value of an attribute. I am using CMF, and thus portal_catalog, > and have built a custom content type. My type has a category field. I > would like to control the view permission of the object dynamically > based on the value of category. > > So, as an example, I have multiple users, and multiple values for the > category field. I would like User A to access the object if the > category ='financial', and User B access the object if the > category='other'. > > Thanks for any ideas. I assume user A and B have different roles? Instead of dynamically controlling the permission, could you set the permission on the object explicitly when the object is edited? e.g. def manage_edit(self, ...): ... if REQUEST.get('category') == 'other': self.set_permission_so_user_B_can_access() elif REQUEST.get('category') == 'financial': self.set_permission_so_user_A_can_access() ___ 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] fine grained, dynamic permissions based on attribute values
Good day, I am wondering if/how I could control the permissions on an object based on the value of an attribute. I am using CMF, and thus portal_catalog, and have built a custom content type. My type has a category field. I would like to control the view permission of the object dynamically based on the value of category. So, as an example, I have multiple users, and multiple values for the category field. I would like User A to access the object if the category ='financial', and User B access the object if the category='other'. Thanks for any ideas. Chris ___ 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] A Flash file in Zope262
GAYOT Philippe SZSIC35 - BOM wrote: I want to show a Flash file in my home's page under ZopeCMF 262. Could anyone tell me the best way to do that ? It is precisely no different from the way you would do it with any other web server, except that the Flash movie comes from a File rather than a file. --jcc -- "Building Websites with Plone" http://plonebook.packtpub.com/ Enfold Systems, LLC http://www.enfoldsystems.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] A Flash file in Zope262
Title: A Flash file in Zope262 Hi, I want to show a Flash file in my home's page under ZopeCMF 262. Could anyone tell me the best way to do that ? Best regards. ___ 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 call a pyhton module's function from with in Page Temmplates?
Αρχικό μήνυμα από Chris Withers <[EMAIL PROTECTED]>: > Thomas G. Apostolou wrote: > > > > > > > > > > > > > > > > > > > > > > > > What Tino said about using a database adapter is true, but even if > you > want to stick with your external method, you can always use the > following ZPT: > > > tal:attributes="python:test(path('repeat/data/odd'),'odd','even')" >tal:content="cell"> > > > > You only need to figure out where sysDSN, usr, mypass, sTable and > sFields come from. Your example being in DTML, I have no idea ;-) sysDSN, usr, mypass are properties with values of a folder object witch i use with aquisition to call the DTML Method trough it. sTable and sFields are input fields of the form that calls the DTML Method and submits its values Thomas G. Apostolou Software Engineer Θωμάς Γ. Αποστόλου Μηχανικός Λογισμικού ___ 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] Display images stored in Relational DB
Hello all, I try to display some images stored in SQL Server 2K. What i do is: I have an External Method "GetPrList" witch is connected to a python module that reads like this def GetPrListData(self, sysDSN="Test_A_Voisys", usr="sa", mypass="voisys"): id = self.id import dbi import odbc connection=odbc.odbc(sysDSN+'/'+usr+'/'+mypass) cur=connection.cursor() sSQL='SELECT M.CODE,M.NAME,X.SODATA FROM dbo.MTRL M JOIN dbo.XTRDOCDATA X ON M.MTRL=X.REFOBJID WHERE X.SOSOURCE=51 AND M.MTRGROUP=3' cur.execute(sSQL) data=cur.fetchall() cur.close() connection.close() return data X.SODATA is jpg stored in SQL 2K in a field degined as [SODATA] [image] NULL The above select returns -executed from within PythonWin- the folowing: [('ACC.ART.0001', 'xd3xc5xd4 xc2xc9xc4xc5xd3 & xd0xc1xcexc9xccxc1xc4xc9xc1 xccxc5 xc5xcbxc1xd4 andy', ), ('ACC.CO3.0001', 'BATTERY xccxcfxcbxd5xc2xc4xcfxd5 12V', ), ('ACC.CO3.0002', 'MExcbxc1xcdxc9 xcfxcaxc9 10i/12i/14e', )] Then from a DTML Method "ShowResults" i call the above External Method "GetPrList" and show its results in a table. ShowResults reads like this: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"> Κωδικός Ονομασία Εικόνα dsnName, usrID, passWD are properties with values of a folder i use with aquisition when i call DTML Method "ShowResults" The problem is that i get a "pythonw.exe" Debug-Send Error Report-Don't Send window and zope server breaks down. ( yes i use windows Xp Pro, Zope 2.7.0, Python 2.3.3) Thanks in advance Thomas G. Apostolou Software Engineer Θωμάς Γ. Αποστόλου Μηχανικός Λογισμικού ___ 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: access rule and authentication
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Withers wrote: > Tres Seaver wrote: > >> AcceseRules run during path traversal, before any authentication is done >> (Zope2 does "inside out" authentication starting at the "published" >> objectd). You might be able to force user validation to be attempted >> earlier, e.g. by calling 'validate' directly on the user folder. > > > Didn't someone add a post-authentication hook for this kind of thing? Yes, but it runs too late to help for all the use cases AccessRules address (like changing the publishing path). Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDVNAK+gerLs4ltQ4RAp28AKDZyoLYz2UemJtj8Jt7NMMxyv0nIwCggoEr pZf1i/CpHXoOI5geoWITcEI= =9qHV -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: access rule and authentication
> -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Krzysztof Kubacki wrote: > > Hi, > > > > Python Script which is set as "Access Rule" for some Folder is > > execute before authentication is done. > > This way the following code won't work> > > if context.portal_membership.getAuthenticatedUser().getId() == "admin": > > return "dog" > > return "cat" > > > > I will always get "cat". So does somebody know how to resolve it? > > AcceseRules run during path traversal, before any authentication is done > (Zope2 does "inside out" authentication starting at the "published" > objectd). You might be able to force user validation to be attempted > earlier, e.g. by calling 'validate' directly on the user folder. > How do do it? Any code example? REQUEST = context.REQUEST user_obj = UserFolder() user = user_obj.validate(REQUEST) Does not work Regards KK ___ 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] Deleting objects from an external method
Nikko Wolf wrote: That was my expectation too, but alas -- it does not work for me. Have you specifically tried this? Yes, many times... Set up: - Plone Site with "Delete objects" permission granted only to Manager (not inheriting privs) - (Plone) Folder "abc" with an object "xyz" under the Plone Site (inheriting privs) Well, you're using Plone, so you're on your own. It or CMF may do some other funky permissions checks on delete which are screwing you up... Browser shows: Insufficient Privileges You do not have sufficient privileges to view this page. If you believe you are receiving this message in error, please send an e-mail to" File "/usr/local/zinstance/Products/CMFPlone/PloneFolder.py", line 306, in manage_delObjects raise Unauthorized, ( Unauthorized: Do not have permissions to remove this object You should install VerboseSecurity if using Zope 2.7 or enable in in zope.conf if using Zope 2.8, it will tell you more... But, look at that traceback, it's coming from PloneFolder.py (suprise, suprise) so you'll have to go there and find out what funky nastiness is lurking ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ 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] COREBlog 1.2.1 on Zope 2.7.5 year_created problem
Allen Schmidt wrote: * Module DocumentTemplate.DT_String, line 474, in __call__ * Module DocumentTemplate.DT_Util, line 198, in eval __traceback_info__: month_created * Module , line 0, in ? NameError: name 'year_created' is not defined Nope, might be time to contact the product author... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ 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: access rule and authentication
Tres Seaver wrote: AcceseRules run during path traversal, before any authentication is done (Zope2 does "inside out" authentication starting at the "published" objectd). You might be able to force user validation to be attempted earlier, e.g. by calling 'validate' directly on the user folder. Didn't someone add a post-authentication hook for this kind of thing? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ 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 call a pyhton module's function from with in Page Temmplates?
Thomas G. Apostolou wrote: What Tino said about using a database adapter is true, but even if you want to stick with your external method, you can always use the following ZPT: You only need to figure out where sysDSN, usr, mypass, sTable and sFields come from. Your example being in DTML, I have no idea ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ 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 )