Login
Introduction Version

E-note resource

RESOURCE
Typing name :  RESOURCE.gws_core.ENoteResource Brick :  gws_core v
Parent :
Resource

Resource that contains a rich text that can be exported to a report

Base class

Views

VIEW E-NOTE - view_enote()Default view
View e-note content
VIEW RESOURCE - view_as_json()
View the complete resource as json

Functions















__INIT__

Constructor, please do not overwrite this method, use the init method instead Leave the constructor without parameters.

Parameters:
NameTypeDefault valueDescription
titlestr None
rich_textRichText None
ADD_HEADER

Add a header to the e-note content.

Parameters:
NameTypeDefault valueDescription
headerstr Header to add
levelRichTextParagraphHeaderLevel Header level
ADD_PARAGRAPH

Add a paragraph to the e-note content.

Parameters:
NameTypeDefault valueDescription
paragraphstr Paragraph to add
ADD_TECHNICAL_INFO

Add a technical information to the resource

Parameters:
NameTypeDefault valueDescription
technical_infoTechnicalInfo
ADD_VIEW

Add a view to the e-note content. To get the information of the views, once you opened the view in the application, you can click on View settings > Show view configuration

                if not, the view is append at the end of the enote, defaults to None
Parameters:
NameTypeDefault valueDescription
resourceResource Resource to call the view on
view_method_namestr Name of the view method to call
config_valuesDict None Config values for the views, defaults to none configparams, optional
titlestr None View title, defaults to none , optional
captionstr None View caption, defaults to none , optional
variable_namestr None If provided, the view replace the provided variable. , optional
APPEND_ENOTE

Append the content of another e-note at the end of the e-note content.

Parameters:
NameTypeDefault valueDescription
enoteENoteResource E-note to append
APPEND_RICH_TEXT

Append rich text at the end of the e-note content.

Parameters:
NameTypeDefault valueDescription
rich_textRichText Rich text to append
CHECK_RESOURCE

You can redefine this method to define custom logic to check this resource. If there is a problem with the resource, return a string that define the error, otherwise return None This method is called on output resources of a task. If there is an error returned, the task will be set to error and next proceses will not be run. It is also call when uploading a resource (usually for files or folder), if there is an error returned, the resource will not be uploaded

Return type:
Union[str, NoneType]
CLONE

Clone the resource to create a new instance with a new id. It copies the RFields.

Return type:
ResourceType
EXPORT_AS_REPORT

Export the note as a report.

Return type:
Report
GET_DEFAULT_NAME

You can redefine this method to set a name of the resource. When saving the resource the name will be saved automatically This can be useful to distinguish this resource from another one or to search for the resource

Return type:
str
GET_TECHNICAL_INFO

Get the technical information of the resource

Parameters:
NameTypeDefault valueDescription
keystr
Return type:
TechnicalInfo
INIT

This can be overwritten to perform custom initialization of the resource. This method is called just after the init (constructor) of the resource. The default values of RFields are set before this method is called.

REPLACE_VARIABLE

Replace a variable in the e-note content with text.

Parameters:
NameTypeDefault valueDescription
variable_namestr Variable name to replace
valuestr Value to replace the variable with