[jboss-svn-commits] JBoss Portal SVN: r5221 - in branches/JBoss_Portal_Branch_2_4: common/src/main/org/jboss/portal/test/common portlet/src/main/org/jboss/portal/portlet/state/producer wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer wsrp/src/main/org/jboss/portal/wsrp/consumer wsrp/src/main/org/jboss/portal/wsrp/producer

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Sep 18 17:47:46 EDT 2006


Author: chris.laprun at jboss.com
Date: 2006-09-18 17:47:42 -0400 (Mon, 18 Sep 2006)
New Revision: 5221

Modified:
   branches/JBoss_Portal_Branch_2_4/common/src/main/org/jboss/portal/test/common/URLToolsTestCase.java
   branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/portlet/state/producer/StatefulPortletInvoker.java
   branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
   branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
   branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
   branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
Log:
- JBPORTAL-1041: de-activated fragment processing for 2.4.1. Will be converted to interceptor for 2.6. Adapted test case.
- JBPORTAL-1039: first implementation. If no namespace prefix is provided by the consumer, use the portlet handle for now.
  Better implementation will be needed in 2.6. Add namespacePrefix and portletInstanceKey to markup request in consumer.
- Improved logging.
- Minor code improvements.

Modified: branches/JBoss_Portal_Branch_2_4/common/src/main/org/jboss/portal/test/common/URLToolsTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/common/src/main/org/jboss/portal/test/common/URLToolsTestCase.java	2006-09-18 21:41:03 UTC (rev 5220)
+++ branches/JBoss_Portal_Branch_2_4/common/src/main/org/jboss/portal/test/common/URLToolsTestCase.java	2006-09-18 21:47:42 UTC (rev 5221)
@@ -23,6 +23,8 @@
 package org.jboss.portal.test.common;
 
 import junit.framework.TestCase;
