[Zope] Zope 2, local python script security

2007-05-23 Thread David H

Hi Zope list,

I have a (zope 2.8.8-final) folder that gives users with the role 
Authenticated

the following Permissions:

---
  . access contents
  . view
  - note: no webDav or FTP access is allowed
---

Playing around with wget and curl I find I can (with proper 
authentication) download the published but not raw source of zpt and 
python files available in the folder.


So, for example, the script \folder\pyDate returns '2007/05/23' not 
its source, e.g.


# module: pyDate
from DateTime import DateTime
return DateTime().Date()

This is the behavior I want - as we have a requirement to keep source 
secure. 

I realize that source in Zope-Instance/Extensions is the most secure but 
I'm interested in local script security.


Thanks,

David





___
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] Access to list items with path expression

2007-04-11 Thread David H

Garito wrote:


Hi!

Is there any way to access to some list index with TALES expression?

I would like to use something like here/list/0 or here/list/int:0

Is this possible?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito


Hi Garito,

Try something like:  tal:content=python: context.list[0]  or you can 
always call a python script that returns the desired value.


David H

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope Products and proprietary software

2007-02-07 Thread David H

Andrew Milton wrote:


+---[ Marco Bizzarri ]--
| Hi all.
| 
| I would like to know if someone can provide infos on the following topic:
| 
| we have developed OpenFlow, which is released under GPL.
| 
| A company is distributing a proprietary product based on Zope and OpenFlow.
| 
| I suspect that if they want to do so, they should have a different

| licence from us.
| 
| Can someone provide further insight?


If they are distributing a codebase that is derived from OpenFlow then that
part of the code has to be released as GPL. The GPL is pretty specific about
derivative products.

You are probably best to go to the FSF with the exact details, they will most
likely be able to advise you better.

 


what the FSF is FSF?  :-)


___
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] Database connectors

2006-11-16 Thread David H

Roberto Edwins wrote:

Could somebody tell me how to close/open a database connection through 
python instructions?


Thanks in advance...


Just do a google on your database + python.  Of course, it would be 
better if you found your database + zope - because (at least zope2) has 
a nice array of database adapters as products for Zope that are ready to 
go (Postgres, mySql, and Interbase come to mind as examples)


Good luck,

David H

ps:  in the future try to be more specific, eg: what db are you using, 
whats your platform ... and since this is a Zope list we kinda assume 
you want a zope db adapter - not just a python one.








___
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] matplotlib and zope problem

2006-11-14 Thread David H

Marek Szczypiński wrote:


Here is the traceback. Looks like problem with matplotlib it self,
doesn't it? Did anyone have the same problems?
Thanks for any help.

Marek


Traceback (innermost last):
 Module ZPublisher.Publish, line 115, in publish
 Module ZPublisher.mapply, line 88, in mapply
 Module ZPublisher.Publish, line 41, in call_object
 Module Products.ExternalMethod.ExternalMethod, line 59, in
manage_addExternalMethod
 Module Products.ExternalMethod.ExternalMethod, line 111, in __init__
 Module Products.ExternalMethod.ExternalMethod, line 134, in manage_edit
 Module Products.ExternalMethod.ExternalMethod, line 141, in getFunction
 Module App.Extensions, line 148, in getObject
  - __traceback_info__:
('/var/lib/zope/zope-markacy/Extensions/mpl.py', 'mpl')
 Module /var/lib/zope/zope-markacy/Extensions/mpl.py, line 1, in ?
 Module None, line 1011, in ?
 Module None, line 968, in rc_params
 Module None, line 914, in matplotlib_fname
 Module None, line 273, in wrapper
 Module None, line 324, in _get_configdir
RuntimeError: '/' is not a writable dir; you must set environment
variable HOME to be a writable dir
 


Hi Marek,
Never heard of matplotlib.  But your traceback is saying that the 
product is trying to write to root - without sufficient permission.  I'd 
look at the source (see _get_configdir) and see if its reading some sort 
of config file or maybe its parsing the enviromental var HOME..  You 
probably can modify that.  Anyway, writing to / doesnt seem to be a 
good idea in any case.


You have set variable HOME? 


Best,
David H



___
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] matplotlib and zope problem

2006-11-14 Thread David H

David H wrote:


Marek Szczypiński wrote:


Here is the traceback. Looks like problem with matplotlib it self,
doesn't it? Did anyone have the same problems?
Thanks for any help.

Marek


Traceback (innermost last):
 Module ZPublisher.Publish, line 115, in publish
 Module ZPublisher.mapply, line 88, in mapply
 Module ZPublisher.Publish, line 41, in call_object
 Module Products.ExternalMethod.ExternalMethod, line 59, in
manage_addExternalMethod
 Module Products.ExternalMethod.ExternalMethod, line 111, in __init__
 Module Products.ExternalMethod.ExternalMethod, line 134, in manage_edit
 Module Products.ExternalMethod.ExternalMethod, line 141, in getFunction
 Module App.Extensions, line 148, in getObject
  - __traceback_info__:
('/var/lib/zope/zope-markacy/Extensions/mpl.py', 'mpl')
 Module /var/lib/zope/zope-markacy/Extensions/mpl.py, line 1, in ?
 Module None, line 1011, in ?
 Module None, line 968, in rc_params
 Module None, line 914, in matplotlib_fname
 Module None, line 273, in wrapper
 Module None, line 324, in _get_configdir
RuntimeError: '/' is not a writable dir; you must set environment
variable HOME to be a writable dir
 


Hi Marek,
Never heard of matplotlib.  But your traceback is saying that the 
product is trying to write to root - without sufficient permission.  
I'd look at the source (see _get_configdir) and see if its reading 
some sort of config file or maybe its parsing the enviromental var 
HOME..  You probably can modify that.  Anyway, writing to / doesnt 
seem to be a good idea in any case.


You have set variable HOME?
Best,
David H



Marek,

I gave bad advise.  Don't mess with (set) your HOME enviro var.

David


___
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] Hosting

2006-10-31 Thread David H

mbr wrote:


Hi List

I am looking for a hosting for one project .


From zope.org see zettai.net and webfaction.com


Exist another hosting?

What hosting recommend?

webfaction.com have all  need (install my own products, ssh acounts,
etc) , but i want sure


Hi mbr,

you can check out  High Speed Rails inc.  http://highspeedrails.com

A few people on this list recommended it and I recently moved my project 
there.


David

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DTML Call Fails

2006-10-24 Thread David H

[EMAIL PROTECTED] wrote:


A little bit of legacy DTML fun here... Zope 2.9.3

On save of a DTML Method, why would this dtml-call fail:

dtml-let standards=REQUEST.SESSION
 dtml-call standards.set('AR-DA-08', AR-DA-08)
/dtml-let

With the error: 


Expression (Python) Syntax error: invalid token

Whereas this works fine:

dtml-let standards=REQUEST.SESSION
 dtml-call standards.set('AR-DA-07', AR-DA-07)
/dtml-let

Any insight is appreciated.



 


hpinson,

Maybe you can get away with something like _['AR-DA-07']  or maybe 
_.getitem('AR_DA-07')?


David
___
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] ZSQL Method's Precision

2006-10-23 Thread David H

Jason C. Leach wrote:


Hi:

In a PostgreSQL DB I have a Numeric data type with a precision of two
decimal places. If I have 1.33 in as the result from my query, it's
everything is good. However, if I have 1.30 it reduces the precision
to one decimal place and I get 1.3. Not so good when dealing with
currency ( I don't want to use the money data dype ).

Any ideas on how I can get my ZSQL method to keep two decimal places?

Thanks,
Jason.


1.3 and 1.30 are different only in terms display and printing.  One 
approach can be wrapping your calls to the zsql in a python script that 
applies formatting before returning the relavent results.


res = yourZSQL(params or request is all set up)
return $%.2f % res[0].yourAmountThatYouNeedToFORMAT

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: zope hosting

2006-09-23 Thread David H




George Lee wrote:

  David H [EMAIL PROTECTED] writes:

  
  
My understanding is that Zettai is closing down.  Bummer cause I have 
been using them.

  
  

I know they are not accepting new orders, but I wasn't aware they are shutting
down. How have you heard? (I also have a Zettai account.)

  

George Lee,

One of my support guys told me that. Maybe he is wrong. I do know
that George Donnelly is starting a different hosting company ... (hat
tip Allen and Phillip)

http://highspeedrails.com/Hosting



David




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


[Zope] zope hosting

2006-09-22 Thread David H

Hi everyone,

My understanding is that Zettai is closing down.  Bummer cause I have 
been using them.


Just looking for Zope Host recommendations

All best,

David

___
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] LocalFS - user needs to be manager?

2006-09-20 Thread David H

Josh Burvill wrote:


Hi all,

I am experiencing an odd situation where if a user does not have 
manager role, he/she cannot browse a localfs object.


I think it can't be a filesystem permissions or zope process os user 
problem because if the zope user has the manager role, there is no 
problem.


I can't see anything in the permissions for the localfs object to 
cause a problem, they are all on acquire.


Any hints?

Zope 2.8.6-final, python 2.3.5, win32
LocalFS-1-7-andreas


Josh
Did you do an Zope upgrade recently?  Why do you say its odd what was 
normal before?


David

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Turning off authentication for a zpt page

2006-09-15 Thread David H




Sinang, Danny wrote:

  
  
  Hello,
  
  I'm
using a Zope product called OpenFlowEditor and I modified one of its
.zpt pages (view_process.zpt).
  
  All
is well, except that I now want to allow Anonymous users to view this
zpt page. 
  
  I
tried doing so by checking the "Anonymous" checkbox for the "View"
privilege in http://myserver/OpenFlowEditor/view_process/manage_access
, but still no success. Am still being asked for a username and
password.
  
  Any
idea on how to get this working ?
  
  Regards,
  Danny
  

Did you also check "Access Contents Information"?



___
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] Remove/Ignore P and other HTML tags

2006-09-14 Thread David H

Zhi-Wei Lu wrote:



for object in container.research.objectValues():
  a = object.getId()
  if (a == name):
text = object.research_description_html.read()
  else:
 pass

text = str(text)

return text[0:400] + '...'


ZhiWei,

Just post a good fragment of

your text[ 0 : 400 ]  that pops your literal p and other 
non-translated html stuff and likely someone will solve it quick.  I'm 
thinking an analogie to ZPT's structure keyword 


Paul is right - the permission scheme did change.  I know it annoyed the 
hell out of me :-)  But not sure if thats your issue


David

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Custom authentication page...

2006-09-13 Thread David H

Chris Withers wrote:


David H wrote:


If necessary add
 dtml-var error_tb
to your standard_error_message (if using dtml) for a clearer error 
expression



This is not good advice. There are reasons why the traceback was 
dropped from standard_error_message in the first place ;-)



When have I ever given good advise? LOL

Much better is just to look in the error_log object which not only 
stores more info, it also does it in a secure way...



Thanks Chris O:-)

___
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] ZPT based on files in local filesystem folder

2006-09-13 Thread David H

Jonathan wrote:



- Original Message - From: Alan [EMAIL PROTECTED]
To: zope@zope.org
Sent: Wednesday, September 13, 2006 8:41 PM
Subject: [Zope] ZPT based on files in local filesystem folder



Hi List,

I've been googling, maybe LocalFS is a solution, but I would like to
listen a second (or more) opinion.

I would like to have a ZPT showing images and links for files that are
not within Zope filesystem, indeed they are in my local filesystem
(they are created by an Unix program btw).

So I am looking for something that may import my local folder and/or
the files inside to Zope space where a ZPT can work with.

For the moment, I would be more insterested in a external method or
similar rather than LocalFS or any other product that I have to
install in my zope server.

Any commentary or advice would be very welcome.



You could also look into ExtFile:

http://www.zope.org/Members/shh/ExtFile



Jonathan



Its unclear what hinges on the distinction between your using localFS 
and some other external method or product (that returns a list of the 
files your users are interested in )


I imagine you need at least 2 external scripts:
a) one that returns a list of available/desireable local file system 
file names so you can manufacture (via python code -- zpt ) HTML links 
to them (eg a href=... onClick=someJavaScript(thatFiles_id) ..


b) one that returns (as called by (a))  the select item to the user's 
browser (http response.write i think)


David



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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Custom authentication page...

2006-09-12 Thread David H




Steve wrote:
I'm just
starting to look at Zope as a potential platform to implement a simple
authenticated web site... however I do not want to face users with the
standard web-browser dialogue, but rather my own log-in page. I've
established how to restrict access based upon permissions etc... and
I'm able to set/reset cookies based a form submission - but do not see
how to integrate an HTML login page with the standard Zope security.
  
  
I've read that I should use the "Cookie Crumbler" product... but after
I've added this to the folder that I intend to protect, I click on
cookie_authentication (the default name for the "Cookie Crumbler"
object) and I get the following error message:
  
--
  
  
An error was encountered while publishing this resource.
  
  
*Error Type: AttributeError*
  
*Error Value: aq_parent*
  
  
--
  
  
Is this a bug with "Cookie Crumbler" (version 0.3 downloaded from
zope.org used against Zope 2.9.4, python 2.4.3, win32)?
  
Am I barking up the wrong tree in hoping to have a slick-looking
"logon" page? Is this something commonly done using Zope? Is "Cookie
Crumbler" the right product? Would I be better hand-coding this
myself?
  
  
  

Steve,
Thats a weird one ... but cookie crumbler is great to get custom
login forms
Did you try deleting it and adding another (cookie_authentication
object) Maybe you added a property thats
non-existent? (login page id or something?)

you can produce a fuller error traceback 

If necessary add
 dtml-var error_tb
to your standard_error_message (if using dtml) for a clearer error
_expression_








___
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] question on URL styling

2006-09-11 Thread David H

Jonathan wrote:



- Original Message - From: Erik Myllymaki 
[EMAIL PROTECTED]

To: zope@zope.org
Sent: Monday, September 11, 2006 12:24 PM
Subject: [Zope] question on URL styling


I am making a survey that has many very similar pages all in one 
directory.

The page templates are called page-1.html, page-2.html, ... page-n.html.

I am using two submit buttons on each of the pages; one for 'Next' 
and one for 'Previous' so that I catch changes to the form elements 
in each direction. I use a python script as index_html, and hit it on 
each submit (form action=.), and then redirect to the appropriate 
page, whether that page is current_page++ or current_page--. I also 
stuff all form variables into SESSION in the index_html python script.


What I am wondering though, is how to display the 'page' portion of 
the address - right now it always just displays as 
http://myzopesite.com/workingdirectory/


I would like it to display 
http://myzopesite.com/workingdirectory/page-1.html, 
http://myzopesite.com/workingdirectory/page-1.html, etc.


The pages are all accessible directly by those names, but by always 
going to index_html and returning the page via return 
container[next_page](context, request) I never see this part in the 
URL.



One possible work-around is to rename your python script, reformat 
your urls and use traverse_subpath to access the page to be 
displayed.  eg.  if you name your script 'displayPage', then you can 
have a url like:


http://myzopesite/workingdirectory/displayPage/page-1.html

the displayPage script will be invoked and it can then access 
REQUEST['traverse_subpath'] (which in the above case will contain 
'page-1.html').



hth

Jonathan


Erik,
I find your use case a bit strange.  Why would your users need to see 
different URLs?  Doesnt that pollute their browser's history list - and 
do you want them clicking some Page-nn from history? 

I like the idea of using a python script as index_html and using it as a 
router.  Instead of a redirect I use


return someZpt(context, request)

David



___
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] question on URL styling

2006-09-11 Thread David H

Erik Myllymaki wrote:




David H wrote:


Jonathan wrote:



- Original Message - From: Erik Myllymaki 
[EMAIL PROTECTED]

To: zope@zope.org
Sent: Monday, September 11, 2006 12:24 PM
Subject: [Zope] question on URL styling


I am making a survey that has many very similar pages all in one 
directory.
The page templates are called page-1.html, page-2.html, ... 
page-n.html.


I am using two submit buttons on each of the pages; one for 'Next' 
and one for 'Previous' so that I catch changes to the form elements 
in each direction. I use a python script as index_html, and hit it 
on each submit (form action=.), and then redirect to the 
appropriate page, whether that page is current_page++ or 
current_page--. I also stuff all form variables into SESSION in the 
index_html python script.


What I am wondering though, is how to display the 'page' portion of 
the address - right now it always just displays as 
http://myzopesite.com/workingdirectory/


I would like it to display 
http://myzopesite.com/workingdirectory/page-1.html, 
http://myzopesite.com/workingdirectory/page-1.html, etc.


The pages are all accessible directly by those names, but by always 
going to index_html and returning the page via return 
container[next_page](context, request) I never see this part in 
the URL.




One possible work-around is to rename your python script, reformat 
your urls and use traverse_subpath to access the page to be 
displayed.  eg.  if you name your script 'displayPage', then you can 
have a url like:


http://myzopesite/workingdirectory/displayPage/page-1.html

the displayPage script will be invoked and it can then access 
REQUEST['traverse_subpath'] (which in the above case will contain 
'page-1.html').



hth

Jonathan


Erik,
I find your use case a bit strange.  Why would your users need to 
see different URLs?  Doesnt that pollute their browser's history list 
- and do you want them clicking some Page-nn from history?



I'm not too sure I understand the pollution reference...do you mean 
that it would make sense that an end user would only ever bookmark to 
the start of the survey, and not half way through?


I guess it's more for me and the designers then for end users.

After the user goes through the 30+ pages of survey questions, they are
presented with a summary page which basically shows all the 'Q's and 
'A's and their contact info on one big page Hi, JOE from CALGARY, you 
told us that your favourite colour is GREEN, your favourite fruit is a 
BANANA ... etc..


There are links beside each answer so that they can go back and change 
that answer before submitting the survey if they wish. So, they should 
have access to each and every page by name and they can jump around 
within the survey.





If you have users that will fill out 30+ pages of any survey I want your 
mailing list. :-)


Also, you might try a page legend?  I use stuff like that for large 
charts of accounts (no one wants to click  click click to get to even 
the middle of a page list)


I hope your project does well!

All best erik,
David


___
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] Session data

2006-09-09 Thread David H




Anton Y. Yakovlev wrote:

  
  
  Hi!
  
From Script (Python) object:
  
request.SESSION[ 'some_data' ] = some_data;
raise 'Redirect', context.some_script.absolute_url();
  
Why session object does not store data after redirect?
  
  
Hi Anton,

Google is bland on this, I don't use redirects. But I remember(?) that
redirects clear the request or is that just form vars?

In any case you could 

return context.some_script(context,context.REQUEST) insteasd of a
redirect raise thing u do
instead to see if you retain the session.

David


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


Re: [Zope] zope and sakai comparison

2006-09-08 Thread David H

David Bear wrote:


Our university has dump a lot of money into sakai. I don't know
anything about it but I wonder if someone has compared sakai with
zope?



 


I only say adopt a good web framework and make it yours ...

Zope is a good as it gets ... and I've never seen a smarter (so smart I 
feel below average :-) ) group that will help you than in the Zope 
community.


David

___
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] Need help tracing my application errors.

2006-09-07 Thread David H

Jose Carlos Balderas Alberico wrote:


Greetings.
 
I have a problem with an application we have hosted in Zope, and I 
thought you could give me a hand. Basically, my question is: what's 
the easiest way to trace errors raised by a python script that's part 
of the application?
 
This is the exact situation: I have to modify such application. It is 
a very big application, with a lot of python scripts, sql methods, 
etc... After testing it for the first time after the modification, 
nothing happens. By this I mean there is no error message, yet I know 
the application doesn't work right, since no data were inserted into 
the database.
 


Jose,

Sounds like you walked into a real beauty.

But your statement:  by this I mean there is no error message, yet I 
know the application doesnt work right, since no data were inserted into 
the database sounds more like a programming error and its unclear how 
logging will solve it (although anything is a start).


Could you give us a code fragments of the relevant parts?

a) the code fragment that calls zsql (assuming thats what is being called)
b) a print out of the request (just before the zsql is called unless 
you pass zsql params directly)

c) your zsql that is not adding records

You might as well also add your OS version and type, Zope version and 
which data adapter you are using. 

ps:  if any of your methods are *external* then changes will not show up 
in some cases (debugging on/off?) unless you update its external python 
link as well.


David





___
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] tal assignment

2006-09-07 Thread David H

David Bear wrote:


I wanted to assign a list object to a tal global variable but I can't
seem to find the correct syntax. I tried:

div tal:define=global mylist=['item1', 'item2'] 
tal:content=

blah
/div

but it doesn't like that syntax. Googling turns up thousands of items
that deal with tal but I can't see a simple example of assigning a
list object to a variable name.

 


Im not a tal expert but if you just put everthing inside of 
div tal:define=python: mylist=[...


/div

Your fine.


___
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] tal assignment

2006-09-07 Thread David H

David H wrote:


David Bear wrote:


I wanted to assign a list object to a tal global variable but I can't
seem to find the correct syntax. I tried:

div tal:define=global mylist=['item1', 'item2'] tal:content=
blah
/div

but it doesn't like that syntax. Googling turns up thousands of items
that deal with tal but I can't see a simple example of assigning a
list object to a variable name.

 


Im not a tal expert but if you just put everthing inside of 
div tal:define=python: mylist=[...


/div

Your fine.


ah heck
it should be:  div tal:define someName python: alist[like so] ...

/div

where someName is global inbetween the divs and the global modifier 
can be pointless.




___
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] Need Help--urgently

2006-09-06 Thread David H




Martijn Pieters wrote:

  cpdm cadlab wrote:
  
  
  thanks for the quick reply. I am glad to be here on active ZOPE
mailing list.

  
  
Let's keep it on the list then; no personal email please.

  
  
  I had initially done the way you have suggested, but it doesn't work
in the sense I get a empty list as output, which I know isn't empty.

  
  
Then something is wrong with the external method. Use a debugger (pdb,
Wing, Komodo, etc.) or spurious logging (import logger;
logger.getLogger('yourmodule').log) to trace your code.

  
  
This made me think that I was making silly mistake. If I run external
method in python shell it shows the mlist, which is non-empty, but if I
ask the same to python script to do what it prints is this : []
  What do you think is wrong. A further code goes like this:
mlist = context.code(uparam)
if len(mlist) == str(0):
print "Sorry no suitable method found in database"
return printed
else:
print mlist
return printed

  
  
Use "if not len(mlist):"; comparing the length to str(0) is always
false. "len" returns an integer, not a string, so 0 == '0' will never be
True.

You can also call the external method directly if you encode the
arguments passed to it in the query string. Just open up a python
propmt, import urllib and call urllib.quote on your argument list to
hand-construct a URL.

Moreover, get decent books on Python and on Web programming in general.

Martijn Pieters
  

Martijn,

I wonder which books would recommend? Best I can say is that books
just about HTTP are probably the least appreciated and often the most
useful.

David










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


Re: [Zope] zope 3 invisibility

2006-09-05 Thread David H




David H wrote:

  
Carlos de la Guardia wrote:
  Hello everyone,

I frequently blog about Zope, and recently posted a list of 10 reasons
why I think Zope 3 is kind of invisible to the Python community (see my
blog at http://blog.delaguardia.com.mx
). One of the things that I talk about in that post is that the
Zope community tends to interact more through its mailing lists than
its blogs, as opposed to other so-called modern frameworks, like Django
and Turbogears. 

I have been following the efforts of the Zope 3 developers and
sometimes wonder why this invisibility effect takes place. That's why I
decided to see if anyone on this list feels like commenting about this,
or any of my other 10 points. I am very interested in the dynamics of
the Zope community and the place of Zope in the larger Python
community, and would be very thankful for any comments, here or on the
blog. 

Thanks very much.

Carlos de la Guardia
  
My invisibility with Zope 3 is Zope 2. When I think of something Zope
2 is failing to provide I will try Zope 3 . I see Django and
Turbogears as "toys" by comparison
:-) 
  
David
  




___
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] iterating dictionaries with dtml-in

2006-09-03 Thread David H




Dieter Maurer wrote:

  Ferhat Ayaz wrote at 2006-9-2 04:40 -0700:
  
  
...
I want to do this with DTML.

select
dtml-in getDicts
option
HOW CAN I PUT the keys 'name' HERE 
/option
/dtml-in
/select
(getDicts returns the above list of dictionaries)

  
  
You probably need the "mapping" attribute of "dtml-in" -- and maybe some
background reading (you should read the documentation (Zope Book 2.7 edition,
online on plope.org).



  

Ferhat,

If you are new to Zope do yourself a favor and forget about DTML. Yeah
its fun and (seemingly) easy to learn. But I argue for Page Templates
+ python. Python is so much clearer than dtml - and Page Templates +
python *is* the favored zope paradigm.

But if you insist - Casey Duncan wrote a nice product (dtml-eval) and
an interesting discussion about DTML and what to watch out for ...

http://www.zope.org/Members/Kaivo/EvalTag_HowTo






___
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] Reportlab issue

2006-08-28 Thread David H




Dieter Maurer wrote:

  David H wrote at 2006-8-27 17:54 -0700:
  
  
...
I display an acrobat report (using Firefox or IE 6) and say scroll down 
to page 10.  I then use the browser back button to re-enter my Zope 
application.

Now, even if I click various unrelated pages in the application  
(clearing the request,etc) and then return to the Report (which is 
always freshly generated) it will try to re-display at page 10 - instead 
of top of page. 

  
  
It is unlikely that this is a server side problem.

To verify, check your "ZServer" log file (usually called "Z2.log").
It is likely that you need to configure it before Zope will
write it.

If configured, the log file will contain one entry (line) for
each completed request. This way, you can verify, whether
Zope see your report requests and how it responded.


If this (quite high) level of detail is not sufficient to
decide whether the problem is on client or server side,
you can use a TCP-logger (such as Shane's "tcpwatch") to
log the communication between client and server.
This will finally allow you to decide



  

Right Dieter and I really should have used these tools by now :-) 






___
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] Reportlab issue

2006-08-27 Thread David H

Jonathan wrote:



- Original Message - From: David H [EMAIL PROTECTED]
To: zope user list zope@zope.org
Sent: Sunday, August 27, 2006 8:54 PM
Subject: [Zope] Reportlab issue



Hi Zope List,

I have an Zope application that uses ReportLab to generate acrobat 
viewable reports. (I already posted this to reportlab list - so far 
no solutions).


Heres the problem:

I display an acrobat report (using Firefox or IE 6) and say scroll 
down to page 10.  I then use the browser back button to re-enter my 
Zope application.


Now, even if I click various unrelated pages in the application  
(clearing the request,etc) and then return to the Report (which is 
always freshly generated) it will try to re-display at page 10 - 
instead of top of page.
This occurs even if the data being reported has changed, and this 
occurs even if a different report is generated!


Note: that I use

import tempfile and
tmpFile2 = tempfile.mktemp()

to keep pdfPath's unique ...

I've tried combinations of Content-Disposition params like changing 
filename=, etc.  Nothing is changing this behavior.


I've tried (a reportlab mailing list suggestion) varying to forms 
action= like


  form name=printform method=post 
action=extensions/pyBudgetReports
tal:attributes=action python: 
'extensions/pyBudgetReports/?random=' + context.python.pyTime()


No help either.




I have never used ReportLab, but is there a possibility that when you 
go back to the adobe document it is being served from a cache?  You 
could try using html meta tags or response.setHeader (better) to make 
sure the document is not being served from the cache.


Just a shot in the dark!


Jonathan


Hi Jonathan,

Yes, I did try that, e.g. (report lab + external file stuff)
  # ---
  def writeReport(self, RESPONSE):
  # ---
 
   generates report output
 
self.save()
theFile=open( self.pdfpath,'rb')
result = theFile.read()
theFile.close()
os.remove(self.pdfpath)
# the next 3 lines were snarked from google zope no cache  I 
think its a casey duncan recipe ...

RESPONSE.setHeader('Pragma', 'no-cache')
RESPONSE.setHeader('Cache-Control','no-cache')
RESPONSE.setHeader('Expires', 'Sat, 1 Jan 2000 00:00:00 GMT')
# the normal fair
RESPONSE.setHeader('Content-Type','application/pdf')

RESPONSE.setHeader('Content-Disposition','inline;filename=reportNz.pdf')

RESPONSE.setHeader('Content-Length',len(result))
RESPONSE.write(result) # result is

And it didn't help. 


David


___
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] Reportlab issue

2006-08-27 Thread David H

Jonathan wrote:



- Original Message - From: David H [EMAIL PROTECTED]
To: Jonathan [EMAIL PROTECTED]
Cc: zope user list zope@zope.org
Sent: Sunday, August 27, 2006 9:25 PM
Subject: Re: [Zope] Reportlab issue



Jonathan wrote:



- Original Message - From: David H [EMAIL PROTECTED]
To: zope user list zope@zope.org
Sent: Sunday, August 27, 2006 8:54 PM
Subject: [Zope] Reportlab issue



Hi Zope List,

I have an Zope application that uses ReportLab to generate acrobat 
viewable reports. (I already posted this to reportlab list - so far 
no solutions).


Heres the problem:

I display an acrobat report (using Firefox or IE 6) and say scroll 
down to page 10.  I then use the browser back button to re-enter 
my Zope application.


Now, even if I click various unrelated pages in the application 
(clearing the request,etc) and then return to the Report (which is 
always freshly generated) it will try to re-display at page 10 - 
instead of top of page.
This occurs even if the data being reported has changed, and this 
occurs even if a different report is generated!


Note: that I use

import tempfile and
tmpFile2 = tempfile.mktemp()

to keep pdfPath's unique ...

I've tried combinations of Content-Disposition params like 
changing filename=, etc.  Nothing is changing this behavior.


I've tried (a reportlab mailing list suggestion) varying to forms 
action= like


  form name=printform method=post 
action=extensions/pyBudgetReports
tal:attributes=action python: 
'extensions/pyBudgetReports/?random=' + context.python.pyTime()


No help either.





I have never used ReportLab, but is there a possibility that when 
you go back to the adobe document it is being served from a cache?  
You could try using html meta tags or response.setHeader (better) to 
make sure the document is not being served from the cache.


Just a shot in the dark!


Jonathan


Hi Jonathan,

Yes, I did try that, e.g. (report lab + external file stuff)
  # ---
  def writeReport(self, RESPONSE):
  # ---
 
   generates report output
 
self.save()
theFile=open( self.pdfpath,'rb')
result = theFile.read()
theFile.close()
os.remove(self.pdfpath)
# the next 3 lines were snarked from google zope no cache  
I think its a casey duncan recipe ...

RESPONSE.setHeader('Pragma', 'no-cache')
RESPONSE.setHeader('Cache-Control','no-cache')
RESPONSE.setHeader('Expires', 'Sat, 1 Jan 2000 00:00:00 GMT')
# the normal fair
RESPONSE.setHeader('Content-Type','application/pdf')

RESPONSE.setHeader('Content-Disposition','inline;filename=reportNz.pdf') 


RESPONSE.setHeader('Content-Length',len(result))
RESPONSE.write(result) # result is

And it didn't help.



