Menu

#246 Entity Thumbnail images

0.49
open
nobody
enhancement (3)
Protocol
Enhancement
2016-07-14
2014-07-03
grwebguy
No

Delighted to see that the thumbnail request (/thumb) for a contact image brought up the contact image, or a generic vcf icon, as it brings up a thumbnail for a file!

It would be excellent for a generic ogo object viewer implementation to have a default icon for any (or at least first class) entity.

Discussion

  • Adam Tauno Williams

    Currently Implemented (2014-07)

    • [Folder] maps to FolderThumb which returns the icon for MIME-type "inode/directory". As FolderThumb is essentially a static image - all folder's get the same thumbnail - so the etag seen on all folder thumbnails will be the same.
    • [Document] maps to DocumentThumb which attempts first to return a pre-rendered thumbnail for the document (assuming one was prepared by the "coils.blob.thumb" component on the event bus). Failing that it falls back to trying to find a corresponding MIME-type icon from Project 7,000's "Thumbnails" folder. Failing that fall-back (perhaps no MIME-type icon has been loaded for that MIME type) it attempts as a last resort to use the icon for MIME-type "application/octet-stream".
    • [Contact] maps to ContactThumb which utilizes the 'contact::get-photo-handle' Logic command to marshal an image related to the contact. Contact photos are resized within the protocol bundle - so resizing support must be available or a full-sized contact photo may be returned to the client.

    Caveats

    Note that availability of a thumbnail is always limited by:

    • Permissions to manifest the entity. The protocol bundle utilizes the [Typemanager]'s get_entity method to attempt to retrieve the entity corresponding to the object id specified in the URL. If an entity is marshaled the protocol passes it on to the mapped handler, if no entity is marshaled an HTTP/404 is returned. If the marshaled entity has no handler an HTTP/501 (Not Supported) is returned.
    • The ability to resize an image to depends on the provisioning of the PIL, or an equivalent, module. As of 2013 the recommended provisioning is the Pillow module.

    Missing

    • [Enterprise] - just use "text/vcard"? there is not a specified MIME-type for an "Organization" ICS representation. All current mapping corresponds to industry standard MIME-types. Otherwise we just use a custom x-style MIME-type. Perhaps "application/x-application-enterprise".
    • [Project] - Probably the only option is to use a custom MIME-type "application/x-opengroupware-project".
    • [Team] - Check for an "application/x-opengroupware-team", fallback to "text/vcard".
    • [Appointment] - MIME-type "text/calendar"
    • [Task] - Check for an "application/x-opengroupware-task", fallback to "text/calendar".
    • [Note] - Check for an "application/x-opengroupware-note", fallback to "text/calendar".
    • [Resource] - MIME-type "application/x-opengroupware-resource", fallback to "text/calendar".
    • [Route] - MIME type "application/xml+bpml", fallback to "application/xml".
    • [Process] - Use BPML type, same as [Route], or hi-jack the old "application/exe" type.
    • [RouteGroup] - Certainly an entirely vertical concept, use "application/x-opengroupware-routegroup".

    There is no way to reference an [Attachment] or [Message] via the /thumb protocol. And transient entities such as [ApplicationAlert] are not relevant.

     

    Related

    Wiki: ApplicationAlert
    Wiki: Appointment
    Wiki: Attachment
    Wiki: Contact
    Wiki: Document
    Wiki: Enterprise
    Wiki: Folder
    Wiki: Process
    Wiki: Project
    Wiki: Resource
    Wiki: Route
    Wiki: RouteGroup
    Wiki: Task
    Wiki: Team

  • Adam Tauno Williams

    2014-12-16 20:39:44,295 31445 http Thumbnails not implemented for entity type "Task"
    Traceback (most recent call last):
      File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc89-py2.6.egg/coils/net/http_handler.py", line 195, in process_request
        handler = self.marshall_handler(root, url)
    File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc89-py2.6.egg/coils/net/http_handler.py", line 175, in marshall_handler
    urllib.unquote(path_elements[i]),
    File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc89-py2.6.egg    /coils/protocol/thumb/root.py", line 79, in object_for_key
    format(kind, )
    NotSupportedException: Thumbnails not implemented for entity type "Task"
    
     
  • Adam Tauno Williams

    • Layer: --> Protocol
    • Type: --> Enhancement
     

Log in to post a comment.

MongoDB Logo MongoDB