Hans Karlsen (talk | contribs) No edit summary |
Charles Olet (talk | contribs) No edit summary |
||
(21 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
SysDocBatch is a model pattern recognized by TurnkeyServer and MDrivenServer. | <message>Describe what a SysDoc is and what it does. Explain SysDocBatch further, giving details on how to do the document conversion in steps. </message> | ||
<u>SysDoc</u>: Sys = system i.e. MDriven built-in feature. <u>Doc</u> = document. | |||
Together: a system pattern for how to handle documents in batches. | |||
'''SysDocBatch''' is a model pattern recognized by TurnkeyServer and WPF-Wecpof (MDrivenServer can zip and convert). | |||
We suggest you keep the SysDocBatch and SysDoc classes transient. | |||
This Pattern is mergable from the GitHub repository: [https://github.com/supportMDriven/MDrivenComponents supportMDriven/MDrivenComponents (github.com)] | |||
The problem it solves is document collections, conversions, zipping and controlled download of reports and other documents. | The problem it solves is document collections, conversions, zipping and controlled download of reports and other documents. | ||
Normally when you generate a report it will directly download as | Normally when you generate a report, it will directly download as an odt or ods formated file. What the SysDocBatch-functionality changes to this behavior is that If a SysSingleton.oclSingleton.CurrentSysDocBatch object is set, we now instead add a SysDoc-object to the SysSingleton.oclSingleton.CurrentSysDocBatch.SysDocs association, thus not triggering the download immediately - but rather build up a batch of documents that may be zipped or converted prior to a later download triggered by the developer or the user. | ||
If a SysSingleton.oclSingleton.CurrentSysDocBatch is | |||
On the first added SysDoc, we will show the SysDocBatchView ViewModel (rooted in SysDocBatch) as a Modal window. | |||
This will enable you to collect a list of possible | This will enable you to collect a list of many possible documents that you need to print (if your action generates multiple reports, multiple SysDoc objects are created). | ||
The SysDocBatchView | The SysDocBatchView ViewModel is a good place to possibly offer to convert documents to pdf or docx (read more on [[Documentation:Use LibreOffice for PDF conversion|Using LibreOffice for this task]]). | ||
You can also make use of the new [[selfVM]] operators for Zipping and Downloading: | You can also make use of the new [[selfVM]] operators for Zipping and Downloading: | ||
vData:=selfVM.SysDocBatchZip( self ) | vData:=selfVM.SysDocBatchZip( self ) | ||
selfVM.Download( 'Somefile.zip' | selfVM.Download( 'Somefile.zip' , vData ) | ||
[[File: | [[File:2024-06-05 11h06 50.png|none|thumb|712x712px]] | ||
==== '''SysDoc Attributes''' ==== | |||
<code>ConversionLog</code>''': Text''' | |||
Message log from LibreOffice on the document conversion | |||
<code>DocData</code>''': Blob''' | |||
Document data required for conversion | |||
<code>DocDirectory</code>''': String''' | |||
Name of the folder to be used when organizing files in zip document. | |||
<code>DocName</code>''': String''' | |||
Name to be assigned to file including file extension for example .odt for open text document. | |||
<code>InfoOnFailed</code>''': String''' | |||
Exception message when file conversion fails. |
Latest revision as of 20:26, 19 September 2024
SysDoc: Sys = system i.e. MDriven built-in feature. Doc = document.
Together: a system pattern for how to handle documents in batches.
SysDocBatch is a model pattern recognized by TurnkeyServer and WPF-Wecpof (MDrivenServer can zip and convert).
We suggest you keep the SysDocBatch and SysDoc classes transient.
This Pattern is mergable from the GitHub repository: supportMDriven/MDrivenComponents (github.com)
The problem it solves is document collections, conversions, zipping and controlled download of reports and other documents.
Normally when you generate a report, it will directly download as an odt or ods formated file. What the SysDocBatch-functionality changes to this behavior is that If a SysSingleton.oclSingleton.CurrentSysDocBatch object is set, we now instead add a SysDoc-object to the SysSingleton.oclSingleton.CurrentSysDocBatch.SysDocs association, thus not triggering the download immediately - but rather build up a batch of documents that may be zipped or converted prior to a later download triggered by the developer or the user.
On the first added SysDoc, we will show the SysDocBatchView ViewModel (rooted in SysDocBatch) as a Modal window.
This will enable you to collect a list of many possible documents that you need to print (if your action generates multiple reports, multiple SysDoc objects are created).
The SysDocBatchView ViewModel is a good place to possibly offer to convert documents to pdf or docx (read more on Using LibreOffice for this task).
You can also make use of the new selfVM operators for Zipping and Downloading:
vData:=selfVM.SysDocBatchZip( self ) selfVM.Download( 'Somefile.zip' , vData )
SysDoc Attributes
ConversionLog
: Text
Message log from LibreOffice on the document conversion
DocData
: Blob
Document data required for conversion
DocDirectory
: String
Name of the folder to be used when organizing files in zip document.
DocName
: String
Name to be assigned to file including file extension for example .odt for open text document.
InfoOnFailed
: String
Exception message when file conversion fails.