Hi,

> 
> o  The vm must only set the CSS when a CSS exists.  This will allow
> portlet
>    to inherit the CSS of their parent.

Not sure what you mean here, if the CSS class is not specified, a
class="" will be returned, which means all other stylings will be
used.

> 
> o  Which elements, i.e. Portlet Box, Portlet Titles, Portlet
> Content...
>    will have a configurable CSS.
> 

I have only the following 6 currently

Portlet as a whole
Portlet title
Portlet content
Tabbed pane as a whole
Tabbed pane title
Tabbed pane content


Attached is a revised patch.

...but I have some problems with using a skin for the overall page
stylesheet.

The "skin" tool is not in the context for the page as a whole - where
should this be added?

How do you use skin properties in the jsp pages?

Regards,
Chris

=====
Need somewhere to Live in London - http://freeflats.com

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com
Index: src/java/org/apache/jetspeed/portal/BasePortletSkin.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/BasePortletSkin.java,v
retrieving revision 1.1
diff -u -r1.1 BasePortletSkin.java
--- src/java/org/apache/jetspeed/portal/BasePortletSkin.java    2001/05/27 15:34:35    
 1.1
+++ src/java/org/apache/jetspeed/portal/BasePortletSkin.java    2001/09/05 09:16:08
@@ -210,4 +210,151 @@
         }
     }    
 
+    /**
+     * Returns the CSS class to use for the portlet overall
+     * @return the CSS class to use (PortletStyleClass)
+     */
+    public String getPortletStyleClass()
+    {
+        return (String)get(PORTLET_STYLE_CLASS);
+    }
+
+    /**
+     * Sets the CSS class to use for the portlet overall
+     * @param portletStyleClass the new class to be used
+     */
+    public void setPortletStyleClass(String portletStyleClass)
+    {
+        if (portletStyleClass!=null)
+        {
+            put(PORTLET_STYLE_CLASS,portletStyleClass);
+        }
+    }    
+
+    /**
+     * Returns the CSS class to use for the portlet title
+     * @return the CSS class to use (TitleStyleClass)
+     */
+    public String getTitleStyleClass()
+    {
+        return (String)get(TITLE_STYLE_CLASS);
+    }
+
+    /**
+     * Sets the CSS class to use for the portlet title
+     * @param titleStyleClass the new class to be used
+     */
+    public void setTitleStyleClass(String titleStyleClass)
+    {
+        if (titleStyleClass!=null)
+        {
+            put(TITLE_STYLE_CLASS,titleStyleClass);
+        }
+    }    
+
+    /**
+     * Returns the CSS class to use for the portlet content
+     * @return the CSS class to use (ContentStyleClass)
+     */
+    public String getContentStyleClass()
+    {
+        return (String)get(CONTENT_STYLE_CLASS);
+    }
+
+    /**
+     * Sets the CSS class to use for the portlet content
+     * @param contentStyleClass the new class to be used
+     */
+    public void setContentStyleClass(String contentStyleClass)
+    {
+        if (contentStyleClass!=null)
+        {
+            put(CONTENT_STYLE_CLASS,contentStyleClass);
+        }
+    }    
+
+    /**
+     * Returns the CSS class to use overall for the tabbed control
+     * @return the CSS class to use (TabStyleClass)
+     */
+    public String getTabStyleClass()
+    {
+        return (String)get(TAB_STYLE_CLASS);
+    }
+
+    /**
+     * Sets the CSS class to use for overall for the tabbed control
+     * @param tabStyleClass the new class to be used
+     */
+    public void setTabStyleClass(String tabStyleClass)
+    {
+        if (tabStyleClass!=null)
+        {
+            put(TAB_STYLE_CLASS,tabStyleClass);
+        }
+    }    
+
+    /**
+     * Returns the CSS class to use on the title of the tabbed control
+     * @return the CSS class to use (TabTitleStyleClass)
+     */
+    public String getTabTitleStyleClass()
+    {
+        return (String)get(TAB_TITLE_STYLE_CLASS);
+    }
+
+    /**
+     * Sets the CSS class to use on the title of the tabbed control
+     * @param tabTitleStyleClass the new class to be used
+     */
+    public void setTabTitleStyleClass(String tabTitleStyleClass)
+    {
+        if (tabTitleStyleClass!=null)
+        {
+            put(TAB_TITLE_STYLE_CLASS,tabTitleStyleClass);
+        }
+    }    
+
+    /**
+     * Returns the CSS class to use on the control of the tabbed control
+     * @return the CSS class to use (TabContentStyleClass)
+     */
+    public String getTabContentStyleClass()
+    {
+        return (String)get(TAB_CONTENT_STYLE_CLASS);
+    }
+
+    /**
+     * Sets the CSS class to use on the control of the tabbed control
+     * @param tabContentStyleClass the new class to be used
+     */
+    public void setTabContentStyleClass(String tabContentStyleClass)
+    {
+        if (tabContentStyleClass!=null)
+        {
+            put(TAB_CONTENT_STYLE_CLASS,tabContentStyleClass);
+        }
+    }    
+    /**
+     * Returns the CSS stylesheet to use for the whole web page
+     * @return the stylesheet to use (css/default.css)
+     */
+    public String getStylesheet()
+    {
+        return (String)get(STYLESHEET);
+    }
+
+    /**
+     * Sets the CSS stylesheet to use for the whole web page
+     * @param stylesheet the new stylesheet to be used
+     */
+    public void setStylesheet(String stylesheet)
+    {
+        if (stylesheet!=null)
+        {
+            put(STYLESHEET,stylesheet);
+        }
+    }    
+
+
 }
Index: src/java/org/apache/jetspeed/portal/PortletSkin.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/PortletSkin.java,v
retrieving revision 1.1
diff -u -r1.1 PortletSkin.java
--- src/java/org/apache/jetspeed/portal/PortletSkin.java        2001/05/27 15:34:35    
 1.1
+++ src/java/org/apache/jetspeed/portal/PortletSkin.java        2001/09/05 09:16:08
@@ -69,6 +69,13 @@
     public static final String TITLE_BACKGROUND_COLOR = "title-background-color";
     public static final String HIGHLIGHT_TEXT_COLOR = "highlight-text-color";
     public static final String HIGHLIGHT_BACKGROUND_COLOR = 
"highlight-background-color";
+    public static final String PORTLET_STYLE_CLASS = "portlet-style-class";
+    public static final String TITLE_STYLE_CLASS = "title-style-class";
+    public static final String CONTENT_STYLE_CLASS = "content-style-class";
+    public static final String TAB_STYLE_CLASS = "tab-style-class";
+    public static final String TAB_TITLE_STYLE_CLASS = "tab-title-style-class";
+    public static final String TAB_CONTENT_STYLE_CLASS = "tab-content-style-class";
+    public static final String STYLESHEET = "stylesheet";
 
     /**
      * Returns the name of this color scheme
@@ -147,5 +154,89 @@
      * @param titleColor the title color value in HTML format (#RRGGBB)
      */
     public void setHighlightBackgroundColor(String titleColor);
+
+    /**
+     * Returns the CSS class to use for the portlet overall
+     * @return the CSS class to use (PortletStyleClass)
+     */
+    public String getPortletStyleClass();
+
+    /**
+     * Sets the CSS class to use for the portlet overall
+     * @param portletStyleClass the new class to be used
+     */
+    public void setPortletStyleClass(String portletStyleClass);
+
+    /**
+     * Returns the CSS class to use for the portlet title
+     * @return the CSS class to use (TitleStyleClass)
+     */
+    public String getTitleStyleClass();
+
+    /**
+     * Sets the CSS class to use for the portlet title
+     * @param titleStyleClass the new class to be used
+     */
+    public void setTitleStyleClass(String titleStyleClass);
+
+    /**
+     * Returns the CSS class to use for the portlet content
+     * @return the CSS class to use (ContentStyleClass)
+     */
+    public String getContentStyleClass();
+
+    /**
+     * Sets the CSS class to use for the portlet content
+     * @param contentStyleClass the new class to be used
+     */
+    public void setContentStyleClass(String contentStyleClass);
+
+    /**
+     * Returns the CSS class to use overall for the tabbed control
+     * @return the CSS class to use (TabStyleClass)
+     */
+    public String getTabStyleClass();
+
+    /**
+     * Sets the CSS class to use for overall for the tabbed control
+     * @param tabStyleClass the new class to be used
+     */
+    public void setTabStyleClass(String tabStyleClass);
+
+    /**
+     * Returns the CSS class to use on the title of the tabbed control
+     * @return the CSS class to use (TabTitleStyleClass)
+     */
+    public String getTabTitleStyleClass();
+
+    /**
+     * Sets the CSS class to use on the title of the tabbed control
+     * @param tabTitleStyleClass the new class to be used
+     */
+    public void setTabTitleStyleClass(String tabTitleStyleClass);
+
+    /**
+     * Returns the CSS class to use on the control of the tabbed control
+     * @return the CSS class to use (TabContentStyleClass)
+     */
+    public String getTabContentStyleClass();
+
+    /**
+     * Sets the CSS class to use on the control of the tabbed control
+     * @param tabContentStyleClass the new class to be used
+     */
+    public void setTabContentStyleClass(String tabContentStyleClass);
+
+    /**
+     * Returns the CSS stylesheet to use for the whole web page
+     * @return the stylesheet to use (css/default.css)
+     */
+    public String getStylesheet();
+
+    /**
+     * Sets the CSS stylesheet to use for the whole web page
+     * @param stylesheet the new stylesheet to be used
+     */
+    public void setStylesheet(String stylesheet);
 
 }
