Re: [Zope] Newbie Question

2006-09-24 Thread Andreas Jung



--On 24. September 2006 10:49:12 -0500 Perry Smith [EMAIL PROTECTED] 
wrote:



Is it possible to have the same host running ZOPE 2 and ZOPE 3?  I  would
like to put both on a Mac OS X server.  I have Apache 2.2  running on it
and PostgreSQL version 8.1.3 running my existing  software.  I'd like to
add zwiki which uses ZOPE 2.  And then add  ZOPE 3 so that I can start
developing a new application.  Can all  three of these coexist on the
same machine?  Are there any suggested  do's and don'ts to follow in such
an arrangement?



You can use configure --prefix=/path/to/dir to install (at least Zope 2)
into a custom location. This might also work for Zope 3. In addition
you must adjust the ports in etc/zope.conf (for Zope 2) in order to run
multiple Zope instances on different ports.

-aj



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


Re: [Zope] Newbie-question

2005-06-23 Thread Paul Winkler
On Thu, Jun 23, 2005 at 08:55:05PM +0200, Thomas Adams wrote:
 hi all,
 
 I have specific folder name art in Zope in which i installed a user 
 folder, and a user
 with manager role. now i want anaonymous user to access i.e view
 the website ubeneath the folder art. Therefore i granted View 
 Permission to the Anonymous Role
 at the folder level art, but that doesn't work. Then i came to the 
 conclusion to grant that
 Permission at root level. But that doesn't work too. So my question is:
 What i have to do if:
 
 1. i want only a manager user acces to the ZMI beneath the folder art

It should be enough to give only to Manager the permission
View management screens on that folder.

 2. grant anonymous user acces to view the generated pages beneath this 
 folder

View and Access Contents Information usually do the trick.
If not, google for VerboseSecurity - a great add-on product
that will help debug security issues.

-- 

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


Re: [Zope] Newbie-question

2005-06-23 Thread Thomas Adams

Paul Winkler schrieb:


On Thu, Jun 23, 2005 at 08:55:05PM +0200, Thomas Adams wrote:
 


hi all,

I have specific folder name art in Zope in which i installed a user 
folder, and a user

with manager role. now i want anaonymous user to access i.e view
the website ubeneath the folder art. Therefore i granted View 
Permission to the Anonymous Role
at the folder level art, but that doesn't work. Then i came to the 
conclusion to grant that

Permission at root level. But that doesn't work too. So my question is:
What i have to do if:

1. i want only a manager user acces to the ZMI beneath the folder art
   



It should be enough to give only to Manager the permission
View management screens on that folder.

 

2. grant anonymous user acces to view the generated pages beneath this 
folder
   



View and Access Contents Information usually do the trick.
If not, google for VerboseSecurity - a great add-on product
that will help debug security issues.

 



Unfortunately VerboseSecurity seems not to work on Zope 2.7.5-final.
I think there are some security issues by my ZCLasses used within the
above mentioned folder. Is there any hack to agin more information
for security issues or for installing VerboseSecurity on this new Zope 
version.


Thanks in advance
Thomas Adams



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

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


Re: [Zope] newbie question

2005-05-25 Thread Florent Guillaume
Barry Drake  [EMAIL PROTECTED] wrote:
 I'm getting an error in CMFCore.utils in the
 _mergedLocalRoles function.  The error is:
 
 Exception Type  TypeError
 Exception Value can only concatenate tuple (not
 list)
 to tuple

Note, this problem is due to a non-core product somewhere incorrectly
managing local roles, and passing them as tuples instead of lists. All
the internals of Zope (and here, CMF) assume that __ac_local_roles__ is
a dict of string-list.

Florent


-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] newbie question

2005-05-24 Thread Phillip Hutchings
 I modify utils.py, after saving a copy, in order to
 obtain diagnostic output.  Then I delete utils.pyc,
 after saving a copy, in order to force a recompile
 (even used compilezpy.py for this a couple of times).
 Zope never seems to use the new version.

Restart Zope. Python will pick up the changes. Also, if you're
modifying security code, make sure you set
security-policy-implementation to Python in zope.conf, otherwise
you're using the C one, and no matter what changes you make to the
Python scripts you won't see any changes.

 I suspect that I have a fundamental misunderstanding
 of how Zope uses code in the Products directory.
 
 Is Zope storing all the compiled byte code in the
 data.fs file?  Is there a way to force Zope to use new
 code?

No. Refresh the product or restart Zope.

 Also, the previous developer removed the Control Panel
 putting Plone as the root of everything.  How can I
 get information that the Control Panel usually
 provides?

Find a heavy object, find the developer, bring the two together at
speed. Repeat until the problem is fixed.

yoursite/manage will get you to the control panel. If he's managed to
override /manage then you have problems...

And the real problem:

 TypeError: can only concatenate tuple (not list) to
 tuple

Like it says, you're supplying a list, you want a tuple. It looks like
you need to update PluginIndexes, I don't know where they come from.


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


Re: [Zope] newbie question

2005-05-24 Thread Barry Drake
Thank you Phillip.  I modified the zope.conf file as
you suggested and did

sudo ./zope stop

... usual msg

sudo ./zope start

... usual msg

Then generated the error.  The error log shows the
same output as before.  Not only should the line
number be one higher, I also put a dummy variable name
on that line to generate a stupid error msg.

How can it not be getting to that code?  I've searched
for another Zope instance, but found none.

Also, you are saying that I probably will never get
the Control Panel back on this site with Product
Management tools; no Product refresh then, I suppose. 
I'll have to thank the previous developer, as you
suggest!  (of course there is no documentation either,
arrgh!)

If you can think of anything else, I'd appreciated it.

Thanks.
Barry

--- Phillip Hutchings wrote:
  I modify utils.py, after saving a copy, in order
 to
  obtain diagnostic output.  Then I delete
 utils.pyc,
  after saving a copy, in order to force a recompile
  (even used compilezpy.py for this a couple of
 times).
  Zope never seems to use the new version.
 
 Restart Zope. Python will pick up the changes. Also,
 if you're
 modifying security code, make sure you set
 security-policy-implementation to Python in
 zope.conf, otherwise
 you're using the C one, and no matter what changes
 you make to the
 Python scripts you won't see any changes.
 
  I suspect that I have a fundamental
 misunderstanding
  of how Zope uses code in the Products directory.
  
  Is Zope storing all the compiled byte code in the
  data.fs file?  Is there a way to force Zope to use
 new
  code?
 
 No. Refresh the product or restart Zope.
 
  Also, the previous developer removed the Control
 Panel
  putting Plone as the root of everything.  How can
 I
  get information that the Control Panel usually
  provides?
 
 Find a heavy object, find the developer, bring the
 two together at
 speed. Repeat until the problem is fixed.
 
 yoursite/manage will get you to the control panel.
 If he's managed to
 override /manage then you have problems...
 
 And the real problem:
 
  TypeError: can only concatenate tuple (not list)
 to
  tuple
 
 Like it says, you're supplying a list, you want a
 tuple. It looks like
 you need to update PluginIndexes, I don't know where
 they come from.
 
 
 -- 
 Phillip Hutchings
 http://www.sitharus.com/
 [EMAIL PROTECTED] / [EMAIL PROTECTED]
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] newbie question

2005-05-24 Thread Phillip Hutchings
 Then generated the error.  The error log shows the
 same output as before.  Not only should the line
 number be one higher, I also put a dummy variable name
 on that line to generate a stupid error msg.
 
 How can it not be getting to that code?  I've searched
 for another Zope instance, but found none.

This is really odd. It sounds like it could be getting patched
somewhere. Try raising exceptions from various points in the method,
see if one gets there.

 Also, you are saying that I probably will never get
 the Control Panel back on this site with Product
 Management tools; no Product refresh then, I suppose.
 I'll have to thank the previous developer, as you
 suggest!  (of course there is no documentation either,
 arrgh!)
 
 If you can think of anything else, I'd appreciated it.

If the /manage URL has been overridden it's probably possible to fix
it. Try going to /manage_workspace, see if that works. Is Zope behind
a proxy? It's possible that it's being done with a URL rewrite
somewhere.

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


Re: [Zope] newbie question

2005-05-24 Thread Barry Drake
Thanks for your help.  I really needed another brain
to bounce things off of so I can get out of the rut
I'm in.  You've given me some fresh ideas to try.

Thanks.
Barry

--- Phillip Hutchings wrote:
  Then generated the error.  The error log shows the
  same output as before.  Not only should the line
  number be one higher, I also put a dummy variable
 name
  on that line to generate a stupid error msg.
  
  How can it not be getting to that code?  I've
 searched
  for another Zope instance, but found none.
 
 This is really odd. It sounds like it could be
 getting patched
 somewhere. Try raising exceptions from various
 points in the method,
 see if one gets there.
 
  Also, you are saying that I probably will never
 get
  the Control Panel back on this site with Product
  Management tools; no Product refresh then, I
 suppose.
  I'll have to thank the previous developer, as you
  suggest!  (of course there is no documentation
 either,
  arrgh!)
  
  If you can think of anything else, I'd appreciated
 it.
 
 If the /manage URL has been overridden it's probably
 possible to fix
 it. Try going to /manage_workspace, see if that
 works. Is Zope behind
 a proxy? It's possible that it's being done with a
 URL rewrite
 somewhere.
 
 -- 
 Phillip Hutchings
 http://www.sitharus.com/
 [EMAIL PROTECTED] / [EMAIL PROTECTED]
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] newbie question

2005-05-24 Thread J Cameron Cooper

Phillip Hutchings wrote:

Then generated the error.  The error log shows the
same output as before.  Not only should the line
number be one higher, I also put a dummy variable name
on that line to generate a stupid error msg.

How can it not be getting to that code?  I've searched
for another Zope instance, but found none.



This is really odd. It sounds like it could be getting patched
somewhere. Try raising exceptions from various points in the method,
see if one gets there.


It doesn't look like a monkey patch. Those aren't invisible in tracebacks.

Follow the code path higher until you do get some effect.


Also, you are saying that I probably will never get
the Control Panel back on this site with Product
Management tools; no Product refresh then, I suppose.
I'll have to thank the previous developer, as you
suggest!  (of course there is no documentation either,
arrgh!)

If you can think of anything else, I'd appreciated it.



If the /manage URL has been overridden it's probably possible to fix
it. Try going to /manage_workspace, see if that works. Is Zope behind
a proxy? It's possible that it's being done with a URL rewrite
somewhere.


I would imagine it's some sort of redirect. I would start with using the 
IP address: usually this is enough to avoid the redirect. Otherwise, 
find out how to turn access rule off. I think this may be in 
Zope/doc/SECURIY.txt.


I don't think it's possible to really remove the Zope Control Panel.

--jcc
--
Building Websites with Plone
http://plonebook.packtpub.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

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


Re: [Zope] Newbie question: HTTP variables

2001-01-13 Thread Michael Bernstein

Dean  Deb Ekstrand wrote:
 
 I'm trying to figure out Zope (on a time crunch, too), and I'm wondering how
 to do something.  How can I access HTTP variables in my DTML code?
 Specifically, I want to return code specific to the user's browser.  I know
 that HTTP has provisions for determing browser version, are those accessible
 in DTML and how?  If they are not accessible in DTML, is there a workaround
 (without oodles of javascript)?

these variables are part of the REQUEST namespace.
Specifically you can do

dtml-var "REQUEST.HTTP_USER_AGENT" to display the browswer
version. Creating conditional code is left as an excersize
for the student.

If you want to display a complete list of all HTTP REQUEST
variables, try this:

dtml-var REQUEST

 Another quick question:  I see that Zope 2.3 will have "Script" objects.
 What's the closest I can come in Zope 2.2.5?

The Python Method product:
http://www.zope.org/Members/4am/PythonMethod

Or external methods:
http://www.zope.org/Documentation/How-To/ExternalMethods

HTH,

Michael Bernstein

___
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] Newbie question: adding a tinyTables objec

2000-12-19 Thread peter bengtson

If a product contains only a Help object, it means that the product is a
Python Product, rather than a ZClass Product.

No broken box in front of the Product name, hmm...
Does Zope raise any errors when you try to start it? Try to remove the whole
TinyTable folder and reinstall it again after having had a second look in
the INSTALL or README docs. If there are any.

Don't give up my friend!


 No, that's the problem. The icon isn't a broken box, but a regular
 product icon. Clicking on the link shows that there's one item in
 TinyTablesPlus, a Help document; when I open that, it tells me that
 there are no items in TinyTablesPlus. So Zope seems to be seeing the
 product, but not adding a TinyTable to the list of Available Objects.
 Is there some setting that I need to change?

 Sorry to be so dense. It's tantalizing to have all this power so
 close at hand, and not be able to access it.

 Richard


 At 10:25 PM + 12/18/00, Peter Bengtsson wrote:
 Go to the Control Panel and click on Products. The TinyTable product
 is probably going to have a little "broken box"-icon.
 Click on it and wish that it will tell you the error so that you can fix
it.
 
 Good luck, Peter
 
   I'm running Zope on a Win98 machine; downloaded, unstuffed, and
   installed tinyTablesPlus folder in the lib\python\Products directory.
   TinyTablesPlus shows up in the product list of the
   Control_Panel/Products folder of my Zope installation. But it does
   not show up in the Available Objects pull-down menu in my Zope
   content folders. I can't figure out how to Add a TinyTables object.
 
   Can anyone help?
 
   Richard
 
   ___
   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] Newbie question - Link between Methods based on Authorization

2000-12-19 Thread Oliver Bleutgen

 I am still newbie in Zope, so my question may be stupid - sorry.

 I have problem with access to method. Example - There are two methods: A
 and
 B. Method A contains common information, accessible for all user (include
 anonymous). Source code in method B updates data for method A and access
 for
 method B is restrict only for users with roles "AdminTables". There is a
 link from method A to method B in the code of script A, and this link is
 viewable for all user (also for anonym). After click on this link, user is
 asked for authentication. So there is no problem, but HOW MAKE THIS LINK
 VIEWABLE ONLY FOR USER WITH AUTORIZATION FOR OBJEKT B ???

Try

http://zdp.zope.org/projects/zsnippet/snippets/DTMLContent/PermissionContent

and zdp.zope.org in general.

cheers,
oliver


___
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] Newbie question - Link between Methods based on Authorization

2000-12-19 Thread Timothy Wilson

On Tue, 19 Dec 2000, Michal Krejza wrote:

 I have problem with access to method. Example - There are two methods: A and
 B. Method A contains common information, accessible for all user (include
 anonymous). Source code in method B updates data for method A and access for
 method B is restrict only for users with roles "AdminTables". There is a
 link from method A to method B in the code of script A, and this link is
 viewable for all user (also for anonym). After click on this link, user is
 asked for authentication. So there is no problem, but HOW MAKE THIS LINK
 VIEWABLE ONLY FOR USER WITH AUTORIZATION FOR OBJEKT B ???

Hello Michal,

This may work:

dtml-if "AUTHENTICATED_USER.has_role('AdminTables', this())"
 a href="/link/to/method/B"Method B/a
/dtml-if

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.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 )




Re: [Zope] Newbie question: adding a tinyTables object

2000-12-18 Thread Peter Bengtsson

Go to the Control Panel and click on Products. The TinyTable product is probably going 
to have a little "broken box"-icon. 
Click on it and wish that it will tell you the error so that you can fix it.

Good luck, Peter

 I'm running Zope on a Win98 machine; downloaded, unstuffed, and 
 installed tinyTablesPlus folder in the lib\python\Products directory. 
 TinyTablesPlus shows up in the product list of the 
 Control_Panel/Products folder of my Zope installation. But it does 
 not show up in the Available Objects pull-down menu in my Zope 
 content folders. I can't figure out how to Add a TinyTables object.
 
 Can anyone help?
 
 Richard
 
 ___
 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] Newbie question: adding a tinyTables object

2000-12-18 Thread Richard Blumberg

No, that's the problem. The icon isn't a broken box, but a regular 
product icon. Clicking on the link shows that there's one item in 
TinyTablesPlus, a Help document; when I open that, it tells me that 
there are no items in TinyTablesPlus. So Zope seems to be seeing the 
product, but not adding a TinyTable to the list of Available Objects. 
Is there some setting that I need to change?

Sorry to be so dense. It's tantalizing to have all this power so 
close at hand, and not be able to access it.

Richard


At 10:25 PM + 12/18/00, Peter Bengtsson wrote:
Go to the Control Panel and click on Products. The TinyTable product 
is probably going to have a little "broken box"-icon.
Click on it and wish that it will tell you the error so that you can fix it.

Good luck, Peter

  I'm running Zope on a Win98 machine; downloaded, unstuffed, and
  installed tinyTablesPlus folder in the lib\python\Products directory.
  TinyTablesPlus shows up in the product list of the
  Control_Panel/Products folder of my Zope installation. But it does
  not show up in the Available Objects pull-down menu in my Zope
  content folders. I can't figure out how to Add a TinyTables object.

  Can anyone help?

  Richard

  ___
  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] newbie question -- database list/report with sort bycolumn header

2000-12-09 Thread Tino Wildenhain

Hi,


Chris Gray schrieb:
 
 Here's a fragment from a table that allows sorting by clicking the header
 in a dtml method named 'displayTable':
 
 table
 tr
 tha href="displayTable?sort_key=ID+desc"ID/a/th
 tha href="displayTable?sort_key=product"Product/a
 /tr
 dtml-in "SQLSelectQuery(sort_key=REQUEST['sort_key'])"
 
 Then feed sort_key into your SQLSelectQuery to use in an ORDER BY clause.
 
 select * from table order by dtml-var sort_key
 
You schould never do so. Unquoted variables in SQL-statements are high
security risc if they came from REQUEST. As an example someone can
send a string which ends a statement and begins a new one, like drop
table.
Instead reference only an index of a list with the columns to sort.

oder by dtml-sqlvar orderindex type=int is also a solution.
The index ranges from 1 to number of returned values.

Regards
Tino




 You can change the properties of an object in DTML by callling its
 manage_changeProperties method, for example:
 
 dtml-call expr="foo.manage_changeProperties(bar='New Value')"
 
 will changes the value of foo's bar property to 'New Value'.
 
 There are several ways of getting the effect of assigning variables in
 DTML, but it really isn't meant to have a direct way of declaring and
 assigning variables.  The way you're trying to use an object's properties
 will, I believe, cause problems in the case of simultaneous users, because
 it will act as a global variable.
 
 Cheers,
 Chris
 
 On Mon, 4 Dec 2000, John Cappelletti wrote:
 
 
  I am listing the results of a database query using dtml-in. I'd like to
  be able to give the user the option to re-sort the list by clicking on a
  column header. ok... I'm starting small with a form and radio buttons to
  allow the user to specify the sort.
 
  I've created what I believe to be a global variable for this page using
  the property screen. The variable is to capture the column name for the
  sort. My simple question is how do I assign a value to this variable
  inside of the dtml method! I'm not finding a description of variable
  assignment in the documentation (yeah, I must be missing the obvious).
 
  Any pointers would be appreciated.  (also, know if anyone has
  implemented interactive sort by column header?)

___
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] Newbie question, help with navigation method

2000-12-06 Thread Dieter Maurer

Richard Blumberg writes:
   Navigation works when called directly,
  does not work when included in "index_html" 
  
  Navigation:
  dtml-in objectValues
 

  Is this a bug in Zope, or am I doing something wrong?
Not directly.

Almost surely, your "index_html" is a DTML document.
A DTML document defines the method "objectValues" and it
returns the empty list.
One *might* think of this as a bug or a feature.
(I tend to think of it as a bug).

In a DTML document (unlike a DTML method), the object
is pushed on top of the namespace stack.
Therefore, the "objectValues" in your navigation object
is the "objectValues" of the "index_html" and it returns
"[]".

If you would make your "index_html" a DTML method,
then "objectValues" would be the method of the
object for which the method is called for. This
means your folder. And it would work.



Dieter

___
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] newbie question -- database list/report with sort bycolumn header

2000-12-04 Thread Chris Gray

Here's a fragment from a table that allows sorting by clicking the header
in a dtml method named 'displayTable':

table
tr
tha href="displayTable?sort_key=ID+desc"ID/a/th
tha href="displayTable?sort_key=product"Product/a
/tr
dtml-in "SQLSelectQuery(sort_key=REQUEST['sort_key'])"

Then feed sort_key into your SQLSelectQuery to use in an ORDER BY clause.

