[
https://issues.apache.org/jira/browse/CMIS-295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996644#comment-12996644
]
Jeff Potts commented on CMIS-295:
---------------------------------
It looks like you are using Alfresco as the back-end. In Alfresco, the
description property (cm:description) is part of an aspect called cm:titled.
The CMIS spec lacks support for aspects, but apparently there is a way to
get/set aspect props via policies. At this time, however, cmislib lacks policy
support.
> Unable to set or retrieve Document "description" property a.k.a "summary"
> -------------------------------------------------------------------------
>
> Key: CMIS-295
> URL: https://issues.apache.org/jira/browse/CMIS-295
> Project: Chemistry
> Issue Type: Bug
> Components: python-cmislib
> Environment: using revision 1038521
> Reporter: Bernhard Reutner-Fischer
> Priority: Critical
>
> I want to createDocument and store a "Document description".
> And i want to retrieve that description.
> There is no way i can see to pass in the description.
> When i manually set a description for a document in the underlying CMS then i
> cannot access that description anywhere in the properties!
> The only spot where that description show up in the retrieved document is in
> it's XML-representation, as "<summary>" field, which is really, really
> inconvenient :)
> So, both storing as well as retrieving the document description would be
> great to have!
> TIA && cheers,
> Gory details:
> The creation looks something like this, for reference:
> upload_form = DocumentUploadForm(request.POST, request.FILES)
> if request.POST.get(u'add_document') and upload_form.is_valid():
> # we now have a
> django.core.files.uploadedfile.InMemoryUploadedFile
> # Note: major takes a string, not a bool! # FIXME!
> checkin_props = {u'major' : u'major_change' in request.POST and
> 'true' or 'false',
> u'properties' : {u'cmis:description' :
> request.POST.get(u'document_description')}
> }
> ret = create(request, path, request.FILES['document'],
> auto_revision=True, checkin_props)
> def create(request, foldername, filename, auto_revision=False,
> checkin_props={}):
> repo = alf_Client(request, foldername + u'/' + filename.name)
> checkinComment, doc_props = (None, None)
> if u'checkinComment' in checkin_props:
> checkinComment = checkin_props.pop(u'checkinComment')
> if u'properties' in checkin_props:
> doc_props = checkin_props.pop(u'properties')
> if auto_revision:
> try:
> old = repo.fetch_path(unicode(foldername + u'/' + filename.name))
> except cmislib.exceptions.ObjectNotFoundException:
> pass # just create a new one
> else:
> # create new revision. Omitted for brevity
> alf_dir_rs, err = repo.fetch(foldername)
> if err:
> return err
> filename.open('rb')
> try:
> doc = alf_dir_rs.createDocument(filename.name,
> properties=doc_props,
> contentFile=filename,
> contentType=filename.content_type)
> except:
> # handler omitted for brevity
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira