Netspective Enterprise Frameworks (NEF) User's Manual

Shahid N. Shah

Release 7.1 ($Date: 2005/12/24 13:37:08 $)

This version is in DRAFT until May 25, 2004 when it's expected to be completed. Check back daily until then because material is being added regularly.

Netspective, Enterprise Console, Sparx, Axiom, Commons, Medigy, Junxion and their respective logos are trademarks of Netspective Communications LLC, and may be registered in some jurisdictions.

Netspective and its suppliers assume no responsibility for any damage or loss resulting from the use of this developer’s guide. Netspective and its suppliers assume no responsibility for any loss or claims by third parties that may arise through the use of this software or documentation.

For warranty information and a copy of the End User License Agreement (EULA), please see the Netspective web site at http://www.netspective.com. If you would like a copy of these materials mailed to you, or if you have any questions, please contact Netspective. The information included on this web site sets forth Netspective’s sole and complete warranty and software licensing obligations with respect to your Netspective product. Use of the product indicates your acceptance of the terms of the warranty and the End User License Agreement.


Table of Contents

1. Introduction
Features
General Features
Feature List
Global
Architecture
Process & Methodology
Presentation Layer
Data Management Layer
Security and Personalization Layer
Benefits
Alternative Frameworks
Why not create your own custom framework?
I have an application server, isn’t that sufficient for me to write my J2EE applications?
Why not use the frameworks that come with my application server?
Why not use open source frameworks like Struts?
What are the primary advantages of NEF versus other frameworks?
Libraries and Components
Commons Core Library
Axiom Relational Data Management Service (Data Management Layer)
Sparx Application Platform (Presentation and Application Layers)
Enterprise Console
Console Login
Accessing the Console in Applications
How NEF Libraries Fit In Your Application
NEF Artifacts
NEF Web Services
NEF System Requirements
NEF Frequently Asked Questions (FAQ)
2. Developing Applications with NEF
Define
Defining the Presentation Layer
Defining the Data Management Layer
Static SQL Queries
Dynamic SQL Queries
Database Schema
Defining the Security Layer
Declare
Declaring the Presentation Layer
Introduction to Navigation Declaration Tags
Introduction to Forms Declaration Tags
Declaring the Data Management Layer
Introduction to Static Query Declarations (Static Data Access Objects)
Introduction to Stored Procedure Declarations (Remote Data Access Objects)
Introduction to Dynamic Query Declarations (Dynamic Data Access Objects)
Introduction to Schema Management Declarations
Declaring the Security Layer
Introduction to Login Management and User Authentication Tags
Introduction to Access Control and User Authorization Tags
Unit Test and User Demonstrations
Unit Testing and Demonstrating the Presentation Layer
Dialogs
Unit Testing the Data Management Layer
SQL Queries
Unit Testing the Security Layer
Generate Code
Location of Generated Code
Generating ID Constants
Generating Presentation Layer Code
Generating Data Management Layer Code
Generating Security Layer code
Customize Code
Customization Styles
Customizing Presentation Layer Code
Customizing Data Management Layer Code
Customizing Security Layer Code
Acceptance, Regression, and Load/Stress Testing
Acceptance Testing
Multi-user and Thread-safety Testing
Regression Testing
Load/Stress Testing
Deploy
3. Key NEF Concepts
Application Directory Structure
The NEF Project File
Input Source
Errors and Warnings
The com.netspective.sparx.Project class
The XML Data Model (XDM)
XDM Overview
XDM Features
XDM Tag Reference
XDM Tag Handlers and Extensibility
XDM Performance
XDM Tags versus JSP Tags
How XDM Tags Become Java Class Instances and Mutator Method Calls
Including XML Files into Other XML Files
Pre-processing XDM Files
XDM Templates
Template Producer and Consumer Tags
Value Sources
Using Value Sources
Catalog and Documentation of Value Sources
Value Contexts
Value Contexts you will most commonly use
Static Values
Parsing name:params Value Source Specifications
Registering a Value Source
Commands
Ant Build Scripts
Executing Ant Scripts through Console
Executing Ant Scripts From the Command Line
Executing Ant Scripts from within your IDE
Automatically Executing Ant Scripts in Navigation Controller
Runtime Environments
Viewing the Active Runtime Environment
Changing the Runtime Environment
Sharing of NEF Objects Across Threads
4. Project Presentation Layer Declarations
Navigation
MVC
Sparx Controller
Sparx Views
Your Model
Navigation Tag Descriptions
Navigation Trees
Specifying the Active Navigation Tree
Paths, Pages, and Page Identification
Page name (identifier) attribute and paths
Page captions, headings, and title attributes
The Navigation Context
Transferring Page Flow to non-Sparx Content
Redirect to an URL
Forward to a Servlet Context Resource
Page Content (Bodies)
Include a Servlet Context Resource
Execute a Command
Show Portal-like Pages using Panels
The body tag
Body Handlers
Conditionally Displaying or Hiding Pages
Navigation Skins
Custom Pages, Bodies, and Body Handlers
NavigationControllerServlet Processing Overview
Forms and Dialogs
Overview
dialog Tag Attributes
Dialog Fields
Available Dialog Field Types
Attributes common to all Dialog Field Types
Test Bed Examples
Custom Fields
Dialog Perspectives
Using Dialogs
Dialog State Management with Dialog Context Beans (DCBs)
Dialog Processing Events
Dialog Execute Handlers
Using the dialog
Using listeners
Defining a customized Java Dialog class
Server and Client-side Validation
Server-side Validation
Client-side Validation (JavaScript)
Dialogs as Services
Dialog Processing Overview
Themes and Skins
Template Engines
5. Project Security Declarations
Login Managers
Authenticated Users and Personalization
Access Control Lists
Role-based Navigation Trees
Role- and permission-based Forms and Fields
6. Project Data Management Declarations
Connection Providers
Database Policies
Static Queries
Overview
What's the difference?
Creating a static query
Defining the query
Defining the data source
Defining alternate SQL for different databases
SQL injection (dynamic replacements in SQL)
Presenting the results of a Query
Testing the static query
Unit Testing
Integration Testing
Using the static query
Using the query command
Using Java objects
Stored Procedures and Callable Statements
Dynamic Queries
Overview
Creating a dynamic query
Testing the dynamic query
Unit Testing
Integration Testing
Using the dynamic query
Schemas
Benefits of Managing the Relational Database Schemas in Axiom
Creating Datatypes
Creating Table Types
Creating Tables
Creating Relationships
Managing Enumerations and Lookup Tables
Generating SQL DDL File

