Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1 CF5
With CTC integration and social rendering
Michele Buccarello 5/3/2013
This document describe how to create a custom theme for portal 8.0.0.1 with CTC modules and Social Rending features.
Page 1
Install CTC V4
For this part you must follow the documentation in the portal wiki at this link
Windows: ConfigEngine.bat action-enable-social-rendering -DPortalAdminId=portal_user_id DPortalAdminPwd=portal_user_password -DWasUserid=was_user_id DWasPassword=was_user_password Linux, Unix, IBM, i z/OS: ./ConfigEngine.sh action-enable-social-rendering -DPortalAdminId=portal_user_id DPortalAdminPwd=portal_user_password -DWasUserid=was_user_id DWasPassword=was_user_password
Page 2
You need to copy this two type of files in two separated folders. For more organization I suggest to create a folder named CUSTOM THEME 8.0.0.1 CF5 and in this folder you need to create two folder: custom theme dynamic custom theme static
In the WEB-INF folder you need only the folder tld and the file decorations.xml, below the screenshoot of my Dynamic folder files. Custom Theme Portal 8.0.0.1 Author:Michele Buccarello
Page 3
You can use these urls http://localhost:10039/wps/mycontenthandler/dav/fs-type1/themes/?mime-type=application/zip http://locahost:10039/wps/mycontenthandler/dav/skinlist/?mime-type=application/zip http://localhost:10039/wps/mycontenthandler/dav/fs-type1/common-resources/?mimetype=application/zip Custom Theme Portal 8.0.0.1 Author:Michele Buccarello Page 4
Go in the skinlist folder rename all folders by removing the part ibm.portal.80 and for every folder you need to delete : Metadata properties folder Metadata.properties file
See the image below for the folder Hidden after renaming BEFORE
Page 5
AFTER
Page 6
Page 7
Page 8
Page 9
1) Create new web project select simple and Java EE and then press next
Page 10
4) Now copy the resources located in the static folder in the webcontent directory of the dynamic war, below you see the screenshot and a map of the file location : skinlist/Hidden WebContent/skinlist/Hidden Custom Theme Portal 8.0.0.1 Author:Michele Buccarello
Page 11
NOTE: in the skinlist folder and themes folder I have the folder mobile 80, I have it only for e future expansion of this article. Setting the access in web.xml
In this part you need to add the line highlighted for enable the access for anonymous user to the static files.
<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/webapp_3_0.xsd"> <display-name>Custom8001ThemeStatic</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <context-param> <description>A regular expression that defines which of the resources in the WAR file can be served by the portal war datasource. </description> <param-name>com.ibm.portal.whitelist</param-name> <param-value>.*</param-value> </context-param> <context-param>
Page 12
Manualy Creation
Log on to the WebSphere Integrated Solutions Console and follow this steps: Go to Resources -> Resource Environment -> -> Resource environment providers -> WP DynamicContentSpotMappings. Select Custom Properties. Select New
Name=CustomTheme8001CF5_head value=res:/CustomTheme8001Dynamic/themes/html/dynamicSpots/head.jsp At the link below you find the official documentations for creating the dynamic content spots http://www10.lotus.com/ldd/portalwiki.nsf/xpDocViewer.xsp?lookupName=V8+Update%3A+Supplemental+Document ation#action=openDocument&res_title=Creating_a_dynamic_content_spot_wp8001&content=pdcontent At the link below you find all properties you need to create manualy http://www10.lotus.com/ldd/portalwiki.nsf/xpDocViewer.xsp?lookupName=V8+Update%3A+Supplemental+Document ation#action=openDocument&res_title=Working_with_dynamic_content_spots_wp8001&content=pdcont ent
Page 13
Automatic Creation
Edit the jython script attached with your own context root and your own name, for my understating I use this naming conventions: CustomThemePortalVersionname_of_the_normal_spots , for example 80theme_head became CustomTheme8001CF5_head
After you complete to edit the jython script you can simply run the script using the wsadmin console using this command: Wsadmin.(sh|bat) user adminuser password passworduser -f path_to_jython_script
After complete registration of dynamic content spots you need to reboot the portal
After this changes you need to change the bootstrap.jspf located in Custom8001ThemeDynamic /WebContent/themes/html/bootstrap.jspf And change URI davURI = pocSvc.createURI("dav","fs-type1/common-resources/ibm/css/portal/ibmPortlets.css"); In URI davURI = pocSvc.createURI("war"," Custom8001ThemeStatic /commonresources/ibm/css/portal/ibmPortlets.css");
Page 14
Page 15
Click on select file and press next (depend if your portal is local or remote)
Page 16
Press next
Map the Websphere_Portal server and the webserver if you install the webserver. Custom Theme Portal 8.0.0.1 Author:Michele Buccarello Page 17
Press next
Press finish
Page 18
Press save
Page 19
Page 20
Using My Custom Script For using mycustom xmlaccess script you need: 1) Modify all context-root= parameter with the correct context root of your ear 2) Modyfy the parameter name="com.ibm.portal.layout.template.href" for pointing to your layout directory 3) Modyfy the parameter name=" com.ibm.portal.theme.template.ref" for pointing to your theme directory 4) Run the script via command line or via graphic interface
RegisterTheme8001.xml
Command line: Open the command line or the shell and go in portal_server_root/bin in my case I go in this folder c:\IBM8\WebSphere\PortalServer\bin and I run this command xmlaccess.bat -user wpsadmin -password wpsadmin -url http://localhost:10039/wps/config -in ..\doc\xml-samples\RegisterTheme8001.xml out result.xml in the result.xml you need to see this line at the bottom of the file. <status element="all" result="ok"/>
Page 21
Graphic Interface Login as portal administrator on websphere portal and go in the administration tab then click on Import Xml link and click on Choose File.
After you choose the RegisterTheme8001.xml click on import and verify the output
Page 22
Page 24
Verify the if the edit mode works and if you are able to see the ctc portlets section
Page 25