[Zope] Organizing Zope Content

Maik Roeder roeder@berg.net
Sat, 15 Jan 2000 03:02:22 +0100


Hi James !


> Neither the Issue or Article will know about how the article is to 
> ultimately be formatted (actually the article contains minimal HTML 
> formatting, but these objects don't know whether they will be contained in 
> tables, frames, etc.)

You have a Model which contains the domain objects issue and article.
These two domain objects just maintain the problem related information.
 
> Outside of the content hierarchy would be one or more objects (Folders, 
> currently) which define the various "pages" of the newsmagazine.  Currently 
> I have a "HomePage" which displays an abbreviated version of the "top 
> story" along with ads and other bits of information.  I also have a 
> "CurrentIssue" page which displays a list of all headlines available in the 
> current issue.  Finally I have a "NewsPage" which defines the layout of the 
> actual news pages.

You have three different views which render the Model to a Screen
presentation.
 
> To display a particular news story, a URL similar to the following is used:
> 
> http://foobar.news.com/SiteRoot/20001001/1/NewsPage
> Via acquisition, the NewsPage folder would be able to get story information 
> from both the Article object itself (1) and the Issue object 
> (20001001).  To look at a different article, simply use a different article 
> number.  To view a different issue, use a different issue name.

The mechanism by which your Views access the information in the domain
objects is by Aquisition.

> I had been thinking the opposite way where I would want to tell the
> NewsPage for example to display a particular page.
> In a traditional web site, the URL might have looked like this:
> 
> http://foobar.news.com/NewsPage?issue=20001001&article=1

You can also base your views on Catalog searches. This way, the Catalog
would provide you with the objects, and you neither have to
explicitly create the aquisition path, nor do you have complicated
URLs like they are used on traditional web sites.

You just have an URL like:

http://foobar.news.com/NewsPage
http://foobar.news.com/HomePage
http://foobar.news.com/IssuePage

I add some suggestions how the views could look, but I must say that
these are just simple ideas and that the code is untested. I just
want to get the idea across.

NewsPage view:

<dtml-in "Catalog( meta_type=Article, issue=20001001, article=1)">
     <a href="<dtml-var "Catalog.getpath(data_record_id_)">">
</dtml-in>

Homepage_View

<dtml-in "Catalog( meta_type=Article, issue=20001001)">
<dtml-if top_story==1>
     <a href="<dtml-var "Catalog.getpath(data_record_id_)">">
</dtml-if>
</dtml-in>

IssuePage

<dtml-in "Catalog( meta_type=Article, issue=20001001)">
     <a href="<dtml-var "Catalog.getpath(data_record_id_)">">
</dtml-in>

> I've been playing around with my new scheme for a little bit and so far I 
> like it.  Of course I still have a lot more to learn about coding in DTML 
> but I think I've got a structure which will support what I want to do.  Or 
> so I hope.
> 
> Comments and feedback are welcome.

You have only talked about Views and Objects, and not about Controllers.
Where do you place the Data Management Object ? How do writers add articles
and edit them ? Views don't change objects, they just display them, and objects
don't know what to do with themselves.

Greetings,

Maik Röder