You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2005/11/14 08:33:50 UTC

svn commit: r344065 - in /portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax: AjaxAction.java AjaxBuilder.java AjaxRequestService.java

Author: taylor
Date: Sun Nov 13 23:33:46 2005
New Revision: 344065

URL: http://svn.apache.org/viewcvs?rev=344065&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-387

Layout pipeline (AJAX), Portlet Placement Manager
base code checked in
still need to integrate into pipeline

Added:
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxAction.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxBuilder.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxRequestService.java

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxAction.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxAction.java?rev=344065&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxAction.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxAction.java Sun Nov 13 23:33:46 2005
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2001,2004 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.jetspeed.ajax;
+
+import org.apache.jetspeed.request.RequestContext;
+import java.util.Map;
+
+/**
+ * An Ajax request is made up of an action and builder phases.
+ * Implement this interface for the Ajax action phase.
+ * The action should put any parameters or results it wants 
+ * passed on to the builders in the resultMap
+ *
+ * @author <href a="mailto:taylor@apache.org">David Sean Taylor</a>
+ */
+public interface AjaxAction
+{
+	 
+    /**
+     * The action should put any parameters or results it wants 
+     * passed on to the builders in the resultMap
+     * This method runs an Ajax action.
+     *  
+     * @param requestContext The Jetspeed Request Context
+     * @param resultMap map of action parameters passed to the builder context
+     * @return success is true, failure is false
+     * @throws Exception
+     */
+    public boolean run(RequestContext requestContext, Map resultMap) throws AJAXException;
+}

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxBuilder.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxBuilder.java?rev=344065&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxBuilder.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxBuilder.java Sun Nov 13 23:33:46 2005
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2000-2001,2004 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.jetspeed.ajax;
+
+import java.util.Map;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * An Ajax request is made up of an action and builder phases.
+ * Implement this interface for the Ajax builder phase.
+ * The builder can add additional information to the requiest context,
+ * and it also provides the template used for building the result stream
+ * sent back over the Ajax request.
+ *
+ * @author <href a="mailto:taylor@apache.org">David Sean Taylor</a>
+ */
+public interface AjaxBuilder
+{    
+    /**
+     * @return the name of the template used for this builder
+     */
+    public String getTemplate();
+
+    /**
+     * @return the name of the error template used for this builder
+     */    
+    public String getErrorTemplate();
+    
+    /**
+     * Build the normal context template
+     * 
+     * @param requestContext The Jetspeed Request Context
+     * @param contextVars Context variables to be substituted into template
+     * @return true on success false onerror
+     */
+    public boolean buildContext(RequestContext requestContext, Map contextVars);
+    
+    /**
+     * Build the error context template
+     * 
+     * @param requestContext The Jetspeed Request Context
+     * @param contextVars Context variables to be substituted into template
+     * @return true on success false onerror
+     */
+    public boolean buildErrorContext(RequestContext requestContext, Map contextVars);
+}

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxRequestService.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxRequestService.java?rev=344065&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxRequestService.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/ajax/AjaxRequestService.java Sun Nov 13 23:33:46 2005
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2001,2004 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.jetspeed.ajax;
+
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * An Ajax request is made up of an action and builder phases.
+ * This interface defines the entry point into Ajax Request processing
+ * typically used in a Jetspeed pipeline.
+ *
+ * @author <href a="mailto:taylor@apache.org">David Sean Taylor</a>
+ */
+public interface AjaxRequestService 
+{
+    public void process(RequestContext requestContext) throws AJAXException;
+}



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