EditLive! 9 Documentation : Basic ASP Example Documentation

This page provides information on how to instantiate Tiny EditLive! within a web page using Active Server Pages (ASP) code. This is intended as a basic sample only. Its purpose is only to demonstrate how Tiny EditLive! can be placed into a web page.

Getting Started

System Requirements

If you are running Microsoft Windows XP Server or Professional, ensure that the following components are installed on your server:

  • Microsoft Internet Information Server 5.1

If you are running Microsoft Windows 2003, ensure that the following components are installed on your server:

  • Microsoft Internet Information Server 5.0
Required Skills

The following skills are required prior to working with this example:

  • Developing Web-based forms in HTML
  • Processing Web-based forms in Active Server Pages
  • Basic client-side JavaScript

Overview

In this example, EditLive! is embedded into a Web page using ASP code. A database is not required for this basic sample. You cannot perform any saving of document content in this basic sample due to the lack of server-side processing in the example code and the absence of a database. This sample is intended to show only how to create an instance of EditLive! within a Web page through the use of ASP code.

This sample demonstrates how to perform the following with EditLive! and ASP:

  • Embed an instance of EditLive! in a Web page using ASP code.
  • Set variables affecting the appearance of EditLive! within the Web page.

EditLive! in basicaspsample.asp

To embed EditLive! within a Web page several steps are required. Each of these steps is explained here and code samples are provided.

1. Include the editlivejava.asp file.

<!-- #include file="../../redistributables/editlivejava/editlivejava.asp" -->

The editlivejava.asp provides an interface to the EditLive! JavaScript file editlivejava.js. Editlivejava.asp includes methods which will be used in creating an instance of EditLive!. This file can be found in the redistributables/editlivejava subdirectory of the EditLive! directory.

2. Create a HTML form to place an instance of EditLive! in.

<form name="form1" method="POST">

3. Create the EditLive! global object.

<% 'Declare a global EditLive! object
Dim eljglobal
Set eljglobal = New EditLiveGlobal
'Set the download directory to where EditLive! can be found
eljglobal.DownloadDirectory = "../../redistributables/editlivejava"
eljglobal.LocalDeployment="false"
eljglobal.Init()

Embedding EditLive! in a Web page requires the creation of two objects within a section of Visual Basic script. The first of these objects is an EditLive! global object. This object stores where the download directory of EditLive! can be found. In this case it is the redistributables/editlivejava subdirectory of the EditLive! directory. Noted also is the location to download the Java Run Time Environment (JRE) if required, but this is dependent on the LocalDeployment load-time property. The object is then initialized by calling its Init() method.

For more information on the properties of this object see EditLive! for Java Instantiation Reference. For more information on Deploying Tiny EditLive! please see the EditLive! for Java SDK.

4. Creating the EditLive! instance object.

'Declare an instance of EditLive!
Dim editlivejava1
Set editlivejava1 = New EditLive
'Set the properties for the instance of EditLive!
editlivejava1.Name = "ELJApplet1"
editlivejava1.Width = 600
editlivejava1.Height = 400
' Specify the location of the XML configuration file for EditLive!
editlivejava1.ConfigurationFile = "sample_eljconfig.xml"
' Specify the initial content for EditLive!
editlivejava1.Body = "<p> Document contents for EditLive! </p>"
' Show the editor applet
editlivejava1.Show()
%>

This section of code creates an instance of EditLive! within the page and sets variables which affect how EditLive! will be presented within the page. After each of the properties have been set the Show() method is called. This method causes the instance of EditLive! just created to be displayed in the Web page. It should be noted that this the closing portion of the Visual Basic script started in step three.

Summary

EditLive! may be quickly and easily placed within an Active Server Page using some simple Visual Basic scripting. EditLive! may have its size and configuration easily customized using the properties as listed in step four of the above procedure.