Re: [Zope] Can somebody please help me....

2000-11-03 Thread chip johansen

Try

dtml-call "REQUEST.set('email', _['sequence-item'])"

You must use the _ namespace variable.

From: "Thomas Søndergaard" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Zope] Can somebody please help me
Date: Fri, 03 Nov 2000 11:42:43 CET

I am currently working on a newsletter function, and I am a newbie at this 
EXELLENT ZOPE-Server.

Therefore can somebody please help me doing this:

**
dtml-var standard_html_header
dtml-in expr="_.string.split(emails.raw,'\n')"

dtml-call "REQUEST.set('first_name', 'none')"
dtml-call "REQUEST.set('last_name', 'none')"

dtml-call "REQUEST.set('email', dtml-var sequence-item)"
dtml-call "REQUEST.set('title', 'added through list')"
dtml-with "manage_addProduct['NewsLetter']"
  dtml-call "newsletter_entry_add(_.None, _, NoRedir=1)"
/dtml-with

/dtml-in
dtml-var standard_html_footer
**

What i am trying to do here is to add alot of email adresses from a 
dtml-document containing them, one on each line But how do I 
REQUEST.set a sequence-item (Sequence-item works perfectly, but not in the 
REQUEST.set line!)

Please Answer me = (

Stoonsdesign, Thomas Søndergaard

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.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 )


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.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] Help wanted on Zope ZClasses/DTML please.

2000-11-03 Thread chip johansen

Instead of ...

dtml-call
"manage_delObjects('REQUEST['id_to_delete']')"

try

dtml-call
"manage_delObjects('REQUEST.id_to_delete')"

Chip Johansen

From: "Bowyer, Alex" [EMAIL PROTECTED]
To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED]
Subject: [Zope] Help wanted on Zope ZClasses/DTML please.
Date: Fri, 3 Nov 2000 16:05:49 +1100

Hi,

I have only just started developing in Zope over this last week. I like it 
a
lot, but I am having problems finding solutions to some of my more specific
problems in the various zope documentations. I am hoping that if I describe
my problems, one of you more-experienced Zope users out there will be able
to help me.

First some background:

Basically I have written a news page which allows you to add/edit/delete
articles from it. It is similar in some ways to the Zope HowTo "Build a
searchable job board". It revolves around two classes:

(UA stands for Update Australia, the name of the news page)

UAArticle : A single article, to be included on the page.
-
Properties:
  article_title,article_author and article_text (self-explanatory)
DTML Methods:
  index_html - renders the data from the three properties into HTML ready 
for
inclusion in the news page
  edit - a page with a form to allow you to modify the content, submits to
"update"
  update - processes the form results from "edit", updates the properties 
and
redirects

UAPage : the page itself, inherits from ObjectManager and has Add UAArticle
permission defined. Each instance contains 0 or more UAArticles.
--
Properties:
  issue_date, issue_number, intro_text (self-explanatory)
Methods:
  index_html - renders the page to HTML, both from these properties and by
calling the index_html of each subcomponent UAArticle.
  edit - a set of forms for modifications to edit the above three 
properties
and add a new article, or select an article to edit or delete.
  update - processes updates to the UAPage properties that have been made 
on
the edit page.
  edit_article - once an article is selected and the Edit button is 
clicked,
this finds the article, calls the edit method and gives feedback.
  add_article - a form to create a new article and add it to the UAPage.
  create_article - processes the data from the add_article form and 
actually
makes the object and adds it.
  delete_article - once an article is selected and the Delete button is
clicked, this finds the article, deletes it and gives feedback.

Now to the problems I have got:

1) I cannot get my delete_article method to work. I figured I need to use
manage_delObjects, but I can't find a working example to copy from and my
code doesn't seem to do anything. The following code gets called by a form
with a field called article_to_delete which is the title of the article we
want to delete:

dtml-var standard_html_header
!-- set a flag to NULL, change it if found --
dtml-call "REQUEST.set('id_to_delete','NULL')"
!-- get the title of the article to delete --
dtml-let the_match="REQUEST['article_to_delete']"
!-- search for the article --
dtml-in objectValues
   dtml-with sequence-itemdtml-with propertysheetsdtml-with
UAArticleClassPropertySheet
   dtml-if expr="article_title==the_match"
 dtml-call "REQUEST.set('id_to_delete',title_or_id)"
 !-- found it, update the flag --
   /dtml-if
   /dtml-with/dtml-with/dtml-with
/dtml-in
!-- test the flag to see if found --
dtml-if expr="REQUEST['id_to_delete']=='NULL'"
   !-- not found --
   h2Article not found/h2
   PCould not find the article to delete./PPA HREF=editReturn to
maintenance page/A/P
dtml-else
   !-- found --
   dtml-let the_id="REQUEST['id_to_delete']"
   !-- do the deletion - this is the bit that doesn't work --
   dtml-call "manage_delObjects('the_id')"
   h2Article deleted/h2
   PDeleted article 'dtml-the_match;' (id='dtml-the_id;')./PPA
HREF=editReturn to maintenance page/A/P
   /dtml-let
/dtml-if
/dtml-let
dtml-var standard_html_footer