select * from table order by dtml-var sort_key

You can change the properties of an object in DTML by callling its
manage_changeProperties method, for example:

dtml-call expr="foo.manage_changeProperties(bar='New Value')"

will changes the value of foo's bar property to 'New Value'.

There are several ways of getting the effect of assigning variables in
DTML, but it really isn't meant to have a direct way of declaring and
assigning variables.  The way you're trying to use an object's properties
will, I believe, cause problems in the case of simultaneous users, because
it will act as a global variable.

Cheers,
Chris

On Mon, 4 Dec 2000, John Cappelletti wrote:

 
 I am listing the results of a database query using dtml-in. I'd like to
 be able to give the user the option to re-sort the list by clicking on a
 column header. ok... I'm starting small with a form and radio buttons to
 allow the user to specify the sort.
 
 I've created what I believe to be a global variable for this page using
 the property screen. The variable is to capture the column name for the
 sort. My simple question is how do I assign a value to this variable
 inside of the dtml method! I'm not finding a description of variable
 assignment in the documentation (yeah, I must be missing the obvious).
 
 Any pointers would be appreciated.  (also, know if anyone has
 implemented interactive sort by column header?)
 
 thanks,
 John Cappelletti
   AverStar, Inc.
   1593 Spring Hill Road, Suite 700
   Vienna, VA 22182-2249
   Tel: (703) 827-2606 x 4291 (also, 301 443-7509)
   Fax: (703) 827-5560
 
 
 
 ___
 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] newbie question: Redirect from Python?

2000-11-27 Thread seb bacon

* Paul Winkler [EMAIL PROTECTED] [001127 19:54]:
 I want the user to be sent to a particular URL after calling the
 product's manage_add method. How can I do that?
 The URL I want is REQUEST['URL3'].
 
 I've tried RESPONSE.redirect(REQUEST['URL3']) but that's not it - the
 RESPONSE doesn't seem to exist here.

sounds alright to me.  are you calling it in quotes, e.g. dtml-var
"RESPONSE.redirect(REQUEST['URL3'])" ?

you shouldn't have to use the REQUEST to look up the variable, either:
dtml-var "RESPONSE.redirect(URL3)"


___
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] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler

seb bacon wrote:
 
 * Paul Winkler [EMAIL PROTECTED] [001127 19:54]:
  I want the user to be sent to a particular URL after calling the
  product's manage_add method. How can I do that?
  The URL I want is REQUEST['URL3'].
 
  I've tried RESPONSE.redirect(REQUEST['URL3']) but that's not it - the
  RESPONSE doesn't seem to exist here.
 
 sounds alright to me.  are you calling it in quotes, e.g. dtml-var
 "RESPONSE.redirect(REQUEST['URL3'])" ?
 
 you shouldn't have to use the REQUEST to look up the variable, either:
 dtml-var "RESPONSE.redirect(URL3)"

Thanks for the reply.
OK, I didn't phrase the question correctly.

I think it boils down to this:
If I have a string that represents a URL, can I define a method of my
product (in python, not in DTML) that redirects the browser to that
URL?

More details:


My product code is based on Boring (like most newbies I guess).
But manage_addBoring() does not do quite what I want. It returns
self.manage_main(self, REQUEST), so they end up at a long and ugly URL
that isn't where I want them to be anyway.

Example:
 the user is at:

http://localhost.localdomain:8080/Members/bobby

Bobby then clicks on a button I've provided that says "Add Test
Product". That sends him to the add form I've created. When Bobby
submits the request from this form, the product is added and he's sent
to

http://localhost.localdomain:8080/Members/bobby/manage_addProduct/MyProduct/manage_main
 

...because manage_addMyProduct returns self.manage_main
So I understand what's happening, but it's not what I want.
I don't want to send him there, I want to send him back to 

http://localhost.localdomain:8080/Members/bobby

So how can I do that from within the manage_addMyProduct method
definition?
The method gets a REQUEST argument, and I know that REQUEST['URL3'] is
what I want because if I return that string, it prints the URL I want.

I could do it by returning an HTML page with a redirect in the head
but that seems like a horribly ugly solution.


Looking through various Zope docs, I thought RESPONSE.redirect might
work, but  RESPONSE is not mentioned anywhere in Boring.py. Boring
only uses REQUEST.


-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.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 )




Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Michel Pelletier

Paul Winkler wrote:
 
 seb bacon wrote:
 
  * Paul Winkler [EMAIL PROTECTED] [001127 19:54]:
   I want the user to be sent to a particular URL after calling the
   product's manage_add method. How can I do that?
   The URL I want is REQUEST['URL3'].
  
   I've tried RESPONSE.redirect(REQUEST['URL3']) but that's not it - the
   RESPONSE doesn't seem to exist here.
 
  sounds alright to me.  are you calling it in quotes, e.g. dtml-var
  "RESPONSE.redirect(REQUEST['URL3'])" ?
 
  you shouldn't have to use the REQUEST to look up the variable, either:
  dtml-var "RESPONSE.redirect(URL3)"
 
 Thanks for the reply.
 OK, I didn't phrase the question correctly.
 
 I think it boils down to this:
 If I have a string that represents a URL, can I define a method of my
 product (in python, not in DTML) that redirects the browser to that
 URL?
 
 More details:
 
 My product code is based on Boring (like most newbies I guess).
 But manage_addBoring() does not do quite what I want. It returns
 self.manage_main(self, REQUEST), so they end up at a long and ugly URL
 that isn't where I want them to be anyway.
 
 Example:
  the user is at:
 
 http://localhost.localdomain:8080/Members/bobby
 
 Bobby then clicks on a button I've provided that says "Add Test
 Product". That sends him to the add form I've created. When Bobby
 submits the request from this form, the product is added and he's sent
 to
 
 
http://localhost.localdomain:8080/Members/bobby/manage_addProduct/MyProduct/manage_main
 
 ...because manage_addMyProduct returns self.manage_main
 So I understand what's happening, but it's not what I want.
 I don't want to send him there, I want to send him back to
 
 http://localhost.localdomain:8080/Members/bobby
 
 So how can I do that from within the manage_addMyProduct method
 definition?
 The method gets a REQUEST argument, and I know that REQUEST['URL3'] is
 what I want because if I return that string, it prints the URL I want.
 
 I could do it by returning an HTML page with a redirect in the head
 but that seems like a horribly ugly solution.
 
 Looking through various Zope docs, I thought RESPONSE.redirect might
 work, but  RESPONSE is not mentioned anywhere in Boring.py. Boring
 only uses REQUEST.

So pass it RESPONSE:

def manage_addMyProduct(self, blah, blah, REQUEST=None, RESPONSE=None):
  ...

The publisher will automaticaly pass you RESPONSE if you ask for it as a
method argument.  Now use RESPONSE.redirect.

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




Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Phil Harris

You need to be careful when redirecting from an external Python wotsit.

RESPONSE.redirect raises an exception which can make the transaction get
rolled back.

This seems not to happen when called from dtml but I've seen it happen from
an external Python wotsit.

Note:

My use of wotsit above in no way has a bearing on the new name for the
Python Methods/ZMethods/Script or whatever the hell they are called now. ;)

Phil
[EMAIL PROTECTED]

- Original Message -
From: "Paul Winkler" [EMAIL PROTECTED]
To: "Zope mailing list" [EMAIL PROTECTED]
Sent: Monday, November 27, 2000 6:26 PM
Subject: [Zope] newbie question: Redirect from Python?


| I want the user to be sent to a particular URL after calling the
| product's manage_add method. How can I do that?
| The URL I want is REQUEST['URL3'].
|
| I've tried RESPONSE.redirect(REQUEST['URL3']) but that's not it - the
| RESPONSE doesn't seem to exist here.
|
|
| --
| .paul winkler..
| slinkP arts:   music, sound, illustration, design, etc.
|web page:  http://www.slinkp.com
|   A member of ARMS:   http://www.reacharms.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] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler

Michel Pelletier wrote:
 
 Paul Winkler wrote:
(snip)
  Looking through various Zope docs, I thought RESPONSE.redirect might
  work, but  RESPONSE is not mentioned anywhere in Boring.py. Boring
  only uses REQUEST.
 
 So pass it RESPONSE:
 
 def manage_addMyProduct(self, blah, blah, REQUEST=None, RESPONSE=None):
   ...
 
 The publisher will automaticaly pass you RESPONSE if you ask for it as a
 method argument.  Now use RESPONSE.redirect.

Aha, thanks. I didn't know that about the publisher.

Now I'm afraid I'm too stupid to see how to use RESPONSE.redirect
after reading the description in the Zope Book API appendix.

My method now looks like this:

def manage_addMyProduct(self, id, title='', REQUEST=None,
RESPONSE=None):
"""Add a MyProduct instance to the folder."""
self._setObject(id, MyProduct(id, title))
if REQUEST is not None:
whereto= REQUEST['URL3']
return RESPONSE.redirect(whereto, 0)


That just prints the URL as a string.
OK, so maybe I'm not supposed to use the return value?
So I try it like this:


def manage_addMyProduct(self, id, title='', REQUEST=None,
RESPONSE=None):
"""Add a MyProduct instance to the folder."""
self._setObject(id, MyProduct(id, title))
if REQUEST is not None:
whereto= REQUEST['URL3']
RESPONSE.redirect(whereto, 0)


Now when I submit the form, I can wait for a result forever and not
get anything.

How am I *really* supposed to do it?




-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.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 )




Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler

Dieter Maurer wrote:
 
 If you need it in the constructor, then you must
 either pass in an object that is tied by acquisition
 or REQUEST or RESPONSE itself,
 or you must move the call out into the method
 "manage_afterAdd" (where the object already is tied in).

Well, I don't have that method. Went to learn about what people use it
for - searched for manage_afterAdd on zope.org and got nothing at
all???

Anyway, I'm now redirecting in manage_Add and it seems to work fine.
 
-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.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 )




Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler

OK, this seems to work.

def manage_addMyProduct(self, id, title='', REQUEST=None,
RESPONSE=None):
self._setObject(id, MyProduct(id, title))
if REQUEST is not None:
whereto= REQUEST['URL3']
RESPONSE.redirect(whereto, lock=0) 




