Download presentation
Presentation is loading. Please wait.
Published byNigel Barton Modified over 9 years ago
2
® Best Practices for Creating Applications with IBM WebSphere Portlet Factory Jonathan Booth | Senior Architect, WebSphere Portlet Factory | IBM AD504
3
Best practices topics Introduction Creating applications using a service oriented architecture Controlling and customizing the user interface Choosing the right builder Building multiple application variations with profiling Optimizing performance Building for multiple platforms Top 10 development best practices Q & A
4
4 WebSphere Portlet Factory Rapid development Robust integration capabilities (SAP, Domino, relational DB, web services and REST services, PeopleSoft, Siebel, and more) Service-oriented development Support for many deployment platforms: WebSphere Portal WebSphere Application Server (servlet or portlet) IBM MashupCenter (widget) Lotus Notes 8.x Runs on Eclipse or IBM Rational tools IBM WebSphere Portlet Factory simplifies & accelerates the development of custom portlets and applications
5
5 Key concepts: builders Capture design patterns and automate the creation of code Have easy to use, wizard-like interfaces Create or modify any number of application elements Pages, schemas and data, server- side and client-side actions and logic, back end connectivity, etc. /** * Generated Method [employees_SelectRow] */ public void employees_SelectRow(WebAppAccess webAppAccess, Integer rowIndex, String nextAction) { int index = rowIndex.intValue(); Variables vars = webAppAccess.getVariables(); int selectedRow = index - 1; IXml data = vars.getXml("employeesGetEmployeesByDeptResults"); if (data == null) return; data = data.findElement("EmployeeList"); if (data == null) return; int row = 0; IXml child = data.getFirstChildElement(); while (child != null) { if (row == selectedRow) { vars.setXml("employees_SelectedRowData", child); break; } row++; child = child.getNextSiblingElement(); } webAppAccess.callMethod( "employeesGetEmployeeRecord" ); webAppAccess.processAction(nextAction); }
6
6 Key concepts: models Models are containers for builders Developers work iteratively with builders in a model, adding and modifying builders to get desired functionality A model is typically used to create a service or presentation pages
7
● Portlet Factory and software automation Portlet Factory’s model-based development paradigm – using builders – is different than other development tools You specify the inputs that control code generation Builders generate all the code, optionally incorporating hand-edited code Builders implement patterns – from high-level service and user interface patterns, to low-level page elements The benefit of this approach is rapid development and a high degree of automation Best practices have evolved over the past several years of experience with this paradigm
8
Best practices topics Introduction Creating applications using a service oriented architecture Controlling and customizing the user interface Choosing the right builder Building multiple application variations with profiling Optimizing performance Building for multiple platforms Top 10 development best practices Q & A
9
● Service oriented builders in Portlet Factory SOA builders in Portlet Factory make it easy to implement a service provider/consumer architecture These builders work in a consistent way with any back end data source: Data integration builders provides access to data source Service Definition builder defines a service provider model for use by consumers Service Operation builders define the operations to expose to consumers Service Consumer allows you to consume service operations in presentation models
10
10 Presentation models Service Consumer Service Definition SQL Call Service Operation SQL Call Service model DB Service Consumer View & Form Service and presentation models
11
11 Presentation models Service Consumer Service Definition Domino Data Access Service Operation Domino Data Access Service model Service Consumer View & Form Service and presentation models – Domino
12
12 Presentation models Service Consumer Service Definition Web Service Call Service Operation Web Service Call Service model Service Consumer View & Form Remote server or Enterprise Service Bus Service and presentation models – web services
13
Benefits of using a service architecture Separate back end and presentation development Automatic support for service testing Develop consumer (presentation) model without any back end access, using stub service model Reuse services in multiple presentation models Transform data between back end schema and some other schema Switch between service implementations without changing consumer model Demo: creating a portlet using a service architecture
14
High-level steps for application development 1. Create a service model for data access 2. Use builder such as View & Form to create the initial presentation Forms and views are automatically generated from the schema 3. Use high-level builders to control overall user interface 4. Apply fine-grained builders where needed For example, for additional navigation 5. Add and modify builders iteratively until the application functions and looks as desired
15
Best practices topics Introduction Creating applications using a service oriented architecture Controlling and customizing the user interface Choosing the right builder Building multiple application variations with profiling Optimizing performance Building for multiple platforms Top 10 development best practices Q & A
16
● Controlling and customizing the user interface Portlet Factory uses “Page Automation” technology to generate pages based on schema definitions For example, View & Form builder and Data Page builder Best practice is to use this automation for any data display and input These builders work with a whole set of fields at a time They adapt automatically to schema changes Builders are used to customize and control the various aspects of the user interface: Forms and data display (formatting, validation, pickers, etc.) Overall style and look and feel (colors, fonts, etc.) Page layout Navigation and other added elements
17
Controlling the UI: forms and data display Portlet Factory has several builders for controlling and customizing forms and views Some builders target a whole set of page elements, for maximum automation Rich Data Definition applies UI characteristics (validation, formatting, UI type, labels, etc.) across many fields Other builders target a specific page element Data Field Modifier sets UI characteristics Attribute Setter sets HTML attributes Goal: use maximum automation whenever possible; use detailed individual customization when needed
18
Controlling forms and views with Rich Data Definition Schema
19
Controlling forms and views with Rich Data Definition Schema Rich Data Definition for schema ORDER_ID DATE_ORDERED STATUS STATE Rich Data Definition Shared Library base_Date base_Currency base_US_State Demo: using Rich Data Definition
20
Controlling the UI: overall style and look and feel New in Portlet Factory 6.1.2: Themes Themes allow you to centrally control and modify the look and feel: Styles (CSS) Page layouts Table and form layout rules Table highlighting and paging controls A theme can be applied for a model, or automatically for a whole project You can also override specific theme elements at any level Demo: using themes
21
● Controlling the UI: page layouts Overall page layout is controlled with imported HTML pages Imported pages include placeholders (named tags) where content will be inserted Field layout, grouping, and visibility can be controlled with builders For complete customization of field layout, use an HTML page with all the field locations (named tags) for a schema Use “Export HTML” command to create HTML file with named tags Select the generated file in builder such as View & Form Iteratively modify the HTML file using an HTML editor to position fields as desired
22
Controlling the UI: navigation and other added elements There is a large set of builders that add elements to pages: Navigation (buttons, links, tabs, etc.) Inserted pages and models Ajax functionality Builders generate all the needed client-side and server-side code Dojo features Drag and drop Popup “tooltip” windows Rich Text Editor Demo: using Dojo and Ajax
23
Best practices topics Introduction Creating applications using a service oriented architecture Controlling and customizing the user interface Choosing the right builder Building multiple application variations with profiling Optimizing performance Building for multiple platforms Top 10 development best practices Q & A
24
● Choosing the right builder Portlet Factory has over 150 builders, and it's not always easy to know the best builder for a task This next section lists some common tasks, showing the builder that is best used to accomplish the task It is derived from the “Getting Started Guide” located at: http://www-10.lotus.com/ldd/pfwiki.nsf/dx/getting-started-with-portlet-factory-6.1 You aren't expected to remember everything from these slides! Get a sense of what's available Refer to the Getting Started Guide when you do your work
25
Choosing builders – creating services TaskBuilder Get access to data store Use data access builder from following slide Define a service Service Definition Add an operation to a service Service Operation Generate a test harness for a service Use the “testing support” inputs of Service Definition builder Create a stub service model In Service Definition builder, use the “Generate Stub” button Create a WSDL/SOAP service provider In Service Definition builder, use the “Generate WSDL” checkbox Create a REST service provider REST Service Enable
26
Choosing builders – data access builders System or Data SourceBuilder Relational databaseSQL Call Lotus ® Domino ® Domino Data Access Microsoft ® Excel ® Excel Import Java ™ classLinked Java Object PeopleSoft ® Peoplesoft Component Interface SAP ® SAP Function Call Siebel ® Siebel Business Component Web Service Web Service Call Web Service Multiple Operations REST service, including Lotus Connections and Lotus Quickr REST Service Call XML DataVariable or Import to XML Human tasks from WebSphere Process Server Builders from Business Process Integration Extension (SOA Catalog) Demo: accessing Lotus Connections using REST services
27
Choosing builders – creating the initial user interface TaskBuilder Access a service model Service Consumer Create portlet pages based on service data View & Form Input Form Create a page with a graphical chart of data Imported Page and Web Charts Make a model available as a portlet Portlet Adapter Add some structured data to a page, for viewing, input, or update Data Page
28
Choosing builders – working with columns and data layout TaskBuilder Hide columns in a table Data Column Modifier Rich Data Definition Add sorting capabilities Data Column Modifier Reorder the columns in a table or add new columns Data Column Modifier Add grouping to fields on a page Data Hierarchy Modifier Create multiple columns for form data Form Layout Add buttons to expand and collapse data by category Category View Display and hide detail information Collapsible Section
29
Choosing builders – validation, formatting, and field UI TaskBuilder Format and validate data in fields Rich Data Definition – for maximum automation Data Field Modifier – for individual fields Change the UI behavior for a field (e.g., change to checkbox or radio button, mark read- only, or create a link) Rich Data Definition Data Field Modifier Create user-friendly labels for fields Data Column Modifier Rich Data Definition Create resource bundle using “Export Resource Bundle” from page, then reference from builders such as View & Form Translate internal values into meaningful names Lookup Table Rich Data Definition (create Lookup from RDD XML file) Apply a lookup table to pages with Data Field Modifier, Select, Text, or Radio Button Group
30
Choosing builders – actions and events TaskBuilder Create a list of actions Action List Assign a value to a variable Action List (select Assignment under “special” actions) Use some Java code Linked Java Object Method Add portlet-to-portlet communication Cooperative Portlet Source and Cooperative Porlet Target (for Property Broker Events or Wired Portlets) Event Declaration and Event Handler (for simple events) Add error handling to a portlet Error Handler Add caching to improve performance Cache Control Service Operation builder – caching option
31
Choosing builders – navigation and page actions TaskBuilder Add action controls to a page Button Image Button Link Run an action when a form is submitted Form Submit Action Run an action when a user clicks or types on a page HTML Event Action Put pages onto separate tabs with navigation between tabs Page Tabs Add paging controls to a table Use the paging options in View & Form builder Data Column Modifier with Paging Buttons or Paging Links Link to another portlet on same or different page Cooperative Portlet Source/Target Add a drop-down menu to a page Contextual Menu
32
Choosing builders – controlling page elements TaskBuilder Show/hide an element based on a condition Visibility Setter Set an HTML attribute for a specified page element HTML Attribute Localize the text strings for a portlet Localized Resource Insert one page in another Inserted Page Display some read-only text on a page Text Add some client-side JavaScript to a page Client JavaScript™ Demo: creating a multi- language portlet
33
Choosing builders – using schemas and variables TaskBuilder Create an XML variable Variable Use an existing schema Use Schema builder to reference existing XSD file Use Variable builder to create a variable based on the schema Create a simple schema Use Variable builder to create an XML variable with the desired structure Use Simple Schema Generator to make a schema from Variable Use an existing Java Bean Linked Java Object Java/XML Converter can be used to convert to XML Transform data between schemas Use Service Operation builder for simple mapping Transform builders For more complex XML manipulation, use Java code that manipulates Ixml Transform builders
34
Choosing builders – portal integration features TaskBuilder Make a model available as a portlet Portlet Adapter Wire your portlets together and communicate between them Cooperative Portlet Source and Cooperative Porlet Target Add support for Edit and Configure mode Use Edit and Configure settings in Portlet Adapter builder, after profiling builder inputs Create a customizer for a business user or administrator Use Portlet Customizer in a customizer model Specify your customizer as a “custom model” choice in the Portlet Adapter builder of your portlet Integrate ‘people awareness’ or Sametime chat capabilities People Awareness (part of Lotus Collaboration Extension feature set) Retrieve user credentials from Credential Vault, to support single sign-on with external back end applications WebSphere Portal Credential
35
Choosing builders – using Ajax and Dojo TaskBuilder Use partial page refresh for a region of a page or for an entire model Ajax Region Builder Use partial page refresh for a specific action Use page action builders such as Link or Button Set the “Post Action Behavior” to “Refresh specified page location after running action” Use client side events Event Declaration Builder Client Event Handler Builder Enable Drag and Drop on your page Dojo Drag Source Dojo Drop Target Add popup “hover” information to a page element Dojo Tooltip Other Ajax related builders to explore Ajax Type-Ahead, Dynamic Validation, Dojo Enable, Dojo Inline Edit, Timed Action, Highlighter, Global Ajax Enablement, XML/JavaScript Converter
36
Choosing builders – sharing model functionality TaskBuilder Use some common builders in a number of models Imported Model Include another model visually on a page, with support for navigation in the contained model Model Container Reuse the actions or methods of another Model Linked Model
37
Best practices topics Introduction Creating applications using a service oriented architecture Controlling and customizing the user interface Choosing the right builder Building multiple application variations with profiling Optimizing performance Building for multiple platforms Top 10 development best practices Q & A
38
● Building multiple application variations with profiling Dynamic profiling can be used to generate multiple application variations from a single source model Variations can be tied to user roles, groups, or other attributes For different customers, partners, regions, etc. Profiling also supports customization by administrators or end users Configure, Personalize, and Edit Shared Settings in Portal Enables business users to customize the application – without requiring additional coding by developers Any aspect of application can be varied by profile: look and feel, level of functionality, services, logic, etc. Demo: dynamic profiling
39
Best practices topics Introduction Creating applications using a service oriented architecture Controlling and customizing the user interface Choosing the right builder Building multiple application variations with profiling Optimizing performance Building for multiple platforms Top 10 development best practices Q & A
40
● Best practices for performance and scalability Avoid retrieving large data sets ● Try to retrieve small or moderate size data sets ● Use paging to back end if possible 1Enable cross-user caching when feasible ● Enabled with Service Operation or Cache Control builders 2Use Portlet Factory's built-in performance logging and tracing tools ● See next slide 3Avoid deploying a large number of Portlet Factory WAR files ● A single WAR can include any number of portlets 4Use automated load test tools to validate performance 5Use the latest version of Portlet Factory 6See recommendations from the tuning guide for WebSphere Portal
41
Built-in performance logging and tracing tools System tracing or model action tracing The quickest way to pinpoint any slowness for particular actions Instantly shows where the time is spent Easily enabled when running from Designer or with property file Server stats A log file that periodically captures statistics about usage and performance on a running server under load See the WEB-INF/logs/serverStats.txt file in deployed WAR Captures numerous statistics, such as request actions and their latency and requests to external systems Session size diagnostics Reports estimated size of session variables Demo: using system tracing
42
Best practices topics Introduction Creating applications using a service oriented architecture Controlling and customizing the user interface Choosing the right builder Building multiple application variations with profiling Optimizing performance Building for multiple platforms Top 10 development practices Q & A
43
43 ● Building for multiple platforms Portlet Factory can be used to build applications for: WebSphere Portal Server 6.0, 6.1 WebSphere Application Server 6.0, 6.1, 7.0 (as servlet or portlet) Lotus Mashups 1.0, 1.1 (as widget) - New in Portlet Factory 6.1.2 Lotus Notes 8.x or Expeditor 6.1.1+ (as portlet)
44
44 WebSphere Portal A Factory for all platforms Use one common set of tools, techniques, and application code… Process Server tasks Quickr and Connections services Databases Domino MashupHub Feeds Web services and REST services SAP …and deploy to many platforms Portlet Factory WebSphere Application Server Notes 8 / Expeditor Lotus Mashups PeopleSoft Siebel Demo: running on Lotus Mashups
45
45 Considerations for multiple platforms The vast majority of builders work on all platforms Data integration, services, page automation, theme, etc. A few builders need special consideration Eventing: no Cooperative Portlet on Mashups or WebSphere Application Server (use widget events or basic Portlet Factory events instead) Portal-specific builders or APIs such as Credential Vault, Portal Group profile selection, and People Awareness cannot be used on non-Portal platforms Profiling can be used to dynamically enable/disable platform specific builders E.g., “Portal Execution Mode” profile selection handler
46
Best practices topics Introduction Creating applications using a service oriented architecture Controlling and customizing the user interface Choosing the right builder Building multiple application variations with profiling Optimizing performance Building for multiple platforms Top 10 development best practices Q & A
47
Top 10 development best practices 1Use a service provider/consumer model architecture 2Use the highest-level builder available for the job 3Use Page Automation builders for display and input of data (View & Form, Input Form, Data Page) 4Use Rich Data Definition to simplify and centralize field formatting, validation, and UI 5Try to keep model size under 50 builders
48
Top 10 development best practices 6Don't write lots of code in Method builder - use Linked Java Object instead 7Use the Theme support in Portlet Factory 6.1.2 to control UI style 8Use system tracing feature to examine program flow and to look for performance issues 9Use the samples on the wiki to get going quickly with new techniques 10Utililize the developerWorks forums for specific questions or problems
49
Additional information and resources Portlet Factory wiki http://www-10.lotus.com/ldd/pfwiki.nsf http://www-10.lotus.com/ldd/pfwiki.nsf Includes numerous samples and articles, best practices documents, and links to other resources Portlet Factory forums on developerWorks http://www-01.ibm.com/support/docview.wss?rs=3044&uid=swg27011853 http://www-01.ibm.com/support/docview.wss?rs=3044&uid=swg27011853 These are very active and are monitored closely by the Portlet Factory team Portlet Factory zone on developerWorks http://www.ibm.com/developerworks/websphere/zones/portal/portletfactory/ http://www.ibm.com/developerworks/websphere/zones/portal/portletfactory/
50
® Q & A
51
Legal disclaimer © IBM Corporation 2008. All Rights Reserved. The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino, Quickr, Sametime, WebSphere, UC2, PartnerWorld and Lotusphere are trademarks of International Business Machines Corporation in the United States, other countries, or both. Unyte is a trademark of WebDialogs, Inc., in the United States, other countries, or both. IJava and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. I
52
® Extra slides
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.