You can package a theme in a war file with a layout like:
mytheme.war + mystyles.css + WEB-INF/ + portal-themes.xml + web.xml + images/ + mylogo.gif + myicon.ico + <lots more images>
The web.xml file is empty (just ) and the portal-themes.xml file contains:
<themes> <theme> <name>mytheme</name> <link rel="stylesheet" id="main_css" href="/mystyles.css" type="text/css"/> <link rel="shortcut icon" href="/images/myicon.ico"/> </theme> </themes>
In addition placing your theme under jboss-portal.sar/portal-core.war/themes is also acceptable, as long as you add the theme name to jboss-portal.sar/portal-core.war/WEB-INF/portal-themes.xml.
(Based on your post, I think you have done the above steps.)
If you want to use your theme as the default theme, you also need to change several files - do a search for the term "renaissance". Note, however, that you need to do this *before* you run the portal for the first time. If you have already run the portal, the best way to switch it to using your theme is to make that change in the management portlet.
Thanks for the help, after your post, I saw the flaw in my thinking.
Putting the theme into a seperate war was a very good idea, didn't notice that in the reference guide.
Above putting the theme there, I also put my own layout too (and the whole portal for simplicity's sake), and with a bit of myportal-object.xml tweaking I don't have to use the management portlet either.
If it's any help to anyone, my dir structure:
mytheme.war + my_styles.css + mylayout.jsp + WEB-INF/ + portal-layouts.xml + portal-themes.xml + myportal-object.xml + web.xml + jsp/ + <my jsp files> + images/ + mylogo.gif + myicon.ico + <lots more images> <etc...>
<themes> <theme> <name>my_theme</name> <link rel="stylesheet" id="main_css" href="/my_styles.css" type="text/css"/> <link rel="shortcut icon" href="/images/favicon.ico"/> </theme> </themes>
<?xml version="1.0" encoding="UTF-8"?> <layouts> <layout> <name>my_layout</name> <uri>/index.jsp</uri> <uri state="maximized">/index.jsp</uri> <regions> <region name="left"/> <region name="center"/> </regions> </layout> </layouts>
part of myportal-object.xml:
...... <page> <page-name>MyPage</page-name> <properties> <property> <name>theme.renderSetId</name> <value>divRenderer</value> </property> <property> <name>theme.id</name> <value>my_theme</value> </property> <property> <name>layout.id</name> <value>my_layout</value> </property> <property> <name>order</name> <value>1</value> </property> </properties> <window> ... </window> ....... </page> .....
And if you by any chance are such a messy coder, that you're using tags in your layout, then you can reference your images in your .jsp via:
<% String contextPath = request.getContextPath(); %> ...... <img src="<%=contextPath %>/images/yourPic.jpg"/> ......
Is there any way to use my custom header.jsp and tabs.jsp without tinkering with default portal core files?
The typical mechanism for changing the header and tabs is to change the theme. (By changing tabs, I assume you mean their appearance - you can change which tabs appear by defining new pages - each page has its own tab.)
The existing header and tabs are laid out in index.jsp files found in subdirectories of jboss-portl.sar/portal-core.war/layouts