-- 
.paul winkler..
slinkP arts:   music, sound, illustration, design, etc.
   web page:  http://www.slinkp.com
  A member of ARMS:   http://www.reacharms.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 )




RE: [Zope] Newbie Question

2000-11-24 Thread Dany Rioux

I'm probably just being dumb... :)

PASTE--
dtml-var standard_html_header

p
dtml-with News
 dtml-in objectValues
 /dtml-in
/dtml-with
/p

dtml-var standard_html_footer
/PASTE--

This doesn't work. Nothing gets printed.

In the News folder is a DTML method called news999. Should it be a
DTML document instead for this to work?

I tried the three methods you gave me. objectValues, "objectValues()"
and "objectValues('[File]')" and even "objectValues('[news999]')" but
empty everytime.

TIA

Dany

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
 Behalf Of Andy
 McKay
 Sent: Thursday, November 23, 2000 7:00 PM
 To: Chris Withers
 Cc: Dany Rioux; Zope Mailing List
 Subject: Re: [Zope] Newbie Question


 Or even: dtml-in "objectValues(['File'])"
 if this news thing is a file ;-P

  Or even:
 
  dtml-in objectValues
 
  ;-)
 
  Chris
 
  Andy McKay wrote:
  
   dtml-in "objectValues()"
  
   --
   From: "Dany Rioux" [EMAIL PROTECTED]
  
Hi everyone,
   
Simple newbie question... :)
   
I've made a directory called News into which I will
 put files named
newsXXX. X being a number from 999 to 001.
   
What I want to do is to tell zope to put each file
 into a document.
Now, here is what I figured out.
   
dtml-with News
  dtml-in ??? --- that's where I'm stuck. I don't
 know how to
iterate through a directory ... I want ALL the
 newsXXX displayed.
  /dtml-in
/dtml-with
   
How do I do that?
   
TIA
   
Dany


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

2000-11-24 Thread Philipp Dunkel


 I'm probably just being dumb... :)
 
 PASTE--
 dtml-var standard_html_header
 
 p
 dtml-with News
  dtml-in objectValues
 
   dtml-var "_['sequence-item']"

  /dtml-in
 /dtml-with
 /p
 
 dtml-var standard_html_footer

this should work out for you.

cu

Philipp


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

2000-11-24 Thread Jim Washington

Dany:


These should work:


dtml-in objectIds

dtml-var "_['sequence-item']"

/dtml-in

-or-


dtml-in objectValues

dtml-var sequence-item
 
/dtml-in

-or-

dtml-in objectValues

dtml-var some_attribute_of_the_sequence-item
 
/dtml-in


--Jim Washington

Dany Rioux wrote:
 
 I'm probably just being dumb... :)
 
 PASTE--
 dtml-var standard_html_header
 
 p
 dtml-with News
  dtml-in objectValues
  /dtml-in
 /dtml-with
 /p
 
 dtml-var standard_html_footer
 /PASTE--
 
 This doesn't work. Nothing gets printed.
 
 In the News folder is a DTML method called news999. Should it be a
 DTML document instead for this to work?
 
 I tried the three methods you gave me. objectValues, "objectValues()"
 and "objectValues('[File]')" and even "objectValues('[news999]')" but
 empty everytime.


___
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] Newbie Question Fixed but continuing.

2000-11-24 Thread Dany Rioux

Thanks Philipp and Jim,

It worked! But... (there's always a but! :) I thought I was clever
when I thought about naming my news files news999, news998 etc,
thinking it would parse the directory and print the news sorted by
their names. So news998 would be printed before news999 etc. It
doesn't.

deleted questions because it's fixed :) /deleted

Now this too is fixed. I just discovered the "sort=" thingie.

One thing would sure be helpful, a Guide explaining all the subtags in
a tag. Like what can be used in a dtml-var or dtml-in and params
for each subtag. Because as someone mentioned, searching on zope is a
real hassle. It takes a long time, and the search is ORed. So lots of
unrelated docs are counted as a hit.

Thanks a lot to all the helpers.

Dany

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
 Philipp Dunkel
 Sent: Friday, November 24, 2000 5:00 PM
 To: Zope Mailing List
 Subject: Re: [Zope] Newbie Question



  I'm probably just being dumb... :)
 
  PASTE--
  dtml-var standard_html_header
 
  p
  dtml-with News
   dtml-in objectValues

dtml-var "_['sequence-item']"

   /dtml-in
  /dtml-with
  /p
 
  dtml-var standard_html_footer

 this should work out for you.

 cu

 Philipp


___
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] Newbie Question Fixed but continuing.

2000-11-24 Thread Michel Pelletier

Dany Rioux wrote:
 
 Thanks Philipp and Jim,
 
 It worked! But... (there's always a but! :) I thought I was clever
 when I thought about naming my news files news999, news998 etc,
 thinking it would parse the directory and print the news sorted by
 their names. So news998 would be printed before news999 etc. It
 doesn't.
 
 deleted questions because it's fixed :) /deleted
 
 Now this too is fixed. I just discovered the "sort=" thingie.
 
 One thing would sure be helpful, a Guide explaining all the subtags in
 a tag. Like what can be used in a dtml-var or dtml-in and params
 for each subtag. 

http://www.zope.org/Members/michel/ZB/AppendixA.html

This DTML reference is also included in the Online Help System with Zope
2.4b1 and beyond.

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




RE: [Zope] Newbie Question Fixed but continuing.

2000-11-24 Thread Dany Rioux

Thanks! That's exactly what I was looking for.

I know that the DTML reference is there on Zope.org but it's a hassle
and well, I'll keep my other opinions for myself.

Anyway. Here's an idea. Shouldn't there be a list FAQ? If there is one
it should be sent when subscribing. Or it could be requested. I'm
pretty sure most of the questions I sent have already been sent 
answered more than once already and I know some that most other FAQs
use one. So, why not zope general list? It *is* possible, though
unlikely, that there is a list FAQ mentionned in the "Welcome to Zope
mailing list" email but if there is, my apologies.

Thanks.

Dany

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Michel Pelletier
 Sent: Friday, November 24, 2000 12:17 PM
 To: Dany Rioux
 Cc: Zope Mailing List
 Subject: Re: [Zope] Newbie Question Fixed but continuing.


 Dany Rioux wrote:
 
  Thanks Philipp and Jim,
 
  It worked! But... (there's always a but! :) I thought I was clever
  when I thought about naming my news files news999, news998 etc,
  thinking it would parse the directory and print the news sorted by
  their names. So news998 would be printed before news999 etc. It
  doesn't.
 
  deleted questions because it's fixed :) /deleted
 
  Now this too is fixed. I just discovered the "sort=" thingie.
 
  One thing would sure be helpful, a Guide explaining all
 the subtags in
  a tag. Like what can be used in a dtml-var or dtml-in
 and params
  for each subtag.

 http://www.zope.org/Members/michel/ZB/AppendixA.html

 This DTML reference is also included in the Online Help
 System with Zope
 2.4b1 and beyond.


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

2000-11-24 Thread Chalu Kim


dtml-with myFolder
dtml-in "objectValues(['DTML Document',])"
dtml-var "_['sequence-item']"
/dtml-in
/dtml-with

Dany Rioux wrote:
 
 I'm probably just being dumb... :)
 
 PASTE--
 dtml-var standard_html_header
 
 p
 dtml-with News
  dtml-in objectValues
  /dtml-in
 /dtml-with
 /p
 
 dtml-var standard_html_footer
 /PASTE--
 
 This doesn't work. Nothing gets printed.
 
 In the News folder is a DTML method called news999. Should it be a
 DTML document instead for this to work?
 
 I tried the three methods you gave me. objectValues, "objectValues()"
 and "objectValues('[File]')" and even "objectValues('[news999]')" but
 empty everytime.
 
 TIA
 
 Dany
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
  Behalf Of Andy
  McKay
  Sent: Thursday, November 23, 2000 7:00 PM
  To: Chris Withers
  Cc: Dany Rioux; Zope Mailing List
  Subject: Re: [Zope] Newbie Question
 
 
  Or even: dtml-in "objectValues(['File'])"
  if this news thing is a file ;-P
 
   Or even:
  
   dtml-in objectValues
  
   ;-)
  
   Chris
  
   Andy McKay wrote:
   
dtml-in "objectValues()"
   
--
From: "Dany Rioux" [EMAIL PROTECTED]
   
 Hi everyone,

 Simple newbie question... :)

 I've made a directory called News into which I will
  put files named
 newsXXX. X being a number from 999 to 001.

 What I want to do is to tell zope to put each file
  into a document.
 Now, here is what I figured out.

 dtml-with News
   dtml-in ??? --- that's where I'm stuck. I don't
  know how to
 iterate through a directory ... I want ALL the
  newsXXX displayed.
   /dtml-in
 /dtml-with

 How do I do that?

 TIA

 Dany
 
 ___
 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] Newbie Question

2000-11-23 Thread Andy McKay

dtml-in "objectValues()"

--
  Andy McKay, Developer.
  ActiveState.
- Original Message - 
From: "Dany Rioux" [EMAIL PROTECTED]
To: "Zope Mailing List" [EMAIL PROTECTED]
Sent: Thursday, November 23, 2000 2:20 PM
Subject: [Zope] Newbie Question


 Hi everyone,
 
 Simple newbie question... :)
 
 I've made a directory called News into which I will put files named
 newsXXX. X being a number from 999 to 001.
 
 What I want to do is to tell zope to put each file into a document.
 Now, here is what I figured out.
 
 dtml-with News
   dtml-in ??? --- that's where I'm stuck. I don't know how to
 iterate through a directory ... I want ALL the newsXXX displayed.
   /dtml-in
 /dtml-with
 
 How do I do that?
 
 TIA
 
 Dany
 
 ---.oo0O--O0oo.
 
 Dany Rioux UnderSoft Inc.
 Business
 www.dating-reviews.com
 [EMAIL PROTECTED]
 
 Personal
 www.drioux.com
 [EMAIL PROTECTED]
 
 ---.o00O---O00o.---
 


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

2000-11-23 Thread Chris Withers

Or even:

dtml-in objectValues

;-)

Chris

Andy McKay wrote:
 
 dtml-in "objectValues()"
 
 --
   Andy McKay, Developer.
   ActiveState.
 - Original Message -
 From: "Dany Rioux" [EMAIL PROTECTED]
 To: "Zope Mailing List" [EMAIL PROTECTED]
 Sent: Thursday, November 23, 2000 2:20 PM
 Subject: [Zope] Newbie Question
 
  Hi everyone,
 
  Simple newbie question... :)
 
  I've made a directory called News into which I will put files named
  newsXXX. X being a number from 999 to 001.
 
  What I want to do is to tell zope to put each file into a document.
  Now, here is what I figured out.
 
  dtml-with News
dtml-in ??? --- that's where I'm stuck. I don't know how to
  iterate through a directory ... I want ALL the newsXXX displayed.
/dtml-in
  /dtml-with
 
  How do I do that?
 
  TIA
 
  Dany
 
  ---.oo0O--O0oo.
 
  Dany Rioux UnderSoft Inc.
  Business
  www.dating-reviews.com
  [EMAIL PROTECTED]
 
  Personal
  www.drioux.com
  [EMAIL PROTECTED]
 
  ---.o00O---O00o.---
 
 
 ___
 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] Newbie Question

2000-11-23 Thread Andy McKay

Or even: dtml-in "objectValues(['File'])"
if this news thing is a file ;-P
--
  Andy McKay, Developer.
  ActiveState.
- Original Message - 
From: "Chris Withers" [EMAIL PROTECTED]
To: "Andy McKay" [EMAIL PROTECTED]
Cc: "Dany Rioux" [EMAIL PROTECTED]; "Zope Mailing List" [EMAIL PROTECTED]
Sent: Thursday, November 23, 2000 2:47 PM
Subject: Re: [Zope] Newbie Question


 Or even:
 
 dtml-in objectValues
 
 ;-)
 
 Chris
 
 Andy McKay wrote:
  
  dtml-in "objectValues()"
  
  --
Andy McKay, Developer.
ActiveState.
  - Original Message -
  From: "Dany Rioux" [EMAIL PROTECTED]
  To: "Zope Mailing List" [EMAIL PROTECTED]
  Sent: Thursday, November 23, 2000 2:20 PM
  Subject: [Zope] Newbie Question
  
   Hi everyone,
  
   Simple newbie question... :)
  
   I've made a directory called News into which I will put files named
   newsXXX. X being a number from 999 to 001.
  
   What I want to do is to tell zope to put each file into a document.
   Now, here is what I figured out.
  
   dtml-with News
 dtml-in ??? --- that's where I'm stuck. I don't know how to
   iterate through a directory ... I want ALL the newsXXX displayed.
 /dtml-in
   /dtml-with
  
   How do I do that?
  
   TIA
  
   Dany
  
   ---.oo0O--O0oo.
  
   Dany Rioux UnderSoft Inc.
   Business
   www.dating-reviews.com
   [EMAIL PROTECTED]
  
   Personal
   www.drioux.com
   [EMAIL PROTECTED]
  
   ---.o00O---O00o.---
  
  
  ___
  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] Newbie question(s)

2000-11-13 Thread Rik Hoekstra



"Bowyer, Alex" wrote:
 
 Hi,
 
 I have what I'm sure is a very simple question about Zope programming style:
 I want to count how many objects are contained in the current container
 object and then do something with that value, but I can't do the bit I need
 to do at the point of reading the count variable because I am in the wrong
 namespace.
 I can't begin a dtml-let because I would need to close dtml-if before
 dtml-let, which is not allowed.
 
 dtml-in objectValues
 dtml-if sequence-end
 dtml-var count-id  !-- this is the value I want to use --
 /dtml-if
 /dtml-in
 !-- this is the scope in which I want to do something with the value. --
 

try (untested):

dtml-call expr="REQUEST.set('countids', _.len(objectValues())"
dtml-in objectValues
dtml-if sequence-end
dtml-var countids
/dtml-if
/dtml-in
!-- do something with the value. --



 What is the "accepted" way of passing a value into a different scope? Do I
 have do a REQUEST.set or is there a tidier way?

dtml-let

 Also I think I read somewhere that you can use the object.subobject or
 object.property syntax but I never got that to work, what's the catch?

dtml-var expr="object.subobject"

note that this is a Python expression and the code between quotes has
Python behaviour.
 

 
 One last thing, I sent a couple of mails to the list about problems I had
 with manage_delObjects. I still haven't got it to work. Since the best way
 to learn Zope is by example, I wonder if anyone could direct me to a sample
 piece of code where a container of some sort deletes one of its children
 subobjects?
 


try (untested):
dtml-call "subobject.manage_delObjects([id1, id2, ..])"


hth

Rik

___
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] Newbie question(s)

2000-11-12 Thread Max M

From: Bowyer, Alex

I want to count how many objects are contained in the current container
object and then do something with that value, but I can't do the bit I 
need to do at the point of reading the count variable because I am in 
the wrong namespace.

I would try and do it like this (untested):

dtml-call "REQUEST.set('itemCount', len(objectIds()))"

Regards

Max M

___
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] Newbie question(s)

2000-11-12 Thread Bowyer, Alex

 I want to count how many objects are contained in the 
 current container
 object and then do something with that value, but I can't do 
 the bit I 
 need to do at the point of reading the count variable 
 because I am in 
 the wrong namespace.
 
 I would try and do it like this (untested):
 
 dtml-call "REQUEST.set('itemCount', len(objectIds()))"
 
 Regards
 
 Max M

Thanks Max, that is certainly useful in this case.

My query is really more general though, that was just an example, I need to
know what the generally accepted method is for transferring values through
the code (i.e between namespaces)

IMHO as far as Zope documentation goes, the thing that is really lacking is
a document introducing people to how to program in Zope, explaining the
overlaps between Python and Zope/DTML and explaining the different syntaxes
for calling variables, methods etc? There are a lot of references on
specific functions, methods etc but no general overview. Maybe the
forthcoming Zope book will address this better.

I am also still looking for example code using manage_delObjects.

Thanks,

Alex

==
Alex Bowyer
IT Contractor, Logica Australasia
Tel: +61 2 9202 8130
Fax: +61 2 9922 7466
E-mail : [EMAIL PROTECTED]
WWW: http://www.logica.com.au/
==

___
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] Newbie question(s)

2000-11-12 Thread Morten W. Petersen

[Alex Bowyer]

| My query is really more general though, that was just an example, I need to
| know what the generally accepted method is for transferring values through
| the code (i.e between namespaces)

Unless I've misunderstood your problem, wouldn't dtml-let do the trick?
(See DTML manual for more info).

-Morten

___
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] Newbie question(s)

2000-11-12 Thread Max M

From: Bowyer, Alex

My query is really more general though, that was just an example,
I need to know what the generally accepted method is for
transferring values through the code (i.e between namespaces)

I do believe that our ugly friend REQUEST.set() is the way to go here. I
cannot remember having seen any other way of doing it. I expect that better
days will be here with v.2.3 as we will get Python Methods, or whatever they
are called.

I am also still looking for example code using manage_delObjects.

Sorry I cannot help there.

Regards
Max M


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

2000-10-24 Thread Chris Withers

Hi Kathy,

 Error Type: SyntaxError
 
 Error Value: invalid syntax
 
 Troubleshooting Suggestions

It looks like your addEntry.py file has some syntax mistakes in it
(think mis-spelled, badly indented or otherwise defective python ;-) Try
comparing it with what it should be and see if the problem goes away
when you correct any mistakes.

cheers,

Chris

PS: Please post only plain text to this list (Plain Text as opposed to
MIME encoded should be an option on your mail program) as the message
you posted came out pretty screwed up on Netscape Communicator ;-)

___
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] Newbie question : ZopeTime permissions

2000-10-16 Thread Manuel Amador (Rudd-O)


access contents information
I guess.
Aaron Straup Cope wrote:
Hi,
My name is Aaron.
I am trying to set up zope with (atleast) three roles : manager, admin,
user.
I'd like to give the last two the bare minimum Security permissions
possible and adding them as needed later on.
My problem is that I can't seem to figure out, specifically, which
permissions to give a user that will allow them to read ZopeTime().
(see below)
For the admin user, I have set the Access content information and View
*
options globally. I've tried guessing at some others, but there are
alot
of possible combinations to try so I thought maybe I would just ask.
Related, is there a detailed description of the default Security
settings? I've checked the mailing lists and the Zope docs and if it's
there, I guess I missed it.
Thanks,
dtml-call "REQUEST.set('ts', ZopeTime())">
dtml-call "REQUEST.set('foo',_.str(_.int(ts)))">
dtml-var foo>
Traceback (innermost last):
 File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line
222, in
publish_module
 File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line
187, in
publish
 File /usr/local/zope.old/lib/python/Zope/__init__.py, line 221,
in
zpublisher_exception_hook
 (Object: Traversable)
 File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line
171, in
publish
 File /usr/local/zope.old/lib/python/ZPublisher/mapply.py, line
160, in
mapply
 (Object: test)
 File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line
112, in
call_object
 (Object: test)
 File /usr/local/zope.old/lib/python/OFS/DTMLDocument.py, line
177, in
__call__
 (Object: test)
 File /usr/local/zope.old/lib/python/DocumentTemplate/DT_String.py,
line
528, in __call__
 (Object: test)
 File /usr/local/zope.old/lib/python/DocumentTemplate/DT_Util.py,
line
337, in eval
 (Object: REQUEST.set('ts', ZopeTime()))
 (Info: REQUEST)
 File string>, line 0, in ?
NameError: (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
)

--
Manuel Amador (Rudd-O)



Re: [Zope] Newbie question : ZopeTime permissions

2000-10-10 Thread Aaron Straup Cope

Yes, it was a misunderstanding regarding basic user permissions and the
Anonymous role on my part.

I did not want to allow the Anonymous role *any* permissions, and the
site I am working in is contained in a folder beneath the root Zope
folder. 

The problem was that I had disabled the "Access contents
information" privilege for the Anonymous user (whose permissions I forgot
are inherited by all other users) at the root level, thus preventing Joe
User from being able to access internals(?) like
ZopeTime even if [it] had permissions at a sub-directory level.

If I've got it wrong, I would be grateful if someone would correct
me. Otherwise, I hope that helps other newbies who find themselves in a
similar situation.

On Sun, 8 Oct 2000, Dieter Maurer wrote:

 Aaron Straup Cope writes:
   My problem is that I can't seem to figure out, specifically, which
   permissions to give a user that will allow them to read ZopeTime().
 Strange...
 
 "DateTime.DateTime" objects (and therefore "ZopeTime") are
 explicitely unprotected (and can be used by everyone).
 
 I tried your example as "Anonymous" (Zope 2.2.2) and
 it worked as expected (i.e. no NameError).
 
 
 Dieter
 


___
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] Newbie question : ZopeTime permissions

2000-10-10 Thread Dieter Maurer

Aaron Straup Cope writes:
  I did not want to allow the Anonymous role *any* permissions, and the
  site I am working in is contained in a folder beneath the root Zope
  folder. 
  
  The problem was that I had disabled the "Access contents
  information" privilege for the Anonymous user (whose permissions I forgot
  are inherited by all other users) at the root level, thus preventing Joe
  User from being able to access internals(?) like
  ZopeTime even if [it] had permissions at a sub-directory level.
Sorry, I was wrong, at least partially!

The fact, that "ZopeTime" returns an unprotected DateTime object,
does of cause not mean that "ZopeTime" itself is unprotected.

After your message, I reexamined your problem:

 * "ZopeTime" is defined in "OFS.Application.Application",
   i.e. the top level application object.

 * "ZopeTime" apparently is not protected by an explicit
   permission (neither mentioned in an "__ac_permissions__"
   nor is there a "ZopeTime__roles__" attribute nor
   is there a new SecurityManager assertion about
   "ZopeTime".

   As I understand Zope 2.2 security, this should mean
   "ZopeTime" is inaccessible from DTML.
   
 * However, magically, "ZopeTime" is protected by "Access Contents
   Information". 

I can not tell you why.
Both is astonishable:
  * that it is accessible by DTML at all
  * why "Access Contents Information" is required.

Apparently, the Zope security still has some hidden magic.


Dieter

___
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] Newbie question : ZopeTime permissions

2000-10-08 Thread Dieter Maurer

Aaron Straup Cope writes:
  My problem is that I can't seem to figure out, specifically, which
  permissions to give a user that will allow them to read ZopeTime().
Strange...

"DateTime.DateTime" objects (and therefore "ZopeTime") are
explicitely unprotected (and can be used by everyone).

I tried your example as "Anonymous" (Zope 2.2.2) and
it worked as expected (i.e. no NameError).


Dieter

___
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] Newbie question : ZopeTime permissions

2000-10-06 Thread knight

Aaron, you left out the error. What was it...

On Fri, 6 Oct 2000, Aaron Straup Cope wrote:

 Hi,
 
 My name is Aaron.
 
 I am trying to set up zope with (atleast) three roles : manager, admin,
 user.
 
 I'd like to give the last two the bare minimum Security permissions
 possible and adding them as needed later on. 
 
 My problem is that I can't seem to figure out, specifically, which
 permissions to give a user that will allow them to read ZopeTime().
 
 (see below)
 
 For the admin user, I have set the Access content information and View *
 options globally. I've tried guessing at some others, but there are alot
 of possible combinations to try so I thought maybe I would just ask.
 
 Related, is there a detailed description of the default Security
 settings? I've checked the mailing lists and the Zope docs and if it's
 there, I guess I missed it.
 
 Thanks,
 
 dtml-call "REQUEST.set('ts', ZopeTime())"
 dtml-call "REQUEST.set('foo',_.str(_.int(ts)))"
 
 dtml-var foo
 
 Traceback (innermost last):
   File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line 222, in
 publish_module
   File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line 187, in
 publish
   File /usr/local/zope.old/lib/python/Zope/__init__.py, line 221, in
 zpublisher_exception_hook
 (Object: Traversable)
   File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line 171, in
 publish
   File /usr/local/zope.old/lib/python/ZPublisher/mapply.py, line 160, in
 mapply
 (Object: test)
   File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line 112, in
 call_object
 (Object: test)
   File /usr/local/zope.old/lib/python/OFS/DTMLDocument.py, line 177, in
 __call__
 (Object: test)
   File /usr/local/zope.old/lib/python/DocumentTemplate/DT_String.py, line
 528, in __call__
 (Object: test)
   File /usr/local/zope.old/lib/python/DocumentTemplate/DT_Util.py, line
 337, in eval
 (Object: REQUEST.set('ts', ZopeTime()))
 (Info: REQUEST)
   File string, line 0, in ?
 NameError: (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] Newbie question : ZopeTime permissions

2000-10-06 Thread Aaron Straup Cope

Doh! Sorry.

Error Type: KeyError
Error Value: ZopeTime

On Fri, 6 Oct 2000, knight wrote:

 Aaron, you left out the error. What was it...
 
 On Fri, 6 Oct 2000, Aaron Straup Cope wrote:
 
  Hi,
  
  My name is Aaron.
  
  I am trying to set up zope with (atleast) three roles : manager, admin,
  user.
  
  I'd like to give the last two the bare minimum Security permissions
  possible and adding them as needed later on. 
  
  My problem is that I can't seem to figure out, specifically, which
  permissions to give a user that will allow them to read ZopeTime().
  
  (see below)
  
  For the admin user, I have set the Access content information and View *
  options globally. I've tried guessing at some others, but there are alot
  of possible combinations to try so I thought maybe I would just ask.
  
  Related, is there a detailed description of the default Security
  settings? I've checked the mailing lists and the Zope docs and if it's
  there, I guess I missed it.
  
  Thanks,
  
  dtml-call "REQUEST.set('ts', ZopeTime())"
  dtml-call "REQUEST.set('foo',_.str(_.int(ts)))"
  
  dtml-var foo
  
  Traceback (innermost last):
File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line 222, in
  publish_module
File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line 187, in
  publish
File /usr/local/zope.old/lib/python/Zope/__init__.py, line 221, in
  zpublisher_exception_hook
  (Object: Traversable)
File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line 171, in
  publish
File /usr/local/zope.old/lib/python/ZPublisher/mapply.py, line 160, in
  mapply
  (Object: test)
File /usr/local/zope.old/lib/python/ZPublisher/Publish.py, line 112, in
  call_object
  (Object: test)
File /usr/local/zope.old/lib/python/OFS/DTMLDocument.py, line 177, in
  __call__
  (Object: test)
File /usr/local/zope.old/lib/python/DocumentTemplate/DT_String.py, line
  528, in __call__
  (Object: test)
File /usr/local/zope.old/lib/python/DocumentTemplate/DT_Util.py, line
  337, in eval
  (Object: REQUEST.set('ts', ZopeTime()))
  (Info: REQUEST)
File string, line 0, in ?
  NameError: (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] Newbie Question: File upload in from my own Product

2000-09-20 Thread Dieter Maurer

Dicken, Peer writes:
  I´m new to Zope ;) I´m currently composing a set of products for my website
  and have a little problem now:
  I need to make a Product that makes it possible to upload a file, well,
  basically a tuned "FILE" object.
  I need to add a description. Is it right to add the FILE object in my
  ZClass, or what should I do?
That is one option.

However, images have properties of their own.
You can just define a new property "description" and give it
a value.

Look at the "PropertyManager" interface (- object reference
(- zdp.zope.org) or interface Wiki (- dev.zope.org)
or the source.



Dieter

___
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] newbie question: installing ZSiteMap and ZPhotoAlbum

2000-09-04 Thread Bill Anderson

Tamara Temple wrote:
 
 Hi all,
 
 My first posting here, please forgive if this is obvious, cause it
 isn't to me. I already checked the How-To's and searched the zope-list
 archives and came up with nothing.
 
 I downloaded the two zexp files for ZSiteMap and ZPhotoAlbum, and put
 them in the import directory. When I try to import them, I get an
 error and a traceback saying that "this operation isn't support by
 ZSiteMap" (or ZPhotoAlbum, depending). There are no instructions with
 either one on how to install them. What do I need to do in order for
 these to work?

You have to import products into the Control Panel - Products folder.


--
Do not meddle in the affairs of sysadmins, for they are easy to annoy,
and have the root password.

___
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] Newbie question: FORM processing in Zope.

2000-08-28 Thread J. Atwood

Easy and hard answer.

The easy answer is forget what you know about scripts/cgi and pulling in
form variables from some sort of CGI method (perl module). Since Zope is a
constant running process it does not require that you point to a script.

Hard Answer: The basics are that all you have to do is give the form element
a name (as you would in any form) and point the action of the form to
another DTML Method/Document. In that M/D all you have to do to get the
variable is call it with DTML-VAR variable_name

1) Create a form page with 'submit' with one text input box with a name of
'email_address'.

2) Point the action to a method called 'result' and create that

3) In the 'result' method include this code dtml-var email_address

4) Play around.

When you submit from one you should be taken to the second page and the
email_address should be there.

Now, for validation you can do all sorts of tricky things. I happen to like
to have the form point back to itself and have one method handle the entire
activity. You can validate things by asking for them, or trying to do
something else like put them into a database/email. If they are not there
you will get an error so you can use dtml-try. What makes Zope great is
that I can have the form and function in the same page (easier to
update/check).

Examples: (these are live and in production so please be kind)

http://fundraising.gotschool.com/tell_a_friend.html

http://market.gotschool.com/  (click on register for either school or
supplier and notice how the form is different for both).

Same thing done twice.

J

 From: Amit Redij [EMAIL PROTECTED]
 Date: Mon, 28 Aug 2000 17:15:03 +0530
 To: [EMAIL PROTECTED]
 Subject: [Zope] Newbie question: FORM processing in Zope.
 
 
 hi,
 
 I am a Perl/CGI programmer, trying out Zope.
 I am confused right now about
 HOW TO process FORM variables?
 and most important thing is
 how to validate form inputs.(like same thing is best done in PERL using
 regex)
 
 that is, if I have a html having some form variables and a submit
 button. I click on the submit button. it should call some script..right?
 My question is how to pass values from one script to another. how is
 this done in Zope?
 
 thanks a lot in advance.
 
 regards
 Amit
 
 
 .--.
 |o_o |
 |\_/ |
 //   \ \Amit Redij
 (| | )   mailto:[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] Newbie question: FORM processing in Zope.

2000-08-28 Thread Loren Stafford



A great resource for newbies is the collection of How-To's
http://www.zope.org/Documentation/How-To (or better yet:
http://www.zope.org/Members/AlexR/tips/howto_list where you can use browser
search to find what you need).

Search for "forms" and you will see, for example:

http://www.zope.org/Members/jules/smarterforms_html

In short, the methods of Zope objects are all "CGI scripts". For the
"action" of a form, you supply the url of a form-handling method of some
Zope object you have created. When that method runs, form fields are stored
in the dictionary (hash, to you) that implements the namespace for the
request. You access them as simple DTML variables: e.g.

dtml-var form_field_name

If you want to send the value of that form field on to another form, you do
it much the same as in Perl -- you code a hidden form field and assign it
the value dtml-var form_field_name.

-- Hope that helps
-- Loren

- Original Message -
From: "Amit Redij" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: August 28, 2000 04:45 AM
Subject: [Zope] Newbie question: FORM processing in Zope.



 hi,

 I am a Perl/CGI programmer, trying out Zope.
 I am confused right now about
  HOW TO process FORM variables?
 and most important thing is
 how to validate form inputs.(like same thing is best done in PERL using
 regex)

 that is, if I have a html having some form variables and a submit
 button. I click on the submit button. it should call some script..right?
 My question is how to pass values from one script to another. how is
 this done in Zope?

 thanks a lot in advance.

 regards
 Amit

 
  .--.
 |o_o |
 |\_/ |
//   \ \Amit Redij
   (| | )   mailto:[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] Newbie Question (Content Manager Tutorial)

2000-08-21 Thread Steve Drees

 With the advent of Zope 2.2, the first thing you need to do is to create a
 management user.  You cannot use the 'superuser' to manage content.  I
 know this is a little unfamiliar, but, for now, just suspend disbelief and
 create another user with the 'Manager' role (by visiting the acl_users
 User Folder and adding a user).  Then quit the browser, and log in as the
 user you created.  You'll then be able to follow the cmg.


Couldn't the zope install be modified to prompt for a 'Manager' username and
password
and then create that account from the outset?


___
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] Newbie Question (Content Manager Tutorial)

2000-08-19 Thread Chris McDonough

Darn.  Those docs are a little ( ok, a lot...) out of date.  They're
still useful, but they don't cover a few things.

With the advent of Zope 2.2, the first thing you need to do is to create a
management user.  You cannot use the 'superuser' to manage content.  I
know this is a little unfamiliar, but, for now, just suspend disbelief and
create another user with the 'Manager' role (by visiting the acl_users
User Folder and adding a user).  Then quit the browser, and log in as the
user you created.  You'll then be able to follow the cmg.

On Sat, 19 Aug 2000, Mark A. Pappas wrote:

 Hi All,
 I decided today was learn Zope Day. I expect to be pounding the list with
 some newbie questions.
 
 I installed Zope 2.2.0 on a Win 98 machine. Seems to work fine. I dloaded
 the Content Manager Guide and started working through the tutorial. Went to
 create a folder as instructed.
 
 Id: News
 Title: The ZAcme News
 
 
 X  Create public interface
 X  Create user folder
 
 Below is what I got. What am I doing wrong?
 Thanks All
 Mark Pappas
 
 
 Zope Error
 Zope has encountered an error while publishing this resource.
 
 Error Type: SuperCannotOwn
 Error Value: Objects cannot be owned by the superuser
 
 
 
 
 
 
 Troubleshooting Suggestions
 
 The URL may be incorrect.
 The parameters passed to this resource may be incorrect.
 A resource that this resource relies on may be encountering an error.
 For more detailed information about the error, please refer to the HTML
 source for this page.
 
 If the error persists please contact the site maintainer. Thank you for your
 patience.
 
 
 
 
 Traceback (innermost last):
   File C:\Program Files\WebSite\lib\python\ZPublisher\Publish.py, line 222,
 in publish_module
   File C:\Program Files\WebSite\lib\python\ZPublisher\Publish.py, line 187,
 in publish
   File C:\Program Files\WebSite\lib\python\Zope\__init__.py, line 221, in
 zpublisher_exception_hook
   File C:\Program Files\WebSite\lib\python\ZPublisher\Publish.py, line 171,
 in publish
   File C:\Program Files\WebSite\lib\python\ZPublisher\mapply.py, line 160,
 in mapply
 (Object: manage_addFolder)
   File C:\Program Files\WebSite\lib\python\ZPublisher\Publish.py, line 112,
 in call_object
 (Object: manage_addFolder)
   File C:\Program Files\WebSite\lib\python\OFS\Folder.py, line 116, in
 manage_addFolder
   File C:\Program Files\WebSite\lib\python\OFS\ObjectManager.py, line 249,
 in _setObject
 (Object: ApplicationDefaultPermissions)
   File C:\Program Files\WebSite\lib\python\AccessControl\Owned.py, line 271,
 in manage_fixupOwnershipAfterAdd
 (Object: ElementWithAttributes)
 SuperCannotOwn: (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] Newbie Question (Content Manager Tutorial)

2000-08-19 Thread Chris Withers

Chris McDonough wrote:
 With the advent of Zope 2.2, the first thing you need to do is to create a
 management user.  You cannot use the 'superuser' to manage content. 

Can anyone remind me why?

T0he problems it's caused, particularly with broswers caching basic auth
info, seem to be pretty nasty for newbies (and a few oldbies ;-)

cheers,

Chris

___
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] Newbie Question (Content Manager Tutorial)

2000-08-19 Thread Jan H. Haul

"Mark A. Pappas" wrote:

 I installed Zope 2.2.0 on a Win 98 machine. Seems to work fine. I dloaded
 the Content Manager Guide and started working through the tutorial. Went to
 create a folder as instructed.
 
 Below is what I got. What am I doing wrong?

 Error Type: SuperCannotOwn
 Error Value: Objects cannot be owned by the superuser
 

You are working as superuser.
While this *did* work up to Zope 2.1.6, since Zope 2.2 the
security model was tightened.

You must (as superuser) create a user with manage privilege,
restart your browser and use that user to create objects.

HTH,
Jan

___
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] Newbie Question (Content Manager Tutorial)

2000-08-19 Thread Chris McDonough

See (sneak peek) http://www.zope.org/Members/mcdonc/PDG/6-1-Security.stx,
section named "The Superuser".

I hope to have this chapter really finished this weekend.

On Sat, 19 Aug 2000, Chris Withers wrote:

 Chris McDonough wrote:
  With the advent of Zope 2.2, the first thing you need to do is to create a
  management user.  You cannot use the 'superuser' to manage content. 
 
 Can anyone remind me why?
 
 T0he problems it's caused, particularly with broswers caching basic auth
 info, seem to be pretty nasty for newbies (and a few oldbies ;-)
 
 cheers,
 
 Chris
 
 ___
 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] Newbie Question (Content Manager Tutorial)

2000-08-19 Thread Dieter Maurer

Hi Mark,

Mark A. Pappas writes:
  I installed Zope 2.2.0 
  I dloaded the Content Manager Guide 
  ...
  Zope Error
  Zope has encountered an error while publishing this resource.
  
  Error Type: SuperCannotOwn
  Error Value: Objects cannot be owned by the superuser
The Content Manager Guide still describes the world
before Zope 2.2.

For some reason (that I do not understand), DC descided
that, starting with Zope 2.2.0, the SuperUser is no
longer Super but instead rather limited. He cannot own objects
and therefore, he cannot create objects.

What you need to do:

  As SuperUser go to "acl_users".
  Create a new user with a role of "Manager".
  Close your browser (all windows!).
  Recontact Zope (in a fresh browser!) as your newly created
  Manager.
  Use this manager, whenever your guide speaks of "SuperUser".


Dieter

___
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] Newbie question: referring to dtml-call documents

2000-08-07 Thread Dieter Maurer

David Loeffler writes:
  
  whenever I try to get hold of this with anything like dtml-var 
  "_[objId].getProperty(dest)" (objId is the id of the document) it simply 
  redirects ...


"_[xxx]" executes (calls) the retrieved object, if possible.
In your case, execution calls "RESPONSE.redirect".

You need "_.getitem(xxx)" instead of "_[xxx]".
This only retrieves and does not call the object.


Dieter

___
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] newbie question: how do I adjust field width?

2000-07-31 Thread Bill Anderson

Joe Hewitt wrote:
 
 Hi,
 
 I'm making an input form.  When I try to change the form's input field
 width, it automagically displays 30 char for each field.  Is there any way
 to adjust the width?

Basic HTML Question. Please read HTML docs.

 
 Different question: where can I find some good examples of how to validate
 input?

Depends on how you want to do it, ie. server or client side. Consult the mailing list
archives for many references and examples. 
They can be reached from zope.org - Resources - Mailing Lists

Cheers,

Bill


--
Do not meddle in the affairs of sysadmins, for they are easy to annoy,
and have the root password.

___
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] Newbie question on page counters

2000-07-27 Thread Chris Withers

"Richard P. Muller" wrote:
 I'm in the process of learning Zope hacking, and I'm having a really
 hard time getting a page counter to work. It isn't even that page
 counters are all that important to me, it's that I feel that if I can't
 even do something this simple, what hope do I have doing something
 really hard?

The ZODB is a _really_ bad place to store a page counter, especially on
a busy site.
Data.fs will grow each time your counter increments. This is because
it's a transactional daatbase with undo ability...

 Here's what I've done.
 (1) Under "Properties" I've created two properties (both ints)
 counter_starting_value, which I've set to 11 (arbitrarily)
 counter_value, which I've set to 0

Sounds good :-)

 dtml-if counter_value
 dtml-let counter_value = counter_value + 1
 /dtml-let
 dtml-else
 dtml-let counter_value = counter_starting_value
 /dtml-if
 dtml-var counter_value
 
 This didn't work. The error message reported that the syntax in the
 first (and probably the second, but I never got past the first) dtml-let
 command was wrong.

Whoops, just remember this:
DTML is not a programming language, it is designed for data presentation
and form processing. Or something like that ;-)

To do what you want, you probably want something like:

dtml-call
"manage_changeProperties(counter_value=getProperty(counter_value,counter_starting_value-1)+1)"

Which isn't pretty :S

cheers,

Chris

___
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] Newbie question on page counters

2000-07-27 Thread Chris Withers

Chris Withers wrote:
 To do what you want, you probably want something like:
 
 dtml-call
 
"manage_changeProperties(counter_value=getProperty(counter_value,counter_starting_value-1)+1)"

Erk, maybe this:
 dtml-call