This gets an error that the_id does not exist. But I can't put dtml-call
"manage_delObjects('REQUEST['id_to_delete']')" because that is quotes
within quotes within quotes. I also tried  dtml-with the_iddtml-call
"manage_delObjects()"/dtml-with but that doesn't seem to do anything.
What is the correct way to use manage_delObjects?

2) I need to be able to make a "Back" button on the UAArticle's edit page
that will return to the UAPage's edit page. The problem is that if I use A
HREF=edit it just goes to the edit page of the object, because our current
location is within the UAArticle not the UAPage. Is there a way to get the
name of an object's parent (or its own name for that matter) and use it to
construct a URL?

3) When redirecting or linking to a page I have already visited, how can I
force a refresh? I tried the JavaScript window.location.reload(true) but I
think that is only supported by Netsc

[Zope] Can't create ZClass from within Member folders???

2000-11-02 Thread chip johansen

I have the PTK.8 installed with Zope 2.2.

I have created a demo portal and implemented membership using ZODBMembership 
Folders.

I have also created several folderish ZClasses to use as content types. I 
have given the add methods of these classes "manager" proxy.  I also created 
some user interfaces for adding these content instances from the app rather 
than the management interface.

The problem is that a user with "manager" role can create and delete content 
instances from within the app while in their member user folder or from the 
management interface, but users with "Member" role can only do so from 
within the management interface, but not the interface I created to be 
called from within there folder.

The funny thing is that if I create a copy of these methods at a level above 
the "Members" folder, it works fine, but go down 2 levels to the 
Members/user folder and it won't let me do it.

I have given every method involved "manager" proxy, and just for the heck of 
it, given "Member" the same permissions as "manager" from the top level 
down, but I still get prompted for authentication when I try to add or 
delete an instance from my method

Is it something particular to the Members/users folders of the PTK or am I 
missing something else?  I would appreciate any insight.

Thanks, Chip Johansen

Trace back:

H2Zope Error/H2
  PZope has encountered an error while publishing this resource.
  /P
  PSTRONGUnauthorized/STRONG/P

  You are not authorized to access emPressReleaseClass_add/em.
DEBUG---
Owner:Anonymous User - Roles:('Manager', 'Member', 'Owner') - 
Value:lt;HTMLgt;
lt;HEADgt;lt;TITLEgt;Add PressReleaselt;/TITLEgt;lt;/HEADgt;
lt;BODY BGCOLOR=quot;#FFquot; LINK=quot;#99quot; 
VLINK=quot;#55quot;gt;

lt;dtml-call quot;REQUEST.set('title', 
REQUEST.form['PressReleaseTitle'])quot;gt;

lt;dtml-with 
quot;PressReleaseClass.createInObjectManager(REQUEST['ItemID'], 
REQUEST)quot;gt;
  lt;dtml-call 
quot;propertysheets.PressRelease.manage_editProperties(REQUEST)quot;gt;
  lt;dtml-call reindex_objectgt;
lt;/dtml-withgt;

lt;dtml-if NoRedirgt;
lt;dtml-elsegt;

lt;dtml-if DestinationURLgt;

lt;dtml-call quot;RESPONSE.redirect(
   DestinationURL+'/manage_workspace')quot;gt;

lt;dtml-elsegt;

lt;dtml-call quot;RESPONSE.redirect(
   URL2+'/manage_workspace')quot;gt;
lt;/dtml-ifgt;
lt;/dtml-ifgt;
lt;/bodygt;lt;/htmlgt;
---
!--
Traceback (innermost last):
  File C:\PROGRA~1\PearlNet\lib\python\ZPublisher\Publish.py, line 222, in 
publish_module
  File C:\PROGRA~1\PearlNet\lib\python\ZPublisher\Publish.py, line 187, in 
publish
  File C:\PROGRA~1\PearlNet\lib\python\ZPublisher\Publish.py, line 171, in 
publish
  File C:\PROGRA~1\PearlNet\lib\python\ZPublisher\mapply.py, line 160, in 
mapply
(Object: pressReleaseInstance_add)
  File C:\PROGRA~1\PearlNet\lib\python\ZPublisher\Publish.py, line 112, in 
call_object
(Object: pressReleaseInstance_add)
  File C:\PROGRA~1\PearlNet\lib\python\OFS\DTMLMethod.py, line 172, in 
__call__
(Object: pressReleaseInstance_add)
  File C:\PROGRA~1\PearlNet\lib\python\DocumentTemplate\DT_String.py, line 
528, in __call__
(Object: pressReleaseInstance_add)
  File C:\PROGRA~1\PearlNet\lib\python\DocumentTemplate\DT_With.py, line 
146, in render
(Object: manage_addProduct['P2B_ContentItems'])
  File C:\PROGRA~1\PearlNet\lib\python\DocumentTemplate\DT_Util.py, line 
331, in eval
(Object: PressReleaseClass_add(_.None,_, NoRedir=1))
(Info: PressReleaseClass_add)
  File C:\PROGRA~1\PearlNet\lib\python\OFS\DTMLMethod.py, line 194, in 
validate
(Object: pressReleaseInstance_add)
  File C:\PROGRA~1\PearlNet\lib\python\AccessControl\SecurityManager.py, 
line 139, in validate
  File C:\PROGRA~1\PearlNet\lib\python\AccessControl\ZopeSecurityPolicy.py, 
line 183, in validate
Unauthorized: (see above)


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.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 )