Menu

#341 Retrieve LinkPath with zOGI

0.49
accepted
Protocol
Enhancement
2019-12-05
2019-12-04
grwebguy
No

Seems like both vista and getObject could benefit from the ability to retrieve information about a document heirarchy/path/dav uri like '/Projects/General%20Documents/Documents'
Currently parent project and folder id's are exposed.

Discussion

  • Adam Tauno Williams

    It would seem the best option would be to add the ogo_uri attribute to the Omphalos presentation of Document (aka: File)

    >>> >>> from coils.core import *
    >>> initialize_COILS()
    SMTP EHLO HACK installed
    >>> ctx = AdministrativeContext()
    >>> d = ctx.r_c('document::get', id=1060141409)
      document::get 0.190720081329s
    >>> dir(d)
    ['__class__', '__delattr__', '__dict__', '__doc__', '__entityName__', '__format__', '__getattribute__', '__hash__', '__init__', '__internalName__', '__mapper__', '__mapper_args__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__table__', '__tablename__', '__weakref__', '_decl_class_registry', '_entity_name', '_is_folder', '_is_link', '_sa_class_manager', '_sa_instance_state', '_version', 'abstract', 'acls', 'appointment_id', 'checksum', 'company_id', 'create_version', 'created', 'creator_id', 'document', 'extension', 'file_size', 'folder', 'folder_entity_path', 'folder_id', 'folder_id_path', 'folder_name_path', 'get_display_name', 'get_file_name', 'get_mimetype', 'info', 'keyed_values', 'locks', 'logs', 'metadata', 'mimetype', 'modified', 'name', 'object_id', 'ogo_uri', 'owner_id', 'project', 'project_id', 'properties', 'set_file_size', 'skyfs_path_to_version', 'state', 'status', 'subvalues_for_key', 'take_values', 'translate_dict', 'translate_key', 'version', 'version_count', 'versions']
    >>> d.folder_entity_path
    [<Folder objectId=944569949 version=1 name="Equipment Manuals" project=944569929 owner=10100 folder="None"/>, <Folder objectId=1055214559 version=1 name="Manufacturers" project=944569929 owner=10100 folder="944569949"/>, <Folder objectId=1057632939 version=1 name="Bobcat" project=944569929 owner=10100 folder="1055214559"/>]
    >>> d.folder_id_path
    [944569949, 1055214559, 1057632939]
    >>> d.folder_name_path
    [u'Equipment Manuals', u'Manufacturers', u'Bobcat']
    >>> d.metadata
    MetaData(bind=None)
    >>> d.ogo_uri
    'ogo://Equipment Manuals/Manufacturers/Bobcat/753 skid steer.pdf'
    >>> d.skyfs_path_to_version
    <bound method Document.skyfs_path_to_version of <Document objectId="1060141409" version="1" name="753 skid steer" extension="pdf" project="944569929" owner="10100"  folder="1057632939" created="20190327T16:40" modified="20190327T16:40" size="11055532" revisions="1"/>>
    
     
  • Adam Tauno Williams

    • labels: zOGI --> zOGI, Document, URI
    • status: open --> accepted
    • assigned_to: Adam Tauno Williams
    • Layer: Undefined --> Protocol
     
  • Adam Tauno Williams

    RPC2, JSON, & XML all are serializations of the Omphalos representation of an object; so adding the attribute to the Omphalos mapping will cause it to appear in all those serializations.

     

Log in to post a comment.

MongoDB Logo MongoDB