[Zope-dev] New fishbowl proposal: PathIndexes

2001-04-03 Thread Tres Seaver

Please review and comment:

  http://dev.zope.org/Wikis/DevSite/Proposals/PathIndexes

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Optimizing Zope

2001-04-03 Thread Matt Hamilton

On Tue, 3 Apr 2001, Stefan Bambach wrote:

 2.) I tried running zope with apache's cgi, fastcgi over sockets,
 fastcgi over TCP/IP. Result: Slower than only Zope.

Have you tried with a proxy in front? Perhaps try with Squid or Apache as
an accelerating proxy in front, this may help with seving images which
might free the rest of the server up to do other things.

-Matt

-- 
Matt Hamilton [EMAIL PROTECTED]
Netsight Internet Solutions, Ltd.  Business Vision on the Internet
http://www.netsight.co.uk   +44 (0)117 9090901
Web Hosting | Web Design  | Domain Names  |  Co-location  | DB Integration



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Homegrown vs. Storebought

2001-04-03 Thread Edmund Goppelt

I'd like to add two capabilities to my city government web site:

1. users should be able to initiate discussions about legislation
pending before our City Council.  i.e., discussions will be tied to the
relevant bill document.

2. users must register in order to post.  I'd like enough information
so that if someone posts death threats or the like they can be tracked
down.

I don't need threaded discussions (though that would be nice) so I'm
tempted just to roll my own.  Is there anything out there in the way
of easy to use discussion Products that I could pop in to my site
without buying into a gigantic set of associated machinery a la CMF?

As far as enforcing some minimal accountability on the part of
posters, the Membership product seems like my best bet, though there
are some things I'd like to change, e.g., I'd like user info stored in
a SQL db, not Zope, passwords should not be encrypted 'cause I want to
send them out every month, and I want different info. stored about
users than the default properties provided by the Product.  How hard
do you think this would be with Membership?

Are there any other Products I should consider IYO?

Thanks!

-- 

Ed Goppelt

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Page Templates: Any plan how to use PT's for I18n and browser dependant templates etc?

2001-04-03 Thread Johan Carlsson

  How would this effect the page cooking and template cache?
 Cooking isn't affected.  You would naturally want to make your cache
 sensitive to the same REQUEST parameters as the switching script.

Hm. ok.
 
  PS. Page Templates are great but I have yet to figure out
  how to use them with the "Content is folderish" pattern.
 
 You can acquire a template into a content folder, then use "here/" paths to
 access bits of content.  Is that the sort of thing you mean?

You mean like having a "global" index_html template and
tal:content="here/my_content" to get the content?
That would probably work.

Now comes the tricky thing, case I want to render with the tal tags
intact. I just tested that and they are intact after render. Jippi!

The next step I want to do is to save the template back to Zope
and extract some of the tal:content tags and save them back to 
my_content.

I noticed that I can access the macros of a METAL template
after its been cooked (or used anyway). 
Is there anyway to parse a TAL template to extract part form it,
preferably from Python?

TIA/Johan

PS. All this is for my IEMethod product which would benefit 
enormously from TAL


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Page Templates: Any plan how to use PT's for I18n and browser dependant templates etc?

2001-04-03 Thread Evan Simpson

From: "Johan Carlsson" [EMAIL PROTECTED]
 Now comes the tricky thing, case I want to render with the tal tags
 intact. I just tested that and they are intact after render. Jippi!

This will be optional in ZPT 1.1, most likely.

 The next step I want to do is to save the template back to Zope
 and extract some of the tal:content tags and save them back to
 my_content.

Wha?  You want to parse out the rendered contents of some tags and save
them?  Will the user be editing the rendered page somehow?

 I noticed that I can access the macros of a METAL template
 after its been cooked (or used anyway).
 Is there anyway to parse a TAL template to extract part form it,
 preferably from Python?

You could use the same code that TAL itself does, I guess.  What are you
trying to accomplish?

Cheers,

Evan @ digicool  4-am


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Page Templates: Any plan how to use PT's for I18n and browser dependant templates etc?

2001-04-03 Thread Johan Carlsson

 From: "Johan Carlsson" [EMAIL PROTECTED]
  Now comes the tricky thing, case I want to render with the tal tags
  intact. I just tested that and they are intact after render. Jippi!
 
 This will be optional in ZPT 1.1, most likely.
 
  The next step I want to do is to save the template back to Zope
  and extract some of the tal:content tags and save them back to
  my_content.
 
 Wha?  You want to parse out the rendered contents of some tags and save
 them?  Will the user be editing the rendered page somehow?

Yes. With the DHTML Editing Component I can turn element
in to editable by setting the contenteditable property while
setting all non editable elements to unselectable (to not 
mess with the current selection while using the UI).
 
  I noticed that I can access the macros of a METAL template
  after its been cooked (or used anyway).
  Is there anyway to parse a TAL template to extract part form it,
  preferably from Python?
 
 You could use the same code that TAL itself does, I guess.  What are you
 trying to accomplish?

A WYSIWYG editor in IE5.5 based on DHTML Editing Component.

Regards,
Johan, whos apperently sleeping with the devil


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Form error handling for Rack-stored PD classes in O-O application

2001-04-03 Thread Itai Tavor

Hi,

I often have more luck the second time I ask a question... let's see 
if this rule holds.

I'm struggling with checking and reporting errors in forms that 
create or modify properties of PD classes in a ZPatterns application.

Automatic checks using Zope's built-in constraints or something like 
ValueHandler won't cut it, because they can't cover all the required 
rules - for example, checking if a Product SKU is being set to an 
existing SKU, or that a Customer is trying to use an email address 
already in use (and also because I want to return the form page with 
the errors indicated, rather than a generic error page). So I need a 
specific verification method for each class. This method will be used 
both when an object is edited and when its created. To use the method 
when creating an object, I either have to place it in the Specialist 
- which is bad, because the PD class should provide its validation 
code, or call it at commit time, using a SkinScript WHEN OBJECT 
CREATED,CHANGED clause. But verification methods called at commit 
time do their checks on the object properties, not on any submitted 
form field values. So they can test that a password is reasonably 
secure, but can't check that passwords typed in two form fields are 
identical.

One thing I can do is define a editInstance method which would verify 
the values in REQUEST.form and then call manage_changeProperties, or 
store a list of errors in the REQUEST and raise a 'FormError' 
exception. But I can't let this exception propagate freely, I have to 
catch it so I can display an appropriate error page. Also, if a form 
results in the creation of more than one object, I want to display 
all the errors that result from the creation of all the objects, but 
if the first object raises an exception, I can't create the second 
one (especially if the second one expects to get the id of the first).

Or I could forget about exceptions and simply return an error list 
from editInstance. Then it would be up to the method calling 
editInstance to raise an exception to roll back the created objects.

This is the only workable solution I got at the moment... I can get 
it to work, but I've chased solutions in the past that seemed good 
but ended up crashing... so I'd really appreciate any comments on 
possible flaws or problems I'm not seeing, or any other, better 
solutions.

This is what it would look like (just an example, not showing cases 
where more complex stuff happens, like 2 objects being created with a 
single form):

In Customer (DataSkin PD class):

 def editInstance(self, REQUEST, errors):
 err = self.verify(REQUEST)
 if err != {}:
 errors.update(err)
 else:
 self.manage_changeProperties(REQUEST)

 def editInstance_html(self, REQUEST, RESPONSE):
 """Action method for editInstanceForm_html"""
 errors = {}
 self.editInstance(REQUEST, errors)
 if errors != {}:
 html = self.editInstanceForm_html(self, REQUEST, errors=errors)
 raise 'FormError', html
 RESPONSE.redirect('editInstanceForm_html?message=Changes%20saved.')

 def verify(self, REQUEST):
 errors = {}
 if REQUEST['name'] == '':
 errors['name'] = 'Please provide a name'
 return errors

In CustomerManager (Specialist):

 addCustomer(self, REQUEST, errors):
 ni = self.defaultRack.newItem()
 ni.editInstance(REQUEST, errors)
 return ni

 addCustomer_html(self, REQUEST, RESPONSE):
 """Action method for addCustomerForm_html"""
 errors = {}
 ni = self.addCustomer(REQUEST, errors)
 if errors != {}:
 html = self.addCustomerForm_html(self, REQUEST, errors=errors)
 raise 'FormError', html
 
RESPONSE.redirect('manageInstances_html?message=New%20customer%20created.')

And, of course, I can also have WHEN OBJECT ADDED,CHANGED CALL 
self.ensure_valid(), to catch anything that might get by the above 
checks. ensure_valid will raise its own error page, independent of 
the above.


TIA for any help/comments

Itai
-- 
--
Itai Tavor  -- "Je sautille, donc je suis."--
[EMAIL PROTECTED]--   - Kermit the Frog --
-- 'Supposing a tree fell down, Pooh, when we were underneath it?' --
-- 'Supposing it didn't,' said Pooh after careful thought. --


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )