Class PhysicalDocumentTemplate
Wraps the stream access to the document template contents. Primarily for access to Mail Templates. See also PhysicalDocument
Inherited Members
Namespace: SuperOffice.CRM.Documents
Assembly: SoDataBase.dll
Syntax
public class PhysicalDocumentTemplate
Properties
DocumentTemplateInfo
Return the document template info passed to constructor. NULL if mail template path was passed to constructor.
Declaration
public IDocumentTemplateInfo DocumentTemplateInfo { get; }
Property Value
Type | Description |
---|---|
IDocumentTemplateInfo |
Methods
GetDocumentTemplate(IDocumentTemplateInfo)
Get a document template - stored in SO_ARC or similar.
Declaration
public static PhysicalDocumentTemplate GetDocumentTemplate(IDocumentTemplateInfo documentTemplateInfo)
Parameters
Type | Name | Description |
---|---|---|
IDocumentTemplateInfo | documentTemplateInfo | AutoEventId and DocumentStoredInPluginId values |
Returns
Type | Description |
---|---|
PhysicalDocumentTemplate | Object with access to template streams |
GetDocumentTemplate(string, bool)
Get a mail template based on filename
Declaration
public static PhysicalDocumentTemplate GetDocumentTemplate(string templateName, bool allowPersonal)
Parameters
Type | Name | Description |
---|---|---|
string | templateName | filename of template (e.g. "mail.htm") |
bool | allowPersonal | If true, look for personal template in user area |
Returns
Type | Description |
---|---|
PhysicalDocumentTemplate | Object with access to template streams |
Load()
Load a template based on information provided about it
Declaration
public Stream Load()
Returns
Type | Description |
---|---|
Stream | Stream to read the document template from. |
Load(string)
Load a template based on information provided about it
Declaration
public Stream Load(string culture)
Parameters
Type | Name | Description |
---|---|---|
string | culture | Language code for template. "nb-NO" or NULL for default. |
Returns
Type | Description |
---|---|
Stream | Stream to read the document template from. |
Save(Stream)
Save a document or mail template based on information about it (e.g. DocumentTemplateInfo). Saves to the default template - not a language specific variant.
Declaration
public void Save(Stream template)
Parameters
Type | Name | Description |
---|---|---|
Stream | template | Stream to read the document template from. Closes the stream when finished. |
Remarks
If the document template file does not exist from before, the document template file is created. Does not provide a language code. i.e. only saves default templates.
Save(Stream, string)
Save a template based on information about it (e.g. DocumentTemplateInfo).
Declaration
public void Save(Stream template, string culture)
Parameters
Type | Name | Description |
---|---|---|
Stream | template | Stream to read the document template from. Closes the stream when finished. |
string | culture | Language variant of the template to save to. "nb-NO" or NULL for default. |
Remarks
If the document template file does not exist from before, the document template file is created. Does not provide a language code. i.e. only saves default templates.