Another shot in the dark... could it be an adobe acrobat issue? By 
which i mean that adobe sees that you are looking at the same document 
(reportNz.pdf) and then tries to reopen the document at the last point 
you were looking.  Try randomizing the file name (add 2 or 3 random 
digits to the filename and see what happens).


Good luck!

Jonathan


Jonathan, 

We think alike.  If you scan my original msg you'll see that I tested 
varying the Content-Dispostion ...  report= name as well.


Im sure if it were a snake i'd be bitten by now.

David

___
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] Reportlab issue

2006-08-27 Thread David H

Jonathan wrote:



- Original Message - From: David H [EMAIL PROTECTED]
To: zope user list zope@zope.org
Sent: Sunday, August 27, 2006 9:48 PM
Subject: Re: [Zope] Reportlab issue



Jonathan wrote:



- Original Message - From: David H [EMAIL PROTECTED]
To: Jonathan [EMAIL PROTECTED]
Cc: zope user list zope@zope.org
Sent: Sunday, August 27, 2006 9:25 PM
Subject: Re: [Zope] Reportlab issue



Jonathan wrote:



- Original Message - From: David H [EMAIL PROTECTED]
To: zope user list zope@zope.org
Sent: Sunday, August 27, 2006 8:54 PM
Subject: [Zope] Reportlab issue



Hi Zope List,

I have an Zope application that uses ReportLab to generate 
acrobat viewable reports. (I already posted this to reportlab 
list - so far no solutions).


Heres the problem:

I display an acrobat report (using Firefox or IE 6) and say 
scroll down to page 10.  I then use the browser back button to 
re-enter my Zope application.


Now, even if I click various unrelated pages in the application 
(clearing the request,etc) and then return to the Report (which 
is always freshly generated) it will try to re-display at page 10 
- instead of top of page.
This occurs even if the data being reported has changed, and this 
occurs even if a different report is generated!


Note: that I use

import tempfile and
tmpFile2 = tempfile.mktemp()

to keep pdfPath's unique ...

I've tried combinations of Content-Disposition params like 
changing filename=, etc.  Nothing is changing this behavior.


I've tried (a reportlab mailing list suggestion) varying to 
forms action= like


  form name=printform method=post 
action=extensions/pyBudgetReports
tal:attributes=action python: 
'extensions/pyBudgetReports/?random=' + context.python.pyTime()


No help either.






I have never used ReportLab, but is there a possibility that when 
you go back to the adobe document it is being served from a 
cache?  You could try using html meta tags or response.setHeader 
(better) to make sure the document is not being served from the 
cache.


Just a shot in the dark!


Jonathan


Hi Jonathan,

Yes, I did try that, e.g. (report lab + external file stuff)
  # ---
  def writeReport(self, RESPONSE):
  # ---
 
   generates report output
 
self.save()
theFile=open( self.pdfpath,'rb')
result = theFile.read()
theFile.close()
os.remove(self.pdfpath)
# the next 3 lines were snarked from google zope no 
cache  I think its a casey duncan recipe ...

RESPONSE.setHeader('Pragma', 'no-cache')
RESPONSE.setHeader('Cache-Control','no-cache')
RESPONSE.setHeader('Expires', 'Sat, 1 Jan 2000 00:00:00 GMT')
# the normal fair
RESPONSE.setHeader('Content-Type','application/pdf')

RESPONSE.setHeader('Content-Disposition','inline;filename=reportNz.pdf') 


RESPONSE.setHeader('Content-Length',len(result))
RESPONSE.write(result) # result is

And it didn't help.




Another shot in the dark... could it be an adobe acrobat issue? By 
which i mean that adobe sees that you are looking at the same 
document (reportNz.pdf) and then tries to reopen the document at the 
last point you were looking.  Try randomizing the file name (add 2 
or 3 random digits to the filename and see what happens).


Good luck!

Jonathan



Jonathan,
We think alike.  If you scan my original msg you'll see that I tested 
varying the Content-Dispostion ...  report= name as well.




Sorry, i missed that in your original post.  I'm all out of 
shots-in-the-dark!  Have you tried seeking help on the adobe acrobat 
developer lists?



Jonathan


I think I'll slaughter a chicken at midnite!

I'll wander off to adobe land ...

David

___
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] MailBoxer Question

2006-08-23 Thread David H




Philip Kilner wrote:

  Hi,

beno wrote:
  
  
Apache duplicates 95% of what Zope's server does, so if you're only
using Zope, then it's un-elegant to use Apache.

  
  
Not so - Apache is a mature production web server, Zope is an
application server that serves over HTTP, but it's HTTP server is *not*
designed for production use.

  
  
the rewrite rules you have to throw at Apache are awkward

  
  
You may think so, but they are the supported, documented solution: -

http://www.plope.com/Books/2_7Edition/VirtualHosting.stx

  
  
Zope can't handle cgi
scirpts

  
  
That is because Zope is an application server, not a web server.

  
  
I find the tokens "yourMailHost"
and "yourDomain" terribly unclear.


  
  
I simply don't understand that. It's off topic, but here goes: -

My domain is "xfr.co.uk", and I have a mail host called "smtp" (because
that is what it serves). So, the token "yourMailHost" refers to the mail
host name and the "yourDomain" refers to the domain name, so to send me
mail, you make an SMTP connection to "smtp.xfr.co.uk".

What's the problem?


  


hang in there beno. You've been baptised. 


david






___
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] Content-Disposition is driving me batty

2006-08-17 Thread David H

Andreas Jung wrote:




--On 16. August 2006 17:28:00 -0500 Kirk Strauser [EMAIL PROTECTED] 
wrote:



I have a Python script that transmits a file to the user.  An excerpt:

if not skipctypeheader:
# Set the content type if one is defined for the file
ctype = file.getProperty('content_type', d=None)
if ctype:
RESPONSE.setHeader('Content-Type', ctype)

RESPONSE.setHeader('Content-Disposition', 'inline; filename=%s' %
filename)



I remember having had similar problems with IE and downloading files. 
In general we use only content-disposition: attachment for IE vs. 
content-disposition: inline for all other browsers. After that change 
we haven't had

any bug reports from IE users.

-aj


I had similar problems too.  This seems to work with IE:
theFile=open( self.pdfpath,'rb')
result = theFile.read()

RESPONSE.setHeader('Content-Type','application/pdf')
RESPONSE.setHeader(Content-Disposition,filename=report.pdf)
RESPONSE.setHeader('Content-Length',len(result))
RESPONSE.write(result)

David

___
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] new user, teething problems

2006-08-03 Thread David H

John P. Looney wrote:



 Hey, I've made my first page, though it's not working as I'd like. 
This is the contents of the page:


html
title testing/title
 Going ! basdasda /b br
dtml-var date fmt=Datebr
/html

 But, the error logs show that it's not happy...

 Traceback (most recent call last):
  File 
/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/publisher/publish.py, 
line 138, in publish

result = publication.callObject(request, object)
  File 
/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/app/publication/zopepublication.py, 
line 161, in callObject

return mapply(ob, request.getPositionalArguments (), request)
  File 
/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/publisher/publish.py, 
line 113, in mapply

return debug_call(object, args)
  File 
/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/publisher/publish.py, 
line 119, in debug_call

return object(*args)
  File 
/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/app/dtmlpage/browser.py, 
line 26, in index

return template.render(REQUEST, **kw)
  File /tmp/Zope-3.2.1/build/lib.linux- 
i686-2.4/zope/app/dtmlpage/dtmlpage.py, line 49, in render

return self.template(self.__parent__, request, REQUEST=request, **kw)
  File 
/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/documenttemplate/untrusted/untrusted.py, 
line 66, in __call__

ProxyFactory(mapping),
  File 
/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/documenttemplate/dt_string.py, 
line 484, in __call__

result = render_blocks(self._v_blocks, md)
  File /tmp/Zope- 
3.2.1/build/lib.linux-i686-2.4/zope/documenttemplate/pdocumenttemplate.py, 
line 322, in render_blocks

section = section(md)
  File 
/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/documenttemplate/dt_var.py, 
line 207, in render

raise KeyError(name)
KeyError: u'date'

 Any idea what I could be doing wrong ? No dtml tag I use seems to 
work - all throw an error.


John


Where is date defined? 
If the answer is nowhere you really need to read the zope book. If its 
somewhere then include that code as well (pertinent parts).

Best luck,
David

___
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] FW: TSU license exception

2006-08-02 Thread David H

Andreas Jung wrote:




--On 2. August 2006 16:46:43 +0200 Kowalski, Piotr 
[EMAIL PROTECTED] wrote:





Hi.
Im looking for informations about TSU for Zope.  Does somebody have  a
license exception  TSU for Zope?



TSU?

-aj



(TSU) Technology and software unrestricted

This would ease us to export our product signifiicantly - otherwise
we´re unable to deploy our stuff to a lot of countries.



No idea what that means but the Zope Public License is license that 
allows you to do almost everything with Zope you want (easily said). 
Isn't that sufficient...you might contact Zope Corporation for such 
legal issues.


-aj


Didn't Sun Tsu write the Art of Zope?

:-)

___
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] button to submit with several parameters and call python script

2006-08-01 Thread David H

Alan wrote:


Hi Dears,

I am looking for ideas of how to use a submitting button to pass
several parameters to a python script.

I have googled but I found different solutions not really appropriate
to my case I guess.

I was trying something like this:

 form action=do_status.py method=POST
  input type=hidden name=jname:string
  input type=hidden name=juser:string
  input type=submit value=Submit
 /form

Then I defined my do_status.py with parameters jname, juser


print jname, juser
return printed




Try print context.REQUEST.get('jname','???')


and nothing is printed.


David

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Can't nest dtml-in using prefix ...

2006-07-28 Thread David H

Jesper Steen Steffensen wrote:


This won't work:

dtml-in qry_user_roles prefix=outer
  dtml-in qry_roles
  dtml-if expr=outer_role==role
Roles are matching
  /dtml-if
  /dtml-in
/dtml-in

I get an error that says key error - outer_role doesn't exist.
It doesn't matter if I prefix the inner dtml-in as well. (I've read it 
isn't necessary though)

Why won't the prefix work for me?


Give more info.  Define qry_user_roles and qry_roles as part of your 
question.


Why are you using DTML?  Its a *dying art*.  I can hardly look at it 
anymore :-)


DTML is depreciated in Zope (I think) and new people should go right to 
Page Templates and Python Scripts (Im sure).

Can you code this in a Python Script?

David


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Can't nest dtml-in using prefix ...

2006-07-28 Thread David H




Jesper Steen Steffensen wrote:

  
  Give
more info.Define qry_user_roles and qry_roles as part of your

question.

Why are you using DTML?Its a *dying art*.I can hardly look at it
anymore :-)

DTML is depreciated in Zope (I think) and new people should go right to
Page Templates and Python Scripts (Im sure).

Can you code this in a Python Script?

David


  
  
qry_user_roles and qry_roles are two ZSQL methods that both contain
data fields called 'role'. They both work fine on my pages apart from
the nesting. One qry holds all possible roles in the system - the other
one associates roles to users. I need the dtml-if to insert the word
"selected" in a html drop-down box, so that the users role will be
selected when the drop-down box displays:
  
  
This will iterate over the roles and build the drop-down box:
  
select
dtml-in qry_roles
optiondtml-var role/option
/dtml-in
/select
  
This should display the proper value as well: 
  
select
dtml-in qry_roles prefix="outer"
option
  
 dtml-in qry_users_roles
 dtml-if expr="outer_role==role"
 selected
 /dtml-if
 /dtml-in
  
dtml-var role/option
  
/dtml-in
/select
  
I'm 1 month into Zope now, so this is just what I've read from the Zope
bible/ web etc. so far ...
  
Is dtml really dead?!? :-o
Shame - I like it.. Will read more about page templates then ;-)
  

Hi Jesper,

I guess Jonathan does have a point. DTML is NOT DEAD as in NOT
BREATHING. And its true that Zope will continue DTML well into Zope 3.

But its expertise "base" is fading. I last used it 2 years ago. Many
of us just don't use it anymore. 

Most still use it because of legacy code. 

I don't think Jonathan would recommend it to a newbie? :-) 

Python + zpt is a clearer model. 

Here is some code to consider if you want to try the Page Template +
python way ...

# 
# The python way (untested)
# 

outer = context.SQL.qry_user_roles()
inner = context.SQL.qry_roles()
options = ''
for o in outer:
 for i in inner:
 if o.role == i.role:
 options += '\noption value="' + i.role + '"' + i.role
+ '/option'

return 'select' + options + '/select'

# 
# in ZPT
# 

tal:sel tal:replace="structure
python:context.python.pyRolesSelect()"
/tal:sel


I will say that learning Page Templates will give you fits for a week
or two. But stick with it. 

David







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


Re: [Zope] how to use chinese character in zope 2.8.7

2006-07-27 Thread David H




Chris Withers wrote:

  Mark Barratt wrote:
  
  
2: In the root of the Zope Management Interface, choose the properties
tab. In it, add a new property called MANAGEMENT_PAGE_CHARSET of type
'string' with value utf-8.

  
  
Actually, for hysterical raisins, this needs to be UTF-8 rather than
utf-8 in order for the unicode property types to make themselves apparent.

Aside from this, use unicode for everything...

cheers,

Chris

  

Chris,
Just a correction: hysterical raisins are grapes.

 :-) 


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


Re: [Zope] how to use chinese character in zope 2.8.7

2006-07-27 Thread David H

Andrew Milton wrote:


+---[ David H ]--
| Chris Withers wrote:
|
| Actually, for hysterical raisins, this needs to be UTF-8 rather than
| utf-8 in order for the unicode property types to make themselves apparent.
|
| Chris,
| Just a correction:  hysterical raisins are grapes.

Q: What's green and commutes?
A: An abelian grape.

Sorry Maths Geek Humour d8)

 


The grapes of math?  Ok this has to stop.


___
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] Newbie: Missing a Variable (TAL/METAL Question)

2006-07-26 Thread David H




beno - wrote:

  Hi;
  I have the following block of code:
  
  table tal:define="objects here/objectValues;
 sort_on python:(('title', 'nocase', 'asc'),
 ('bobobase_modification_time',
'cmp', 'desc'));
 sorted_objects python:sequence.sort(objects,
sort_on);
 start python:getattr(request, 'start', 0);
 batch
python:modules['ZTUtils'].Batch(sorted_objects, size=10, start=start);
 previous python:batch.previous;
 next python:batch.next"
 tr tal:repeat="item batch"
 td tal:content="item/title"title/td
 td tal:content="item/bobobase_modification_time"
 modification date/td
 td tal:content="here/author"author/td
 td tal:content="here/content"content/td
 /tr
/table
  
  that works fine. But I'd like to call the following in that
table:
  
  tdtal:content
metal:use-macro="here/XXX/macros/author"/tal:content/td
  
  where "XXX" is the "item" that changes each time a new item from
the batch is called. In other words, there is a folder with a "batch"
of files, and each file is an "item". So, since the files' titles are
simply sequential numbers, it would look something like this:
  
  tdtal:content
metal:use-macro="here/1/macros/author"/tal:content/td
tdtal:content
metal:use-macro="here/2/macros/author"/tal:content/td
tdtal:content
metal:use-macro="here/3/macros/author"/tal:content/td
...

How do I do that? Even better, is it possible to just open up each file
and read its contents??

  Thanks,
  Ben
   
  

Ben,
First this is wrong:

tdtal:content ...

If should be
td tal:content ...

But that may be wrong in the context you've given. 

Since "do it in python" has been a theme lately, you can also return a
macro from a python script like so:

Where there is an author might be a parameter.
#some python script
#
 return container.YourMacroFolder.someMacro[ author ]
