[CMF-checkins] CVS: CMF - metadata_edit.py:1.1 metadata_edit_form.dtml:1.3 metadata_edit.dtml:NONE
tseaver@digicool.com
tseaver@digicool.com
Wed, 30 May 2001 18:00:25 -0400 (EDT)
Update of /cvs-repository/CMF/CMFDefault/skins/content
In directory korak.digicool.com:/tmp/cvs-serv16167/CMFDefault/skins/content
Modified Files:
metadata_edit_form.dtml
Added Files:
metadata_edit.py
Removed Files:
metadata_edit.dtml
Log Message:
- Replace 'metadata_edit' DTMLMethod with PythonScript.
- Update to avoid clearing values not passed in REQUEST (Tracker
issue #268).
- Remove spurious whitespace being added to Subject.
--- Added File metadata_edit.py in package CMF ---
## Script (Python) "metadata_edit"
##title=Update Content Metadata
##parameters=title=None,subject=None,description=None,contributors=None,effective_date=None,expiration_date=None,format=None,language=None,rights=None
def tuplify( value ):
if not same_type( value, () ):
value = tuple( value )
temp = filter( None, value )
return tuple( temp )
if title is None:
title = context.Title()
if subject is None:
subject = context.Subject()
else:
subject = tuplify( subject )
if description is None:
description = context.Description()
if contributors is None:
contributors = context.Contributors()
else:
contributors = tuplify( contributors )
if effective_date is None:
effective_date = context.EffectiveDate()
if expiration_date is None:
expiration_date = context.expires()
if format is None:
format = context.Format()
if language is None:
language = context.Language()
if rights is None:
rights = context.Rights()
context.editMetadata( title=title
, description=description
, subject=subject
, contributors=contributors
, effective_date=effective_date
, expiration_date=expiration_date
, format=format
, language=language
, rights=rights
)
if context.REQUEST.get( 'change_and_edit', 0 ):
action_id = 'edit'
elif context.REQUEST.get( 'change_and_view', 0 ):
action_id = 'view'
else:
action_id = 'metadata'
action_path = context.getTypeInfo().getActionById( action_id )
action_method = context.restrictedTraverse( action_path )
return action_method( context
, context.REQUEST
, portal_status_message='Metadata changed.'
)
--- Updated File metadata_edit_form.dtml in package CMF --
--- metadata_edit_form.dtml 2001/05/29 18:59:54 1.2
+++ metadata_edit_form.dtml 2001/05/30 22:00:25 1.3
@@ -63,7 +63,7 @@
><dtml-let item=sequence-item
><dtml-unless expr="item in allowedSubjects"
><dtml-var sequence-item>
- </dtml-unless></dtml-let></dtml-in></textarea>
+</dtml-unless></dtml-let></dtml-in></textarea>
<dtml-comment>
Comment out / delete this to ignore controlled vocabulary
for Subject.
--- Removed file metadata_edit.dtml from package CMF --