[Zope-PTK] PTK questions

Mike Pelletier mike@digicool.com
Thu, 16 Mar 2000 10:31:09 -0500 (EST)


    Sorry for the great delay.  Stop asking such hard questions!  ;-)  
(Only joking, of course.)

On 6 Mar 2000, John Goerzen wrote:

> The basic idea is, to have each person create stuff in his own area.
> OK, but what about site consistency?  Instead of having a nice
> hierarchial URL like /projects/software/linux/freeciv/java.html, now
> the Java Freeciv might be at /members/bob/mystuff/fc.html and the
> foobarbaz Linux project could be at /members/jane/foo/bar/baz.html.

    While the PTK encourages a member-centric organization, you do not
HAVE to use this model.  You simply need to give members (all or specific
members) permission to add items elsewhere.

    Say you have a couple librarian members.  They can create folders (or
some sort of smarter 'project' object) in designated locations.  So you
have a librarian for '/projects/software/linux' and
'/projects/software/beos'.  You give them permission to create project
objects in those locations.  They can then give the projects they create
to the project manager members, who can create whatever they like within
the project.

> Now, there is mention of using Zcatalogs to solve this, but no mention
> of HOW.  I like having Zope look at what documents and folders are in
> the current folder and thus generate an index_html
> pseudo-automatically where possible.  Doesn't seem possible here.

    If you already understand how to loop over the contents of a folder
and generate links or other information, doing the same with a catalog is
not much mroe difficult.

    Instead of:

<dtml-in objectValues>
 <a href="<dtml-var absolute_url>">&dtml-title;</a><br>
</dtml-in>

    You would use something like:

<dtml-in "getPortal().getCatalog().searchResults(meta_type='Project',
                                                 platform='Linux')">
 <a href="<dtml-var "getpath(data_record_id_)">">&dtml-title;</a><br>
</dtml-in>

    I can dig up some resources which explain using catalogs in more
detail if you like.  Check Zope.org first.


> Plus it seems that the superuser has to create all the index
> documents.  Right?  Unless it's the homepage for a given member.

    Like I mentioned above, you can delegate these tasks out to whichever
members or roles you like.

> Next question.  News.  The front page thing is static.  How to fix?
> Also, I want people to be able to post comments to news stories, ala
> Squishdot.  How?

    It needs to be replaced with a catalog query.  I'll do so next time I
update the DemoPortal.zexp file in the CVS.

> Next question.  What is the point of a "Link" object?  :-)

    It is a reference to a resource on the WWW.  What did you think?  ;-D

    Seriously, think Yahoo.  Essentially a giant collection of folders and
Link objects.

> There is reference in the docs to Subject.  But the wizard doesn't ask
> for Subject.

    Good point.  It's not actually exposed anywhere.

    Say, that reminds me...  Has anyone looked at the partial searching
capabilities recently added to the ZCatalog?  Do they work on Field or
KeywordIndexes?  If so, I have some fun abuses in mind.

> Finally, I have lots of stuff in plain Zope (DTML Documents, etc). How
> can I migrate this over to the portal toolkit?  Can I just plonk it
> down in a subfolder there?  If so, will it be properly cataloged and
> enjoy the review process?  A lot of this code is DTML and the Portal
> toolkit doesn't seem to support DTML in its Documents, so I am rather
> puzzled here.

    Hmm.  There is not yet a DTML PTK object.  This is a tough question.  
I image you will have to migrate the data to new objects.  Actually...  
Perhaps you could write a folder object from which it's contents could
acquire the PortalContent methods.  That certainly wouldn't be the
preferred solution, but it's an idea.

Mike.

-- 
Mike Pelletier                          email: mike@digicool.com
Mild mannered software developer          icq: 7127228
by day, super villain by night.         phone: 519-884-2434