cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r386062 - /cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java
Date Wed, 15 Mar 2006 12:29:36 GMT
Author: cziegeler
Date: Wed Mar 15 04:29:32 2006
New Revision: 386062

URL: http://svn.apache.org/viewcvs?rev=386062&view=rev
Log:
Improve logging

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java?rev=386062&r1=386061&r2=386062&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java
Wed Mar 15 04:29:32 2006
@@ -126,7 +126,10 @@
         }
         PortletDefinitionRegistry registry = (PortletDefinitionRegistry) portletContainerEnvironment.getContainerService(PortletDefinitionRegistry.class);
 
-        final String portletEntityId = (String) getConfiguration(coplet, "portlet");   
+        final String portletEntityId = (String) getConfiguration(coplet, "portlet");
+        if ( this.getLogger().isDebugEnabled() ) {
+            this.getLogger().debug("Coplet " + coplet.getId() + " tries to login into portlet
" + portletEntityId);
+        }
 
         PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
         PortletEntity portletEntity = ((PortletEntityListImpl)pae.getPortletEntityList()).add(pae,
portletEntityId, coplet, registry);
@@ -154,11 +157,13 @@
                 this.portletContainer.portletLoad(portletWindow, req.getRequest(portletWindow),
 
                                                   res);
             } catch (Exception e) {
-                this.getLogger().error("Error loading portlet " + portletEntityId, e);
+                this.getLogger().error("Error loading portlet " + portletEntityId + " for
instance " + coplet.getId(), e);
                 // remove portlet entity
                 coplet.removeTemporaryAttribute("window");
                 ((PortletEntityListImpl)pae.getPortletEntityList()).remove(portletEntity);
             }
+        } else {
+            this.getLogger().error("Error finding portlet " + portletEntityId + " for instance
" + coplet.getId() + " - no definition found.");
         }
     }
 
@@ -172,10 +177,11 @@
             throw new SAXException("Unable to execute JSR-168 portlets because of missing
servlet context.");
         }
         try {
+            final String portletEntityId = (String) getConfiguration(coplet, "portlet");
             // get the window
             final PortletWindow window = (PortletWindow)coplet.getTemporaryAttribute("window");
             if ( window == null ) {
-                throw new SAXException("Portlet couldn't be loaded: " + coplet.getId());
+                throw new SAXException("Portlet couldn't be loaded: " + coplet.getId() +
"(" + portletEntityId + ")");
             }
             final Map objectModel = ContextHelper.getObjectModel(this.context);
             final ServletRequestImpl  req = (ServletRequestImpl) objectModel.get("portlet-request");
@@ -219,7 +225,7 @@
         if ( window != null ) {
             coplet.removeTemporaryAttribute("window");
             PortletDefinitionRegistry registry = (PortletDefinitionRegistry) portletContainerEnvironment.getContainerService(PortletDefinitionRegistry.class);
-        
+
             PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
             ((PortletEntityListImpl)pae.getPortletEntityList()).remove(window.getPortletEntity());
         }



Mime
View raw message