Exemplo n.º 1
0
class_permissions(Document, [
    PERMISSION_DOCUMENT_PROPERTIES_EDIT,
    PERMISSION_DOCUMENT_EDIT,
    PERMISSION_DOCUMENT_VIEW,
    PERMISSION_DOCUMENT_DELETE,
    PERMISSION_DOCUMENT_DOWNLOAD,
    PERMISSION_DOCUMENT_TRANSFORM,
    PERMISSION_DOCUMENT_NEW_VERSION,
    PERMISSION_DOCUMENT_VERSION_REVERT,
    PERMISSION_HISTORY_VIEW
])

document_search = SearchModel('documents', 'Document')
document_search.add_model_field('document_type__name', label=_(u'Document type'))
document_search.add_model_field('versions__mimetype', label=_(u'MIME type'))
document_search.add_model_field('versions__filename', label=_(u'Filename'))
document_search.add_model_field('metadata__metadata_type__name', label=_(u'Metadata type'))
document_search.add_model_field('metadata__value', label=_(u'Metadata value'))
document_search.add_model_field('versions__pages__content', label=_(u'Content'))
document_search.add_model_field('description', label=_(u'Description'))
document_search.add_model_field('tags__name', label=_(u'Tags'))
document_search.add_related_field('comments', 'Comment', 'comment', 'object_pk', label=_(u'Comments'))

namespace = StatisticNamespace(name='documents', label=_(u'Documents'))
namespace.add_statistic(DocumentStatistics(name='document_stats', label=_(u'Document tendencies')))
namespace.add_statistic(DocumentUsageStatistics(name='document_usage', label=_(u'Document usage')))

endpoint = APIEndPoint('documents')
endpoint.register_urls(api_urls)
endpoint.add_endpoint('document-list')
Exemplo n.º 2
0
    [
        {
            "name": _(u"thumbnail"),
            "attribute": encapsulate(
                lambda x: staging_file_thumbnail(x, gallery_name="staging_list", title=x.filename, size="100")
            ),
        }
    ],
)

register_setup(setup_sources)

register_links(
    [
        Document,
        "document_list_recent",
        "document_list",
        "document_create",
        "document_create_multiple",
        "upload_interactive",
        "staging_file_delete",
    ],
    [document_create_multiple],
    menu_name="secondary_menu",
)
register_links(Document, [document_create_siblings])

endpoint = APIEndPoint("sources")
endpoint.register_urls(api_urls)
endpoint.add_endpoint("stagingfolder-list", _(u"Returns a list of all the staging folders and the files they contain."))
Exemplo n.º 3
0
])

document_search = SearchModel('documents', 'Document')
document_search.add_model_field('document_type__name',
                                label=_(u'Document type'))
document_search.add_model_field('versions__mimetype', label=_(u'MIME type'))
document_search.add_model_field('versions__filename', label=_(u'Filename'))
document_search.add_model_field('metadata__metadata_type__name',
                                label=_(u'Metadata type'))
document_search.add_model_field('metadata__value', label=_(u'Metadata value'))
document_search.add_model_field('versions__pages__content',
                                label=_(u'Content'))
document_search.add_model_field('description', label=_(u'Description'))
document_search.add_model_field('tags__name', label=_(u'Tags'))
document_search.add_related_field('comments',
                                  'Comment',
                                  'comment',
                                  'object_pk',
                                  label=_(u'Comments'))

namespace = StatisticNamespace(name='documents', label=_(u'Documents'))
namespace.add_statistic(
    DocumentStatistics(name='document_stats', label=_(u'Document tendencies')))
namespace.add_statistic(
    DocumentUsageStatistics(name='document_usage', label=_(u'Document usage')))

endpoint = APIEndPoint('documents')
endpoint.register_urls(api_urls)
endpoint.add_endpoint('document-list',
                      _(u'Returns a list of all the documents.'))
Exemplo n.º 4
0
class_permissions(Document, [
    PERMISSION_DOCUMENT_PROPERTIES_EDIT,
    PERMISSION_DOCUMENT_EDIT,
    PERMISSION_DOCUMENT_VIEW,
    PERMISSION_DOCUMENT_DELETE,
    PERMISSION_DOCUMENT_DOWNLOAD,
    PERMISSION_DOCUMENT_TRANSFORM,
    PERMISSION_DOCUMENT_NEW_VERSION,
    PERMISSION_DOCUMENT_VERSION_REVERT,
    PERMISSION_HISTORY_VIEW
])

document_search = SearchModel('documents', 'Document')
document_search.add_model_field('document_type__name', label=_(u'Document type'))
document_search.add_model_field('versions__mimetype', label=_(u'MIME type'))
document_search.add_model_field('versions__filename', label=_(u'Filename'))
document_search.add_model_field('metadata__metadata_type__name', label=_(u'Metadata type'))
document_search.add_model_field('metadata__value', label=_(u'Metadata value'))
document_search.add_model_field('versions__pages__content', label=_(u'Content'))
document_search.add_model_field('description', label=_(u'Description'))
document_search.add_model_field('tags__name', label=_(u'Tags'))
document_search.add_related_field('comments', 'Comment', 'comment', 'object_pk', label=_(u'Comments'))

