cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r307043 - in /cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal: ./ impl/ layout/ layout/impl/ profile/ profile/impl/ util/
Date Fri, 07 Oct 2005 07:29:31 GMT
Author: rgoers
Date: Fri Oct  7 00:29:21 2005
New Revision: 307043

URL: http://svn.apache.org/viewcvs?rev=307043&view=rev
Log:
<action dev='RG' type='fix' fixes-bug='34802' due-to='Roy Huang' due-to-email='roy_huang@nbmgroup.com'>
      PageLabelLinkService generated the wrong url when using 3 layer tabs with showallnav.
    </action>

Added:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/PortalException.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutException.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/ProfileException.java
Removed:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/ProfileException.java
Modified:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFactory.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletBaseDataReferenceFieldHandler.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletDataReferenceFieldHandler.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletInstanceDataReferenceFieldHandler.java

Added: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/PortalException.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/PortalException.java?rev=307043&view=auto
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/PortalException.java (added)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/PortalException.java Fri Oct
 7 00:29:21 2005
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+package org.apache.cocoon.portal;
+
+/**
+ *
+ * @author <a href="mailto:rgoers@apache.org">Ralph Goers</a>
+ *
+ * @version $Id: $
+ */
+public class PortalException extends RuntimeException {
+    public PortalException() {
+        super();
+    }
+
+    public PortalException(String message) {
+        super(message);
+    }
+
+    public PortalException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public PortalException(Throwable cause) {
+        super(cause);
+    }
+}

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java?rev=307043&r1=307042&r2=307043&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java
Fri Oct  7 00:29:21 2005
@@ -161,7 +161,14 @@
                     value.append('.');
                 }
                 if (item instanceof NamedItem) {
-                    value.append(((NamedItem)item).getName());
+                    if(value.length()>0) {
+                    	value.append(((NamedItem)item).getName());
+                    }
+                    else {
+                        StringBuffer key = new StringBuffer("");
+                        getKey(item, key);
+                	    value.append(key.toString());
+                    }
                 } else {
                     value.append(Integer.toString(i));
                 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java?rev=307043&r1=307042&r2=307043&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java Fri
Oct  7 00:29:21 2005
@@ -31,6 +31,7 @@
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.cocoon.portal.PortalService;
+import org.apache.cocoon.portal.PortalException;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.CompositeLayout;
 import org.apache.cocoon.portal.layout.Item;
@@ -161,7 +162,7 @@
 
             return map;
         } catch (ServiceException ce) {
-            throw new CascadingRuntimeException("Unable to lookup component.", ce);
+            throw new PortalException("Unable to lookup component.", ce);
         } finally {
             this.manager.release(service);
         }
@@ -193,7 +194,7 @@
 
             return list;
         } catch (ServiceException ce) {
-            throw new CascadingRuntimeException("Unable to lookup component.", ce);
+            throw new PortalException("Unable to lookup component.", ce);
         } finally {
             this.manager.release(service);
         }
