[Zope-dev] Python class and ZClass
Hi, I would like to subclass a Python class with a ZClass. I mean that my DTML document will declare ZClass and I would like to be able to access the method declared in the python class (parent of the ZClass). Does anybody knows how to do that ? PS : I read a paper call "SubClassing from Custom Python classes", but I did not understood everything, so if somebody can give me an example or the main steps to solve my problem... Thank you very very much Vincent ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] hmmm.. wierd permission issues with getPersistentItemIDs()...
Hi Steve, Thanks for the reply. Of course as soon as I reported this, I went away for a couple days and I haven't been able to check the list. It appears that the problem is that the BTreeItems object returned by getPersistentObjectIDs isn't currently allowed as an argument of 'in' by itself since it's not in the 'containerAssertions' dictionary defined in SimpleObjectPolicies.py and it doesn't have the magic property: '__allow_access_to_unprotected_subobjects__'. If you *sort* the BTreeItems object however, the dtml-in tag makes a copy of the items in the BTreeItems object as a simple List, and sorts that rather than destructively attempting to sort the original. The simple list is in containerAssertions, and is therefore allowed. I was wrong about the dtml-var "defaultRack.getPersistentItemIDs()" it's only dtml-in "defaultRack.getPersistentItemIDs()" that seems to cause the problem. The odd thing is that the method 'getPersistentObjectIDs' is correctly included in the definition of __ac_permissions__ in Rack.py, but as you point out, it returns a BTreeItems object that doesn't want to play nice with dtml-in... . Once possible solution would be to add an '__allow_access_to_unprotected_subobjects__' property to the BTreeItems object. I'm not sure who should do that. maybe Rack.py? For now.. I'll just sort the ids. ;-) thanks, -steve "Steve" == Steve Alexander [EMAIL PROTECTED] writes: Steve Steve Spicklemire wrote: Hi ZPatterns folks... ZPatterns-0.4.1snap1 Zope2.2.0-src I have a specialist with a defaultRack storing DataSkin subclassed ZClass instances with only persistent attribute providers. dtml-var "defaultRack.getPersistentItemIDs()" Steve When I call that, I get BTreeItems object at 869a5d8. To Steve get that list of IDs, I use an external method: Steve def get_persistent_ids(self): try: items = Steve self.defaultRack.aq_base.getPersistentItemIDs() return Steve map(lambda x: x, items) Steve except: import sys, traceback, string etype, val, tb = Steve sys.exc_info() Steve sys.stderr.write(string.join(traceback.format_exception(etype, Steve val, tb),'')) del etype, val, tb Steve I've tried something like your code, with no sheetproviders Steve in the rack. I can't reproduce your error. I'm using the Steve method as a Manager. or dtml-in "defaultRack.getPersistentItemIDs()" ... /dtml-in raise AuthorizationFailed dtml-in "defaultRack.getPersistentItemIDs()" sort ... /dtml-in works fine. What did I do now? ;-) Steve Line 318, Rack.py. The method getPersistentItemIDs has no Steve docstring. Is that still significant under the new security Steve model? Steve Does the user you're running the method as have the Steve permission "Access contents information" ? Steve Looks like you may have uncovered a Zope security bug in Steve dtml-in ... sort :-/ Steve How could we test this further? Steve -- Steve Alexander Software Engineer Cat-Box limited Steve http://www.cat-box.net Steve ___ Zope-Dev Steve maillist - [EMAIL PROTECTED] Steve http://lists.zope.org/mailman/listinfo/zope-dev ** No cross Steve posts or HTML encoding! ** (Related lists - Steve http://lists.zope.org/mailman/listinfo/zope-announce Steve http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Caching problems
Hi, I have a problem with a class I wrote where I have a list as an attribute of the class. When I append something to that list, it stays there at first, but only until I restart Zope. It disappears (==is set to the value I assigned to it in __init__) and reappears as well when I hit reload a few times very quickly. Whenever I flush the cache it disappears immediately. There seems to be no transaction registered by Zope, because it doesn't show up under 'Undo'. I observed this both thru a dtml page and a debugging function written in python. I attached the code below, the method and attributes I'm talking about are IEEShare.read_access_roles, IEEShare.write_access_roles and IEEShare.add_user_access() The problem exists with both Zope 2.2.0 and 2.2.1b1. I'm running 2.2.1b1 right now on a SuSE Linux 6.4 default installation. (standard libc, threads etc.) Both versions of Zope are compiled from source. __doc__ = """IEEFolder product module.""" __version__ = '0.1' import string from Globals import HTMLFile,MessageDialog,Persistent import OFS.Folder import OFS.PropertyManager import Acquisition import AccessControl from AccessControl import getSecurityManager manage_addIEEFolderForm = HTMLFile('ieefolderAdd', globals()) def manage_addIEEFolder(self, id, title=None, REQUEST=None): """Add an IEE Folder to a folder.""" ob=IEEFolder() ob.id=str(id) if title: ob.title=title self._setObject(id, ob) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1) def findProperty(ids, props, searchterm, path='', all=0): """Find a property """ result=[] checkPermission=getSecurityManager().checkPermission for obj in ids: if hasattr(obj, '_properties') and checkPermission('Access contents information', obj): for md in getattr(obj, '_properties'): propid=md['id'] if (all or (propid in props)) and \ (string.find(str(getattr(obj, propid)),searchterm) != -1): result.append({'object': obj, 'id': path + obj.id, 'url': obj.absolute_url()}) if getattr(obj, 'isPrincipiaFolderish', None): result.extend(findProperty(obj.objectValues(), props, searchterm, \ path=path+obj.id+'.', all=all)) return result class IEEFolder(OFS.Folder.Folder, Persistent, Acquisition.Implicit, AccessControl.Role.RoleManager, OFS.PropertyManager.PropertyManager ): meta_type = 'IEE Folder' __ac_permissions__=( ('Read Access', ('manage_findPropertyForm', 'manage_findProperty', 'index_html', 'manage_main', 'manage_workspace', 'objectIds', 'objectValues', 'objectItems', '')), ('Write Access', ('manage_delObjects',))) manage_workspace__roles__=('Read Access','Write Access') manage_options = ( {'label': 'Folder View', 'action': 'index_html', 'image': 'folder-view'}, {'label': 'Search', 'action': 'manage_findPropertyForm', 'image': 'search'}, {'label': 'Undo', 'action': 'manage_UndoForm', 'image': 'undo'}) index_html = HTMLFile('index', globals()) manage_main = HTMLFile('index', globals()) manage_findPropertyForm=HTMLFile('findProperty', globals()) findPropertyResult=HTMLFile('findPropertyResult', globals()) manage_UndoForm=HTMLFile('undo', globals()) def filtered_objectIds(self): map(lambda x: x.id, filter(lambda x: getSecurityManager().checkPermission('Read Access', x), self.objectValues())) def manage_findProperty(self, searchterm, props=[], allprops='all'): """Find a property.""" if type(props) is type(''): props=[props] if allprops == 'all': allprops = 1 else: allprops = 0 return self.findPropertyResult(self, result=findProperty(self.objectValues(), props, searchterm, all=allprops), URL=self.absolute_url()) __doc__ = """IEEShare product module.""" __version__ = '0.1' import nis,traceback from Globals import HTMLFile,MessageDialog,Persistent from Products.CARS.IEEFolder import IEEFolder from Products.CARS.NisLogin import NisLogin from Products.LoginManager.LoginManager import manage_addLoginManager from Globals import HTMLFile manage_addIEEShareForm = HTMLFile('ieeshareAdd', globals()) def manage_addIEEShare(self, id, title=None, REQUEST=None): """Add an IEE Share to a folder.""" ob=IEEShare() ob.id=str(id) ob.title=title self._setObject(id, ob) ob=self._getOb(id) ob.manage_role('Read Access', permissions=('Read Access',)) ob.manage_role('Write Access', permissions=('Write Access',)) #manage_addLoginManager(ob, usource='NIS User Source') if REQUEST is not None: return
[Zope-dev] Funny bug in Zope?
I'm not quite sure if this is already reported or not, so I won't give much information on it (I've looked for something similar, but I haven't found it). I'm runnig Zope 2.2.0 under Linux. I have this product I've made myself - called TravelAgent. I add an instance of it to the Zope root-folder, which I call TravelAgent. Everything works fine. If I rename this instance to something that has less than five characters in it, something very fish starts to happen. I should also mention that in the index_html method's body-tag I have an background-element which displays somepic.gif. Now, if the instance is called f ex Trav (ie. less that five characters) and I try to render the index_html, it displays the background image correctly, but it also pukes out the gif in ASCII on top - and nothing else. This happens very consistently, unless I reload fast four, five times - then it display the whole index_html just fine. I rename back to Trave (ie. five characters or more) and everything is fine. I can reproduce this all the time. Strange, huh? ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Caching problems
You directly change a nonpersistence participant object. As stated in http://www.python.org/workshops/2000-01/proceedings/papers/fulton/zodb3.html : quote All sub-objects of persistent objects must be persistent or immutable. This rule is necessary because, without it, the persistence system would not be notified of persistent object state changes. Like most rules, this rule can be broken with care, as is done in the issue tracking system. A persistent object can use mutable non-persistent sub-objects if it notifies the persistence system that the sub-object has changed. It can do this in two ways. It can notify the persistence system directly by assigning a true value to the attribute _p_changed /quote so what I think you need is to tell the object wich has the list property that it has changed, coz he can't know it by himself if you list.append or list.extend or even list[0] = something. To do this you can: 1- set self._p_changed = 1 on the object after the change (append or something) 2 - assign self.list to itself so that the object knows a change has been made to that property. but mainly... RTFM ;-) On Wed, 16 Aug 2000, Bob Pepin wrote: Hi, I have a problem with a class I wrote where I have a list as an attribute of the class. When I append something to that list, it stays there at first, but only until I restart Zope. It disappears (==is set to the value I assigned to it in __init__) and reappears as well when I hit reload a few times very quickly. Whenever I flush the cache it disappears immediately. There seems to be no transaction registered by Zope, because it doesn't show up under 'Undo'. I observed this both thru a dtml page and a debugging function written in python. I attached the code below, the method and attributes I'm talking about are IEEShare.read_access_roles, IEEShare.write_access_roles and IEEShare.add_user_access() The problem exists with both Zope 2.2.0 and 2.2.1b1. I'm running 2.2.1b1 right now on a SuSE Linux 6.4 default installation. (standard libc, threads etc.) Both versions of Zope are compiled from source. -- "Sometimes I think the surest sign that intelligent life exists elsewhere in the Universe is that none of it has tried to contact us." Carlos Neves [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope] Is this a bug? Posting data to another DTML document
I developed my project on Zope 2.1.6 on NT environment. Last week i installed Zope 2.2.0 on Solaris 8. i transferred my project to 'new' Zope. But when i try to access my DTML document comes authentication window. I can't authenticate it in any of my usernames. Traceback (innermost last): File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/Zope-2.2.0/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: email_accounts) File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: email_accounts) File /usr/local/Zope-2.2.0/lib/python/OFS/DTMLDocument.py, line 170, in __call__ (Object: email_accounts) File /usr/local/Zope-2.2.0/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: email_accounts) File /usr/local/Zope-2.2.0/lib/python/DocumentTemplate/DT_Let.py, line 147, in render (Object: resDTML="Imap('Authentication',REQUEST,1)") File /usr/local/Zope-2.2.0/lib/python/DocumentTemplate/DT_Util.py, line 337, in eval (Object: resDTML.cn) (Info: resDTML) File string, line 0, in ? File /usr/local/Zope-2.2.0/lib/python/DocumentTemplate/DT_Util.py, line 142, in careful_getattr File /usr/local/Zope-2.2.0/lib/python/OFS/DTMLMethod.py, line 189, in validate (Object: email_accounts) File /usr/local/Zope-2.2.0/lib/python/AccessControl/SecurityManager.py, line 139, in validate File /usr/local/Zope-2.2.0/lib/python/AccessControl/ZopeSecurityPolicy.py, line 159, in validate Unauthorized: cn case is that i have login window which passes user information to another DTML document. User information is different than my zope user. ex. i log into my Zope management as jarkkov (so that stays at my browsers cache, until i restart browser) i type in my login document '66' and 'password', these values are submitted to another document called email_accounts, which uses external method with submitted parametres and return values into email_accounts document. Above error message is shown. in zope 2.1.6 environment it did'nt happen. I tied to create all kind of users on users folder and tried to give all permissions to anonymous user and tried to access anonymously thrue another browser, but nothing seems to work. This is essential that i can anonymously access to this DTML documents and submit any kind of values on my REQUEST. All the documents are on subfolder called testweb and i noticed that Zope 2.2.0, i have ownership in all documents and folders. testweb is owned directly by jarkkov (testweb/acl_users) and all documents in that folder. I also tried post data to email_accounts thrue browser like this: http://194.42.57.17:8080/proto_test/email_acounts?cn=66password=1234 on Zope 2.1.6 it worked, but with Zope 2.2.0, ZServer asked authentication. I can't remove ownership or can i? Is it the blocking my access anonymously to documents? What i have to do to make my project work on new Zope version? jarkkov ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Best way to subclass DTML Document and some other ZClassesquestions
"R. David Murray" wrote: On Mon, 14 Aug 2000, Marcin Kasperski wrote: 1) How can I set standard DTML Document properties (title!) from my constructor? I created constructor form and constructor method, I succesfully prompt for and set all my properties but I do not know how to set properties belonging to DTML Document. Pass it as an argument to the call that creates the DTML Document. How? Currently my constructor method contains the following (mk_dtml_document is my custom class which subclasses DTML Document, Extra is the name of my custom propertysheet): dtml-with "mk_dtml_document.createInObjectManager(REQUEST['id'],REQUEST)" dtml-call "propertysheets.Extra.manage_editProperties(REQUEST)" dtml-comment How can I change original title? /dtml-comment dtml-call reindex_object /dtml-with title is present in REQUEST and is not set in created document. 2) Can I do anything to have single property screen which would behave as original DTML Document property screen but present both original properties and properties belonging to my custom property sheet? Yep. You should be able to replicate everything the original constructor code does in your own code. Read The Source, Luke grin. I hate replicating code. I love calling it. Couldn't it be done this way? 4) Can I do something to have ZCatalog PrincipiaSearch (i.e. full text search) to scan some property of my custom ZClass (say property body from propertysheet Basic)? You can add that property name as an index, and construct your search form so the search string is submitted to it (see the Advanced ZCatalog Searching HowTo). Or, you could define your own PrincipiaSearchSource method and return whatever value is appropriate. I *think* you should be able to define this as a method of your ZClass, but I've never tried that. I know it works from python grin. I tried defining DTML Method with name PrincipiaSearchSource and contents dtml-var body (body is my custom property name). Next I clicked 'Update Catalog' in ZCatalog screen. Seems my attempt has been ignored - the amount of objects indexed via PrincipiaSearchSource (according to ZCatalog status screen) has not changed (those object are succesfully indexed on title etc). 5) Can I write index_html method of my custom class so it interpret DTML tags (like dtml-var substitution)? I'm sure you can, but I don't know how grin. But if you are doing that, why not just subclass DTML-Method (or document)? Because I have not done it previously and now I have about 100 objects of this type and do not know how to perform such a change. 6) What you, Zope gurus, would do if you were to find all the DTML Documents in some directory tree and remove them, creating instead Documents (where Document is some subclass of DTML Document) - and keeping the document id, title, contents and properties without change? Write an external method to do all the object creation, property copying, and old object deletion. What about some sample code? Regards -- Serwis nie tylko mieszkaniowy: http://www.mk.w.pl | | The cost of a few uncorrected non-critical human errors is less then | the cost imposed by a process that tries to prevent them. | (Booch,Martin,Newkirk) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML: fetch an object by its url?
dtml-var "REQUEST.resolve_url('/some/folder/and/path/wotsit')" - Original Message - From: "Scott Shepherd" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 16, 2000 5:06 AM Subject: [Zope] DTML: fetch an object by its url? In DTML is it possible to get an object using its url? Something like dtml-with "get_object( '/some/local/url' )".../dtml-with Similar to dtml-with "_.getitem( name )".../dtml-with but what I have is the object's zserver url, not its name in the current namespace. TIA, Scott ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] UserDb, GUF, LoginManager, etc, which one?
[various folks basically suggest using UserDb and give useful tips] Okay, thanks for the suggestions, folks -- UserDb it will be, then! Regards, Martijn ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Structured Text Rendering and \r
Dieter Maurer wrote: Chris Withers writes: I have a list of string.strip'ped strings which I'd like to render using Erk, they weren't actully being stripped, I meant what was supposed to the happening was \r\n and \n\r were both supposed to be replaced by \n, but the regular expression to do that was broken and so wasn't working... 2) why just the one paragraph beign picked up, instead of 4? You said, the list consists of "strip"ped strings? Structured text uses indentation and newlines to determine paragraphs and their nesting. Found the problem. Due to the dodgy regular expression, some of the lines I was joining had \r's in them. Apparently, \r's interact badly with the Structured Text paragraph detecter, which matches \n(some spaces)\n I'll go comment on that in the StructuredTextNG wiki... 3) why are the '-'s being turned into list items? This is what structured text should do: a paragraph (!) starting with '-' or '*' is turned into a list item. Because, however, no paragraphs are recognized, I would not expect to see list items. Gak.. I meant "why are the '-'s _not_ being turned into list items?" :S The reason was 'cos none of the paragraph seperations were being picked up... sorry for the confusion... Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] __call__ error message - I gave up
What I like to do is pretty simple, but I don't get it. The following code snippet is simple and what I want to is straightforward: dtml-in "objectItems('DTML Document')" dtml-var sequence-item /dtml-in All DTML Documents in a Folder should be put together in one document. It works fine, if there is no reference to another object. But when I put something like dmtl-var imageobject in one of this DTML Document I get the appended error message. Any Idea Jens Error Type: AttributeError Error Value: __call__ Traceback (innermost last): File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 222, in publish_module File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 187, in publish File E:\Programme\WebSite\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 171, in publish File E:\Programme\WebSite\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: index_html) File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: index_html) File E:\Programme\WebSite\lib\python\OFS\DTMLMethod.py, line 172, in __call__ (Object: index_html) File E:\Programme\WebSite\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: index_html) File E:\Programme\WebSite\lib\python\DocumentTemplate\DT_In.py, line 691, in renderwob (Object: objectItems('DTML Document')) File E:\Programme\WebSite\lib\python\OFS\DTMLDocument.py, line 167, in __call__ (Object: subdocument) File E:\Programme\WebSite\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: subdocument) AttributeError: (see above) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Python class and ZClass
Hi, I would like to subclass a Python class with a ZClass. I mean that my DTML document will declare ZClass and I would like to be able to access the method declared in the python class (parent of the ZClass). Does anybody knows how to do that ? PS : I read a paper call "SubClassing from Custom Python classes", but I did not understood everything, so if somebody can give me an example or the main steps to solve my problem... Thank you very very much Vincent ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML: fetch an object by its url?
What's the difference between: dtml-with "_.string.split(URL,'/')[-2]" (for current folder) or dtml-with "_.string.split(URL,'/')[-1]" (for current object) and dtml-var "REQUEST.resolve_url('/some/folder/and/path/wotsit')" ?? - Original Message - From: "Scott Shepherd" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 16, 2000 5:06 AM Subject: [Zope] DTML: fetch an object by its url? In DTML is it possible to get an object using its url? Something like dtml-with "get_object( '/some/local/url' )".../dtml-with Similar to dtml-with "_.getitem( name )".../dtml-with but what I have is the object's zserver url, not its name in the current namespace. TIA, Scott ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Simple acquisition (?) question
Hi all I have 'index_html (Welcome to the Mosaic Intranet)' and 'standard_html_header' in '/' (the site root). 'standard_html_header' does the usual:: !--#var title_or_id-- Maybe I shouldn't be, but I was somewhat surprised that this renders the title of '/' instead of the title of 'index_html'. ("title" == "the title property of"). What further confuses me is that '/docs' has no title, and it contains 'index_html (Document Warehouse)'. Now 'standard_html_header' renders '/docs/index_html's title. If '/' has no title and '/index_html' does, 'standard_html_header' renders no title. This seems inconsistent. Because there's acquisition stuff that escapes me, doubtless. Anyone have 50c worth of enlightenment? -- Jean Jordaan --technical writer-- Mosaic Sofware --Zope 2.1.6 on W2K ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] __call__ error message - I gave up
Maybe you've got the syntax wrong. Have you tried these, and what they return. dtml-in "objectItems(['DTML Document'])" dtml-var sequence-item /dtml-in dtml-in "objectValues(['DTML Document'])" dtml-var sequence-item /dtml-in dtml-in "mycurrentfolder.objectItems(['DTML Document'])" dtml-var sequence-item /dtml-in dtml-in "mycurrentfolder.objectValues(['DTML Document'])" dtml-var sequence-item /dtml-in dtml-in "PARENTS[0].objectItems(['DTML Document'])" dtml-var sequence-item /dtml-in dtml-in "PARENTS[0].objectValues(['DTML Document'])" dtml-var sequence-item /dtml-in I honestly don't know the difference. If my DTML doesn't work I tend to trial-and-error my way to it, and not bother why things happen and don't happen. Don't give up!! Cheers, Peter What I like to do is pretty simple, but I don't get it. The following code snippet is simple and what I want to is straightforward: dtml-in "objectItems('DTML Document')" dtml-var sequence-item /dtml-in All DTML Documents in a Folder should be put together in one document. It works fine, if there is no reference to another object. But when I put something like dmtl-var imageobject in one of this DTML Document I get the appended error message. Any Idea Jens Error Type: AttributeError Error Value: __call__ Traceback (innermost last): File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 222, in publish_module File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 187, in publish File E:\Programme\WebSite\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 171, in publish File E:\Programme\WebSite\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: index_html) File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: index_html) File E:\Programme\WebSite\lib\python\OFS\DTMLMethod.py, line 172, in __call__ (Object: index_html) File E:\Programme\WebSite\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: index_html) File E:\Programme\WebSite\lib\python\DocumentTemplate\DT_In.py, line 691, in renderwob (Object: objectItems('DTML Document')) File E:\Programme\WebSite\lib\python\OFS\DTMLDocument.py, line 167, in __call__ (Object: subdocument) File E:\Programme\WebSite\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: subdocument) AttributeError: (see above) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] getting rid of PTKDemo
Anyone know how I can get rid of this? I don't have it in my lib/python/Products folder. I don't have it in my Control_Panel/Products folder. I have compacted the database and restarted my server. I still get errors when trying to do selecte the 'Advanced tab' in *any* ZSQL method. Anyone who tells me how to get rid of this thing gets a pint (you'll have to come to Newcastle to collect) cheers Tone -- Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5116 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] HOWTO (but to be improved) - linking to neighbours
[ Below I describe my solution to the problem which seems to me to be fairly frequent. Maybe someone is interested, maybe someone can show me better (faster, shorter) solution ] * Problem The problem: while presenting some page, I would like to automagically add links to 'previous' and 'next' page in the same directory. Say you organize a bunch of HOWTOS and you would like to let the people navigate via 'next' links - without going back go table of contents. * Idea What I really need is to calculate identifiers of 'neighbours' of my page in its container. I do have id of the current page, I can easily got list of all identifiers in the container. So I can just scan this list, find my id and read previous and next element. Transforming it into hyperlink is natural. * Code First I create the following Python Method (could be External Method as well). The method returns tuple (previous_id, next_id) substituting '' if there is no such element (we are at the start or at the end). -- Name: neighbours Parameters: self,myId,allIds Contents: position = 0 for x in range(0, len(allIds)): if allIds[x] == myId: position = x break else: raise 'Internal inconsistency: id ' + str(myId) + ' does not belong to list ' + str(allIds) left = '' right = '' if position 0: left = allIds[position - 1] if position len(allIds) - 1: right = allIds[position + 1] return (left, right) -- Then I add standard_html_footer DTML Method to the directory with my iterated items. I put there sth like that (of course presentation can vary, 'MyHowto' is the metatype of objects I iterate over, as you can see I call original footer after writting my navigational details): - p dtml-let allIds="PARENTS[0].objectIds(['MyHowto'])" myId=id neigh="neighbours(myId,allIds)" table border="0" width="90%" align="center"tr td width="33%" align="left" dtml-if "neigh[0] != ''" a href="dtml-var "neigh[0]""Previous/a dtml-else nbsp; /dtml-if /td td width="33%" align="center" a href="dtml-var howto_index url"Table of Contents/a /td td width="33%" align="right" dtml-if "neigh[1] != ''" a href="dtml-var "neigh[1]""Next/a dtml-else nbsp; /dtml-if /td /tr/table /dtml-let dtml-with "PARENTS[1]" dtml-var standard_html_footer /dtml-with -- (by the way I do not know why I need 'myId=id' in let - but removing it and putting id on the neighbours parameters list does not work) * Unsolved problems There are two important unsolved problems: - efficiency - I perform linear scan which can be expensive if my directory contains a lot of objects (I do not know good method to solve it - I would need some help from Folder class) - order - if I need to present my objects in some order other than default, I would need to sort allIds in some way (probably I would need youse objectValues instead of objectIds) * Minor tricks The python method I wrote is generic, I use the same method for two different folders. In fact I worked around the order problem for the very simple case - presenting everything in reverse order. I just exchanged neigh[0] and neigh[1] in standard_html_footer. -- Serwis nie tylko mieszkaniowy: http://www.mk.w.pl | | You have the right to say how long each requirement will take you to | implement, and to revise estimates given experience. (Ken Beck's | Second Developer Right) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Simple acquisition (?) question
on Wednesday, August 16, 2000 Jean Jordaan wrote : JJ !--#var title_or_id-- ... JJ What further confuses me is that '/docs' has no title, and it JJ contains 'index_html (Document Warehouse)'. Now JJ 'standard_html_header' renders '/docs/index_html's title. JJ If '/' has no title and '/index_html' does, JJ 'standard_html_header' renders no title. This seems inconsistent. JJ Because there's acquisition stuff that escapes me, doubtless. JJ Anyone have 50c worth of enlightenment? Check whether those index_htmls are DTML methods or DTML documents.. DTML Documents have properties of their own, and return their title, when title_or_id is callet upon them.. DTML methods are just that, methods of their container, in this case their folder, and so returns the folder's title when title_or_id is called on them .. see also : http://www.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo -- Geir Bækholt web-developer/designer [EMAIL PROTECTED] http://www.funcom.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] __call__ error message - I gave up
On Wed, 16 Aug 2000, cuiod-tec Jens Gelhaar wrote: dtml-in "objectItems('DTML Document')" dtml-var sequence-item /dtml-in [...] works fine, if there is no reference to another object. But when I put something like dmtl-var imageobject in one of this DTML Document I get the appended error message. Change it to dtml-var "imageobject.tag()". Probably it's a bug in Image class. [EMAIL PROTECTED] /--\ | `long long long' is too long for GCC | \--/ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ProxyPass - where ???
How about a trailing / after okstudio? VirtualHost 123.45.678.9 ServerName www.mydomaine.com.au ProxyPass / http://demon.server.com.au:8080/okstudio ProxyPassReverse / http://demon.server.com.au:8080/okstudio /VirtualHost Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Extra spaces on the end of id's?
Hi Zopers What's with the spaces ('%20') in the following from:: site/Control_Panel/Products/ccDoc/ccDocClass/propertysheets/methods/manage _main FORM ACTION="http://corpcomms/Control_Panel/Products/ccDoc/ccDocClass/propertyshe ets/methods" METHOD="POST" TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" [...] TD ALIGN="LEFT" VALIGN="TOP" A HREF="edit_properties%20/manage_workspace" IMG SRC="/misc_/OFSP/dtmlmethod.gif" ALT="[DTML Method]" BORDER="0"/A /TD TD ALIGN="LEFT" VALIGN="TOP" A HREF="edit_properties%20/manage_workspace" edit_properties/A /TD [...] A HREF="edit_propertiesForm%20/manage_workspace" IMG SRC="/misc_/OFSP/dtmlmethod.gif" ALT="[DTML Method]" BORDER="0"/A /TD TD ALIGN="LEFT" VALIGN="TOP" A HREF="edit_propertiesForm%20/manage_workspace" edit_propertiesForm/A /TD [...] /TABLE -- Jean Jordaan --technical writer-- Mosaic Sofware --Zope 2.1.6 on W2K ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Import classes in External method
Hi, How to import classes in an External method? I mean, where to place the module where my class is defined. I tried to put it in "lib/python/" or "Zope-2-2-0/lib/python/Shared", or in "/usr/lib/python1.5/" but I always got the same message : The errror === Error Type: SystemError/STRONGBR Error Value: Failed to import class myclass from module __main__ mycode == import module_of_class def useClass(self): foo = module_of_class.myclass() Bye, FR. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML: fetch an object by its url?
On Wed, 16 Aug 2000, Chris Withers wrote: Shame no-one implemented this into the entity syntax :( dtml-/some/folder/and/path/wotsit; would be so nice ;-) Ooo, that's seriously *ugly* looking syntax grin. --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] HTTP_ACCEPT
Greetings Zope Fans, There is a value included in "REQUEST" called HTTP_ACCEPT. Is there a way within Zope to reset this value? The default seems to be "*/*", but our sysadmin says Zope would get along better if we can change it to include the alias that Zope has been assigned by our Proxy Server. Thanks! Jery S. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] zShop
I installed zShop according to the installation instructions. When I come to the point where they write: "Click on your newly created Catalog and start adding products and categories." I receive the following error message: Error Type: NameError Error Value: 'CATEGORYSTORAGE' no such relation in DB Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] How can I find memory leaks in External Methods?
I have an External method that is used to upload files to a unix file system. Thing is, it seems to be causing more and more memory to be used by Zope. Can anyone give me some pointers on what might be causing this? TIA Tone -- Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5116 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Bug zClass subobjects?
(Second post) (I speak french, sorry for my english!) I created a ZClass, zRow. This class can contain other ZClass: zField_Text, zField_Date, etc. This let me define the columns contained in a zRow. I then defined a Class zTable, wich contains zRows. Question: - In my manage tabs, I needed to have a tab "Define columns". To achieve this, I inserted a ZRow Instance (with id "Definition") in my zTable product definition, and a method called "Define_Columns", containing: Perhaps it is a better idea to assign the Define_Columns in the Views of you zTable zclass definition (it is a separate tab in the management interface there). You can assign any tab name there to any method in you zclass. But I'm not sure I understand this correctly dtml-with Definition dtml-var manage_main /dtml-with And I defined a view "Define Columns" pointing to that method. When i click on the "Define Columns", I can see the manage screen of the instance "Definition", that's what I wanted. But when I try to add a zField to "Definition" instance, the zField instance is created at the zTable level, not IN "Definition" instance! All the classes are derived from on CatalogAware, ObjectManager. Are they by any chance nested ZClasses? If so, this is a known problem. If not, it is not entirely clear what you're doing. In general, if you create a ZClass instance to make it appear in the target you intend, it is important to do so through calling it through a manage_addProduct['yourclass'].yourclass_factory and _not_ directly through the yourclass_add method. But once again, it is not entirely clear to me what you try to do I HAVE to deliver the product for the end of the week, so PLEASE help me! hth Rik ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to use RESPONSE.redirect ?
"R. David Murray" wrote: On Tue, 15 Aug 2000, Kapil Thangavelu wrote: #example call to above #dtml-call "RESPONSE.redirect(URL1+'?'+url_encode_form_vars(_))" If your original form submits using the GET method, then QUERY_STRING will contain the already URL encoded parameters that the browser sent originally. True. However, the GET method is of limited utility which is not appropiate for many situations mainly because of size constraints. Examples, file upload, most anything with text area, stuff with a user passwd. Granted the above example is something that is going to stick the whole thing in the URL anyways. But the two python methods can be used for both GETs and POSTs and if you use the second method url_encode_vars you can pass it a dict of only those values you want to receive in the next page example. dtml-call "RESPONSE.redirect(url_encode_vars({'var1':var1, 'metoo':metoo}))" DTML also has a url_encode format you can use to cause a string to be url encoded if it isn't already. Check the dtml reference. been there, done that. DTML fmts are useful only for inserting text into a page or link with a dtml-var or the entity syntax. there are no functions that will encode a var in a pythonish expression("") which is what you need when doing this with a redirect. Cheers Kapil ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How can I find memory leaks in External Methods?
One place to start is /Control_Panel/DebugInfo/manage_main but Im not sure if this will work for External Methods. But it does show the objects in memory and the change over time. -- Andy McKay, Developer, ActiveState http://www.ActiveState.com Programming for the People - Original Message - From: "Tony McDonald" [EMAIL PROTECTED] To: "Zope List" [EMAIL PROTECTED] Sent: Wednesday, August 16, 2000 8:51 AM Subject: [Zope] How can I find memory leaks in External Methods? I have an External method that is used to upload files to a unix file system. Thing is, it seems to be causing more and more memory to be used by Zope. Can anyone give me some pointers on what might be causing this? TIA Tone -- Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5116 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Bug zClass subobjects?
(Second post) (I speak french, sorry for my english!) I created a ZClass, zRow. This class can contain other ZClass: zField_Text, zField_Date, etc. This let me define the columns contained in a zRow. I then defined a Class zTable, wich contains zRows. Question: - In my manage tabs, I needed to have a tab "Define columns". To achieve this, I inserted a ZRow Instance (with id "Definition") in my zTable product definition, and a method called "Define_Columns", containing: dtml-with Definition dtml-var manage_main /dtml-with And I defined a view "Define Columns" pointing to that method. When i click on the "Define Columns", I can see the manage screen of the instance "Definition", that's what I wanted. But when I try to add a zField to "Definition" instance, the zField instance is created at the zTable level, not IN "Definition" instance! All the classes are derived from on CatalogAware, ObjectManager. I HAVE to deliver the product for the end of the week, so PLEASE help me! Jean-François Ménard Intranet DPAS Pratiques d'affaires et orientations *(514) 840-3000 poste 3939 * (514) 840-5585 * [EMAIL PROTECTED] * 855 Ste-Catherine est, 6e étage Montréal, Qué. H2L 4P5 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Python function within a ZClass...
Is it possible to access Python function within a ZClass ? If yes, how should I do that ? Thanks ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python function within a ZClass...
On Wed, Aug 16, 2000 at 06:11:32PM +0100, Vincent wrote: Is it possible to access Python function within a ZClass ? If yes, how should I do that ? Just create an External Method. -- Martijn Pieters | Software Engineermailto:[EMAIL PROTECTED] | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | ZopeStudio: http://www.zope.org/Products/ZopeStudio - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Creating properties with a product.
___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Creating properties with a product.
Hello, I recently created a product which adds a folder, with multiple dtmldocuments inside of it, effectivly creating a site immedatly. However, even though I can add folders and documents easiliy, I can't seem to create properties! It keeps giving me the Attribute error: aq_base. Here is the code for the function that does the work: def manage_addMemberSite(self, id, title='',REQUEST=None): """Add a MemberSite folder.""" try: user=REQUEST['AUTHENTICATED_USER'] except: user=None folder = MemberSite(id, title) # _setObject must be the Zope hook that actually stores this instance in # the ZODB self._setObject(id, folder) folder.manage_addFolder(id='Images', title='') folder.manage_addDTMLDocument(id='index_html', title='', file=index_body) folder.manage_addDTMLDocument(id='navbar', title='', file=navbar_html) folder.manage_addDTMLDocument(id='content', title='enter page content here', file=default_dd_html) folder.manage_addProperty(id='nav_color', value='#483D8B', type='string') folder.manage_addProperty(id='content_color', value='#F0E68C', type='string') folder.manage_addProperty(id='background_color', value='#FF', type='string') if REQUEST: return self.manage_main(self, REQUEST, update_menu=1) The folder.manage_addProperty(id etc etc) does not work. I have been looking all over, have looked to where the error seems to stem from, (the valid_property_id function in the PropertyManager.py) but I can't seem to find out whats wrong. Does anyone have any ideas? Please respond ASAP. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Creating properties with a product.
Take a look at the doc string in the class definition of PropertyManager. It states that: An object may specify that it has one or more predefined properties, by specifying an _properties structure in its class:: _properties=({'id':'title', 'type': 'string', 'mode': 'w'}, {'id':'color', 'type': 'string', 'mode': 'w'}, ) The _properties structure is a sequence of dictionaries, where each dictionary represents a predefined property. Note that if a predefined property is defined in the _properties structure, you must provide an attribute with that name in your class or instance that contains the default value of the predefined property. Also take a look at some of the other products out there that have properties and you will see how they handle them. Don't forget to update any properties you have added in your manage_edit member function for example: self._updateProperty('cool',cool) Hope this helps, DR jesse wrote: Hello, I recently created a product which adds a folder, with multiple dtmldocuments inside of it, effectivly creating a site immedatly. However, even though I can add folders and documents easiliy, I can't seem to create properties! It keeps giving me the Attribute error: aq_base. Here is the code for the function that does the work: def manage_addMemberSite(self, id, title='',REQUEST=None): """Add a MemberSite folder.""" try: user=REQUEST['AUTHENTICATED_USER'] except: user=None folder = MemberSite(id, title) # _setObject must be the Zope hook that actually stores this instance in # the ZODB self._setObject(id, folder) folder.manage_addFolder(id='Images', title='') folder.manage_addDTMLDocument(id='index_html', title='', file=index_body) folder.manage_addDTMLDocument(id='navbar', title='', file=navbar_html) folder.manage_addDTMLDocument(id='content', title='enter page content here', file=default_dd_html) folder.manage_addProperty(id='nav_color', value='#483D8B', type='string') folder.manage_addProperty(id='content_color', value='#F0E68C', type='string') folder.manage_addProperty(id='background_color', value='#FF', type='string') if REQUEST: return self.manage_main(self, REQUEST, update_menu=1) The folder.manage_addProperty(id etc etc) does not work. I have been looking all over, have looked to where the error seems to stem from, (the valid_property_id function in the PropertyManager.py) but I can't seem to find out whats wrong. Does anyone have any ideas? Please respond ASAP. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] The mysteries of Product icons ?????
I made an icon form my new product, Zope loaded it correctly. Then someone had the brilliant idea to change it. I can not figure out how to get Zope to load the new icon. I have deleted the product from Product Management at /Control_Panel / Products, rm the *.pyc files, bounced Zope, but it still hangs on to the old icon. Can anyone out there demystify this for me??? DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] I think, it is a bug in acquisition
Maybe I have found a situation, where images are not working or rather acquisition. For example, you create 2 documents and one image doc1 (DTML Document) contents: "document 1 dtml-var doc2 doc2 (DTML Document) contents: "document 2 dtml-var image image (Image) contents: image When you put everything in one folder and try to render doc1, everything works fine. You get your image at the end. But if you put doc1 in a folder below like doc2 image subfolder doc1 you get the appended error. When you remove the image call from doc2 everything works again. I checked this with JPicture - the same. Beside, today I posted another mail with "[Zope] __call__ error message - I gave up". In this situation I thought my coding was wrong because I wanted to list all documents with dtml-in "objectItems('DTML Document')" dtml-var sequence-item /dtml-in Any Help? Jens Error Type: AttributeError Error Value: __call__ 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 the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 222, in publish_module File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 187, in publish File E:\Programme\WebSite\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 171, in publish File E:\Programme\WebSite\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: doc1) File E:\Programme\WebSite\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: doc1) File E:\Programme\WebSite\lib\python\OFS\DTMLDocument.py, line 171, in __call__ (Object: doc1) File E:\Programme\WebSite\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: doc1) File E:\Programme\WebSite\lib\python\OFS\DTMLDocument.py, line 167, in __call__ (Object: doc2) File E:\Programme\WebSite\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: doc2) AttributeError: (see above) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] class name of current object
Is there a way to get the current object's class name? dtml-var "this.__class__.__name__" doesn't work. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] The mysteries of Product icons ?????
On Wed, 16 Aug 2000, Daniel Rusch wrote: Then someone had the brilliant idea to change it. I can not figure out how to get Zope to load the new icon. I have deleted the product from Product Management at /Control_Panel / Products, rm the *.pyc files, bounced Zope, but it still hangs on to the old icon. Can anyone out there demystify this for me??? Browser caching? --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] modifying/changing DTML properties
- I have a folder in my zope tree called spam. - spam has one document called "foo" - spam has a property called "eggs" which is set to "green" foo looks like this: hello p!--#var eggs -- ( dtml-eggs; ) I want to be able to change the value of eggs to, say, "blue" like so: !--#if someCondition -- !--#call "MythicalChangePropertyFunction(eggs, 'blue')" -- !--#endif -- peggs is now b!--#var eggs --/b how do I do this? I am running Zope 2.1.6 under debian linux. Paul = shad 96c / 4A CS / mac activist / eda / fumbler fan of / jewel / sophie b. / sarah slean / steve poltz / emm gryner / / x-files / buffy / dawson's creek / habs / bills / 49ers / t h i n k d i f f e r e n t. __ Do You Yahoo!? Send instant messages get email alerts with Yahoo! Messenger. http://im.yahoo.com/ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] The mysteries of Product icons ?????
On Wed, Aug 16, 2000 at 02:08:47PM -0500, Daniel Rusch wrote: I made an icon form my new product, Zope loaded it correctly. Then someone had the brilliant idea to change it. I can not figure out how to get Zope to load the new icon. I have deleted the product from Product Management at /Control_Panel / Products, rm the *.pyc files, bounced Zope, but it still hangs on to the old icon. Can anyone out there demystify this for me??? Zope reads images for Python Product icons from disk at startup, it doesn't store them persistently though. However, many browsers cache them agressively. Did you do a force-reload? -- Martijn Pieters | Software Engineermailto:[EMAIL PROTECTED] | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | ZopeStudio: http://www.zope.org/Products/ZopeStudio - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] I think, it is a bug in acquisition
Maybe I have found a situation, where images are not working or rather acquisition. For example, you create 2 documents and one image doc1 (DTML Document) contents: "document 1 dtml-var doc2 doc2 (DTML Document) contents: "document 2 dtml-var image image (Image) contents: image When you put everything in one folder and try to render doc1, everything works fine. You get your image at the end. But if you put doc1 in a folder below like doc2 image subfolder doc1 you get the appended error. When you remove the image call from doc2 everything works again. You're probably right about this, or my Zen has left me. I did some testing and it will work allright if you move doc2 to the subfolder. i wonder if it is an acquisition bug, though, as it seems to work with other objects in the same setup. Could this be an Image bug? I checked this with JPicture - the same. Beside, today I posted another mail with "[Zope] __call__ error message - I gave up". In this situation I thought my coding was wrong because I wanted to list all documents with dtml-in "objectItems('DTML Document')" dtml-var sequence-item /dtml-in try (untested) dtml-in "objectItems(['DTML Document'])" dtml-var sequence-item /dtml-in the object items returns you a tuple with (id, object). Are you sure you want that - it won't show on the html page perhaps dtml-in "objectIds(['DTML Document'])" dtml-var sequence-item /dtml-in or dtml-in "objectValues(['DTML Document'])" dtml-var sequence-item /dtml-in will bring you more luck Any Help? hth Rik ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] modifying/changing DTML properties
--- Rik Hoekstra [EMAIL PROTECTED] wrote: Paul Schreiber wrote: - I have a folder in my zope tree called spam. - spam has one document called "foo" - spam has a property called "eggs" which is set to "green" foo looks like this: hello p!--#var eggs -- ( dtml-eggs; ) I want to be able to change the value of eggs to, say, "blue" like so: !--#if someCondition -- !--#call "MythicalChangePropertyFunction(eggs, 'blue')" -- Untested dtml-call "manage_changeProperties('eggs', 'blue')" I tried that, and received the following error: Zope Error Zope has encountered an error while publishing this resource. Error Type: TypeError Error Value: too many arguments; expected 2, got 3 any suggestions? Paul = shad 96c / 4A CS / mac activist / eda / fumbler fan of / jewel / sophie b. / sarah slean / steve poltz / emm gryner / / x-files / buffy / dawson's creek / habs / bills / 49ers / t h i n k d i f f e r e n t. __ Do You Yahoo!? Send instant messages get email alerts with Yahoo! Messenger. http://im.yahoo.com/ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] EventLogManager1.0
Chris McDonough writes: Folks, Available at http://www.zope.org/Members/mcdonc/Products/EventLogManager is my attempt to write a somewhat smarter logging facility for Zope. It supports complex rules processing and configurable targets (syslog and file). It's been tested under Linux only but should work on Win32 and other UNIX derivatives. Give it a roll. Looks very useful. It would be even better if rules could associated with each target. This would make it easy to separate, say, debugging logs from site statistics. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Referencing an object in a subfolder
I want to create an "images" directory for a web site and store image objects there that I can reference. How do I get a DTML document in a higher directory to see the images folder and locate the appropriate image? ...Paul ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Can't change user roles without password
Somewhere along the way, the acl_users/Contents form has decided to quit filling in the value of each user's password, so that their roles can only be assigned if a Manager knows their password...I've got new installation running Zope 2.2.0 and a new CVS PTK release on another box that does it correctly, but I can't determine what's the differentiating factor by comparing them. Any ideas on what I did to cause this, or more importantly, what I can do to fix it? I'm using... Zope 2.1.6 (binary release, python 1.5.2, win32-x86) PTK 0.7.1 WinNT 4.0 SP5 Thanks, Dave. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] modifying/changing DTML properties
On Wed, 16 Aug 2000, Paul Schreiber wrote: dtml-call "manage_changeProperties('eggs', 'blue')" dtml-call "manage_changeProperties({'eggs': 'blue'})" --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] EventLogManager1.0
They can. :-) -Original Message- From: Dan L. Pierson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 16, 2000 3:38 PM To: Chris McDonough Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject: [Zope] EventLogManager1.0 Chris McDonough writes: Folks, Available at http://www.zope.org/Members/mcdonc/Products/EventLogManager is my attempt to write a somewhat smarter logging facility for Zope. It supports complex rules processing and configurable targets (syslog and file). It's been tested under Linux only but should work on Win32 and other UNIX derivatives. Give it a roll. Looks very useful. It would be even better if rules could associated with each target. This would make it easy to separate, say, debugging logs from site statistics. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] HTTP_ACCEPT
Spicklemire, Jerry writes: There is a value included in "REQUEST" called HTTP_ACCEPT. Is there a way within Zope to reset this value? dtml-call "REQUEST.environ.update({'HTTP_ACCEPT' : whatever_you_want})" The default seems to be "*/*", but our sysadmin says Zope would get along better if we can change it to include the alias that Zope has been assigned by our Proxy Server. I doubt, it will work as you want. As far as I know, Zope by itself does not interpret "HTTP_ACCEPT". Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Import classes in External method
Francois-Regis CHALAOUX writes: How to import classes in an External method? I mean, where to place the module where my class is defined. I tried to put it in "lib/python/" or "Zope-2-2-0/lib/python/Shared", or in "/usr/lib/python1.5/" but I always got the same message : The errror === Error Type: SystemError/STRONGBR Error Value: Failed to import class myclass from module __main__ Strange! When you place your module in "lib/python" (or any other directory listed in PYTHONPATH), then "import module" should work. When you place it in "lib/python/Shared", you need "from Shared import module". Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Managing subobjects
[EMAIL PROTECTED] writes: I created a ZClass, zRow. This class can contain other ZClass: zField_Text, zField_Date, etc. This let me define the columns contained in a zRow. I then defined a Class zTable, wich contains zRows. Question: - In my manage tabs, I needed a have a tab "Define columns". Do achieve this, I inserted a ZRow Instace (with id Definition) in my zTable product definition, and a method called Define_Columns, containing: dtml-with Definition dtml-var manage_main /dtml-with And I defined a view "Define Columns" pointing to that method. When i click on the "Define Columns", I can see the manage screen of the instance "Definition", that's what I wantwd. But when Add a zField, the instance is create in the zTable level, not IN Definition instance! All the classes are Based on CatalogAware, ObjectManager. There are 2 hierarchies, the object hierarchy in Zope and the URL hierarchy used by the browser. Usually, these two hierarchies are magically in sync. However, it is easy to change this. In your case: the "with Definition" changes (in some way) the current location in Zope's object hiararchy. However, the current location in the URL hierarchy is not changed. When you press "add", an HTTP request is generated, almost surely with a relative URL, i.e. relative to the current location in the URL hierarchy. Obviously, your add method is called in the wrong context (or maybe, the add method of the wrong object is called). You may succeed, when you change the location in the URL hierarchy, too. You do this with a "RESPONSE.setBase(newBase)". Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] intermittent problems downloading portal files
Lucas Hofman writes: We use PTK as an intranet for a RD company. Users publish their reports as in PDF format using portal file object type. Now and then (enough to be irritating, but not reproducable on demand) the PDF file gets corrupted in the download, resulting in the reader complaining (typically "file does not start with %PDF...") The server runs linux (mandrake 7), Zserver2.1.6, Zope 2.1.6 and PTK 0.7.1 The clients are heterogenous, IE5, Netscape 4.x on both PC and workstations. This almost surely is the "Missing Thread Synchronization Bug". I reported it several month ago (to the list and the collector). The problem is fixed in Zope 2.2. My collector report contains a patch for Zope 2.1.6, though not an optimal one. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] HOWTO (but to be improved) - linking to neighbours
Marcin Kasperski writes: * Problem The problem: while presenting some page, I would like to automagically add links to 'previous' and 'next' page in the same directory. Say you organize a bunch of HOWTOS and you would like to let the people navigate via 'next' links - without going back go table of contents. You could use: dtml-in "PARENTS[0].objectValues()" sort=id size=1 orphan=0 !-- Navigation -- dtml-var sequence-item !-- header/footer should be disabled -- /dtml-in Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Best way to subclass DTML Document and some other ZClasses questions
Marcin Kasperski writes: 1) How can I set standard DTML Document properties (title!) from my constructor? I created constructor form and constructor method, I succesfully prompt for and set all my properties but I do not know how to set properties belonging to DTML Document. Your ZClass inherits the methods of its base classes. You use the base classes methods to access their features. In your specific case, you would use "manage_changeProperties" to change the DTML Document properties. "manage_changeProperties" is defined by "OFS.PropertyManager.PropertyManager". What exactly should I write? On which object (which property sheet) should I call manage_editProperties to change document title? On the object you want the title changed Okay, let's admit: I am a bit confused. Above, I understood that your class derives from DTML Document. Then each instance of your class is an instance of DTML Document, too. You use the inherited methods in the same way you use the methods defined in your class. I.e. dtml-with mkNewObject(.) dtml-call "manage_changeProperties(.)" /dtml-with What confuses me: below your custom class does not seem to be derived from DTML Document. 2) Can I do anything to have single property screen which would behave as original DTML Document property screen but present both original properties and properties belonging to my custom property sheet? You can create your own ZClass "view" that does this. So it is impossible to use original DTML Document property screen? I like it. You can use the source and extend it (slightly). 4) Can I do something to have ZCatalog PrincipiaSearch (i.e. full text search) to scan some property of my custom ZClass (say property body from propertysheet Basic)? You just define "Meta Data" or indexes for them. Not exactly. I would like to have bodies of my DTML Documents and my custom class (which does not subclass DTML Document) .body property contents to be indexed with _the same_ full text index. What should this "the same" mean? I tried defining method PrincipiaSearchSource in my custom class but it did not helped (ZCatalog did not indexed my objects in PrincipiaSearch index - according to its status screen). Any parameterless method (or any attribute) should work. Maybe, your methods throws an exception. Then, it will not contribute to the indexing. Test it in isolation. 5) Can I write index_html method of my custom class so it interpret DTML tags (like dtml-var substitution)? I do not understand this question: "index_html" has nothing to do with interpreting DTML tags. Yes I know. In fact I ask 'what can I do to parse DTML in a method of object which does not subclass DTML Document?' When you want to interpret DTML tags, you will need to somehow use DocumentTemplate instances. And that 'somehow' is what I am asking for. You either use the Zope wrapped Document Template objects (DTML method/document) or you use the DocumentTemplate directly in Python (external method, product, maybe Python method). The DTML user guide contains a chapter on how to use Document Template from Python. The archives are not searchable :-( You look at the wrong archives. NIP archives the main Zope mailing lists. *These* archives *are* searchable. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] The mysteries of Product icons ?????
Daniel Rusch wrote: Can anyone out there demystify this for me??? Browser caching perhaps? Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Meet Paul Everitt at the Paris Zope Meeting !
Hi everyone ! The Paris Zope Meeting is a great opportunity for Europe's Zope community to meet Paul Everitt, CEO of Digital Creations, who is currently in France for holidays. It is also a chance to meet Zope developers from England, Germany, Switzerland and of course France. If you want to come to the event, please send a mail to [EMAIL PROTECTED] to let us know about your plans. Maybe some of us can already gather a day or two before the event ? A list of people who have already registered is available here: http://portalux.com/nnl/documents/zope-meeting/list Event Details: Date: Wednesday August 23rd 2000 Schedule: From 09:00 to 18:00 CET Place: 18, rue du Faubourg du Temple - 75011 Paris Registration: http://portalux.com/nnl/documents/zope-meeting/ WebSite: http://zdp.zope.org/projects/eurozope/events/pariszopemeeting Mailing List: http://comlounge.net/mailman/listinfo/eurozope There are some talks planned, but due to the short preparation time, these are not fixed (yet). Maybe you can give a talk as well ? Just let us know. This is the first event organized by the EuroZope initiative, which tries to better support Zope in Europe due to the great response we received at the Linuxtag 2000 in Stuttgart. EuroZope infos: http://zdp.zope.org/projects/eurozope Maybe you want to attend some of the other events planned by the EuroZope team ? http://zdp.zope.org/projects/eurozope/events We still need Zopers who would like to help us organizing those future events. Let's discuss it on the EuroZope mailing list: http://comlounge.net/mailman/listinfo/eurozope Greetings, Maik Röder -- "The computing future is based on "cyberbodies" - self-contained, neatly-ordered, beautifully-laid-out collections of information, like immaculate giant gardens." The second coming - A manifesto. David Gelernter http://www.edge.org/3rd_culture/gelernter/gelernter_p1.html ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Newbie Q from non-Newbie: Where does my HTML go?
Dead on balls accurate. Works like a charm. Thanks Chris. (now have to figure out why I couldn't figure that out!) :) J From: Chris Withers [EMAIL PROTECTED] Organization: New Information Paradigms Date: Wed, 16 Aug 2000 23:17:01 +0100 To: "J. Atwood" [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [Zope] Newbie Q from non-Newbie: Where does my HTML go? "J. Atwood" wrote: EX1: dtml-var expr="_.whrandom.choice(tips.objectValues())" untested... dtml-var expr="_.whrandom.choice(tips.objectValues())(_.None,_)" cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Can't change user roles without password
The differentiating factor is the version. This was an issue in 2.1.6. Upgrade time :) -- Andy McKay, Developer, ActiveState http://www.ActiveState.com Programming for the People - Original Message - From: "David Riggs" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 16, 2000 2:20 PM Subject: [Zope] Can't change user roles without password Somewhere along the way, the acl_users/Contents form has decided to quit filling in the value of each user's password, so that their roles can only be assigned if a Manager knows their password...I've got new installation running Zope 2.2.0 and a new CVS PTK release on another box that does it correctly, but I can't determine what's the differentiating factor by comparing them. Any ideas on what I did to cause this, or more importantly, what I can do to fix it? I'm using... Zope 2.1.6 (binary release, python 1.5.2, win32-x86) PTK 0.7.1 WinNT 4.0 SP5 Thanks, Dave. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Referencing an object in a subfolder
"Smith, Paul" wrote: I want to create an "images" directory for a web site and store image objects there that I can reference. How do I get a DTML document in a higher directory to see the images folder and locate the appropriate image? dtml-with images_folder dtml-var an_image /dtml-with cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] ZOracleDA problem
Hello, Ive successfully compiled the DCOracle package and then moved the compiled modules to the DCOracle directory of ZOracleDA, and now the DA shows up as non-broken in my Zope installation.. However, when I try to add a ZOracleDA connection object to my Zope website, I get a "this document contained no data" page... back.. it wont work. DCOracle passed the connection test so I know it isnt that.. Does anyone have any idea what I might be doing wrong? I'm using Zope 2.16 Thank you ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Best way to subclass DTML Document and some other ZClasses questions
On Wed, 16 Aug 2000, Marcin Kasperski wrote: dtml-with "mk_dtml_document.createInObjectManager(REQUEST['id'], REQUEST)" dtml-call "propertysheets.Extra.manage_editProperties(REQUEST)" dtml-comment How can I change original title? /dtml-comment dtml-call reindex_object /dtml-with On which object (which property sheet) should I call manage_editProperties to change document title? I believe the title goes in the 'default' property sheet, but more than that I can't tell you. 'default' gets some special handling I think, but you could certainly try just using it in place of Extra in the call up there. --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Best way to subclass DTML Document and some other ZClassesquestions
On Wed, 16 Aug 2000, Marcin Kasperski wrote: Pass it as an argument to the call that creates the DTML Document. How? Currently my constructor method contains the following (mk_dtml_document is my custom class which subclasses DTML Document, Extra is the name of my custom propertysheet): dtml-with "mk_dtml_document.createInObjectManager(REQUEST['id'],REQUEST)" Hmm. I've only done this kind of thing by calling the add method of the class, where you could pass in, say, title=title. I'm not sure how you'd do it with createInObjectManager. Although you might try wrapping the whole thing in dtml-with REQUEST. The REQUEST title may be getting overridden by another title property that happens to be blank. Yep. You should be able to replicate everything the original constructor code does in your own code. Read The Source, Luke grin. I hate replicating code. I love calling it. Couldn't it be done this way? Maybe. You'd have to look at the source code and see if can handle being called as a subroutine. If not, somebody ought to refactor it grin. I tried defining DTML Method with name PrincipiaSearchSource and contents dtml-var body (body is my custom property name). Next I clicked 'Update Catalog' in ZCatalog screen. Seems my attempt has been ignored - the amount of objects indexed via PrincipiaSearchSource (according to ZCatalog status screen) has not changed (those object are succesfully indexed on title etc). As someone else said, the method has to be parameterless (yours probably appears to be). This also means that it can't depend on having a name space around (that usually gets passed implicitly to dtml methods), including REQUEST, since Catalog won't have that to pass it in most indexing scenarios. At first glance I'd think your code would work, but I can think of two other things you could try: dtml-return body, and defining an external method instead and just have it just do "return self.body". 5) Can I write index_html method of my custom class so it interpret DTML tags (like dtml-var substitution)? I'm sure you can, but I don't know how grin. But if you are doing that, why not just subclass DTML-Method (or document)? Because I have not done it previously and now I have about 100 objects of this type and do not know how to perform such a change. Ah, yes, changing the base class of a ZClass is hard. There's a hold-onto-your-pants recipie for doing it, but it's not for the faint of heart. Check the HowTo's if you are curious. Depending on the complexity of the objects, you could write an external method that would write the data out to a file in some format, and another to read the data back in and use it to instantiate new objects of the desired type. I did this once with a 60K database of objects wry grin. I *could* send you that source code as an example, if you want. I based the re-load code on the "adding ZClass object programatically" howto. Write an external method to do all the object creation, property copying, and old object deletion. What about some sample code? I haven't done it myself, so I don't have any sample code for this (but see above). --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] modifying/changing DTML properties
On Wed, 16 Aug 2000, Paul Schreiber wrote: --- "R. David Murray" [EMAIL PROTECTED] wrote: On Wed, 16 Aug 2000, Paul Schreiber wrote: dtml-call "manage_changeProperties('eggs', 'blue')" dtml-call "manage_changeProperties({'eggs': 'blue'})" This: b!--#var eggs --/b dtml-call "manage_changeProperties({'eggs': 'blue'})" p!--#var eggs -- results in: bgreen/b pgreen did i miss something? Hmm. That should have worked. You could try manage_changeProperties(eggs='blue') as an alternative, but the dictionary way should have worked. Did you check the property after the method had executed? Perhaps the change is not visible until the method completes, although I would not expect that to be the case...unless 'eggs' exists "closer" in the name space stack as a variable than it does as a property on the object, in which case the second dtml-var would be picking up the variable value but the manage_changeProperties will have affected property of the object it was called on. --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] third party hosting options wihtout long running process
Hi all, I hope this hasn't been asked to death before, but out of lots of related information that I did find, I could not find a direct answer to my question. I have been using and really enjoying Zope on my Debian system at home, but would like to start using it for a couple of web sites that I maintain. The problem is, they are hosted at providers that do not have Zope, and currently have no plans to do it. Both of the providers allow pretty much any CGI you can write, except that they don't allow long runing processes. Where does this leave me? I have seen where Zope can be run as a CGI, but is unbearably slow. Is unbearable truly unbearable? I have gleaned that they are several parts of Zope, not all of which needs to be used. In particular, so far I have really gotten into the acquisition concept, as it is similar to something I was already doing with python CGIs and heavy abuse of soft links. Can just ZPublisher (this is what does this right?), be run as a CGI? Of course, my other option is to move my sites. I have a freezope account at nipltd, but I assuming they don't want people doing redirections ala redirection.net to freezope accounts. I have seen other hosting companies, but most seemed rather expensive, especially in light that I would not be giving up my current ISP for a couple of unrelated to Zope reasons. Basixally, if I am limited to CGI, what parts of Zope can I use effectively? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] upgrade 2.2.0 to 2.2.1b1
hello all has anybody encountered problems when upgrading from 2.2.0 to 2.2.1b1? i have problems with some products (kmnetnews), and some of my ZClasses. are there any known issues? things i should have considered? there are also tracebacks "Couldn't load state" when starting zope in debug mode.. platform RH6.2, straight ZServer products - KMnetnews, a few ZClasses, thanks --traceback when i tried accessing kmnetnews-- Zope Error Zope has encountered an error while publishing this resource. TypeError Sorry, a Zope error occurred. Traceback (innermost last): File /home/kdie/Zope-2.2.1b1-src/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /home/kdie/Zope-2.2.1b1-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /home/kdie/Zope-2.2.1b1-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /home/kdie/Zope-2.2.1b1-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /home/kdie/Zope-2.2.1b1-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: index_html) File /home/kdie/Zope-2.2.1b1-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: index_html) File /home/kdie/Zope-2.2.1b1-src/lib/python/OFS/DTMLDocument.py, line 171, in __call__ (Object: index_html) File /home/kdie/Zope-2.2.1b1-src/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: index_html) File /home/kdie/Zope-2.2.1b1-src/lib/python/DocumentTemplate/DT_With.py, line 146, in render (Object: Data) File /home/kdie/Zope-2.2.1b1-src/lib/python/DocumentTemplate/DT_Util.py, line 337, in eval (Object: index_html(_.None, _, category='top')) (Info: _) File string, line 0, in ? TypeError: call of non-function (type None) end tracebacks --tracebacks starting zope-- -- 2000-08-17T03:53:37 ERROR(200) ZODB Couldn't load state for '\000\000\000\000\000\000\000Z' Traceback (innermost last): File /home/kdie/Zope-2.2.1b1-src/lib/python/ZODB/Connection.py, line 447, in setstate File /home/kdie/Zope-2.2.1b1-src/lib/python/ZODB/Connection.py, line 213, in _persistent_load (Info: 8÷) File /home/kdie/Zope-2.2.1b1-src/lib/python/ZODB/Connection.py, line 154, in __getitem__ ---data snipped--- ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] ZCatalog key error
is Zope.org running 2.2.1b1 or CVS? cause i think key error still occurs. check out 'What's New' at Zope.org, and you'll get the error. i might be wrong though thanks ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )