[Zope-CMF] get a members name / 'project' object into a member folder

Grégoire Weber gregoire.weber@switzerland.org
Thu, 21 Jun 2001 13:57:13 +0200


Just forgot (as allways) to cc that to the list:

Hi Flynt,

thanks for your quick answer! (question 1)

I've seen that method also, but what I search for is not method that lists
all members.
I am searching for *the* members name inside of the member folder. It
should be the same as is supplied by the DublinCore Creator attribute.

I've made some progress in extracting the name out of the URLPATH with:

<dtml-let anchor = "'Members'"
          pos    = "_.string.find(URLPATH0, anchor)"
          beg    = "pos + _.len(anchor) + 1"
          end    = "_.string.find(URLPATH0, '/', beg)">
<dtml-if "pos == -1">
   <dtml-call "REQUEST.set('member', '')">
<dtml-else>
   <dtml-call "REQUEST.set('member', URLPATH0[beg:end])">
</dtml-if>

So I get correct results whith this code:
   http://localhost:8080/up/Members/wwf/home/view             --> member is
'wwf'
   http://localhost:8080/up/Members/wwf/folder/news_in_folder --> member is
'wwf'
   http://localhost:8080/up                                   --> member is ''

But the question remains, if there would exist a more elegant (CMF built
in) method. 
It's only if you know anyhow!

Greg

> Something like:
> <dtml-in expr="portal_membership.listMembers()">
> brings you the portal members.
>
> Grégoire Weber wrote:
> > 
> > Hi folks!
> > 
> > I'd like to have a generic index_html in every member folder showing up
> > news items. They should show only the news generated by the member. So
I am
> > looking for a method returning me the members name so I can feed it in=
 to
> > the catalog search.
> > 
> > So I have two questions concerning this:
> > 
> > 1. Get a members name
> > ---------------------
> > 
> > I'd like to have something like a getMember() (not
getAuthenticatedUser()!)
> > but couldn't find that in the portal_membership interface. Should it be
> > there or can I get this information from an other place?
> > 
> > What I am doing now (as workaround) in the index_html method in the
members
> > folder (Members/name/index_html) is:
> > 
> >    URLPATH1[_.string.rfind(URLPATH1, '/')+1:]
> > 
> > which returns correctly the string 'name'.
> > 
> > But I am searching for a better solution which is independant of the
> > members folder structure because I want to include this into the=
 standard
> > header to save the information in the REQUEST for further use!
> > 
> > Is there a better solution? Hints for search would help also.
> > 
> > 2. 'Inject' or (better) 'project' objects into a (member) folder from
> > somewhere
> >
----------------------------------------------------------------------------
> > ---
> > 
> > I'd like to have a generic index_html dtml method somewhere (best in a
skin
> > folder) which will be show up as index_html dtml method in every Member
> > folder (automagically). More generaly said: Is there a possibility (a
> > tool?) to project a whole folder tree into the member area? I don't like
> > the idea of having copies of the same file in every member folder.
> > 
> > As I remember there was a discussion about a similar topic, but I don't
> > have any idea how to search the mailing list for messages.
> > 
> > Thanks in advance, Greg
> > 
> > P.S.: Zope/CMF is a great and real powerful tool, thanks for all who=
 made
> > it work!
> 
_____________________________________
Grégoire Weber
mailto:gregoire.weber@switzerland.org