def get_document_metadata(document):
    """ Get Document Metadata

        Given a document, return a dictionary of
        values: title, size (in KB) and content-type.
    """
    assert document, "No document provided"

    doc_title = document.title_or_id()
    doc_size = document.get_size() / 1024
    doc_content = document.getContentType()

    retval = {
        'title' : doc_title,
        'size'  : doc_size,
        'type'  : doc_content
    }
    return retval