The deployment process
The deployment process
The deployment
process involves three phases:
- Get Retrieves a file from the Build folder
- Transform Processes the contents of the file, changing HTML tags and scripts,
or adding server scripts as necessary to suit the target application server - Put Writes out the deployed pages to your local or network file
system, to an FTP site, or directly to an application server
When you deploy a target, the deployment controller executes
these three phases for each HTML, JSP, and script file you deploy.
About deployment configurations
A deployment configuration is a named set of instructions
for deployment. You can deploy to one configuration, or to as many
as you like. Deployment configurations can be stored in a target
file or in your Windows registry.
When you define a configuration, you specify the type of server
to deploy the Web site files to, and other information about your
site that the deployment controller requires to transform files
into the syntax used by the server.
You can use the PowerDynamo Web Site wizard to define a deployment configuration
for a PowerDynamo database Web site, or the JSP Target wizard to
define a deployment configuration for a JSP server. Otherwise, you
set up and modify deployment configurations from the Web target
properties dialog box.
Working with server types
About server types
Each deployment
configuration is associated with a specific type of server. A controller
for that type of server
provides program logic that performs:
- The
Get, Transform, and Put phases of deployment - Pre-deployment and post-deployment procedures as
required
Transformations for Web site targets
When you deploy to PowerDynamo or ASP, the deployment controller processes
the HTML pages to make them compatible with the format used by the
application server. The deployment controller performs these transformations
for each page:
- Updates links in HTML elements
to reflect the deployment file structure - Replaces the delimiters in the HTML editor (<% and %>)
for server scripts with the correct delimiters for the specified
application server. - If a page includes any server scripts, includes
the object model file specified for the deployment configuration.
The object model file maps the Web Target objects you use in your
scripts to objects and methods on the application server.
When you use the Basic deployment controller, the controller
does not modify the pages you deploy.
Transformations for JSP
targets
When you deploy a JSP target, the JSP deployment controller
adds the following server scripts to the top of each JSP page:
1 |
<%@ page import="com.sybase.powerbuilder.jspobject.*" %><br /> <% <br /> // global instance for the page<br /> PSDocumentClass psDocument = new PSDocumentClass<br /> (request, response, out, application);<br /> PSSessionClass psSession = new <br /> PSSessionClass(session);<br /> PSServerClass psServer = new<br /> PSServerClass(psDocument);<br /> %> |
Deploying to PowerDynamo
When you
deploy to PowerDynamo, you can
deploy files to a PowerDynamo Web site for production purposes,
or for testing and debugging purposes.
If debugging is enabled, the deployment controller changes
all the LANGUAGE=JavaScript attributes in client and server
scripts to LANGUAGE=DynaScript (the language the debugger
supports). DynaScript is fully compatible with JavaScript. Whenever
you enable debugging, you should run the deployed pages only from
the debugger for Web targets.
Disable debugging for production Do not enable debugging for the final deployment of a Web
application. If you do, browsers will not be able to interpret the
client-side scripts, since they are converted to DynaScript when
debugging is enabled.
The PowerDynamo deployment controller also handles coding
for the database connections your page uses.
Any changes made by the deployment controller to Web site
files are saved in a local copy folder that you selected as part
of your deployment configuration properties.
Deploying to ASP
Procedures performed by the deployment controller
for ASP
When you deploy to ASP, the controller performs several
additional procedures during the deployment process:
- Changes the file extension to ASP for those files that contain
server-side scripts. When the deployment controller changes a file’s
extension to ASP, it is possible that some links to that file might
break.
To avoid breaking links, use the ASP extension for the target
file within your Web target. If two different files have the same
file names but different extensions (for example TEST.HTM and TEST.STM),
and both contain server-side code, the deployment controller will
rename both files to the same name (for example, TEST.ASP)
and overwrite one of the files. To prevent this, assign your files
unique file names. - Creates a GLOBAL.ASA file.
This file contains a Session_onStart routine that
establishes session variables for each database connection used
in the pages you deploy.
If your project already contains a GLOBAL.ASA file,
the deployment controller updates it to include the necessary code
(instead of creating a new file). - Transforms DynaScript tags such as <!–SQL, <!–FORMATTING,
and <!–DATA into blocks of JavaScript that will run on
ASP.
To allow your Web pages to use the predefined connections,
you need to create a data source for each connection (if one does
not already exist). The DSN name for each data source must match
the DSN specified in the ConnectionString session variable.
Targets using the Web Target object model
When
you deploy a Web page that uses the Web Target object model, the deployment
controller automatically includes an object model file in the page. When
you deploy to ASP, the controller for ASP generates a server-side include
(<!–#INCLUDE –>) statement that specifies
the name of the target in the path to the object model file, as
shown in the following example:
1 |
<!--#INCLUDE VIRTUAL="/MyProject/ObjMod.js"--> |
Any references to the Web Target object model do not work
when you deploy to ASP unless the name of the virtual mapping you
deploy to matches the name of the target exactly. So, the <!–#INCLUDE
–> statement shown above would work only if the virtual
mapping were MyProject.
Server-specific setup steps
After deploying the target to an ASP Web site, you may need
to perform some additional procedures to get your Web application
up and running. For detailed instructions, see the documentation
provided for your Web and application servers.
Deploying using the Basic deployment controller
When you deploy
Web pages using the Basic deployment controller, the pages you deploy
are the same as the source files–the deployment controller
does not change them. Use the Basic controller for deploying Web
applications that do not require the services of an application
server. The Basic controller deploys pages to a target directory
on your file system or to an FTP site.