98

Best Practices when Developing with IBM WebSphere Portlet Factory

  • Upload
    marty

  • View
    29

  • Download
    2

Embed Size (px)

DESCRIPTION

BP202. Best Practices when Developing with IBM WebSphere Portlet Factory. Paul T. Calhoun / CTO, NetNotes Solutions Unlimited, Inc. Your Presenter – This Is Me!. Paul T. Calhoun Chief Technology Officer NetNotes Solutions Unlimited - PowerPoint PPT Presentation

Citation preview

Page 1: Best Practices when Developing with IBM WebSphere Portlet Factory
Page 2: Best Practices when Developing with IBM WebSphere Portlet Factory

®

Best Practices when Developing with IBM WebSphere Portlet Factory

Paul T. Calhoun / CTO, NetNotes Solutions Unlimited, Inc.

BP202

Page 3: Best Practices when Developing with IBM WebSphere Portlet Factory

Your Presenter – This Is Me!

Paul T. CalhounChief Technology OfficerNetNotes Solutions Unlimited

Paul Calhoun, ND 6,7 and 8 PCLI and PCLP,is a highly rated speaker who provides customer-focused knowledge transfer and consulting to Fortune 100 and 500 companies, as well as many SMBs. Paul currently builds Domino, Web, Java, and XML applications for his customers using Domino, Portlet Factory and WebSphere.

He co-authored the IBM Redbook “XML Powered by Domino,” and has developed several online XML and Java programming courses. He has written articles for both “The View” and “The Sphere” technical publications.

Page 4: Best Practices when Developing with IBM WebSphere Portlet Factory

Agenda

So What Exactly is the Portlet Factory ?

Installing Portlet Factory

Creating Projects

Creating Models

Testing and Deploying Models

Portlet Factory Development

Wrap up

Page 5: Best Practices when Developing with IBM WebSphere Portlet Factory

Agenda

So What Exactly is the Portlet Factory ?

Installing Portlet Factory

Creating Projects

Creating Models

Testing and Deploying Models

Portlet Factory Development

Wrap up

Page 6: Best Practices when Developing with IBM WebSphere Portlet Factory

So What Exactly is the Portlet Factory

The Portlet Factory Described in 50 words or less…

The IBM Portlet Factory is a Rapid Application Development environment that allows for the creation of Web Applications and Portlets without having to write any code. These applications can then be massively customized to provide different user experiences with the use of profiled input.

Page 7: Best Practices when Developing with IBM WebSphere Portlet Factory

So What Exactly is the Portlet Factory

Terminology Portlet Factory – The application design environment enabled as a plug in to

IDE’s like Rational and Eclipse Factory Project – Top level container for Portlet Factory elements (Models,

supporting HTML, XML, CSS files) A project can contain “N” number of models

Model – Container for all application functionality represented as an XML structure of the complete Web Application Models are made up of Builders

Builder – Component that provides specific application functionality to the Model

Profiling – The ability to dynamically alter the Application at runtime Profile Sets – Container for the dynamic values that alter the Application at

runtime Profile Entry – Specific profiled builder input

Page 8: Best Practices when Developing with IBM WebSphere Portlet Factory

So What Exactly is the Portlet Factory

Creates WEB APPLICATIONS that can be PORTLET enabled very easily

Designer client that plugs into existing IDE’s

Rapid Application Development Environment

Zero Code Development Portlet Factory generates ALL the code for you No, you CAN NOT alter the GENERATED code No, to the best of my knowledge, you will never be able to modify the

generated code

Allows for the MASSIVE customization of applications via PROFILING at runtime

Page 9: Best Practices when Developing with IBM WebSphere Portlet Factory

So What Exactly is the Portlet Factory

Applications are deployed as standard JEE WAR files To the Web Application Server To the Portal Server

All necessary code is deployed with the WAR file No additional configuration is required on the WAS/Portal server

Page 10: Best Practices when Developing with IBM WebSphere Portlet Factory

Agenda

So What Exactly is the Portlet Factory ?

Installing Portlet Factory

Creating Projects

Creating Models

Testing and Deploying Models

Portlet Factory Development

Wrap up

Page 11: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory

Portlet Factory can be officially installed on the following O/S’s Windows 2003 Windows 2000 Windows XP professional Windows Vista (Version 6.0.2 only)

Portlet Factory is a plug in to Rational

Application Developer V6 and V7 Software Architect V6 and V7 Web Developer V6

Eclipse 3.1.x – PF 6.0 3.2.x – PF 6.0.1/PF 6.0.2

Page 12: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory

Start the install program Install.bat

On the splash screen choose the language of your choice

Click “OK”

Page 13: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory

There will be an Introduction screen and a License screen Click the “Next” button on both of these

On the “Choose Install Location” screen change the install location to something shorter than the default of installing in the program files directory

If you indicate the version number it will allows for the easy installation of multiple versions of the Portlet Factory This may be beneficial if you are supporting projects going forward

that are developed with different versions of the factory Click the “Next” button

Page 14: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory

On the “Specify install items” screen you have three choices Into existing IBM Rational Application Developer Into existing Eclipse And Eclipse

Page 15: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory

ProsMakes sense if you already do the

majority of your development in Rational Tools

Provides editors for XML, XSD Schema, HTML, CSS and other editors out of the box

Includes the WebSphere Application test Server

Supports Rational Application Developer, Rational Software Architect and Rational Web Developer

ConsCan only easily support one

installed version of the Portlet Factory

Requires more system resources (primarily memory) then Eclipse

Due to the number of syntax validators included in the Rational product line, there are many more errors and warnings that have to be ignored in the Problems tab

This makes it difficult to distinguish between the “noise” and real problems

Into existing IBM Rational Application Developer

Page 16: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory

ProsMakes sense if you already have a

working installed copy of the supported version of Eclipse

Requires less system resources (primarily memory) than the Rational products

As there are not as many validators, there are significantly less problems/errors in the problems tab for valid Portlet Factory projects

ConsCan cause problems/errors if not

installed into the proper version of Eclipse

For example the latest release of Eclipse is 3.3, but the latest supported release for the Factory is 3.2

Into existing Eclipse

Page 17: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory

ProsBest choice if no other development

environment is installed on your workstation

Allows multiple versions of Portlet Factory to be installed on the same workstation

Ensures that proper version of Eclipse for running Portlet Factory

Does not alter the configuration of any other installed tools on your workstation

Isolates the Portlet Factory development environment

The workspace can be updated with additional editors to support XML, HTML, CSS and other editors

ConsRequires additional disk space if

other development tools are already installed

Managing workspaces can become difficult if not kept in version specific directories

And Eclipse

Page 18: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory

New to Portlet Factory 6.0.2 is the option to install WebSphere Application Server – Community Edition (WASCE) This provides a light weight alternative to installing and configuring

the App/Portal server on your local workstation Installs as part of The Portlet Factory installation so there is no need to

download, install and configure an alternate WAS server like Tomcat

Page 19: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory

Install WASCE into the same directory that you are installing the Portlet Factory into This keeps all of this versions specific resources together

Page 20: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory

The final screen is a the Pre-Installation screen summarizing the installation choices

Click the “Install” button to complete the installation

Page 21: Best Practices when Developing with IBM WebSphere Portlet Factory

Installing Portlet Factory – Best Practices

Don’t install in the default directory

Choose the “With Eclipse” install option

Install the WASCE server for testing locally

Install Portlet Factory, Eclipse and WAS/CE into the same directory root

If installing multiple version of Portlet Factory (or the same version into different IDE’s) copy the menu shortcuts to your Desktop The Portlet Factory Install over writes the menu items with the latest installation

location

Periodically check for fix packs and updates to ensure you are running the most current version of Portlet Factory

Page 22: Best Practices when Developing with IBM WebSphere Portlet Factory

Agenda

So What Exactly is the Portlet Factory ?

Installing Portlet Factory

Creating Projects

Creating Models

Testing and Deploying Models

Portlet Factory Development

Wrap up

Page 23: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

Regardless of which IDE you extend all factory development is done in the WebSphere Portlet Factory Perspective

Project List

Builder CallList

Problem, Task and Profile tabs

CurrentlyOpenModel

Page 24: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