+import org.jboss.portal.common.util.URLTools;
+import org.jboss.portal.common.util.URLTools.URLMatch;
 
 /**
  * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
@@ -52,9 +54,9 @@
    {
       String markup = MARKUP;
 
-      org.jboss.portal.common.util.URLTools.URLMatch[] links = org.jboss.portal.common.util.URLTools.extractURLsFrom(markup);
+      URLMatch[] links = URLTools.extractURLsFrom(markup);
       assertEquals(4, links.length);
-      org.jboss.portal.common.util.URLTools.URLMatch link = links[0];
+      URLTools.URLMatch link = links[0];
       assertEquals("wsrp_rewrite?wsrp-urlType=render&amp;wsrp-navigationalState=rO0ABXNyACdvcmcuamJvc3MucG9ydGFsLnNl" +
          "cnZlci51dGlsLlBhcmFtZXRlcnOJoAlMQZGhngIAAUwAA21hcHQAD0xqYXZhL3V0aWwvTWFwO3hwc3IAEWphdmEudXRpbC5IYXNoTWFwBQ" +
          "fawcMWYNEDAAJGAApsb2FkRmFjdG9ySQAJdGhyZXNob2xkeHA_QAAAAAAADHcIAAAAEAAAAAF0AARuYW1ldXIAE1tMamF2YS5sYW5nLlN0" +
@@ -66,7 +68,7 @@
 
       String url = "wsrp_rewrite?wsrp-urlType=render&amp;wsrp-mode=help/wsrp_rewrite";
       markup = "12345href='" + url + "'76";
-      links = org.jboss.portal.common.util.URLTools.extractURLsFrom(markup);
+      links = URLTools.extractURLsFrom(markup);
       link = links[0];
       int startIndex = 11;
       assertEquals(startIndex, link.getStart());
@@ -77,18 +79,18 @@
 
    public void testReplaceURLs()
    {
-      String markup = org.jboss.portal.common.util.URLTools.replaceURLsBy(MARKUP, new String[]{"foo", "bar", "baz", "buz"});
+      String markup = URLTools.replaceURLsBy(MARKUP, new String[]{"foo", "bar", "baz", "buz"});
       String replaced = "Hello, Anonymous!\nCounter: 0<a href='foo'>My name is Julien</a><a href='bar'>My name is Roy</a>" +
          "<action='baz'>counter++</a><a href='buz'>counter--</a>";
       assertEquals(replaced, markup);
-      assertEquals(replaced, org.jboss.portal.common.util.URLTools.replaceURLsBy(replaced, (String[])null));
+      assertEquals(replaced, URLTools.replaceURLsBy(replaced, (String[])null));
 
       String mixed = "<a href='wsrp_rewrite?wsrp-urlType=render&amp;wsrp-mode=help/wsrp_rewrite'>My name is Julien</a>" +
          "<a href='bar'>My name is Roy</a>";
       assertEquals("<a href='foo'>My name is Julien</a><a href='bar'>My name is Roy</a>",
-         org.jboss.portal.common.util.URLTools.replaceURLsBy(mixed, new org.jboss.portal.common.util.URLTools.URLReplacementGenerator()
+         URLTools.replaceURLsBy(mixed, new URLTools.URLReplacementGenerator()
          {
-            public String getReplacementFor(int currentIndex, org.jboss.portal.common.util.URLTools.URLMatch currentMatch)
+            public String getReplacementFor(int currentIndex, URLTools.URLMatch currentMatch)
             {
                String urlAsString = currentMatch.getURLAsString();
                if (urlAsString.startsWith("wsrp_rewrite"))

Modified: branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/portlet/state/producer/StatefulPortletInvoker.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/portlet/state/producer/StatefulPortletInvoker.java	2006-09-18 21:41:03 UTC (rev 5220)
+++ branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/portlet/state/producer/StatefulPortletInvoker.java	2006-09-18 21:47:42 UTC (rev 5221)
@@ -26,22 +26,22 @@
 import org.jboss.portal.common.value.SimpleValueMap;
 import org.jboss.portal.common.value.Value;
 import org.jboss.portal.common.value.ValueMap;
+import org.jboss.portal.portlet.InvalidPortletIdException;
 import org.jboss.portal.portlet.NoSuchPortletException;
 import org.jboss.portal.portlet.Portlet;
 import org.jboss.portal.portlet.PortletInvoker;
 import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.InvalidPortletIdException;
-import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.portlet.state.AbstractPropertyContext;
+import org.jboss.portal.portlet.info.PortletInfo;
 import org.jboss.portal.portlet.info.PreferenceInfo;
 import org.jboss.portal.portlet.info.PreferencesInfo;
-import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
 import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.state.AbstractPropertyContext;
+import org.jboss.portal.portlet.state.AccessMode;
 
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Set;
-import java.util.ArrayList;
 
 /**
  * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -177,7 +177,6 @@
          throw new InvocationException("No portlet invoker provided");
       }
 
-
       // Get the portle access mode
       AccessMode access = invocation.getInstanceContext().getAccessMode();
       if (invocation instanceof ActionInvocation && access == null)
@@ -221,6 +220,7 @@
       // If it is a producer offered portlet we consider read-write as read-only
       if (access == AccessMode.READ_WRITE && stateId == null)
       {
+         log.debug("Producer offered portlet '" + portletId + "' requiring READ_WRITE mode. Switching to READ_ONLY.");
          access = AccessMode.READ_ONLY;
       }
 
@@ -424,7 +424,7 @@
             // We need the referenced portlet
             if (referencedPortlet == null)
             {
-               throw new PortletInvokerException("The portlet " + referencedPortletId  + " referenced by this clone " + portletId + " is not available");
+               throw new PortletInvokerException("The portlet " + referencedPortletId + " referenced by this clone " + portletId + " is not available");
             }
 
             // Get the portlet info
@@ -478,7 +478,7 @@
       }
       try
       {
-         String stateId =  portletId.substring(1);
+         String stateId = portletId.substring(1);
 
          // Load the state
          State state = stateStore.loadState(stateId);
@@ -492,7 +492,7 @@
          // We need the referenced portlet
          if (referencedPortlet == null)
          {
-            throw new PortletInvokerException("The portlet " + referencedPortletId  + " referenced by this clone " + portletId + " is not available");
+            throw new PortletInvokerException("The portlet " + referencedPortletId + " referenced by this clone " + portletId + " is not available");
          }
 
          // Get the portlet info
@@ -505,7 +505,7 @@
          properties = new SimpleValueMap(properties);
 
          //  Remove read only values 
-         for (Iterator i = new ArrayList(properties.getKeys()).iterator();i.hasNext();)
+         for (Iterator i = new ArrayList(properties.getKeys()).iterator(); i.hasNext();)
          {
             String key = (String)i.next();
             Value value = properties.getValue(key);

Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java	2006-09-18 21:41:03 UTC (rev 5220)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java	2006-09-18 21:47:42 UTC (rev 5221)
@@ -90,8 +90,13 @@
       getMarkup.getMarkupParams().setMode(WSRPConstants.EDIT_MODE);
 
       MarkupResponse response = markupService.getMarkup(getMarkup);
+      /*
+      // commented out because fails with fragment processing de-activation
       checkMarkupResponse(response, "<form method='post' action='wsrp_rewrite?wsrp-urlType=blockingAction&amp;wsrp" +
          "-interactionState=JBPNS_/wsrp_rewrite' id='wsrp_rewrite_portfolioManager'><table><tr><td>Stock symbol</t" +
+         "d><td><input name='symbol'/></td></tr><tr><td><input type='submit' value='Submit'></td></tr></table></form>");*/
+      checkMarkupResponse(response, "<form method='post' action='wsrp_rewrite?wsrp-urlType=blockingAction&amp;wsrp" +
+         "-interactionState=JBPNS_/wsrp_rewrite' id='portfolioManager'><table><tr><td>Stock symbol</t" +
          "d><td><input name='symbol'/></td></tr><tr><td><input type='submit' value='Submit'></td></tr></table></form>");
    }
 

Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java	2006-09-18 21:41:03 UTC (rev 5220)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java	2006-09-18 21:47:42 UTC (rev 5221)
@@ -27,6 +27,8 @@
 import org.jboss.portal.portlet.PortletInvokerException;
 import org.jboss.portal.portlet.invocation.PortletInvocation;
 import org.jboss.portal.portlet.result.ErrorResult;
+import org.jboss.portal.portlet.spi.InstanceContext;
+import org.jboss.portal.portlet.spi.WindowContext;
 import org.jboss.portal.wsrp.core.InvalidCookieFault;
 import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
 import org.jboss.portal.wsrp.core.InvalidSessionFault;
@@ -104,6 +106,13 @@
          sessionHandler.initCookieIfNeeded(invocation);
          updateRegistrationContext(request);
          RuntimeContext runtimeContext = getRuntimeContextFrom(request);
+
+         WindowContext windowContext = invocation.getWindowContext();
+         runtimeContext.setNamespacePrefix(windowContext == null ? null : windowContext.getId());
+
+         InstanceContext instanceContext = invocation.getInstanceContext();
+         runtimeContext.setPortletInstanceKey(instanceContext == null ? null : instanceContext.getId());
+
          updateUserContext(request, consumer.getUserContextFrom(invocation, runtimeContext));
          consumer.setTemplatesIfNeeded(invocation, runtimeContext);
 

Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java	2006-09-18 21:41:03 UTC (rev 5220)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java	2006-09-18 21:47:42 UTC (rev 5221)
@@ -182,7 +182,7 @@
       PortalContext portalContext = createPortalContext(params, markupRequest);
       UserContext userContext = createUserContext(wsrpUserContext, markupRequest.getLocale(), desiredLocales);
       InstanceContext instanceContext = createInstanceContext(portletHandle, AccessMode.READ_ONLY);