Index: webapp/WEB-INF/conf/skins.xreg
===================================================================
RCS file: /home/cvspublic/jakarta-jetspeed/webapp/WEB-INF/conf/skins.xreg,v
retrieving revision 1.3
diff -u -r1.3 skins.xreg
--- webapp/WEB-INF/conf/skins.xreg      2001/07/23 21:46:44     1.3
+++ webapp/WEB-INF/conf/skins.xreg      2001/09/05 09:16:08
@@ -18,6 +18,13 @@
     <property name="title-background-color" value="#dddddd"/>
     <property name="highlight-text-color" value="#000000"/>
     <property name="highlight-background-color" value="#FFCC00"/>
+    <property name="portlet-style-class" value="PortletStyleClass"/>
+    <property name="title-style-class" value="TitleStyleClass"/>
+    <property name="content-style-class" value="ContentStyleClass"/>
+    <property name="tab-style-class" value="TabStyleClass"/>
+    <property name="tab-title-style-class" value="TabTitleStyleClass"/>
+    <property name="tab-content-style-class" value="TabContentStyleClass"/>
+    <property name="stylesheet" value="css/default.css"/>
   </skin-entry>
 
   <skin-entry name="orange-red">
Index: webapp/WEB-INF/templates/vm/controls/html/jetspeed-tab.vm
===================================================================
RCS file: 
/home/cvspublic/jakarta-jetspeed/webapp/WEB-INF/templates/vm/controls/html/jetspeed-tab.vm,v
retrieving revision 1.3
diff -u -r1.3 jetspeed-tab.vm
--- webapp/WEB-INF/templates/vm/controls/html/jetspeed-tab.vm   2001/09/04 11:12:15    
 1.3
+++ webapp/WEB-INF/templates/vm/controls/html/jetspeed-tab.vm   2001/09/05 09:16:08
@@ -2,10 +2,10 @@
 #if ( ! $tabs )
 #parse ("jetspeed.vm")
 #else
-<table cellpadding="0" cellspacing="0" border="0" width="100%">
+<table cellpadding="0" cellspacing="0" border="0" width="100%" 
+class="$!{skin.TabStyleClass}">
 <tr>
   <td valign="top">
-    <table align="left" cellspacing="0" border="0" cellpadding="0">
+    <table align="left" cellspacing="0" border="0" cellpadding="0" 
+class="$!{skin.TabTitleStyleClass}">
       <tr width="100%">
 #foreach ( $tab in $tabs )
 #if ($tab.isSelected() )
@@ -37,18 +37,21 @@
   </td>
 </tr>
 </table>
-<table cellspacing="0" width="100%" border="0" cellpadding="0">
+<table cellspacing="0" width="100%" border="0" cellpadding="0" 
+class="$!{skin.TabStyleClass}">
   <tr><td height="2" bgcolor="$!{skin.HighlightBackgroundColor}"><img height="2" 
width="2" src="images/dot.gif" /></td></tr>
   <tr><td height="2" bgcolor="$!{skin.BackgroundColor}"><img height="2" width="2" 
src="images/dot.gif" /></td></tr>
 </table>
-<table bgcolor="$!{skin.BackgroundColor}" cellspacing="0" width="100%" border="0" 
cellpadding="0">
+<table cellspacing="0" width="100%" border="0" cellpadding="0" 
+class="$!{skin.TabStyleClass}"><tr><td>
+<table bgcolor="$!{skin.BackgroundColor}" cellspacing="0" width="100%" 
+       border="0" cellpadding="0" class="$!{skin.TabContentStyleClass}">
 <tr>
   <td valign="top" width="100%">
     $portlet.getContent($data)
   </td>
 </tr>
 </table>
+</td></tr></table>
 #end
 #else
     $portlet.getContent($data)
-#end
\ No newline at end of file
+#end
Index: webapp/WEB-INF/templates/vm/controls/html/jetspeed.vm
===================================================================
RCS file: 
/home/cvspublic/jakarta-jetspeed/webapp/WEB-INF/templates/vm/controls/html/jetspeed.vm,v
retrieving revision 1.3
diff -u -r1.3 jetspeed.vm
--- webapp/WEB-INF/templates/vm/controls/html/jetspeed.vm       2001/09/04 11:12:15    
 1.3
