chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Potts (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CMIS-295) Unable to set or retrieve Document "description" property a.k.a "summary"
Date Tue, 22 Feb 2011 19:49:38 GMT

     [ https://issues.apache.org/jira/browse/CMIS-295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jeff Potts resolved CMIS-295.
-----------------------------

    Resolution: Not A Problem
      Assignee: Jeff Potts

This appears to be a server-specific problem not related to the client library.

> 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
>            Assignee: Jeff Potts
>            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

        

Mime
View raw message