-      WindowContext windowContext = createWindowContext(runtimeContext);
+      WindowContext windowContext = createWindowContext(portletHandle, runtimeContext);
 
       // prepare the invocation
       WSRPRenderContext renderContext = new WSRPRenderContext(navigationalState, securityContext, streamInfo,
@@ -195,7 +195,9 @@
 
       try
       {
+         log.debug("RenderInvocation on portlet '" + portletHandle + "'");
          producer.getInvoker().invoke(render);
+         log.debug("RenderInvocation done");
       }
       catch (PortletInvokerException e)
       {
@@ -211,7 +213,7 @@
       switch (fragment.getType())
       {
          case FragmentResult.TYPE_CHARS:
-            markupString = processFragmentString(fragment.getChars().toString());
+            markupString = fragment.getChars().toString();
             break;
          case FragmentResult.TYPE_BYTES:
             markupBinary = fragment.getBytes().toByteArray(); // fix-me: might need to convert to Base64?
@@ -258,13 +260,15 @@
     */
    private String processFragmentString(String renderString)
    {
-      if (renderString != null)
+      if (renderString != null && renderString.length() > 0)
       {
+         log.debug("processFragmentString: preparing for rewriting:\n" + renderString);
          String result = Tools.replace(renderString, "id='", "id='" + WSRPRewritingConstants.WSRP_REWRITE_TOKEN);
          result = Tools.replace(result, "id=\"", "id=\"" + WSRPRewritingConstants.WSRP_REWRITE_TOKEN);
+         log.debug("processFragmentString: processed string:\n" + result);
          return result;
       }
-      return null;
+      return renderString;
    }
 
    public BlockingInteractionResponse performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
@@ -288,8 +292,8 @@
 
       PortletContext portletContext = performBlockingInteraction.getPortletContext();
       WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletContext, "PortletContext", PBI);
-      String handle = portletContext.getPortletHandle();
-      WSRPUtils.throwMissingParametersFaultIfValueIsMissing(handle, "portlet handle", "PortletContext");
+      String portletHandle = portletContext.getPortletHandle();
+      WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletHandle, "portlet handle", "PortletContext");
 
       RuntimeContext runtimeContext = performBlockingInteraction.getRuntimeContext();
       WSRPUtils.throwMissingParametersFaultIfValueIsMissing(runtimeContext, "RuntimeContext", PBI);
@@ -301,7 +305,7 @@
       final Portlet portlet;
       try
       {
-         portlet = invoker.getPortlet(handle);
+         portlet = invoker.getPortlet(portletHandle);
       }
       catch (PortletInvokerException e)
       {
@@ -312,7 +316,7 @@
 
       // get portlet description for the desired portlet...
       final String[] desiredLocales = markupParams.getLocales();
-      PortletDescription portletDescription = producer.getPortletDescription(handle, desiredLocales);
+      PortletDescription portletDescription = producer.getPortletDescription(portletHandle, desiredLocales);
       if (Boolean.TRUE.equals(portletDescription.getUsesMethodGet()))
       {
          throw WSRPUtils.createOperationFailedFault(
@@ -329,11 +333,11 @@
       HTTPStreamInfo streamInfo = createStreamInfo(markupRequest);
       PortalContext portalContext = createPortalContext(markupParams, markupRequest);
       UserContext userContext = createUserContext(wsrpUserContext, markupRequest.getLocale(), desiredLocales);
-      WindowContext windowContext = createWindowContext(runtimeContext);
+      WindowContext windowContext = createWindowContext(portletHandle, runtimeContext);
 
       StateChange stateChange = interactionParams.getPortletStateChange();
       WSRPUtils.throwMissingParametersFaultIfValueIsMissing(stateChange, "portletStateChange", "InteractionParams");
-      InstanceContext instanceContext = createInstanceContext(handle, WSRPUtils.getAccessModeFromStateChange(stateChange));
+      InstanceContext instanceContext = createInstanceContext(portletHandle, WSRPUtils.getAccessModeFromStateChange(stateChange));
 
 
       Parameters parameters;
@@ -368,6 +372,7 @@
       {
          parameters = new Parameters();
       }
+      log.debug("form parameters:\n" + parameters);
 
       StateString interactionState = createNavigationalState(interactionParams.getInteractionState());
 
@@ -382,7 +387,9 @@
 
       try
       {
+         log.debug("ActionInvocation on portlet '" + portletHandle + "'");
          producer.getInvoker().invoke(invocation);
+         log.debug("ActionInvocation done");
       }
       catch (PortletInvokerException e)
       {
@@ -506,21 +513,6 @@
 
    // Parameter checking methods ***************************************************************************************
 
-   private String checkSessionId(RuntimeContext runtimeContext) throws InvalidSessionFault
-   {
-      String sessionId = null;
-      if (runtimeContext != null)
-      {
-         sessionId = runtimeContext.getSessionID();
-         if (sessionId != null && !producer.isSessionValid(sessionId))
-         {
-            throw(InvalidSessionFault)WSRPUtils.createFaultFrom(InvalidSessionFault.class,
-               new IllegalStateException("Session with id: " + sessionId + " is invalid."));
-         }
-      }
-      return sessionId;
-   }
-
    private void checkUserContext(org.jboss.portal.wsrp.core.UserContext wsrpUserContext) throws MissingParametersFault
    {
       if (wsrpUserContext != null)
@@ -560,13 +552,22 @@
       };
    }
 
-   private WindowContext createWindowContext(final RuntimeContext runtimeContext)
+   private WindowContext createWindowContext(final String portletHandle, final RuntimeContext runtimeContext)
    {
       return new WindowContext()
       {
          public String getId()
          {
-            return runtimeContext.getNamespacePrefix();
+            String prefix = runtimeContext.getNamespacePrefix();
+            if (prefix != null && prefix.length() > 0)
+            {
+               return prefix;
+            }
+            else
+            {
+               log.debug("No provided namespace prefix for portlet '" + portletHandle + "'. Using portlet handle as namespace.");
+               return portletHandle;
+            }
          }
       };
    }

Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java	2006-09-18 21:41:03 UTC (rev 5220)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java	2006-09-18 21:47:42 UTC (rev 5221)
@@ -156,7 +156,7 @@
    public ServiceDescription getServiceDescription(GetServiceDescription gs)
       throws InvalidRegistrationFault, OperationFailedFault, RemoteException
    {
-      log.debug("getServiceDescription() invoked");
+      log.debug("getServiceDescription invoked");
       ServiceDescription sd = serviceDescriptionHandler.getServiceDescription(gs);
 
       //to avoid unnesessary processing
@@ -174,6 +174,7 @@
          }
       }
 
+      log.debug("end getServiceDescription");
       return sd;
    }
 
@@ -185,8 +186,10 @@
       OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault, InvalidRegistrationFault,
       UnsupportedMimeTypeFault, RemoteException
    {
-      log.info("getMarkup() invoked");
-      return markupHandler.getMarkup(getMarkup);
+      log.debug("getMarkup invoked");
+      MarkupResponse response = markupHandler.getMarkup(getMarkup);
+      log.debug("end getMarkup");
+      return response;
    }
 
    public BlockingInteractionResponse performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
@@ -195,22 +198,28 @@
       InvalidRegistrationFault, MissingParametersFault, InvalidUserCategoryFault, InconsistentParametersFault,
       InvalidHandleFault, InvalidCookieFault, RemoteException
    {
-      log.info("performBlockingInteraction() invoked");
-      return markupHandler.performBlockingInteraction(performBlockingInteraction);
+      log.debug("performBlockingInteraction invoked");
+      BlockingInteractionResponse interactionResponse = markupHandler.performBlockingInteraction(performBlockingInteraction);
+      log.debug("end performBlockingInteraction");
+      return interactionResponse;
    }
 
    public ReturnAny releaseSessions(ReleaseSessions releaseSessions)
       throws InvalidRegistrationFault, OperationFailedFault, MissingParametersFault, AccessDeniedFault, RemoteException
    {
-      log.info("releaseSessions() invoked");
-      return markupHandler.releaseSessions(releaseSessions);
+      log.debug("releaseSessions invoked");
+      ReturnAny returnAny = markupHandler.releaseSessions(releaseSessions);
+      log.debug("end releaseSessions");
+      return returnAny;
    }
 
    public ReturnAny initCookie(InitCookie initCookie)
       throws AccessDeniedFault, OperationFailedFault, InvalidRegistrationFault, RemoteException
    {
-      log.info("initCookie() invoked");
-      return markupHandler.initCookie(initCookie);
+      log.debug("initCookie invoked");
+      ReturnAny returnAny = markupHandler.initCookie(initCookie);
+      log.debug("end initCookie");
+      return returnAny;
    }
 
    // Registration implementation **************************************************************************************
@@ -218,22 +227,28 @@
    public RegistrationContext register(RegistrationData register) throws MissingParametersFault, OperationFailedFault,
       RemoteException
    {
-      log.info("register() invoked");
-      return registrationHandler.register(register);
+      log.debug("register invoked");
+      RegistrationContext registrationContext = registrationHandler.register(register);
+      log.debug("end register");
+      return registrationContext;
    }
 
    public ReturnAny deregister(RegistrationContext deregister) throws OperationFailedFault, InvalidRegistrationFault,
       RemoteException
    {
-      log.info("deregister() invoked");
-      return registrationHandler.deregister(deregister);
+      log.debug("deregister invoked");
+      ReturnAny returnAny = registrationHandler.deregister(deregister);
+      log.debug("end deregister");
+      return returnAny;
    }
 
    public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration) throws MissingParametersFault,
       OperationFailedFault, InvalidRegistrationFault, RemoteException
    {
-      log.info("modifyRegistration() invoked");
-      return registrationHandler.modifyRegistration(modifyRegistration);
+      log.debug("modifyRegistration invoked");
+      RegistrationState registrationState = registrationHandler.modifyRegistration(modifyRegistration);
+      log.debug("end modifyRegistration");
+      return registrationState;
    }
 
    // PortletManagement implementation *********************************************************************************
@@ -242,47 +257,59 @@
       throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault, InconsistentParametersFault,
       MissingParametersFault, InvalidRegistrationFault, OperationFailedFault, RemoteException
    {
-      log.info("getPortletDescription() invoked");
-      return portletManagementHandler.getPortletDescription(getPortletDescription);
+      log.debug("getPortletDescription invoked");
+      PortletDescriptionResponse description = portletManagementHandler.getPortletDescription(getPortletDescription);
+      log.debug("end getPortletDescription");
+      return description;
    }
 
    public PortletContext clonePortlet(ClonePortlet clonePortlet) throws InvalidUserCategoryFault, AccessDeniedFault,
       OperationFailedFault, InvalidHandleFault, InvalidRegistrationFault, InconsistentParametersFault,
       MissingParametersFault, RemoteException
    {
-      log.info("clonePortlet() invoked");
-      return portletManagementHandler.clonePortlet(clonePortlet);
+      log.debug("clonePortlet invoked");
+      PortletContext portletContext = portletManagementHandler.clonePortlet(clonePortlet);
+      log.debug("end clonePortlet");
+      return portletContext;
    }
 
    public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws InconsistentParametersFault,
       MissingParametersFault, InvalidRegistrationFault, OperationFailedFault, RemoteException
    {
-      log.info("destroyPortlets() invoked");
-      return portletManagementHandler.destroyPortlets(destroyPortlets);
+      log.debug("destroyPortlets invoked");
+      DestroyPortletsResponse destroyPortletsResponse = portletManagementHandler.destroyPortlets(destroyPortlets);
+      log.debug("end destroyPortlets");
+      return destroyPortletsResponse;
    }
 
    public PortletContext setPortletProperties(SetPortletProperties setPortletProperties) throws OperationFailedFault,
       InvalidHandleFault, MissingParametersFault, InconsistentParametersFault, InvalidUserCategoryFault,
       AccessDeniedFault, InvalidRegistrationFault, RemoteException
    {
-      log.info("setPortletProperties() invoked");
-      return portletManagementHandler.setPortletProperties(setPortletProperties);
+      log.debug("setPortletProperties invoked");
+      PortletContext portletContext = portletManagementHandler.setPortletProperties(setPortletProperties);
+      log.debug("end setPortletProperties");
+      return portletContext;
    }
 
    public PropertyList getPortletProperties(GetPortletProperties getPortletProperties) throws InvalidHandleFault,
       MissingParametersFault, InvalidRegistrationFault, AccessDeniedFault, OperationFailedFault,
       InconsistentParametersFault, InvalidUserCategoryFault, RemoteException
    {
-      log.info("getPortletProperties() invoked");
-      return portletManagementHandler.getPortletProperties(getPortletProperties);
+      log.debug("getPortletProperties invoked");
+      PropertyList list = portletManagementHandler.getPortletProperties(getPortletProperties);
+      log.debug("end getPortletProperties");
+      return list;
    }
 
    public PortletPropertyDescriptionResponse getPortletPropertyDescription(GetPortletPropertyDescription getPortletPropertyDescription)
       throws MissingParametersFault, InconsistentParametersFault, InvalidUserCategoryFault, InvalidRegistrationFault,
       AccessDeniedFault, InvalidHandleFault, OperationFailedFault, RemoteException
    {
-      log.info("getPortletPropertyDescription() invoked");
-      return portletManagementHandler.getPortletPropertyDescription(getPortletPropertyDescription);
+      log.debug("getPortletPropertyDescription invoked");
+      PortletPropertyDescriptionResponse descriptionResponse = portletManagementHandler.getPortletPropertyDescription(getPortletPropertyDescription);
+      log.debug("end getPortletPropertyDescription");
+      return descriptionResponse;
    }
 
    // Producer implementation ******************************************************************************************
@@ -350,8 +377,7 @@
 
    Portlet getPortletWith(String handle) throws InvalidHandleFault, PortletInvokerException
    {
-
-      Portlet portlet = null;
+      Portlet portlet;
       try
       {
          portlet = invoker.getPortlet(handle);
@@ -372,7 +398,7 @@
 
    Set getRemotablePortlets() throws PortletInvokerException
    {
-      log.debug("Picking up remotable portlets");
+      log.debug("Retrieving remotable portlets");
       Set allPortlets = invoker.getPortlets();
       Set remotablePortlets = new HashSet(allPortlets.size());
       for (Iterator iterator = allPortlets.iterator(); iterator.hasNext();)
@@ -382,7 +408,7 @@
          if (isRemotable(portlet))
          {
             remotablePortlets.add(portlet);
-            log.debug("Adding remotable portet to set: " + portlet.getId());
+            log.debug("Adding remotable portlet to set: " + portlet.getId());
          }
       }
       return remotablePortlets;
@@ -420,9 +446,9 @@
    /** Dispatch the invocation to the target by reflection */
    public Object invoke(Invocation invocation) throws Exception
    {
-      log.debug("invoke() invoked");
       Method method = invocation.getMethod();
       Object[] args = invocation.getArguments();
+      log.debug("invoke invoked: method=" + method + " args=" + args);
       return method.invoke(this, args);
    }
 
@@ -437,9 +463,9 @@
     */
    protected boolean isRegistrationValid(RegistrationContext registrationContext) throws InvalidRegistrationFault
    {
-      log.debug("checking isRegistrationValid()");
       if (isRequiresRegistration())
       {
+         log.debug("registration required: checking registration");
          // todo: implement more completely
          if (registrationContext == null)
          {
@@ -453,8 +479,8 @@
             throw(InvalidRegistrationFault)WSRPUtils.createFaultFrom(InvalidRegistrationFault.class,
                new IllegalArgumentException("Missing required registration handle is not a valid registration."));
          }
+         log.debug("registration is valid");
       }
-      log.debug("registration is valid");
       return true;
    }
 




More information about the jboss-svn-commits mailing list