Class Index | File Index

Classes


Class Alfresco.WebPreview

Extends Alfresco.component.Base
WebPreview component.

Displays the node's content using various plugins depending on the node's content mime type & thumbnails available.
Document, video & image previewers are shipped out of the box.

Now supports plugins to be able to render custom content, by adding new elements in .get.config.xml.
Defined in: web-preview.js
Constructor Summary
Constructor Attributes Constructor Name and Description
 
WebPreview constructor.
Field Summary
Field Attributes Field Name and Description
 
Object container for initialization options
 
If a plugin was found to preview the content it will be stored here, for future reference.
 
Space for preview "plugins" to register themselves in.
Fields borrowed from class Alfresco.component.Base:
modules, services, widgets
Method Summary
Method Attributes Method Name and Description
 
conditionsMatch(condition)
Checks if the conditions are fulfilled.
 
getContentUrl((Optional))
Helper method for plugins to create url tp the node's content.
 
Makes it possible for plugins to get hold of the "previewer wrapper" HTMLElement.
 
getThumbnailUrl(thumbnail, fileSuffix)
Helper method for plugins to create a url to the thumbnail's content.
 
Fired by YUILoaderHelper when required component script files have
 
Fired by YUI when parent element is available for scripting
Methods borrowed from class Alfresco.component.Base:
attachLinkClickListeners, bind, createYUIButtons, destroy, fire, invokeAction, msg, onComponentLoaded, onReadyWrapper, refresh, setMessages, setOptions
Constructor Detail
Alfresco.WebPreview(htmlId)
WebPreview constructor.
Parameters:
{string} htmlId
The HTML id of the parent element
Returns:
{Alfresco.WebPreview} The new WebPreview instance
Field Detail
{object} options
Object container for initialization options

{Object} plugin
If a plugin was found to preview the content it will be stored here, for future reference.

{Object} Plugins
Space for preview "plugins" to register themselves in.
To provide a 3rd party plugin:

1. Create a javascript file and make it define a javascript class that defines a "plugin class" in this namespace.
2. Override this component's .get.head.ftl file and make sure your javascript file (and its resources) are included.
3. Override this component's .get.config.xml and define for which mimeTypes or thumbnails it shall be used.
4. To make sure your plugin works in the browser, define a report() method that
returns nothing if the browser is supported and otherwise a string with a message saying the reason the
plugin can't be used in the browser.
5. Define a display() method that will display the browser plugin or simply return a string of markup that shall be inserted.
Method Detail
conditionsMatch(condition)
Checks if the conditions are fulfilled.
Parameters:
{Object} condition
The condition to match gainst this components options
Returns:
true of conditions are fulfilled for plugins to be used.

{String} getContentUrl((Optional))
Helper method for plugins to create url tp the node's content.
Parameters:
{Boolean} (Optional)
Default false. Set to true if the url shall be constructed so it forces the
browser to download the document, rather than displaying it inside the browser.
Returns:
{String} The "main" element holding the actual previewer.

{HTMLElement} getPreviewerElement()
Makes it possible for plugins to get hold of the "previewer wrapper" HTMLElement.

I.e. Useful for elements that use an "absolute" layout for their plugins (most likely flash), so they have
an element in the Dom to position their own elements after.
Returns:
{HTMLElement} The "main" element holding the actual previewer.

{String} getThumbnailUrl(thumbnail, fileSuffix)
Helper method for plugins to create a url to the thumbnail's content.
Parameters:
{String} thumbnail
The thumbnail definition name
{String} fileSuffix
(Optional) I.e. ".png" if shall be inserted in the url to make certain flash
plugins understand the mimetype of the thumbnail.
Returns:
{String} The url to the thumbnail content.

onComponentsLoaded()
Fired by YUILoaderHelper when required component script files have
been loaded into the browser.

onReady()
Fired by YUI when parent element is available for scripting

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Feb 16 2012 12:24:28 GMT-0000 (GMT)