---

And in your ZPT: (where result.author is just a stub for whatever your
using)

tdspan metal:use-macro="python:
context.youPythonScript(result.author)"macro goes
here/span/td

I suggest *always* doing stuff in python when things are not clear.
Then code back into your Page Templates, if desired

DAvid








___
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] Win32com?

2006-07-25 Thread David H




Garrett DeHoyos wrote:
Is there a way to use win32com in Python scripts in Zope?
  


By using it in External Scripts. If you want to know more be more
specific. Like "what do you want to do?".







___
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] variable propagation

2006-07-24 Thread David H

Pavel Zaitsev wrote:


Hi,
I would like to ask how to propagate variables from initial index_html
call to deeper levels. Say I have index_html python script, I invoke it
then I would like to feed some data to generic template, that will in
turn will invoke template in the same directory that will do nice layout
of my results. Generic template lies below all other objects, in
directory tree, in the root.
When I execute the command chain, variables are not passed and options
is lost on one layer of zpt calls. Is there way to rectify that.
Thanks
Pavel

 


Pavel,

You question is a bit vague but ...

Make your index_html a python script.  And then stuff your REQUEST with 
info you want


Then just call the Page Template ...

request.set('formvar1', somevalue)
return context.myPageTemplate(context.request)

Of course of you have forms submit with an action=. and method=post.

Then you can intercept all calls using index_html, do what you need to 
do and *then* render the next form.


David



___
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] variable propagation

2006-07-24 Thread David H




Pavel Zaitsev wrote:

  В Пнд, 24/07/2006 в 15:00 -0700, David H пишет
  
  
Pavel,

You question is a bit vague but ...

Make your index_html a python script.  And then stuff your REQUEST with 
info you want

Then just call the Page Template ...

request.set('formvar1', somevalue)
return context.myPageTemplate(context.request)

Of course of you have forms submit with an action="" and method="post".

Then you can intercept all calls using index_html, do what you need to 
do and *then* render the next form.

  
  
here is description:

root/
	index_html
	index_tmpl -- invokes here.content_html
 
root/some/web/page
	index_html  -- overriding root one, calls --   context.index_tmpl(some
parameters=some parameters).
	content_html -- gets called from index_tmpl

So i want parameters that are presented to index_html be presented to
context_html just like they would be presented to index_html.
So i would be able to call context_html from outside as well from the
inside. Ie span tal:replace="username"/ should work in both
cases. I thought thats the way zope's code reuse works.
Thanks
Pavel

  

Pavel,

How are you invoking templates?  Give code snippets.  

Have you read the "Advanced Scripting" section in the Zope book? 
Plope.com has a the latest version (i think).



David






___
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] ExternalFile - getting back the file

2006-07-19 Thread David H

[EMAIL PROTECTED] wrote:


Hi  :-)

I'm using the ExternalFile product:

http://www.zope.org/Members/arielpartners/ExternalFile

because I need to have a file both in ZMI, as well as in filesystem.

I would like to ask if anyone can tell me how to get back the file that
ExternalFile was created from, having only the object? In fact I do not need
the file itself, but tha data (bytes) that were inside.

I would be very grateful for any help.

Best regards,
Maciej Zieba 





 

a) why do you need access to *both* the file system *and* the ZMI for 
the same object?  (because ExternalFile (says) the external files appear 
as objects in the ZMI)
b) You want to get back the file that ExternalFile was created from, 
having only the object?  Can you explain that?  Sounds like Freud would 
be interested.


David



___
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] Script execute with every request

2006-07-18 Thread David H




Joshua Burvill wrote:

  
  
  
  
  Hi,
   
  I’d like to log
certain parts of
each request into a database table for every request to provide an
audit trail.
   
  I thought of
inserting a
dtml-call  xxx into the standard_html_header, but when there is
a
RESPONSE.redirect, it will not be the original request that gets logged.
   
  Can anyone offer
any suggestions?
   
  Thanks, Josh
  
  

Dieter wrote this 

http://www.dieter.handshake.de/pyprojects/zope/emulateRedirect.py

Maybe that helps. 


___
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] cant log in as admin

2006-07-18 Thread David H




Noah wrote:

  
  zope-2.8.8
freebsd-4.11
  
  
okay I've followed the directions on the zope website, in the PDF, and
the Zope/doc docs. Could not really find the proper cure.

Then I made an instance and placed it in /usr/local/www/Zope 
  
Started zope and the username and password does not work. 
  
there is an entry in Z2.log everytime I go to the link and everytime
  
What am I doing wrong?
  
the Zope/inituser is where I thought things should authenticate?
  
Anyways I must really be missing something.
  
cheers,
  
Noah
  
  
You tried this?
http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/Security.stx

See the section on emergency user. 


___
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] Creating and displaying lists

2006-07-13 Thread David H




[EMAIL PROTECTED] wrote:


  Hi,
  
  I need to collect a list of student id numbers from one table so
I can take this list, find them in another table, and display their
names so their teachers can give them a score.
  
  I still like to use DTML but I do not know if I have the
sequence-number in the proper format. This is what I have been playing
with:
  
  dtml-call "REQUEST.set('RECORD_ID',
REQUEST.SESSION['RECORD_ID'])"
dtml-in lookup_students_in_course
 dtml-call "REQUEST.set('student_id_temp', student_id)"
/dtml-in
  dtml-in expr="_.range(sequence-number)"
 dtml-call "REQUEST.set('student_id_temp', student_id_temp)"
SELECT NAME="student_id_selected"
 option value=""/option
dtml-in lookup_student_name sort=student_last_name
 OPTION VALUE="dtml-var student_id"
 dtml-var student_last_name, dtml-var
student_first_name 
 /OPTION
/dtml-in
/SELECT
/dtml-in
  
  I am having a hard time find reference material on this.
  
  Thanks,
  
  Larry

Larry,

I have an idea for you. Rewrite in python. Its easy to return a html
select structure from a python scripts and python scripts are
so much easier to think thru than dtml. 

Then from your dtml (if i recall) you'd just dtml-var
expr="yourPython()". From tal use include the "structure" key word
like:
span tal:content="structure python:context.yourPython(params=
...) 

If you get stuck re-ask (but give your version in python code) :-) 

David



___
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] Viewing images from a form upload

2006-07-11 Thread David H

vl wrote:

I am stuck on trying to preview images that are uploaded from a html 
form.


form method=POST action=py_save_new_image 
enctype=multipart/form-data

input type=file  name=file
input type=submit name=save value=Upload

When the form is submited it sends it to a python script that gets the 
image and sends it to another page to be previewed.  Problem is, I 
receive and error that the image cannot be displayed.


My python script is below.
REQUEST=context.REQUEST
content_type=file.headers['Content-Type']
if content_type.find('image')!=-1:
context.REQUEST.RESPONSE.setHeader('Content-Type', 'image/jpg')
img = file.read()
print context.dtml_select_new_image(context, context.REQUEST, 
image=img)

return printed
else:
return error

I load the image in a dtml method with:
dtml-var image
___


Vi,

Your kind of vague but one thing i'd change is:

 print context.dtml_select_new_image(context, context.REQUEST, image=img)
to
 return context.dtml_select_new_image(context, context.REQUEST, image=img)

David


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope 2.7 installation on SuSE 10.0 - unable to find startup script

2006-07-10 Thread David H

TR wrote:

This is rather bizarre, but I'm unable to determine what script to run to 
start my Zope instance. I installed 2.7.7-3, which comes with the distro, and 
ran mkzopeinstance.py, which terminated without errors after asking for the 
instance home and site admin id/password.


Isn't there supposed to be a startzope.py somewhere? The closest thing I could 
find was the following:


[/opt/zope/lib/python/Zope/App]  python startup.py
Traceback (most recent call last):
 File startup.py, line 16, in ?
   from AccessControl.SecurityManagement import getSecurityManager
ImportError: No module named AccessControl.SecurityManagement

Even wierder, my installation contains an AccessControl.SecuritySuite package 
with a SecurityBase module - no SecurityManager.


Can anyone shed some light, here?

-Tom Russell
___
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 )

 


TR,

I wouldnt use distros.  Download zope directly from zope.org.  While 
your at it get your python from python.org.  Don't rely on zope distros.


Oh and you start zope with zope-instance/bin/zopectl start




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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope 2.9.3/2.9.1 On Suse 10.1 box version

2006-07-08 Thread David H




Ofer Weisglass wrote:

  yes, it fixed the problem but now I have this error
it seems like user premission problem but I don't know how to solve it


/home/ofer/zope1/bin/runzope -X debug-mode=on
/home/usr/zopeplone/lib/python/ZServer/utils.py:33: DeprecationWarning:
The zLOG package is deprecated and will be removed in Zope 2.11. Use the
Python logging module instead.
  LOG('ZServer', severity[type], message)
2006-07-09 00:16:23 INFO ZServer HTTP server started at Sun Jul  9
00:16:23 2006
Hostname: 0.0.0.0
Port: 8080
2006-07-09 00:16:23 CRITICAL Zope A user was not specified to setuid to;
fix this to start as root (change the effective-user directive in
zope.conf)
Traceback (most recent call last):
  File "/home/usr/zopeplone/lib/python/Zope2/Startup/run.py", line 56, in ?
run()
  File "/home/usr/zopeplone/lib/python/Zope2/Startup/run.py", line 21, in run
starter.prepare()
  File "/home/usr/zopeplone/lib/python/Zope2/Startup/__init__.py", line
94, in prepare
self.dropPrivileges()
  File "/home/usr/zopeplone/lib/python/Zope2/Startup/__init__.py", line
213, in dropPrivileges
return dropPrivileges(self.cfg)
  File "/home/usr/zopeplone/lib/python/Zope2/Startup/__init__.py", line
382, in dropPrivileges
raise ZConfig.ConfigurationError(msg)
ZConfig.ConfigurationError: A user was not specified to setuid to; fix
this to start as root (change the effective-user directive in zope.conf)


  
  

--On 24. Juni 2006 23:09:00 +0300 Ofer Weisglass [EMAIL PROTECTED]
wrote:



  Hi

I am trying to install Zope 2.9.3 or 2.9.1 on Suse 10.1 and this is what
I
get:

error: must supply either home or prefix/exec-prefix -- not both
make: *** [install] Error 1

Any ideas what to do?

  

Please try again with a Python source build. Usually we don't care much
about system Python installation that are often broken in different ways.

-aj

  
  

Maybe this can help?

This is from either Plope or Plone site (i think I snipped it long ago):

If you are running everything as root, you will get an instance that
cannot be started, because a different effective user id is required
for it to change to. Even if you create an account after the fact, that
user cannot start zope because it doesn't have access to any of the
instance files.

The best way to run mkzopeinstance is to first su to another user (su
zope) and then run mkzopeinstance.py. The zope user must have write
access to create the directory. 

EFFECTIVE-USER
After the instance is created, edit "effective-user zope" into the
etc/zope.conf, so if you start it as root later it should su itself to
the non-root user.


David



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


Re: [Zope] Zope installation woes

2006-07-05 Thread David H

russ wrote:


O.k. thanks,

There are a number of lines like this:

mailman   2485  2468  2485  01 Jun29 ?00:00:00
/usr/bin/python2.4 /u

...and a few like this:

root 12796 11967 12796  01 13:10 pts/100:00:00 /usr/bin/python
/usr/

I can't see anything relating to zope specifically  running the zopect1
command results in this:

[EMAIL PROTECTED] [/usr/local/zope/instance3/bin]#
/usr/local/zope/instance3/bin/zopect1 fg
-bash: /usr/local/zope/instance3/bin/zopect1: No such file or directory

 


Hi russ, change zopect1 to zopectl :-)

David
___
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] Trying to trap ConflictError

2006-07-05 Thread David H

Jonathan wrote:



- Original Message - From: [EMAIL PROTECTED]
To: Jonathan [EMAIL PROTECTED]
Cc: Dennis Allison [EMAIL PROTECTED]; zope@zope.org
Sent: Wednesday, July 05, 2006 2:28 PM
Subject: Re: [Zope] Trying to trap ConflictError



Jonathan wrote at 2006-7-4 13:46 -0400:


...
The image objects stored in
TemporaryStorage are never overwritten, edited etc (which is causing 
me some

confusion as to why the conflict errors are occurring)



The error message tells your that the conflict is not caused by
the modification of the image but the container holding your image.

BTreeFolder already do conflict resolution -- and reduce the
conflict probability by about a factor of 30 to 100 (depending on type).

However, if several threads should try to add elements with the same
id, then the conflict resolution cannot work.
Maybe, that happens in your case?



The id for the image object is generated by the following code:

def MakeId():
  time.sleep(.01)
  ts = string.replace(str(time.time()),'.', '')   # remove floating 
point '.' char

  return ts[-10:]

So there should not be any collision of ids.

I am still investing, and have found errors like:


Jonathan,

I wouldn't feel safe with that.  Why not append a few random digits just 
to be safe?


David
___
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] Trying to trap ConflictError

2006-07-05 Thread David H

Jonathan wrote:



- Original Message - From: David H [EMAIL PROTECTED]
To: Jonathan [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; zope@zope.org
Sent: Wednesday, July 05, 2006 3:00 PM
Subject: Re: [Zope] Trying to trap ConflictError



Jonathan wrote:



- Original Message - From: [EMAIL PROTECTED]
To: Jonathan [EMAIL PROTECTED]
Cc: Dennis Allison [EMAIL PROTECTED]; zope@zope.org
Sent: Wednesday, July 05, 2006 2:28 PM
Subject: Re: [Zope] Trying to trap ConflictError



Jonathan wrote at 2006-7-4 13:46 -0400:


...
The image objects stored in
TemporaryStorage are never overwritten, edited etc (which is 
causing me some

confusion as to why the conflict errors are occurring)




The error message tells your that the conflict is not caused by
the modification of the image but the container holding your image.

BTreeFolder already do conflict resolution -- and reduce the
conflict probability by about a factor of 30 to 100 (depending on 
type).


However, if several threads should try to add elements with the same
id, then the conflict resolution cannot work.
Maybe, that happens in your case?




The id for the image object is generated by the following code:

def MakeId():
  time.sleep(.01)
  ts = string.replace(str(time.time()),'.', '')   # remove floating 
point '.' char

  return ts[-10:]

So there should not be any collision of ids.

I am still investing, and have found errors like:


Jonathan,

I wouldn't feel safe with that.  Why not append a few random digits 
just to be safe?



I am relatively new to python, so if there is something problematic 
with my use of the time module to create unique ids, please let me 
know! (just adding random digits seems a bit kludgy?!)


Thanks,

Jonathan


Hi Jonathan,

I figured that if conflicts occur because mutliple processes are 
requesting some service at the same time +- delta then simply generating 
a file name based on the time was suspect. 


David


David





___
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] Improved Zope Org Proposal

2006-06-27 Thread David H

Chris Withers wrote:


David H wrote:

This is sounding more bizzare with each day and it doesnt feel good.  
Zope cant maintain a friggin web site?  Isnt that rich.



Hey David,

Cool, thanks so much for volunteering to provide all the resources, 
coders and support staff to look after a 10,000 user site with all the 
problems that entails.


Oh? What's that? You weren't volunteering?

Then stfu ;-)

Chris


LOL yeah ok.

___
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] Improved Zope Org Proposal

2006-06-26 Thread David H

Lennart Regebro wrote:


On 6/26/06, Dieter Maurer [EMAIL PROTECTED] wrote:


I would prefer a single big site as an access point to the most
relevant information. But, if this is not possible...



Single big site is probably not possible. We have tried and failed.
But having a small focused site that works as the nave and center of
several small focused site, that should be possible.


Sorry Lennart but ...

This is sounding more bizzare with each day and it doesnt feel good.  
Zope cant maintain a friggin web site?  Isnt that rich.


David

___
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] Improved Zope Org Proposal

2006-06-25 Thread David H




Andrew Sawyers wrote:

  On Sun, 2006-06-25 at 21:41 +0200, Dieter Maurer wrote:
  
  
Then I fear few interesting content will arrive at this site.


  
  Well, I think the content of this site is what I'd noted is what I noted
in earlier emails.  It might not be 'interesting', but I would hope it
to be quality and focused.  I have faith the 'interesting' aspects you
wish will come from the community.

  
  
We use Plone.org's infrastructure. When I remember right,
we have membership there and this membership contributes
a good deal of valuable content (software, howtos, faqs).

  
  We have failed at managing the breadth of content and properly
presenting it to potential and exisitng Zope users.  Maybe that
sub-community has not.
  
  
Why should it be different for Zope.org?

  
  Because it has not shown it can rise to the occasion.  Outside our
community this might not be so obvious, but referring new co-workers to
zope.org when they inquire as to the technology I bring to the table at
work, is an embarrassment.

I think my position is pretty clear.  It's up to the Foundation
ultimately.  I was asked to get the proposal out.  I've provided my
view.  The rest will become history.  :)

Andrew

  
  



  
  

Everyone has a point.

Zope is WAY too cool not to have a great web presence. But we need a
TEAM LEADER on this.

I can pitch in and I know others will as well ...

David



___
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] No joy on 8080.

2006-06-25 Thread David H

[EMAIL PROTECTED] wrote:


Do you see anything in your logs?

- Original Message - From: Ignacio Valdes [EMAIL PROTECTED]
To: thomas desvenain [EMAIL PROTECTED]; zope@zope.org
Sent: Sunday, June 25, 2006 7:18 PM
Subject: Re: [Zope] No joy on 8080.


Thanks, effective-user is zope and it appears to own the directories 
pertaining to zope. I restarted it using /etc/rc.d/init.d/zope 
restart but I still don't get anything on 8080. -- IV


On Mon, 26 Jun 2006 01:01:24 +0200
 thomas desvenain [EMAIL PROTECTED] wrote:

i had this problem : i forgot giving to zope server's 
effective-user the

rights on zope instance directory

(effective-user name is defined in zopeinstance/etc/zope.conf)

2006/6/26, Ignacio Valdes [EMAIL PROTECTED]:



Hello all,

I installed Zope on Fedora Core 5 using yum install zope, I opened
port 8080 with lokkit, then I started it up using zopectl start. This
is all on a headless server by ssh so I can't check
http://localhost:8080 but http://server ip address:8080 on my browser
doesn't work. I do have xampp apache running as well and can get the
xampp welcome screen to appear but with xampp apache started or
stopped http://server ip address:8080 doesn't do anything. I'm baffled
as to what to do next. What should I try?

Thanks!

-- IV




Maybe ...

chown -R your user name (not as root!)  /your/zope-instance

If that doesnt work you might review these 2 zope install write ups:

http://www.plope.com/Books/2_7Edition/InstallingZope.stx#2-6

x http://plone.org/documentation/how-to/setup-from-source

David



___
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] dictionary from sequence-item

2006-06-19 Thread David H




Alric Aneron wrote:
Hello,
I am looping through a list of dictionary objects using dtml-in...
and within the dtml-in body I have:
dtml-var "_.getitem('sequence-item')['titled']" missing="none"
Some of the dictionaries in the list don't have 'titled' key so it
should replace it with the word "none", but it gives me an error
  Error Type: KeyError
  Error Value: 'titled'
   I don't understand. Another option is that I can use
dtml-if "_.getitem('sequence-item').has_key('titled')" but it
doesn't work, says has_key is an unknown attribute. This is the
stupidest thing ever! it's a dictionary object!
I try to typecast it using the
dict(_.getitem('sequence-item')).has_key('titled') it gives me an error
saying it can't typecast, but I am 100% sure it's a dictionary object
because I can access it easily _.getitem('sequence-item')['titled'] for
those that have that key.
  
Any idea how I can check if the titled key is in the dictionary for the
current list item?
  
Thanks in advance guys!
   
  
Alric,

Your earlier post indicated that your DTML obtains the sequence of
dictionaries from a python script - and *then* tries to filter it and
process it. 

Why not do your filtering, e.g. appending only thoses values that have
a key == 'key1' in your python script first? Thats why "god" invented
python scripts :-) .

And as Jonathan indicated, you should also simplify the list returned.
I would just return a list of filtered values, e.g.

# ---
# python script (based on your earlier message)
# ---

# DTML call to this script can pass these as parameters or obtain them
from the request ...
mydict = {'key1': 'value1', 'key2': 'value2'}
mydict2 = {'key1': 'value3', 'key2': 'value4'}
desired_key = 'key1'

#results bucket
finalList = []
for dict in (mydict,mydict2): # we avoid returning list of
dictionaries which can be awkward in DTML
 for k in dict.keys():
 if k == desired_key: # --- filter it here so DTML
doesn't have to
 finalList.append( dict[ k ] )

return finalList

Now your DTML is simple. 

David






___
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] Basic Template question : 'truthiness'

2006-06-11 Thread David H

Mark Gibson wrote:

I thought I knew how this stuff worked, but this has gotten me banging 
my head against a wall.


I'm trying to evaluate a condition expression, and I'm not getting 
what I expect when using path, and I get a different result when using 
python.  The following expressions


results=span tal:content=results /br /
dosearch=span tal:content=request/dosearch | string:NO SEARCH /br /
querytpe=span tal:content=request/querytype | string:NO QUERYTYPE 
/br /


!-- test with python: this gives me what I expect --
div tal:condition=python:len(results) or 
request.get('dosearch',None) or request.get('querytype',None)TRUE IN 
PYTHON/div


-- This doesn't evaluate to true --
div tal:condition=results | request/dosearch | request/querytype | 
nothingTHIS DOESN'T SHOW UP/div



Produces:
results=[]
dosearch=NO SEARCH
querytpe=mps
TRUE IN PYTHON


As you can see, the second expression doesn't evaluate to True.  Can 
someone explain the subtleties I seem to be missing?


Thanks,
Mark
___
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 )

__ NOD32 1.1592 (20060611) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com




Mark,
Just looking at your second example:
-- This doesn't evaluate to true --
div tal:condition=results | request/dosearch | request/querytype | 
nothingTHIS DOESN'T SHOW UP/div


If you replace '| nothing' with '| default' you will get THIS DOESNT 
SHOW UP


David






___
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] Basic Template question : 'truthiness'

2006-06-11 Thread David H

David H wrote:


Mark Gibson wrote:

I thought I knew how this stuff worked, but this has gotten me 
banging my head against a wall.


I'm trying to evaluate a condition expression, and I'm not getting 
what I expect when using path, and I get a different result when 
using python.  The following expressions


results=span tal:content=results /br /
dosearch=span tal:content=request/dosearch | string:NO SEARCH 
/br /
querytpe=span tal:content=request/querytype | string:NO QUERYTYPE 
/br /


!-- test with python: this gives me what I expect --
div tal:condition=python:len(results) or 
request.get('dosearch',None) or request.get('querytype',None)TRUE 
IN PYTHON/div


-- This doesn't evaluate to true --
div tal:condition=results | request/dosearch | request/querytype | 
nothingTHIS DOESN'T SHOW UP/div



Produces:
results=[]
dosearch=NO SEARCH
querytpe=mps
TRUE IN PYTHON


As you can see, the second expression doesn't evaluate to True.  Can 
someone explain the subtleties I seem to be missing?


Thanks,
Mark
___
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 )

__ NOD32 1.1592 (20060611) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com




Mark,
Just looking at your second example:
-- This doesn't evaluate to true --
div tal:condition=results | request/dosearch | request/querytype | 
nothingTHIS DOESN'T SHOW UP/div


If you replace '| nothing' with '| default' you will get THIS DOESNT 
SHOW UP


David



Mark,

Sorry  I misread your problem.  My last post!  *Sorry* :-)

David

___
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] Templates vs DTML

2006-06-05 Thread David H

Dennis Allison wrote:

We've been using DTML but we are at a point where we could move to page 
templates.  

We are starting a major restruture and rewrite of much of the 
system and are debating moving to ZPT.  Performance is potentially a major 
issue.  We are using Zope 2.9.X, will eventually move to Zope 2.10.X and 
Five.  Python 2.4.X.


Has anyone done any benchmark comparison of the two design choices?  For 
the same functionality, which performs better.  No flame wars about which 
is better, just information about performance.  




 


Dennis,

Interesting question.  Because to reasonably performance test ZPT vs 
DTML one would have a scenario where DTML script does both logic and 
presentation (its weakness) and ZPT does presentation and off-loads 
its logic to Python Scripts (presumably its strength). 
Note: I say this assuming the DTML typically has lots of embedded 
logic whereas ZPT does not.


Chris M wrote an very interesting blog (see plope.com) that (among other 
things) compares Meld to ZPT in terms of performance.   I recall that he 
was impressed with ZPT's rendering speed.


At any rate, you could always invest the time to convert one of your 
DTML workhorses into ZPT and do your own compare.  That might be best 
because the style your DTML was written in may make a big difference in 
your performance results.


David

___
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] Ghost user in Zope 2.7.6 on Win32

2006-06-01 Thread David H

Dale Strickland-Clark wrote:

We have a strange case of a user disappearing from the acl_users folder. 

The user used to be there and has been using the web site for some months but 
today, she reports that she has lost her permissions. Investigation revealed 
that her user id had disappeared from acl_users (it was the only one in 
there) at that folder level.


Using the ZMI, I added her back in and it all seemed OK but then I realised I 
had given her the wrong role. I went back and corrected the role but she 
disappeared again.


Now, even though the folder is showing There are no users defined, when I 
try and add her back in, I get A user with the specified name already 
exists.


I experimented a bit more.

I added another user and gave it Manager role. I can't delete this one.

I added another user and gave it one of our roles, Reviewer (the same as the 
original ghost user). This one vanished immediately.


Can anyone offer any clues as to what might be happening here? Is it safe to 
delete and re-create the acl_users folder?


Thanks for any help.
 



Dale,

I remember something odd like this from like 2 years ago ... did you 
delete a role that had been used previously for that user? If so, try 
re-adding even if its no longer used and see if that changes anything. 

Or maybe you could check the security settings for that folder (and all 
folders above) and see if there are orphaned roles and clean them up.


David

ps

Or you could upgrade to a more current version of Zope and maybe it will 
just go away ...




___
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] cooked body??

2006-05-10 Thread David H

David Bear wrote:

I'm attempting to use a zpt to read/render an html file. Just using 
something like


div tal:content=here/htmlfolder/file.html stufff /div

puts the 'escaped' contents of the file.html in the div section. I 
seem to remember something about cooked body or uncooked to get the 
non-rendered contents of the html file.


any pointers?

--
David Bear
What's the difference between private knowledge and public knowledge?


David,

Maybe tal:content=structure here/htmlfolder/file.html ?  I use the 
structure key word to include things like CSS, and (python) 
dynamically generated JavaScript - maybe it will work fo you in this case.


David H






___
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] Process uploaded text file.

2006-04-26 Thread David H

Jason C. Leach wrote:


Hi,

Does anyone have an example (URL is fine) on how to processes a text
file via a Python script that has been uploaded from a web form?

Thanks,
Jason.

-


Jason,
Maybe this will help:

http://www.zopelabs.com/cookbook/1006887320

David
___
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] REQUEST.form variables order

2006-04-20 Thread David H




Gaute Amundsen wrote:

  On Thursday 20 April 2006 15:46, Tino Wildenhain wrote:
  
  
Gaute Amundsen schrieb:
...



  The order of the form elements that goes into mail headers is ofcourse
irelevant. I'ts the rest of the form, you know name, adress, street, etc.
that are the problem.
It's a purely visual thing, but when you have a form with perhaps 50
fields, that the client has carefully grouped and ordered, they can get
rather pissed if you try to tell them they can only have it in
semi-random or alpabetic in their mail.
  

...



  A smiley or two helps, but now I would say you are bordering on arrogant.
What more do I have to explain to convince you that I understand what the
problem is?
  

We would have saved time if you provided the very usefull information
first :-)


  
  Well, it's amazing how what seems clear to one can be quite opaque to another.
I will try to be more explicit next time.

  
  
Now you are building some kind of table/list with
form-field-name: form-field-value  - am I right?

how is it supposed to handle checkboxes, radiobuttons
and select fields?


  
  Hm.. I can't recall how I did that. I just made a reiplemetation of how 
formmail.pl did it.
But anything it does, it does looping thru request.form, so I dont think this 
is relevant. 

  
  
One possible workaround, if you dont want to touch
ZPublishers form handling would be to run a script
to not only update the forms target (formmail.pl - zopeform)

  
  
I use apache "proxy rewrite" for that, no update needed.

  
  
but split every form element from
input type="text" name="foo" value="" /

into

input type="hidden" name="body.name:records" value="foo"/
input type="text" name="body.value:records" value="" /

which you easily get as list of name/value pairs in
the form variable "body".

You can even make this transformation any time a user edits
her HTML source - save the users source in a property and
transform this source via some regex or HTML parser
to what you really want here.

Moderate work and you can even add some sanity checks :-)

If you can provide some typical samples of the HTML you
are facing I believe you even can get help with the
transformation script.

Regards
Tino

  
  
I have considered a number of variations along these lines.
Extracting the ordering information and adding a hidden field is also a 
posibilty. 
But the potential for messups, and big pain, with a script altering large 
amounts of user content, is not inconsiderable I would say.

I still think my own idea of adding a small proxy to transparently add that 
"hidden field" is rather more elagant.

I expect I will go with Andrew Milton's idea however, since that keeps us 
inside zope, and seems simpler to implement.

I would have prefered to go to the root of the problem, that allways works 
best in the long run, but it seems I have managed to avoid the effort this 
time. 

I still think it is something zope should handle, but for me it is only a sort 
of medium-term stop-gap measure, so it will do.

Thanks for your attention :)

Gaute
  

Hi Gaute,

I saw this in a Goodman _javascript_ book "Elements: A collection of all
elements w/in a form ... Collection members are sorted in source code
order". So, you could standardize a _javascript_ process
function that loops thru the elements naming each one? 

If such a thing could work that you just need to include the
../_javascript_. 

David


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


Re: [Zope] Re: zope 2.8.6 on Mac Intel

2006-04-13 Thread David H




Dieter Maurer wrote:

  manuel spuhler wrote at 2006-4-12 21:40 +0200:
  
  
...
 File "/opt/Zope2.8/lib/python/ZODB/__init__.py", line 21, in ?
   from persistent import TimeStamp
 File "/opt/Zope2.8/lib/python/persistent/__init__.py", line 19, in ?
   from cPersistence import Persistent, GHOST, UPTODATE, CHANGED, STICKY
ImportError: Inappropriate file type for dynamic loading

  
  
Something is wrong with your "cPersistent.so" file.

   It should be a dynamically loaded shared object but somehow it is not.

I cannot tell you why...


  

Manuel,

Last time I saw cPersistent.so mentioned as a problem it had to do with
conflicting python versions. No idea either, otherwise. 
Did you mention your zope version *and* the python versions you are
using? (check your control panel) Didnt see the start of this thread.

David




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


Re: [Zope] how to include a local html file

2006-04-07 Thread David H

Chris Purves wrote:


Hello,

How can I include an html file on my local filesystem into a DTML method?


 


