Building Portlets With ColdFusion - Pete Freitag

2y ago
5 Views
2 Downloads
1.67 MB
39 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Rosemary Rios
Transcription

Building Portlets withColdFusionPete FreitagFoundeo, Inc.Twitter Tag: #adobemax347 Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.1

Who Am I?10 Years working with ColdFusion & Web DevelopmentOwner of Foundeo Inc. a ColdFusion Consulting & ProductsCompany.Blog : petefreitag.comTwitter : @pfreitag Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.2

AgendaWhat are Portals & Portlets?Standards (JSR-168, JSR-286, WSRP)Writing Portlets in ColdFusionDeploying ColdFusion PortletsWeb Services for Remote Portlets Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.3

What is a Portal?portal (n) - Door, Entrance ; especially : a grand or imposing oneSource: Merriam-Webster Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.4

What is a Portal?Public Portal SitesMyYahoo: my.yahoo.comiGoogle: google.com/igCorporate Portal SitesProvides employees, partners or customers with access to company data andweb applications. Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.5

What is a Portlet?Portal PagePortlet Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.6

Portal ServersPortal Servers consist of multiple Portal PagesA Portal Page May Serve Multiple PortletsA Portlet May have multiple instances on multiple pagesIt may also have multiple instances on the same page. Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.7

Portlet States & ModesWindow StatesNormalMinimizedMaximizedPortlet ModesViewEditHelpPortal Server Implementation may support additional states ormodes. Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.8

What does a Portal Server do?Supports standard cross-vendor APIs for building portletsProvides Authentication & AuthorizationPortlet Deployment & ConfigurationUI ManagementHigh Level Controller Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.9

Java Portlet StandardsJSR-168 (Java Portlet 1.0 API)Portal Vendors had proprietary API’s for writing portlets.Finalized in 2003Provides a basic set of functionality for building portlets.JSR-286 (Java Portlet 2.0 API)Mostly backwards compatible with JSR-168Added features such as:EventsCachingFiltersResource Serving Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.10

Deploying ColdFusion PortletsDeploy ColdFusion as a Portal Application in a Java Portal ServerJSR-168 or JSR-286Web Services for Remote PortletsWSRP Version 1.0 Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.11

Deploy CF9 on jBoss Portal ServerDownload JBoss Portal Server bundled with JBoss ApplicationServer.Extract JBoss Portal ServerStart JBoss: {jboss.dir}/bin/run.sh (or run.bat)Get some Coffee, it will take a whileLogin at: http://localhost:8080/portal/Default username and password are both “admin”Stop JBoss Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.12

Deploy CF9 on jBoss Portal ServerRun ColdFusion 9 Installer to Generate a WAR File Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.13

Deploy CF9 on jBoss Portal ServerUnzip contents of cfusion.war to {jboss.dir}/server/default/deploy/cfusion.war/War files are in the same format as zip files, you can use any zip fileextraction tool to extract a war file.Start JBossBetter go refill your coffeeComplete CF Installation visit: /cfusion/CFIDE/administrator/Enable J2EE Sessions Recommended Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.14

Deploying PortletsWe now have ColdFusion Running inside a PortalServer! Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.15

Deploying a ColdFusion PortletYour ColdFusion Instance can host multiple Portlets.Portlets defined in the same ColdFusion instance are consideredto be in the same Portal Application.Portal Applications can share data, and session variables. Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.16

Deploying a PortletCreate an instance of the Portlet in your Portal ServerAdd the Portlet to a Portal PageAbove steps differ by portal vendor.Demo. Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.17

ColdFusion Portlet APIColdFusion 9 Introduces the ColdFusion Portlet APICFC API Designed to align with JSR-168 & JSR-286ColdFusion Portlets should extend theCFIDE.portlets.ColdFusionPortlet component. Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.18

ColdFusion Portlet APIAt a minimum your portlet should implement the doViewmethod.doView(renderRequest, renderResponse)renderRequest is a javax.portlet.RenderRequest java objectrenderResponse a javax.portlet.RenderResponse java object Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.19

A Hello World ColdFusion Portlet cfcomponent extends "CFIDE.portlets.ColdFusionPortlet" cffunction name "doView" returntype "void" output "true" cfargument name "renderRequest" type "any" required "true" cfargument name "renderResponse" type "any" required "true" h1 Hello ColdFusion /h1 cfoutput p Today is #DateFormat(Now(), "long")#. /p p Rendered at: #TimeFormat(Now(), "h:mm:ss tt")# /p /cfoutput /cffunction /cfcomponent Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.20

Portlet Output Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.21

Portlet XML Deployment DescriptorsEach Portal Application has a /WEB-INF/portlet.xml file.Configuration for each portlet is stored in this file.Specify the full package name of the CFC to use for this portlet.Which portlet modes does it support (View, Edit, Help)?Default Title and DescriptionCustom Initialization Parameters Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.22

Hello World portlet.xml ?xml version "1.0" encoding "UTF-8"? portlet-app version "1.0" portlet portlet-name ColdFusionPortlet /portlet-name portlet-class coldfusion.portlet.ColdFusionPortlet /portlet-class supports mime-type text/html /mime-type portlet-mode VIEW /portlet-mode /supports portlet-info title ColdFusion Hello World Portlet /title /portlet-info init-param name cfcName /name value portlets.hello.HelloPortlet /value /init-param /portlet /portlet-app Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.23

Using ParametersTo build portlets with multiple views, we need to create links withvariables.The variables are called parametersMust use the Portlet API to create the linkThe ColdFusionPortlet CFC has a method createRenderURL to make this easy.createRenderURL( parameters, portletMode, windowState, secure )parameters - a struct, your variables.portletMode - VIEW, EDIT, HELP, default stays same.windowState - MINIMIZED, MAXIMIZED, NORMAL, default samesecure - if true uses HTTPS, otherwise same a href "#createRenderURL({sort "name"})#" Sort by Name /a Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.24

Accessing ParametersThe ColdFusion Portlet API populates therequest.portlet.parameters struct to access parameters passedto the portlet.eg: #request.portlet.parameters.sort#You can also use renderRequest.getParameter(“name”), but it returns a null ifthe parameter is not defined. Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.25

Working with FormsForms should be method POSTThe form action should be generated by the Portlet APIcreateActionURL(parameters, portletMode, windowState, secure)similar to createRenderURL() Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.26

Handling Form ActionThe processAction(actionRequest, actionResponse) method isinvoked in the Portlet CFC when form is submitted.The form variables are available in the request.portlet.parameters structactionRequest is the portal’s implementation of javax.portlet.ActionRequestactionResponse is the portal’s implementation of thejavax.portlet.ActionResponse interface.The processAction() method does not generate any output, adoView request is subsequently rendered.You can call setRenderParameter(key, value) on the actionResponse object topass values to the view.eg: actionResponse.setRenderParameter(“success”, “true”) Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.27

Basic ColdFusion Portlet APIinit(portletConfig)render(renderRequest, renderResponse)doView(renderRequest, renderResponse)doHelp(renderRequest, renderResponse)doEdit(renderRequest, renderResponse)processAction(actionRequest, ateActionURL(parameters, portletMode, windowState, secure)createRenderURL(parameters, portletMode, windowState, secure)destroy() Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.28

ColdFusion Portlet API Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.29

Web Services for Remote Portlets (WSRP)WSRP is a SOAP driven API for hosting portlets on externalservers.WSRP Producer - Hosts Portlets using WSRPWSRP Consumer - Displays portlets hosted by the ProducerMost Current Portal Servers can consume portlets via WSRP Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.30

WSRPColdFusion 9 is a WSRP Producer!You can host portlets on a dedicated ColdFusion serverColdFusion does not need to be installed on the Portal ServerThe Consumer Portal Server does not need to be written in Java Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.31

How WSRP WorksConsumers must register with the ProducerColdFusion doesn’t have any mechanism to authorize or distinguish oneconsumer from another. Use IP restrictions to limit communication.Upon successful registration the Producer provides a list ofportlets that the consumer may use.Each time the portlet is rendered, or interacted with a SOAPrequest to the Producer is made. Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.32

ColdFusion 9 WSRP ProducerSupports WSRP 1.0 SpecColdFusion portlets can use most feature of JSR-168The New Features in JSR-286 are not supported by WSRP 1.0Doesn’t support Consumer Configured PortletsPortlets are configured on the Producer (ColdFusion side) Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.33

ColdFusion WSRP ProducerThe WSRP Producer is mapped to the URI /WSRPProducerWSDL is rendered by using ?WSDLExample: http://localhost/cfusion/WSRPProducer?wsdlThe list of portlets available to the WSRP Consumers is controlledin /WEB-INF/cf-wsrp-portlet.xmlThe portlet-class tag should hold the full CFC package nameFollows the portlet.xml 1.0 Schema Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.34

Setting up WSRP Consumer on JBoss Portal Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.35

WSRP: Enter WSDL URL Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.36

WSRP: Registration Handle Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.37

WSRP: View Portlets, Create Instance Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.38

Thank You. Questions?foundeo.com petefreitag.com Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.39

ColdFusion 9 WSRP Producer Supports WSRP 1.0 Spec ColdFusion portlets can use most feature of JSR-168 The New Features in JSR-286 are not supported by WSRP 1.0 Doesn’t support Consumer Configured Portlets Portlets are

Related Documents:

Before installing ColdFusion, review the considerations for installing or upgrading on your platforms. Adobe ColdFusion (2016 release), ColdFusion 11, ColdFusion 10, and ColdFusion 9 can co-exist on the same system. Note:Understand the various ColdFusion Se

ColdFusion 10 ColdFusion Hit list Metasploit Module to find ColdFusion URLs ColdFusion Scanner Metasploit Module to find ColdFusion URLs . schedule a task to download code/executables/ bat files/

† Adobe supports installing ColdFusion 9 side-by-side with ColdFusion 8, ColdFusion MX 7, ColdFusion MX 6.1. † If you installed a Beta version of ColdFusion 9, uninstall it before you install this version. † Adobe recommends using the built-in (internal port-based) web server for development, but not in a production

ColdFusion 11 through current 11 Generated HTML 11 Date or time range 11 Query 11 Parameters 11 Example query 12 Tag syntax 12 Generated HTML 12 Limiting output to specific rows 13 Grouping Output 13 CFScript 14 ColdFusion 6 (MX) though current 15 ColdFusion 8 though current 15 ColdFusion

There are various ways to migrate your ColdFusion 11/10/9 Server to Adobe ColdFusion (2016 release). After you decided to upgrade your ColdFusion 11/10/9 Server environment to Adobe ColdFusion (2016 release), follow the migration paths specified in this guide for a quick and seamless migration. As always, contact the

For details, see the Attributes section for the cfdbinfo tag in ColdFusion 9 CFML Reference. See also "Function summary" on page 4 History ColdFusion 9 Update 1: Added this function. Function Equivalent ColdFusion Tag dbinfo cfdbinfo imap cfimap pop cfpop ldap cfldap feed cffeed Mode Syntax Creating the service new dbinfo(); or

Download the following ZIP file: xmlxslt.zip (220KB). 2. Unpack the ZIP file in your ColdFusion MX webroot. Typically this is located at c:\cfusionmx\webroot\ if you chose the default ColdFusion MX installation. The unpacked ZIP file will create a folder named XmlExampleCode. 3. To run a ColdFusion page, such as ParseXML1.cfm, browse it at a URL

Classical Theory and Modern Bureaucracy by Edward C. Page Classical theories of bureaucracy, of which that of Max Weber is the most impressive example, seem to be out of kilter with contemporary accounts of change within the civil service in particular and modern politico-administrative systems more generally. Hierarchy and rule-bound behaviour seem hard to square with an environment .