Re: [Zope] Want to access ZClass Instance from external program

2000-10-18 Thread Ender

Jon Prettyman wrote:
 
 Well, I've gotten xmlprclib and fixed it up so I can talk to my
 server.  So far I can retrieve objectIds and retrieve objects via an
 objectid, but I can't figure out how to get to the property sheets.
 
 Here's what I've got:
 
 server = Server( "http://jonprettyman.com" )
 
 print server
 
 for k,v in
 server.EBQ.id_company_apply_html.propertysheets.common.propertyItems():
 print "%-15s: %s" % (k, v)
 
 My ZClass has a propertysheet named ``common''
 
 The error I get is:
   -2 Unexpected Zope Error Value
 
 and a bunch of HTML which boils down to:
 
Resource not found
 
 -jon

hmmm...

try and take it a step back and query the propertysheet container for
 names of propertysheets it contains. you'll need to check out the ZQR 
for the syntax, i think its propertyIds().


you might also want to check that your authenticating with a user
that has the proper security roles to query this info. 


if you're still having problems tell me and i'll play with it once i get
back from work.

Cheers

Kapil

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




Re: [Zope] Want to access ZClass Instance from external program

2000-10-18 Thread Ender

Sorry Jon, i've lead you down a slippery slope...

unlike ttw dtml-methods and the rest of zope which relies on the
security context soley, for a filesys python method to be exposed
through the web via xml-rpc it must have a doc string as well as have
proper credentials.

looking through propertysheets there is no 'proper' way to do this...
but i lead you down the path, so here is a way back out... 

there are a couple of options.

the easiest is to have dtml_method for this zclass that functions as a
helper method, 
like

dtml method -- external_helper

dtml-var "propertysheets.propertyMap()"

and in the client

x = root.subfolder.zclass.external_helper()
meta_info=eval(x)
print meta_info
({'id': 'vvv', 'type': 'int', 'meta': {}, 'mode': 'w'}, {'id': 'aaa',
'type': 'lines', 'meta': {}, 'mode': 'w'}, {'id': '', 'type':
'tokens', 'meta': {}, 'mode': 'w'}, {'id': '122', 'type': 'date',
'meta': {}, 'mode': 'w'}, {'id': 'ff', 'type': 'float', 'meta': {},
'mode': 'w'}, {'id': '', 'type': 'text', 'meta': {}, 'mode': 'w'})

or if external_helper returned propertyItems()

[('vvv', 1), ('aaa', ['']), ('', ['ss', 'aa1113', '3', '4']),
('122', DateTime('1900/01/01')), ('ff', 455.0), ('', '')]


if you're working with DateTime values in your propertysheets this will
be trickier as you'll need to either retrieve the property you want
independently or import Zope's DateTime module. also remember to set the
security on the helper method so its not helping somebody hack your
site.

the rest of the ways are exercises in wasting time... IMO

hope that helps out

Cheers

Kapil

Jon Prettyman wrote:
 
 Adding:
 try:
 for k in
 server.EBQ.id_company_apply_html.propertysheets.propertyIds():
 print "%-15s:" % (k)
 except Error, v:
 print server
 print "ERROR", v
 
 Gives me output, although I'm pretty shure it's not the right thing.
 Output:
title
base
 
 Both of these are properties of server.EBQ.
 
 -jon
 
 Ender [EMAIL PROTECTED] writes:
 
  Jon Prettyman wrote:
  
   Well, I've gotten xmlprclib and fixed it up so I can talk to my
   server.  So far I can retrieve objectIds and retrieve objects via an
   objectid, but I can't figure out how to get to the property sheets.
  
   Here's what I've got:
  
   server = Server( "http://jonprettyman.com" )
  
   print server
  
   for k,v in
   server.EBQ.id_company_apply_html.propertysheets.common.propertyItems():
   print "%-15s: %s" % (k, v)
   -jon
 
  hmmm...
 
  try and take it a step back and query the propertysheet container for
   names of propertysheets it contains. you'll need to check out the ZQR
  for the syntax, i think its propertyIds().
 
 
  you might also want to check that your authenticating with a user
  that has the proper security roles to query this info.
 
 
  if you're still having problems tell me and i'll play with it once i get
  back from work.
 
  Cheers
 
  Kapil
 
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope-dev )
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Multiple queries in a ZSQL method?

2000-10-22 Thread Ender

multiple non-select statements (max 1 select) are done through the use
of

dtml-var sql_delimiter

kapil

Noah wrote:
 
 Hi,
 
 I'm using MySQL.  I need to have a ZSQL Method that does an insert and a select in 
one call.
 After I do an insert I need to check the LAST_INSERT_ID to get the primary key of the
 record that I just inserted. Something like this:
 
 insert into author
 (id, name, sort_name, email, bio, initials)
 values
 (null,
 dtml-sqlvar name type=nb,
 dtml-sqlvar sort_name type=nb,
 dtml-sqlvar email type=nb,
 dtml-sqlvar bio type=nb,
 dtml-sqlvar initials type=nb);
 
 select LAST_INSERT_ID();
 
 If I put this into two different methods then I'm afraid that I will have some
 threading problems due to the fact that another client might come in and
 do an insert using the database connection I was using. LAST_INSERT_ID
 is safe as long as you have an unshared connection. Zope does
 connection pooling, so I worry that using two separate ZSQL Methods
 may not always work. And WILL NOT work if Zope gives me a different connection
 for the second ZSQL call.
 
 Is there a better way to do this?
 
 Yours,
 Noah
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Creating Object

2000-10-22 Thread Ender

Salvatore DIDIO wrote:
 
 Hello,
 
 I am new to Zope
 I've just installed Zope on Linux. I just can't create any object !.
 I receive the following message :
 the object can not be owned by the superuser
 (line 217 in file Owned.py)
 Could someone help me ?
 
 Thank you very much

i feel for you, in zope 2.2 and above the initial account, the
superuser, isn't allowed to create/own objects. 

what you're supposed to do is create a new user in the acl_users of the
root directory which will be your first working account.

after you create a user in acl_users, logout by shutting down the
browser and than try logging into the system with a new browser.

you can escape shutting down the browser by editing one of the existing
methods to have this section of code. when asked to reauthenticate type
in the name of the new user. than click cancel and reload the /manage
page, you should be able to login as the new user.

dtml-raise Unauthorized
Log out
/dtml-raise

Cheers 

Kapil

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




Re: [Zope] Problems with sequence-item

2000-10-22 Thread Ender

I thought at first this might be a permission problem, but after
browsing around the site. i'm pretty sure its a calling issue. its hard
to say for sure given the lack of details.

Taco, i'm pretty sure your objectValues on the addressen folder to fill
in to fill in the addresses of the artiklen document. zope renders these
subtemplates slightly differently than a template called directly by the
browser, when you're calling the addressen subobject from the document
call it like this

dtml-var "addressen.YOURADDRESS(_.None, _)"

or in a dtml-in

dtml-let x=sequence-item
dtml-var "x(_.None,_)"
/dtml-let


if that doesn't solve it for you, than it would be helpful to have the
relevant src of the document. i tried without success to duplicate the
exact same error, but i'm pretty sure that the problem has something to
do with this.


Kapil



Taco Scargo wrote:
 
 Please feel free to look at it at
 
 http://www.gezondheidskrant.nl:8080/mainframe
 
 Taco
 - Original Message -
 From: "Curtis Maloney" [EMAIL PROTECTED]
 To: "Taco Scargo" [EMAIL PROTECTED]; "Mark N. Gibson" [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Sunday, October 22, 2000 6:57 PM
 Subject: Re: [Zope] Problems with sequence-item
  Any chance you could post the WHOLE traceback, so we might be able to see
  which object it's choking on?
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] HELP! Permissions problem, ZClass

2000-10-22 Thread Ender

trying giving anonymous proxy roles on the actual add method.



Eric Walstad wrote:
 
 Help, pls! I have a ZClass that is functioning beautifully if I am logged
 in, but the anonymous user keeps getting prompted for a password.  The
 problem occurs when my DTML method trys to  create a new instance of the
 ZClass.  I tried giving that DTML method a Proxy of "Manager" but that isn't
 helping.
 
 Any pointers?
 
 Thanks,
 
 Eric.
 
 Here's the traceback:
 Zope Error
 
  Zope has encountered an error while publishing this resource.
 
  Unauthorized
 
  You are not authorized to access CNewsItem.
 
  Traceback (innermost last):
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line
 222, in publish_module
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line
 187, in publish
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line
 171, in publish
File /usr/local/Zope/lib/python/ZPublisher/mapply.py, line
 160, in mapply
  (Object: buildNews)
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line
 112, in call_object
  (Object: buildNews)
File /usr/local/Zope/lib/python/OFS/DTMLMethod.py, line 172,
 in __call__
  (Object: buildNews)
File
 /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line 528, in
 __call__
  (Object: buildNews)
File /usr/local/Zope/lib/python/DocumentTemplate/DT_With.py,
 line 146, in render
  (Object: manage_addProduct['NewsItem'])
File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py,
 line 337, in eval
  (Object: CNewsItem_add(_.None, _, NoRedir=1))
  (Info: _)
File string, line 0, in ?
File /usr/local/Zope/lib/python/OFS/DTMLMethod.py, line 168,
 in __call__
  (Object: CNewsItem_add)
File
 /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line 528, in
 __call__
  (Object: CNewsItem_add)
File /usr/local/Zope/lib/python/DocumentTemplate/DT_With.py,
 line 133, in render
  (Object: CNewsItem.createInObjectManager(REQUEST['id'],
 REQUEST))
File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py,
 line 331, in eval
  (Object: CNewsItem.createInObjectManager(REQUEST['id'],
 REQUEST))
  (Info: CNewsItem)
File /usr/local/Zope/lib/python/OFS/DTMLMethod.py, line 194,
 in validate
  (Object: buildNews)
File
 /usr/local/Zope/lib/python/AccessControl/SecurityManager.py, line 139, in
 validate
File
 /usr/local/Zope/lib/python/AccessControl/ZopeSecurityPolicy.py, line 209, in
 validate
  Unauthorized: (see above)
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Looking for short term Zope contractor

2000-10-23 Thread Ender

Hello,

i'm an experienced zope/acs developer in Pasadena,CA. my resume to
follow. 

Cheers

Kapil

Kapil Thangavelu

Contact Information:

[EMAIL PROTECTED]
[EMAIL PROTECTED]

http://lostworld.imeme.net
http://sindev.dhs.org


2445 E. Del Mar 
Apartment 238
Pasadena, CA 91107

(626) 405-9877 (home)


Objective:

To obtain a challenging position in which I can use
my experience in creating community based web applications.

Desired Job:
Full-Time Employee

Preferred Site Location:
Pasadena, CA

Education:

College of William  Mary
BS in Computer Science  History
Graduated May 2000

Professional Skills:
Areas of Expertise:
- very skilled in Python, C, HTML, JavaScript
- very skilled in Zope, Open Source Web Application
Server and
  Oracle/ACS4/Aolserver
- skilled in Java, Perl, C++, XML, TCL/TK
- well-versed in underlying Internet Protocols:
 HTTP(S), TCP/IP, DNS/BIND, DHCP, SMTP, IMAP, POP

Areas of Proficiency:   
- Strong Knowledge of Linux Kernel, multi-threaded
programming,
process management
- RDBMS Design and SQL (PostGresSQL, ORACLE)
- Skilled in Systems Adminstration - Redhat, Mandrake,
Suse
- Knowledgable of different Web Application Platforms:
  Enhydra, Servlets, Apache, AOLServer/ACS, Midguard


Work Experience:

OpenSource Developer - July - August 2000

Developing OpenSource Zope/Python Products. Product releases
include
a Mailman (www.list.org) search/archive, and a NewsSyndication
Product
based on RSS/OCS.

BootCamp - ArsDigita.com - June - July 2000

Participated in the ArsDigita bootcamp. Acquired skills in
Aolserver,
Oracle, Tcl scripting and the ACS community system.

Web Application Developer - ASTi February 2000 - May 2000

Hired by ASTi, member of the Python Consortium, to implement
a prototype of their corporate intranet, designed to manage
project workflow and production. Technologies used
Zope/XML/Python/SQL.

I talked with ASTi employees regarding site requirements and
project
management. I designed and implemented a working prototype to
fufill 
those requirements and the workflow guidelines I was given.
After the 
prototype was build, I turned over the project to their web
master, and
educated him regardings its construction and extensibility.

Some of the things that I designed and implemented and
integrated with
the corporate intranet.

* RDBMS schema for ASTi's parts and production components as
well
as installation and setup of RDBMS (PostgreSQL)

* A validating xml-parser/dom interface for ASTi's internal
project parts.
The Product created subvendor orders based on a customer's
product
spec/purchase order.

* A searchable email archive for communications between ASTi's
sales
engineer and clients.

* A flexible user system, to allow for automatic messaging for
various
phases of workflow and presentation of intranet menus based on
user
roles.



Director of Development - Information Technology @ College of William 
Mary
Fall 1999 - May 2000

www.sin.wm.edu

Selected to be the architect of the next generation Student
Information 
Network at the College, an information portal for students. I
investigated
various Web Application Platforms, before settling on Zope,
Python , and
PostgreSQL, to replace an aging code-base of mod_perl scripts.
Taught
the developers about Zope Architecture and Python and lead them
in
designing and implementing a new functionality and
reimplementation.
Designed and Implemented Session Management(cookie-less), IMAP 
authentication, Team Web Site for Distrvuted Development, 
Online Rideboard, Message Board, Housing Market, Local Jobs.
Choice
of tools, technology, and design/implementation focused on easy
maintenance,
rapid development, and extensibility.


Skills Acquired

- Management of the Software Life Cycle
- Object Oriented esign
- Team Managment

Field Consultant - Technology Support Center @ College of William  mary
Summer 1999 - Spring 2000

Assisted in training of on-call support specialist. Made field
visits 
to various problem sites doing network troubleshooting (DHCP,
SMB, TCP/IP),
operating systems troubleshooting (Linux, WIN98), and
application 
troubleshooting (Email Clients, MS Office).

HTML -PERL/CGI Developer - Information Technology @ College of William 
Mary
Spring 1998- Spring 1999

Designed and Implemented Entertainment Section 

Re: [Zope] Looking for short term Zope contractor

2000-10-23 Thread Ender

Doh!,

i've gotten far to use to hitting reply all on my emails:)

kapil

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




Re: [Zope] One last request

2000-10-23 Thread Ender

Taco Scargo wrote:
 
 I have one unsolved mystery left. What I am trying to do is print the titles
 from the DTML Documents in the 'artikelen' folder (and actually another
 property called 'inleiding'. I believe the code below should do this, but it
 does not work. It returns 'Zope' instead of the title. If I use the
 'inleiding' property it reports that it does not exist. If I just use
 sequence-item it returns the complete item ok.
 
 Any clues ?
 
 Thanks,
 
 Taco
 
 http://www.gezondheidskrant.nl:8080/mainframe :
 dtml-let articleList="[]"
 
 dtml-in "artikelen.objectValues(['DTML Document'])" sort=publiceren_vanaf
 dtml-call "articleList.append(_['sequence-item'])"
 /dtml-in
 
 dtml-in "articleList[-4:]" reverse
dtml-let theDocument=sequence-item
dtml-var "theDocument.title"
dtml-var "theDocument.inleiding"
/dtml-let
 /dtml-in
 
 /dtml-let


try this instead

dtml-in "artikelen.objectValues(['DTML Document'])"
sort=publiceren_vanaf size=4 reverse
dtml-var title
dtml-var inleiding
/dtml-in


kapil

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




Re: [Zope] Modifiable local variables

2000-10-24 Thread Ender

Sean McGrath wrote:
 
 Hello all,
 
 I am trying to use the DTML engine outside of Zope, and would like to be
 able to create local variables in my DTML documents. Because I have no
 access to Zope, I can't do REQUEST.set, nor can I use the method shown on
 http://www.zope.org/Members/Duncan/LocalVars. So, the questions is, what is
 the recommended way to create modifiable variables using DTML, without
 using Zope?
 
 Thanks in advance


i've used dtml outside of zope, but i tend to pass it most of the
variables it needs and let it do the rendering. 

you should be able to pass an empty dict to the dtml as the mapping
arguement and set variables inside of that, although you might have to
wrap it with attributing setting methods so that it can be used from
dtml. or you can use a dtml-let clause to create the proper variables.

dtml-let x="1+2"
dtml-var x
dtml-var "x/2"
/dtml-let

long live the pyxies:)

kapil

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

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




Re: [Zope] using a dictionary returned from an external method

2000-10-24 Thread Ender

Matthew Wilbert wrote:
 
 I have some DTML that needs to call an external method that returns a dictionary.  I 
don't have any problem referencing the resulting dictionary by doing something like
 
 dtml-var externalMethod()['key1']
 dtml-var externalMethod()['key2']

 .
  .
 
 However, I need to do this for several keys, and I don't
 want to call externalMethod several times.  Is there a
 way to assign the method result to another variable, or
 is it possible that DTML is smart enough not to do the
 call multiple times?  Or is there some other approach
 that I am not even thinking of?

dtml-let mydict="externalMethod()"
dtml-var "mydict['key1']"
/dtml-let

i know dtml will cache results on the same method call in a single
request which generally makes it efficient to do stuff like

dtml-if expensiveQuery
dtml-var expensiveQuery
dtml-else
cheap skate;)
/dtml-if

and i'm guessing the same should apply to external methods.

kapil

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




Re: [Zope] Python product - inherittance

2000-10-25 Thread Ender

Petr Knapek wrote:
 
 Hi Zopists,
 I have a problem with inherittance of my publishable python classes.
 I created in python
 
 classA and classB(classA)
 
 classA has functionA and classB has functionB. In __init__.py of my
 product I register only classB.
 
 My problem is that it is not possible to call functionA of an instance
 of classB. There is 'Error Type: AttributeError'. Does anybody know
 where the problem is? I use Zope 2.1.6


its probably a security error.

you need to either enable subobject access or explicitly register the
method as part of the products permissions.

something like this
allow_access_to_unprotected_subobjects=1

this is not the recommended way to it as you'll open up the entire
product to access.
buts it useful to identify if its a security issue.

kapil



 Thanks, Petr
 --
 Petr Knápek
 NEXTRA Czech Republic, s.r.o., Hlinky 114, 603 00 Brno, Czech Republic
 e-mail: [EMAIL PROTECTED]
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Not grocking RESQUEST.set syntax

2000-10-25 Thread Ender

Noah wrote:
 
 I'm still not grocking the syntax for setting REQUEST fields.
 I want to set a REQUEST field "filename" to be the value returned
 by a ZSQL call. I want something like this (pseudo-code of what I want):
 
 dtml-let FOO=MyFavoiteZSQLMethod
 dtml-call "REQUEST.set('filename', FOO)"
 dtml-call some_other_thing_that_uses_filename
 /dtml-let
 
 That does not work because FOO gets set to something like:
 Shared.DC.ZRDB.Results.Results instance at 7760b0
 I tried sticking this inside dtml-indtml-in to get
 at the sequence-item, but I just ended up getting confused.

thats because you're working on the results returned by a zsql method
which is a result object, you want access to values within it.

try

dtml-call "REQUEST.set('filenames',
MyFavoriteZSQLMethod(REQUEST).dictionaries())"


this returns the list of dictionaries that represent rows in the table,
with column names as keys and column values as values.

you can reference
lib/python/Shared/DC/ZRDB/Results.py
for more info on the results object


kapil

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




Re: [Zope] Reverse SendMail Question

2000-10-26 Thread Ender

[EMAIL PROTECTED] wrote:
 
 Has anyone thought of using SendMail (or any other e-mail program) to send
 e-mail to Zope and have that e-mail be loaded directly into a specific folder
 (say, based on the e-mail address or subject line)?
 
 This would be handy to keep track of e-mail.  All the person would have to do is
 cc the project and all the e-mail could be viewed centrally.
 
 Any ideas?
 
 Ron
  ./.

(IMO) its not to hard to write a cronn'd python client to retrieve
emails sent to an email addr from a pop/imap server and drop them into
zope via xml-rpc. i wrote something like this for my first zope
contract, dropping the emails into a CatalogAware ZClass, and offering
searches of the projects archives via ZCatalog. i believe ZMailin does
something like this. 

kapil

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




Re: [Zope] which python gets used ... ?

2000-10-26 Thread Ender

Jonathan Cheyne wrote:
 
 Hi, just a quickie idiot question ..
 
 Does zope use any of the python on my RH6.2 box or does it use its own
 copy exclusively?
 
 I was trying to install the python xml libraries to try our the hyperdom
 product. I installed an rpm succesfully before remembering that zope has
 its own python.
only on windows...

 I struggled to install a tgz version though and it
 struck me that I was probably not being as efficient as I could be ...
 
 So the question is: can I run zope using the stock RH6.2 distributions'
 own copy of python?

check if it has threads

try:
import threading
except:
print "this won't work"
import sys;sys.exit()
print "you can use this python"


if not normally a python install is as simple as

./configure --with-threads
make
su
make install

you might need to switch your path if you've got both pythons on your
system as most 
will put /usr/bin before /usr/local/bin

you can check which one your using with:: which python

to fix it in bash :: export PATH=/usr/local/bin:$PATH

cheers

kapil

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




Re: [Zope] Displaying non-start values as the first batch seen in a batchprocessing dtml-inprocessing dtml-in

2000-10-26 Thread Ender

Chris Beaumont wrote:
 
 Hello,
 
   I'm using dtml-in to display a long list of events taken from a SQL
 table, as part of a calendar, using batch processing,
 (basically the example from the DTML reference adapted to use direct
 traversal to fetch the table contents)
 
 I want my calendar to be basically a timeline, with the current date as
 the default starting point. The idea is that someone can go back in time
 as well as forward. (links for past events as well as future)
 
 So, basically, I'm looking for a not-too-convoluted (i.e. decent
 performance) way to have the 'default' screen on entry be the batch that
 contains the item whose datetime value is the next one occurring after
 the current time. Dtml-in doesn't seem to have a straightforward way to
 do this, unless I'm overlooking something obvious.
 
  Does a solution to this occur to anyone?


do it in sql, this is pretty database dependent, but the ideal way to me
would be just 

where event_date  dtml-var TimeArguement fmt=dbdateformat

and just adjust your dtml to call the method with a date arguement.

you probably need to use your db's string-date functions to convert the
value for comparisions.

i think this would offer the best performance, and least code.

cheers

kapil

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




Re: [Zope] My Items will not show themself in manage_main (objectItems)

2000-10-30 Thread Ender

Max M wrote:
 
 I have made a product that inherits:
 "OFS.ObjectManager.ObjectManager"
 and so should be able to contain other object.

In python any object can be a container, the use of the ObjectManager
assists in creating an api and ui for the container's management of
objects.

 I have given the product a manage option:
 {'label':'Contents', 'action':'manage_main'}
 This is inherited from ObjectManager, To make it possible to
 add content to my product.
 
 But when I add ie. a dtml method to my folderish object, it does it
 allright, and the document gets added. I know because I can see it directly
 when going to it's url. And if I try to add another document with the same
 name I get an error saying that the id is allready used.
 
 But the Item doesn't show up in Itemlist on the "manage_main" page. So I
 cannot edit the items that I have added.
 
 I only get the:
 "There are currently no items in XXX"

some more information on what you changed in the container would be
useful.

 Why is this? is there any special methods or something that I need to create
 for the Items to show up in "objectItems".

this pseudo code should give you the result you want?, it works for me
to display objects in the manage_main. 


def manage_addMyContainer:
foo = MyContainer()
bar = MyObject()

foo._setObject(bar, 'bar')

self._setObject(foo, 'foo')

caveat, register your permissions properly on the manage_add, and note
that adding bar in this way will mean it won't have access to
acquisition properties from further up the tree at creation (including
manage_afterAdd).

also for registering manage options this syntax is a little more
inclusive.

manage_options=(
OFS.ObjectManager.ObjectManager.manage_options+
(
{'label':'YourTabHere', 'action':'YourMethodHere'},
)+
AccessControl.Role.RoleManager.manage_options+
OFS.SimpleItem.SimpleItem.manage_options
)

hth

kapil

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




Re: [Zope] Zope Book Beta

2000-10-31 Thread Ender

Phil Harris wrote:
 
 Give me a few hours and I'll be knocking out the eBook and PDF versions.
 
 By the end of the day.
 
 Phil

Hi Phil,

how do you do that? for the pdf are you dumping stuff into reportlab?

Kapil


 - Original Message -
 From: "Chris Withers" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, October 31, 2000 11:49 AM
 Subject: Re: [Zope] Zope Book Beta
 
  There a PDF of it anywhere?
 
  cheers,
 
  Chris
 
  Michel Pelletier wrote:
  
   Amos and I are gibbering like madmen with excitement to announce the
   Zope Book Beta.  This is the complete, technical draft of the book with
   all screenshots (but minus illustrations, those are on there way!).
   Some other things like a colophon and information about the authors is
   missing. The beta includes all completed chapters, the API reference,
   and the DTML reference.  We've received over a hundred comments,
   corrections, and ideas from you the community and it has made a much
   better book.  This is the one to print out and give to your friends as
   christmas gifts, folks, so get crackin and start reading at
   http://www.zope.org/Members/michel/ZB/.
  
   Enjoy,
  
   -Michel
  
   ___
   Zope maillist  -  [EMAIL PROTECTED]
   http://lists.zope.org/mailman/listinfo/zope
   **   No cross posts or HTML encoding!  **
   (Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )
 
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope-dev )
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] MailHost: bcc broken ?

2000-11-01 Thread Ender

"Stefan H. Holek" wrote:
 
 On Wed, 25 Oct 2000, Gregory Haley wrote:
 
  i was one of the participants in the recent discussion of zope bulk
  mail.  i'm wondering about the mechanics of sending the work of the mail
  to the actual sendmail server outside of zope.  would i do that by
  creating an external method which is program/script that accepts the
  data from zope and then passes them to the mail server?  any suggestions
  or details would be most appreciated.
 
 got me ;) I have not done this myself (yet), and I have firtshand
 knowledge of majordomo list management only. but I could think of
 something like this:
 
 a) very simple
 create a mailing list in your listmanager and have zope send the email to
 the list's address. voila, the rest is taken care of by the listmanager.
 
 b) a bit more involved
 if your addressee list changes (you create it on the fly with zope
 somehow) you could pass that list to the listmanager before sending email
 to it. in majordomo, a mailing list is simply a textfile containing a line
 for each subscriber's email address. make an external function to create
 that file and proceed like in a).
 
 HTH,
 Stefan
 

i've been thinking about bulk mailing in zope recently, one easy thing
to do is to change MailHost to use a persistent mail connection (i've
already submitted this as a patch to the Collector, if you're interested
email me), this should provide some marginal improvements. Another
method that should increase both speed and reliability is to directly
inject the mail into a relay smtp server's mail queue. this is
definitely mail server dependent but offers the greatest performance
gains and is capable of scaling and greater reliabiltiy (dependent on
mailserver). usings lists is a valid solution but it doesn't get at the
core question of how to send more mail messages from zope quickly and
reliably.


cheers 

kapil

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




Re: [Zope] XML-RPC vs External method?

2000-11-01 Thread Ender

if the xml format is simple you could just do it dtml, it would end up
with some extra white space but it would still be valid.

a dtml method akin to 

?xml version="1.0"?
dtml-in mysqlretrieve
item
contentdtml-var content/content
squishydtml-var squishy/content
/item
/dtml-in


kapil


Irene Barg wrote:
 
 Hello all,
 
 I have setup a query form to query a small MySQL database using
 Zope.  It consists of:
 
 1.  ZMySQL Database Connection (ZMySQLDA)
 2.  ZSQL method
 3.  A search interface.
 
 Now, what I want is the user to have the option of viewing the
 results in HTML or raw XML.  I think there can be two approaches
 to this:  1. External method, or 2. XML-RPC.
 
 1.  External method:  Replaces the ZMySQL database connection
 with an external Python function called 'mysqldb_XML', pieces
 of which follow:
 
 def mysqldb_XML(self,query):
 """
 Use a MySQL SAX driver to map relational data to XML.
 Hacked from PyXML saxdemo.py.  The MySQL driver is a modified
 version of Sean McGrath's drv_mysql.py ("XML Processing with
 Python").
 """
 from xml.sax import saxexts, saxlib, saxutils, writer
 import sys,urllib
 
 #Our MySQLdb XML driver;
 driver="xml.sax.drivers.drv_mysqldb"
 .
 out = sys.stdout;
 p=saxexts.make_parser(driver)
 dh=writer.PrettyPrinter(out,dtdinfo=info)
 try:
 p.setDocumentHandler(dh)
 return p.parse(query)
 except IOError,e:
 return in_sysID+": "+str(e)
 except saxlib.SAXException,e:
 return str(e)
 
 Inside Zope, I get the ZSQL 'query' and do something like:
 
 dtml-call "RESPONSE.setHeader('content-type','text/xml')"
 dtml-in "mysqldb_XML(query)"
   dtml-var sequence-item
 /dtml-in
 
 2.  XML-RPC:  It seems to me XML-RPC could do this too, but
 I don't know how one would print out the raw XML response.
 Could I have a Zope client request the ZSQL method above,
 but instead of sending it to my output DTML method, I just
 print the raw-XML stream?  Examples would be helpful:-)
 
 It seems to me if XML-RPC already produces an XML formatted
 stream, it would be more efficient to just use it (unless
 there is yet another way in Zope I'm not aware of).  Is it
 possible?  Is there any reason to want to use the external
 method instead?
 
 Thanks for your comments,
 
 --irene
 
 --
 Irene Barg  Email:  [EMAIL PROTECTED]
 Steward Observatory Phone:  520-621-2602
 933 N. Cherry Ave.
 University of Arizona   FAX:520-621-1891
 Tucson, AZ  85721   http://nickel.as.arizona.edu/~barg
 --
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Upscaling of performance

2000-11-02 Thread Ender

has anyone tried the asyncore.c module from nightmare.com to speed up
zserver?

Kapil

"J. Atwood" wrote:
 
 1,000,000 hits is not that much but you can check out the Zope Benchmarks
 
 http://www.zope.org/Members/BwanaZulia/benchmarks.html
 
 On some good hardware it can handle about 100 Requests per second (8,640,000
 per day).
 
 Beyond that you need two things... ZEO and hardware.
 
 Cheers,
 J
 
  From: Petr van Blokland [EMAIL PROTECTED]
  Organization: Buro Petr van Blokland + Claudia Mens
  Reply-To: [EMAIL PROTECTED]
  Date: Thu, 02 Nov 2000 18:19:24 +0100
  To: zope list [EMAIL PROTECTED]
  Subject: [Zope] Upscaling of performance
 
  Hi,
  does have anyone reference on or information about
  the upscaling of Zope for *very* large hit performance:
  1.000.000 per day or so?
 
  Petr van Blokland
  [EMAIL PROTECTED]
 
 
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )
 
 
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] How do I logout?

2000-11-04 Thread Ender

I don't know if there is an elegant way to do this.

if i'm the superuser i just try to find a junk method (The QuickStart
Tutorial does nicely) and change the text to include the following. (if
i'm another user it the same thing applies but i generally create a
logout method._

dtml-raise Unauthorized
Log Me out Scotty
/dtml-raise

when the basic auth box pops up, just change your username and click
enter, next time the pop up happens click cancel. now when you try to
browse around in any place requiring authorization, it will query you
for your password as the new user. 

Kapil

Lee Curtis wrote:
 
 Hi all,
 
 How do I logout or switch users when running Zope?
 
 I've got some DTML code that does it - sometimes, othertimes it produces a
 keyerror.
 
 This must be a common problem - coz I'm logged in as super user and want to
 switch back to my regular username.
 
 Contributions of help greatly appreciated...
 
 Thanks.
 
 lee
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Question about dtml-in

2000-11-05 Thread Ender

Sean McGrath wrote:
 
 Hello all,
 
 I have a question about the dtml-in tag. When it is iterating over a
 sequence, and the items in the sequence happen to be tuples containing
 exactly two items, then dtml-in places the first item from the sequence in
 sequence-key, and the second item goes in sequence-item. If the items in
 the sequence are not tuples of two items, then sequence-item contains the
 whole item. For example, if I have:
 
 dtml-in "[(1,2),(3,4),(5,6)]"
 dtml-var sequence-item
 /dtml-in
 
 then I get 2,4,6 when I view this. The 1, 3 and 5 have been assigned to
 sequence-key. Now, if I change the dtml to be this:
 
 dtml-in "[(1,2,3),(3,4,5),(5,6,7)]"
 dtml-var sequence-item
 /dtml-in
 
 then I get
 (1,2,3)(3,4,5)(5,6,7)
 
 which is what I would expect. I think the reason for this behaviour is to
 do with iterating over dictionaries, but I'm not sure. The problem I have
 is this: I have code which retrieves data from a database, and the result
 is a list of tuples, with each tuple corresponding to a record, and each
 item in the tuple corresponding to a field. I don't know in advance how
 many fields will be in the record. I want to iterate over the records and
 fields, wrapping them in a html table. If the database I'm talking to
 happens to return a list of records with two fields, ie a tuple of two
 items, I have to handle this differently than any other case, which makes
 for some ugly code. I haven't been able to find any way to avoid this,
 unless I'm missing something. Any information would be greatly appreciated.
 
 Regards,
 


in addition to Dieter Maurer's suggestion of fixing this behavior in
dtml-in, another possibility is to do the work in a web python method,
and directly access the Result object from the query to generate the
html. 

Result object api.
/lib/python/Shared/DC/ZRDB/Result.py

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




Re: [Zope] Can Zope use a Different Python?

2000-11-11 Thread Ender


Hi

i'm not sure exactly whats being asked here. zope on linux doesn't
include its own python interpreter. you can choose which one executes
zope and its external methods by specifing the interpreter binary in the
start.py. its quite possible that your installing third party modules
into the distros python in /usr/bin/python, in which case if zope's
using /usr/local/bin/python you won't see them and you'll get import
errors. if this is the case copying the third party modules into
/usr/lib/python1.5/site-packages will solve the import errors, or moving
the modules into the zope_dir/lib/python/ (or perhaps a subdirectory
with an init) might do the trick. if you specifically want to run
something through a custom python interp from zope you might need to use
os.popen2 (or variant) in an external method, or setup sometype of
interprocess communication via xml-rpc or an rdbms or shared file, etc.

hope that helps

kapil


Gary Perez wrote:
 
 Hi.
 
 We've got Zope 2.2.2 installed on a Linux box. We want to be able to use
 the full-up python that's on the box instead of the python interpreter
 that comes with Zope for playing with External Methods.
 
 Is there any way to circumvent Zope's python in this way?
 
 If not, what's the easiest way to extend Zope to be able to use our
 non-Zope python?
 
 Alternatively, we're plagued by import and attribute errors when
 accessing the External Methods. Will simply moving (or linking?) all the
 pieces (whatever.py, __init__.py, etc.) into a subdirectory of "Shared"
 fix the problem?
 
 Thanks in advance for your help.
 -GMP
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Bulk Mailing How-To!

2000-11-11 Thread Ender

Wow, this is really cool. nice job.

btw. if anyone's interested i wrote a patch to change the mailhost
behavior to use a persistent connection to the mta. email me if
interested (yes, i submitted a feature/wpatch to the collector).

also its good to note that the mailhost doesn't currently participate in
transactions.

regarding injecting to the mta, this is def. the best way to send bulk
mail, but you might want to do an fsync to make sure it gets written to
disk vs. lingering in a kernel cache. 

kapil


"Stefan H. Holek" wrote:
 
 For those who care: I have created a bulk mailing How-To at
 
 http://www.zope.org/Members/shh/BulkMailHack/
 
 Cheers,
 Stefan
 
 --
 Things work better when plugged in
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Re: DateTime

2000-11-11 Thread Ender

Jerome Alet wrote:
 
 On Fri, 10 Nov 2000, Chris Withers wrote:
 
  mxDateTime is _not_ the DateTime in Zope. If only it was
 
 It's voting season, so I vote +10 for this one.
 
 bye,

I'll second that 

+10

kapil

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




Re: [Zope] How do I form an XML-RPC query to a remote server?

2000-11-16 Thread Ender

Tony McDonald wrote:
 
 Hi all,
 I'm experimenting with collating data from a remote database that uses
 XML-RPC.
 
 I can send it messages like;
  import xmlrpclib
  medweb = xmlrpclib.Server("http://bogus.server.com")
  medweb.getImages('scar')
 '?xml version="1.0" encoding="ISO-8859-1"
 ?\015\012\011data\015\012\011\011titleMedwebb Images/title \0
 
 (lots of stuff snipped)
 
 But I just can't figure out how to send the XML version of the same query,
 ie
 ?XML VERSION="1.0"?
 methodCall
 methodNamegetimages/methodName
 params
 param
 valuestringscar/string/value
 /param
 /params
 /methodCall
 
 to the server.
 
 I've got a nasty feeling that when I get told how to do this, I'm going to
 slap my forehead bloody hard
 
 As you can see the data is returned in XML format, and whilst I'm fine with
 Python code for XML parsing (usually use sgmlop), I'm a bit lost on where to
 start here. An External Method seems the best way, but I'd like the received
 wisdom on this.

this probably isn't your problem, but in your above example getimages
looks like it should be getImages. 

i'm not sure why you want work by hand on the xml-processing, since
xmlrpclib already exists. if you want to debug your setup you can use
shane hathaway's tcpwatch as a proxy which show you what goes out on
the  wire. 

as for the location of such code, it depends on what you're doing with
the results, i think the choices are between a product and an external
method.

kapil

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




Re: [Zope] Search and replace

2000-11-20 Thread Ender

Lee Hunter wrote:
 
 Martin Winkler wrote
  I just wanted to express that this feature may be too hard to
  program for
  the (IMHO) rare cases that we really need it, but IF there

its not that hard to program,  if you want just want to replace,
previewing is a bit difficult, because your asking for a multi-doc
preview (how?)

ideally two external methods. one recurses through folders collect
objects of a particular meta_type

the second external method calls the first to get a collection of
objects for a particular meta_type and performs string manipulations on
the raw() representation of the method. 

kapil

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




Re: [Zope] Search and replace

2000-11-22 Thread Ender

Mario Olimpio de Menezes wrote:
 
 On Tue, 21 Nov 2000, Lee Hunter wrote:
 
  On the other hand I actually *like* the Zope management interface - in fact,
  so far I've found it to be very easy to understand and a total pleasure to
  use. It just doesn't offer some things that I must have - features that
  would probably be hard to incorporate into a browser interface.
 
 
 what about a plug-in, written in {Java | TclTk | whatever_language}?
 I don't have skills to do this but I think this could be done.

 just an idea!

sadly...

cross-browser compatibility would be a pain, and performance would bite.

kapil

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




Re: [Zope] Search and replace

2000-11-22 Thread Ender

tom smith wrote:
 
 on 21/11/00 3:05 am, Ender at [EMAIL PROTECTED] wrote:
 
  Sadly this is a constraint of zope ide's being browser based (or based
  on current browsers). I would eagerly like to help out with a project
  that would like to see this changed.  Building such an interface with
  gnome or kde would be possible, indeed there are already efforts
  underway to do both
 
 Surely something written in python and Tk would be better, so that the
 editor could also be run on macs, PCs as well as Linux.

tk on the macs is flaky, i'm not to sure of Tk's widget potential to do
the needed html rendering quickly ( i haven't looked at grail in a while
though). 

mozilla really seems like the only strong option for cross-platform dev
of a zope ide.

good news though,  from 

http://www.python9.org/p9-applications.html

At a minimum, these sessions will cover the following: The Komodo
Integrated Development Environment, a Mozilla-based, cross platform IDE
which is both extensible and network-oriented; The Python-XPCOM
bindings, which allow the Python programmer to build Mozilla-based
applications and script them; Python for .NET, a new port of Python to
Microsoft's .NET platform; and Visual Python, a plugin for Visual Studio
.NET, which allows the Visual Studio programmer to integrate Python into
her  development environment.


kapil

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




Re: [Zope] Pseudo E-Mail Address validation

2000-11-22 Thread Ender

Martin Winkler wrote:
 
 Hi all,
 
 For a subscription tool of a mailing list I'd like to quick-check the
 e-mail address our users type. Is there a little product/method etc.
 available that does this? I know that you can only be sure whether an
 e-mail address exists or not, when you actually send a mail to the user,
 but a quick-n-dirty check would be nice. Maybe even complete RFC-compliancy
 as implemented in some Perl-Modules? (spaces, "@" sign, dot-notation etc.)
 
 Hoping for an answer,
 
 Martin
 

not feature complete but def. qualifying as a quick-n-dirty-check

dtml-if "'@' in email_addr and '.' in email_addr and not ' ' in
email_addr"
valid dtml-var email_addr
/dtml-if

solves most of my concerns with valid email addrs


kapil

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




Re: [Zope] Python and EJB (J2EE)

2000-11-24 Thread Ender

i've been playing around with servlets (tomcat, jserv, orionserver.com)
and generally been pretty happy with them. development cycle is a lot
slower than zope. i did some prelim work on hooking up jserv to zope but
gave up cause the performance generally sucked (jserv is still using
apj1.1 which doesn't have persistent connections) and figured there were
easier ways to get the two talking besides directly ala distributed
protocols or shared backend resource like a rdbms.

j2ee is more than just ejbs, its a whole slew of technologies like
(jdbc, jndi (directories), jms (messaging), jts (client transactions),
jaxl?(xml)...). one advantage of using java for a project thats going to
be talking several of these protocols is the fact that there is a
standard supported library for it as opposed to python's bazaar style of
development and support (not to mention documentation). integration of
this stuff in python generally requires evalutation on a per
protocol/library basis because in some cases the library just isn't
robust enough to handle the work (python's soap support comes to mind).  

as for component technologies, i really feel this comes out more as a
programming paradigm in python rather than a forced technology. 

as for distributed technologies, while xml-rpc is useful and simple its
not useful (IMO) for enterprise programming, its too basic. it requires
alot of custom app programming to transfer meaningful exceptions. some
protocols/libraries that i would like to see in python would be soap,
wddx (bindings for httpsoap), uddi. i've never used com/dcom so i've
nothing to say about them. python does have great corba support
(omniorb, fnorb) and some is working on integrating zope as a corba
system (hopefully they'll write up a howto/ release some code), and pyro
can cut it for simple distributed systems.

so what would you like to see in a python component container?

kapil



Hung Jung Lu wrote:
 
 Python and EJB (J2EE)
 =
 
 Searching through comp.lang.python newsgroup archive
 ([EMAIL PROTECTED]) and the [EMAIL PROTECTED] mailing list, I have not been
 able to find much about EJB (Enterprise Java Bean) and Python/Zope
 comparisons. (J2EE is Java Two Enterprise Edition, basically another jargon
 for any architecture based on EJBs.)
 
 I believe this field deserves to be explored a little bit more. If Python is
 going to be more used in the corporate environment, it has to be made
 stronger. This message is kind of unorganized, but I would like to have
 comments/feedback from other people.
 
 The following message shows that I am not the only one interested:
 
 ruben [EMAIL PROTECTED] 11/08/2000 in comp.lang.python:
 
 Coming from a Java background and recently using Python for application
 development, I have a question. Is there an equivalent to Enterprise
 JavaBeans in Python?  If so, please point me to some resources!!!
 
 Similarly Joe Grace [EMAIL PROTECTED] has posted an explanation on J2EE in
 the Zope mailing list:
 
 
http://zope.nipltd.com/public/lists/zope-archive.nsf/0dec1f578f18f116802568ab003585d2/86cffddc1a8a73b980256865006d44a2?OpenDocument
 
 I am starting to look into Java EJB, and I must say that despite all the
 hype, it is totally horrible. I can understand the goals of EJB, but I
 wonder whether something simpler and cleaner might be better. EJBs,
 especially entity beans, have largely failed and have disappointed many Java
 developers, or so it seems from the comments I have received from other
 people.
 
 First off: what is an EJB? There are plenty of books out there, there are
 plenty of websites out there, but you'll probably be hard-pressed to find
 someone that has actually worked with EJBs. I've never liked the names "Java
 Beans" and "Enterprise Java Beans". These are marketing names. We need some
 more generic names. "Java Beans" are an attempt by Sun to implement
 component programmming. That is, the idea is to have component classes on a
 single machine (virtual machine in the case of Java) that can be shared/used
 by different programs. In this sense, "Java Beans" are much like DLLs, Unix
 shared libraries, Python modules, or Microsoft's COM, ActiveX stuff. "Java
 Beans" are designed to be shared within one single machine. "Enterprise Java
 Beans" are much more complex than "Java Beans", and they are aimed at
 distributed computing: EJBs are designed as classes/components to be shared
 by multiple machines. In this sense, they are more like CORBA, or
 Microsoft's DCOM. Therefore:
 
 (1) Java Beans --- local components, run on the same machine
 (2) Enterprise Java Beans --- distributed components, distributed
 computing, multiple machines, potentially located in different geographic
 locations. These components often have instance pools running in multiple
 threads, and often are transactional.
 
 -
 
 What about Python? Or Zope? Simple distributed computing is not too hard to
 implement. CGIs in fact are a way of distributed 

Re: [Zope] Python and EJB (J2EE)

2000-11-25 Thread Ender

Hung Jung Lu wrote:
 
 From: Ender [EMAIL PROTECTED]
 ...
 
 Thanks for the comments. I'll reply other points in a few more days.

cool, i've been waiting for this discussion:)

 as for distributed technologies, while xml-rpc is useful and simple its
 not useful (IMO) for enterprise programming, its too basic.
 
 This maybe true. However, HTML is also basic and simple, but exactly because
 of its simplicity, it became widely accepted and used. On the opposite end
 is CORBA: because it's so complicated, there is no vendor out there that can
 possibly implement all its features. Trading powerful features for a wider
 acceptance at times does work.

don't forget marketing, behold windows.

CORBA is complicated but its also more widely deployed in the enterprise
because this problem domain needs the additional feature set. 

my comments regarding xml-rpc are targeted towards enterprise
implementations. if all you need is simple rpc, than xml-rpc will
provide 80% functionality of soap at 20% of the complexity (not my
numbers) and i recommend to anyone to use xml-rpc. but if you need
actual cross-platform object access/transport, than it just won't cut it
and then you need the additional functonality of soap.

also back to the marketing hype, if something isn't supported than it
tends to wither away into a niche. while xml-rpc is used in the trenches
for lots of stuff, SOAP is supported by lots of major software
developers (ibm and ms come to mind) and it will become the future
standard supported by interoable products (in many ways it already has). 
 
 SOAP is showing symptoms of becoming complicated. And that's a bad sign. See
 Fredrik Lundh's implementation comment for Python SOAP at
 http://www.pythonware.com/products/soap/profile.htm

 Profile
 Posted Jun 08, 2000
 
 SOAP 1.1 is a highly modular and rather complicated standard. Supporting
 every little nook and cranny is huge task, and since the specification is
 still a moving target, we've decided to do this implementation step by
 step.
 
 OK. Even the guru describes SOAP as "rather complicated", what then for the
 novices? 

implementing a standard and using a standard are different things. do
you need to understand how a db works to query it?

do you really need to understand how xmlrpc works when you do something
like this?

(pseudo-code)
xmlrpcServer('http://yourzopeserver.com')
print xmlrpcServer.objectIds()

i think that as long as the library implementors create a clean
interface to the system than the novice should be able to use the system
without as a blackbox.


I personally went through the SOAP protocol spec today and I had to
 agree it's "rather complicated". SOAP is going down the path of CORBA all
 over again. It's becoming COAP (Complicated Object Access Protocol). If not
 because Microsoft is behind it, I'd dump SOAP right away. Due to its
 simplicity, I'd say XML-RPC is here to stay, SOAP or no SOAP. It's
 unfortunate that the twin brothers have to fare good-bye, but at the same
 time I am glad that XML-RPC split off to remain simple. Future servers will
 have to handle both: more work, but that's fate.


i agree with /F description of SOAP, but i have a different guru.

Dave Winer is the/a writer of the specs for of XML-RPC and SOAP. a bit
dated link. 

http://davenet.userland.com/1999/09/12/anEndToTheUberoperatingSystem

I agree that there is a place for both protocols, (right tool for the
right job), and that zope should support both. although how is another
can of worms, since i don't think people want the same xml-rpc style
automatic opening of your entire site that currently happens with zope. 

incidentally some other useful links

# distributed lightweight protocols
lwprotocols.org

# alternative python soap-rpc lib
http://casbah.org/~kmacleod/orchard/

Cheers

Kapil

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




Re: [Zope] How to checkout PythonMethod from CVS

2000-11-25 Thread Ender

Milos Prudek wrote:
 
 How can I checkout PythonMethod from cvs? I tried to modify the "Zope2"
 in the following command:
 
 cvs -z7 -d :pserver:[EMAIL PROTECTED]:/cvs-repository checkout
 Zope2
 
 (Zope2/PythonMethod, Zope/PythonMethod, Zope/DC/PythonMethod,
 Zope/Products/PythonMethod and countless other combinations)
 
 --
 Milos Prudek

when in doubt you can always use the cvsweb to find out what directories
you want.

kapil

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




Re: [Zope] Python and EJB (J2EE)

2000-11-26 Thread Ender

Nitin Borwankar wrote:
 
 
  I've mentioned two-phase commit to Digicool people. Not sure whether it's
  already inside Zope or not, but it seems not. Zope's TM (Transaction
  Machinery) does not seem to be two-phase. See the TM.py file itself: it only
  has
 
  def _finish(self):
  self.db.commit()
 
  That is, I don't see the equivalent of prepare_to_commit().
 
 I'm not sure Zope source is the place to look for this,
 perhaps ZEO source may be more appropriate.
 
 Nitin.


this has been enlightening, i'm still coming up to speed on all the ejb
stuff.

zope does implement a two-phase commit and it is integrated with the
transaction machinery. to see a good mix in that shows more of the
transaction methods take a look at ZPatterns/Transaction.py although its
not recommended for use (its deprecated in the current ZPatterns to look
at you'll have to check out an older version).

you can see how things get called by looking in 

ZopeHOME/lib/python/ZODB/Transaction.py to see the internals of a
transaction mechanics.

and you can see how the zodb manages these semantics for objects living
in the ZODB here.

zHOME/lib/python/ZODB/Connection.py


kapil

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




Re: [Zope] Python and EJB (J2EE)

2000-11-26 Thread Ender

assuming no errors, in which case you'll get rollback method calls, or
subtransactions.

a call to tpc_begin signals the begin of the two-phase commit. than
comes a call to commit, next tpc_vote, and finally tpc_finish.

kapil


Ender wrote:
 
 Nitin Borwankar wrote:
 
 
   I've mentioned two-phase commit to Digicool people. Not sure whether it's
   already inside Zope or not, but it seems not. Zope's TM (Transaction
   Machinery) does not seem to be two-phase. See the TM.py file itself: it only
   has
  
   def _finish(self):
   self.db.commit()
  
   That is, I don't see the equivalent of prepare_to_commit().
 
  I'm not sure Zope source is the place to look for this,
  perhaps ZEO source may be more appropriate.
 
  Nitin.
 
 this has been enlightening, i'm still coming up to speed on all the ejb
 stuff.
 
 zope does implement a two-phase commit and it is integrated with the
 transaction machinery. to see a good mix in that shows more of the
 transaction methods take a look at ZPatterns/Transaction.py although its
 not recommended for use (its deprecated in the current ZPatterns to look
 at you'll have to check out an older version).
 
 you can see how things get called by looking in
 
 ZopeHOME/lib/python/ZODB/Transaction.py to see the internals of a
 transaction mechanics.
 
 and you can see how the zodb manages these semantics for objects living
 in the ZODB here.
 
 zHOME/lib/python/ZODB/Connection.py
 
 kapil
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Re:External Methods

2000-11-29 Thread Ender

check out the urlencode function of urllib.

kapil

Kini Natekar wrote:
 
 Hi,
 
 I am currently running a external method .This method
 calls a python script using the following line
 
a
 href=\"http://localhost/cgi-bin/test.py?%s+%s\"%s/a"
 %(name,age,gender)
 
 Instead of calling the python script we want to add
 the script as an external method in zope.The problem
 we are currently facing is in generating the above
 link dynamically.
 
 How do we solve the above problem ?
 
 Thanks,
 Kini.
 
 __
 Do You Yahoo!?
 Yahoo! Shopping - Thousands of Stores. Millions of Products.
 http://shopping.yahoo.com/
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Search and replace

2000-11-21 Thread Ender

Daniel Rusch wrote:
 
 I have been following this thread with mild amusement. Those of you who
 don't think that there is any need for a search and replace are being,
 at the least, disingenuous. Have you never needed to replace a dtml var
 that is on a hundred or more pages with another one, but replace it only
 on some of the pages???
 
 The lack of a search and replace, a find that actually "finds" a string
 on a page (instead of just the page) and other standard editor features
 are the reasons why Zope is being phased out of this companies (15,000
 person worldwide company, the worlds largest web hosting and fiber optic
 network) web tool set.
 
 Don't get me wrong, I think Zope is the greatest thing since sliced
 bread. But, if Zope is to become anything other than a bastion for open
 source zealots (myself included), a real editor is a necessity not a
 nicety! Zope had the opportunity to sweep this company ( it could have
 ended up on hundreds if not thousands of servers) but the lack of a
 professional interface doomed it.
 
 DR

Sadly this is a constraint of zope ide's being browser based (or based
on current browsers). I would eagerly like to help out with a project
that would like to see this changed.  Building such an interface with
gnome or kde would be possible, indeed there are already efforts
underway to do both. But to create a cross-platform solution really
needs... Mozilla. Sadly, the ZopeMoz projects appears to be dead,
hopefully developer interest can be generated in reviving it after
ActiveState releases the python bindings to XPCOM (which should be
soon).

kapil


 
 
 Lee Hunter wrote:
 
  Martin Winkler wrote
   I just wanted to express that this feature may be too hard to
   program for
   the (IMHO) rare cases that we really need it, but IF there
 
  I had understood that Python and Zope excelled at string manipulation.
  That's why I am surprised that it would be difficult to scan a folder full
  of documents to find a word and replace it with another (with the option of
  ignoring anything in pointed brackets). I'm not a programmer so I probably
  don't appreciate the complexities of the task, however in this case it seems
  like the object-oriented database is a hindrance rather than a help. If it
  was just a batch of html files I could search and replace through them with
  just about any piece of software on my desktop.
 
  I wouldn't know whether this is the sort of tool that is generally useful,
  but in my work I use search and replace all the time (if only to fix my
  endless confusion over 'its' and 'it's')
 
  Cheers
 
  Lee Hunter
  Hum Communications Ltd.
 
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope-dev )
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] zope, xemacs and efs

2001-01-17 Thread ender

On Wednesday 17 January 2001 18:39, Geoffrey L. Wright wrote:
 [EMAIL PROTECTED] (A.J. Rossini) writes:
  What version of EFS are you using, and if not recent, have you
  considered upgrading the EFS package?

 1.21

 That's the most recent version listed by the xemacs package manager.
 Is there a known problem with older versions of efs and  zope?

!!i think!! zope in general has problems with active ftp clients. if you can 
make efs work passive only you'll probably have better results.


kapil

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




Re: [Zope] HELP: ZPatterns Installation on Linux

2001-01-20 Thread ender

assuming you have a source distro of zope than this 'should'  work

# from zope base dir
cd  lib/python/Products/ZPatterns
# the following is dependent on your python install, assuming
# a stock redhat rpm
cp /usr/lib/python1.5/config/Makefile.pre.in.boot .
make -f Makefile.pre.in boot
make

should do it leaving you with an *so file in your Zpatterns directory.

restart zope and you should be good to go.

kapil




On Friday 19 January 2001 14:11, J. Atwood wrote:
 The instructions in the README.txt and on zope.org are a little vague..

 How, indeed, do I " build this extension using the included Setup
 file in the ZPatterns directory" I can see the Setup file but that is
 about it.

 I would be more than happy to write up some documentation (on
 Zope.org) if someone sends me the answer.

 RH Linux 6.2, Zope 2.2.2, Latest ZPatterns

 Thanks,
 J

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

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




Re: [Zope] ZPoPyDA woes

2001-01-22 Thread ender

the most recent versions of popy are currently hosted on sourceforge.

http://www.sourceforge.net/projects/popy
http://www.sourceforge.net/projects/zpopy

popy wants some includes which are not included in a normal source make
of popy. catalog/fe??h. i generally just copy them over from the source 
directory to the installation directory

also if anyone is curious popy seems to work fine against postgres7.1b3,
which includes massive improvements to postgres. no 8k row limits, outer 
joins, speed improvements, etc.

cheers

kapil


On Monday 22 January 2001 12:11, J B Bell wrote:
 Dear comrades in zopeness:

 For some time now I have been struggling trying to get Zope to talk to
 Postgres.  I am now nearly successful and hope that the revolutionary
 spirit of fellow zopatistas will carry the day.

 Background:

 Debian 2.1r2 on a PII 600 or so (the machine is pretty loaded)
 Postgres 7.0.3
 Python 1.5.2
 PoPy 1.4.1
 ZPoPyDA 0.7

 The most recent vexation is simple:  after expanding
 ZPoPyDA.0.7.tar.gz (dl'ed from www.zope.org/Members/tm), there is no
 configure file and no Makefile.  Like many products, it just expands
 out into lib/python/Products/ZPoPyDA/*.  However, the README file says
 to run "./configure; make; make install".  In an acronym, WTF?

 Bonus question:  I had a terrible time with installing PoPy itself
 until I modified the makefile to have a second -I argument going back
 to the source (.../postgres-7.0.3/src/include).  One or the other (the
 source or the installed include, that is) would result in various
 missing *.h files.  Did I install postgres incorrectly?  There was no
 .../include/catalog directory at all in the installed directories,
 which PoPy wanted.

 I eagerly anticipate any clues, and thank everyone for their
 attention.

 --JB

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

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




Re: [Zope] TCPWatch... and closing sockets..

2001-01-22 Thread ender

i'm guessing this has something to do with the default line terminators that 
medusa is looking for before it senses that a data buffer is ready to be 
processed. it seems like the url encoded ones request seem to have different 
line terminators. you can adjust this the fly by using the set_terminator() 
func on the dispatcher. set_terminator can look for either a set of input 
chars, or you can adjust the data buffers to fire off for processing on 
integer sizes. 

hope that helps

kapil


On Sunday 21 January 2001 14:15, Steve Spicklemire wrote:
 I'm going to try to make a long story short... and the story isn't even
 over... but I'm getting close. One of our clients is a 'multimedia'
 company and we're working with a group there that consists mostly
 of artists and designers who use tools like photoshop and
 macromedia director. They came to us recently with a project
 for which they were *going* to use Macromedia Multiuser Server
 but the complexity of their application is significant..

 long story short... I've sold them on the concept of using Zope as the
 'media/personality server' for this application.  They will use
 Director (which can post stuff to an URL and can also parse
 XML). So.. I'm building a framework that permits them to use their
 favorite tools, but I get to use *my* favorite tool too. ;-) The
 problem: Director is not a browser. There is no 'view source'. But (I
 think to myself) this is a great chance to use tcpwatch, which I've
 never used before. It's a little tricky since my favorite client
 machine is a Macintosh, and well.. lets just say that Tkinter for the
 mac is not perfect... not to mention there is no thread module..  but
 I do have a workaround that's useful (since I run Zope on a FreeBSD
 server, I just use tcpwatch on FreeBSD and either MI/X, or VirtualPC
 with Linux for my X server.. ). I noticed however that when I did a
 'POST' the URL encoded arguments were lost. I found that the
 proxy_receiver handle_close method was never called.. so that anything
 in a 'last line' that didn't end in '\n' was lost. I added the
 following patch that shows this... but why is handle_close not called?
 I can only guess that the socket is not being properly closed
 somehow. I use lib/python/ZPublisher/Client.py to test calls to Zope
 and it works fine, but the asyncore/asynchat stuff never calls
 handle_close for proxy_receiver.

 Anyway... here's the patch: Comments welcome!

 *** ./tcpwatch_orig.py Sat Jan 20 16:55:43 2001
 --- ./tcpwatch.py   Sun Jan 21 16:52:11 2001
 ***
 *** 130,135 
 --- 130,137 
   pos = pos + 1
   else:
   # Last line, may be incomplete.
 + line = "Partial line? " + data[oldpos:] + '\r\n'
 + self.watch_output(line, byClient)
   return data[oldpos:]

   def cleanupRefs(self):

 take care,
 -steve

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

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




Re: [Zope] Calling a DTML Document using a string

2001-01-24 Thread ender

On Wednesday 24 January 2001 12:00, Anderson Ami wrote:
 How can I do a dtml document call using the call dtml tag ?
 e.g.

 - I have 3 DTML documents ( bot1, bot2 and bot3)
 - I have in my request a int variable called varX
 - I would like do it, but this one doesn't work :
 ...
 dtml-var expr="bot + varX"
 ...

this might work

dtml-var "_['bot'+_.str(varX)]"

cheers

kapil

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




Re: [Zope] License

2001-01-29 Thread ender

On Monday 29 January 2001 01:41, Chris Withers wrote:
 Olaf Zanger wrote:
  is the product planned to ship under GPL or an corresponding licence?

 Please don't shit it under GPL, it makes it much less useful :-S
 A variant of the Zope License would be much mroe friendly :-)

 cheers,

 Chris


just what i needed to start the week off right, a flamewar. :(

please allow people to choose their licenses freely. knocking on the gpl, is 
ignoring the reason why its there, to allow people to give their work freely 
to the community without concern of it being subverted.

k

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




Re: [Zope] CacheManagers are cool :)

2001-01-29 Thread ender

On Monday 29 January 2001 10:15, Seb Bacon wrote:
 I've just been experimenting with the RAM Cache manager, and FWIW I thought
 I'd share my findings:

 I ran some simple tests using ab against a single, dynamic page which has
 some display logic both in the filesystem product and dtml.  I cached the
 index_html using the default RAM Cache Manager settings.

 Without caching, response time appeared to increase in direct proportion to
 the number of simultaneous requests up to 10.  Above 10 connections,
 response time worsened dramatically.  When there were 15 simultaneous
 connections, the response time averaged at approximately 10 seconds.  The
 relationship looked logarithmic, but I didn't really take enough samples to
 be sure.  Plus, the system I tested it on only has 96Mb RAM, and it was
 swapping a bit.

 In all cases the cache improved performance.  The average response time was
 improved by up to 70% where more than 10 concurrent users were simulated.
 There was an improvement of 20% - 25% between 5 and 10 concurrent requests.
 There was no significant improvement where there were no concurrent
 requests.  The relationship between the number of simultaneous requests and
 the response time remained linear across all measured levels of
 concurrency.


very cool. although i find the lack of improvement on a non concurrent 
requests a bit strange if its a the dtml is doing real computation vs. 
serving a string from memory.

 Not exactly a real-life usage scenario, but it sounds impressive :)  Not
 sure I understand what the cache keys are for though... is there any more
 documentation forthcoming on this?


so you can cache requests based on dynamic input. 

useful for authentication to present different cache pages to different 
users, and also to present common request dependent information from cache.

as for real documentation, use the source luke

k

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




Re: [Zope] RESPONSE.redirect

2001-01-29 Thread ender

On Monday 29 January 2001 09:14, Oliver Vecernik wrote:
 Hi all,

 I'd like to show a page and after a few seconds I'd like to redirect to
 another page. If I simply add !--#call "RESPONSE.redirect"-- it is
 done immediately. How can I achieve a delay of a couple of seconds?

 Oliver



meta refresh in your headers should do it. you can use dtml to dynamically 
insert the redirect page.

standard html (4?)

k

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




Re: [Zope] DTML difficulties

2001-01-30 Thread ender

dtml-with jobs
dtml-in "objectValues('JobsZClass')"
option value="dtml-var id"dtml-var title_or_id/option
/dtml-in
/dtml-with

same thing for taskforces

your error from what you tried was because you were trying to treat
the taskforce and job folder objects as lists which they aren't. what you had 
would work, if you changed your dtml-in to reference the respective folders 
objectValues method which will return a list of objects which dtml-in will 
iterate over.

kapil


On Tuesday 30 January 2001 15:12, Nolan Darilek wrote:
 I'm working on my first zope product and, while everything has gone
 relatively smoothly so far, I'm having some issues.

 The product is a folderish object which contains 3 subfolders, each of
 which contains a specific type of object. The structure looks
 something like this:
 work/: Main folder, UI, etc
jobs/: List of all jobs
projects/:
taskforces/:

 Each folder contains a job, project or taskforce object, as well as
 the UI to manage them.

 Now, the difficulty. I'm working on the UI for the job add form, which
 is in work/jobs. The form needs to iterate over the contents of
 projects/ and taskforces/, and I can't figure out how. Here's what
 I've tried:

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




Re: [Zope] Zope memory usage / cache

2001-01-30 Thread ender

On Tuesday 30 January 2001 10:09, Ron Bickers wrote:
 I have a site that has dozens of 300k+ Photo objects
 (http://www.zope.org/Members/Drew/Photo).  When I start Zope, it uses about
 10MB.  It will run at around 10-12MB for days as long as I don't access any
 of the photos.  Once I access several of the photos, it jumps up to around
 50MB.  The debug info says there are over 200 Photo object references.

 If I then do a Cache minimize, there are no longer any Photo object
 references, but the memory usage remains 50MB.  It will stay that high
 indefinitely (at least as long as I have tested -- a few days), even if the
 site isn't accessed.  If I restart, it goes back down to 10MB, and it will
 stay there as long as my photos aren't accessed.

 Is this normal behavior?  It seems crazy to have Zope sucking up that much
 memory when those photos are hardly ever accessed.

this sounds like normal operating system behavior. memory isn't being free'd 
just dealloc and returned to the program heap and marked as available. 

kapil

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




Re: [Zope] Zope memory usage / cache

2001-01-31 Thread ender

On Tuesday 30 January 2001 21:21, Ron Bickers wrote:
  -Original Message-
  From: ender [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 30, 2001 10:12 AM
  To: Ron Bickers; [EMAIL PROTECTED]
  Subject: Re: [Zope] Zope memory usage / cache
 
  this sounds like normal operating system behavior. memory isn't
  being free'd
  just dealloc and returned to the program heap and marked as available.

 Ok.  So you're saying that even though it says it's taking 50MB, much of
 that memory is probably available for other applications?  

warning: i'm on shaky ground here.

this is very os dependent. most os's don't resize a process's heap down on a 
dealloc. instead the heap has more available memory for that process (ie 
Zope), other processes will have to alloc from free memory.

the management of free heap space and disk caching is again os dependent, but 
a good os should try to do some optimization of heaps before thrashing, so 
starting a new process should cause a problem.


Does this mean
 that if another application actually starts to use that memory that the
 Zope process should start showing a reduction in use? 

no.

 How can I (if I can)
 see how much is really available? 

 i'm not sure how you would do this on linux.


Also, does the free memory below not
 necessarily reflect the amount of memory that is actually available for
 applications that may need it?

no it does not (again os dependent). free memory is indicator of the os free 
resources for new and current processes. for existing processes it is a 
indicator not a def. answer.

  total   used   free sharedbuffers cached
 Mem:126312 122936   3376  48424   5820  29952
 -/+ buffers/cache:  87164  39148
 Swap:   530104  21876 508228

 Sorry if this is inappropriate for the Zope list.  I have only *noticed*
 this behavior with Zope, but that may not mean anything.

if you're on linux trying starting up a large app (gimp comes to mind as a 
good one) and loading and unloading some large docs, and watch what happens


kapil

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




Re: [Zope-dev] Lists of Objects

2000-10-19 Thread Ender


please don't post html to this zope mailing lists, many people aren't
using html email readers


 Jack Fitzgerald wrote:
 
 Hello,
  I am currently keeping a list of objects sorted in a particular
 object. I am wondering if
 anyone has an opinion about whether I should keep just the 'id' in
 this list or if it is ok
 to actually keep a reference to the object in the list. When I use the
 list at a later point in time
 I will need to access several attributes of the object. If I keep the
 'id' I would have to find the object
 for each entry in the list. Thanks in advance for any opinions.
 
 -Jack Fitzgerald

depending on your application you could just do it the way zcatalog does
it and store the url and resolve the url to an object when you want to
access attributes.

kapil

___
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] Object references from dtml

2000-10-20 Thread Ender

Ross Boylan wrote:
 
 I have a log composed of sublogs, and so on.  I would like for people to be
 able to see some kind of summary (e.g., short versions of the logs down n
 levels) on the screen and then click on one of interest and see a fuller
 display of it.
 
 Is there a good way to do this using dtml?
 
 I've thought of two approaches.  The "standard" zope

having recently debugged company's zope server, i can safely say that
there is no 'standard'.

 way seems to be to
 make each log folderish, and give each entry an id.  Then I can embed the
 address in the html.  The problem with this is that I would have to make up
 the id's and add extra machinery that the logs don't really need.

 I'm leaning toward a second approach, of getting an object id and putting
 it in the html.  This also raises some issue.

you lost me. your problem with the first method is having ids for your
log entries and your second method starts with getting ids for your
objects. 


looking ahead, YIKES, you just went from can i do this in dtml to
messing with python code in the guts of the ZODB. that was a SERIOUS
leap. IMO i'd highly recommend against messing with the zodb stuff, _p_
attrs are supposed to be reserved. i understand you want to treat them
as read only, but i wouldn't even go near it if it could be implemented
easily otherwise or i had developed a strong masochistic tendency and
already knew the zodb well (well enough to know the answers to the below
questions).

 This also raises some issue.
* Will the id be stable in the face of the db potentially
 dematerializing objects underneath?

what id?

* If I use a persistent id (_p_oid, I think), will that be stable?

see above commentX2.

* (Also, I'll need to be sure everything has persisted, but I think I
 can do that by forcing a transaction end before getting the _p_oid).

transactions are important, but also telling it before hand that the
object is dirty and needs to be saved. you might want to read jim's
paper on the zodb. it and alot of other good material are linked from

http://www.zope.org/Members/itamar/LearningZope/LearningZope.html

* Can I map from object id back to object?  (_p_jar.something or other)

this is getting worse(scarier?) as i go on... i have no idea. consider
also that a url is also a unique persistent object id that maps into the
zodb, why your first method works. 

* Will this be robust across database changes (minimally, from ZODB to
 ZEO)?
* Will the object id consist of characters which can be embedded easily
 in html?
 

...

there are alot of other ways to do this... of the top of my head

you could always store log entries in a sql db. 

since you seem not adverse to doing it in python, despite your original
question...

so why not just write a python class for the log folder thats
persistent, add some methods for managing/storing log entries in a some
attr (maybe list of dicts) of the logfolder. write some dtml accessible
accessor methods to the attrs. write a dtml page for summary and one for
details. 

kapil

___
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] Excluding meta_types

2000-10-22 Thread Ender



you can redefine the meta_types tuple like so
meta_types=({'name':'MessageFilter',
'action':'manage_addMessageFilter'},)

btw how is GUM going?

kapil


"Morten W. Petersen" wrote:
 
 When I'm building a class which inherits from the OFS.Folder.Folder, how
 do I exlude the meta_types it brings with it (if it's there they come
 from).
 
 In other words, if I have a class, with meta_type 'MessageFilterFolder',
 which should only be able to contain instances of meta_type 'MessageFilter',
 what do I do (i.e. exlude all the other meta_types)?
 
 Thanks in advance.
 
 -Morten
 
 ___
 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 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] Unit testing, ZUnit

2000-10-23 Thread Ender

What do people think of this? 

you get my vote

kapil

___
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] 2 Zopes

2000-10-25 Thread Ender

Andre Schubert wrote:
 
 Hi,
 
 Can anyone tell me a way to get Zope Objects from the first
 Zope-Installation to the second.
 I need this because i have to program a Product to putting data into
 different Zope Installations from one point of the Web.
 My boss want this way because he want a central point for data input,
 where the data are of different type and therefore they have to stored
 in different locations( different Zope Installations) My idea is to use
 ZPublisher.Client, but i don't find a way to use it.
 
 thanks as

i've never done it before, but the options as always are multiple
depending on your needs and requirements.

if you can distill your objects down to simple python types (lists,
dicts, etc) you can try using xml-rpc and reconstructing the object on
the separate system. there is even a product that uses xml-rpc to
facilitate sharing between zope installs.

if you don't need to really replicate the info, and depending on the
frequency which it will need to be accessed you can just use xml-rpc to
a function on the second server and display the results directly on the
first server.

if you need to copy the actual objects verbatim you might want to
investigate exporting to zexp and using file transfer between the hosts
and (using Client to faciltate calling into zope) importing them on the
second server.

hth

kapil

___
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] strange FTP bug

2000-11-16 Thread Ender

Robin Becker wrote:
 
 I'm using python's ftplib to automate transfer of my dtml methods back
 and forth into my ZClasses
 
 I seem to be unable to GET a method called 'filtered_meta_types'
 from
 
 /Control_Panel/Procucts/myProduct/myZClass/propertysheets/methods
 
 I get instead a permissions error 550. I get the same transferring using
 another FTP client. I checked the ownership etc and it should be OK. I
 can only think it's some horrible acquistion problem relating to the
 default filtered_meta_types thing. Indeed when I rename to FMT it all
 works quite happily. Is this kind of 'feature' known/expected?

filtered_meta_types is used by zope to keep a list of the object
types/meta types that a user can create (and interact? with) in the
current context.

so yes this behavior is known and expected, else it would be possible to
bypass the security system.

kapil

___
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] Conflict Errors

2000-11-22 Thread Ender

Chris Withers wrote:
 

i'm no expert but deeply nested data structures in a single object are
rife with possibilities for conflict errors. if data might be changing
concurrently in the structures or frequently changing you would be
better off to switch the structure to nested persistent objects.

 No, for once it has nothing to do with the catalog. ;-)
 This is a python product of ours that stores lots of data in somewhat
 nested, persistent dictionaries. How can this be improved so this
 doesn't happen?
 
  I know your next questions are going to be "why?" and "how do I fix it?" and
  "why don't you fix it?".
 
 While I'd love it if you'd fix our code for free, it's probably beyond
 the OSS remit ;-) Any clues about how to make our code 'less bad' would
 be cool...
 
 cheers,
 
 Chris
 
 ___
 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 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] SQL-Methods Through-the-FileSystem

2000-11-26 Thread Ender

Johan Carlsson wrote:
 
  Seb:
   Does anybody have a good suggestion how to
   develope SQL Method ftfs (through the filesystem)
   rather than ttw.
  
   Perferably in someway similare to the HTMLFile way
 
  try something like this:
 
from Products.ZSQLMethods.SQL import SQL
import PoPy
 
def manage_add_user(self,email,password):
 
  conn = 'PoPy_database_connection'
  self.sql_add_user=SQL('sql_add_user', '', conn, 'email password', 
_sql_add_user)
 
  _sql_add_user = """
  insert into tbl_users(email,password)
  values (
dtml-sqlvar email type=string,
dtml-sqlvar password type=string
  )
  """
 
 Hi Seb,
 
 I guess I could skip putting it in a method and create the SQL instance
 as a attribute of the class (that I currently would be working on)?

yes

 Why do I need to import the database module?

sql methods are bound to database connections, you could instantiate one
without, but than you wouldn't be able to use it. 

 Couldn't I just try to locate/create a DA when my class is instantiated?

you could, the search routine in /lib/python/Products/ZSQLMethods/SQL.py
is a good starting point

 Would it be poor design to create a DA connection as an attribute of the class?
 Or would it be perferd to create it in the __init__ as a instance attribute?

do you really want to create a new db connection for every instance of
your class?


kapil

___
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] Questions, Jar, Transactions, Metaclassess, ZPatterns

2000-11-27 Thread Ender

sorry for the poorly worded question (midnight madness), let me try and
restate them a bit better in the fond hope that someone will answer any
of them.

whats is a jar? as far as i know its just the data  representation of
the object that gets stored in the zodb, hence its directly related to
the __dict__ of the object. but then what is the signifigance of calling
methods directly on the jar like i see in some of the transaction
machinery, is this an indirect call to the thread's zodb connection?

 does zope restrict you from doing metaprogramming with python products?
 or does zope's own metaprogramming reserve some names __klass__, etc?

i was reading through guido's essays yesterday, and happened upon the
metaprogramming essay ( i read it when i was first learning python but
it made a lot more sense now:). i was thinking about creating my own
caching metaclass, but i know that acquisition (and probably
persistence, and zclasses) use some c-based metaclasses to work. i'm
just curious what the possibilites and restrictions are of doing
metaclasses in zope, so my classes play well with others. 

in /lib/python/Shared/DC/ZRDB/TM.py, i see the class Surrogate defining
methods for __inform_commit__ and __inform_abort__, what are these for?

In ZPatterns/Transaction.py I see some talk of transaction boundaries,
namely the inability for an object participating in the transaction to
know that a transaction is finished. From my understanding of
transactions i thought that an object could assume a transaction was
over if it has its tpc_finish called on it when its not in a
subtransaction. I understand that the Zpatterns problem here might be
related to providing attrs to other objects which might be used in a
tpc_finish but i just wanted to clarify/make sure.

kapil

___
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] objectValues performance

2000-11-27 Thread Ender

Brett Carter wrote:
 
 I have a folder with greater than 5000 ZClass instances in it.  It
 takes  5mins to do an objectValues for every object in the folder -
 is there a higher perfomance call I could make?
 -Brett

use a catalog. (which only help if you want a filtered set or a schema
attrs of the object)

beefing up your memory (assuming you want zope to use alot), could also
help, assuming these objects are accessed frequently enough to stay in
the object cache.

kapil

___
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] Massive scalability

2001-01-17 Thread ender

On Tuesday 16 January 2001 20:42, Michael Bernstein wrote:

 Are you saying that Zope's startup and shutdown time is
 affected by the size of the ZODB?

AFAIK on a filestorage zope loads up the indexes (oid, file_offset?) into 
memory on start to facilitate object retrieval which impacts start up time. i 
don't think the other storages operate this way.

kapil

___
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] mounting obj to more than one zodb location

2001-01-17 Thread ender

whats happens when you create a persistent object and mount it 
to multiple points on your zodb. do you get a shared ref or multiple
copies of the object?


kapil

___
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] Annouce Developer Version DTML-Page-Contract

2001-01-22 Thread ender

hello zen masters

i just finished documenting a developer version of a port of the ACS's 
(arsdigita community system) acs_page_contract to dtml.  test it out,
i'm pretty sure everyone will be happy with the simplification of the 
resulting dtml. 

feed back and thoughts welcome.

if no bugs are found in the next week or so i'll make it a general release,
new filters are always welcome.

available at 

http://www.zope.org/Members/k_vertigo/PageContract.tgz

kapil


readme included below.

README.txt

INSTALL:
extract PageContact.tgz in your zope directory. it will create
a python product in lib/python/Products. you will need to
restart zope before you can use dtml-contract

UNINSTALL:
remove the PageContract directory from lib/python/Products and
restart zope.

I. What
Page-Contract is a python product that adds a new type of dtml-tag 
to your zope installation. dtml-contract is a multi-purpose tag that
is designed to provide documentation, marshalling and filtering of
request data, and custom error handling of the request data. the
documentation comes from a read only section of the contract 
which should describe the purpose of the object, its author, and
some information about its parameters. the marshalling and filtering
is done by naming variables expected in the request and associating
one or more filters with those variables. PageContract comes with
a set of prebuilt filters although it can easily be extended by
writing new filters. lastly it allows association of different
error handlers to different variables.


II. Why
Zope already includes facilties to perform simple marshalling of 
REQUEST values submitted via GET/POST into python data_types. This
facility is built into ZPublisher. There are a couple of problems
with this facility in real world usage. First, ZPublishers 
marshalling isn't secure because it retrievesmarshalling info from
the REQUEST, a cracker could perform url surgery to by pass
the marshalling. Second, ZPublishers marshalling isn't easily
extensible to provide application level support of. The marshalling
is buried square in the guts of the Publishing process, even if you
did extend it would be too early in the Publishing of the object to
perform any meaningful application specific processing (ie you don't
know where you're going so how do you know what you'll see when you 
get there). Third ZPublisher has no concept of excluding parts of 
the REQUEST that aren't needed, this is mitigated by Zope placing the
REQUEST on the bottom of the namespace stack, however it still 
provides a means for accidents (ie. you're expecting this object to have this
attr, but it doesn't but the REQUEST has that attr). dtml-contract 
can optionally strip the REQUEST of variables not explicitly named
within it. Fourth, ZPublisher is inflexible about how it handles 
errors. ZPublisher has hardcoded return values whenever it hits
a bad input AND it short circuits the evalutation. Users don't 
get informative messages regarding their errors other than they 
made one. dtml-contract differs in that it collects all errors 
and associates them with their variables and provides the option
of custom error pages on a variable by variable basis with 
information passing about the errors. (The current implementation
is limited in that it only passes a list of filter errors to the
error handler via a url string.)

The dtml-contract also hopes to offer a standardized form
of documenting your zope objects (DTML_METHODS, DOCUMENTS,
and the like) by standardizing on a documentation format
and a location for that documentation.


III. How
So how do you use it?

dtml-contract

Documentation about this object

@author Kapil Thangavelu [EMAIL PROTECTED]
@params myobj_id the id of the object where after
@params title we'll set the object's title to this value
@params thedate should be the range of the bada and bing
@params foobar optional integer value that tells us whats going on

dtml-params

myobj_id:objid
foobar:integer,optional
thedate:range(date, 1.1.1, 11/11/11)
title:string
dtml-exceptions
myobj_id:my_error_page
generic_error_page
/dtml-contract

Generally dtml-contracts should be used at the start of a dtml
page. why? so they can be easily referenced for documentation
and knowledge of the expected parameters.

Caveats. Note that there are no strict enforcements of the documentation
section. Although some future documentation extraction 

[Zope-dev] Re: [medusa] Re: [Zope-dev] asynchat producer ready() method patch.

2001-01-31 Thread ender

On Wednesday 31 January 2001 04:18, Donovan Baarda wrote:
 On Mon, Jan 29, 2001 at 07:26:56PM +0100, Dieter Maurer wrote:
  Donovan Baarda writes:
On Sun, Jan 28, 2001 at 09:31:07PM +0100, Dieter Maurer wrote:
 Donovan Baarda writes:
   I remember reading ages ago on a wishlist for ZServer that
   someone was thinking of adding blocking support to producers.
   This patch adds support for just that in a non-intrusive way. I
   haven't tried applying this patch to ZServer, but it _should_
   work.

 What does "blocking support dor producers" mean?
   
Disclaimer: you must be moderately familiar with
ZServer/medusa/asynchat for the following to make sense;
   
Asynchat used by ZServer and medusa use producers as a way to "push"
data through an async interface. The current version of asynchat
requires that producers be able to produce data immediately on calling
their more() method, untill they are finished, when they return ''.
   
My patch adds support for producers being able to "block" by letting
asynchat know if they are ready via a ready() method. This allows you
to use the simple producer model to push data that may not be
immediately available. An example would be a http-fetch producer that
fetches data from upstream for a proxy.
   
This patch is only useful for people creating or modifying things like
medusa or ZServer.
 
  Thank you for this good explanation.
 
  By now, I think, it would not be usefull for ZServer, at least
  not for standard operations.
 
 ZServer is a multi-threaded server, where different requests
 are serviced by different threads.
 The thread may block and does simply not return from "more()".
 
 On first thought, you patch might free some blocked threads
 to do productive work. However, Zope's transaction system
 is linked to thread management. If you patch would be used
 for that, Zope's transaction subsystem would need to be
 rewritten.

 Hmmm, it's been a while since I looked at ZServer, I might have to take
 another look. I thought that it pre-spawned a number of threads that each
 ran their own asyncore.loop event handler. I thought this was a neat way to
 get the benefits of async event handlers and distributing threads on
 multiple processors. Unless it spawns new threads when it needs them, it
 would still be possible for ZServer to get blocked if all the threads were
 blocked.

disclaimer: insert here.

zserver has a main thread which binds and listens, passing requests to a pool 
of zpublisher threads. the zpublisher threads communicate with the client via 
the main threads dispatcher, ie output is funneled back into the main 
thread's dispatcher so as not to tie up threads talking to distant clients.

reference: Zserver/medusa/select_trigger.py

python has a global interpreter lock, so multiple cpus have little utility. 
 

 However, my patch is only useful if you _have_ producers that can block. It
 is usually possible to re-structure your system so that no producers block
 (typicaly by using a dispatcher instead of a producer). The ready() block
 feature is really a shortcut way of modifying an existing producer-based
 design when you realise that the producer can block; ie an alternative way
 of implementing it that may or may not be better.


i've taken a quick look at the patch, i find it interesting in that it 
provides i think a way to implement a Proactor type server vs the standard 
medusa Reactor style server.

reference: Patterns of System Architecture Vol II.  Douglas Schmidt et al
reference: http://www.cs.wustl.edu/~schmidt/PDF/proactor.pdf

and a webserver that makes use of this pattern
http://www.cs.wustl.edu/~jxh/research/


kapil


 In my case I wanted to create a cached-ftp-backend filesystem that medusa
 could serve via ftp or http. Unfortunately the existing ftp and http server
 implementations used producers to pull data from the abstract filesystem.
 Since my "filesystem" could block pretty severly, I either needed to
 completely re-write the http and ftp servers to use dispatchers instead of
 producers, or implement blocking for producers (or use a seperate thread
 for each request, but I thought that defeated the purpose of using an async
 event loop).



 I really must look at ZServer to figure out how it handles things... I
 suspect that my patch by itself would not _hurt_ ZServer, but perhaps if
 you started using the ready() feature it provides it might cause problems.
 I'll have a look at ZServer again soon and give you an evaluation of how my
 patch would interact with it.

 Who knows, someone might find a need for blocking producers as ZServer
 evolves, and if people know the patch exists, they might use it instead of
 re-structuring to get around it :-)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or 

Re: [Zope-dev] Creating IMAP and SMTP services for Zope

2001-02-03 Thread ender



On Saturday 03 February 2001 10:28, Morten W. Petersen wrote:
 Hi guys,

 I'm wondering about creating IMAP and SMTP services for Zope.
 Someone mentioned to me that extending (using?) the ZServer
 could be a Good Thing (tm).

probably. i've always been curious though about the threads in zserver, i 
thought they were allocated to handle only zpublisher requests (maybe just 
http requests). assuming you don't want to tie up the thread handling the 
asyncore it seems you might need to create a pool of threads for handling 
requests, or adjust your code to translate imap/smtp requests into zpublisher 
requests so the default pool can be used. granted if you're not also running 
a  busy website on this than it probably won't be a concern as esp. if the 
server operations are fast.

 Could anyone point me in the right direction?

micheal already pointed out his imap code. i'd like to give warning that 
handling imap properly with different clients can be a pain. the protocol is 
a bit complex and there are some gray areas, which different clients handle 
differently. pop is much, much simpler if you want to go that route (with the 
option of just leaving mail on the server, you might be able to treat it 
superficially  like imap).

barry warsaw has an async implementation of a smtp server that he uses to 
test out mailman, its on his homesite at

http://www.wooz.org/users/barry/software/Code/smtpd.py

HTH,

kapil

___
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] The field converters (:int, :text, etc.)

2001-02-06 Thread ender

my alpha quality dtml-contract tag does allows custom field converters much 
as has been requested here, its meant as a generic form processing engine 
with the ability to define per variable error pages. its got some other 
features. its modeled on the arsdigita (acs) ad_page_contract.

due to my stupidity you have to add a custom filter directly to the filter 
dictionary defined in Filters.py.

fyi for the license impaired its gpl'd

available at www.zope.org/Members/k_vertigo/PageContract.tgz

kapil



  On 4 Feb 2001, at 15:59, Morten W. Petersen wrote:
   IIRC, there was some talk about modularizing the field
   converters (checkers) so that they could be easiliy modified
   and added to.  Is there currently any efforts to solving
   this problem?  If not, there's definently a need for it,
   IMO..
 
  I agree. Each time I get a Zope update I have to edit Converters.py
 
  What I want is something like :empty_as_none
 
  So a float, int or date field will be passed as None if the fields are

 blank,

  rather than having the converter raising an exception.
 
  ignore_empty doesn't work, because then the field isn't passed in the
  Record at all.
 
  I use SQLDict as the backend for all my forms (wow, it's great), so None
  really is needed for every field if its blank. If I have ignore_empty,

 then that

  field doesn't get updated in the database, so if someone wants to blank
  out a field, they can't do it.
 
 
 
  Brad Clements,[EMAIL PROTECTED]   (315)268-1000
  http://www.murkworks.com  (315)268-9812 Fax
  netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements
 
  ___
  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 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 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] SAP DB -- ZODB ?

2001-03-10 Thread ender

On Friday 09 March 2001 07:20, Steve Alexander wrote:
I just heard that the SAP DB has gone Free and Open Source.

sapdb isn't open source yet. it will be in a few months. when it does it 
looks like it will instantly become the most advanced open source database 
out there. my current rankings of the general os rdbms  in terms of features 
postgresql-interbase-mysql  

currently sapdb has only opened the database manager and the client 
interfaces as well as the build environment needed to make these from src.

the feature list of this database is astonishing
www.sapdb.org

to name a few
subtransactions
outer joins
sql 92 compliant, possible modes for db2, oracle 7
very nice prodecural sql language.
lots of statistics information
really rich set of standard functions
scrollable cursors

this is a great candidate for a zodb storage

kapil


  SAP DB is an open, SQL-based, relational database management system that
   provides high availability and performance scaling from small to very
large
   implementations.

  In addition, SAP DB goes beyond relational database technology by
 offering object orientation as well as support for managing unstructured
 data. It supports open standards including SQL, JDBC and ODBC; access from
 Perl and Python; and HTTP-based services with HTML or XML content. SAP DB
 is platform independent, so users can deploy it for a wide array of
 projects.

   Since 1994, the SAP e-Business Solution is available on SAP DB
technology.
Today  SAP DB is being used by nearly 800 customers.

  On October 5, 2000, at Linux World SAP DB was announced to be made
available
as Open Source software using the GNU General Public License for the
database
kernel and the GNU Lesser General Public License for clients and
 programming interfaces.


http://freshmeat.net/projects/sapdb/

I'd never heard of SAP DB before, although I've heard of SAP.

This looks as if it would be good for a ZODB storage.

--
Steve Alexander
Software Engineer
Cat-Box limited


___
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 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] DBObjects 1.0 and Demos for Proiektor ZQuest released

2001-04-05 Thread ender


hi, 

this seems pretty cool, and i'd like to thank stephen and iuveno for 
releasing it, but the release seems pretty half-baked.

the website
1. dbobjects demo is not existent
2. the documentation for projektor is password protected
3. there are no downloads apparent for anything but dbobjects

dbobjects distro
1. no __init__.py, hence not usable in zope without guessing your own.
2. the DBFolderishObject references a SQLTools module that is not present
   - it does not seem to use this so i just removed the reference.

documentation
1. it should be explicitly stated that these are for subclassing in python
and the name restrictions imposed.

dbobjects arch
1. no use of volatile variables to minimize read/writes to db.
2. the use of exec can lead to only sorts of ref count problems, using
of __imp__  (or imp) would probably be better. 

hopefully some of the above can be fixed, and then i'm sure these products 
will see some use in the zope community.

cheers

kapil


Hello everyone,

iuveno AG, Ingolstadt Germany, has made available a demo and products page,
releasing several products:

THE LINK: http://demo.iuveno-net.de/

1. DBObjects 1.0 - DBObjects is a framework that maps relational data to a
Zope object tree. It provides many features (such as SQL Method
auto-generation) and saves up to 95% development time on object creation
with relational data. API Documentation, a Demo, Feature List and so on are
available on the site.

2. Proiektor - Proiektor is a groupware and project management system
developed by iuveno. It is based on DBObjects and implements a nice set of
features with some unique design ideas. But see yourself...

3. ZQuest - ZQuest was originally written for a university as testing tool
and is now also developed by iuveno AG. It has a good set of features,
especially for scientific questions. ZQuest uses DBObjects of course. If
you are interested, click on the link above ...

4. CMS - Our Content Management System is coming soon with a true
user-friendly management interface...

ALL THESE PRODUCTS ARE OPEN SOURCE!!! Please feel free to contact me any
time via E-mail ([EMAIL PROTECTED] or [EMAIL PROTECTED]) or via phone at
+1-901-230-ZOPE (9673).

I hope you enjoy!

Regards,
Stephan


--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development  Technical Project Management


___
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 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] ZPatterns, DataSkins, forms and error checking/handling

2001-04-06 Thread ender

On Tuesday 27 March 2001 17:40, Itai Tavor wrote:
Hi,

I'm trying to work out the best way to check for and report errors
when DataSkin objects are created/edited, but I'm having a lot of
problems.

For form validation, Zope's build-in constraints are pretty
useless... things like ValueHandler are a little better, but IMO not
good enough. When a user types incorrect data in a form, I don't want
to display a page with a list of errors and say "click Back to fix
your errors". I want to return the form, with a list of errors and
the bad fields highlighted. So I need to perform field checks in the
form action method and in case of errors call the original form,
giving it an error list.

I know that to ensure that object data is always valid I should
validate the object in a SkinScript, using WHEN OBJECT ADDED,CHANGED
call self.validate(), and raise an exception in validate in case of a
problem. But this can't deal with returning the original form. It can
only display error pages, and to display nicely formatted error pages
it has to return a DTML Method so I can use dtml-raise, rather than
directly do raise in validate.

So I'm looking at a validate method for use at commit time, a
show_errors DTML Method, and a validate_form to call from the form
action method...

The validate_form method is defined in the DataSkin class. But it is
also used when a new object is created from a form, so it needs to be
called from a Specialist before the object is created, so I need to
import it in the Specialist. But this method might use other methods
of the DataSkin class, so I need to import those too...

So, to sum up, I need a method used in commit time, that renders a
DTML method to raise an error message, another method to verify form
submissions and return the form with error messages, and I need to
import that method and all other methods it uses into the Specialist.
This seems too much work...

Can anyone suggest a simpler approach (one that still retains the
ability to return the original form in case of errors)?

check out dtml-contract.

sample form processor with dtml contract

dtml-contract
this page retrieves records from the db based on user input
dtml-params
foo:int,optional
bar:date
foobar:range(int, 0,10)
dtml-exceptions
bad_user_input
/dtml-contract

user gets redirected if bar is not a valid date string, and foobar is not a 
integer compatible string between 0 and 10. if foo is present it must be a 
integer compatible string (compatible means coercible via int(foo)). if any 
of these things does not happen than all the collected errors for the page 
are sent to the error handler bad_user_input. this is not a redirect, the 
error handler is evaluated in the context of the page with an additonal value 
added to the namespace to denote the list of errors. page processing stops 
after evaluation of the tag if an error occurs.

this may be clear as mud, i don't know, i tried to make the included 
documentation pretty inclusive and readable, its not completely insync with 
the code but it does elaborate on the feature set pretty well. if you have 
specific questions feel free to ask.

so in your case you can just use the original form as the error handler and 
add logic to it to insert the values if they already exist in the request, 
and display error messages to the user on the particular vars that have 
problems based on the existence of the special error variable.

hth

kapil


TIA, Itai

___
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] **Important Notice** for Zope public CVS users

2001-04-12 Thread ender

On Thursday 12 April 2001 12:46, Brian Lloyd wrote:

We are soon going to begin checking in changes to the head of
the Zope CVS that will require the use of Python 2.1. Once we
start on the 2.4 tasks, you will not be able to use a public
CVS checkout of Zope with older Pythons.

We are not going to start this until after Python 2.1 final
is out (expected next monday), but wanted to give CVS'ers
fair warning. If you are using the current public CVS and
don't want to start using Python 2.1, you should either
avoid doing any CVS updates until you're ready to migrate
or move off of CVS to a current (2.3.1) release.

will there be a 2.3 maintenance branch or will all development stop on 2.3?

curious,

kapil

___
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] Re: [Zope] **Important Notice** for Zope public CVS users

2001-04-13 Thread ender

On Friday 13 April 2001 02:22, Oleg Broytmann wrote:
Hi!

On Thu, 12 Apr 2001, Brian Lloyd wrote:
 We are soon going to begin checking in changes to the head of
 the Zope CVS that will require the use of Python 2.1. Once we
 start on the 2.4 tasks, you will not be able to use a public
 CVS checkout of Zope with older Pythons.

   Why not make a branch, and port some important things from one branch to
the other? This allows people to checkout from the branch, not from the
head.

i asked brian much the same thing on zope-dev (i was trying to avoid cross 
posting). his is response follows. 

-kapil



There is (and will continue to be) a "current release branch", 
which is the branch that stable (bug-fix) releases are made 
from. Currently the release branch name is 'zope-2_3-branch'.

This is probably the branch that most CVS users actually want 
to be using anyway. Running from the trunk you get all of the 
latest bugfixes, but you also get all of the latest half-baked 
work for the next feature release - which might be worse than 
the bugs you were trying to avoid in the first place :)

So if you are running from CVS (but are not running from the 
current release branch) you can go into your local copy and 
do: 'cvs up -d -P -r zope-2_3-branch' to update to the release 
branch checkout.

The warning is mostly aimed at the bleeding-edge people who 
use the CVS trunk. If you are running the release branch you 
will continue to get bug fixes and will not need to upgrade to 
Python 2.1, as the changes in preparation for 2.1 will only 
go into the trunk.

___
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] Request for a Pluggin Index (NameIndex)

2001-06-06 Thread ender

On Monday 04 June 2001 16:55, Andreas Jung wrote:
Looks like you should write your own index type. Zope 2.4
comes with an PlugableIndex interface to allow third-party
indexes to be integrated into the Catalog.

this brings up an interesting question of what is the best way to register a 
new plugindex thats distributed with a product. Glancing over the cvs logs it 
looks as though plugin indexes are arranged to be the first product installed 
in Application.py. Given that what is the suggested method for registering a 
new plugin index?

Kapil


Andreas
- Original Message -
From: Chris Withers [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 04, 2001 4:05 PM
Subject: [Zope-dev] Request for a Pluggin Index (NameIndex)

 Hi,

 If anyone's got the time or fancies a challenge, could they write an
 index that behaves as follows:

 Indexed values:
 1) C.J.Withers
 2) Chris Withers
 3) C Petrilli
 4) Christopher McDonough

 search result
 C  1,2,3,4
 C.J.Withers1
 c.j.Withers1
 withers mcdonough  1,2,4
 Chris  2,4
 Christo4

 I think the basic rules are:
 - split on whitespace and punctuation (not accentuated characters and the
 like ;-)
 - index each remaining name part
 - when searching, return all records where any of the name parts match
 something like:
 string.find(name_part,search_expression)

 ...oh yeah, and do it blindingly quickly ;-)

 This would be really useful for the Creator dublin core field and
 anywhere you're searching for someone's name. The CMF could benefit from
 it and

would

 eliminate the phrase next to the Creator field which has haunted me from
 Squishdot:

  Note that you must enter their username exactly. 

 cheers,

 Chris



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