namespace = StatisticNamespace(name='documents', label=_(u'Documents'))
namespace.add_statistic(DocumentStatistics(name='document_stats', label=_(u'Document tendencies')))
namespace.add_statistic(DocumentUsageStatistics(name='document_usage', label=_(u'Document usage')))

endpoint = APIEndPoint('documents')
endpoint.register_urls(api_urls)
endpoint.add_endpoint('document-list', _(u'Returns a list of all the documents.'))
Exemplo n.º 5
0
    },
])

register_links(Tag, [tag_tagged_item_list, tag_edit, tag_delete, tag_acl_list])
register_multi_item_links(['tag_list'], [tag_multiple_delete])
register_links([Tag, 'tag_list', 'tag_create'], [tag_list, tag_create], menu_name='secondary_menu')
register_top_menu('tags', link={'text': _(u'tags'), 'view': 'tag_list', 'famfam': 'tag_blue'}, children_view_regex=[r'^tag_(list|create|delete|edit|tagged|acl)'])

register_links(Document, [tag_document_list], menu_name='form_header')
register_links(['document_tags', 'tag_remove', 'tag_multiple_remove', 'tag_attach'], [tag_attach], menu_name='sidebar')
register_multi_item_links(['document_tags'], [single_document_multiple_tag_remove])

register_multi_item_links(['document_find_duplicates', 'folder_view', 'index_instance_node_view', 'document_type_document_list', 'search', 'results', 'document_group_view', 'document_list', 'document_list_recent', 'tag_tagged_item_list'], [tag_multiple_attach, multiple_documents_selection_tag_remove])

class_permissions(Document, [
    PERMISSION_TAG_ATTACH,
    PERMISSION_TAG_REMOVE,
])

class_permissions(Tag, [
    PERMISSION_TAG_DELETE,
    PERMISSION_TAG_EDIT,
    PERMISSION_TAG_VIEW,
])

Document.add_to_class('tags', TaggableManager())

endpoint = APIEndPoint('tags')
endpoint.register_urls(api_urls)
endpoint.add_endpoint('tag-list', _(u'Returns a list of all the tags.'))
Exemplo n.º 6
0
register_links(['setup_web_form_list', 'setup_staging_folder_list', 'setup_watch_folder_list', 'setup_source_edit', 'setup_source_delete', 'setup_source_create'], [setup_sources, setup_source_create], menu_name='sidebar')

register_links(StagingFolder, [setup_web_form_list, setup_staging_folder_list], menu_name='form_header')
register_links(StagingFolder, [setup_source_transformation_list, setup_source_edit, setup_source_delete])

register_links(WatchFolder, [setup_web_form_list, setup_staging_folder_list, setup_watch_folder_list], menu_name='form_header')
register_links(WatchFolder, [setup_source_transformation_list, setup_source_edit, setup_source_delete])

# Document version
register_links(['document_version_list', 'upload_version', 'document_version_revert'], [upload_version], menu_name='sidebar')

register_links(['setup_source_transformation_create', 'setup_source_transformation_edit', 'setup_source_transformation_delete', 'setup_source_transformation_list'], [setup_source_transformation_create], menu_name='sidebar')

source_views = ['setup_web_form_list', 'setup_staging_folder_list', 'setup_watch_folder_list', 'setup_source_edit', 'setup_source_delete', 'setup_source_create', 'setup_source_transformation_list', 'setup_source_transformation_edit', 'setup_source_transformation_delete', 'setup_source_transformation_create']

register_model_list_columns(StagingFile, [
        {'name': _(u'thumbnail'), 'attribute':
            encapsulate(lambda x: staging_file_thumbnail(x, gallery_name='staging_list', title=x.filename, size='100'))
        },
    ])

register_setup(setup_sources)

register_links([Document, 'document_list_recent', 'document_list', 'document_create', 'document_create_multiple', 'upload_interactive', 'staging_file_delete'], [document_create_multiple], menu_name='secondary_menu')
register_links(Document, [document_create_siblings])

endpoint = APIEndPoint('sources')
endpoint.register_urls(api_urls)
endpoint.add_endpoint('stagingfolder-list')
Exemplo n.º 7
0
    'setup_source_create', 'setup_source_transformation_list',
    'setup_source_transformation_edit', 'setup_source_transformation_delete',
    'setup_source_transformation_create'
]

register_model_list_columns(StagingFile, [
    {
        'name':
        _(u'thumbnail'),
        'attribute':
        encapsulate(lambda x: staging_file_thumbnail(
            x, gallery_name='staging_list', title=x.filename, size='100'))
    },
])

register_setup(setup_sources)

register_links([
    Document, 'document_list_recent', 'document_list', 'document_create',
    'document_create_multiple', 'upload_interactive', 'staging_file_delete'
], [document_create_multiple],
               menu_name='secondary_menu')
register_links(Document, [document_create_siblings])

endpoint = APIEndPoint('sources')
endpoint.register_urls(api_urls)
endpoint.add_endpoint(
    'stagingfolder-list',
    _(u'Returns a list of all the staging folders and the files they contain.')
)