Create a new Portlet Factory Project using the file menu or the right click menu Choose New > WebSphere Portlet Factory Project

Page 25: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

Provide a project name By default this value becomes the basis for the deployed WAR file

name Keep it short but descriptive

Leave the “Use default location” box checked This will store the project in the workspace

Page 26: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

Feature Sets add functionality to the project for a specific task

In the “Add Feature Sets” dialog select the additional functionality to add to this projectFunctionality that is not added during

project creation can be added later via the projects properties dialog

To access Domino objects, select the “Lotus Collaboration Extension” feature

Tutorial and Samples supply complete working examples of Portlet Factory projects

Don’t include in every project

Tip

Page 27: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

Feature Sets are .pkg files located in the following directory \install_folder\WPFDesigner\FeatureSets\Web-App_6.0.1\Packages .pkg files are Portlet Factory archives Even though they have a .pkg extension, they are just WinZip files and

can be opened with the WinZip utility

The Charting capability is for evaluation/demo purposes only In order to use the charting in production applications you will need to

Upgrade to the Dashboard Framework Get a license from GreenPoint, Inc.

– http://www.gpoint.com

Page 28: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

No additional libraries need to be added to standard Portlet Factory projects Just click Next

Page 29: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

Deployment Configuration defines the test server environments

The test servers need to be running before you create the configurations

You will need to Add a configuration when creating the first project in a every new Workspace Subsequent projects will be able to choose from the existing configurations

You will need to create configurations for the Application Server

WebSphere Application Server – Version 5.x or 6.x WebSphere Application Server – Community Edition Apache Tomcat – Version 5.5

Portal Server WebSphere Portal Server – Version 5.x or 6.x

Page 30: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

You do not have to have the Portal Server installed on your local workstation

You can de-select the “Specify Deployment Credentials” checkbox on the Portal configuration This will still allow you to create portlets in the Portlet Factory, but the

only object that will be created is the deployment WAR file This WAR file can then be installed on any Portal Server (Local or

Remote) via the Administration tools included with the Portal Server

Page 31: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

Completed Deployment Configuration After you click the “Finish” button you

will be prompted to deploy the project now Click “Yes”

Page 32: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

The Configuration details are stored in the workbench preferences under WebSphere Portlet Factory > Deployment The configuration files are located in the following directory

workspacedir\.metadata\.plugins\com.bowstreet.designer.webapp\deploymentconfigs

The files located in this directory can be copied to a central location and then referenced in subsequent workspaces so the that the configurations do not have to be re-created

Page 33: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects

Project folders are configured as JEE applications in the Project Explorer Models folder

Contains all project Models Profiles folder

Contains all profiles WebContent/WEB-INF/work/source

Contains java code that can be accessedby the Linked Java Object (LJO) builder

WebContent Contains support files

– Web Pages

– CSS files

– XML Documents

Page 34: Best Practices when Developing with IBM WebSphere Portlet Factory

Demo – Creating Projects

Page 35: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects – Best Practices

Do not AutoDeploy the Portlet War from the Factory Configuration This allows for the deployment of the WAR file via the Portlet

Administration functionality

Use the WASCE test server installed as part of the Portlet Factory as your Web Application test server locally If running a version prior to 6.0.2, then use the RAD test server or

Tomcat

Do not include the Tutorials and Samples Feature in every project If you need/want these for reference create a separate project

Page 36: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Projects – Best Practices

After creating your first project, copy the Deployment configuration files to a central location for use by new workspaces

Only add the Features that are required for that project

Some Features add sample models, html, xml, css and xsd schema files that are not needed for the production application Either delete these or add them to a “nodeploy” folder prior to

production deployment (Search help for “nodeploy” for more information)

Page 37: Best Practices when Developing with IBM WebSphere Portlet Factory

Agenda

So What Exactly is the Portlet Factory ?

Installing Portlet Factory

Creating Projects

Creating Models

Testing and Deploying Models

Portlet Factory Development

Wrap up

Page 38: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models

Models contain all of the application logic for a Web Application or Portlet

Models are contained in a Project

Create a new model from the file menu or right click menu File > New > WebSphere Portlet Factory Model

Page 39: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models

Select the project this model will be a part of

Click Next

Page 40: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models

On the Select Model page there will be default choices and additional choices based upon features that have been added to the project

The following are the default options Factory Starter Models

Empty Main and Page

Service Consumers List and Detail Service Consumer

Service Providers Database Service Provider

Page 41: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models

Empty An empty model that contains no Builder calls It is a blank slate, to which the developer must add all of the necessary

application functionality Choose this type of new model when you want to build the entire

application without any assistance up front

After you have familiarized yourself with the Portlet Factory this will be the one you start with 94.27% of the time

Page 42: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models

Main and Page A Main and Page model supplies a page and a main action that

presents that page when the application is run You may specify your own page or use the default that is provided for

you This is a very basic starting point from which you may then begin your

development effort

If you are creating a Web Application/Portlet that does not access any data (RDBMS, Domino etc) then this saves you the time of creating two builders you would need any way

Always create this simple model to test new server configurations

Page 43: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models

Database Service Provider Creates a service provider model that exposes operations

corresponding to SQL statements executed against a J2EE data source The data source has to be defined on the Application/Portal server

before the Portlet Factory can consume it This wizard will provide some of the information for the builders that

define this service provider, but most builders will have to be edited

In reality once you have used the wizard vs creating a service provider model from scratch, you will create service provider models from scratch

Page 44: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models

List and Detail Service Consumer This wizard builds a model that displays data from a data service that

is already defined in the project It can create tables and detailed views of data using the View and

Form Builder behind the scenes

In reality once you have used the wizard vs creating a service consumer model from scratch, you will create service consumer models from scratch

Page 45: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models

Other models available during setup Some Features (like the collaboration feature for Domino) will add

wizards to this interface that allow you to use them to create models with that features functionality

Once you have stepped through the wizard once and seen the builders that are included in the model you will probably opt for creating subsequent models from scratch

The final dialog will prompt you for a Model name and location You can create folders that do not exist yet by typing the folder name

in the “Enter or select the folder:” field Enter the model name in the Model Name Field Click Finish

Tip

Page 46: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models

The newly created model will be displayed in the Project Explorer View under the Models folder

All the builders that are used to comprise this model are located in the Outline View

Builder Call List

Model

Page 47: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models

The model is open in the Editor area that can be navigated using the four tabs at the bottom of the view WebApp Tree

Hierarchical structure of the application components After adding a new builder you should review the WebApp tree to see what

was added Model XML

Complete XML representationof the application

If you export a model file,this is the contents of that file

Builder Call Editor Editor where Builder Inputs are supplied

Web App Diagram Graphical Depiction of the application

Page 48: Best Practices when Developing with IBM WebSphere Portlet Factory

Demo – Creating Models

Page 49: Best Practices when Developing with IBM WebSphere Portlet Factory

Creating Models – Best Practice

Create a Main and Page model to test new server configurations

Delete or add this model to the “nodeploy” folder prior to deployment

Use the “Empty” starting Model

Avoid “One Project – One Model” development Remember that Project = Deployed WAR file You can have multiple Models per project (5-10 is the recommended max)

Include a comment builder at the beginning of every Model that describes the models functionality

Page 50: Best Practices when Developing with IBM WebSphere Portlet Factory

Agenda

So What Exactly is the Portlet Factory ?

Installing Portlet Factory

Creating Projects

Creating Models

Testing and Deploying Models

Portlet Factory Development

Wrap up

Page 51: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

All non-portlet specific application testing can be accomplished in the local test server The majority of your testing can be done locally without deploying to

the Portal Server

Create a Run-Time configuration to test Models using the local application server Set the configuration to run the from the current active model

This will require you to only have one Run Configuration Run Configurations can be created for specific model testing

Page 52: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

With a model open in the editor Choose “Run > Run…” from the menu Click on the “Run” tool in the toolbar Use the keyboard shortcut “CTRL-SHIFT-F11”

Page 53: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

The model will run and be displayed in the configured browser

The default test browser is configured in the workbench preferences Window > Preferences / WebSphere Portlet Factory

Page 54: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

Web applications are “Portalized” by adding the Portlet Adapter builder

Page 55: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

