Re: [Zope] Atomic ZSQL on Zope 2.7.5

2006-04-25 Thread Floyd May

Philip Kilner wrote:

Hi Andreas,

Andreas Jung wrote:

For some reason I thought ZSQL method calls were atomic, but they appear
otherwise.

What do you mean by atomic? ZSQL are handled by the database adaper
which is usually tied to the transaction manager of the ZODB.



I'm too tired to find the words, so cut and pasted from answers.com: -

Indivisible. An atomic operation, or atomicity, implies an operation
that must be performed entirely or not at all. For example, if machine
failure prevents a transaction to be processed to completion, the system
will be rolled back to the start of the transaction.

Like Michael, I had understood that ZSQL database transactions were tied
into Zope transactions, and would fail or succeed as a whole. Like him,
I have found that - at least with this combination of DA  RDBMS - this
is not so. I work around it, as I always do when a Microsoft product is
involved. If I hit the same thing with PostgreSQL, I'll look into it
deeper...




I was under the impression that ZSQL methods were very much intended to 
be atomic:

http://www.plope.com/Books/2_7Edition/RelationalDatabases.stx#2-77


I know that it's been atomic to the point of frustration when working 
with Zope and MySQL.  Perhaps the database adapter is at fault here?


--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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 page whitespace removal

2006-04-13 Thread Floyd May

Paul Winkler wrote:

On Wed, Apr 12, 2006 at 01:56:58PM -0500, Floyd May wrote:
One solution I've found is to buffer the writes to REQUEST.RESPONSE by 
using a python script which the calls granular page templates rather 
than a single monolithic template, and outputting the results 25k at a 
time or so; it gives the rest of the server some time to catch up. 


Note that this doesn't buy you any improved responsiveness
if you're running behind e.g. apache, because apache has to
read the entire response from Zope before it starts sending it
back to the client.



Wasn't aware of that, but I've tested it from behind Squid, and it works 
like a charm.


--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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 page whitespace removal

2006-04-12 Thread Floyd May

Robert (Jamie) Munro wrote:

Dieter Maurer wrote:

Robert (Jamie) Munro wrote at 2006-4-10 13:14 +0100:


For example, I downloaded the www.plone.org home page and it was 47704
bytes. I removed all whitespace from the beginning and end of lines, and
then removed blank lines, and it was down to 35087 bytes - that's a more
than 25% saving, and the output renders exactly the same in web
browsers.

A much more efficient way is to activate gzip compression
for your pages. It not only handles white space efficiently
(and correct for e.g. pages with pre tags or similar CSS directives)
it also compresses other text. You not only gain 25 % but about 70 %
(in the size of requests).


gzip will add enormous processing overhead to the server. Striping
spaces will add negligible overhead, likely less overhead than it saves.


Doubtful.  If high-throughput servers can encrypt and decrypt SSL 
traffic, gzip isn't going to be a problem.  The difference between 
running gzip versus htmltidy shouldn't even be significantly noticeable 
on a sufficiently-powered server.  I know that super-high throughput 
sites (e.g. Google) intentionally break some standards to save bandwidth 
(where omitting '/body/html' could save gigabytes per day), but if 
you're in a situation like that, Zope probably isn't for you anyway.



You will not save RAM on the server side (of course), but
hopefully (and very likely) the scripts are not the major
user of RAM on your site.


I have written TAL that produces very large dumps of XML data in the
past, even whole sites. It's a really nice way to dump data from a
database (SQL or Zope DB), but Zope has to build the whole output in RAM
before sending any of it, so it can cause the site to crash.


One solution I've found is to buffer the writes to REQUEST.RESPONSE by 
using a python script which the calls granular page templates rather 
than a single monolithic template, and outputting the results 25k at a 
time or so; it gives the rest of the server some time to catch up. 
However, the point you bring up has nothing to do with whether or not 
the output has significant whitespace in it -- double or triple the 
amount of data sent, and you're still in the same boat.  If you're this 
concerned about bandwidth, you're probably using the wrong tool for the job.



I would
hope in this kind of case that the TAL is the major user of RAM on the
site, so any saving would be really good, but it all cases (except pre
tags, which I would never use) it seems like a possibly significant gain.


There's a reason for TAL being rendered and stored before it's sent. 
Zope is an *Application Server*.  If there's an error in rendering, it 
gives the server an opportunity to handle this case gracefully in an 
*Application-Specific* way, rather than sending a half-finished page to 
the browser followed by an error message that will be rendered 
God-knows-how to the user.  If you render  store before sending, you 
can catch rendering errors and handle them gracefully.


--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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] calling a product with xmlrpc

2006-04-11 Thread Floyd May

Paul Winkler wrote:

On Tue, Apr 11, 2006 at 05:54:35PM +0200, Reinoud van Leeuwen wrote:

[...]
This however generates a NotFound Exception :-(


I'm not sure why you get NotFound, but one thing I spotted is that
anything you want to publish in zope 2 must have a docstring.



I've ran into situations where lack-of-docstring results in a NotFound. 
   Not saying that this is the sole culprit of the trouble, but it's 
certainly worth knowing.



--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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 crashes on request of certain page

2006-04-07 Thread Floyd May

Sven Jacobs wrote:

Dear Zope list,

I have a serious problem with Zope. Every time a certain page is 
requested by a web browser for the second or third time (first time 
always works) the whole Zope server crashes :-(


The only thing special about this page are calls of external Python 
methods from a custom extension. These methods don't do any special 
magic. They just open a MySQL database (using the MySQLdb module version 
0.9.1) and return some HTML output.


I was able to catch a somewhat informative error message when Zope was 
running in debug mode:


2006-03-27T12:18:57 PANIC(300) z2 Startup exception
Traceback (innermost last):
  File /opt/zope/z2.py, line 495, in ?
(Object: ZLogger)
  File string, line 1, in ?
  File /opt/zope/lib/python/Zope/__init__.py, line 37, in ?
  File /opt/zope/lib/python/ZODB/FileStorage.py, line 202, in __init__
  File /opt/zope/lib/python/ZODB/lock_file.py, line 29, in lock_file
StorageSystemError: Could not lock the database file.  There must be
another process that has opened the file.

Operating system is SuSE Linux 8.0, Zope version is 2.5.0, Python 2.2, 
MySQL 3.23.48. I know, pretty old but upgrading any of these software 
components should be avoided due to emerging costs unless absolutely 
necessary!


So if you have any idea how to fix this problem besides upgrade to the 
newest versions I would be glad to here from you!


Thank you very much!



Use a MySQL database adapter in Zope, and use ZSQL Methods to retrieve 
data from the database.

See here:
http://www.plope.com/Books/2_7Edition/RelationalDatabases.stx

HTH!

--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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] Strange behavior with TAL and python: expressions

2006-03-30 Thread Floyd May
Great and mighty Zope gurus,

I have a template which calls a macro.  Within the template, I
tal:define a variable, 'form'.  Within the macro, the 'form' variable
(which is an FSForm object) is defined as None unless I access it
using python expressions.  If I attempt to do anything with attributes
of 'form', I get an AttributeError indicating that the NoneType
object, form, doesn't have the attribute that I'm looking for. 
However, I can use 'form' any way I want inside the template that
calls the macro.  It seems that the macro call somehow lost part of
the information associated with the 'form' variable.

I worked around the problem by defining form using a python expression
instead of a pure TALES expression.  I was also able to work around
the issue by accessing 'form' within the macro using python
expressions instead of TALES.  Why would this happen?  Is this
expected?

I'm using Zope 2.7.5 and Formulator 1.9.  I'm not sure what other
products to list here; this seems like a ZPT-related thing.  Please
let me know if there is any more information I can provide.

Thanks!

--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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] About Archetypes

2006-03-15 Thread Floyd May
On 3/15/06, Sergio Gomez [EMAIL PROTECTED] wrote:
 Does anybody know a good tutorial on how to write archetypes from scratch?

There is a rather dated developers' guide at plone.org:
http://plone.org/products/archetypes/documentation/old/ArchetypesDeveloperGuide/index_html

I would recommend playing with ArchGenXML, seeing how it works, and
using it to either:
1. Generate all your classes and relationships
2. Learn how things are done so that you can write AT-based stuff from scratch.

The developers' guide that I mentioned above has been very helpful,
especially when writing page templates.

Also, there's an Archetypes-users mailing list for these kind of questions:
http://lists.sourceforge.net/lists/listinfo/archetypes-users

The #plone channel on irc.freenode.net is also very helpful when
dealing with Archetypes.

--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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: Re: major problems placing authentication on an extranet site-security flaw?

2006-02-16 Thread Floyd May
It's been said a million times in a million different ways, so let's
tick that counter one more time and make it a million and one:

DON'T FEED THE TROLLS.

http://img18.photobucket.com/albums/v55/krazykit/2004-03-22_104550_troll.gif

--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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] [Getting OT] major problems placing authentication on an extranet site-security flaw?

2006-02-16 Thread Floyd May
On 2/16/06, michael nt milne [EMAIL PROTECTED] wrote:
 yeah, take his advice Chris :-)


 On 2/16/06, Floyd May [EMAIL PROTECTED] wrote:
  It's been said a million times in a million different ways, so let's
  tick that counter one more time and make it a million and one:
 
  DON'T FEED THE TROLLS.
 
 
 http://img18.photobucket.com/albums/v55/krazykit/2004-03-22_104550_troll.gif
 
  --
  Floyd May
  Senior Systems Analyst
  CTLN - CareerTech Learning Network
  [EMAIL PROTECTED]
  ___
  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 )
 



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




Michael's response reminds me of being a teenager in a small town. 
There was a man there that owned a junkyard.  Rather than attempt to
maintain weed control with herbicides or a weedeater, the man bought a
goat.  The goat began eating weeds and making a wonderful dent in the
overgrown areas of the junkyard, giving the man more space for his
business.  Furthermore, the goat became somewhat of a mascot, and
customers would bring a carrot or a handful of veggies to feed the
goat whenever they visited the junkyard.  The goat was friendly, and
would greet customers, happily bleating and begging for treats.  The
goat's horns, however, had a tendency to scratch the paint of their
vehicles, so the junkyard owner wrapped the goat's horns in duct tape.
 This worked wonderfully, until the junkyard owner bought another goat
to clean up a newly-acquired adjacent plot of land -- the goats ate
the duct tape from each others' horns.

Goats, like trolls, will eat almost anything.

--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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: major problems placing authentication on an extranet site-security flaw?

2006-02-10 Thread Floyd May
.  The complexity of Zope's
security features is INTENTIONAL, and will not change, especially not
to suit the needs of a disrespectful leech like yourself (and I use
the word 'leech' to indicate that you expect it is perfectly fine to
take from the Zope community without giving back).

Consider these words long and hard before posting again.

--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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] about zope and mouse event handling

2006-02-10 Thread Floyd May
On 2/10/06, Tino Wildenhain [EMAIL PROTECTED] wrote:
 ... maybe if there is a chapter about
 image manipulation on the fly with PIL (python imaging lib)


I believe that Plone (or Plohn as it seems to be called by Zope people
;-) ) has some product(s) somewhere that make use of PIL.  Here's a
VERY brief page on it:
http://plone.org/documentation/tutorial/richdocument/pil

It's definitely possible to hook PIL into Zope, and it's been done in
the past.  You should be able to find some documentation or perhaps a
product or two that uses it.

--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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] zserver-threads

2006-01-31 Thread Floyd May
On 1/31/06, Jake [EMAIL PROTECTED] wrote:
Am I gleaming from that that you are proposing a less-is-more approach tothreads?Here is what I have been using:- Zope 2.7.8 (Plone 2.1.2)- RH Linux- AMD Athlon 64 3200+ 2.0 GHz- 2GB DDR RAM
- 120,000 hits a day- 392,036 objects in database- 2 threads- 100,000 object cache sizeThis seems to eat up about half of the RAM on the server.Would one thread but double the cache size do better?
Jake___http://www.ZopeZone.comOn Tue, January 31, 2006 2:40 pm, Dieter Maurer said: Jens Vagelpohl wrote at 2006-1-31 15:07 +:
On 31 Jan 2006, at 15:01, Jake wrote: http://plone.org/documentation/how-to/threads-vs-cache-size
That article contains little information to back up the conclusions,and some of it is patently wrong. Another case of hearsay and half-thruths being propagated by well-meaning but uninformed parties.
 There is a convincing example (I think from Matt Kromer) what happens to mean response time when the number of threads is increased from 1 to 2: Assume you have 2 units of work. If you have a single
 thread, 1 unit is done, then the second. The mean response time is (1 + 2) / 2 = 1.5. Now assume you have two threads (but a single processor). Both threads work (quasi) parallel but have only half of the
 processor power. Both will take 2 time units to perform their unit of work. The mean response time is (2 + 2) / 2 = 2. You get the same ratios whenever you double the number of threads
 (but keep the number of processors and all your work is CPU bound). Things become more difficult when you have a mix of very small requests and very long requests. You then may want a higher
 level of concurrency to not let the small requests being blocked by the long ones. -- Dieter ___ Zope maillist-
Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding!** (Related lists -
http://mail.zope.org/mailman/listinfo/zope-announcehttp://mail.zope.org/mailman/listinfo/zope-dev
 )___Zope maillist-Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding!**(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce 
http://mail.zope.org/mailman/listinfo/zope-dev )I would recommend exploring ZEO and Squid if you're *this* worried about performance. There's only so much that one machine can do. If I understand the Zope framework, the idea is that read-to-write ratio for the ZODB is going to be much greater than one, meaning that there are going to be a lot more reads than writes. In this case, having some load balancing and ZEO client caching will make overall performance faster. However, if you're doing lots of writing to the ZODB, you'll probably need to explore ZEO even more in the area of mounting different ZODBs at different places in your ZEO clients' trees.
Like some of the other people said, you probably should just tune it as needed. It's also a Bad Thing to be running your servers at or near capacity; you should leave plenty of headspace for usage spikes. I've certainly run into situations where Zope stuff was processor-bound and slowing everything down, but the RAM wasn't even 25% full. In cases like this, more zserver threads (or more ZEO clients) helps even things out. YMMV.
-- Floyd MaySenior Systems AnalystCTLN - CareerTech Learning Network[EMAIL PROTECTED]
___
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] zopectl or runzope just won't start zope

2005-12-14 Thread Floyd May
First, I would recommend against changing anything in any file at this point except configuration files.

Next, verify that the correct python version is being used. It's
easy to have two pythons side-by-side on the same linux system.
If you built Zope from source, you (probably) should build python from
source as well. However, if you used an installable package for
Zope, I would recommend staying with whatever version pairing of
Zope/Python that your Linux distribution has by default. It's
simpler that way, and will probably solve your problem. I know
that I've built Zope before where it's pointed at the wrong python
version, and got things all screwed up for me. Use `which
python` -V (those are backtics) to figure out the version that your
$PATH points to by default.

If you *are* building from source, verify that you used
--with-python=/path/to/python2.3.5 when you ran the configure script
for Zope. The configure script should(?) tell you if there's a
problem with any module dependencies. Again, if building Zope
from source, it's probably best that you use a python built from source
as well.

Good Luck!
fmOn 12/14/05, Qass [EMAIL PROTECTED] wrote:
Hi:I'm new to zope and yesterday installed zope 2.8.4 on a linux systemrunning python 2.3.5Having followed installation instructions I got to the point of'zopectl start' and got the following error message while trying both
'runzope' and 'zopectl'.I've tried installing different versions of Zope and get the sameerror (error absent with Zope 3). At one point, Zope did start (Imoved it to a different port) but when I tried installing Plone in the
Products directory of the zope instance, the 'Plone Site' did not showup in the drop down menu on the right hand side of the ZMI. Which iswhy I decided to reinstall and have been getting errors since. Ihaven't messed around with the Python installation at all.
In this latest install I ran 'make instance' intead of 'make install'just to see if I would get the same error as I did yesterday when Ihad an instance of Zope running and I did.Any help in trying to fix this would be highly appreciated. I've tried
changing PYTHONPATH in the zopectl file but that just leads to moreand more errors.Traceback (most recent call last):File /blah//Zope-2.8.4-final/lib/python/Zope2/Startup/run.py, line 56, in ?
run()File /blah/Zope-2.8.4-final/lib/python/Zope2/Startup/run.py, line 17, in runimport Zope2.StartupFile /blah/Zope-2.8.4-final/lib/python/Zope2/__init__.py, line 60, in ?
from Zope2.Startup.run import configureFile /network/share/home/sra/Zope-2.8.4-final/lib/python/Zope2/Startup/__init__.py,line 24, in ?import ZConfigFile /blah/Zope-2.8.4-final
/lib/python/ZConfig/__init__.py, line 21, in ?from ZConfig.loader import loadConfig, loadConfigFileFile /blah/Zope-2.8.4-final/lib/python/ZConfig/loader.py, line 23, in ?import ZConfig.datatypes
File /blah/Zope-2.8.4-final/lib/python/ZConfig/datatypes.py, line 19, in ?import datetimeFile /blah/Zope-2.8.4-final/lib/python/DateTime/__init__.py, line 13, in ?from DateTime import DateTime
File /blah/Zope-2.8.4-final/lib/python/DateTime/DateTime.py, line 21, in ?from datetime import datetimeFile /blah/Zope-2.8.4-final/lib/python/DateTime/DateTime.py, line 21, in ?
from datetime import datetimeImportError: cannot import name datetimeThank you very much for your help.Qass___Zope maillist-
Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope** No cross posts or HTML encoding!**(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )-- 
Floyd MaySenior Systems AnalystCTLN - CareerTech Learning Network[EMAIL PROTECTED]
___
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] msSql and python

2005-11-10 Thread Floyd May
You can pass arguments to ZSQL Methods.  In this particular case, I
assume that you don't want the WHERE clause in the query if the
'description' parameter is not passed?

You can do it like this (inside the query):
--8
dtml-if description
WHERE description = dtml-sqlvar description type=string
/dtml-if
--8

Then, inside your python script:
--8
desc = 'some string'
context.path.to.query.queryname(description=desc)
--8

Hope that helps!

fm

On 11/10/05, Kate Legere [EMAIL PROTECTED] wrote:
 I have a zsql method to which I want to pass and argument. Normally I do it
 from a dtml method and the use something like this to test for equality.

 WHERE  description = dtml-sqlvar description type=string.

 However, I'm passing the variable from a python script and it won't accept
 the dtml tag what do I put in the equality test?




 Kate

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

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


[Zope] Debugging security settings in .metadata files

2005-10-27 Thread Floyd May
I have a set of files - page templates, python scripts, and zsql
methods - that are set up as filesystem objects.  I'm having trouble
getting the security set the way I want it to be with the .metadata
files.  Here is the content of my .metadata files:
--8-
[security]
View = 0:Manager
Access contents information = 0:Manager
Access Contents Cnformation = 0:Manager
-8--

However, I can still access my content through an anonymous context. 
Can anyone give me some ideas about debugging my situation?  Thanks!

Zope 2.7.7-final, python 2.3.5, freebsd5
CMF 1.4.8

fm
___
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] Debugging security settings in .metadata files

2005-10-27 Thread Floyd May
 I don't know what you're doing with the third line...
Me neither, typo.

 Check what it looks like in the ZMI. This will tell you whether or not
 the problem is in getting the permissions set like you expect.

Filesystem objects don't have a security tab in the ZMI (or at least,
these don't).  Should one be there?

fm


On 10/27/05, J Cameron Cooper [EMAIL PROTECTED] wrote:
 Floyd May wrote:
  I have a set of files - page templates, python scripts, and zsql
  methods - that are set up as filesystem objects.  I'm having trouble
  getting the security set the way I want it to be with the .metadata
  files.  Here is the content of my .metadata files:
  --8-
  [security]
  View = 0:Manager
  Access contents information = 0:Manager
  Access Contents Cnformation = 0:Manager
  -8--
 
  However, I can still access my content through an anonymous context.
  Can anyone give me some ideas about debugging my situation?  Thanks!
 
  Zope 2.7.7-final, python 2.3.5, freebsd5
  CMF 1.4.8

 Looks okay to me, though I don't know what you're doing with the third line.

 Check what it looks like in the ZMI. This will tell you whether or not
 the problem is in getting the permissions set like you expect.

 --jcc
 --
 Building Websites with Plone
 http://plonebook.packtpub.com/

 Enfold Systems, LLC
 http://www.enfoldsystems.com

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


[Zope] Re: Filesystem Page Template lowercase-ifying all my tags

2005-10-26 Thread Floyd May
An update -
It appears as though this problem is due to the content-type being set
inappropriately (probably text/html).  I'm attempting to render XML,
but each of the templates only contains a piece of my final output XML
file; therefore, I don't have the '?xml ... ?' header in the file. 
From a perusal of the source for FSPageTemplate, this appears to be
the only way to get the Content-Type set to 'text/xml'.  Basically,
I'm constructing a VERY large XML file using a python script that
buffers writes to REQUEST.RESPONSE.  The script calls the page
templates, and then writes the rendered page templates to
REQUEST.RESPONSE through the buffering mechanism.

I have attempted adding .metadata files for each of my templates, with
the following content:
---8--
[default]
content_type=text/xml
---8--
It didn't work.  I'm still at a loss for how to make this all happen,
I can't have my XML tags get lower-case-ified.  Please help!

 Zope 2.7.7-final, python 2.3.5, freebsd5
 Page Templates 1.4.0
CMF 1.4.8

fm

On 10/25/05, Floyd May [EMAIL PROTECTED] wrote:
 I have a product that installs some filesystem page templates into a plone 
 site's portal_skins.  The templates are exactly the same as their 
 created-through-ZMI counterparts, yet the filesystem templates render with 
 all their tags lower-cased, whereas the ZMI-created templates preserve case.  
 Why is this happening?

  Zope 2.7.7-final, python 2.3.5, freebsd5
  Page Templates 1.4.0

  Thanks!
  fm

___
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: Filesystem Page Template lowercase-ifying all my tags

2005-10-26 Thread Floyd May
I found a way to hack around it.  It's definitely ugly, though.

Basically, I have a python script that calls page templates and
buffers the results as it writes out to REQUEST.RESPONSE.  Each page
template is *just a portion* of my final output XML file.  Since all
of the scripts and templates that I'm using are read from the
filesystem, they are the filesystem-equivalents to the ZODB-stored
objects.

Specifically, I discovered that the FSPageTemplate from CMFCore will
set the content_type attribute on the object to 'text/xml' if the file
begins with '?xml'.  Otherwise, when it sees the xml-or-html-looking
content, it assumes a content_type of 'text/html', which lowercases
all the tags.

So I added an xml header to all of my page templates, and I strip it
back out inside the python script that calls the template (so that I
don't have the XML header repeated over and over in my final output
XML file).  Ugly, yes, but it does work.

fm

On 10/26/05, Fred Drake [EMAIL PROTECTED] wrote:
 On 10/26/05, Floyd May [EMAIL PROTECTED] wrote:
  It appears as though this problem is due to the content-type being set
  inappropriately (probably text/html).  I'm attempting to render XML,
  but each of the templates only contains a piece of my final output XML
  file; therefore, I don't have the '?xml ... ?' header in the file.
  From a perusal of the source for FSPageTemplate, this appears to be
  the only way to get the Content-Type set to 'text/xml'.  Basically,

 Unfortunately, that's true for the current code.  Julien Anguenot and
 I started working on this problem (along with some other aspects of
 the XML vs. HTML behavior) based on the Zope 3 implementation for page
 templates.  The work isn't done yet, though the aspect you're
 interested in is pretty straightforward.

 That's only for the Zope 3 version of the code, however.  For now,
 your best bet may be to subclass the PageTemplateFile class (or
 whichever derived class of that that's relevant to you) and override
 the _cook_check() method to do what you need it to do.  If you're
 using a file-system view, you likely need to arrange for your new
 class to be used for some new filename extension; I'm not sure how to
 arrange for that.


   -Fred

 --
 Fred L. Drake, Jr.fdrake at gmail.com
 Society attacks early, when the individual is helpless. --B.F. Skinner

___
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] Filesystem Page Template lowercase-ifying all my tags

2005-10-25 Thread Floyd May
I have a product that installs some filesystem page templates into a
plone site's portal_skins. The templates are exactly the same as
their created-through-ZMI counterparts, yet the filesystem templates
render with all their tags lower-cased, whereas the ZMI-created
templates preserve case. Why is this happening?

Zope 2.7.7-final, python 2.3.5, freebsd5
Page Templates 1.4.0

Thanks!
fm
___
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] Using the set object within page templates

2005-09-26 Thread Floyd May
How can I use a set object within a page template?

When I attempt to create a set (e.g. tal:define=myset
python:set(some_list)), zope complains that the name 'set' is not
defined.

Thanks!

fm
___
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] Using the set object within page templates

2005-09-26 Thread Floyd May
Is there no way to allow sets to be used within templates/scripts?

fm

 Andreas Jung [EMAIL PROTECTED] 9/26/2005 1:41:18 PM 
Python sets are not available from with ZPT since ZPT and
PythonScripts
run within a sandbox. Write an external method or move your code to
trusted code (Zope product).

-aj

--On 26. September 2005 13:38:55 -0500 Floyd May
[EMAIL PROTECTED]
wrote:

 How can I use a set object within a page template?

 When I attempt to create a set (e.g. tal:define=myset
 python:set(some_list)), zope complains that the name 'set' is not
 defined.

 Thanks!

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



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