Advanced
Lesson 4: Designing a Container Application for XMetaL for ActiveX
Getting
started
XMetaL for
ActiveX is a system-registered ActiveX control. You can think of XMetaL for
ActiveX as a container for XML documents. It provides editing functions for XML
documents, like insert, delete, cut, and paste. The XMetaL for ActiveX control
also supports drag and drop, revision tracking, and other features.
XMetaL for
ActiveX must be embedded in an application before use. This application is
called a container application.
It helps if
you've done some basic research before completing this lesson (and later
lessons). Look into the reasons for creating a container application for XMetaL
for ActiveX for your organization. If you know who your users are, how your
users work, what equipment your users have, and why they need an XML editor,
you can make intelligent design decisions based on your users' needs. Then you
can focus your learning on the most relevant exercises presented in these
lessons.
In this
lesson, you will walk through some of the major design decisions you face when
developing an XMetaL for ActiveX container application. By the end of this
lesson, you will understand what a container application is, and what kind of
container application to develop to meet your users' needs. You can then learn
the specifics about creating HTML container applications or custom container
applications in subsequent lessons.
This lesson
will take about 20 minutes to complete.
Understanding
container applications
You must
create a container application before using XMetaL for ActiveX. Container
applications should do the following:
- Embed the XMetaL
for ActiveX control
- Provide the look
and feel of the XML editing application
- Provide buttons,
menus, toolbars, and dialog boxes
- Call the XMetaL
for ActiveX API to perform XML document processing tasks
A
container application is just like any other Windows application or HTML
application, except that XMetaL for ActiveX displays and processes XML
documents for you. When you use the XMetaL for ActiveX API, you can open
documents in XMetaL for ActiveX, save documents, insert elements, validate
documents, track changes to documents, and perform many other document
processing tasks.
Take a look at
the XMetaL Author user interface to get some ideas about what you might want to
include in your user interface. XMetaL for ActiveX is similar to the main
document pane in XMetaL Author. When you create the user interface for your
container application, you might want to create user interface features similar
to the ones that appear in XMetaL Author, like an Element List, Attribute
Inspector, or Structure View. Alternatively, you might want to create an
interface that is totally different than the XMetaL Author interface. Use your
imagination!
Choosing
a deployment strategy for document customizations
Document
customizations control the look and feel of the XMetaL for ActiveX control when
an XML document is open. When you are writing your container application for
XMetaL for ActiveX, you will probably use the XMetaL for ActiveX API to load a
document customization whenever you load an XML document.
There are two
ways to deploy a document customization for use with XMetaL for ActiveX:
- Use an XMetaL -
Central package
- Use a XAC
Here are some
of the situations where you should use an XMetaL - Central package to deploy a
customization:
- When you want to
distribute customizations on a user-level basis
- When you want
version control for customizations
- When you want
document customizations in development to be available only to developers
- When you want
users to be authenticated before downloading document customizations
Here are some
of the situations where you should use a XAC to deploy a customization:
- When you want to
distribute customizations without installing XMetaL - Central
- When you want to
make document customizations publicly available
Choosing
a licensing strategy for XMetaL for ActiveX
There are two
types of licenses for XMetaL for ActiveX: node-locked licenses and
floating licenses. A node-locked
license is tied to a specific computer. If you use a license key when
installing XMetaL for ActiveX, you are using a node-locked license. A floating
license can be shared by any number of computers. Whenever XMetaL for ActiveX
Concurrent User License Server is in use, a floating license is required. If
you use XMetaL for ActiveX Concurrent User License Server to manage licenses,
you are using floating licenses.
Here are some
of the situations where you should use node-locked licenses:
- When you want to
run XMetaL for ActiveX without a network or internet connection
- When you want to
create a custom container application for XMetaL for ActiveX
- When the majority
of your users will be using XMetaL for ActiveX at the same time
- When you want to
use the CD installation of XMetaL for ActiveX
- When you do not
have the resources to run a dedicated server for XMetaL for ActiveX Concurrent
User License Server
Here are some
of the situations where you should use floating licenses:
- When you have
many users that will use XMetaL for ActiveX infrequently
- When you have many
users that use XMetaL for ActiveX at different times
- When you don't
want to distribute license keys to end users
Choosing
a deployment strategy for XMetaL for ActiveX
There are two
ways to deploy XMetaL for ActiveX: using the CD installation, and using the CAB
installation.
Note: Do not use the CAB file when users
already have XMetaL for ActiveX installed, as this will cause problems
uninstalling XMetaL for ActiveX.
Here are some
of the situations where you should use the CD installation:
- When you want to
use node-locked licensing
- When you want to
create a custom container application for XMetaL for ActiveX
Here are some
of the situations where you should use the CAB installation:
- When you want to
deploy XMetaL for ActiveX over the Internet or over an intranet
- When you want to
use the XMetaL for ActiveX Concurrent User License Server
Choosing
a type of container application
There are two
basic types of container applications: HTML
container applications and custom
container applications.
An HTML
container application is an HTML page that embeds the XMetaL for ActiveX
control. A custom container application is a stand-alone application that
embeds the XMetaL for ActiveX control. Typically, custom container applications
are developed in a programming language like Visual Basic .NET or C++.
You can embed
the XMetaL for ActiveX control in many other applications. For example, you can
embed the XMetaL for ActiveX control in a Microsoft Outlook form. However,
these applications are not discussed in the lessons that follow.
Here are some
of the situations where you should develop an HTML container application:
- When you are
using the XMetaL for ActiveX Concurrent User License Server
- When you want to
use the CAB file to deploy XMetaL for ActiveX
- When you want to
deploy one centralized XMetaL for ActiveX container application
- When you want your
container application to be available over the Internet or over an intranet
Here are some
of the situations where you should develop a custom container
application:
- When you want to
use advanced language features to create a container application
- When you want to
distribute a desktop application
- When you want to
integrate XMetaL for ActiveX with a larger pre-existing program
Compatibility
of design strategies
The following tables summarize the compatibility of different design
strategies.
Compatibility
of Licensing Strategies and Deployment Strategies
Deployment strategy |
Compatible with node-locked licensing? |
Compatible with floating licensing? |
CD installation of XMetaL for
ActiveX |
Yes |
No |
CAB installation of XMetaL for
ActiveX |
Yes |
Yes |
Compatibility
of container application types with licensing and deployment
strategies
Deployment or licensing strategy |
Compatible with HTML container
application? |
Compatible with custom container
application? |
CD installation of XMetaL for
ActiveX |
Yes |
Yes |
CAB installation of XMetaL for
ActiveX |
Yes |
No |
Node-locked licensing |
Yes |
Yes |
Floating licensing |
Yes |
No |
Choosing
a programming language for the container application
If you are developing a custom container
application:
Choosing a
programming language for a custom container application is largely a matter of
preference. You may find it convenient to use the Visual Studio .NET IDE to do
application development and customization development, although it is not
required.
Keep in mind
that an ActiveX control is a COM object. Visual Basic .NET, C++, and C#
natively support the use of ActiveX controls. You can get a COM bridge that
supports embedding an ActiveX control with a graphic display in a Java program,
so you can develop a custom container application in Java.
If you are developing an HTML container
application:
HTML container
applications are a little different. Since users must have Internet Explorer 5
or higher installed, you can take advantage of DHTML to create the user
interface for the container application. You will also need to use a
client-side scripting language to provide additional processing capabilities,
such as VBScript or JavaScript. You may find it convenient to use the same
scripting language in your HTML container application and in your document
customization, but that is optional.
About scripts:
Scripts
(macros) in your document customization must be written in a scripting
language.
You can use
any scripting language that conforms to the
Microsoft Scripting Language
Interface. Built-in support is provided for JScript and VBScript; the
XMetaL Programmer's Guide provides extensive documentation and examples for
these two languages. The scripting language is often a special version of a
language: for example, instead of using Perl, you need to use PerlScript
(available from
http://www.activestate.com) and for
Python you need the
win32com package. You must
specify the language ID in macros and in the Customizations editor. This is the
ProgID of the ActiveX control that implements the script engine, and can be
found in the registry. Keep in mind that users must have the PerlScript or
Python language runtime installed to run scripts on their machines.
Taking
the next step in application development
There are two
lessons after this one, Advanced Lesson 5: Implementing an HTML container
application for XMetaL for ActiveX and Advanced Lesson 6: Implementing a custom
container application for XMetaL for ActiveX using VB.NET. Continue to the
lesson that interests you the most.
Last modified: Friday, May 21, 2004 3:30:17 PM