You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2009/03/27 22:52:55 UTC

svn commit: r759365 - in /portals/jetspeed-2/portal/trunk: applications/jetspeed/src/main/webapp/ applications/jetspeed/src/main/webapp/WEB-INF/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/ components/jetspeed-portal/src/mai...

Author: taylor
Date: Fri Mar 27 21:52:55 2009
New Revision: 759365

URL: http://svn.apache.org/viewvc?rev=759365&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-942
handle case when no decorations found due to root folder.metadata <defaults> tag removed. Also, more gracefully handle fatal exceptions in pipeline

Added:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/server-diag.jsp   (with props)
Modified:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/web.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/JetspeedServlet.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/decoration/DecorationFactory.java
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/desktop.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/theme-engine.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/web.xml?rev=759365&r1=759364&r2=759365&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/web.xml (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/web.xml Fri Mar 27 21:52:55 2009
@@ -146,6 +146,16 @@
     <servlet-class>org.apache.jetspeed.manager.ManagerServlet</servlet-class>
   </servlet>
 
+  <servlet>
+    <servlet-name>DiagnosticsServlet</servlet-name>
+ 	<jsp-file>/server-diag.jsp</jsp-file>
+  </servlet>
+
+  <servlet-mapping>
+      <servlet-name>DiagnosticsServlet</servlet-name>
+       <url-pattern>/diagnostics/*</url-pattern>  	   
+  </servlet-mapping>
+    
   <servlet-mapping>
        <servlet-name>
           jetspeed

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/server-diag.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/server-diag.jsp?rev=759365&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/server-diag.jsp (added)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/server-diag.jsp Fri Mar 27 21:52:55 2009
@@ -0,0 +1,40 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<html>
+  <title>Portal Diagnostic Information</title>
+  <body>
+  <h2>Portal Diagnostic Information</h2>
+	<p>
+	<b>General Message: <%= request.getSession().getAttribute("org.apache.portals.jestspeed.diagnostics") %></b>
+	</p>
+	<p>
+	  To return to the server, click here: <a href='<%= request.getContextPath() + "/portal" %>'>Return to Server</a>
+	</p>
+    <h3>Server Information:</h3>
+	<p>
+	<ul>
+		<li>Free Memory (KB): <%= Runtime.getRuntime().freeMemory()/1024 %></li>
+		<li>Total Memory (KB): <%= Runtime.getRuntime().totalMemory()/1024  %></li>
+	</ul>
+	</p>
+<!-- 
+This page is meant to be used for diagnostics when the portal becomes unavailable
+TODO: provide other diagnostic information, Heap Usage, Number of users 
+-->
+  </body>
+</html> 
+

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/server-diag.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/server-diag.jsp
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java?rev=759365&r1=759364&r2=759365&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java Fri Mar 27 21:52:55 2009
@@ -74,6 +74,8 @@
 
     private String defaultDesktopLayoutDecoration = null;
     private String defaultDesktopPortletDecoration = null;
+    private String defaultLayoutDecoration = null;
+    private String defaultPortletDecoration = null;
     
     private Set layoutDecorationsDir = Collections.EMPTY_SET;
     private Set portletDecorationsDir = Collections.EMPTY_SET;
@@ -91,20 +93,22 @@
     public DecorationFactoryImpl( String decorationsPath, 
                                   ResourceValidator validator )
     {
-        this( null, decorationsPath, validator, null );
+        this( null, decorationsPath, validator, null, null, null );
     }
     
     public DecorationFactoryImpl( String decorationsPath, 
                                   ResourceValidator validator,
                                   JetspeedCache decorationConfigurationCache )
     {
-        this( null, decorationsPath, validator, decorationConfigurationCache );
+        this( null, decorationsPath, validator, decorationConfigurationCache, null, null );
     }
 
     public DecorationFactoryImpl( PortletRegistry registry,
                                   String decorationsPath, 
                                   ResourceValidator validator,
-                                  JetspeedCache decorationConfigurationCache )
+                                  JetspeedCache decorationConfigurationCache,
+                                  String defLayoutDecoration,
+                                  String defPortletDecoration)
     {
         this.registry =  registry;
         this.decorationsPath = new Path( decorationsPath );
@@ -114,6 +118,8 @@
         this.portletDecorationsPathStr = this.portletDecorationsPath.toString();
         this.validator = validator;
         this.decorationConfigurationCache = decorationConfigurationCache;
+        this.defaultLayoutDecoration = defLayoutDecoration;
+        this.defaultPortletDecoration = defPortletDecoration;
     }
         
     public ResourceValidator getResourceValidator()
@@ -432,6 +438,10 @@
                 {
                     // use page specified layout decorator name
                     decoration = page.getEffectiveDefaultDecorator(Fragment.LAYOUT);
+                    if (decoration == null)
+                    {
+                        decoration = this.defaultLayoutDecoration;
+                    }                    
                 }
                 else
                 {
@@ -443,9 +453,12 @@
             {
                 // use page specified default portlet decorator name
                 decoration = page.getEffectiveDefaultDecorator(Fragment.PORTLET);
+                if (decoration == null)
+                {
+                    decoration = this.defaultPortletDecoration;
+                }                
             }
-        }
-
+        }       
         return decoration;
     }
 
@@ -624,5 +637,14 @@
         {
             this.defaultDesktopPortletDecoration = newOne;
         }
+    }    
+    public String getDefaultPortletDecoration()
+    {
+        return this.defaultPortletDecoration;
     }
+    
+    public String getDefaultLayoutDecoration()
+    {
+        return this.defaultLayoutDecoration;        
+    }    
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/JetspeedServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/JetspeedServlet.java?rev=759365&r1=759364&r2=759365&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/JetspeedServlet.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/JetspeedServlet.java Fri Mar 27 21:52:55 2009
@@ -290,10 +290,11 @@
 
         }
         catch (JetspeedException e)
-        {
-            final String msg = "Fatal error encountered while processing portal request: "+e.toString();
+        {            
+            final String msg = "Fatal error encountered while processing portal request: "+e.getMessage();
             log.fatal(msg, e);
-            throw new ServletException(msg, e);
+            req.getSession(true).setAttribute("org.apache.portals.jestspeed.diagnostics", e.getLocalizedMessage());
+            res.sendRedirect(req.getContextPath() + "/diagnostics");
         }
     }
 

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/decoration/DecorationFactory.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/decoration/DecorationFactory.java?rev=759365&r1=759364&r2=759365&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/decoration/DecorationFactory.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/decoration/DecorationFactory.java Fri Mar 27 21:52:55 2009
@@ -203,4 +203,21 @@
      * selected portlet decoration does not support /desktop.
      */
     void setDefaultDesktopPortletDecoration( String newOne );
+
+    /**
+     * Get the default portal portlet decoration to be used when
+     * selected portlet decoration does not support /portal.
+     * 
+     * @return default desktop portlet decoration.
+     */
+    String getDefaultPortletDecoration();
+    
+    /**
+     * Get the default portlet layout decoration to be used when
+     * selected layout decoration does not support /portal.
+     * 
+     * @return default desktop layout decoration.
+     */
+    String getDefaultLayoutDecoration();
+    
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/desktop.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/desktop.xml?rev=759365&r1=759364&r2=759365&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/desktop.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/desktop.xml Fri Mar 27 21:52:55 2009
@@ -45,10 +45,10 @@
       supports the settings 'desktop.decoration.layout' and 'desktop.decoration.portlet', which if
       specified, override the values set here -->
     <constructor-arg index="5"><!-- default desktop layout decoration  -->
-      <value>tigris</value>
+      <value>${decorator.desktop.page.default}</value>
     </constructor-arg>
     <constructor-arg index="6"><!-- default desktop portlet decoration -->
-      <value>tigris</value>
+      <value>${decorator.desktop.portlet.default}</value>
     </constructor-arg>
 
     <!-- Uncomment this to HARD CODE your portal URL -->

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/theme-engine.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/theme-engine.xml?rev=759365&r1=759364&r2=759365&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/theme-engine.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/theme-engine.xml Fri Mar 27 21:52:55 2009
@@ -36,6 +36,12 @@
     <constructor-arg index="3">
       <ref bean="decorationConfigurationCache" />
     </constructor-arg>
+    <constructor-arg index="4"><!-- default layout decoration  -->
+      <value>${decorator.page.default}</value>
+    </constructor-arg>
+    <constructor-arg index="5"><!-- default portlet decoration -->
+      <value>${decorator.portlet.default}</value>
+    </constructor-arg>
   </bean>
 
 </beans>

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties?rev=759365&r1=759364&r2=759365&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties Fri Mar 27 21:52:55 2009
@@ -249,15 +249,6 @@
 email.smtp.auth=false
 
 #-------------------------------------------------------------------------
-# F I L E  - S E R V E R 
-#-------------------------------------------------------------------------
-# use-language
-use-language=true
-# use-language
-useFileSystem=true
-location=${applicationRoot}/content/
-
-#-------------------------------------------------------------------------
 # L A Y O U T
 #-------------------------------------------------------------------------
 # the default page layout if none is specified
@@ -272,6 +263,10 @@
 decorator.page.default = tigris
 # default portlet decorator if none specified
 decorator.portlet.default = tigris
+# Desktop: default page decorator if none specified
+decorator.desktop.page.default = tigris
+# Desktop: default portlet decorator if none specified
+decorator.desktop.portlet.default = tigris
 
 #-------------------------------------------------------------------------
 # P S M L



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