You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2005/10/28 21:27:02 UTC

svn commit: r329272 [2/2] - in /cocoon/blocks: portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/ portal/trunk/java/org/apache/cocoon/portal/ portal/trunk/java/org/apache/cocoon/portal/authenticationfw/ portal/trunk/java/org/apache/cocoo...

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=329272&r1=329271&r2=329272&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 28 12:19:23 2005
@@ -41,12 +41,13 @@
 import org.apache.cocoon.portal.event.coplet.CopletInstanceDataAddedEvent;
 import org.apache.cocoon.portal.event.coplet.CopletInstanceDataRemovedEvent;
 import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.layout.LayoutException;
 import org.apache.cocoon.portal.profile.PortalUser;
 import org.apache.cocoon.portal.profile.ProfileLS;
 import org.apache.cocoon.portal.profile.ProfileException;
 import org.apache.cocoon.portal.scratchpad.Profile;
 import org.apache.cocoon.portal.scratchpad.ProfileImpl;
-import org.apache.cocoon.portal.PortalException;
+import org.apache.cocoon.portal.PortalRuntimeException;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.commons.collections.map.LinkedMap;
 import org.apache.commons.lang.exception.ExceptionUtils;
@@ -143,7 +144,7 @@
      * Prepares the object by using the specified factory.
      */
     protected void prepareObject(Object object)
-    throws ProcessingException {
+    throws LayoutException {
         if ( object != null ) {
             if ( object instanceof Map ) {
                 object = ((Map)object).values();
@@ -173,7 +174,7 @@
                     }
                 } catch (ServiceException se) {
                     // this should never happen
-                    throw new ProcessingException("Unable to get component.", se);
+                    throw new PortalRuntimeException("Unable to get component.", se);
                 } finally {
                     this.manager.release(adapterSelector);
                 }
@@ -214,7 +215,7 @@
                 }
 
             } catch (ServiceException e) {
-                throw new PortalException("Unable to lookup portal service.", e);
+                throw new PortalRuntimeException("Unable to lookup portal service.", e);
             } finally {
                 this.manager.release(adapterSelector);
             }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/StaticProfileManager.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/StaticProfileManager.java?rev=329272&r1=329271&r2=329272&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/StaticProfileManager.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/StaticProfileManager.java Fri Oct 28 12:19:23 2005
@@ -31,7 +31,7 @@
 import org.apache.cocoon.portal.profile.PortalUser;
 import org.apache.cocoon.portal.profile.ProfileLS;
 import org.apache.cocoon.portal.profile.ProfileException;
-import org.apache.cocoon.portal.PortalException;
+import org.apache.cocoon.portal.PortalRuntimeException;
 import org.apache.commons.collections.map.LinkedMap;
 import org.apache.commons.collections.map.StaticBucketMap;
 import org.apache.excalibur.source.SourceValidity;
@@ -46,12 +46,12 @@
 
     protected String profilesPath;
 
-    protected StaticBucketMap copletInstanceDataManagers = new StaticBucketMap();
-    protected StaticBucketMap copletDataManagers = new StaticBucketMap();
+    protected final StaticBucketMap copletInstanceDataManagers = new StaticBucketMap();
+    protected final StaticBucketMap copletDataManagers = new StaticBucketMap();
 
     protected static final String LAYOUTKEY_PREFIX = StaticProfileManager.class.getName() + "/Layout/";
 
-    protected PortalUser portalUser = new StaticPortalUser();
+    protected final PortalUser portalUser = new StaticPortalUser();
 
     /**
      * @see org.apache.cocoon.portal.profile.ProfileManager#getPortalLayout(String, String)
@@ -122,7 +122,7 @@
 
             return (Layout) layouts.get(layoutID);
         } catch (Exception ce) {
-            throw new LayoutException("Unable to get layout.", ce);
+            throw new ProfileException("Unable to get layout.", ce);
         } finally {
             this.manager.release(adapter);
         }
@@ -262,8 +262,10 @@
                 return current.getCopletData();
             }
             return null;
+        } catch (PortalRuntimeException pre) {
+            throw pre;
         } catch (Exception e) {
-            throw new PortalException("Unable to lookup portal service.", e);
+            throw new PortalRuntimeException("Unable to lookup portal service.", e);
         }
     }
 

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/tools/copletManagement/LayoutActions.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/tools/copletManagement/LayoutActions.java?rev=329272&r1=329271&r2=329272&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/tools/copletManagement/LayoutActions.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/tools/copletManagement/LayoutActions.java Fri Oct 28 12:19:23 2005
@@ -21,10 +21,10 @@
 import java.util.List;
 import java.util.ListIterator;
 
-import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.forms.formmodel.Repeater;
 import org.apache.cocoon.forms.formmodel.Widget;
 import org.apache.cocoon.forms.formmodel.Repeater.RepeaterRow;
+import org.apache.cocoon.portal.PortalException;
 import org.apache.cocoon.portal.coplet.CopletData;
 import org.apache.cocoon.portal.coplet.CopletFactory;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
@@ -74,28 +74,24 @@
 		else
 			lay = (Layout) layoutObj;
 
-		try {
-			// an empty item can not be handled by the LayoutFactory, do the job manual:
-			if (lay == null) {
-				List items = ((NamedItem)layoutObj).getParent().getItems(); 
-				for (ListIterator iter = items.listIterator(); iter.hasNext(); ) {
-
-					Item itemElem = (Item) iter.next();
-
-					if (itemElem.equals(layoutObj)) {
-						items.remove (iter.nextIndex()-1);
-						return true;
-					}
+		// an empty item can not be handled by the LayoutFactory, do the job manual:
+		if (lay == null) {
+			List items = ((NamedItem)layoutObj).getParent().getItems(); 
+			for (ListIterator iter = items.listIterator(); iter.hasNext(); ) {
+
+				Item itemElem = (Item) iter.next();
+
+				if (itemElem.equals(layoutObj)) {
+					items.remove (iter.nextIndex()-1);
+					return true;
 				}
-			} else if(lay.getParent() instanceof NamedItem) {
-				// FIXME: Causes that only the contents inside a tab are deleted instead of the tab
-			    NamedItem par = (NamedItem) lay.getParent();
-			    par.setLayout(null);
-			} else { 
-				lf.remove(lay);
 			}
-		} catch (ProcessingException e) {
-			e.printStackTrace();
+		} else if(lay.getParent() instanceof NamedItem) {
+			// FIXME: Causes that only the contents inside a tab are deleted instead of the tab
+		    NamedItem par = (NamedItem) lay.getParent();
+		    par.setLayout(null);
+		} else { 
+			lf.remove(lay);
 		}
 		return true;
 	}
@@ -183,7 +179,7 @@
 				nObj.setParent(ni);
 				ni.setLayout(nObj);
 			}
-		} catch (ProcessingException e) {
+		} catch (PortalException e) {
 			e.printStackTrace();
 		}
     }
@@ -228,7 +224,7 @@
 					((CompositeLayout) lay).addItem(m);
 					m.setLayout(tab);
 				}
-			} catch (ProcessingException e) {
+			} catch (PortalException e) {
 				e.printStackTrace();
 			}
 		}
@@ -279,7 +275,7 @@
 				    lay.setParent(item);
 				    cl.addItem(item);
 			    }
-			} catch (ProcessingException e) {
+			} catch (PortalException e) {
                 // ignore it
             }
 		}