Overview | File | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class MLA

    Object
       |
       +--MLA

class MLA

Defined in MarkLogicPowerPointAddin.js

Constructor Summary
`MLA()` The MLA namespace is used for global attribution.

Method Summary
`<static> string` | `addCustomXMLPart(customPartXml)` Adds custom part to active Open XML package.
`<static> string` | `convertFilenameToImageDir(filename)` Converts .pptx filename to image directory name.
`<static> Object` | `createXMLDOM(xmlstring)` Utility function for creating Microsoft.XMLDOM object from string.
`<static> void` | `deleteCustomXMLPart(customXMLPartId)` Deletes custom part from Active Open XML package identified by id.
`<static> string` | `embedOLE(tmpPath, title, url, usr, pwd)` Embeds OLE into the Presentation.
`<static> Object` | `getConfiguration()` Returns MLA.config.
`<static> Microsoft.XMLDOM object` | `getCustomXMLPart(customXMLPartId)` Returns the custom XML part, identified by customXMLPartId, that is part of the active Open XML package.
`<static> Array` | `getCustomXMLPartIds()` Returns ids for custom parts (not built-in) that are part of the active Open XML package.
`<static> string` | `getPresentationName()` Returns the name being used for the active Presentation on the client system.
`<static> string` | `getPresentationPath()` Returns the path being used for the active Presentation on the client system.
`<static> string` | `getTempPath()` Returns the path being used for the /temp dir on the client system.
`<static> string` | `getVersion()` Returns version of MarkLogicPowerPointAddin.js library.
`<static> string` | `insertImage(url,user,pwd)` Inserts image into the Presentation.
`<static> string` | `insertJSONTable(table)` Inserts JSON string as table in Active Presentation.
`<static> string` | `insertSlide(tmpPath, filename, slideidx, url, user, pwd,retain)` Inserts slide, identified by slideIdx, into the active presentation at current slide position.
`<static> string` | `insertText(text)` Inserts text into the Presentation at cursor position.
`<static> string` | `openPPTX(tmpPath, docuri, url, user, pwd)` Opens .pptx into PowerPoint from local copy saved to client from MarkLogic.
`<static> string` | `saveActivePresentation(filename, url, user, pwd)` Saves active Presentation to MarkLogic from client system.
`<static> string` | `saveActivePresentationAndImages(saveasdir, saveasname, url, user, pwd)` Saves Presentation on client as .pptx.
`<static> string` | `saveImages(imgdir, url, user, pwd)` Saves directory of images on client.
`<static> string` | `saveLocalCopy(filename)` Saves .pptx for active Presentation on the client system.
`<static> string` | `useSaveFileDialog()` Launches Windows form on client as simple SaveAs text box.

Constructor Detail

### MLA

    MLA()

The MLA namespace is used for global attribution. The methods within this namespace provide ways of interacting with an active Open XML document through a WebBrowser control. The control must be deployed within an Addin in Office 2007. The functions here provide ways for interacting with the active presentation in PowerPoint ; however, the functions getCustomXMLPart(), getCustomXMLPartIds(), addCustomXMLPart(), and deleteCustomXMLPart() will work for any Open XML package, provided they are used within the context of an Addin for the appropriate Office application.

Method Detail

### addCustomXMLPart

    <static> string addCustomXMLPart(customPartXml)

Adds custom part to active Open XML package. Returns the id of the part added.

Parameters:

`customPartXML` - Either A) an XMLDOM object that is the custom part to be added to the active Open XML package, or B)The string serialization of the XML to be added as a custom part to the active Open XML package. ( The XML must be well-formed. )

Returns:

id for custom part added

Throws:

- Exception if unable to add custom part

### convertFilenameToImageDir

    <static> string convertFilenameToImageDir(filename)

Converts .pptx filename to image directory name.

Parameters:

`filename` - the name to be converted

Returns:

converted_name replaces .pptx of filename with _PNG

Throws:

- Exception if unable to retrieve the /temp path

### createXMLDOM

    <static> Object createXMLDOM(xmlstring)

Utility function for creating Microsoft.XMLDOM object from string.

Parameters:

`xmlString` - the string to be loaded into a XMLDOM object. The string must be serialized, well-formed XML.

Returns:

Microsoft.XMLDOM object

Throws:

- Exception if unable to create the XMLDOM object

### deleteCustomXMLPart

    <static> void deleteCustomXMLPart(customXMLPartId)

Deletes custom part from Active Open XML package identified by id.

Parameters:

`customXMLPartId` - the id of the custom part to be deleted from the active Open XML package.

Throws:

- Exception if unable to delete custom part

### embedOLE

    <static> string embedOLE(tmpPath, title, url, usr, pwd)

Embeds OLE into the Presentation. the OLE is downloaded to client and saved into Presentation from local file.

Parameters:

`tmpPath` - the directory (including path) where the local copy of object to be embedded will be saved.

`url` - the url for the file to be downloaded and embedded

`pwd` - password for MarkLogic Server url connects with

`filename` - the name of the file to be embedded. tmpPath + filename should be the name and path of file on client.

`user` - username for MarkLogic Server url connects with

Throws:

- Exception if unable to embedOLE

### getConfiguration

    <static> Object getConfiguration()

Returns MLA.config. The fields for this object are version, url, and theme. version - the version of the Addin library, url - the url used by the Addin WebBrowser control, theme - the current color scheme used by Office.

Throws:

- Exception if unable to create MLA.config object

### getCustomXMLPart

    <static> Microsoft.XMLDOM object getCustomXMLPart(customXMLPartId)

Returns the custom XML part, identified by customXMLPartId, that is part of the active Open XML package. (.docx, .xlsx, .pptx, etc.)

Parameters:

`customXMLPartId` - the id of the custom part to be fetched from the active package

Returns:

the XML for the custom part as a DOM object.

Throws:

- Exception if there is error retrieving the custom part

### getCustomXMLPartIds

    <static> Array getCustomXMLPartIds()

Returns ids for custom parts (not built-in) that are part of the active Open XML package. (.docx, .xlsx, .pptx, etc.)

Returns:

the ids for custom XML parts in active Open XML package as array of string

### getPresentationName

    <static> string getPresentationName()

Returns the name being used for the active Presentation on the client system.

Returns:

presentation_name the name of the active Presentation

Throws:

- Exception if unable to retrieve the presentation name

### getPresentationPath

    <static> string getPresentationPath()

Returns the path being used for the active Presentation on the client system.

Returns:

path path is path for where current Presentation is saved on client

Throws:

- Exception if unable to retrieve the presentation path

### getTempPath

    <static> string getTempPath()

Returns the path being used for the /temp dir on the client system.

Returns:

/temp path on client system

Throws:

- Exception if unable to retrieve the /temp path

### getVersion

    <static> string getVersion()

Returns version of MarkLogicPowerPointAddin.js library.

Returns:

the version of MarkLogicWordAddin.js

### insertImage

    <static> string insertImage(url,user,pwd)

Inserts image into the Presentation.

Parameters:

`url` - a url to XQuery module that will return the image when evaluated

`user` - username for the MarkLogic Server the picuri connects with

`pwd` - password for the MarkLogic Server the picuri connects with

Throws:

- Exception if unable to insert image

### insertJSONTable

    <static> string insertJSONTable(table)

Inserts JSON string as table in Active Presentation. see template example in insertJSONTable() found in Samples/officesearch/officesearch.js for required JSON format.

Parameters:

`table` - the JSON representation of the table to be inserted

Throws:

- Exception if unable to save insert table into Presentation

### insertSlide

    <static> string insertSlide(tmpPath, filename, slideidx, url, user, pwd,retain)

Inserts slide, identified by slideIdx, into the active presentation at current slide position.

Parameters:

`tmpPath` - the directory (including path) where the local copy of presentation will be saved.

`filename` - the name of the .pptx file

`url` - the url of the .pptx to be downloaded

`user` - the username of the MarkLogic Server the url connects with

`pwd` - the password of the MarkLogic Server the url connects with

`retain` - true or false setting determines whether background style of copied slide will be retained when copied to active presentation

`slideIdx` - the index of the slide within the source powerpoint file to be copied

Throws:

- Exception if unable to copy slide to active presentation

### insertText

    <static> string insertText(text)

Inserts text into the Presentation at cursor position.

Parameters:

`text` - text to inser

Throws:

- Exception if unable to insert text

### openPPTX

    <static> string openPPTX(tmpPath, docuri, url, user, pwd)

Opens .pptx into PowerPoint from local copy saved to client from MarkLogic.

Parameters:

`tmpPath` - the directory (including path) where the local copy of presentation will be saved.

`docuri` - the uri of the .pptx within MarkLogic

`url` - the url for fetching the .pptx to be downloaded

`user` - the username for the MarkLogic Server the url connects with

`pwd` - the password for the MarkLogic Server the url connects with

Throws:

- Exception if unable to download and open local copy

### saveActivePresentation

    <static> string saveActivePresentation(filename, url, user, pwd)

Saves active Presentation to MarkLogic from client system. .pptx being saved to ML must already exist (be saved) on client and have both path and name.

Parameters:

`filename` - the name of the file (including path) to be saved to MarkLogic

`url` - the url on MarkLogic that the client calls to upload the presentation

`user` - username for MarkLogic Server url connects with

`pwd` - password for MarkLogic Server url connects with

Throws:

- Exception if unable to save the active Presentation

### saveActivePresentationAndImages

    <static> string saveActivePresentationAndImages(saveasdir, saveasname, url, user, pwd)

Saves Presentation on client as .pptx. Saves same .pptx to MarkLogic. Saves images for Presentation to client. Saves same images to MarkLogic.

Parameters:

`saveasdir` - the name of the directory (including path) where to save the local copies

`saveasname` - the name to save the .pptx as (no path)

`url` - the url on MarkLogic that the client calls to upload the Presentation and images to MarkLogic

`user` - username for MarkLogic Server url connects with

`pwd` - password for MarkLogic Server url connects with

Throws:

- Exception if unable to save active Presentation and images

### saveImages

    <static> string saveImages(imgdir, url, user, pwd)

Saves directory of images on client. saves this directory and its contents to MarkLogic.

Parameters:

`imgdir` - the name of the directory (including path) where to save the images on the client system

`url` - the url on MarkLogic that the client calls to upload the image directory and contents to MarkLogic

`user` - username for MarkLogic Server url connects with

`pwd` - password for MarkLogic Server url connects with

Throws:

- Exception if unable to save images

### saveLocalCopy

    <static> string saveLocalCopy(filename)

Saves .pptx for active Presentation on the client system.

Parameters:

`filename` - the filename (including path) to save Presentation as on client system

Throws:

- Exception if unable to save local copy

### useSaveFileDialog

    <static> string useSaveFileDialog()

Launches Windows form on client as simple SaveAs text box.

Returns:

text entered by user as filename into form

Throws:

- Exception if unable to return text

Overview | File | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Wed Sep 16 10:20:21 2009