Chris,
You have asked a two part question.

a) how to access your local file system

http://sourceforge.net/projects/localfs

and b) how to access it in a DTML method

Dont know cause I havent used (a) but i'm sure you will see examples if 
you have (a).


David


___
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] single sign-on

2006-04-02 Thread David H

robert rottermann wrote:


Fernando Martins wrote:


Hi,

I'm doing single sign-on using Apache+mod_ntlm+FastCGI. Since the 
last is

deprecated, is there any alternative?

TIA,
Fernando Martins

___
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 )

  


Fernando,
during the next 4 weeks we will be prototyping a site.
One of the request we have to meet is SSO using
Active Directory to manage the users. One of the request
we *should* meet (I declined to commit ourselfs for this feature)
is that a user when logged into Windows she is automaticaly logged into
Plone. The server is running on a Linux box (SuSE 9.3 or later)
No idea yet whether this is possible yet, and I have read all related 
info with interest.

If you like we can try to join forces.

Robert


_

 


Robert,

You can python + COM your way to a browser startup zope/plone login 
screen.  I cannot see how you automate the authentication of a given 
browser instance that is then handed to your users.


Maybe someone will correct this.  If so everyone's happy.

Of course, you could make your plone site anonymous if you feel your 
secure by the time they get there.


David


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Question about Zope and security

2006-03-29 Thread David H

Cyrille Bonnet wrote:


Hi Terry,

thanks for your comment.

Stock Zope doesn't use cookie authentication, so you're actually 
talking about
an alternate user folder product (which you don't specify and I don't 
know that
many of them, so I can't really comment much -- except that 
SimpleUserFolder
with CookieCrumbler will indeed put you in this situation (or did the 
last time

I checked)).



I am using Plone 2.1.2, which uses CookieCrumbler. I wanted to put the 
problem in a Zope perspective, though: this is why I didn't mention that.




The fact that Zope stores passwords as plain text is not the issue if 
you're worried
about man-in-the-middle attacks, though. The problem there is that 
you are passing
passwords plain text in the request, and there is almost no way 
around that unless you run an SSL (HTTPS) server.  Which you should 
if you want real security.




Sorry, I wasn't even aware that Zope stores the passwords in plain 
text.  My primary concern (for the moment) is passwords in plain text 
in the request.


I had thought of SSL, but it doesn't solve the problem for WebDAV access.

I should also mention that the site is for the general public, with a 
few users logging in.


Of course, I can't put the public site on SSL, so I would have to have 
a separate URL for logged-in users with SSL. And I still have to worry 
about the ZMI and WebDAV access.


It seems so much simpler to solve the problem at the root: change Zope 
authentication.



Encrypting your password database without moving your server login to 
HTTPS
is only going to create inconvenience without improved security (you 
can no
longer send password reminders, for example) -- it's a false sense of 
security.




Ouch, so on top of my concerns, passwords are stored in plain text?? 
Thanks for pointing that out.


I'd rather encrypt passwords with a hash and reset the password if the 
users have lost it. Is it possible to do that in Zope?


Obviously, I don't understand the ins and outs of Zope as well as most 
people on this list. So, my questions really are:


* why is Zope authentication implemented that way?
* Is it really complex to secure the authentication process?
* Is there any documentation summing up Zope security (authentication 
process, password storage, etc.)?


Cheers,

Cyrille

___


Cyrille,

I am curious:  If HTTPS is a hassle, then what do your security experts 
have as a secure alternative?


All best,

David

___
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] newbie dtml-in question objectValues

2006-01-10 Thread David H




Alric Aneron wrote:

  Hello,
I am trying to find how to get the relative path of an object. If i do:
dtml-in "objectValues('DTML Document')"
 dtml-var URLPATH0
/dtml-in
  
URLPATH0 does not give me the relative path of the objects interated,
but rather the path of the object doing the iterating (my method). I
want the path of every DTML Document the loop encounters. absolute_url
works, but it puts in the undesired filename and "http://" in front
etc. 
  
Thanks in advance!
Al
  
   
  
Alric,

This is a python example. I dont want to convert to dtml but maybe you
do.

for o in container.objectValues('DTML Method'):
 print o.virtual_url_path()

return printed



___
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] Help me!

2006-01-09 Thread David H

Bruno Grampa wrote:


Hello,
i'm building a site to sell images (this is the concept, the reality is
different...).
All the images are in a directory mapped through LocalFS product.
For every image i have a record in a SQL table with all the basic
informations: author, name of the file, cost.

What i haven't understood is how to block users from getting images if
they have not enough credit to buy them.
I need to control the view method, but i don't know if this idea is the
right one or there are better solutions.

Any hints?

Thanks,
   Bruno





Bruno,

Maybe you can better explain your question. Im not at all sure the 
following will help:


Seems like you can check a users credit at login, store the credit score 
in SESSION and use that for branching logic.  You could also update the 
creditScore as it changes.


Then you can develope your pages with stuff like this:  (syntax not checked)

in TAL

a hRef=somewhere tal:condition=python:  
request.SESSION['hasCredit'];This link only shows up if session's 
'hasCredit' is true./a


In DTML

dtml-if SESSION['hasCredit']
a hRef=somewhere ...
dtml-else
 hRef=somewhereelse

In Python: (and TAL macros)

  if context.REQUEST.SESSION['hasCredit']:
return container.Images.macros['allImages']  
  else
return container.Images.macros['someImages']  


David





___
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] CPU architecture and Zope

2006-01-09 Thread David H

Hi list,

Im just wondering what the wisdom is about Zope performance and various 
CPU types.  I'm running Zope on Linux (Ubuntu). I notice that Dell is 
selling  a dual-core Pentium unit.  But I have no idea if something 
like dual core  is advantegous to Zope, python execution or one's 
favorite RDMS.



Thanks,
David

___
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] Leave the ivory tower now!

2006-01-08 Thread David H




Jonathan wrote:

  
  
  
  To pour fuel on the flames...
   
  +1 DTML
  -1 ZPT
   
  Why...
   
  1) For 'quick and dirty' demos and
rapid application prototyping DTML does the trick (yes, even including
ZClasses), it is fast, easy, reasonably robust and it works!
   
  2) For 'heavy lifting' (ie. intense
computation, high loads, etc.) I prefer a 'product' approach.
   
  3) For client-side
functionality/control I prefer an
AJAX approach using a combination of _javascript_/HTML/XHTML/XHTML-MP
plus server-side python scripts/external methods/products.
   
  ZPT is a bit of a hybrid
which increases overhead and doesn't really bring any new functionality
to the table (for my applications and environment).  Yes, for
separating (well, mostly separating) content from display formatting
ZPT is one possible solution, but the divorce of content and
presentation is better achieved with an AJAX type of approach.
   
  I think Zope beginners would be
better off using DTML (easier to learn, user's get quicker results and
therefore have more satisfaction with Zope as a development platform),
and then 'serious' development should be done using an AJAX approach
with Zope 3 - the way of the future imho :-)
   
  If we had to make a choice for the
future I would prefer Zope 2 + DTML and Zope 3 + AJAX (and consign ZPT
to the 'good idea at the time' bin).  Possibly, in the distant future,
AJAX utilities/ides will exist which will make rapid prototyping and
'quick  dirty' demos feasible, in which case Zope 2 + DTML could
fade into happy history.
   
  Just my 1-1/2 cents.
   
   
  Jonathan
   
  
-
Origin
  


Think about it:  we argue about Z Classes vs DTML vs ZPT + python
scripts vs Products.  Its all good.

Zope + 1
  
 :-) 

David




___
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] Cookie Crumbler

2006-01-06 Thread David H




Dieter Maurer wrote:

  Infor Gates wrote at 2006-1-4 20:14 -0800:
  
  
I have a trying time using Cookie Crumbler 1.2 with Zope2.8.4 (windows version).
I could NOT figure out how to log out a user.  I have simplified to the orginal logged_out form to this:

  
  
The "Cookie Crumber" has a "logout" method.
You should use it for the logout (and not try to emulate it yourself).

You can activate it via an URL of the form:

url_to_your_cookie_crumbler/logout

It will redirect to the "logout_page" (you can configure for
your "Cookie Crumbler".


  

Infor,

you can also do it with a python script like so: (I make a python
script into index_html and use it as a request clearing house):

if request.get('action_type') == 'LOGOUT':
 context.cookie_authentication.logout()

I guess you can translate this into DTML with something like:

dtml-call "cookie_authentication.logout()"

David






___
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] Change object/role permissions w/ python?

2006-01-05 Thread David H




John Toews wrote:
Hi all,
  
I have a need to restrict anonymous access to an object until after a
specific action occurs. For example, the View permission by default is
restricted to owner and manager, but after a 'release' flag is checked,
it is viewable to anyone. I can't seem to find a way to do this
programatically, after googling for a few hours over the past few
weeks. Is it possible? I think the user running the action would need
'change permissions' rights... is there anyway to override that?
  
Thanks again!
John
  



John,

Here's a solution that at best will stimulate a better answer :-)

a href="" 
 tal:condition="python: request.get(releaseFlag,0)"some link
/a
or
a href="" 
 tal:condition="python: not request.get(releaseFlag,0)"some
other link
/a


David
 


___
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] Javascript obfuscator and Zope

2006-01-04 Thread David H

Jean-Marc Orliaguet wrote:


Peter Bengtsson wrote:


It's not a Zope product but at least it's python.
http://www.issuetrackerproduct.com/Download#slimmer

It's basically a javascript whitespace optimiser
Compare
http://real.issuetrackerproduct.com/tw-sack.js
with the original:
http://www.issuetrackerproduct.com/tw-sack.js

More work can be done of course but I wanted to keep it relatively 
CPU fast.

It works on CSS and HTML too:
http://www.peterbe.com/stylesheet.css

 



there is minjs written in C too: 
http://www.crockford.com/javascript/jsmin.html


this is a one-way process though, and this should also be compared 
with the effect of compressing files while serving them.


/JM


Thanks Peter and Jean-Marc!
I'll take a look at these.
David
___
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] Java vs Zope

2006-01-03 Thread David H

Asad Habib wrote:

From my experience, Java development has been a lot faster when 


applications have middle to high level complexity. Since Java is 
inherently object-oriented, reusability is much easier to achieve then 
when using Zope. Also, Java has mature development and debugging 
environments and well organized API's. Zope is seriously lacking in 
this regard.


Zope is good for building simple interfaces but any application that 
does data processing and requires session management should be left 
for Java. The closest comparison to Zope that I can think of is PHP.


Again, this is just my opinion based on my own experiences.

- Asad


Asad,

Python is also object oriented.  In python, x = 10 creates an object not 
a simple type - if I recall the same is true in Java.


The comparison should first be between python and java.  I've used both 
and prefer python.


The next compare should be between developement platforms for each: e.g. 
Zope vs some java IDE.


Lastly, I think Zope is more than capable of handling complex 
applications using external databases.  I've not run into a single 
barrier doing this using Zope (other than fleeing braincells).


All best,
David



___
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] Help with Zope Python result object please!

2005-12-30 Thread David H




Alric Aneron wrote:
hello,
I have a python code that recieves two result objects from two
different ZSQL methods. I need to join them (sort of like UNION).
I can't do result1+result2, otherwise it raises an exception that the +
operator isn't supported.
When I try to do this (read below, I explained what i've done if you
are lazy to read the code)
result1 = context.zsqlmethod1()
result2 = context.zsqlmethod2()
if (len(result1) == 0):
 return result2
row1 = 0
row2 = len(result1) + 1
col = 0
for r in result2:
 col = 0
 if (context.duplicateExists(result1, result2[row1][0]) == -1):
 result1[row2][col] = result2[row][col]
 col = col + 1
 row1 = row1 + 1
 row2 = row2 + 1
  
return result1
  
Basically, it loops through the rows and columns of result2 and adds
them to the end of th e result 1. However it for some reason raises
"index out of range" and says that assigning
result1[0][0]=result2[0][0] (if there is an element in both of them) is
illegal because:
  Error Value: object does not support item or slice assignment
  I realize that in most programming languages you can't add
them to result1 without resizing it first, but I can't find much
documentaiton on member functions of the result object, so I can't
resize it. 
I am completely stuck, I've tried everything, spent so much time on it,
can anyone please help save my sanity :P
  
Thanks in advance guys! I really appreciate it.
   
   Y
Alric,
The merging of two zsql result sets is easy - here's one way:
newResults = []

for r in resultset1:
 newResults.append( r )

for r in resultset2:
 newResults.append( r )

return newResults.

David







___
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] Javascript obfuscator and Zope

2005-12-29 Thread David H

Hi list,

I am wondering if anyone is obfuscating JavaScript  using a python 
script or product.  I did some googling but nothing cropped up.  Seems 
like a nice idea unless the  realities of javascript obfuscation make 
the exercise pointless.


Any thoughts?

David

___
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] Change ZSQLMethod connection id

2005-12-23 Thread David H

Andreas Jung wrote:




--On 23. Dezember 2005 13:33:08 +0100 Fabio [EMAIL PROTECTED] 
wrote:



Hi!
in my zope application I call ZSQLMethods from python script. Is it
possible  to set connection id property of a ZSQLMethod before call 
it?


How?
ZSQLMethod.propertyItems() return only ('title','')



perhaps

zsql_method.connection_id = '' might to the job. See DA.py

-aj

 


Fabio,

This, I think, is something I found in ZopeLabs some time ago. 
-

objs = container.ZopeFind(container,
 obj_metatypes=['Z SQL Method'],
 search_sub=1)
# module:  pyPsycopgPropertyChanges
path_list = []
for path, method in objs:

  title = method.title
  conn_id = 'Psycopg_database_connection'
  args = method.arguments_src
  body = method.src

  method.manage_edit(title, conn_id, args, body,max_rows=5000)
  path_list.append(path)

header = Fixed up the following methods - %s out of total sql count of 
%s%(str(len(path_list)), str(len(objs)))

body=brbrulli%s/li/ul%join(path_list, '/lili')
return header+body
-
HTH,
David



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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: [Zope-dev] Re: sessions in the presence of conflicts

2005-12-19 Thread David H

Dennis Allison wrote:

Chris McDonough identified a persistence problem with the routine(s) that 
manage sessions variables.  (Thanks Chris)  I have put the correction in 
place which resolved some (but not all) of the problems.


There are still problems which are apparently due conflicts in accessing
the session variables.  To minimize frequency of conflicts, I am rewriting
several routines using Dieter's rules of the thumb (Thanks Dieter).

One routine being modified is a Script(Python) that initializes a number
of session variables.  I am collecting the session values in a dictionary
and then use update to set their value, for example:

s = {}
s['alpha'] = 'a'
s['beta'] = 'b'
request['SESSION'].update(s)

Is the persistence machinery smart enough to detect this as a change?  I
suspect that it has to be flagged since the assignment won't be seen.  
Usually this means setting the _p_changed=1 attribute, but it is not clear
to me where to set it in this particular context.  







 


Dennis,

Did you means request['SESSION']['someDictionary'].update(s)?
Anyway your idea seems correct - The SESSIONS chapter (at least on 
plope.com) addresses SESSION staleness and mutable objects.


1) someDict = SESSION['someDict']
2) someDict['someKey'] = newValue

But (2) does not guarentee that a subsequent lookups like:
SESSION['someDict'] will return newValue.

But this WILL:
3) SESSION['someDict'] = someDict.

Which looks like your example.  How this connect to your primary issue:  
*conflicts* is not clear to me.  :-\


David


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: [Zope-dev] Re: sessions in the presence of conflicts

2005-12-19 Thread David H




Dennis Allison wrote:

  The interaction between sessions, conflicts, and persistence is a bit
