Anatomy Of An Extension - Adobe GoLive CS2 Programmer's Manual

Hide thumbs Also See for GoLive CS2:
Table of Contents

Advertisement

SDK Programmer's Guide
special <jsx... > tags the SDK provides. As a result, you can edit an extension's Main.html file (or any of
the other file types noted) in a GoLive document window, just like any other markup document.
GoLive CS2 SDK provides enhanced support for site-level operations, including notification of changes in
the content or organization of the Site window, and programmatic selection of site assets according to
criteria you specify. For example, an extension can select all files in the site that would take longer than a
minute to download at 56kbps. You might then process each selected file in some way. For example, you
might compress it, downsample it, or reformat it in some way that would reduce the time required to
download it.
In addition to its extended DOM and event model, the GoLive object model provides access to the GoLive
application itself, which in turn makes available a host of other services and content.
The GoLive application provides access to:
The GoLive user interface (Menus, Dialogs, Palettes, Inspectors, Site window, Document windows, Site
reports, built-in localization).
User settings, global stylesheets, preferences, shared data, other extensions.
Custom/server tag support and special parsing behavior.
You can create extensions that provide your own customized tags and content as icons in the Objects
palette. You can also preprocess documents before the GoLive parser reads them, to deal with
encoding issues or to mimic the effects of server-side code in Layout view, which is the graphical
editing view in GoLive.
Automation and macros: apply automated edits to every file in a site, or generate entire sites
programmatically.
Dynamic Content database content.
Resources on network and WebDAV servers.
The typical extension can and does, of course, define things for itself in its own code, such as its own user
interface items, custom functions, custom tags, SDK-provided tags, HTML tags, localization, source
translation, and more. To accomplish this, you'll just add tags and functions to an extension's Main.html
file as you might add them to a web page: tags go in the file's <head> and <body> elements, and
JavaScript functions go in the file's <script> elements.
XML support enables even further extensibility, allowing GoLive to grow rapidly and conform easily to
new standards that may emerge in the future.

Anatomy of an Extension

At its most basic, an extension consists of a Main.html file in a subfolder of the Extend Scripts folder,
called the extension folder. The extension folder can contain other files the extension requires, such as
images. These additional files can be kept in subfolders. For example, the Custom Box extension's folder
contains the extension's Main.html file, and also an Images subfolder that holds external .gif and .jpg
image files.
The extension's Main.html file contains markup tags and JavaScript that define the extension. At startup
time, GoLive interprets these tags and scripts to load an extension in the GoLive environment. The
Main.html file should be an xHTML UTF-8 encoded markup document.
The extension defines objects using the GoLive SDK xHTML tags, and also defines the behavior for those
objects using JavaScript code.
Adobe GoLive CS2
How to Create an Extension
19

Advertisement

Table of Contents
loading

Table of Contents