Once the a Web Application contains a Portlet Adapter builder the portlet WAR file can be generated for deployment to the Portal Server The WAR file will be created in the directory that was configured

during the project creation

Page 56: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

The Portal Administrator is used to deploy the Portlet WAR Choose Portlet Management > Web Modules from the menu Click on the “Install” button to browse to the WAR file on your local file

system

Page 57: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

Using the “Browse” button locate the Portlet WAR file on your local system

Click the “Next” button to begin deploying the WAR

Page 58: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

On the next screen there will be a summary of the application and the portlets contained in that application that will be deployed

Page 59: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

You will receive a status that the web module was successfully deployed

Page 60: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

Once the WAR file has been deployed, updates to the WAR can be deployed using the “Refresh” functionality of the Portal Administrator

Page 61: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models

The Portlet can then be added to an existing or new Portal page from either the administration interface or the edit page interface

Page 62: Best Practices when Developing with IBM WebSphere Portlet Factory

Demo – Testing Models

Page 63: Best Practices when Developing with IBM WebSphere Portlet Factory

Testing and Deploying Models – Best Practice

Use the local test server to do the majority of you application functionality testing Create a Run configuration to test the currently open model

Do not auto deploy the Portlet WAR file to the Portal server Create a local copy of the Portlet WAR on your local system The process is then the same for deploying to a test or production server

Testing on the Portal Server only needs to occur when You are testing the application as a Portlet on the Portal Server Portlet testing requires authentication

This is usually due to using a custom profile handler Testing different Portlet configurations using explicit profiling

Explicit profiles are applied using the portlets configure mode

Page 64: Best Practices when Developing with IBM WebSphere Portlet Factory

Agenda

So What Exactly is the Portlet Factory ?

Installing Portlet Factory

Creating Projects

Creating Models

Testing and Deploying Models

Portlet Factory Development

Wrap up

Page 65: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

All model functionality is added to the application via Builders

The Builders that are available will depend upon what Features have been added to the Project Core Builders – available to every project

Data access

– SQL

– Web Service Web Pages

– Text, Images, Variables Feature specific builders – Specific to the Features that have been added

Domino SAP AJAX

Page 66: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

In Portlet Factory Builders become the “Language” that you have to learn

Before starting your first Portlet Factory project you should review the Builder help in the Help files You are NOT memorizing each of the Builder call inputs, you are

reviewing the elements you will use to build your application This is same thing you did when you learned

– The Domino Formula Language

– LotusScript

– Java

– C ++

– C #

Page 67: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

Like most languages you will find that you apply the 20/80 rule You will use 20% of the builders 80% of the time

This will be the steepest learning curve for transitioning to the factory This will become easier if you…

Review ALL the builders in the help Go through ALL the tutorials that ship with the Portlet Factory When a feature is added to a project sample models are usually

added

– Review these models to see which builders are used Download and import the Samples that are available on

Developerworks

Page 68: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

Don’t lose sight of the fact that the end result produced by the Portlet Factory is a JEE application This means that every application that produces output has to start

with a “main” method Service Consumer Models Static web content Models

You either have to use an Action List builder called “main” or use a builder that implements a main method Action List View and Form Domino View and Form

Page 69: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

Builders are added to the Models Builder Call List in the Outline View from the Builder Palette

Page 70: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

When a builder is selected from the Palette that builders inputs are opened in the Builder Call Editor Values are supplied via the builder call inputs The Icons next to the builder call inputs enable profiling for that

particular input Icons with no color mean the input has not been profiled Blue icons mean the builder input has been profiled

Page 71: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

Builders that have at least one Profiled input are also indicated in the Builder Call List

Page 72: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

The power of Profiling

Profile Entries Model

Custom Application

Custom Application

Custom Application

Page 73: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

The Power of Profiling Profiles are used to alter the content or functionality of an application at run-

time Profile values are created and stored separate from the application There are two types of Profiling in Portlet Factory

Explicit

– Values are explicitly applied to alter content or functionality

– In the Portlet Factory designer

– In the Portlets edit or configure mode Custom (Dynamic)

– Values that alter content or functionality are applied programmatically based upon

– Browser locale

– LDAP or Portal group membership

– Custom profile handler

Page 74: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

When a Builder call input has been profiled two components are created A Profile Set

A Profile set is the container for “n” number of profile entries A Profile Entry for that builder input

A profile entry maintains the profiles and their values that will alter the content

Page 75: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

The Profile set editor can be used to manage all of the profile entries for a model

The Select Handler tab is used to set the Profile Selection Handler The default handler is the Explicit Handler Custom Handlers can be chosen from the drop down list

Portlet Factory ships with several

Page 76: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

Explicit Profiles can be applied in the Portlet Factory designer via the “Applied Profiles” tab with a Model open for editing

Page 77: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

Service / Consumer Models (Implementation of SOA) Always at least two Models

Service Provider Service Consumer

Service Provider models can be consumed by many Service Consumer Models

ServiceProviderModel

ServiceConsumer

Model

ServiceProviderModel

ServiceConsumer

Model

ServiceConsumer

Model

ServiceConsumer

Model

Page 78: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

The Service Provider model provides access to data from; A Web Service A SQL data source (RDMBS) Domino SAP

Service Provider Models do not contain any UI or display elements In other words no “main” method Service Operations expose “consumable” functionality

Automatic testing support can be enabled in the Service Definition builder

ServiceProviderModel

ServiceConsumer

ModelData

Page 79: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

The Service Consumer model provides output from a Provider Consumes functionality from the Service Provider Model to

Read View Data

– Table of records from a RDBMS Read Specific Data

– Specific record from a RDBMS Perform data operations

– Create new records

– Edit existing records

– Delete existing records

ServiceProviderModel

ServiceConsumer

Model

ApplicationOutput

Page 80: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

Using the Domino Builders In order to use the Domino collaboration builders the “Lotus

Collaboration Extension” will need to be added to the project at the time it’s created or from the projects properties after the project is created

Page 81: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

Create a new properties file and update it with your server information When the collaboration features are added a properties file is added in

the following location WebContent\WEB-INF\config\domino_config\

default_domino_server.properties This file is overwritten during fix pack and dot release updates

Create a copy of this file in the same directory to hold your configuration information. You will need to configure Server Name User Name Password

Page 82: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

The Domino Server parameter “Allow HTTP Clients to browse databases:” will have to be set to “yes” This only needs to be set on the development server so the Portlet Factory

can access the databases The property does not have to be set on production servers

The two primary builders you will use Domino Data Access

Does not contain a “main” method Allows access to back end Domino Data via View Name

Domino View and Form Contains and optional “main” method Allows access to back end Domino Data via View Name Allows for complete View, Create, Edit, Delete functionality

Page 83: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

The Domino View and Form builder does not lend itself well to a Service Provider/Service Consumer model Methods created by the Domino View and Form Builder are only

available in the model that contains the Domino View and Form Builder or Data Access Builder

It is easiest to access “Flat” Domino data There are no builders that allow for hierarchical Domino data There are no default capabilities that handle multi-value fields

You will need to create a Java file that reads the document as it is being loaded, parses all multi value fields and then replaces the field contents in the displayed document

– This will be demoed

Page 84: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

There are Domino specific issues that the Factory does not work with easily Multi-value fields Controlling UI Elements via Database ACL role values

Page 85: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

Controlling UI Elements via Database ACL roles values Create a Web Service that reads the Database ACL based upon the

logged in user The Web Service is created in an Eclipse Project or Rational

Developer, NOT THE FACTORY Use the returned value in a Profile set to control the value of the

builder input to either enabled or disabled it Create a custom profile selection handler to run the web service

and return the ACL roles Use those role values to control the builder inputs enabled flag

Page 86: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development

Multi-value fields Create an Linked Java Object (LJO) that includes a method to read the

multi-value fields Create a method that will call the LJO to write the values back to the

document Call that method in a link builder that replaces the default link builder

Page 87: Best Practices when Developing with IBM WebSphere Portlet Factory

Demo – Portlet Factory Development

Page 88: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development – Best Practices

Review ALL the Builders in the Portlet Factory Help

Keystroke ALL of the tutorials that ship with Portlet Factory

Review sample code added as part of a Feature Set

Import and review the samples from Developerworks

Consider Profiling at the BEGINNING of the project cycle, not the end