confusing.  I am still trying to understand the code in depth.  

One thing is for sure, request.SESSION and/or request['SESSION'] must be
persistent for things to work.  Mutable objects in the session variable
set (dictionaries and lists) have to be handled specially to get the
persistence machinery to recognize they have been changed.

In this case, I am trying to ensure that the session variables get 
identified as persistent.  My question is whether using update (an 
implicit assignment) triggers the persistence mechanism.  It is the 
moral equivalent of writing 

	request['SESSION']['alpha'] = 'a'B
	request['SESSION']['beta'] = 'b'

but I am unsure whether the persistence mechanism will recognize it as 
such.  

Doing session variable initialization in a Script(Python) object has a
downside because one cannot set a _p_changed attribute and so must rely on
the assignment paradigm.  Perhaps the interface should be in a Product or
External Method which is less constrained.

Anyhow, David, thanks for the assist.


On Mon, 19 Dec 2005, David H wrote:

  
  
Dennis Allison wrote:



  Chris McDonough identified a persistence problem with the routine(s) that 
manage sessions variables.  (Thanks Chris)  I have put the correction in 
place which resolved some (but not all) of the problems.

There are still problems which are apparently due conflicts in accessing
the session variables.  To minimize frequency of conflicts, I am rewriting
several routines using Dieter's rules of the thumb (Thanks Dieter).

One routine being modified is a Script(Python) that initializes a number
of session variables.  I am collecting the session values in a dictionary
and then use update to set their value, for example:

	s = {}
	s['alpha'] = 'a'
	s['beta'] = 'b'
	request['SESSION'].update(s)

Is the persistence machinery smart enough to detect this as a change?  I
suspect that it has to be flagged since the assignment won't be seen.  
Usually this means setting the _p_changed=1 attribute, but it is not clear
to me where to set it in this particular context.  

  

  
  
  
  
Dennis,

Did you means request['SESSION']['someDictionary'].update(s)?
Anyway your idea seems correct - The SESSIONS chapter (at least on 
plope.com) addresses SESSION "staleness" and mutable objects.

1) someDict = SESSION['someDict']
2) someDict['someKey'] = "newValue"

But (2) does not guarentee that a subsequent lookups like:
SESSION['someDict'] will return "newValue".

But this WILL:
3) SESSION['someDict'] = someDict.

Which looks like your example.  How this connect to your primary issue:  
*conflicts* is not clear to me.  :-\

David



  
  
  

Dennis,
Lets just put the question out there: Does:

SESSION['someKey'] = someValue

Force a commited transaction?

As opposed to ...
someDict = Session['SomeKey']
someDict['aKey'] = 'aNewValue'

David


David




___
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] zyncer 0.7.0?

2005-12-17 Thread David H

Hi List,

I downloaded  zsyncer-0.7.0  and am having problems.  Its not working 
for me and it no longer displays prompts for destination password and 
user name when clicking its edit tab.   Anyone else seeing this?


More importantly, as a fall-back is there a version (0.6.1?) others 
recommend?


All best,
David

___
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] zyncer 0.7.0?

2005-12-17 Thread David H




Alan Milligan wrote:

  -BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David H wrote:
  
  
Hi List,

I downloaded  zsyncer-0.7.0  and am having problems.  Its not working
for me and it no longer displays prompts for destination password and
user name when clicking its edit tab.   Anyone else seeing this?


  
  You need to use extended url auth syntax:
http://username:[EMAIL PROTECTED]/bla ...

This is because we can have multiple targets all with different
passwords ...

Alan

  

Alan,

Thanks for your response. Apparently my
zope-instancebin/zopectl stop / restart sequence was not
working on my remote (zettai) instance.
I had to do a shutdown from the control panel and *then* a bin/zopectl
start worked just fine - and zyncer came up as it should. The install
of zsyncer 0.7.0 on my *localr* system was fine - hence the disconnect
in what I was seeing ...

David


___
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] List within a list - how to use in a page template

2005-12-14 Thread David H




David H wrote:

  
Paul Winkler wrote:
  
On Wed, Dec 14, 2005 at 06:06:21PM +1300, Cameron Beattie wrote:
  

  I am trying to get my head around representing a list in a page template.

Assume the following list:

  

  
m
  
  

  
  [[61282125371L, 1, 6, 0], [61282125379L, 1, 6, 0], [61282825240L, 6, 6, 0], 
[61282125378L, 1, 6, 0], [61282125374L, 1, 6, 0]

  

  
m[0]
  
  

  
  [61282125371L, 1, 6, 0]

  

  
m[0][0]
  
  

  
  61282125371L

i.e. m is a list where each member is itself a list.

How do I get a page template to render a particular item? Assume a function 
getem returns the list.
tal:block repeat="m python:here.getem()"
   td tal:repeat="single m" tal:content="single"/td

This code will produce four columns and five rows, with each populated by 
the list members. But what if I only want the first and third members in 
each case i.e. 2 columns and five rows?

I thought it would be something like tal:content="python:single[0]" but 
that gives me an unsubscriptable object error.



That's because, in your example, each time through the loop,
single is an int. Try indexing m instead.

  
  
I think all thats needed is a tal:condition (he wants to filter out
rows)
  
1)span tal:define="res python: context.pyTest();" --- returns
list of lists like [[61282125371L, 1, 6, 0], [61282125379L, 1, 6, 0],
[61282825240L, 6, 6, 0]]tal:repeat="r1 res"
3)  tal:span tal:repeat = "r2 r1" 
4)  tal:condition="python: repeat.r2.number in (1,2,4)" 
5)  tal:content="r2"
6) /tal:span
  
Where 4 is not brain dead as in my example. 
  
David
  
  
  
  
  

Ok, its best to parse your list of lists in a python script. You pass
a tuple (or array) of inclusionary index numbers. It will return the
filtered list of lists The problem with the try I gave before is that
*condition* is evaluated before *repeat* :-0

So ...

# python script
# input: a tuple named tup of index items to include in list of lists,
eg (1,3) and the list of lists
#example input: listoflists = [[61282125371L, 1, 6, 0], [61282125379L,
1, 6, 0], [61282825240L, 6, 6, 0]]
#example tup: (1,3)

ret = []
for i in range(len(listoflists)):
 if i in tup:
 ret.append(x[i])
return ret

Then your ZPT is easy.

David



___
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] sessions in the presence of conflicts

2005-12-14 Thread David H

Dennis Allison wrote:


Zope 2.8.4, ZODB 3.4.2

I am still trying to resolve a session variables in the presence of
conflicts problem.  The observed symptom is that suddenly either some
session variables disappear or all session variables disappear.  In both
cases, Zope has raised a KeyError exception for the a particular session
variable because it is not present and an attempt was being made to access
it from the session.

The cause appears to be related to the presence of a conflict error and a
botched recovery, but the exact mechanism remains a mystery.

Zope equates a session object with a TransientObject.  For our instance,
that's fine, since our only TransientObject is a session.  For the general
case, I would have thought a SessionObject inheriting from TransiendObject
would have been used so that conflict resolution for sessions could be
easily specialized.

The conflict resolution for a TransientObject (that is, a Session Object)
is clearly suboptimal.  In the next paragraphs I'll review what is 
currently done and then propose a different approach which I am about to 
implement for our systems.  Comments, corrections,  and suggestions much 
appreciated.


_p_resolveConflict(self, oldState, savedState, newState) 

returns the state of the object after resolving different changes.  The 
arguments are:


  oldState   -- state of the object at the beginning of the current 
	 transaction (mutable)
  savedState -- state currently stored in the database.  This state 
was written after oldState and reflect changes made

by a transaction that committed before the current
transaction (immutable)
  newState   -- state after changes made by the current transaction 
	 (immutable)


The standard conflict resolution for a TransientObject resolves according
to the following rules:

  1.  if any of the states are invalid (that is, has a key '_invalid')
  return the invalid state.

  2.  if any any of the attributes ['token','id','_created'] differ then 
  there is a conflict, raise the conflict exception.


  3.  choose the state most recently modified, if possible.

  4.  otherwise, choose the state most recently accessed.

It seems to me that we can do much better for sessions because we know a
bit about the semantics of sessions.  A session object is a
dictionary-like object mapping key-value pairs.  Adding or deleting keys
or changing the value associated with a key are independent operations and
do not conflict unless the keys are duplicated in both the transactions.  
Any conflict resolution mechanism needs to be able to manage multiple keys
independently since the session object is modified as a unit.   In 
addition, new keys may be added and old keys deleted; any conflict 
resolution mechanism at the key level needs to be comprehend those 
operations.


A more session-friendly conflict resolution might use:

  1.  if any of the states are invalid (that is, has a key '_invalid')
  return the invalid state.

  2.  if any any of the states attributes ['token','id','_created']
  differ then there is a conflict, raise the conflict exception. 


  3.  order the newState and savedState by modification time (or if that
  cannot be computed, by access time).   

  4.  any key appearing in oldState's dictionary but not appearing in 
  both savedState and newState should be removed from all.  This 
  corresponds to a key-value pair being deleted in one of the 
  transactions.  Insertions will be managed automatically by 
  the updates.


  5.  beginning with the oldest, update oldState dictionary of key-value 
  pairs using the dictionary part of newState and savedState.  Return 
  oldState.


This does several things.  First, it captures independent key-value
changes made in both potentially conflicting transactions.  Second, it
provides a reasonable ordering for multiple (potentially conflicting)
key-value pair updates.  Third, it manages insertions and deletions to the
session variable set in the presence of conflicts.

Does this make sense?  I have yet to figure out how to map a
TransientObject state back to the object it represents, but it clearly
is possible.




 


Dennis,
Im only curious and this is no recommendation ... and I asked this on 
the list maybe a year ago (and got zero reponses)


Have you given HappySession a try?  Has anyone? I've never had a 
problem with it, but then its never been under much load and is no 
longer actively supported (least last time I checked).


I converted back and forth between Zope SESSION and HappySession (for 
reasons of  legacy code).  Their interfaces have just few differences, 
e.g., HappySession['this'] returns None (if 'this' is not a key) and 
SESSION raises an exception.  That type of thing.


HappySession  does not read/write to zodb (if I recall it stores session 
data in RAM (session) cookies).  I just do not know if its otherwise up 
to your 

Re: [Zope] Unauthorized exception when trying to access a list item

2005-12-14 Thread David H

Cameron Beattie wrote:

I am trying to access a value in a list. The script getDIDS_list is 
passed a list called listoflists:

list = listoflists
ret = []
tup = (0,1,2)
factortup = (1,2)
factor = 2
for i in range(len(list)):
#   1 == 1
 if i in tup:
   if i in factortup:
  x = list[i] * factor
etc

The code is a bit strange due to my testing. However zope gets upset 
when trying to evaluate list[i]:


You are not allowed to access '1' in this context

a.. Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
__traceback_info__: context.getDIDS_list(listoflists = DIDs)
a.. Module Python expression context.getDIDS_list(listoflists = 
DIDs), line 1, in expression

a.. Module Shared.DC.Scripts.Bindings, line 311, in __call__
a.. Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
a.. Module Products.PythonScripts.PythonScript, line 323, in _exec
a.. Module None, line 10, in getDIDS_list
PythonScript at /Conversant/account/getDIDS_list
Line 10
a.. Module AccessControl.ZopeGuards, line 71, in guarded_getitem
a.. Module AccessControl.ImplPython, line 529, in validate
a.. Module AccessControl.ImplPython, line 329, in validate

I've tried calling the script from the page template using 
here.getDIDS_list, container.getDIDS_list context.getDIDS_list but the 
problem persists. Am I accessing the list in the wrong way? Any advice 
would be appreciated.


Regards

Cameron


Whats in your list?  A protected item?  Does this happen everytime or 
just with '1'? 


David

___
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] List within a list - how to use in a page template

2005-12-13 Thread David H




Paul Winkler wrote:

  On Wed, Dec 14, 2005 at 06:06:21PM +1300, Cameron Beattie wrote:
  
  
I am trying to get my head around representing a list in a page template.

Assume the following list:


  

  m
  

  

[[61282125371L, 1, 6, 0], [61282125379L, 1, 6, 0], [61282825240L, 6, 6, 0], 
[61282125378L, 1, 6, 0], [61282125374L, 1, 6, 0]


  

  m[0]
  

  

[61282125371L, 1, 6, 0]


  

  m[0][0]
  

  

61282125371L

i.e. m is a list where each member is itself a list.

How do I get a page template to render a particular item? Assume a function 
getem returns the list.
tal:block repeat="m python:here.getem()"
   td tal:repeat="single m" tal:content="single"/td

This code will produce four columns and five rows, with each populated by 
the list members. But what if I only want the first and third members in 
each case i.e. 2 columns and five rows?

I thought it would be something like tal:content="python:single[0]" but 
that gives me an unsubscriptable object error.

  
  
That's because, in your example, each time through the loop,
single is an int. Try indexing m instead.

  

I think all thats needed is a tal:condition (he wants to filter out
rows)

1)span tal:define="res python: context.pyTest();" --- returns
list of lists like [[61282125371L, 1, 6, 0], [61282125379L, 1, 6, 0],
[61282825240L, 6, 6, 0]]tal:repeat="r1 res"
3)  tal:span tal:repeat = "r2 r1" 
4)  tal:condition="python: repeat.r2.number in (1,2,4)" 
5)  tal:content="r2"
6) /tal:span

Where 4 is not brain dead as in my example. 

David






___
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] Simple User Folder Setup

2005-12-12 Thread David H




Infor Gates wrote:

  Chris
  
Thanks for your email. There is another person I wish to thank.
However, I lost his email contact by accident - his advice points me to
where to check for the errors.
  
Let me Simple User Folder works.
  
As I googled for some time on this, I noticed there are others who had
similar problems but the answer was not quite straight forward. The
reason, my best guess, is most of us are "juniors" - slightly above a
beginner. As we journey to "higher" level Zope development, we tried to
grasp the concepts of the Products developed by people like you.
  
For me, when I installed the SUF according to the README file, it was
straight forward. I test individual programs and it is working OK. I
copy LITERALLY the needed *.pys and *.sql from test directory to
content page of SUF instance.
  
However, when I try through Zope TTW (e.g. ADD user), the system
produces the said error message. "Juniors" like me wo uld expect the
SUF works the same as Zope User Folder. When it did not, I was lost.
  
Thanks to the an advice from the earlier email, I learnt to hack around
the example I copied to the content page of SUF instance. It was a
simple error BUT I did not see it. The example call for addUser but the
program copied was named addUser.pys. Also missing inside the example
is calling the addUser.sql.
So when I change the name to addUser and added call to addUser.sql, it
work fine.
  
In conclusion, I would say it was a miscommunication or mis-reading of
the README. It would be better the README file can improve this aspect.
Then I believe everyone would enjoy using the SUF.
  
  
  
  
  Chris Withers [EMAIL PROTECTED] wrote:
  
Infor Gates wrote:
 I am having problems in setting up Simple User Folder.
 Error Message:
 Error Type: UnconfiguredException
 Error Value: Addition of users has not been configured
 
 I have googled around for an answer. However, there is very little
info on it.

Urm? That's a pretty damn clear error message if you ask me ;-)
Did you read the readme.txt in SUF?

 My Configuration: Zope2.8.4 / Windows XP Pro / Postgresql
 I have copied all (addUser.pys, addUser.sql, editUser.pys
editUser.sql, deleteUser.pys deleteUser.sql, getUserIds.pys,
getUserIds.sql, getUserDetails.pys, getUserDetails.sql) into the
/TEST/acl_users/Contents page as advised in README.

Does it say just blindly copy them?
Where did you copy them to?

