[Zope] Two hairy questions

Samu Mielonen ex@uiah.fi
Sun, 17 Oct 1999 22:01:13 +0300


I'm building KM|NetNews again and while I've been able to
tackle some tricky dtml-problems with the help of this list,
I've hit a brickwall again (for two days now).

I'm trying to create a simple button that will approve
my article, that has been submitted to my site for publication.

The hierarchy of my ArticleStore is as follows:

News
   add.html 		(submit form)
   AddArticle 		(dtml-method to handle form submit and save contents)
   1999			(year for article's submit date)
     10			(month for article's submit date)
       #article1_id	(unique_id of article)
	     index.html   (view the article contents)
           edit		(form to edit article, sends results to postit)
           postit		(dtml-method to APPROVE article for publication)
       #article2_id
       ...

The problem is that I do not understand from the code what postit
does so that the article becomes visible for the publishing methods,
but I do know that untill I put the article object through postit-method
it won't be approved and ready for publishing (for those who know
KM|NetNews, I've usen the property current to denote approval).

Anyway, I want the AddArticle method to PREVIEW a submitted article
(that was sent through the add.html form). This is easy. I can
call article's own index.html from within Addarticle and it is rendered
visible.

But here I bumb into my first problem. Even though I go into the
article's folder with <dtml-with> and am able to display the
articles text-properties (heading, body text, importance) ok,
I can't display pictures.

<dtml-with "_[_.str(tsyear)]">
 <dtml-with "_[_.str(tsmonth)]">
  <dtml-with "_[_.str(uniqueID)]">

	  <dtml-var index.html>

  </dtml-with>
 </dtml-with>
</dtml-with>

For some reason, the index.html than renders the images just with
<img src="image_name"> does not understand that it should render
the images in that specific folder from which it is called.

Thus, all my image links that come from index.html of a particular
article point to the directory (/News in my example) from which I
call the aforementioned index.html.

How do I make the IMG-tags display the images correct from the
right directory?

Also, when I finally try approve an article from the
AddArticle method by displaying a link that calls

	http://mydomain/1999/10/somearticleid/postit

in order "to do the thing" to get article approved, I
can't somehow pass the current article object to
postit, so that it would know what article to handle.

So, how can I call article's method called "postit" from
somewhere else in such a manner as to make the method
work on the desired article and have it approved for publishing?

I know this can be tricky to understand without me drowning you
with pages of code, but this is the best I could manage.

Again, I'm extremely grateful for any hints. The ones I got from
many of you earlier have been invaluable.


Best regards,
	 Samu Mielonen


--
"Our reflections on the order of society, as well as nature, are still
dominated by the Newtonian image of massive power, exerted by sovereign
agency through the operation of central force..." -Stephen Toulmin,
"Cosmopolis"