"manage_changeProperties(counter_value=getProperty('counter_value',getProperty(counter_starting_value,0)-1)+1)"

Chris

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

2000-06-22 Thread ethan mindlace fremen

Alexander N Gould wrote:
 
 Now that I've set up some virtual hosts off my zserver, I have another
 question.  These sites (each in a folder in the zope DB) share a lot of
 data in the form of some custom zobjects representing contacts, calendar
 items, and posts to discussion boards.  If I put these objects in folders
 on the root level, how do I access them from dtml methods somewhere else?
 Or am I going about this all wrong?

dtml-with SomeTopFolder
dtml-var SomeObject
/dtml-with

A revamped "transparent folder" will allow you to make global objects
more easily sometime in the near future (after 2.2 release)

ethan mindlace fremen
Zopatista Community Liason

___
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] Newbie Question (dropdown menu)

2000-06-21 Thread Jim Sanford

This is my answer to another seeker's question.
It should also answer yours.

This code assumes that the variable customerid on the form
contains a value that matches up with customerid in 
the query custcompanysearch

___
dtml-let tcustid="customerid"
  select name="customerid"
dtml-in custcompanysearch
  option value=dtml-var customerid
  dtml-if "customerid==tcustid"selected/dtml-if
  dtml-var firstname dtml-var lastname/option
/dtml-in
  /select
dtml-let
 __
 
  Jim Sanford
  .   Database Engineer
 / \  /   Accelerated Technology, Inc.
/   / 720 Oak Circle Drive East
   /  /  \Mobile, AL 36609
  / / \   Voice: 334-661-5770  fax: 334-661-5788
 / \  E-Mail: [EMAIL PROTECTED]
  Web: http://www.atinucleus.com
  
 Nucleus.  All You NEED in an RTOS.  Royalty Free
 __


- Original Message - 
From: joel grimes [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 21, 2000 10:51 AM
Subject: [Zope] Newbie Question (dropdown menu)


I'm trying to fill a combo-box (pardon the vb-centric lingo - I don't know 
what the things are called - it's a select...option... thing) with items 
selected from a table.  I haven't a clue how to do this.  I've got the ODBC 
Connection and SQL Method working, but how do I iterate through the query 
results to fill a drop-down?

Thanks

Joel Grimes

Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] Newbie Question,

2000-06-07 Thread Chris Withers

CURTIS David wrote:
 I wish to use use the date of a database file in my dynamic html code.  For example, 
this database was last updated on 06/06/2000.  I suppose that there must be a dynamic 
html tag that zope uses.  What could it be?  I looked at all the documentation and 
have yet to discover it.  DTML-ZOPE-FILE-DATE  Any help is apprechiated.

dtml-var bobobase_modification_time

...obviously... :(

This will give you the time your current object was last modified.

Why has this not been renamed to something sensible?
We lost PrincipiaSearchSource a while back, I hope this goes the same
way ;-)

cheers,

Chris

___
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] Newbie question: graphics in subdirs

2000-06-07 Thread Rik Hoekstra

snip
 
However, I want to keep all of my commonly used image files in a
 subdirectory called /images.  So I create a folder called "images", upload
 another copy of logo.jpg into it, everything's fine.  I change the dtml in
 the "test" document to be "dtml-var /images/logo.jpg".  And it doesn't
 work, giving me an error message of:
 
 Error Type: KeyError
 Error Value: /images/logo.jpg
 
Looking through the docs and tutorials I can't find anything on this --
 and I know it's mindlessly simple.  Can someone whack me with a clue-bat?
 TIA.

whack 1. Don't use URL separators in dtml expressions. Use dots 2. You
shouldn't have used dots in the logo.jpg name as it confuses zope, look
below what that gets you ;-):

dtml-var "images._['logo.jpg']"

sorry 'bout that (untested, but should work)

/whack

Rik

___
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] Newbie question: graphics in subdirs

2000-06-07 Thread Tony McDonald

At 11:35 am -0400 7/6/00, Randy Edwards wrote:
dtml-var standard_html_header
h2dtml-var title_or_id/h2
pThis is the dtml-var id Document./p
pNow show a graphic: br
dtml-var logo.jpg
/p
dtml-var standard_html_footer

That references an image file in the root directory called logo.jpg.
Everything works, it displays fine.

However, I want to keep all of my commonly used image files in a
subdirectory called /images.  So I create a folder called "images", upload
another copy of logo.jpg into it, everything's fine.  I change the dtml in
the "test" document to be "dtml-var /images/logo.jpg".  And it doesn't
work, giving me an error message of:


try
dtml-with images
dtml-var logo.jpg
/dtml-with

It can get complex quickly though - I'm sure I remember something on 
thew Zope list about this, I think it was a word of wisdom from Phil 
Harris...

hth
tone
--
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2

___
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] Newbie question: graphics in subdirs

2000-06-07 Thread Phil Harris

eh tone,  your using my name in vain again ;)

- Original Message -
From: "Tony McDonald" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; "Zope List" [EMAIL PROTECTED]
Sent: 07 June 2000 16:56
Subject: Re: [Zope] Newbie question: graphics in subdirs


 At 11:35 am -0400 7/6/00, Randy Edwards wrote:
 dtml-var standard_html_header
 h2dtml-var title_or_id/h2
 pThis is the dtml-var id Document./p
 pNow show a graphic: br
 dtml-var logo.jpg
 /p
 dtml-var standard_html_footer
 
 That references an image file in the root directory called logo.jpg.
 Everything works, it displays fine.
 
 However, I want to keep all of my commonly used image files in a
 subdirectory called /images.  So I create a folder called "images",
upload
 another copy of logo.jpg into it, everything's fine.  I change the dtml
in
 the "test" document to be "dtml-var /images/logo.jpg".  And it doesn't
 work, giving me an error message of:
 

 try
 dtml-with images
 dtml-var logo.jpg
 /dtml-with

 It can get complex quickly though - I'm sure I remember something on
 thew Zope list about this, I think it was a word of wisdom from Phil
 Harris...

 hth
 tone
 --
 Dr Tony McDonald,  FMCC, Networked Learning Environments Project
 http://nle.ncl.ac.uk/
 The Medical School, Newcastle University Tel: +44 191 222 5888
 Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2

 ___
 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-dev] Re: [Zope] newbie question: parameter passing for ZSQL Object

2000-05-28 Thread Stephan Richter


With dtml-call insertItem, Zope gives me following error message:

If the parameters are from another SQL statement, then the SQL method will 
not find them, since not the entire namespace is sent.

Try:
dtml-call "insertItem(param1=pvalue1, param2=pvalue2, param3=pvalue3, 
param4=pvalue4)"

pvalueX can be also a variable. If your variables are called paramX, then 
the following will work:

dtml-call "insertItem(param1=param1, param2=param2, param3=param3, 
param4=param4)"

That is typical Python syntax. So in case you want to know why and how that 
works, read a little in the Python documentation (which is btw excellent.)

Regards,
Stephan
--
Stephan Richter
CBU - Physics and Chemistry
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 )




Re: [Zope] newbie question: parameter passing for ZSQL Object

2000-05-28 Thread Stephan Richter


With dtml-call insertItem, Zope gives me following error message:

If the parameters are from another SQL statement, then the SQL method will 
not find them, since not the entire namespace is sent.

Try:
dtml-call "insertItem(param1=pvalue1, param2=pvalue2, param3=pvalue3, 
param4=pvalue4)"

pvalueX can be also a variable. If your variables are called paramX, then 
the following will work:

dtml-call "insertItem(param1=param1, param2=param2, param3=param3, 
param4=param4)"

That is typical Python syntax. So in case you want to know why and how that 
works, read a little in the Python documentation (which is btw excellent.)

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


___
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] newbie question: case sensitive folder problem

2000-05-24 Thread Phil Harris


create an other object (DTML Method) called bigfolder with these contents
(untested):

dtml-call "RESPONSE.redirect('BigFolder')"


- Original Message -
From: "Alexander N Gould" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 24, 2000 12:43 PM
Subject: [Zope] newbie question: case sensitive folder problem


 How can I make a folder on my site case - insensitive in regards to access
 from URLs.  If someone types http://mysite.com/bigfolder/ into their
 browser, I want it to take them to the Bigfolder, but right now, it
 produces a missing object error.  Any hints?  Sorry if this is a silly
 question - I'm just getting started here.

 I use zope with pcgi on Apache.
 --
 Building highways to reduce traffic is like loosening your belt to reduce
 obesity


 ___
 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] newbie question: case sensitive folder problem

2000-05-24 Thread Steve Alexander

Alexander N Gould wrote:
 
 How can I make a folder on my site case - insensitive in regards to access
 from URLs.  If someone types http://mysite.com/bigfolder/ into their
 browser, I want it to take them to the Bigfolder, but right now, it
 produces a missing object error.  Any hints?  Sorry if this is a silly
 question - I'm just getting started here.
 
 I use zope with pcgi on Apache.

You can solve this using a DTML method called bigfolder:

dtml-call "RESPONSE.setBase(Bigfolder.absolute_url())"
dtml-with Bigfolder
  dtml-var index_html
/dtml-with


However, this won't help you if you want things to be totally
case-insensitive, like having "bIgFolDer" direct to "Bigfolder" for
example.

--
Steve Alexander
Software Engineer
Cat-Box limited

___
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] newbie question: case sensitive folder problem

2000-05-24 Thread Marcus Collins

You could try using Apache rewrite rules to convert all URL's to lower case,
and then use only lower case names for your folders, documents and methods.
As long as the case is consistent, one rewrite rule should cover everything.

hth,

-- Marcus

 -Original Message-
 From: Alexander N Gould [mailto:[EMAIL PROTECTED]]
 Sent: 24 May 2000 13:43
 To: [EMAIL PROTECTED]
 Subject: [Zope] newbie question: case sensitive folder problem
 
 
 How can I make a folder on my site case - insensitive in 
 regards to access
 from URLs.  If someone types http://mysite.com/bigfolder/ into their
 browser, I want it to take them to the Bigfolder, but right now, it
 produces a missing object error.  Any hints?  Sorry if this is a silly
 question - I'm just getting started here.
 
 I use zope with pcgi on Apache.
 --
 Building highways to reduce traffic is like loosening your 
 belt to reduce
 obesity
 
 
 ___
 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 )