AMP.AnyModalPublish Class Reference

List of all members.


Detailed Description

This has a static constructor that is used to pre-load the resources needed in order to render documents. This preloading step is somewhat expensive, so please plan accordingly.

Many of the available methods are exposed primarily for the word plugin. There are really only two methods that you will need to consider:

This library no longer contacts cds whatsoever. All of the authentication logic has been removed and only stubs remain for compatibility with prior integrations.


Public Types

enum  Format { WordXMLDocument, DocX }

Public Member Functions

 AnyModalPublish (string cdsServer, string domain, string userName, string password)
 AnyModalPublish ()
byte[] CompileAMPTemplate (string wordTemplateXml, string debugDestination, string uiVersion)
byte[] Render (string CDA, string AMPTemplate, string debugDestination)
byte[] Render (byte[] CDA, byte[] AMPTemplate, string debugDestination)
byte[] RenderFromFile (string CdaFileName, string AMPTemplateFileName, string debugDestination)
bool testTemplate (byte[] template)

Static Public Member Functions

static XmlDocument UpgradeCDA (XmlDocument cda)
static string SaxonXpath (string xml, string xpath)
static string FormatCdaDate (string dateString)

Properties

Format OutputFormat [get, set]
string CdsServer [get, set]
string Domain [get, set]
string UserName [get, set]
string Password [get, set]


Member Enumeration Documentation

Used in setting the OutputFormat property. The available options are:

  • WordXMLDocument: This outputs in the Word 2007 .xml file format (wordProcessingML or wordML)
  • DocX: This outputs in the word 2007 .docx file format
.


Constructor & Destructor Documentation

AMP.AnyModalPublish.AnyModalPublish ( string  cdsServer,
string  domain,
string  userName,
string  password 
)

DEPRECATED - Authentication calls to CDS no longer occur in the rendering engine.

constructor. This will attempt to authenticate with cds during initialization.

Parameters:
cdsServer the cds server URI
domain your company identifier
userName cds username
password cds password

AMP.AnyModalPublish.AnyModalPublish (  ) 

constructor. If this constructor is used then you will need to set connectivity info prior to calling CompileAMPTemplate, Render, or RenderFromFile.


Member Function Documentation

byte [] AMP.AnyModalPublish.CompileAMPTemplate ( string  wordTemplateXml,
string  debugDestination,
string  uiVersion 
)

Generates an AMP template from a wordML file created via the AMP2 word plugin. This is mainly intended for use only by the word plugin's use.

Parameters:
wordTemplateXml the wordML to generate a template from
debugDestination location to write the AMP debug file. This can be null, if desired, and there will be no debug file created.
Returns:
AMP template

byte [] AMP.AnyModalPublish.Render ( string  CDA,
string  AMPTemplate,
string  debugDestination 
)

Renders the cda document using the formatting and layout defined in the AMPTemplate. This method expects the contents of the files to be sent as strings.

Parameters:
CDA The UTF-8 encoded contents of the cda file
AMPTemplate the UTF-8 encoded contents of the AMP template file
debugDestination location to write the AMP debug file. This can be null, if desired, and there will be no debug file created.
Returns:
The byte[] contents of the final document. This will be in the format specified by the OutputFormat property. Common uses are writing directly to file or converting to string. If converted to string, please use the UTF8 encoding.

byte [] AMP.AnyModalPublish.Render ( byte[]  CDA,
byte[]  AMPTemplate,
string  debugDestination 
)

Renders the cda document using the formatting and layout defined in the AMPTemplate. This method expects the contents of the files to be sent as strings.

Parameters:
CDA byte contents of the cda file
AMPTemplate byte contents of the AMP template file
debugDestination location to write the AMP debug file. This can be null, if desired, and there will be no debug file created.
Returns:
The byte[] contents of the final document. This will be in the format specified by the OutputFormat property. Common uses are writing directly to file or converting to string. If converted to string, please use the UTF8 encoding.

byte [] AMP.AnyModalPublish.RenderFromFile ( string  CdaFileName,
string  AMPTemplateFileName,
string  debugDestination 
)

Renders the cda document using the formatting and layout defined in the AMPTemplate. This method expects only the filename locations of the cda and amp template.

Parameters:
CdaFileName The file location for the cda document
AMPTemplateFileName The file location of the AMP template
debugDestination location to write the AMP debug file. This can be null, if desired, and there will be no debug file created.
Returns:
The byte[] contents of the final document. This will be in the format specified by the OutputFormat property. Common uses are writing directly to file or converting to string. If converted to string, please use the UTF8 encoding.

bool AMP.AnyModalPublish.testTemplate ( byte[]  template  ) 

This loads a template into saxon to ensure it doesn't have any compile errors.

Parameters:
template compiled amp tempalte
Returns:
true if succeeds, exception if fails

static XmlDocument AMP.AnyModalPublish.UpgradeCDA ( XmlDocument  cda  )  [static]

upgrades a CDA r2b2 xml string to a CDA r2 XmlDocument. This is called automatically when a cda file is submitted to either of the .Render methods. It is exposed for use by the word plugin.

Parameters:
cda well-formed xml string that adheres to cda schema
Returns:
XmlDocument containing CDA r2 xml

static string AMP.AnyModalPublish.SaxonXpath ( string  xml,
string  xpath 
) [static]

Uses Saxon to execute an xpath expression on a supplied xml string. Intended for word plugin use.

Parameters:
xml well-formed xml string
xpath xpath xpression
Returns:

static string AMP.AnyModalPublish.FormatCdaDate ( string  dateString  )  [static]

Formats a cda date using XSL and Saxon. Intended for word plugin use.

Parameters:
dateString the format-date pattern
Returns:
the formatted date string


Property Documentation

Format AMP.AnyModalPublish.OutputFormat [get, set]

Specifies the file format of the final document. Defaults to Format.WordXMLDocument.

string AMP.AnyModalPublish.CdsServer [get, set]

DEPRECATED - Authentication calls to CDS no longer occur in the rendering engine.

The location of the cds server. eg: https://production.mmodal.com/.

string AMP.AnyModalPublish.Domain [get, set]

DEPRECATED - Authentication calls to CDS no longer occur in the rendering engine.

Your company identifier with M*Modal. The domain location of our standard URLs is located in the following example eg: https://production.mmodal.com/DOMAIN/services/JobControl.

string AMP.AnyModalPublish.UserName [get, set]

DEPRECATED - Authentication calls to CDS no longer occur in the rendering engine.

Cds username that is used to authenticate to our web servers (case sensitive).

string AMP.AnyModalPublish.Password [get, set]

DEPRECATED - Authentication calls to CDS no longer occur in the rendering engine.

Cds password that is used to authenticate to our web servers.


Multimodal Technologies, Inc.
Multimodal Technologies, Inc.
Copyright © 1998-2008 Multimodal Technologies, Inc. All rights reserved.
Send comments to:
MTI Support