Upload
lamhanh
View
283
Download
7
Embed Size (px)
Citation preview
Script Portlet
Installation and Configuration with
Websphere Portal v8.5
Adinarayana H
Table Of Contents
1. Script Portlet Overview
2. Script Portlet Download Process
3. Script Portlet Installation with Websphere Portal
4. Script Portlet Deployment to a Page
5. Script Portlet Installation on Virtual Portal
5.1 Export/Import of WCM Library and Export/Import of DnD page
5.2 Running deploy-paa command
6. Script Portlet Development Example
1. Script Portlet Overview
The IBM Script Portlet enables a script developer to create portlets for IBM WebSphere Portal with HTML, JavaScript, and CSS.
The following key WebSphere Portal and IBM Web Content Manager features are available with the Script Portlet:
Content targeting based on devices or locations Access to user login information Adaptive design that uses conditional rendering Access to shared render parameters, portlet preferences, and live text
The Script Portlet has the following advantages:
Users have more autonomy and less dependence on central IT for portlet development, which decreases the time to market.
Users need less skill to be productive WebSphere Portal developers. Users control access and workflow processes in enterprise settings. Users can create reusable assets and contents. Users can render existing portlets, such as those developed with IBM Web Experience Factory or
IBM Rational Application Developer, on a page with portlets by using Script Portlet.
*As mentioned in Knowledge Center
2. Script Portlet Download Process
Download Script Portlet 1.3 from Greenhouse,
https://greenhouse.lotus.com/plugins/plugincatalog.nsf/assetDetails.xsp?action=editDocument&doc
umentId=DDB5C467D991413285257C67002476E0
Scriptportlet.zip file contains scriptportlet-app.1.3.0.paa which needs to be installed in Websphere
Portal v8.5.
3. Script Portlet Installation with Websphere Portal
Navigate to Portal server profile Configengine folder and issue the bloe command to start Script Portlet
Installation.
Script Portlet Can be installed on Base Portal or it can be deployed on Virtual Portal.
Base Portal Installation process
Configengine command will be executed twice, for Install and then Deploy
ConfigEngine.bat install-paa -DPAALocation=C:\Portal85\Scriptportlet\scriptportlet-app-1.3.0.paa -
DWasPassword=wpadmin -DPortalAdminPwd=wpadmin
Make sure that Build Successful message is seen after running the command.
Execute below command for deploying Script Portlet
ConfigEngine.bat deploy-paa -DappName=scriptportlet-app -DWasPassword=wpadmin -
DPortalAdminPwd=wpadmin
Exclude Script Portlet from Portal Development Mode Applications list,
Navigate to <path to wp_profile>/PortalServer/config/StartupPerformance/
And edit wp.base_TargetMapExclList.properties file.
Include scriptportlet at the end of the line in the file.
Restart Websphere Portal Server.
4. Script Portlet Deployment to a Page
Navigate to Websphere Portal Admin console and create a new page.
Page name: scriptportletpage
Make sure that Edit mode is ON. Click on Toolbar and then click on Create for the scriptportlet page.
Select Applications Select Web Content Click on Script Portlet
Click on Add To Page
Following message will be displayed after successfully adding Script portlet to the page.
Below screenshot shows Script Portlet being added to the page.
Right Click on the Icon and Maximize the Portlet.
Click on Edit to edit the Script Portlet in order to start writing new code.
There will be three tabs to start writing the HTML, CSS and Javascript code.
A sample HTML tag is written to show the page. Two panes will be displayed, One to write the code and
other to see the output. Click on Save after completing the Code.
Output will be displayed as well. Switch off Edit Mode and Portlet Data will be displayed.
Screenshot below after disabling Edit mode,
Scriptportlet is the WCM Library which will be used internally to handle all the content.
5. Script Portlet Installation on Virtual Portal
Create a new Virtual Portal.
Assigning Script Portlet to a Virtual Portal can be done 2 ways,
5.1 Export/Import of WCM Library and Export/Import of DnD page
5.2 Running deploy-paa task
5.1 Export/Import of WCM Library and Export/Import of DnD page
Export WCM Library Scriptportlet using below command running from PortalServer Profile Configengine
directory.
ConfigEngine.bat export-wcm-data -DWasPassword=wpadmin -DPortalAdminPwd=wpadmin -
Dexport.libraryname="Script Portlet Library" -Dexport.directory=C:\Portal85\Scriptportletlibrary
Import the WCM library using below command,
ConfigEngine.bat import-wcm-data -DWasPassword=wpadmin -DPortalAdminPwd=wpadmin -
Dimport.directory=C:\Portal85\Scriptportletlibrary -DVirtualPortalContext=adminib-mkg0t0h18097
VirtualPortalContext is the Context path given to Virtual Portal.
Make sure that Build Successful message pops up after running the command.
WCM Library displays in Web Content Libraries of Virtual Portal.
We need to Export DnD page and Import the page in Virtual Portal. DnD configuration page will be
present in Content Root Hidden Pages
Click on Export and select NO during export.
DON’T export the entire hiearchy. Click on NO here and save the XML file
pageExport.xml is saved and this XML file will be Imported in Virtual Portal.
Navigate to Virtual Portal and click on Import XML to Import the DnD page XML.
Successful message appaears after Importing the XML file.
Running deploy-paa task
Second way of deploying Script Portlet to Virtual Portal is using deploy-paa command through
Configengine task.
I have created another Virtual Portal and issued the following command,
ConfigEngine.bat deploy-paa -DappName=scriptportlet-app -DWasPassword=wpadmin -
DPortalAdminPwd=wpadmin -DforceDeploy=true -DVirtualPortalContext=virtualportal1
6. Script Portlet Development Example
A simple Javascript Query written using Script Portlet.
HTML to display the button and Text
Javascript Code to trigger the alert
References
https://greenhouse.lotus.com/plugins/plugincatalog.nsf/assetDetails.xsp?action=editDocument&doc
umentId=DDB5C467D991413285257C67002476E0
http://www-
01.ibm.com/support/knowledgecenter/SSHRKX_8.5.0/welcome/script_welcome.html?lang=en