Those files are primarilly for running theses tests. If you read the 
python files in the tests folder you'll see how to use them.

In your case, you need to define a method called 'addUser' inside the 
Contents tab of your SUF instance.

Read the readme.txt to find out what that method needs to take as 
parameters and what it needs to do.

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk
  
  

And SUF deserves enjoying. Its simple, clean and to the point. Thanks
Chris.

David



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


Re: [Zope] Re: live dtml updating?

2005-12-11 Thread David H

Jonathan wrote:

This is client side processing (could be done via repetitive calls to 
the server, but very inefficient), so you want a javascript-type of 
solution. Not a zope solution.


Trying googling 'javascript dynamic lists'... it should get you going 
in the right direction.


Jonathan


- Original Message - From: Rich Harley [EMAIL PROTECTED]
To: zope@zope.org
Sent: Sunday, December 11, 2005 5:31 PM
Subject: [Zope] Re: live dtml updating?



On Sunday 11 December 2005 22:30, you wrote:


 Hi all

 Sorry if this is not a specific zope question but I'm confident 
someone

 will be able to help me with the following.

 I have an input form on a webpage and below it a table which pulls 
out  of
 a database. The column headers in the table relate to the input 
form in
 that I want whatever the user types into the input box for the 
correct
 column to be highlighted in bold. So say, for example I had two 
columns  A
 and B I want column B to be highlighted bold when the user types 
'b'  into

 the input box

at

 the top. How can I do this?

Rich



--
www.horsey.tk


Rich,

Or you can try using CSS  + (javascript and DOM object style 
attributes).  Where you use javascript to give a 
document.someform.someInput.style the ID of an existing CSS style maybe 
onBlur  Not sure if it will do it all but its a place to look as well.

David

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: live dtml updating?

2005-12-11 Thread David H

David H wrote:


Jonathan wrote:

This is client side processing (could be done via repetitive calls to 
the server, but very inefficient), so you want a javascript-type of 
solution. Not a zope solution.


Trying googling 'javascript dynamic lists'... it should get you going 
in the right direction.


Jonathan


- Original Message - From: Rich Harley 
[EMAIL PROTECTED]

To: zope@zope.org
Sent: Sunday, December 11, 2005 5:31 PM
Subject: [Zope] Re: live dtml updating?



On Sunday 11 December 2005 22:30, you wrote:


 Hi all

 Sorry if this is not a specific zope question but I'm confident 
someone

 will be able to help me with the following.

 I have an input form on a webpage and below it a table which 
pulls out  of
 a database. The column headers in the table relate to the input 
form in
 that I want whatever the user types into the input box for the 
correct
 column to be highlighted in bold. So say, for example I had two 
columns  A
 and B I want column B to be highlighted bold when the user types 
'b'  into

 the input box

at

 the top. How can I do this?

Rich




--
www.horsey.tk


Rich,

Or you can try using CSS  + (javascript and DOM object style 
attributes).  Where you use javascript to give a 
document.someform.someInput.style the ID of an existing CSS style 
maybe onBlur  Not sure if it will do it all but its a place to look 
as well.

David

Let me correct myself -  use onBlur to trigger JS + CSS and object 
style manipulation -

If interested or this sounds like what you want to do then go to:

http://www.quirksmode.org/

And check out the JavaScript/DHTML section.

Best,
David


re something like:
style type=text/css
#
David

___
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] Simple User Folder Setup

2005-12-09 Thread David H




Infor Gates wrote:

  Dear zopist
  
I am having problems in setting up Simple User Folder.
Error Message:
  Error Type: UnconfiguredException
  Error Value: Addition of users has not been configured
  
  
I have googled around for an answer. However, there is very little info
on it.
My Configuration: Zope2.8.4 / Windows XP Pro / Postgresql
I have copied all (addUser.pys, addUser.sql, editUser.pys
editUser.sql, deleteUser.pys deleteUser.sql, getUserIds.pys,
getUserIds.sql, getUserDetails.pys, getUserDetails.sql) into the
/TEST/acl_users/Contents page as advised in README.
  
Do anyone have similar experiences?
  
Thank you.
  
   
  

Infor,

Take a look at the source SimpleUserfolder.py. That error occurs when
the method:

 def _doAddUser(self, name, password, roles, domains, **kw):

cannot acquire the method "addUser".

You should ensure that all methods (addUser, getUserDetails,
getUserName, etc) are either in the folder or acquirable by the folder
that you drop a Simple User Folder object in.

HTH,
David





___
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] ZSQL batching with dtml-in

2005-12-08 Thread David H

Ed Colmar wrote:

Do ZSQL methods communicate with the dtml-in call and understand the 
size attribute?


for example, in this dtml-in statement:
dtml-in SQL_get_large_list size=20 start=query_start
/dtml-in

Will the database be queried for all results, and only have 20 
displayed, or will the database just return the 20 that are needed?


Thanks for the insight!

-Ed
___


Ed,
Just add a Z Search Interface to a folder that can acquire your zSQL 
method(s).  I think it will create a sample of what you want to do in 
either ZPT or DTML.  Then you can experiment.


You can use the advanced tab to tell zSqL methods how many data 
records to download per get and how many to cache.


David

___
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] Install Zope

2005-12-07 Thread David H

Harry Forster wrote:

I would like to install Zope 2.8.4 on a Suse 9.0 system.  Has anyone done this 
and how did you do 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 )

__ NOD32 1.1315 (20051207) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com



 


Forster,
Install Zope from source - get Zope 2.84 from zope.org/downloads.  Get 
python from python.org.  I just did wgets and went from there.  Google 
for linux zope installation docs.  I installed zope over Ubuntu doing 
this just a a few weeks ago.   It just takes some time - a few hours of 
extreme annoyance and then its a beautiful thing.

David


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope 2.8.4 compilation error

2005-11-15 Thread David H

Gusti Gonzalez wrote:


Hi,

I am having the following error when compiling Zope:
---
/usr/bin/python /infra/portal/Zope-2.8.4-final/setup.py \
   build
--build-base=/infra/portal/Zope-2.8.4-final/build-base/python-2.3
--build-lib=/infra/portal/Zope-2.8.4-final/build-base/python-2.3/build-lib
--build-scripts=/infra/portal/Zope-2.8.4-final/build-base/python-2.3/build-scripts
--build-temp=/infra/portal/Zope-2.8.4-final/build-base/python-2.3/build-temp
running build
running build_py
running build_ext
building 'AccessControl.cAccessControl' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-fPIC -IExtensionClass -IAcquisition -I/usr/include/python2.3 -c
AccessControl/cAccessControl.c -o
/infra/portal/Zope-2.8.4-final/build-base/python-2.3/build-temp/AccessControl/cAccessControl.o
En el fichero incluído de 
/usr/lib/gcc-lib/i486-linux/3.3.5/include/syslimits.h:7,
de /usr/lib/gcc-lib/i486-linux/3.3.5/include/limits.h:11,
de /usr/include/python2.3/Python.h:19,
de ExtensionClass/ExtensionClass.h:83,
de AccessControl/cAccessControl.c:51:
/usr/lib/gcc-lib/i486-linux/3.3.5/include/limits.h:122:75: limits.h: No existe
el fichero o el directorio
En el fichero incluído de ExtensionClass/ExtensionClass.h:83,
de AccessControl/cAccessControl.c:51:
/usr/include/python2.3/Python.h:28:19: stdio.h: No existe el fichero o el 
directorio
/usr/include/python2.3/Python.h:30:5: #error Python.h requires that stdio.h
define NULL.
/usr/include/python2.3/Python.h:33:20: string.h: No existe el fichero o el
directorio
/usr/include/python2.3/Python.h:34:19: errno.h: No existe el fichero o el 
directorio
/usr/include/python2.3/Python.h:36:20: stdlib.h: No existe el fichero o el
directorio
/usr/include/python2.3/Python.h:39:20: unistd.h: No existe el fichero o el
directorio
/usr/include/python2.3/Python.h:46:20: assert.h: No existe el fichero o el
directorio
...
... and the error list goes on.
---

but the limits.h file does exist at the above mentioned location

My environment is:
Debian 3.1 (stable)

dpkg -l | grep python
ii  python 2.3.5-2An interactive high-level object-oriented la
ii  python-ldap2.0.4-1A LDAP interface module for Python. [dummy p
ii  python2.3  2.3.5-3An interactive high-level object-oriented la
ii  python2.3-dev  2.3.5-3Header files and a static library for Python
ii  python2.3-ldap 2.0.4-1A LDAP interface module for Python 2.3

dpkg -l | grep gcc
ii  gcc3.3.5-3The GNU C compiler
ii  gcc-3.33.3.5-13   The GNU C compiler
ii  gcc-3.3-base   3.3.5-13   The GNU Compiler Collection (base package)
ii  libgcc13.4.3-13   GCC support library

dpkg -l | grep make
ii  ant1.6.2-2Java based build tool like make
ii  libant1.6-java 1.6.2-2.1  Java based build tool like make -- library
ii  make   3.80-9 The GNU version of the make utility.
ii  makedev2.3.1-77   creates device files in /dev


Any ideas what can be missing from my installation?

Best regards,
Gustavo.


 


Gustavo,
Did you download the full (developers) version of python from 
python.org?  If not you'll need to to compile Zope.

David




___
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] question about stopping acquisition in VHM sites?

2005-10-27 Thread David H




Gary wrote:
On 10/27/05, Chris Withers
[EMAIL PROTECTED]
wrote:
  
  Gary
wrote:
 How do I stop acquisition at the root of my website?
 If I have two websites in zope, and I set the virtual host mapping
to
 www.sitea.com/websites/SiteA
 http://www.sitea.com/websites/SiteA
 www.siteb.com/websites/SiteB

http://www.siteb.com/websites/SiteB

 I don't want my users to get to SiteB from http://www.sitea.com/SiteB

Why not? How would they find a URL like that?


You can't do anything from the Zope side to stop this.
An Apache rewrite rule maybe? You'll need ot be clever mind...

http://www.sitea.com/somefolder/somesubfolder/SiteB/somesitebfolder/etc


...will still work.

Best bet? Don't sweat it, onyl worry about it if it really proves to be
a problem ,which it shouldn't be...

cheers,

Chris

PS: There's always Zope 3 ;-)

  
  
  
Thanks Chris,
  
I don't know how the URL got out. But the web-bots are having so
much fun with my website right now. :(
They are indexing everything for the wrong virtual host. Maybe
robot.txt will stop them.
  
--
Gary
  


Gary,
Are these anonymous access sites? If not then where are your users
defined? BTW, im curious - how does Zope 3 otherwise solve this?
David





___
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] help - my zope build exits with compile errors :-(

2005-10-27 Thread David H

Thomas Wolf wrote:


Hi,

 I'm trying to build Zope-2.7.4-0 from source (I can't use a different 
version because of the releas of Plone we're

using.)  I ran
./configure --with-python=/usr/local/zope/python/bin/python 
--prefix=/usr/local/zope
and that reported no issues.  BTW, I'm using python 2.3.5 - that's why 
I had to use the --use-python argument.


Then I ran make.  No reported problems for quite a bit into the build 
- then I get:


gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes 
-fPIC -I/usr/local/zope/python/include/python2.3 -c 
Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.c 
-o 
/usr/local/zope/Zope-2.7.4-0/build-base/python-2.3/build-temp/Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.o 

gcc: 
Products/PluginIndexes/TextIndex/Splitter/ISO_8859_1_Splitter/src/ISO_8859_1_Splitter.c: 
No such file or directory

gcc: no input files

Sure enough, there's no ISO_8859_1_Splitter.c file - but I haven't got 
a clue why not.  IS this generated by an earlier
part of the build and just didn't?  Or was there something missing 
from the tar ball (I got it off www.zope.org!)


Any help/suggestion would be much appreciated,
Tom

P.S. I'm trying to build this under Solaris 9 using gcc 3.3.2.


Thomas,

I seem to recall something like this.  I think the path + file name for 
sISO_8859_1_Splitter.o is *too long* for the extractor.


David

___
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] Linux/unix preferences question

2005-10-22 Thread David H

Hi List,

I want to soon move from Windox XP to Linux or Unix (intel/amd) for my 
Zope projects.  Just wondering if users experienced with these can 
recommend versions (freeBSD?, SuSe?, Red Hat?  etc)  that plays well 
with Zope and those to avoid.


Thanks,
David


___
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] selected in select lists

2005-10-14 Thread David H

Garry Saddington wrote:


Tino Wildenhain wrote:


Am Freitag, den 14.10.2005, 20:03 +0100 schrieb Garry Saddington:
 


Chris Withers wrote:

  


Garry Saddington wrote:




DTML:
select name=groupabbrev
dtml-in getpastoralgroups
option value=dtml-var thisgroupabbrev dtml-if 
expr=groupabbrev==_.str(thisgroupabbrev) selected/dtml-if 
dtml-var thisgroupabbrev/option

/dtml-in
/select
  


And just for comparison, here's the ZPT:

select name=groupabbrev
   tal:define=abbrev context/groupabbrev
 tal:i repeat=group context/getpastoralgroups
 option tal:define=thisAbbrev group/thisgroupabbrev
 tal:attributes=value thisAbbrev;
 selected python:abbrev==thisAbbrev
 tal:content=thisAbbrev/
/select

Stop using DTML ;-)

Chris




This code does not work;-). If I always work in the ZMI and do not 
collaborate with designers on database web applications where the data
is more important than the presentation, can you give me a good 
reason for not using DTML. I find DTML more intuitive than ZPT and 
once you get the hang of
the namespace magic thing it is not that bad. The ZPT code above 
seems to me more complex and it has defined two new variables, 
whereas the DTML only has two variables

and a string conversion.
Regards
Garry
ps. I would use ZPT if I could see a valid reason to do so.
  



The example above is unfortunatly a bit bad from app design view.
You should either do the comparison in your ZSQL Method
or wrap the call to the ZSQL method in a simple python script.

Then all your ZPT reduces to:

select name=groupabbrev
optiontal:repeat=group here/getpastoralgroups
   tal:attributes=value group/groupabbrev; selected group/selected
   tal:content=thisgroupabbrev Example /option
/select

Which is imho much better to read then the code above.
All you need to do is to deliver True/False, None/Something
for the selected field.
Not doing the comparison in your Template (no matter if DTML
or ZPT) really makes live easier.

You should try to get your Application right independend of
any HTML output. (e.g. you can call the scripts/ZPTs directly
to find out whats going on)

HTH
Tino Wildenhain



 

The comparison is dynamic. The user selects an option, that option is 
passed to a formhandler and hence back to the referring method.  How 
could I not do the comparison in this method? If it could be done in a 
python script as you say, why should I inject another layer of 
complexity into my application when the one dtml method will do the job?
imho such a problem as selected in selects should have a well 
documented solution as many developers will need it and why should 
each one have to find the solution for themselves?
I think Zope is the most important technology on the Internet at 
present, with the possibility to become really huge, but if every 
developer has to search so hard for solutions as I have had to, it 
will forever be a niche product.

regards
Garry

_


Garry,
You argue sucessfully re: DTML vs ZPT on some of the grounds you articulate.
Although the particulars of your app are not so significant.

Calls to python scripts hardly add complexity - its just the opposite..  
Have you noticed a simpler language than python?
An important  issue in my view - is something unexpected to new ZPT 
users:  superior design patterns - especially if you take advantage of 
Macros and Slots.


If you are mid developement i wouldnt suggest making the change now.  
But I do suggest you consider using ZPT when you can - maybe with 
simpler modules at first. 

BTW this very same dispute came up a few months ago and you might google 
for it.


David


___
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 )


  1   2   >