## Script (Python) "plinndocument_edit"
##parameters=text='', file='', SafetyBelt='', **kw
##title=Edit a document
##

from Products.CMFDefault.exceptions import EditingConflict, ResourceLockedError

if text != context.text :
	try:
		context.edit( 'html', text, file, safety_belt = SafetyBelt)
		return context.setStatus(True, 'Document changed.')
	except (ResourceLockedError, EditingConflict), msg:
		return context.setStatus(False, msg)
else :
	return context.setStatus(False, 'Nothing to change.')
