Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
1
Share

RichTextFileService

Service to store file assosicated to a rich text (note, note template)

Files are stored in the 'note' directory in the data directory For each object (note, note template), a directory (from id) is created to store the files

Path example : data_dir/note/note/{note_id}/filename

The object type is a plain str (not a :class:RichTextObjectType) so that other bricks can scope their own rich text files without extending the enum: gws_project stores the images of a project document under the project_document object type. :class:RichTextObjectType inherits str, so its members can still be passed directly.

:return: [description] :rtype: [type]

Functions
copy_object_dir @classmethod
source_object_type : str
source_object_id : str
target_object_type : str
target_object_id : str
create_object_dir @classmethod
object_type : str
object_id : str
delete_object_dir @classmethod
object_type : str
object_id : str
get_figure_file_path @classmethod
object_type : str
object_id : str
filename : str
Return type : str
get_file_view @classmethod
object_type : str
object_id : str
filename : str
Return type : CallViewResultDTO
get_object_dir_path @classmethod

Return the directory storing the files of an object.

object_type : str
Type of the object owning the files. A
object_id : str
Id of the object owning the files
Return type : str
get_object_file_path @classmethod

Return the path of a file of an object, checking that it stays inside the object dir.

object_type : str
Type of the object owning the file
object_id : str
Id of the object owning the file
filename : str
Name of the file, without any directory component
Return type : str
get_uploaded_file_path @classmethod
object_type : str
object_id : str
filename : str
Return type : str
save_file_view @classmethod
object_type : str
object_id : str
view_result : CallViewResultDTO
Return type : str
save_image @classmethod

Method to save the image of a note to the file system

object_type : str
object_id : str
image : Image
_description_
extension : str
_description_
Return type : RichTextUploadImageResultDTO
upload_file @classmethod
object_type : str
object_id : str
upload_file : UploadFile
Return type : RichTextUploadFileResultDTO
upload_image @classmethod
object_type : str
object_id : str
file : UploadFile
Return type : RichTextUploadImageResultDTO
write_file @classmethod
object_type : str
object_id : str
file_content : Any
filename : str
mode : str
Return type : RichTextUploadFileResultDTO
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.