add possibility for predefined keywords (#22009)
This commit is contained in:
parent
85603bbc6e
commit
dfc266661a
|
@ -29,6 +29,7 @@ class IImportFileFormSchema(form.Schema):
|
|||
location = schema.Text(required=False)
|
||||
owner = schema.Text(required=False)
|
||||
treating_group = schema.Text(required=False)
|
||||
keywords = schema.Text(required=False) # comma separated identifiers
|
||||
|
||||
|
||||
class ImportFileForm(form.SchemaForm):
|
||||
|
@ -72,9 +73,13 @@ class ImportFileForm(form.SchemaForm):
|
|||
owner = data['owner']
|
||||
treating_group = data['treating_group']
|
||||
folder = self.get_folder(data['location'])
|
||||
keywords = set([x.strip() for x in data['keywords'].split(',')])
|
||||
|
||||
document_id = self.convertTitleToId(data.get('title') or os.path.splitext(filename)[0])
|
||||
|
||||
utils.createDocument(self, folder, portal_type, document_id,
|
||||
filename, data['file'], owner, treating_group=treating_group,
|
||||
metadata={'title': data.get('title')})
|
||||
metadata={
|
||||
'title': data.get('title'),
|
||||
'keywords': keywords,
|
||||
})
|
||||
|
|
Reference in New Issue