portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r405129 - in /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl: JetspeedDesktopContextImpl.java JetspeedDesktopImpl.java
Date Mon, 08 May 2006 18:43:45 GMT
Author: taylor
Date: Mon May  8 11:43:43 2006
New Revision: 405129

URL: http://svn.apache.org/viewcvs?rev=405129&view=rev
Log:
Patch from Steve Milek to Desktop. 
This patch adds support for:
* multiple desktop themes (blue, tigris)
* header top area for themes
* navigations and menus!


Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopContextImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopImpl.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopContextImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopContextImpl.java?rev=405129&r1=405128&r2=405129&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopContextImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopContextImpl.java
Mon May  8 11:43:43 2006
@@ -35,11 +35,15 @@
     
     /** base portal URL to override default URL server info from servlet */
     private BasePortalURL baseUrlAccess = null;
+    private String themeRootPath = null;
+    private String theme = null;
         
-    public JetspeedDesktopContextImpl(RequestContext context, BasePortalURL baseUrlAccess)
+    public JetspeedDesktopContextImpl(RequestContext context, BasePortalURL baseUrlAccess,
String theme, String themeRootPath )
     {
         this.context = context;
         this.baseUrlAccess = baseUrlAccess;
+        this.theme = theme;
+        this.themeRootPath = themeRootPath;
     }
     
     public String getPortalResourceUrl(String relativePath)
@@ -98,4 +102,19 @@
         }
     }
     
+    public String getDesktopThemeResourceUrl(String relativePath)
+    {
+        if ( relativePath.startsWith( "/" ) )
+            return getPortalResourceUrl(themeRootPath + relativePath);
+        else
+            return getPortalResourceUrl(themeRootPath + "/" + relativePath);
+    }
+    public String getDesktopThemeRootUrl()
+    {
+        return getPortalResourceUrl(themeRootPath);
+    }
+    public String getDesktopTheme()
+    {
+        return theme;
+    }
 }

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopImpl.java?rev=405129&r1=405128&r2=405129&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopImpl.java
Mon May  8 11:43:43 2006
@@ -86,7 +86,7 @@
         try
         {
             RequestDispatcher dispatcher = request.getRequest().getRequestDispatcher(path);
               
-            JetspeedDesktopContext desktopContext = new JetspeedDesktopContextImpl(request,
this.baseUrlAccess);
+            JetspeedDesktopContext desktopContext = new JetspeedDesktopContextImpl(request,
this.baseUrlAccess, theme, getThemeRootPath( theme ) );
             request.getRequest().setAttribute(JetspeedDesktopContext.DESKTOP_ATTRIBUTE, desktopContext);
             dispatcher.include(request.getRequest(), request.getResponse());
         }
@@ -134,10 +134,15 @@
         String ext = themeConfiguration.getProperty("template.extension");
         if (ext == null)
             ext = this.defaultExtension;
+        return getThemeRootPath(theme) + "/" + id + ext;
+    }
+
+    protected String getThemeRootPath(String theme)
+    {
         if (this.themesRoot.endsWith("/"))
-            return this.themesRoot + theme + "/" + id + ext;
+            return this.themesRoot + theme;
         else
-            return this.themesRoot + "/" + theme + "/" + id + ext;
+            return this.themesRoot + "/" + theme;
     }
     
     protected Properties getConfiguration(String theme)
@@ -202,4 +207,4 @@
     }
     
 }
-    
\ No newline at end of file
+    



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message