Show / Hide Table of Contents

Class PhysicalDocumentTemplate

Wraps the stream access to the document template contents. Primarily for access to Mail Templates. See also PhysicalDocument

Inheritance
Object
DocumentBase
PhysicalDocumentTemplate
Inherited Members
DocumentBase.ImpersonateUser()
DocumentBase.RevertUser()
DocumentBase.FileExtension
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.CRM.Documents
Assembly: SoDataBase.dll
Syntax
public class PhysicalDocumentTemplate : DocumentBase

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, Boolean)

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")

Boolean 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 override Stream Load()
Returns
Type Description
Stream

Stream to read the document template from.

Overrides
DocumentBase.Load()

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 override void Save(Stream template)
Parameters
Type Name Description
Stream template

Stream to read the document template from. Closes the stream when finished.

Overrides
DocumentBase.Save(Stream)
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.

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top