|
|
|
|
308
|
def allowed_dim_preview_jpg(self, context, request: TracimRequest, hapic_data=None):
|
308
|
def allowed_dim_preview_jpg(self, context, request: TracimRequest, hapic_data=None):
|
309
|
raise NotImplemented()
|
309
|
raise NotImplemented()
|
310
|
|
310
|
|
311
|
- # @hapic.with_api_doc(tags=[FILE_ENDPOINTS_TAG])
|
|
|
312
|
- # @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
|
|
|
313
|
- # @require_content_types([file_type])
|
|
|
314
|
- # @hapic.input_path(WorkspaceAndContentIdPathSchema())
|
|
|
315
|
- # #@hapic.output_file([])
|
|
|
316
|
- # def get_file_preview_info(self, context, request: TracimRequest, hapic_data=None): # nopep8
|
|
|
317
|
- # # TODO - G.M - 2018-07-05 - Do this endpoint
|
|
|
318
|
- # app_config = request.registry.settings['CFG']
|
|
|
319
|
- # preview_manager = PreviewManager(app_config.PREVIEW_CACHE_DIR, create_folder=True) # nopep8
|
|
|
320
|
- # api = ContentApi(
|
|
|
321
|
- # current_user=request.current_user,
|
|
|
322
|
- # session=request.dbsession,
|
|
|
323
|
- # config=app_config,
|
|
|
324
|
- # )
|
|
|
325
|
- # content = api.get_one(
|
|
|
326
|
- # hapic_data.path.content_id,
|
|
|
327
|
- # content_type=ContentType.Any
|
|
|
328
|
- # )
|
|
|
329
|
- # file_path = api.get_one_revision_filepath(content.revision_id)
|
|
|
330
|
- # return {
|
|
|
331
|
- # 'nb_pages': preview_manager.get_page_nb(file_path),
|
|
|
332
|
- # 'pdf_preview': preview_manager.has_pdf_preview(file_path),
|
|
|
333
|
- # 'mimetype': preview_manager.get_mimetype(file_path),
|
|
|
334
|
- # }
|
|
|
335
|
-
|
|
|
336
|
# File infos
|
311
|
# File infos
|
337
|
@hapic.with_api_doc(tags=[FILE_ENDPOINTS_TAG])
|
312
|
@hapic.with_api_doc(tags=[FILE_ENDPOINTS_TAG])
|
338
|
@require_workspace_role(UserRoleInWorkspace.READER)
|
313
|
@require_workspace_role(UserRoleInWorkspace.READER)
|