@@ -221,7 +222,7 @@
             return labels;
         }
         catch (ServiceException ce) {
-            throw new CascadingRuntimeException("Unable to lookup component.", ce);
+            throw new PortalException("Unable to lookup component.", ce);
         }
         finally {
             this.manager.release(service);

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java?rev=307043&r1=307042&r2=307043&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java Fri
Oct  7 00:29:21 2005
@@ -160,8 +160,12 @@
         if ( portalLayout == null ) {
             portalLayout = this.portalService.getComponentManager().getProfileManager().getPortalLayout(null,
null);
         }
+        if ( portalLayout == null) {
+            getLogger().error("No Layout to render");
+            return;
+        }
 
-        Renderer portalLayoutRenderer = this.portalService.getComponentManager().getRenderer(
portalLayout.getRendererName());       
+        Renderer portalLayoutRenderer = this.portalService.getComponentManager().getRenderer(
portalLayout.getRendererName());
 
         ch.startDocument();
         portalLayoutRenderer.toSAX(portalLayout, this.portalService, ch);

Added: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutException.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutException.java?rev=307043&view=auto
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutException.java (added)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutException.java Fri
Oct  7 00:29:21 2005
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+package org.apache.cocoon.portal.layout;
+
+import org.apache.cocoon.portal.PortalException;
+
+/**
+ *
+ * @author <a href="mailto:rgoers@apache.org">Ralph Goers</a>
+ *
+ * @version $Id: $
+ */
+public class LayoutException extends PortalException {
+    public LayoutException() {
+        super();
+    }
+
+    public LayoutException(String message) {
+        super(message);
+    }
+
+    public LayoutException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public LayoutException(Throwable cause) {
+        super(cause);
+    }
+}
+

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFactory.java?rev=307043&r1=307042&r2=307043&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFactory.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFactory.java Fri
Oct  7 00:29:21 2005
@@ -25,7 +25,7 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: LayoutFactory.java,v 1.5 2004/03/05 13:02:13 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public interface LayoutFactory  {
     
@@ -34,8 +34,7 @@
     /**
      * This method is invoked for a newly loaded profile
      */
-    void prepareLayout(Layout layout)
-    throws ProcessingException;
+    void prepareLayout(Layout layout);
     
     /**
      * Create a new layout instance.

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java?rev=307043&r1=307042&r2=307043&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
Fri Oct  7 00:29:21 2005
@@ -51,6 +51,7 @@
 import org.apache.cocoon.portal.layout.Item;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutFactory;
+import org.apache.cocoon.portal.layout.LayoutException;
 import org.apache.cocoon.portal.layout.renderer.Renderer;
 import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.cocoon.util.ClassUtils;
@@ -257,20 +258,19 @@
     /* (non-Javadoc)
      * @see org.apache.cocoon.portal.layout.LayoutFactory#prepareLayout(org.apache.cocoon.portal.layout.Layout)
      */
-    public void prepareLayout(Layout layout) 
-    throws ProcessingException {
+    public void prepareLayout(Layout layout){
         if ( layout != null ) {
             
             this.init();
      
             final String layoutName = layout.getName();
             if ( layoutName == null ) {
-                throw new ProcessingException("Layout '"+layout.getId()+"' has no associated
name.");
+                throw new LayoutException("Layout '"+layout.getId()+"' has no associated
name.");
             }
             Object[] o = (Object[]) this.layouts.get( layoutName );
             
             if ( o == null ) {
-                throw new ProcessingException("LayoutDescription with name '" + layoutName
+ "' not found.");
+                throw new LayoutException("LayoutDescription with name '" + layoutName +
"' not found.");
             }
             DefaultLayoutDescription layoutDescription = (DefaultLayoutDescription)o[0];
 

Added: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/ProfileException.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/ProfileException.java?rev=307043&view=auto
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/ProfileException.java
(added)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/ProfileException.java
Fri Oct  7 00:29:21 2005
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+package org.apache.cocoon.portal.profile;
+
+import org.apache.cocoon.portal.PortalException;
+
+/**
+ *
+ * @author <a href="mailto:rgoers@apache.org">Ralph Goers</a>
+ *
+ * @version $Id: $
+ */
+public class ProfileException extends PortalException {
+    public ProfileException() {
+        super();
+    }
+
+    public ProfileException(String message) {
+        super(message);
+    }
+
+    public ProfileException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public ProfileException(Throwable cause) {
+        super(cause);
+    }
+}

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java?rev=307043&r1=307042&r2=307043&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
Fri Oct  7 00:29:21 2005
@@ -35,7 +35,7 @@
 import org.apache.cocoon.portal.profile.PortalUser;
 import org.apache.cocoon.portal.profile.ProfileLS;
 import org.apache.cocoon.portal.util.DeltaApplicableReferencesAdjustable;
-import org.apache.cocoon.portal.util.ProfileException;
+import org.apache.cocoon.portal.profile.ProfileException;
 import org.apache.cocoon.webapps.authentication.AuthenticationManager;
 import org.apache.cocoon.webapps.authentication.configuration.ApplicationConfiguration;
 import org.apache.cocoon.webapps.authentication.user.RequestState;

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java?rev=307043&r1=307042&r2=307043&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
Fri Oct  7 00:29:21 2005
@@ -41,6 +41,7 @@
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.profile.PortalUser;
 import org.apache.cocoon.portal.profile.ProfileLS;
+import org.apache.cocoon.portal.profile.ProfileException;
 import org.apache.commons.collections.map.LinkedMap;
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.excalibur.source.SourceNotFoundException;
@@ -311,11 +312,11 @@
             try {
                 profile = this.loadProfile(layoutKey);
             } catch (Exception e) {
-                throw new CascadingRuntimeException("Unable to load profile: " + layoutKey,
e);
+                throw new ProfileException("Unable to load profile: " + layoutKey, e);
             }
         }
         if ( profile == null ) {
-            throw new RuntimeException("Unable to load profile: " + layoutKey);
+            throw new ProfileException("Unable to load profile: " + layoutKey);
         }
         if ( layoutId != null ) {
             return (Layout)profile.getLayouts().get(layoutId);

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletBaseDataReferenceFieldHandler.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletBaseDataReferenceFieldHandler.java?rev=307043&r1=307042&r2=307043&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletBaseDataReferenceFieldHandler.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletBaseDataReferenceFieldHandler.java
Fri Oct  7 00:29:21 2005
@@ -17,6 +17,7 @@
 
 import org.apache.cocoon.portal.coplet.CopletBaseData;
 import org.apache.cocoon.portal.coplet.CopletData;
+import org.apache.cocoon.portal.profile.ProfileException;
 
 /**
  * Field handler for external CopletBaseData references.

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletDataReferenceFieldHandler.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletDataReferenceFieldHandler.java?rev=307043&r1=307042&r2=307043&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletDataReferenceFieldHandler.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletDataReferenceFieldHandler.java
Fri Oct  7 00:29:21 2005
@@ -17,6 +17,7 @@
 
 import org.apache.cocoon.portal.coplet.CopletData;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
+import org.apache.cocoon.portal.profile.ProfileException;
 
 /**
  * Field handler for external CopletData references.

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletInstanceDataReferenceFieldHandler.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletInstanceDataReferenceFieldHandler.java?rev=307043&r1=307042&r2=307043&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletInstanceDataReferenceFieldHandler.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/CopletInstanceDataReferenceFieldHandler.java
Fri Oct  7 00:29:21 2005
@@ -17,6 +17,7 @@
 
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.layout.impl.CopletLayout;
+import org.apache.cocoon.portal.profile.ProfileException;
 
 /**
  * Field handler for external CopletInstanceData references.



Mime
View raw message