[Zope-CMF] Eliminating the /Members directory?
Kevin Carlson
khcarlso@bellsouth.net
Mon, 12 Aug 2002 08:50:17 -0400
Here's how I put the documents in directories other than the member
directory:
First, you'll have to create a new form to collect the document data. Have
this form post to a Python Script that does the following:
# 1. Create the id
# in this example, I am using a timestamp.
# you may want to get more complex, to
# avoid possible duplications.
ts = str(int(context.ZopeTime()))
# 2. Get a object identifier for the
# folder in which you want to place
# the object. In this example, I place
# the name of the folder in an attribute
# of the Portal root called 'docStorage'
dfn = portal.docStorage
docFolder = getattr(context, hfn)
# 3. Create the document and get a
# handle to the new object
# The parameter 'docType' is a text
# representation of the type of object
# you with to create (e.g., 'File')
context.portal_types.constructContent(docType, docFolder, ts)
newDoc = docFolder[ts]
# 4. Edit the documents metadata
# These values will most like come from your
# custom document entry form
newDoc.editMetadata( title=docTitle
, description=desc
, subject=caseID
, contributors=contributor
, effective_date=pubDate.strftime("%Y/%m/%d")
)
# 5. Add properties, if desired
newDoc.manage_addProperty('test', test, 'text')
#6. If there is a file associated with the document,
# attach it to the document here.
newDoc.edit(file=filename)
# 7. Let the catalog know about the changed object
newDoc.reindexObject()
Hope that helps!
Kevin
-----Original Message-----
From: cd@kompetenzplus.de [mailto:cd@kompetenzplus.de]
Sent: Saturday, August 10, 2002 11:36 AM
To: Kevin Carlson
Subject: AW: [Zope-CMF] Eliminating the /Members directory?
Hi,
I would like to know, how you did that! That posting would be very
interesting.
Christian
-----Ursprüngliche Nachricht-----
Von: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]Im Auftrag
von Kevin Carlson
Gesendet: Samstag, 10. August 2002 06:06
An: David Elfstrom
Cc: Zope-CMF@zope.org
Betreff: RE: [Zope-CMF] Eliminating the /Members directory?
Another option you have is to handle the entire document creation process
yourself. For example:
- programmatically create an ID for the document
- call constructContent
- call editMetadata after the fact
I have used this strategy to create a "repository" based instance of CMF
that doesn't expose any member-based path information in the URLS. If you
would like code to go with the rather lame instructions above, please let me
know and I will post them to the list.
Kevin
-----Original Message-----
From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
Of Tres Seaver
Sent: Friday, August 09, 2002 6:31 PM
To: David Elfstrom
Cc: Zope-CMF@zope.org
Subject: Re: [Zope-CMF] Eliminating the /Members directory?
On Fri, 2002-08-09 at 14:42, David Elfstrom wrote:
> I'm wondering what can be done to eliminate the /Members directory in the
CMF.
>
> Basically I want to have people be able to contribute documents, news
> items, articles, and other document types, but I don't want those
documents
> to be stored in the /Members/username -- I want them to be stored in /news
> and /articles and /policies. User accounts should be able to come and go,
> but what the user creates should stay. Does this make sense? Has anyone
> else done this with the CMF, or did you just roll-your-own content
> management system in Zope?
Two things:
- Turn off member folder creation in the membership tool; members
won't have the folder.
- Give the users the "Owner" local role in the specific folders
where you want them to add content.
That's it.
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com
_______________________________________________
Zope-CMF maillist - Zope-CMF@zope.org
http://lists.zope.org/mailman/listinfo/zope-cmf
See http://collector.zope.org/CMF for bug reports and feature requests
_______________________________________________
Zope-CMF maillist - Zope-CMF@zope.org
http://lists.zope.org/mailman/listinfo/zope-cmf
See http://collector.zope.org/CMF for bug reports and feature requests