portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r351672 - in /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed: ajax/AjaxRequestServiceImpl.java layout/ajax-xml/getportlets.vm layout/ajax-xml/psml.vm layout/impl/GetPageAction.java
Date Fri, 02 Dec 2005 10:52:28 GMT
Author: taylor
Date: Fri Dec  2 02:52:25 2005
New Revision: 351672

URL: http://svn.apache.org/viewcvs?rev=351672&view=rev
Log:
make "getpage" the default action for the ajaxapi pipeline
For this api, no need to specify the action:

http://localhost:8080/jetspeed/ajaxapi/testsuite.psml?action=getpage

same as

http://localhost:8080/jetspeed/ajaxapi/testsuite.psml

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/ajax/AjaxRequestServiceImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getportlets.vm
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/psml.vm
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/ajax/AjaxRequestServiceImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/ajax/AjaxRequestServiceImpl.java?rev=351672&r1=351671&r2=351672&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/ajax/AjaxRequestServiceImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/ajax/AjaxRequestServiceImpl.java
Fri Dec  2 02:52:25 2005
@@ -75,6 +75,9 @@
     // Parameter on the URL that will be used to lookup the object
     protected String urlParameterName = URL_PARAMETER_NAME;
 
+    // Default Action if no action specified
+    protected String defaultAction = "getpage";
+    
     // Spring can be used to inject this information
     public AjaxRequestServiceImpl(Map objects, VelocityEngine velocityEngine)
     {
@@ -95,56 +98,50 @@
     public void process(RequestContext requestContext) throws AJAXException
     {        
         // Lookup the object that is to be used
-        String objectKey = requestContext.getRequestParameter(urlParameterName);
-        if (objectKey != null)
+        String objectKey = requestContext.getRequestParameter(urlParameterName);        
+        if (objectKey == null)
         {
-            // Get the object associated with this key
-            Object object = objects.get(objectKey);
-            if (object != null)
-            {
-                Map resultMap = new HashMap();
+            objectKey = defaultAction;
+        }
+        // Get the object associated with this key
+        Object object = objects.get(objectKey);
+        if (object != null)
+        {
+            Map resultMap = new HashMap();
 
-                boolean success = true;
-                try
-                {
-                    // Check to see if this object implements the action
-                    // interface
-                    if (object instanceof AjaxAction)
-                    {
-                        success = processAction((AjaxAction) object,
-                                requestContext, resultMap);
-                    }
-                } catch (Exception e)
+            boolean success = true;
+            try
+            {
+                // Check to see if this object implements the action
+                // interface
+                if (object instanceof AjaxAction)
                 {
-                    success = false;
+                    success = processAction((AjaxAction) object,
+                            requestContext, resultMap);
                 }
+            } catch (Exception e)
+            {
+                success = false;
+            }
 
-                try
-                {
-                    // Check to see if this object implements the builder
-                    // interface
-                    if (object instanceof AjaxBuilder)
-                    {
-                        processBuilder((AjaxBuilder) object, resultMap,
-                                requestContext, success);
-                    }
-                } catch (Exception e)
+            try
+            {
+                // Check to see if this object implements the builder
+                // interface
+                if (object instanceof AjaxBuilder)
                 {
-                    // The builder failed, return an error response
-                    buildError(requestContext);
+                    processBuilder((AjaxBuilder) object, resultMap,
+                            requestContext, success);
                 }
-            } else
+            } catch (Exception e)
             {
-                // Log an informational message
-                log.debug("could not find the object named:" + objectKey);
-
-                // Return an error response
+                // The builder failed, return an error response
                 buildError(requestContext);
             }
         } else
         {
-            // Log an information message
-            log.debug("key not found, could not process");
+            // Log an informational message
+            log.debug("could not find the object named:" + objectKey);
 
             // Return an error response
             buildError(requestContext);

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getportlets.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getportlets.vm?rev=351672&r1=351671&r2=351672&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getportlets.vm
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getportlets.vm
Fri Dec  2 02:52:25 2005
@@ -1,6 +1,6 @@
 <js>
     <status>$status</status>
-    <action>getportlets</action>
+    <action>$action</action>
     
     <portlets>
 #foreach ($portlet in $portlets)    

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/psml.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/psml.vm?rev=351672&r1=351671&r2=351672&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/psml.vm
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/psml.vm
Fri Dec  2 02:52:25 2005
@@ -20,7 +20,7 @@
 
 <js>
     <status>$status</status>
-    <action>getportlets</action>
+    <action>$action</action>
     
 <page hidden='$page.Hidden'>
   <defaults

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java?rev=351672&r1=351671&r2=351672&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
Fri Dec  2 02:52:25 2005
@@ -40,7 +40,7 @@
     implements AjaxAction, AjaxBuilder, Constants
 {
     /** Logger */
-    protected Log log = LogFactory.getLog(GetPortletsAction.class);
+    protected Log log = LogFactory.getLog(GetPageAction.class);
 
     private PageManager pageManager = null;
     



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


Mime
View raw message