+++ webapp/WEB-INF/templates/vm/controls/html/jetspeed.vm       2001/09/05 09:16:08
@@ -1,21 +1,22 @@
 #if( ! $portlet.isClosed($data) )
-<table border="0" bgcolor="$!{skin.BackgroundColor}" cellpadding="0" cellspacing="0" 
width="100%">
-<tr bgcolor="$!{skin.TitleBackgroundColor}">
-    <td align="left"  bgcolor="$!{skin.TitleBackgroundColor}" nowrap="true" 
valign="middle" width="100%">
+<table border="0" bgcolor="$!{skin.BackgroundColor}" cellpadding="0" cellspacing="0" 
+width="100%" 
+       class="$!{skin.PortletStyleClass}">
+<tr bgcolor="$!{skin.TitleBackgroundColor}" class="$!{skin.TitleStyleClass}">
+    <td align="left"  bgcolor="$!{skin.TitleBackgroundColor}" 
+        nowrap="true" valign="middle" width="100%">
       <b><font color="$!{skin.TitleTextColor}">$portlet.Title</font><b>
     </td>
     <td align="right" bgcolor="$!{skin.TitleBackgroundColor}" nowrap="true" 
valign="middle">
 #foreach ( $action in $actions )
       <a href="${action.Link}" title="${action.Name}"><img 
src="images/${action.Name}.gif" border="0"></a>
-
-
 #end
     </td>
 </tr>
 #if( ! $portlet.isMinimized($data) )
 <tr>
     <td colspan="2" align="center" valign="top" width="100%" >
-        <table border="0" cellpadding="2" cellspacing="0" width="100%" align="center">
+        <table border="0" cellpadding="2" cellspacing="0" 
+               width="100%" align="center" class="$!{skin.ContentStyleClass}">
         <tr>
             <td>
                 $!portlet.getContent($data)
@@ -26,4 +27,4 @@
 </tr>
 #end
 </table>
-#end
\ No newline at end of file
+#end
Index: webapp/WEB-INF/templates/vm/layouts/html/default.vm
===================================================================
RCS file: 
/home/cvspublic/jakarta-jetspeed/webapp/WEB-INF/templates/vm/layouts/html/default.vm,v
retrieving revision 1.2
diff -u -r1.2 default.vm
--- webapp/WEB-INF/templates/vm/layouts/html/default.vm 2001/07/29 13:42:52     1.2
+++ webapp/WEB-INF/templates/vm/layouts/html/default.vm 2001/09/05 09:16:08
@@ -1,7 +1,7 @@
 <html>
   <head>
     <base href="$clink.External" />
-    <link href="$clink.setURI("css/default.css").Absolute" type="text/css" 
rel="stylesheet" /> 
+    <link href="$clink.setURI($!{skin.stylesheet}).Absolute" type="text/css" 
+rel="stylesheet" /> 
   </head>
   <body bgcolor="#ffffff">
     <table cellspacing="0" width="100%" border="0" cellpadding="0">
@@ -28,4 +28,4 @@
       </tr>
     </table>
   </body>
-</html>
\ No newline at end of file
+</html>
Index: webapp/css/default.css
===================================================================
RCS file: /home/cvspublic/jakarta-jetspeed/webapp/css/default.css,v
retrieving revision 1.2
diff -u -r1.2 default.css
--- webapp/css/default.css      2001/07/29 13:42:52     1.2
+++ webapp/css/default.css      2001/09/05 09:16:08
@@ -30,3 +30,37 @@
         .MESSAGENEW:link {font-family: "Verdana"; font-size: 8pt; color: 
NAVY;font-weight: bold}
         .MESSAGENEW:visited {font-family: "Verdana"; font-size: 8pt; color: 
BLACK;font-weight: bold}
 
+        .PortletStyleClass
+        {
+          padding: 1;
+          background-color: #AAAAAA;
+          border: thin gray solid;
+        }
+
+        .TabStyleClass
+        {
+          padding: 1;
+        }
+
+        .TitleStyleClass
+        {
+          text-transform: uppercase;
+          font-weight: bold;
+        }
+
+        .TabTitleStyleClass
+        {
+          background-color: #FFFFFF;
+        }
+
+        .ContentStyleClass
+        {
+          background-color: #FFFFFF;
+          border-top: thin gray solid;
+        }
+
+        .TabContentStyleClass
+        {
+          background-color: #FFFFFF;
+        }
+

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to