List of Figures

1.1. Overview of NEF Components
1.2. NEF Position in J2EE Stack
1.3. NEF Artifacts
2.1. NEF Application Development Process Overview
2.2. NEF Tags Overview
2.3. Automatically Generated Unit Test for a Dialog
3.1. NEF Standard Project Directory Structure
3.2. Overview of Classes Involved in Parsing and Processing the project tag.
3.3. Value Sources Overview
4.1. MVC Pattern Overview
4.2. Sparx NavigationControllerServlet Request Processing Sequence Diagram
4.3. Sparx NavigationPage Rendering Sequence Diagram
4.4. Dialog Definition, Call, and Processing Overview
4.5. Sparx Forms Processing Class Interactions Overview
6.1. Axiom Schema Artifacts

List of Tables

2.1. Automatically Generate Unit Test Harness for SQL Queries

List of Examples

2.1. Navigation Tags in the Presentation Layer
2.2. Form Tags in Presentation Layer
2.3. Query Tags in the Data Management Layer
2.4. Stored Procedure Tags in the Data Management Layer
2.5. Query Definition Tags in the Data Management Layer
2.6. Schema Tags in the Data Management Layer
2.7. Login an Authentication Tags in the Security Layer
2.8. Access Control and Authorization Tags in the Security Layer
2.9. How to Generate Code using the Console
3.1. Basic NEF Project File
3.2. Specifying a different location for the NEF Project File
3.3. NEF Error Reporting Samples
3.4. How to use the xdm:include tag
3.5. How to Pre-process an XDM file
3.6. How to Use Global XDM Templates
3.7. Changing Application Runtime Environment Flags to Production
3.8. Changing Application Runtime Environment Flags to Production Maintenance
4.1. Using the page tag's caption, heading, and title attributes
4.2. Conditional fields dependent upon the Dialog's data mode
4.3. Client-side Validation using JavaScript
5.1. Setting up the Login Manager, Authenticator, Authenticated User, and Login Dialog for Medigy Application
5.2. Setting up the Access Control List for CTS Application
5.3. Setting up the Roles for CTS Application
6.1. Setting up the Data Source for Books Application
6.2. Defined Query
6.3. Passed In Query