sybase tools technology preview john strano – technology evangelist may 2006 sybase confidential...
Post on 22-Dec-2015
223 views
TRANSCRIPT
Sybase ToolsSybase ToolsTechnology PreviewTechnology Preview
John Strano – Technology EvangelistMay 2006
Sybase Confidential Propriety.
Sybase Confidential Propriety.
PowerBuilder 10.5Overview
Sybase Confidential Propriety.
Microsoft’s Modified Release Schedule
PowerBuilder’s .NET Compiler Takes advantage of ASP .NET 2.0 features Originally slated for PowerBuilder 11 release Q4
2005
Visual Studio .NET 2005 (ASP .NET 2.0) Release date moved by Microsoft from Summer
2005 to Q4 2005
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements
Decimal data type upgrade Provide support for 30 digits versus current 18 Position for support of .NET which handles 28 digits DataWindow expression support
Currently all numerics converted to double before calculations Add Decimal() DataWindow function for conversion
Implementation will replace current 3rd party implementation but should be completely transparent to user
Byte data type
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements
DateTime PickerWrapper for Microsoft Common ControlNew control and/or enhancement to EditMaskNew DataWindow edit mask style
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements
Menu EnhancementsStyles
TraditionalContemporary
Style attributesShadowBitmaps (16x16 and 32x32)TitlesMain background colorBitmap background colorHighlight color
Relies on GDI+ (GDIPLUS.DLL)
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements
Toolbar EnhancementsStyles
TraditionalContemporary
Style attributesTitlesMain background colorBitmap background colorHighlight colorText color
Allow toolbars to be attached to top-level non-MDI WindowsRelies on GDI+ (GDIPLUS.DLL)
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements
New Rich Text Edit control PB10 investigation of Microsoft control found it lacking in
features necessary to support DataWindow TX Text Control
http://www.textcontrol.com/ Minimal (if any) loss of current functionality New functionality including saving as Microsoft Word DOC format
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements
Updated bitmaps and icons Provide updated look to IDE Allow use in application Potential sources
3rd party Reuse from Sybase Workspace
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements
Autosize Height for All DataWindow Bands All Bands Supported (not just detail band) Band will resize for Nested DataWindows
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements
Treeview Presentation StyleDesigned similar to group DataWindowProperty support
Node linesIconsGrid styleIndention size
Event supportExpanding / ExpandedCollapsing / Collapsed
Function supportExpand (multiple variations)Collapse (multiple variations)
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements – TreeView Presentation Style Properties
CollapsedTreeNodeIconNameDefaultExpandToLevelExpandedTreeNodeIconNameIndentShowConnectLinesShowLeafNodeConnectLinesShowTreeNodeIconStateIconAlignModeTreeNodeIconName
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements – TreeView Presentation Style Functions
ExpandCollapseExpandAllCollapseAllExpandAllChildrenCollapseAllChildrenExpandLevelCollapseLevelIsExpanded
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements
Infrastructure refactoring (continuing past PB 11) DataWindow “rewrite” to support growth
Development of generic Data Source Interface (DSI) Abstract layer above current DBI layer Designed to support access of non-SQL based data
.NET DataSet EJB Web Services
Crosstab GridGraph Label Nested Ole RichTextProcessing
Styles
Functions Load / SaveDescribe /
Modify
Parse / Generate /
InfoExpression Table Import Export
Painting / Printing
Edit StyleControl Event Function Dialog External
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements – Database Enhancements
ASE 15.0 native driver supportADO.NET for ASE supportADO.NET for Oracle supportDBI refactoring (not a visible enhancement)
Sybase Confidential Propriety.
PowerBuilder 10.5 Enhancements – Web Services Enhancements
Adding .NET’s Web Services SDK Better data type support Security and Authentication
EasySOAP Implementation Will be left intact, but not enhanced
Sybase Confidential Propriety.
PowerBuilder 10.5 in action.
Demonstration
Sybase Confidential Propriety.
PowerBuilder 10.5
Q & A
Sybase Confidential Propriety.
-Sybase WorkSpace – Web Application Development & The JSF Web DataWindow
Sybase Confidential Propriety.
AGENDA
Introduction to JavaServer Faces What is JavaServer Faces? Architecture Overview Key Concepts Why JavaServer Faces?
Sybase WorkSpace - Web Application Development Tooling Objectives Architecture Overview Features
Integration with DataWindow DataWindow Designer JavaDatastore
Demonstration
Sybase Confidential Propriety.
JavaServer Faces:In General
Sybase Confidential Propriety.
BACKGROUND
Building high-quality web application user interfaces is hard HTTP request/response model HTML dialect(s) and browser capabilities Need to support multiple client devices types
Sybase Confidential Propriety.
WHAT IS JAVA SERVER FACES?
JavaServer Faces (JSF) is a component user interface (UI) framework for Java web applications.
It is designed to significantly ease the burden of writing and maintaining applications that run on a application server and render their User Interfaces back to a target client.
Sybase Confidential Propriety.
WHY JSF?
MVC (Model-View-Controller) for Web applications Clean separation of roles Easy to use Extensible component and rendering architecture Support for client device independence Offers finer-grained separation of behavior and presentation Component and web-tier concepts without limiting you to a
particular scripting technology or markup language
Sybase Confidential Propriety.
COMPONENT MODEL
Maintaining a reference to model objects Driving the event-handling Rendering is separate from the component JSF implementation provides a set of UI component classes Standard Component classes, for example
Commandbutton, Form, Graphic, Input Output, Panel, Parameter SelectBoolean, SelectMany, SelectOne
Sybase Confidential Propriety.
RENDERING MODEL
Renderers – Adapt components to a specific markup language Encoding – Create markup to represent value Decoding – Retrieve request parameters and create new value
RenderKits – Library of Renders Extensible at runtime For JSP pages, represented as a custom tag library Basic HTML RenderKit part of the standard
Component Rendered As
command_button
command_hyperlink
Sybase Confidential Propriety.
NAVIGATION MODEL
Sybase Confidential Propriety.
Sybase WorkSpace Web Application Development
Sybase Confidential Propriety.
OBJECTIVE
Provide a life-cycle support including design, develop, debug/test, and deploy a web application utilizing JavaServer Faces technology.
Visual Development Environment Allows building Web pages in a manner very similar to :
PowerBuilder Visual Basic A flavor of 4GL experience.
Sybase Confidential Propriety.
OBJECTIVE
Provides a component model Allows users to think about components, events and scripting
instead of the detail of HTTP request / response Leverages standards JavaServerFaces runtime Uses Java DataStore to make data access easy Reuse existing Datawindows in your Web applications Make service and EJB invocation in the Web application easy
Sybase Confidential Propriety.
ARCHITECTURE
Eclipse
Graphical Editing Framework
(GEF)
Eclipse Modeling
Framework(EMF)
Web Tool Platform(WTP)
Web Application Development Tool
DataWindow Painter
Java DatastoreWorkSpace
Service Framework
Integration
Sybase Confidential Propriety.
COMPONENTS of the WAD IDE
Web Application Development Perspective Creation wizards (application, page and resources) Web Page Designer (graphical editor) Tab-based Properties View Databinding View Resource Bundle Editor (tabular-based editor) Faces-config Editor (graphical editor…navigation rules) Web.xml Editor (form-based editor…
Deployment to runtime container DataWindow Designer DataWindow Library Importer
Sybase Confidential Propriety.
WEB APPLICATION DEVELOPMENT PERSPECTIVE
WorkSpace Navigation View Tree view of components in the application
Editors view All editors will be displayed in this view
Properties view Properties and attributes of each widget
Databinding view Data and managed beans used by the page
Service Explorer, Enterprise Explorer Service Explorer displays a tree view of available services Enterprise Explorer displays server connection profiles available
Sybase Confidential Propriety.
FEATURE SET :In the Interest of Time…Just One Sample
Databinding View Resource Bundle Binding: use key to bind to UI component; Service Binding: generate managed bean to wrap service
invocation; Java Class Binding: generate managed bean with getter/setter EJB Binding: generate bean to lookup ejbs and create bean
instances Database Binding: support JSF DataWindow, or hibernate
Sybase Confidential Propriety.
Building JSF Web App Demo
Sybase Confidential Propriety.
JSF DataWindow
Sybase Confidential Propriety.
DATAWINDOW AND THE JSF TECHNOLOGY
Java DataStore.
A pure java package which provides the DataWindow functionality to the Java world.
JSF DataWindow Component.
A custom UI component written to fit the JSF model.
DataWindow Java Bean.
A Java Bean non-UI component written to fit the JSF model.
JSF DataWindow tag library
A tld file containing the attributes of the DataWindow for a JSP page.
Sybase Confidential Propriety.
DATAWINDOW AND THE JSF TECHNOLOGY
DataWindow JSF
Component Java
Datastore
DataWindow Bean
JSF Web Application
DataWindow JSF tag library
Faces-Config.xml
Sybase Confidential Propriety.
JAVA DATASTORE INTERFACE
Pure Java package.
Distributed as jdatastore.jar.
Non-visual Java Wrapper for DataWindow Server.
Can be used by the Java programmer for non-UI DataWindow functionality.
A JNI based interop layer to the DataWindow Server.
The DataWindow Server.
Java Datastore
JNI Interop Layer
DataWindow Server +Database Interface Layer +
XML Support +PDF Support
Marshalling and Event HandlingManagement
Sybase Confidential Propriety.
JAVA DATASTORE
Sample Code
Sybase Confidential Propriety.
JSF DATAWINDOW IN DESIGN TIME
The DataWindow object and DataWindow painter.
Exposed as plugins in Eclipse environment.
Maintained in pbl files. Imported as an Eclipse resource.
Sybase Confidential Propriety.
JSF DATAWINDOW IN DESIGN TIME
JSF DataWindow designed using Sybase Web Application Development page designer.
Drag and Drop from pallete.
Sybase Confidential Propriety.
JSF DATAWINDOW IN DESIGN TIME
Drag and Drop DataWindow object from the navigator.
JSF DataWindow design time properties.
Sybase Confidential Propriety.
JSF DATAWINDOW IN DESIGN TIME
JSF DataWindow design time properties.
dataWindowObject
displayOnly
enableDataCaching
jndiDataSource
libraryList
objectLink
onLoadHandler
rendered
rowsperPage
Sybase Confidential Propriety.
JSF DATAWINDOW IN DESIGN TIME
Creating relationship between multiple JSF DataWindows in a MasterDetail type scenario.
Add Text
Sybase Confidential Propriety.
JSF DATAWINDOW PROPERTIES,METHODS AND EVENTS
The Rich DataWindow API is accesible through the JSF DataWindow.
More than 100 methods are available.
Categorized as
Dynamic DataWindow creation function.
Retrieve functions
Search functions
Get / Set functions
Import / Export Functions
Sybase Confidential Propriety.
JSF DATAWINDOW PROPERTIES,METHODS AND EVENTS
Access and Modify DataWindow object metadata at runtime.
Use the describe and modify methods.
Sybase Confidential Propriety.
JSF DATAWINDOW PROPERTIES,METHODS AND EVENTS
JSF DataWindow generated server events.
RetrieveEvents (BeginRetrieve,EndRetrieve,RowRetrieved)
UpdateEvents (BeginUpdate, EndUpdate)
SqlPreview Events (SQLPreviewEvent)
Print Events (BeginPrint,EndPrint,PrintPage)
DWLoadedEvent
JSF DataWindow server event listeners
RetrieveListener
UpdateListener
SqlPreviewListener
PrintListener
DataWindowOnLoadListener
Sybase Confidential Propriety.
JSF DATAWINDOW PROPERTIES,METHODS AND EVENTS
Sybase Confidential Propriety.
JSF DATAWINDOW PROPERTIES,METHODS AND EVENTS
JSF DataWindow client events.
Sybase Confidential Propriety.
JSF DATAWINDOW TRANSACTION MANAGEMENT
JNDI datasource as the database connection information.
Configure the JNDI datasource in the respective App Server.
Use that JNDI name in the jndiDataSource property of the JSF DataWindow UI component.
DataWindow JSF Component
“jndiDataSource”
tag
Bind the Connection
to a DataWindowTransaction
object
Extract JDBC connection
from the DataSource
DatabaseConnection
JNDI
DataSource
Sybase Confidential Propriety.
JSF DATAWINDOW TRANSACTION MANAGEMENT
Sharing of Transaction information among multiple JSF DataWindows on a page.
The user can persist the Transaction information in a JSF “session variable” and share it between multiple DataWindows.
This can be accomplished in the DWLoadedEvent Handler.
Sybase Confidential Propriety.
JSF DATAWINDOW TRANSACTION MANAGEMENT
User Controlled Transaction Management.
Manage the Transaction information through the DWLoadedEvent handler.
Sybase Confidential Propriety.
JSF Web DataWindow Demo
Sybase Confidential Propriety.
JSF Web DataWindow
Q & A
Sybase Confidential Propriety.
PowerBuilder Application Server Plug-In
Sybase Confidential Propriety.
What is it?
• A Deployment Tool that wraps PowerBuilder NVOs as EJB Session Beans (optionally as
J2EE 1.4 Web Services) for deployment into a J2EE 1.3+ compliant application server.
• A Server Runtime Library that integrates the PowerBuilder Virtual Machine with the EJB container
and transaction and connection managers of the application server.
• A Remote Debugging Component that permits debugging from the PowerBuilder IDE.
• A Web DataWindow Component that permits browser-based clients to utilize DataWindow functionality.
• A Proxy Server that permits PB clients to call deployed PB NVOs without the use of a
client side Java virtual machine.
Sybase Confidential Propriety.
Application Server
Architecture Diagram
Deployment Tool(JaguarCompiler)
PowerBuilder IDE
Remote Debugging Component
Server Runtime Library
PowerBuilder VM
Web DataWindow Component
EJB Container
EJB Clients
PB Clients
Web Container
Proxy Server
Server Machine
Web Clients
Client Machine
Developer Machine
PB Components(EJB Session Beans)
(EJB Web Services)
Sybase Confidential Propriety.
Supported Application Servers
• JBoss 4.0• WebLogic 8.1 (9.0 at GA)• WebSphere 6.0• Post-1.0
Geronimo 1.0 Oracle 10 (OC4J)
• Others may work, but are not tested by Sybase and configuration instructions may vary from what we document.
Sybase Confidential Propriety.
Supported Operating Systems
• Development environment Windows
• Server runtime environment - same as the supported platforms for PBVM with Sybase EAServer. Windows Solaris AIX HP/UX
Sybase Confidential Propriety.
PowerBuilder IDE Integration
• This deployment tool runs on your application server machine, and emulates the Sybase EAServer PB NVO deployment API.
• To create a component (in PowerBuilder IDE) New -> Target -> EAServer Component, or New -> Project -> EAServer Component, or New -> Project -> EAServer Component Wizard
• To deploy a component (in project painter) “Deploy Button”, or Design -> Deploy Project
• No changes to PowerBuilder IDE are needed! Sort of…
Sybase Confidential Propriety.
Installation
• The PB server plugin is installed on the application server host.
• This does not need to be the same machine where the PowerBuilder IDE is running.
• The PowerBuilder server VM (or full IDE for Windows) must also be separately installed on the application server host.
Sybase Confidential Propriety.
Development – Components
• Develop components as if you were writing NVOs for deployment to Sybase EAServer.
• Check the PowerBuilder documentation for general instructions.
• The deployment tool will wrap your PB NVOs as standard EJB session beans. Target-specific deployment descriptors are generated to
automate the binding of JNDI names and JDBC data source resource references.
Sybase Confidential Propriety.
Development – Data Access
• PowerScript (in NVO source code):sqlca.dbms = “JDBC”sqlca.dbparm = “CacheName=’DefaultDS’”connect; // check error code... // use embedded SQL or DataStoredisconnect; // check error code
• Use your application server’s facilities to define JDBC data sources and assign JNDI names to them.
• The %PB_SERVER_HOME%/config/pb-server-XXX.xml can be edited to map PB “cache names” to JNDI names for JDBC Data Sources. This applies even when using native drivers.
Sybase Confidential Propriety.
Data Sources – ODBC
• PowerScript (in NVO source code):sqlca.dbms = ‘ODBC’sqlca.dbparm=“CacheName=’OdbcDS_JCM’”...
• When setting up your data source, use: JDBC driver class:
com.sybase.jaguar.jcm.OdbcDriver Database URL:
jcm:TBD;...
• If you need XA (2 phase commit), use JDBC.• You don’t need to use the cache name OdbcDS_JCM. You can
define custom cache names in config/pb-server-XXX.xml.
Sybase Confidential Propriety.
Development – Data Types
PowerBuilder type Java type
Boolean boolean
Char char
Integer, UnsignedInteger short
Long, UnsignedLong int
LongLong long
Real float
Double double
Decimal java.math.BigDecimal
Blob byte[]
String java.lang.String
Date java.sql.Date
Time java.sql.Time
DateTime java.sql.Timestamp
ResultSet java.sql.ResultSet
NVO Class EJB remote and home interfaces
Array Type Java array
Structure Type Java class with public fields
This table shows the mapping of PB data types to Java data types that is applied when an NVO package is wrapped as an EJB module.
Sybase Confidential Propriety.
Development – Array Results
• PowerBuilder does not permit methods to directly return arrays.
• To return an array, embed it inside a PB structure type.
• PB structure types are mapped to Java classes with public instance fields.
Sybase Confidential Propriety.
Development - DataStore
• The PB DataStore type, in combination with the ResultSet return type, is particularly useful for PB NVOs running in an application server.
• For improved performance, use PB NVO instance variables and create the DS and assign the “dataobject” in your NVO constructor. But check application server memory usage!
Sybase Confidential Propriety.
PB ErrorLogging Class
• Writes to plugin log file. %PB_SERVER_HOME%\logs\pb-server.log
• PowerScript Usage:ErrorLogging loggergetContextService(“ErrorLogging”, logger)logger.log(“My Message”)
Sybase Confidential Propriety.
PB TransactionServer Class
• Supported methods: CreateInstance, DisableCommit, EnableCommit, IsCallerInRole,
IsTransactionAborted, SetAbort, SetComplete.• CreateInstance notes (for NVO to NVO inter-component calls):
Use the two argument form and specify full JNDI name of target component, e.g. (error checking code omitted for brevity)TransactionServer tsgetContextService(“TransactionServer”, ts)pbtest_MyComp comp // remember to generate and use proxiests.createInstance(comp, “pbtest/MyComp”)// call methods on comp
If the target NVO is not in the same EJB-JAR as the calling NVO, you might encounter issues with your application server’s class loader (e.g. ClassCastException). Sybase will NOT support NVO inter-component calls across EJB-JAR boundaries if you encounter class loader issues. Consult your application server vendor for assistance with class loader issues across EJB-JAR boundaries.
Sybase Confidential Propriety.
Development – EJB Clients
• For EJB clients, use your application server’s facilities for EJB client access.
• If your package is named “MyPackage”, and your component is named “MyComp”: The generated EJB home interface is named
ejb.components.mypackage.MyCompHome The generated EJB remote interface is named
ejb.components.mypackage.MyComp The Java package for home and remote interfaces can be
overridden. See “Deployment – Java Packages”. The JNDI name is “MyPackage/MyComp”.
Sybase Confidential Propriety.
Development – PB Clients
• PowerBuilder has built in facilities for calling EJBs in third party application servers.
• Check the PowerBuilder documentation for the EJBConnection class and your application server documentation for general instructions.
• Alternatively, we provide a proxy server to permit native IIOP communication (without client-side JVM) from PB clients to NVOs running in your EJB server.
Sybase Confidential Propriety.
Web DataWindow
• Supports browser-based clients using XML, XHTML, HTML.See DataWindow Programmer's Guide.
http://sybooks.sybase.com/onlinebooks/group-pb/pbg1000e/dwprgug
• Note change - to configure (generate and deploy EJB-JAR): cd %PB_SERVER_HOME%\bin configure web-data-window
• Note change - to instantiate (from JSF, JSP, servlet etc.):import com.sybase.pb.datawindow.*;…InitialContext nc = new InitialContext();HtmlGenerator100Home home =
(HtmlGenerator100Home)javax.rmi.PortableRemoteObject.narrow(nc.lookup(“DataWindow/HTMLGenerator100”), HTMLGenerator100Home.class);
HTMLGenerator gen = home.create();
Sybase Confidential Propriety.
Deployment – General
• In the PB Project Painter, for your component project(s), use the “EAServer Host” tab in the “Project Properties” dialog: Host name: TCP host name for server machine Port - 9000 Login ID - admin@system Login password - (remember, you set it!)
• You can override the host name and port number that the server uses for its deployment listener by changing the iiopListeners property in config/pb-server.xml.
Sybase Confidential Propriety.
Deployment – Web Services
• Not generated by default.• In the Project Painter Properties dialog, General tab, use
the Comments box to specify which components must be generated as webServices, e.g.
javaPackage=“...”;webServices=“MyComp1,MyComp2”;
• Remember the semicolon at the end of this entry.• Your application server must support J2EE 1.4.• The ResultSet return type is not supported for web
services. Use array and structure types instead.• Don’t use the WebService tab, or the “wizard” option to
expose a component as a web service. These are only for Sybase EAServer (with Web Services Toolkit).
Sybase Confidential Propriety.
Deployment – Naming Conventions
• PowerScript identifiers with underscore are mapped to Java “camel case” for structure fields and NVO methods, e.g. “my_simple_method” maps to “mySimpleMethod”.
• A leading capital is used for structure types e.g. “my_structure” maps to “MyStructure”.
• Component names are not changed from what you specify in the Project Painter. We recommend using the Java class naming conventions (e.g. “MyComp”).
• Your NVO implementation class can use any name.
Sybase Confidential Propriety.
Deployment – Validation Test
• Using the PowerBuilder IDE, define a component with package name “pbtest” and component name “MyComp”.
• Add some business methods of your choice. You might want to try some methods with database access.
• Deploy to your application server.• Run the following commands:
cd %PB_SERVER_HOME% bin/pb-server-test
• The test program will try to call all methods of your component with “fake” parameter values (e.g. 1, 2, “S1”, S2”, …)
• If you have a method named “perftest”, the test program will call it repeatedly to provide basic performance metrics.
• Source code for the test client program can be found in src/java/com/sybase/pb/server/PbServerTest.java.
Sybase Confidential Propriety.
Remote Debugging
• Use the “Start Remote” button in the PowerBuilder debugger to start a remote debugging session, as if debugging a component in Sybase EAServer.
• Check the PowerBuilder documentation for detailed instructions.
Sybase Confidential Propriety.
Troubleshooting
• PB application server plugin log: %PB_SERVER_HOME%\logs\pb-server.log
• Your application server log file(s).• Your application server console window (if
applicable).
Sybase Confidential Propriety.
Licensing, Pricing, Release…
• Licensing model: TBD• Packaging: TBD• Pricing: TBD• Release date: August 2006
• PowerBuilder IDE Accomodating Enhancements Replacement of semicolon-delimited string in Comments
field of General tabpage of Project Properties Post PowerBuilder 10.5 EBF
Sybase Confidential Propriety.
Sybase Tools
Thank You