[Zope] Zwiki conflicts with my product
I've developed a FS based product, and now I'm preparing the environment to put it in production. After copying the product directory in Zope's Product folder Zope doesn't start anymore, for reasons that frankly I don't understand because it "conflicts" with Zwiki (and I don't use anything from that product). 2005-09-15T12:05:37 ERROR(200) Zope Could not import Products.ZWikiTraceback (most recent call last): File "C:\Program Files\Zope-2.7.7-final\lib\python\OFS\Application.py", line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File "d:\Zope-Instance\Products\ZWiki\__init__.py", line 12, in ? import ZWikiPage, ZWikiWeb, Permissions, Defaults File "d:\Zope-Instance\Products\ZWiki\ZWikiPage.py", line 63, in ? from Regexps import url, bracketedexpr, doublebracketedexpr, \ File "d:\Zope-Instance\Products\ZWiki\Regexps.py", line 93, in ? uppercase_uc = unicode(string.uppercase)UnicodeDecodeError: 'ascii' codec can't decode byte 0x8a in position 26: ordinal not in range(128)Traceback (most recent call last): File "C:\Program Files\Zope-2.7.7-final\lib\python\Zope\Startup\run.py", line 50, in ? run() File "C:\Program Files\Zope-2.7.7-final\lib\python\Zope\Startup\run.py", line19, in run start_zope(opts.configroot) File "C:\Program Files\Zope-2.7.7-final\lib\python\Zope\Startup\__init__.py",line 52, in start_zope starter.startZope() File "C:\Program Files\Zope-2.7.7-final\lib\python\Zope\Startup\__init__.py",line 231, in startZope Zope.startup() File "C:\Program Files\Zope-2.7.7-final\lib\python\Zope\__init__.py", line 47, in startup _startup() File "C:\Program Files\Zope-2.7.7-final\lib\python\Zope\App\startup.py", line45, in startup OFS.Application.import_products() File "C:\Program Files\Zope-2.7.7-final\lib\python\OFS\Application.py", line 650, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File "C:\Program Files\Zope-2.7.7-final\lib\python\OFS\Application.py", line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File "d:\Zope-Instance\Products\ZWiki\__init__.py", line 12, in ? import ZWikiPage, ZWikiWeb, Permissions, Defaults File "d:\Zope-Instance\Products\ZWiki\ZWikiPage.py", line 63, in ? from Regexps import url, bracketedexpr, doublebracketedexpr, \ File "d:\Zope-Instance\Products\ZWiki\Regexps.py", line 93, in ? uppercase_uc = unicode(string.uppercase)UnicodeDecodeError: 'ascii' codec can't decode byte 0x8a in position 26: ordinal not in range(128) My product depends on Reportlab and PIL, nothing else, I don't have a clue of what's happening here. If I delete my product, everything's fine. If I delete Zwiki, everything's fine. I've tried various locale settings inside zope.conf, always the same error. Zope 2.7.7 on Windows. Zwiki is 0.41. Suggestions ? TIA, ngw Yahoo! Messenger: chiamate gratuite in tutto il mondo ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Virtual Host Monster
I'm trying to use VHM to rewrite a pair of urls. What I want is to have a "normal" Zope on localhost:8080/, and an instance of a Product on localhost:8080/myProduct. The problem I'm having is that VHM locks me out from the root folder :( My mappings line is: localhost:8080/my_container/VirtualHostRoot/myProduct How do I exclude localhost:8080 to behave normally, as without Virtual Host Monster ? Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] SQLConnectionIds
I'm working as admin, sorry for not mentioning it. The same PageTemplate in the same folder, but not inside the product, works like a charm, same as SQLConnectionIDs inside the product, but as DTMLFile. ngw Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] SQLConnectionIds
Again, this problem is making me mad :) This is a simple TTW PageTemplate I'm using: placeholder This works without any problem, returning a list of tuples. The same template in a FS based product raises a site error: Unauthorized: You are not allowed to access 'SQLConnectionIDs' in this context (Also, an error occurred while attempting to render the standard error message.) that's not even logged. A very similar DTML file on the FS, that cycles through SQLConnectionIds, works perfectly. This is Zope 2.7 on Windows. Is this a Zope bug ? TIA, ngw Yahoo! Messenger: chiamate gratuite in tutto il mondo ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] FS based product and image replacement
- Dieter Maurer : > Nicholas Wieland wrote at 2005-8-12 11:45 +0200: > >The image is inside 'myproduct/images', what I've tried is to create > >an ImageFile and use it inside the background-image directive inside > >the stylesheet, but also url("images/foo.gif") with and without the > >absolute url. > > "ImageFile" works. You must do something wrong. > What happens precisely? > Exception+Traceback > -- broken image (then access it and report exception+traceback). Nothing, the image isn't displayed at all, so I argue that Zope doesn't find it. > Sometimes, images are put into the "misc_" section of a product. > You can see an example use in "Products/ZGadflyDA/__init__.py". Thank you. ngw -- checking for life_signs in -lKenny... no Oh my god, make (1) killed Kenny ! You, bastards ! nicholas_wieland-at-yahoo-dot-it ___ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] FS based product and image replacement
Hi *, I'm trying to use image replacement in a FS product, but unfortunately I'm not able to catch the image on the FS (a simple gif). The image is inside 'myproduct/images', what I've tried is to create an ImageFile and use it inside the background-image directive inside the stylesheet, but also url("images/foo.gif") with and without the absolute url. How do people use image replacement in FS based products ? TIA, ngw Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] product organization
But how do I get the connection id ? Actually I get it when I instance the product in Zope. What I think is something like class Foo def __init__ (self, conn): self.conn = conn myquery = SQL ('doMyQuery', '', self.conn, '', 'select * from table') but obviously it will not work. TIA, ngw p.s. Sorry for top-postingMarco Bizzarri <[EMAIL PROTECTED]> ha scritto: I can't talk for best practise. You can put your queries also outside ofthe init, in this way:class YourProduct:_my_query = SQL('doMyQuery', '','your_connection', '', 'select * from data')def __init__(self):passAlso, if you have a *LOT* of queries, consider in building your query onthe fly. Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] reportlab and images
I know, I'm flooding the list ... I use images inside my reports, so I have to open PIL-image objects inside my product. Everything is fine, but I must use the full path, like /Zope-Instance/Products/foobar/image/blah.png, and this is a problem, because the product will have a different path when put in production. My solution is to have a class variable to use, like: imagepath = "/Zope-Instance/.../image" and then use that variable to build the path, but I think it's ugly. How do you solve this problem and just use 'image/blah.png' just like ZPTs, knowing that all image files will be stored in an "image" subdirectory of the product ? TIA, ngw Yahoo! Messenger: chiamate gratuite in tutto il mondo ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] product organization
Well, not exactly - just a way to separate access to data from everything else in the product. Maybe a separate class that needs the connection as argument and that just returns the data I need in appropriate data structures by calling class methods. class DataModel (object): def __init__ (self, conn): self.conn = conn self.sqlFetchSomething = SQL (.) def fetchSomething (self): return self.sqlFetchSomething This is really simple, but I think it gives the idea. Obviously I'd like to perform various operation at the data level, for example return a list of lists for reportlab tables and so on. TIA, ngw Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] product organization
As usual, my question is rather simple :) I'd like to know what are the best practices for product organization - for example I have _tons_ of queries to sqlserver, and my main class is becoming less manageble every time I look at it :/ I like the way SQL integrates in Zope, what I don't like is having a giant __init__ and a lot of _sqlSomething at the end of the class. Can I associate queries to something else than a _variable ? Something like a dictionary or a class ? Can I move SQL calls outside the initializer ? I'd prefer to have a class for data access and another one to glue all the parts together, maybe I'm plain wrong but I think that my product would be a lot cleaner. What are the best practices for FS based products ? Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] working with urls
Because it's a bit ugly - my url will grow a lot, because I have to include the variable name. It's also really simple to make the product generate a PDF if the user know the ref_date and code, without playing with variable names. Obviously if it's not possible I will generate a normal querystring, no problem at all, I'm just curious to know if it's possible to have urls like in ruby on rails :) TIA, ngwJonathan <[EMAIL PROTECTED]> ha scritto: Why don't you identify the variable data portion of the urls you are building as standard http-type arguments: eg. http://www.myweb.com/amethod?var1=val1&var2=val2... This way var1, var2 etc will be accessible to your method as entries in REQUEST. Jonathan - Original Message - From: Nicholas Wieland To: zope@zope.org Sent: Monday, July 25, 2005 9:39 AM Subject: [Zope] working with urls First of all thanks everyone for the help, I've resolved my problems one after the other thanks to the suggestions I've found here. Now I'm rewriting urls by substituting the href attribute with custom data, and everything works fine. What I'd like is having an url like: myproduct/generate/20050301/PG2, and actually that's exactly what I've got. This url will make my app generate a pdf report for the ref_date 2005/03/01 and code PG2 (ref_date and code are internal data). Zope obviously maps the url as an object, but that's not what I want: I want to parse the url and use the ref_date and code data inside a generate method. Is it possible inside Zope without mod_rewriting and similar stuff ? I don't like querystring, the resulting url would be too long and difficult to paste. I know that this is not the way Zope works ... TIA, ngw Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3 ___Zope maillist - Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope** No cross posts or HTML encoding! **(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] working with urls
First of all thanks everyone for the help, I've resolved my problems one after the other thanks to the suggestions I've found here. Now I'm rewriting urls by substituting the href attribute with custom data, and everything works fine. What I'd like is having an url like: myproduct/generate/20050301/PG2, and actually that's exactly what I've got. This url will make my app generate a pdf report for the ref_date 2005/03/01 and code PG2 (ref_date and code are internal data). Zope obviously maps the url as an object, but that's not what I want: I want to parse the url and use the ref_date and code data inside a generate method. Is it possible inside Zope without mod_rewriting and similar stuff ? I don't like querystring, the resulting url would be too long and difficult to paste. I know that this is not the way Zope works ... TIA, ngw Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] zpt and sql
Hi *, I've searched a lot but actually didn't find anything useful to solve my problem, and probably I haven't really understood how Zope works ... :) I'm developing a filesystem product and I need to display a zpt form where I display some results from a query. I'm able to query the DB, and I'm able to display an empty zpt form, qhat I don't understand is how to stick the two things together. This is what I have: class InstitutionalReport (Item, Implicit, Persistent, RoleManager, Folder): """ Base class for InstitutionalReport. """ meta_type = "Institutional Report" manage_options = ( {'label' : 'View', 'action' : 'index_html' }, ) def __init__ (self, id, conn_id): """ initializer """ self.id = id self.conn_id = conn_id self.sqlGetReferenceDate = SQL ('slGetReferenceDate', '', conn_id, '', _sqlGetReferenceDate) #Folder.manage_addPageTemplate (self, 'index_html', file = self.def_index_html, REQUEST = None) index_html = PageTemplateFile ("zpt/index_html.pt", globals ()) I want to cycle through the query result with ZPT and populate a select. TIA, ngw Yahoo! Messenger: chiamate gratuite in tutto il mondo ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] css in filesystem based product
Hi *, I'm having issues developing a filesystem based product. The product loads correctly and I see my zpt, but I'm not able to apply a stylesheet. The product directory is under Zope-Instance/Products, I've created some directories where I put styles and templates - but changing this structure is no problem at all. I don't have the slightest idea on how I can hook the .css to the .zpt, probably the css must be "published" inside zope in some ways, but I don't know how. I'm using plain Zope, no Plone and no CMF. I've also tried to look how Plone does this but without any success (it's just too big ...). TIA, ngw Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )