[Zope-dev] Task, Job or Operation?

jpenny@universal-fasteners.com jpenny@universal-fasteners.com
Mon, 23 Oct 2000 19:04:21 -0400


On Mon, Oct 23, 2000 at 03:07:25PM -0700, James Johnson wrote:
> Is there a Wiki or some other starting point for this thread. As a 
> newbie I like safe vs power over anything else.  I also understand 
> that with using anything in a power mode can be risky for a newbie.  
> It's nice to know that I can start out learning in a safe mode and 
> then graduate to a power mode after learning more. Is there a 
> ZopeScript and why not? Safe ZopeScript can be written in using other 
> scripting languages.  Zopelet imho is not as marketable as ZopeScript.

OK, this is the problem.  There are several ways of writing executable
code available to other objects in Zope.  One is the Python Method.
It is available from http://www.zope.org/Members/4am/PythonMethod

From 4am's page:
PythonMethods will not allow assignment to an attribute, element, or slice. 
No "del" is allowed.  Names starting with "_" are not accessible. Import 
is controlled. Globals all live in a private namespace.

There is a proposal to call this construct a Zope Script.  And your
message is exactly the ammunition I wanted.  Thanks!

The other way to script in python is currently called an External
Method.  Since perl is being added as a Zope scripting option, this
will clearly have to be renamed, as well.  External Methods have none
of the restrictions of PythonMethods.  This makes it quite easy to escape
all Zope security, to crash Zope, and to do other nasty things.  Needless
to say, Zope hosting sites do not generally provide External Methods.

There is no ZopeScript, and probably never will be.  What would
ZopeScript do?  Would it be a construct like JavaScript that was
executed on the client's computer?  If so, every browser vendor would
have to support it.  This is unlikely, to say the least.

Is it server side?  Then DTML, PythonMethods (to be renamed), PerlMethods
(which don't exist yet), External (Python) Methods, External Perl Methods
(which also don't exist yet) give plenty of scripting options, without the
need for another language.

It is not at all clear that Safe scripting methods (in the strong sense
meant here, meaning that it can neither damage the client nor the 
server), can be written in languages other than Python (I have
heard some doubts expressed about perl).

And, there is generally no need to "graduate" to external (power)
methods.  You only need to use an external method when you need a
module not imported by Zope (not available through the _ namespace).

So, you have written several things in your message that really
bolster my dislike for both zope script and power as terms.
1) You have gone from the word Zope Script to a separate language
ZopeScript in a single bound.  2)  You have assumed that you will
want to "graduate" from Safe Methods to "Power" Methods (You don't,
external methods are last resort options).  3)  "Power" methods
don't require a lot more learning than Safe Methods.  You have
to learn what modules are available, but you are using the same
language in either case!

Maybe my suggeston of flexible is to weak.  Maybe they should be
Escape Hatch Python Operations (Escape Hatch Python Zopelets)!

>   When you call it operation, method, or function it takes it away 
>  from it's context.  This is zope specific right?  Excuse me while I 
> use safe ZopeScriptPython or power ZopeScriptPerl.

Not really Zope specific in the sense you mean.  It is an object (not
in the OO meaning) that can be called from a Zope site.  But the 
language is pure Python (perl), with no modifications, and usually
can be snipped and executed outside of Zope.

> 
> 
> Get your Free E-mail at http://tacoma.zzn.com
> ____________________________________________________________
> Get your own Web-Based E-mail Service at http://www.zzn.com
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> 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 )
>