Show:      

ConvertController

Signature
global with sharing class ConvertController

ConvertController Methods

convert(data)

Convenient method that converts a DocConfig and returns the ContentVersionId or AttachmentId
Signature
webService static String convert(ConvertDataModel data)
Parameters
data
Type: ConvertDataModel
ConvertDataModel instance to use
Returns
ContentVersionId or AttachmentId (dependent on Delivery Type on DocConfig)
See
Example
 cadmus_core.ConvertController.convert(data);

convertAura(data)

Signature
@AuraEnabled
global static String convertAura(ConvertDataModel data)

convertStandaloneDocToPDF(fileName, document, pdfAction)

Signature
@AuraEnabled
global static String convertStandaloneDocToPDF(String fileName,Blob document,String pdfAction)

convertToDocx(docConfigId, objectId)

Signature
webService static String convertToDocx(Id docConfigId, Id objectId)
Deprecated
use cadmus_core.ConvertController.convertWithWrapper(data)

convertToDocxAura(docConfigId, objectId)

Signature
@AuraEnabled
global static String convertToDocxAura(Id docConfigId, Id objectId)

convertToPdf(docConfigId, objectId)

Signature
webService static String convertToPdf(Id docConfigId, Id objectId)
Deprecated
use cadmus_core.ConvertController.convertWithWrapper(data)

convertToPdfAura(docConfigId, objectId)

Signature
@AuraEnabled
global static String convertToPdfAura(Id docConfigId, Id objectId)
Deprecated
use cadmus_core.ConvertController.convertWithWrapper(data)

convertWithWrapper(data)

Convert DocConfig or Pack defined in the ConvertDataModel
Signature
webService static DocGenerationWrapper convertWithWrapper(ConvertDataModel data)
Parameters
data
Type: ConvertDataModel
ConvertDataModel instance to use
Returns
DocGenerationWrapper
See
Example
 cadmus_core.ConvertController.ConvertDataModel cdm = new cadmus_core.ConvertController.ConvertDataModel(); 
 cdm.objectId = YOUR_RECORD_ID; //this must be the Id of the record you want to generate from eg an Opportunity Id 
 cdm.docConfigId = YOUR_DOCCONFIG_ID; //the Id of the DocConfig you want to use in your generation, you can also choose to fill the cdm.packId parameter. Then then docConfigId is not required 
 cadmus_core.DocGenerationWrapper wrapper = cadmus_core.ConvertController.convertWithWrapper(cdm); 
 //Get the name of the generated file: wrapper.response.metadata.targetName 
 //Get the generated file (Blob): wrapper.response.base64

convertWithWrapperAndInputMap(data, inputMap)

Convert DocConfig or Pack defined in the ConvertDataModel
Signature
global static DocGenerationWrapper convertWithWrapperAndInputMap(ConvertDataModel data, Map<String, Object> inputMap)
Parameters
data
Type: ConvertDataModel
ConvertDataModel instance to use
inputMap
Type: Map<String, Object>
Map<String, Object) Map that can include extra key/value datasources, parameters for SOQL DataSources, ...
Returns
DocGenerationWrapper
See
Example
 cadmus_core.ConvertController.convertWithWrapper(data);

ConvertController.ConvertDataModel

Class to capture all required convert data
Signature
global with sharing class ConvertDataModel
Example
 cadmus_core.ConvertController.ConvertDataModel cdm = new cadmus_core.ConvertController.ConvertDataModel();

ConvertController.ConvertDataModel Properties

Name Signature Description
alternativeName
webService String alternativeName
Which Alternative on your DocConfig to use
country
webService String country
Country, only used for DateTime formatting
deliveryOverwrite
webService String deliveryOverwrite
Use this Delivery instead of the one specified on the DocConfig.
Values: 'BASE64', 'FILES','FILES_OVERWRITE', 'FILES_ADD_VERSION', 'ATTACHMENTS', 'ATTACHMENTS_OVERWRITE'
docConfigId
webService Id docConfigId
SFDC Id of the DocConfig. Required when not specifying 'packId' or 'docConfigIds'
docConfigIds
webService List<Id> docConfigIds
Required! If you want to overwrite the DocConfigs in the Pack. List the DocConfig Ids here. A packId is also required
language
webService String language
Language, used for translation (eg TRANSLATION PICKLIST DataSource). By default, the first part of the locale is used. eg de_DE => de
locale
webService String locale
Which Locale to use. Locale is a combination of language and country. eg en_US, fr_CA, fr_BE, de_DE, de_AT
numCurrLocale
webService String numCurrLocale
Which Locale to use for Number and Currency formatting. eg en_US, fr_CA, fr_BE, de_DE, de_AT
objectId
webService Id objectId
Required! Record Id in which the convert process has to work
packId
webService Id packId
Id of the PDF Butler pack. Required when no DocConfigId is given
parameters
webService CadmusParameters parameters
There parameters are extra variables that can be used in the DataSources
pdfActionType
webService String pdfActionType
Merge the PDF's or not. In a pack or with Additional PDF's. Values: 'MERGE' or 'NONE'
targetType
webService String targetType
Export type, only used for DOCX convert. Values: PDF, DOCX
timeZone
webService String timeZone
only used for DateTime formatting