Use the highest-level builder available for the job View and Form instead of Data page

Try and keep model size under 50 builders Use a service provider/consumer model architecture Use the Model Container, Imported and Linked model builders

Page 89: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development – Best Practices

Use Linked Java Objects instead of multiple Method builders

Use a Rich Data Definition to simplify and centralize field formatting, validation, and UI

Use the Comment builder to organize and document the application

Review the “Best Practices” documentation on the wike site

The “Look and Feel” of the Portlet Factory output is controlled by Cascading Style Sheets (CSS), HTML Templates If you are not familiar with CSS or have a resource that is, you will need to

come up to speed on this as part of learning Portlet Factory

Page 90: Best Practices when Developing with IBM WebSphere Portlet Factory

Portlet Factory Development – Best Practices

Test your Service Provider Models using the built in testing support BEFORE consuming them

User Profiling during development to access Data Sources

When naming builders preface the builder names to differentiate them from the objects created by the factory Actions – A_ActionName Methods – M_MethodName Variables – V_VariableName

Use comment builders to describe the functionality of the builders in the Builder Call List

Page 91: Best Practices when Developing with IBM WebSphere Portlet Factory

Agenda

So What Exactly is the Portlet Factory ?

Installing Portlet Factory

Creating Projects

Creating Models

Testing and Deploying Models

Portlet Factory Development

Wrap up

Page 92: Best Practices when Developing with IBM WebSphere Portlet Factory

Wrap up

Other Portlet Factory Sessions HND203 – IBM WebSphere Portlet Factory Version 6.02 Not Just for

Portlets Anymore! AD407 – Creating Rich Internet (AJAX) Applications with IBM

WebSphere Portlet Factory AD406 – Best Practices for Creating Applications with IBM WebSphere

Portlet Factory AD409 – Extending IBM WebSphere Portlet Factory with Custom

Builders

Page 93: Best Practices when Developing with IBM WebSphere Portlet Factory

Resources

Portlet Factory WIKI http://www.ibm.com/developerworks/wikis/display/PortletFactoryID/

Home?S_TACT=105AGX01&S_CMP=LP

Developerworks Portlet Factory Zone

http://www.ibm.com/developerworks/websphere/zones/portal/portletfactory

Forums http://www.ibm.com/developerworks/wikis/display/

PortletFactoryID/Portlet+Factory+forums+on+developerWorks Product Documentation

http://www.ibm.com/developerworks/websphere/zones/portal/portletfactory/proddoc.html

Page 94: Best Practices when Developing with IBM WebSphere Portlet Factory

Resources

Downloads http://www-1.ibm.com/support/search.wss?

rs=3044&tc=SSRUWN+SS3LP9&rank=8&dc=D400&dtm

Davelan Top Gun Portlet Factory Courses http://www.davalen.com/training_portletfactory.html

Page 95: Best Practices when Developing with IBM WebSphere Portlet Factory

Resources

Learning Portlet Factory Official IBM Curriculum

WP416 – IBM WebSphere Portlet Factory V6.0.1: Developer Fundamentals

WP516 – IBM WebSphere Portlet Factory V6.0.1: Advanced Developer Topics

WP520 – Using IBM WebSphere Dashboard Framework 6 Familiarize your self with ALL of the builders via the Builder help Samples and Tutorials

Download and review all the samples and tutorials available from the Documentation and wiki sites

Review Sample code added as part of a Feature Set Review and participate in the Portlet Factory forums

Page 96: Best Practices when Developing with IBM WebSphere Portlet Factory

Resources

Davalen Davalen Top Gun courses Stop by their booth on the showroom floor Get a great shirt Scan your badge to win a Gift Certificate or a Nintendo WII

Page 97: Best Practices when Developing with IBM WebSphere Portlet Factory

Remember the On-line Evaluations !!!!!

Please take a moment after this session to fill out the on-line evaluations !!!!!! Fill out 15 or more evaluations and your name will be entered in a

drawing where 5 lucky attendees will receive a free pass to Lotusphere 2008 !!!

http://www.lotusphere08surveyonline.com

Page 98: Best Practices when Developing with IBM WebSphere Portlet Factory

Questions ?

[email protected]

Hire Me !