portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r725977 [14/48] - in /portals/jetspeed-2/portal/trunk: ./ app-servers/security/jboss/src/java/META-INF/jboss-secsvc/ app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/ applications/jetspeed/src/main/javascrip...
Date Fri, 12 Dec 2008 12:07:04 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletHeaderRequestImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletHeaderRequestImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletHeaderRequestImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletHeaderRequestImpl.java Fri Dec 12 04:06:29 2008
@@ -1,71 +1,71 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You 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.aggregator.impl;
-
-import javax.portlet.PortletPreferences;
-
-import org.apache.jetspeed.om.portlet.InitParam;
-import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.jetspeed.portlet.PortletHeaderRequest;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.container.PortletWindow;
-
-
-public class PortletHeaderRequestImpl implements PortletHeaderRequest
-{
-    private RequestContext requestContext;
-    private String portletApplicationContextPath;
-    private PortletWindow portletWindow;
-    private PortletDefinition pd;
-    
-    public PortletHeaderRequestImpl( RequestContext requestContext, PortletWindow portletWindow, String portletApplicationContextPath )
-    {
-        this.requestContext = requestContext;
-        this.portletApplicationContextPath = portletApplicationContextPath;
-        this.portletWindow = portletWindow;
-    }
-    
-    public String getPortalContextPath()
-    {
-        return requestContext.getRequest().getContextPath();
-    }    
-    
-    public PortletPreferences getPreferences()
-    {
-        return null;
-//        return new PortletPreferencesImpl(org.apache.pluto.Constants.METHOD_NOOP, this.portletWindow.getPortletEntity());
-    }
-    
-    public String getInitParameter( String name )
-    {
-        if (pd == null)
-        {
-            pd = portletWindow.getPortletEntity().getPortletDefinition();
-        }
-        InitParam param = pd.getInitParam(name);
-        return param != null ? param.getParamValue() : null;
-    }
-    
-    /**
-     * @return Returns the portletApplicationContextPath.
-     */
-    public String getPortletApplicationContextPath()
-    {
-        return portletApplicationContextPath;
-    }
-    
-}
+ * 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.aggregator.impl;
+
+import javax.portlet.PortletPreferences;
+
+import org.apache.jetspeed.om.portlet.InitParam;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+import org.apache.jetspeed.portlet.PortletHeaderRequest;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.container.PortletWindow;
+
+
+public class PortletHeaderRequestImpl implements PortletHeaderRequest
+{
+    private RequestContext requestContext;
+    private String portletApplicationContextPath;
+    private PortletWindow portletWindow;
+    private PortletDefinition pd;
+    
+    public PortletHeaderRequestImpl( RequestContext requestContext, PortletWindow portletWindow, String portletApplicationContextPath )
+    {
+        this.requestContext = requestContext;
+        this.portletApplicationContextPath = portletApplicationContextPath;
+        this.portletWindow = portletWindow;
+    }
+    
+    public String getPortalContextPath()
+    {
+        return requestContext.getRequest().getContextPath();
+    }    
+    
+    public PortletPreferences getPreferences()
+    {
+        return null;
+//        return new PortletPreferencesImpl(org.apache.pluto.Constants.METHOD_NOOP, this.portletWindow.getPortletEntity());
+    }
+    
+    public String getInitParameter( String name )
+    {
+        if (pd == null)
+        {
+            pd = portletWindow.getPortletEntity().getPortletDefinition();
+        }
+        InitParam param = pd.getInitParam(name);
+        return param != null ? param.getParamValue() : null;
+    }
+    
+    /**
+     * @return Returns the portletApplicationContextPath.
+     */
+    public String getPortletApplicationContextPath()
+    {
+        return portletApplicationContextPath;
+    }
+    
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletHeaderRequestImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletHeaderResponseImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletHeaderResponseImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletHeaderResponseImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletHeaderResponseImpl.java Fri Dec 12 04:06:29 2008
@@ -1,116 +1,116 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You 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.aggregator.impl;
-
-import java.io.BufferedReader;
-import java.io.StringReader;
-import java.util.Map;
-
-import javax.portlet.PortletException;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.jetspeed.aggregator.PortletContent;
-import org.apache.jetspeed.headerresource.HeaderResource;
-import org.apache.jetspeed.portlet.PortletHeaderRequest;
-import org.apache.jetspeed.portlet.PortletHeaderResponse;
-import org.apache.jetspeed.request.RequestContext;
-
-
-public class PortletHeaderResponseImpl implements PortletHeaderResponse
-{
-    private RequestContext requestContext;
-    private HeaderResource hr;
-    private String tempContent;
-    
-    private boolean isDesktop;
-    
-    private Map headerConfiguration;
-    private Map headerResourceRegistry;
-    
-    public PortletHeaderResponseImpl( RequestContext requestContext, HeaderResource hr, boolean isDesktop, Map headerConfiguration, Map headerResourceRegistry )
-    {
-        this.requestContext = requestContext;
-        this.hr = hr;
-        this.isDesktop = isDesktop;
-        
-        this.headerConfiguration = headerConfiguration;
-        this.headerResourceRegistry = headerResourceRegistry;
-    }    
-
-    public void include(PortletHeaderRequest request, PortletHeaderResponse response, String headerResource)
-    throws PortletException
-    {
-        try
-        {
-            HttpServletRequest servletRequest = requestContext.getRequest();
-            HttpServletResponse servletResponse = requestContext.getResponse();
-            PortletContent content = new PortletContentImpl();
-            HttpBufferedResponse bufferedResponse = 
-                new HttpBufferedResponse(servletResponse, content.getWriter());
-            ServletContext crossContext = requestContext.getConfig().getServletContext().getContext(request.getPortletApplicationContextPath());            
-            RequestDispatcher dispatcher = crossContext.getRequestDispatcher(headerResource);
-            if (dispatcher != null)
-                dispatcher.include(servletRequest, bufferedResponse);            
-            bufferedResponse.flushBuffer();
-            BufferedReader reader = new BufferedReader(new StringReader(content.getContent()));
-            String buffer;
-            StringBuffer headerText = new StringBuffer();
-            while ((buffer = reader.readLine()) != null)
-            {
-                headerText.append( buffer ).append( "\r\n" );
-            }
-            tempContent = headerText.toString();            
-        }
-        catch (Exception e)
-        {
-            throw new PortletException(e);
-        }
-    }
-    
-    protected RequestContext getRequestContext()
-    {
-        return this.requestContext;
-    }
-    
-    public HeaderResource getHeaderResource()
-    {
-        return this.hr;
-    }
-    
-    public boolean isDesktop()
-    {
-        return this.isDesktop;
-    }
-    
-    public Map getHeaderConfiguration()
-    {
-        return this.headerConfiguration;
-    }
-    
-    public Map getHeaderResourceRegistry()
-    {
-        return this.headerResourceRegistry;
-    }
-    
-    public String getContent()
-    {
-        return tempContent; 
-    }
-}
+ * 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.aggregator.impl;
+
+import java.io.BufferedReader;
+import java.io.StringReader;
+import java.util.Map;
+
+import javax.portlet.PortletException;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.jetspeed.aggregator.PortletContent;
+import org.apache.jetspeed.headerresource.HeaderResource;
+import org.apache.jetspeed.portlet.PortletHeaderRequest;
+import org.apache.jetspeed.portlet.PortletHeaderResponse;
+import org.apache.jetspeed.request.RequestContext;
+
+
+public class PortletHeaderResponseImpl implements PortletHeaderResponse
+{
+    private RequestContext requestContext;
+    private HeaderResource hr;
+    private String tempContent;
+    
+    private boolean isDesktop;
+    
+    private Map headerConfiguration;
+    private Map headerResourceRegistry;
+    
+    public PortletHeaderResponseImpl( RequestContext requestContext, HeaderResource hr, boolean isDesktop, Map headerConfiguration, Map headerResourceRegistry )
+    {
+        this.requestContext = requestContext;
+        this.hr = hr;
+        this.isDesktop = isDesktop;
+        
+        this.headerConfiguration = headerConfiguration;
+        this.headerResourceRegistry = headerResourceRegistry;
+    }    
+
+    public void include(PortletHeaderRequest request, PortletHeaderResponse response, String headerResource)
+    throws PortletException
+    {
+        try
+        {
+            HttpServletRequest servletRequest = requestContext.getRequest();
+            HttpServletResponse servletResponse = requestContext.getResponse();
+            PortletContent content = new PortletContentImpl();
+            HttpBufferedResponse bufferedResponse = 
+                new HttpBufferedResponse(servletResponse, content.getWriter());
+            ServletContext crossContext = requestContext.getConfig().getServletContext().getContext(request.getPortletApplicationContextPath());            
+            RequestDispatcher dispatcher = crossContext.getRequestDispatcher(headerResource);
+            if (dispatcher != null)
+                dispatcher.include(servletRequest, bufferedResponse);            
+            bufferedResponse.flushBuffer();
+            BufferedReader reader = new BufferedReader(new StringReader(content.getContent()));
+            String buffer;
+            StringBuffer headerText = new StringBuffer();
+            while ((buffer = reader.readLine()) != null)
+            {
+                headerText.append( buffer ).append( "\r\n" );
+            }
+            tempContent = headerText.toString();            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException(e);
+        }
+    }
+    
+    protected RequestContext getRequestContext()
+    {
+        return this.requestContext;
+    }
+    
+    public HeaderResource getHeaderResource()
+    {
+        return this.hr;
+    }
+    
+    public boolean isDesktop()
+    {
+        return this.isDesktop;
+    }
+    
+    public Map getHeaderConfiguration()
+    {
+        return this.headerConfiguration;
+    }
+    
+    public Map getHeaderResourceRegistry()
+    {
+        return this.headerResourceRegistry;
+    }
+    
+    public String getContent()
+    {
+        return tempContent; 
+    }
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletHeaderResponseImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletTrackingManagerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXFilter.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXFilter.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXFilter.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXFilter.java Fri Dec 12 04:06:29 2008
@@ -1,83 +1,83 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You 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.io.IOException;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.context.ApplicationContext;
-import org.springframework.web.context.WebApplicationContext;
-
-/**
- * Simple ServletFilter for invoking AJAX services.
- * 
- * 
- * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
- *
- */
-public class AJAXFilter implements Filter
-{
-    private ApplicationContext ctx;
-    private AJAXService ajaxService;
-    private FilterConfig config;
-    
-    public void init(FilterConfig config) throws ServletException
-    {
-        this.config = config;
-    }
-
-    public void doFilter(ServletRequest request, ServletResponse response,
-            FilterChain arg2) throws IOException, ServletException
-    {        
-        try
-        {
-            response.setContentType("text/xml");
-            if(ctx == null)
-            {
-                ctx = (ApplicationContext)config.getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
-                ajaxService = (AJAXService) ctx.getBean("AJAXService");
-            }
-            
-            AJAXRequest ajaxRequest = new AJAXRequestImpl((HttpServletRequest) request, (HttpServletResponse) response, config.getServletContext());
-            AJAXResponse ajaxReponse = ajaxService.processRequest(ajaxRequest);
-            ajaxReponse.complete();
-        }
-        catch (AJAXException e)
-        {
-           ((HttpServletResponse) response).sendError(500, e.getMessage());
-        }
-        catch(Exception e)
-        {
-            throw new ServletException(e.getMessage(), e);
-        }
-    }
-
-    public void destroy()
-    {
-        // do nothing
-
-    }
-
-}
+ * 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.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.web.context.WebApplicationContext;
+
+/**
+ * Simple ServletFilter for invoking AJAX services.
+ * 
+ * 
+ * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
+ *
+ */
+public class AJAXFilter implements Filter
+{
+    private ApplicationContext ctx;
+    private AJAXService ajaxService;
+    private FilterConfig config;
+    
+    public void init(FilterConfig config) throws ServletException
+    {
+        this.config = config;
+    }
+
+    public void doFilter(ServletRequest request, ServletResponse response,
+            FilterChain arg2) throws IOException, ServletException
+    {        
+        try
+        {
+            response.setContentType("text/xml");
+            if(ctx == null)
+            {
+                ctx = (ApplicationContext)config.getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
+                ajaxService = (AJAXService) ctx.getBean("AJAXService");
+            }
+            
+            AJAXRequest ajaxRequest = new AJAXRequestImpl((HttpServletRequest) request, (HttpServletResponse) response, config.getServletContext());
+            AJAXResponse ajaxReponse = ajaxService.processRequest(ajaxRequest);
+            ajaxReponse.complete();
+        }
+        catch (AJAXException e)
+        {
+           ((HttpServletResponse) response).sendError(500, e.getMessage());
+        }
+        catch(Exception e)
+        {
+            throw new ServletException(e.getMessage(), e);
+        }
+    }
+
+    public void destroy()
+    {
+        // do nothing
+
+    }
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXRequestImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXRequestImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXRequestImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXRequestImpl.java Fri Dec 12 04:06:29 2008
@@ -1,181 +1,181 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You 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.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Request used for AJAX services.
- * 
- * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
- *
- */
-public class AJAXRequestImpl implements AJAXRequest
-{
-    public static final String AJAX_SERVICE = "ajax_service";
-    public static final String AJAX_PARAM_PREFIX = "ajax_param_";
-    
-    private final HttpServletRequest request;
-    private List ajaxParams;
-    private final String serviceName;
-    private final String methodName;
-    private HttpServletResponse response;
-    private ServletContext context;
-
-    public AJAXRequestImpl(HttpServletRequest request, HttpServletResponse response, ServletContext context) throws AJAXException
-    {
-        this.request = request;
-        this.response = response;
-        this.context = context;
-        String serviceRequest =  request.getParameter(AJAX_SERVICE);
-        if(serviceRequest == null )
-        {
-            throw new AJAXException("No '"+AJAX_SERVICE+"' parameter could be found in the request or it was not in the '{service_name}.{method_name}' format.");
-        }
-        final String split = serviceRequest.split("\\.")[0];
-        serviceName = split;
-        methodName = serviceRequest.split("\\.")[1];
-        
-        parseRequestArguments();
-        
-    }
-    
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.ajax.AJAXRequest#getParameters()
-     */
-    public List getParameters()
-    {
-        return ajaxParams;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.ajax.AJAXRequest#getServiceName()
-     */
-    public String getServiceName()
-    {
-        return serviceName;
-    }
-
-    protected List parseRequestArguments() throws AJAXException
-    {
-        try
-        {
-            ajaxParams = new ArrayList();
-            Map rawParams = request.getParameterMap();
-            Iterator entryItr = rawParams.entrySet().iterator();
-            while(entryItr.hasNext())
-            {
-                Map.Entry entry = (Map.Entry) entryItr.next();
-                String key = entry.getKey().toString();
-                
-                if(key.startsWith(AJAX_PARAM_PREFIX))
-                {
-                    String[] paramInfo = key.split("_");
-                    int index = Integer.parseInt(paramInfo[2]);
-                    String type = paramInfo[3]; 
-                    AJAXParameter ajaxParam = new AJAXParameter(type, (String[])entry.getValue());
-                    ajaxParams.add(index, ajaxParam);
-                }
-            }
-            return ajaxParams;
-        }
-        catch (Throwable e)
-        {
-            throw new AJAXException("Errors were encountered parsing request parameters for the AJAX service "+serviceName+": "+e.getMessage(), e);
-        }
-    }
-    
-    public class AJAXParameter
-    {
-        private Object value;
-             
-        public AJAXParameter(String typeName, String[] paramValues)
-        {
-            if(typeName.equals("int"))
-            {                
-                if(paramValues.length > 1)
-                {
-                    int[] intValues = new int[paramValues.length];
-                    for(int i=0; i<paramValues.length; i++)
-                    {
-                        intValues[i] = Integer.parseInt(paramValues[i]);
-                    }
-                }
-                else
-                {
-                    value = new Integer(paramValues[0]);
-                }
-            }
-            else if(typeName.equals("str"))
-            {
-              if(paramValues.length > 1)
-              {    
-                  value = paramValues;
-              }
-              else
-              {
-                  value = paramValues[0];
-              }
-            }
-        }
-        
-        public Object getValue()
-        {
-            return value;
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.ajax.AJAXRequest#getMethodName()
-     */
-    public String getMethodName()
-    {
-        return methodName;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.ajax.AJAXRequest#getContext()
-     */
-    public ServletContext getContext()
-    {
-        return context;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.ajax.AJAXRequest#getServletRequest()
-     */
-    public HttpServletRequest getServletRequest()
-    {
-        return request;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.ajax.AJAXRequest#getServletResponse()
-     */
-    public HttpServletResponse getServletResponse()
-    {
-        return response;
-    }
-}
+ * 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.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Request used for AJAX services.
+ * 
+ * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
+ *
+ */
+public class AJAXRequestImpl implements AJAXRequest
+{
+    public static final String AJAX_SERVICE = "ajax_service";
+    public static final String AJAX_PARAM_PREFIX = "ajax_param_";
+    
+    private final HttpServletRequest request;
+    private List ajaxParams;
+    private final String serviceName;
+    private final String methodName;
+    private HttpServletResponse response;
+    private ServletContext context;
+
+    public AJAXRequestImpl(HttpServletRequest request, HttpServletResponse response, ServletContext context) throws AJAXException
+    {
+        this.request = request;
+        this.response = response;
+        this.context = context;
+        String serviceRequest =  request.getParameter(AJAX_SERVICE);
+        if(serviceRequest == null )
+        {
+            throw new AJAXException("No '"+AJAX_SERVICE+"' parameter could be found in the request or it was not in the '{service_name}.{method_name}' format.");
+        }
+        final String split = serviceRequest.split("\\.")[0];
+        serviceName = split;
+        methodName = serviceRequest.split("\\.")[1];
+        
+        parseRequestArguments();
+        
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.ajax.AJAXRequest#getParameters()
+     */
+    public List getParameters()
+    {
+        return ajaxParams;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.ajax.AJAXRequest#getServiceName()
+     */
+    public String getServiceName()
+    {
+        return serviceName;
+    }
+
+    protected List parseRequestArguments() throws AJAXException
+    {
+        try
+        {
+            ajaxParams = new ArrayList();
+            Map rawParams = request.getParameterMap();
+            Iterator entryItr = rawParams.entrySet().iterator();
+            while(entryItr.hasNext())
+            {
+                Map.Entry entry = (Map.Entry) entryItr.next();
+                String key = entry.getKey().toString();
+                
+                if(key.startsWith(AJAX_PARAM_PREFIX))
+                {
+                    String[] paramInfo = key.split("_");
+                    int index = Integer.parseInt(paramInfo[2]);
+                    String type = paramInfo[3]; 
+                    AJAXParameter ajaxParam = new AJAXParameter(type, (String[])entry.getValue());
+                    ajaxParams.add(index, ajaxParam);
+                }
+            }
+            return ajaxParams;
+        }
+        catch (Throwable e)
+        {
+            throw new AJAXException("Errors were encountered parsing request parameters for the AJAX service "+serviceName+": "+e.getMessage(), e);
+        }
+    }
+    
+    public class AJAXParameter
+    {
+        private Object value;
+             
+        public AJAXParameter(String typeName, String[] paramValues)
+        {
+            if(typeName.equals("int"))
+            {                
+                if(paramValues.length > 1)
+                {
+                    int[] intValues = new int[paramValues.length];
+                    for(int i=0; i<paramValues.length; i++)
+                    {
+                        intValues[i] = Integer.parseInt(paramValues[i]);
+                    }
+                }
+                else
+                {
+                    value = new Integer(paramValues[0]);
+                }
+            }
+            else if(typeName.equals("str"))
+            {
+              if(paramValues.length > 1)
+              {    
+                  value = paramValues;
+              }
+              else
+              {
+                  value = paramValues[0];
+              }
+            }
+        }
+        
+        public Object getValue()
+        {
+            return value;
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.ajax.AJAXRequest#getMethodName()
+     */
+    public String getMethodName()
+    {
+        return methodName;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.ajax.AJAXRequest#getContext()
+     */
+    public ServletContext getContext()
+    {
+        return context;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.ajax.AJAXRequest#getServletRequest()
+     */
+    public HttpServletRequest getServletRequest()
+    {
+        return request;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.ajax.AJAXRequest#getServletResponse()
+     */
+    public HttpServletResponse getServletResponse()
+    {
+        return response;
+    }
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXRequestImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXResponseImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXResponseImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXResponseImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXResponseImpl.java Fri Dec 12 04:06:29 2008
@@ -1,65 +1,65 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You 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.io.Reader;
-import java.io.Writer;
-
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.context.Context;
-
-/**
- * Response object used for AJAX services.
- * 
- * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
- *
- */
-public class AJAXResponseImpl implements AJAXResponse
-{   
-
-    private Context context;
-    private VelocityEngine engine;
-    private Reader template;
-    private Writer output;
-
-    public AJAXResponseImpl(Context context, VelocityEngine engine, Reader template, Writer output)
-    {
-        this.context = context;
-        this.engine = engine;
-        this.template = template;
-        this.output = output;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.ajax.AJAXResponse#complete()
-     */
-    public void complete() throws AJAXException
-    {
-        try
-        {
-            engine.evaluate(context, output, "AJAX processor", template);
-        }
-        catch (Exception e)
-        {
-            throw new AJAXException("Failed to render velocity xml template: "+e.getMessage(), e);
-        }
-     
-    }
-
-    
-
-}
+ * 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.io.Reader;
+import java.io.Writer;
+
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.context.Context;
+
+/**
+ * Response object used for AJAX services.
+ * 
+ * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
+ *
+ */
+public class AJAXResponseImpl implements AJAXResponse
+{   
+
+    private Context context;
+    private VelocityEngine engine;
+    private Reader template;
+    private Writer output;
+
+    public AJAXResponseImpl(Context context, VelocityEngine engine, Reader template, Writer output)
+    {
+        this.context = context;
+        this.engine = engine;
+        this.template = template;
+        this.output = output;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.ajax.AJAXResponse#complete()
+     */
+    public void complete() throws AJAXException
+    {
+        try
+        {
+            engine.evaluate(context, output, "AJAX processor", template);
+        }
+        catch (Exception e)
+        {
+            throw new AJAXException("Failed to render velocity xml template: "+e.getMessage(), e);
+        }
+     
+    }
+
+    
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXResponseImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXServiceImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXServiceImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXServiceImpl.java Fri Dec 12 04:06:29 2008
@@ -1,173 +1,173 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You 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.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringWriter;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.context.Context;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.BeanFactoryAware;
-
-/**
- * Performs invocation of the actual AJAX request and returns
- * a result object to converted into XML.
- * 
- * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
- *
- */
-public class AJAXServiceImpl implements AJAXService, BeanFactoryAware
-{
-    private Map serviceToBeans;
-    private Map serviceToTemplates;
-
-    private BeanFactory beanFactory;
-    private VelocityEngine engine;
-
-    public AJAXServiceImpl(Map serviceToBeans)
-    {
-        this.serviceToBeans = serviceToBeans;        
-    }
-
-    public AJAXServiceImpl(Map serviceToBeans, VelocityEngine engine, Map serviceToTemplates)
-    {
-        this.serviceToBeans = serviceToBeans; 
-        this.engine = engine;
-        this.serviceToTemplates = serviceToTemplates;
-    }
-
-    public AJAXResponse processRequest(AJAXRequest request)
-            throws AJAXException
-    {
-        final String serviceName = request.getServiceName();
-        final String methodName = request.getMethodName();
- //       final String templateName = request.getServletRequest().getServletPath();
-
-        final String mappedServiceName = (serviceName+"."+methodName).trim();
-        try
-        {
-            if(engine == null)
-            {
-                engine = new VelocityEngine();
-                Properties props = new Properties();
-                props.load(request.getContext().getResourceAsStream("/WEB-INF/velocity.properties"));
-                props.setProperty("file.resource.loader.path", request.getContext().getRealPath("/"));
-                engine.init();
-            }
-            
-            
-            if(!serviceToBeans.containsKey(mappedServiceName))
-            {
-                throw new AJAXException("There is no AJAX service named '"+mappedServiceName+"' defined.  "+ 
-                        "Please make sure that your ajax.xml is set up correctly.");
-            }
-            
-            String beanId = ((String)serviceToBeans.get(mappedServiceName)).trim();
-            Object targetService = beanFactory.getBean(beanId);
-            final List parameters = request.getParameters();
-            Method method = targetService.getClass().getMethod(methodName, getTypes(parameters));
-            Object result = method.invoke(targetService, getValues(parameters));
-            Context context = new VelocityContext();
-            context.put("ajaxRequest", request);
-            context.put("result", result);            
-   
-            String templateName =  ((String)serviceToTemplates.get(mappedServiceName)).trim();
-            final InputStream templateResource = request.getContext().getResourceAsStream(templateName);
-            
-            if(templateResource == null)
-            {
-                request.getServletResponse().sendError(404, templateName+" ajax template could not be found.");
-                throw new IOException(templateName+" does not exist");
-            }
-            Reader template = new InputStreamReader(templateResource);
-            
-            StringWriter stringWriter = new StringWriter();
-
-            AJAXResponse ajaxResponse = new AJAXResponseImpl(context, engine, template, stringWriter);            
-            ajaxResponse.complete();
-    
-            String buffer = stringWriter.getBuffer().toString();
-
-            // Put the response XML on the response object            
-            HttpServletResponse response = request.getServletResponse();
-            ServletOutputStream sos = response.getOutputStream();
-            sos.print(buffer);
-            sos.flush();
-            return ajaxResponse;
-        }
-        catch(AJAXException ae)
-        {
-            throw ae;
-        }
-        catch (Exception e)
-        {
-            throw new AJAXException("Unable to process service" + mappedServiceName + ": " + e.getMessage(), e);
-        }
-
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
-     */
-    public void setBeanFactory(BeanFactory beanFactory) throws BeansException
-    {
-        this.beanFactory = beanFactory;
-    }
-
-    protected Class[] getTypes(List objects)
-    {
-        Class[] args = new Class[objects.size()];
-        Iterator itr = objects.iterator();
-        int i = 0;
-        while (itr.hasNext())
-        {
-            args[i] = ((AJAXRequestImpl.AJAXParameter)itr.next()).getValue().getClass();
-            i++;
-        }
-        return args;
-    }
-    
-    protected Object[] getValues(List objects)
-    {
-        Object[] args = new Object[objects.size()];
-        Iterator itr = objects.iterator();
-        int i = 0;
-        while (itr.hasNext())
-        {
-            args[i] = ((AJAXRequestImpl.AJAXParameter)itr.next()).getValue();
-            i++;
-        }
-        return args;
-    }
-
-}
+ * 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.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.lang.reflect.Method;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.context.Context;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
+
+/**
+ * Performs invocation of the actual AJAX request and returns
+ * a result object to converted into XML.
+ * 
+ * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
+ *
+ */
+public class AJAXServiceImpl implements AJAXService, BeanFactoryAware
+{
+    private Map serviceToBeans;
+    private Map serviceToTemplates;
+
+    private BeanFactory beanFactory;
+    private VelocityEngine engine;
+
+    public AJAXServiceImpl(Map serviceToBeans)
+    {
+        this.serviceToBeans = serviceToBeans;        
+    }
+
+    public AJAXServiceImpl(Map serviceToBeans, VelocityEngine engine, Map serviceToTemplates)
+    {
+        this.serviceToBeans = serviceToBeans; 
+        this.engine = engine;
+        this.serviceToTemplates = serviceToTemplates;
+    }
+
+    public AJAXResponse processRequest(AJAXRequest request)
+            throws AJAXException
+    {
+        final String serviceName = request.getServiceName();
+        final String methodName = request.getMethodName();
+ //       final String templateName = request.getServletRequest().getServletPath();
+
+        final String mappedServiceName = (serviceName+"."+methodName).trim();
+        try
+        {
+            if(engine == null)
+            {
+                engine = new VelocityEngine();
+                Properties props = new Properties();
+                props.load(request.getContext().getResourceAsStream("/WEB-INF/velocity.properties"));
+                props.setProperty("file.resource.loader.path", request.getContext().getRealPath("/"));
+                engine.init();
+            }
+            
+            
+            if(!serviceToBeans.containsKey(mappedServiceName))
+            {
+                throw new AJAXException("There is no AJAX service named '"+mappedServiceName+"' defined.  "+ 
+                        "Please make sure that your ajax.xml is set up correctly.");
+            }
+            
+            String beanId = ((String)serviceToBeans.get(mappedServiceName)).trim();
+            Object targetService = beanFactory.getBean(beanId);
+            final List parameters = request.getParameters();
+            Method method = targetService.getClass().getMethod(methodName, getTypes(parameters));
+            Object result = method.invoke(targetService, getValues(parameters));
+            Context context = new VelocityContext();
+            context.put("ajaxRequest", request);
+            context.put("result", result);            
+   
+            String templateName =  ((String)serviceToTemplates.get(mappedServiceName)).trim();
+            final InputStream templateResource = request.getContext().getResourceAsStream(templateName);
+            
+            if(templateResource == null)
+            {
+                request.getServletResponse().sendError(404, templateName+" ajax template could not be found.");
+                throw new IOException(templateName+" does not exist");
+            }
+            Reader template = new InputStreamReader(templateResource);
+            
+            StringWriter stringWriter = new StringWriter();
+
+            AJAXResponse ajaxResponse = new AJAXResponseImpl(context, engine, template, stringWriter);            
+            ajaxResponse.complete();
+    
+            String buffer = stringWriter.getBuffer().toString();
+
+            // Put the response XML on the response object            
+            HttpServletResponse response = request.getServletResponse();
+            ServletOutputStream sos = response.getOutputStream();
+            sos.print(buffer);
+            sos.flush();
+            return ajaxResponse;
+        }
+        catch(AJAXException ae)
+        {
+            throw ae;
+        }
+        catch (Exception e)
+        {
+            throw new AJAXException("Unable to process service" + mappedServiceName + ": " + e.getMessage(), e);
+        }
+
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
+     */
+    public void setBeanFactory(BeanFactory beanFactory) throws BeansException
+    {
+        this.beanFactory = beanFactory;
+    }
+
+    protected Class[] getTypes(List objects)
+    {
+        Class[] args = new Class[objects.size()];
+        Iterator itr = objects.iterator();
+        int i = 0;
+        while (itr.hasNext())
+        {
+            args[i] = ((AJAXRequestImpl.AJAXParameter)itr.next()).getValue().getClass();
+            i++;
+        }
+        return args;
+    }
+    
+    protected Object[] getValues(List objects)
+    {
+        Object[] args = new Object[objects.size()];
+        Iterator itr = objects.iterator();
+        int i = 0;
+        while (itr.hasNext())
+        {
+            args[i] = ((AJAXRequestImpl.AJAXParameter)itr.next()).getValue();
+            i++;
+        }
+        return args;
+    }
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXValve.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXValve.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXValve.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXValve.java Fri Dec 12 04:06:29 2008
@@ -1,86 +1,86 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You 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 javax.servlet.http.HttpServletResponse;
-
-import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
-import org.apache.jetspeed.pipeline.PipelineException;
-import org.apache.jetspeed.pipeline.valve.AbstractValve;
-import org.apache.jetspeed.pipeline.valve.ValveContext;
-import org.apache.jetspeed.request.RequestContext;
-
-/**
- * This should eventually replace the AJAX ServletFilter.
- * 
- * @author <href a="mailto:weaver@apache.org">Scott T. Weaver </a>
- * 
- */
-public class AJAXValve extends AbstractValve
-{
-    private AJAXService ajaxService;
-    private PortletActionSecurityBehavior securityBehavior;
-    
-    public AJAXValve(AJAXService service, PortletActionSecurityBehavior securityBehavior)
-    {
-        super();
-        this.ajaxService = service;
-        this.securityBehavior = securityBehavior;
-    }
-        
-    public void invoke( RequestContext request, ValveContext context )
-        throws PipelineException
-    {
-        HttpServletResponse response = request.getResponse(); 
-        try
-        {
-            response.setContentType("text/xml");  
-            if (!securityBehavior.checkAccess(request, "edit"))
-            {
-                throw new AJAXException("Access Denied.");
-            }
-            AJAXRequest ajaxRequest = new AJAXRequestImpl(request.getRequest(), response, request.getConfig().getServletContext());
-            ajaxService.processRequest(ajaxRequest);
-        }
-        catch (AJAXException e)
-        {
-            try
-            {
-                response.sendError(500, e.getMessage());
-            }
-            catch (Exception e2)
-            {
-                throw new PipelineException(e2.getMessage(), e2);
-            }
-        }
-        catch(Exception e)
-        {
-            throw new PipelineException(e.getMessage(), e);
-        }
-        
-        // Pass control to the next Valve in the Pipeline
-        context.invokeNext(request);
-    }
-
-    public String toString()
-    {
-        return "AJAXValve";
-    }
-
-    
-    
-}
+ * 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 javax.servlet.http.HttpServletResponse;
+
+import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
+import org.apache.jetspeed.pipeline.PipelineException;
+import org.apache.jetspeed.pipeline.valve.AbstractValve;
+import org.apache.jetspeed.pipeline.valve.ValveContext;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * This should eventually replace the AJAX ServletFilter.
+ * 
+ * @author <href a="mailto:weaver@apache.org">Scott T. Weaver </a>
+ * 
+ */
+public class AJAXValve extends AbstractValve
+{
+    private AJAXService ajaxService;
+    private PortletActionSecurityBehavior securityBehavior;
+    
+    public AJAXValve(AJAXService service, PortletActionSecurityBehavior securityBehavior)
+    {
+        super();
+        this.ajaxService = service;
+        this.securityBehavior = securityBehavior;
+    }
+        
+    public void invoke( RequestContext request, ValveContext context )
+        throws PipelineException
+    {
+        HttpServletResponse response = request.getResponse(); 
+        try
+        {
+            response.setContentType("text/xml");  
+            if (!securityBehavior.checkAccess(request, "edit"))
+            {
+                throw new AJAXException("Access Denied.");
+            }
+            AJAXRequest ajaxRequest = new AJAXRequestImpl(request.getRequest(), response, request.getConfig().getServletContext());
+            ajaxService.processRequest(ajaxRequest);
+        }
+        catch (AJAXException e)
+        {
+            try
+            {
+                response.sendError(500, e.getMessage());
+            }
+            catch (Exception e2)
+            {
+                throw new PipelineException(e2.getMessage(), e2);
+            }
+        }
+        catch(Exception e)
+        {
+            throw new PipelineException(e.getMessage(), e);
+        }
+        
+        // Pass control to the next Valve in the Pipeline
+        context.invokeNext(request);
+    }
+
+    public String toString()
+    {
+        return "AJAXValve";
+    }
+
+    
+    
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AJAXValve.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/AjaxRequestServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_apps.ajax
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_apps.ajax?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_apps.ajax (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_apps.ajax Fri Dec 12 04:06:29 2008
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 #*
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -15,11 +15,11 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 *#
-<portletApps>
-#foreach($app in $result)
-  <portletApp>
-    <id>$app.id</id>
-    <name>$app.name</name>
-  </portletApp>
-#end
+<portletApps>
+#foreach($app in $result)
+  <portletApp>
+    <id>$app.id</id>
+    <name>$app.name</name>
+  </portletApp>
+#end
 </portletApps>
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_apps.ajax
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_definitions.ajax
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_definitions.ajax?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_definitions.ajax (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_definitions.ajax Fri Dec 12 04:06:29 2008
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 #*
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -15,13 +15,13 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 *#
-<portletDefinitions>
-#foreach($portlet in $result.portletDefinitions)
-	<portletDefinition>
-		<id>$portlet.id</id>
-		<name>$portlet.name</name>
-	</portletDefinition>
-#end
-</portletDefinitions>
-
-
+<portletDefinitions>
+#foreach($portlet in $result.portletDefinitions)
+	<portletDefinition>
+		<id>$portlet.id</id>
+		<name>$portlet.name</name>
+	</portletDefinition>
+#end
+</portletDefinitions>
+
+

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_definitions.ajax
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_entities.ajax
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_entities.ajax?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_entities.ajax (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_entities.ajax Fri Dec 12 04:06:29 2008
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 #*
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -15,10 +15,10 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 *#
-<portletEntities>
-#foreach($entity in $result)
-	<portletEntity>
-		<id>$entity.id</id>
-	</portletEntity>
-#end
+<portletEntities>
+#foreach($entity in $result)
+	<portletEntity>
+		<id>$entity.id</id>
+	</portletEntity>
+#end
 </portletEntities>
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_entities.ajax
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_entity.ajax
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_entity.ajax?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_entity.ajax (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_entity.ajax Fri Dec 12 04:06:29 2008
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 #*
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -15,20 +15,20 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 *#
-<portletEntity>
-  <id>$result.id</id>
-
-  #foreach($pref in $result.preferenceSet.iterator())
-   #if($pref.readOnly)
-	#set($readOnly = "true") 
-   #else 
-	#set($readOnly = "false")
-   #end  
-   <preference readOnly="${readOnly}">
-     <name>$pref.name</name>
-   #foreach($value in $pref.values)
-	 <value>$value</value>
-   #end
-   </preference>
-  #end
+<portletEntity>
+  <id>$result.id</id>
+
+  #foreach($pref in $result.preferenceSet.iterator())
+   #if($pref.readOnly)
+	#set($readOnly = "true") 
+   #else 
+	#set($readOnly = "false")
+   #end  
+   <preference readOnly="${readOnly}">
+     <name>$pref.name</name>
+   #foreach($value in $pref.values)
+	 <value>$value</value>
+   #end
+   </preference>
+  #end
 </portletEntity>
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ajax/templates/portlet_entity.ajax
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/cluster/NodeInformationImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/cluster/NodeInformationImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/cluster/NodeInformationImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/cluster/NodeInformationImpl.java Fri Dec 12 04:06:29 2008
@@ -1,174 +1,174 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You 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.cluster;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.text.DateFormat;
-import java.util.Date;
-
-/**
- * Node Information
- * 
- * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
- * @version
- */
-public class NodeInformationImpl implements NodeInformation, Serializable 
-{
-	static final long serialVersionUID = -598265530537353219L;
-
-	private Long revision;
-	private String contextName;
-	private Date lastDeployDate = null;
-	private static final int CompressVersion = 1;
-
-	/**
-	 * default class construtor required for bean management
-	 *
-	 */
-	public NodeInformationImpl()
-	{}
-	
-	/**
-	 * extensible serialization routine - indicates the version written to allow for later structural updates
-	 *
-	 */
-	private void writeObject(ObjectOutputStream out) throws IOException
-	{
-		out.writeByte(CompressVersion);
-		out.writeLong(revision.longValue());
-		out.writeUTF(contextName);
-		if (lastDeployDate == null)
-			out.writeByte(0);
-		else
-		{
-			out.writeByte(1);
-			out.writeLong(lastDeployDate.getTime());
-		}
-	}
-	/**
-	 * extensible serialization routine 
-	 * using the version byte code can identify older versions and handle updates correctly
-	 *
-	 */
-	private void readObject(ObjectInputStream in) throws IOException,
-			ClassNotFoundException
-	{
-		in.readByte();
-		// do changes here if version dependant
-
-		revision = new Long(in.readLong());
-		contextName = in.readUTF();
-		int dateSet = in.readByte();
-		
-		if (dateSet == 1)
-			lastDeployDate = new Date(in.readLong());
-		else
-			lastDeployDate = null;
-	}
-
-	public boolean equals(Object object)
-	{
-		if (object == this)
-			return true;
-		if (!(object instanceof NodeInformation))
-			return false;
-		return equals((NodeInformation) object);
-	}
-
-	public int compareTo(Object object)
-	{
-		if (object == null)
-			return 1;
-		if (object == this)
-			return 0;
-		if (!(object instanceof NodeInformation))
-			return 1;
-		return compareTo((NodeInformation) object);
-	}
-
-	public final boolean equals(NodeInformation object)
-	{
-		if (object == null)
-			return false;
-		return object.getContextName().equalsIgnoreCase(contextName);
-	}
-
-	public final int compareTo(NodeInformation object)
-	{
-		return getContextName().compareToIgnoreCase(contextName);
-	}
-
-	public String toString()
-	{
-		StringBuffer buffer = new StringBuffer();
-		buffer.append("revision= " + this.revision.longValue());
-		buffer.append("; contextName= " + this.getContextName());
-		buffer.append("; lastDeployDate= " + this.getContextName());
-		if (this.lastDeployDate != null)
-		{
-			DateFormat format = DateFormat.getTimeInstance(DateFormat.SHORT);
-			try
-			{
-				buffer.append(format.format(this.lastDeployDate));
-			} catch (Exception e)
-			{
-				buffer.append("<invalidDate>");
-			}
-		} else
-			buffer.append("<empty>");
-
-		return buffer.toString();
-	}
-
-	public String getContextName()
-	{
-		return contextName;
-	}
-
-	public void setContextName(String contextName)
-	{
-		this.contextName = contextName;
-	}
-
-	public Long getRevision()
-	{
-		return revision;
-	}
-
-	public void setRevision(Long revision)
-	{
-		this.revision = revision;
-	}
-
-	public void setRevision(long revision)
-	{
-		this.revision = new Long(revision);
-	}
-
-	public Date getLastDeployDate()
-	{
-		return lastDeployDate;
-	}
-
-	public void setLastDeployDate(Date lastDeployDate)
-	{
-		this.lastDeployDate = lastDeployDate;
-	}
-}
+ * 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.cluster;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.text.DateFormat;
+import java.util.Date;
+
+/**
+ * Node Information
+ * 
+ * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+ * @version
+ */
+public class NodeInformationImpl implements NodeInformation, Serializable 
+{
+	static final long serialVersionUID = -598265530537353219L;
+
+	private Long revision;
+	private String contextName;
+	private Date lastDeployDate = null;
+	private static final int CompressVersion = 1;
+
+	/**
+	 * default class construtor required for bean management
+	 *
+	 */
+	public NodeInformationImpl()
+	{}
+	
+	/**
+	 * extensible serialization routine - indicates the version written to allow for later structural updates
+	 *
+	 */
+	private void writeObject(ObjectOutputStream out) throws IOException
+	{
+		out.writeByte(CompressVersion);
+		out.writeLong(revision.longValue());
+		out.writeUTF(contextName);
+		if (lastDeployDate == null)
+			out.writeByte(0);
+		else
+		{
+			out.writeByte(1);
+			out.writeLong(lastDeployDate.getTime());
+		}
+	}
+	/**
+	 * extensible serialization routine 
+	 * using the version byte code can identify older versions and handle updates correctly
+	 *
+	 */
+	private void readObject(ObjectInputStream in) throws IOException,
+			ClassNotFoundException
+	{
+		in.readByte();
+		// do changes here if version dependant
+
+		revision = new Long(in.readLong());
+		contextName = in.readUTF();
+		int dateSet = in.readByte();
+		
+		if (dateSet == 1)
+			lastDeployDate = new Date(in.readLong());
+		else
+			lastDeployDate = null;
+	}
+
+	public boolean equals(Object object)
+	{
+		if (object == this)
+			return true;
+		if (!(object instanceof NodeInformation))
+			return false;
+		return equals((NodeInformation) object);
+	}
+
+	public int compareTo(Object object)
+	{
+		if (object == null)
+			return 1;
+		if (object == this)
+			return 0;
+		if (!(object instanceof NodeInformation))
+			return 1;
+		return compareTo((NodeInformation) object);
+	}
+
+	public final boolean equals(NodeInformation object)
+	{
+		if (object == null)
+			return false;
+		return object.getContextName().equalsIgnoreCase(contextName);
+	}
+
+	public final int compareTo(NodeInformation object)
+	{
+		return getContextName().compareToIgnoreCase(contextName);
+	}
+
+	public String toString()
+	{
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("revision= " + this.revision.longValue());
+		buffer.append("; contextName= " + this.getContextName());
+		buffer.append("; lastDeployDate= " + this.getContextName());
+		if (this.lastDeployDate != null)
+		{
+			DateFormat format = DateFormat.getTimeInstance(DateFormat.SHORT);
+			try
+			{
+				buffer.append(format.format(this.lastDeployDate));
+			} catch (Exception e)
+			{
+				buffer.append("<invalidDate>");
+			}
+		} else
+			buffer.append("<empty>");
+
+		return buffer.toString();
+	}
+
+	public String getContextName()
+	{
+		return contextName;
+	}
+
+	public void setContextName(String contextName)
+	{
+		this.contextName = contextName;
+	}
+
+	public Long getRevision()
+	{
+		return revision;
+	}
+
+	public void setRevision(Long revision)
+	{
+		this.revision = revision;
+	}
+
+	public void setRevision(long revision)
+	{
+		this.revision = new Long(revision);
+	}
+
+	public Date getLastDeployDate()
+	{
+		return lastDeployDate;
+	}
+
+	public void setLastDeployDate(Date lastDeployDate)
+	{
+		this.lastDeployDate = lastDeployDate;
+	}
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/cluster/NodeInformationImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/cluster/NodeManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/cluster/NodeManagerImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/cluster/NodeManagerImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/cluster/NodeManagerImpl.java Fri Dec 12 04:06:29 2008
@@ -1,193 +1,193 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You 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.cluster;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.HashMap;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.BeanFactoryAware;
-
-/**
- * Node Manager 
- *
- * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
- * @version 
- */
-public class NodeManagerImpl implements NodeManager,BeanFactoryAware
-{
-	protected final static Log log = LogFactory.getLog(NodeManagerImpl.class);
-
-    /**
-     * added support for bean factory to create profile rules
-     */
-    private BeanFactory beanFactory;
-
-	private HashMap<String, NodeInformation> nodes = null; 
-	private File rootIndexDir = null;
-	    
-    /** the default criterion bean name */
-    private String nodeInformationBean = "NodeInformation";
-
-	
-	public NodeManagerImpl(String indexRoot, String nodeInformationBean)
-    throws Exception
-    {
-    	
-        //assume it's full path for now
-        rootIndexDir = new File(indexRoot);
-        this.nodeInformationBean = nodeInformationBean;
-
-        if (!(rootIndexDir.exists()))
-        	rootIndexDir.mkdirs();
-        load();
-    }
-
-	
-	protected void save()
-	{
-		try {
-		      FileOutputStream fout = new FileOutputStream(rootIndexDir.getAbsolutePath()+ "/nodeInfo.ser");
-		      ObjectOutputStream oos = new ObjectOutputStream(fout);
-		      oos.writeObject(nodes);
-		      oos.close();
-		      }
-		   catch (Exception e) 
-		   {
-	            log.error("Failed to write nodes data file to  " + rootIndexDir.getAbsolutePath()+ "/nodeInfo.ser" + " - error : " + e.getLocalizedMessage());
-			   e.printStackTrace(); 
-			}
-	}
-    
-	@SuppressWarnings("unchecked")
-    protected void load()
-	{
-			File data = new File( rootIndexDir.getAbsolutePath()+ "/nodeInfo.ser");
-			if (data.exists())
-			{
-				try {
-				    FileInputStream fin = new FileInputStream(data.getAbsolutePath());
-				    ObjectInputStream ois = new ObjectInputStream(fin);
-				    nodes = (HashMap<String,NodeInformation>) ois.readObject();
-				    ois.close();
-				    }
-				   catch (Exception e) 
-				   { 
-			            log.error("Failed to read nodes data file from " + data.getAbsolutePath() + " - error : " + e.getLocalizedMessage());
-					   nodes = new HashMap<String,NodeInformation>();
-				   }
-			}
-			else
-			{
-				try
-				{
-					data.createNewFile();
-				}
-				catch (Exception e)
-				{
-		            log.error("Failed to create new nodes data file error : " + e.getLocalizedMessage());
-					e.printStackTrace();
-				}
-				nodes = new HashMap<String,NodeInformation>();
-			}
-			
-//			NodeInformationImpl temp = new NodeInformationImpl();
-//			temp.setContextName("tttt");
-	}
-	public int checkNode(Long revision, String contextName)
-	{
-		if ((contextName == null) || (revision == null))
-			return NodeManager.INVALID_NODE_REQUEST;
-		NodeInformation info = (NodeInformation)nodes.get(contextName);
-		if (info == null)
-			return NodeManager.NODE_NEW;
-		if (info.getRevision().longValue() < revision.longValue())
-			return NodeManager.NODE_OUTDATED;
-		return NodeManager.NODE_SAVED;
-	}
-	
-	public void addNode(Long revision, String contextName) throws Exception
-	{
-		if ((contextName == null) || (revision == null))
-			return;
-		NodeInformation info = (NodeInformation)nodes.get(contextName);
-		if (info == null)
-		{
-			info = createNodeInformation();
-			info.setContextName(contextName);
-		}
-		info.setRevision(revision);
-		nodes.put(contextName, info);
-		save();
-	}
-
-	public void removeNode(String contextName) throws Exception
-	{
-		if (contextName == null)
-			return;
-		NodeInformation info = (NodeInformation)nodes.get(contextName);
-		if (info == null)
-			return;
-		nodes.remove(contextName);
-		save();
-	}
-	
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jetspeed.profiler.Profiler#createRuleCriterion()
-     */
-    protected NodeInformation createNodeInformation() throws ClassNotFoundException
-    {
-        try
-        {
-            NodeInformation nodeInformation = (NodeInformation) beanFactory.getBean(
-                    this.nodeInformationBean, NodeInformation.class);
-            return nodeInformation;
-        } catch (Exception e)
-        {
-            log.error("Failed to create nodeInformation for " + nodeInformationBean
-                    + " error : " + e.getLocalizedMessage());
-            throw new ClassNotFoundException("Spring failed to create the "
-                    + " nodeInformation bean.", e);
-        }
-
-    }
-
-    /*
-     * Method called automatically by Spring container upon initialization
-     * 
-     * @param beanFactory automatically provided by framework @throws
-     * BeansException
-     */
-    public void setBeanFactory(BeanFactory beanFactory) throws BeansException
-    {
-        this.beanFactory = beanFactory;
-    }
-
-	public int getNumberOfNodes()
-	{
-		return nodes.size();
-	}    
-}
+ * 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.cluster;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.HashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
+
+/**
+ * Node Manager 
+ *
+ * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+ * @version 
+ */
+public class NodeManagerImpl implements NodeManager,BeanFactoryAware
+{
+	protected final static Log log = LogFactory.getLog(NodeManagerImpl.class);
+
+    /**
+     * added support for bean factory to create profile rules
+     */
+    private BeanFactory beanFactory;
+
+	private HashMap<String, NodeInformation> nodes = null; 
+	private File rootIndexDir = null;
+	    
+    /** the default criterion bean name */
+    private String nodeInformationBean = "NodeInformation";
+
+	
+	public NodeManagerImpl(String indexRoot, String nodeInformationBean)
+    throws Exception
+    {
+    	
+        //assume it's full path for now
+        rootIndexDir = new File(indexRoot);
+        this.nodeInformationBean = nodeInformationBean;
+
+        if (!(rootIndexDir.exists()))
+        	rootIndexDir.mkdirs();
+        load();
+    }
+
+	
+	protected void save()
+	{
+		try {
+		      FileOutputStream fout = new FileOutputStream(rootIndexDir.getAbsolutePath()+ "/nodeInfo.ser");
+		      ObjectOutputStream oos = new ObjectOutputStream(fout);
+		      oos.writeObject(nodes);
+		      oos.close();
+		      }
+		   catch (Exception e) 
+		   {
+	            log.error("Failed to write nodes data file to  " + rootIndexDir.getAbsolutePath()+ "/nodeInfo.ser" + " - error : " + e.getLocalizedMessage());
+			   e.printStackTrace(); 
+			}
+	}
+    
+	@SuppressWarnings("unchecked")
+    protected void load()
+	{
+			File data = new File( rootIndexDir.getAbsolutePath()+ "/nodeInfo.ser");
+			if (data.exists())
+			{
+				try {
+				    FileInputStream fin = new FileInputStream(data.getAbsolutePath());
+				    ObjectInputStream ois = new ObjectInputStream(fin);
+				    nodes = (HashMap<String,NodeInformation>) ois.readObject();
+				    ois.close();
+				    }
+				   catch (Exception e) 
+				   { 
+			            log.error("Failed to read nodes data file from " + data.getAbsolutePath() + " - error : " + e.getLocalizedMessage());
+					   nodes = new HashMap<String,NodeInformation>();
+				   }
+			}
+			else
+			{
+				try
+				{
+					data.createNewFile();
+				}
+				catch (Exception e)
+				{
+		            log.error("Failed to create new nodes data file error : " + e.getLocalizedMessage());
+					e.printStackTrace();
+				}
+				nodes = new HashMap<String,NodeInformation>();
+			}
+			
+//			NodeInformationImpl temp = new NodeInformationImpl();
+//			temp.setContextName("tttt");
+	}
+	public int checkNode(Long revision, String contextName)
+	{
+		if ((contextName == null) || (revision == null))
+			return NodeManager.INVALID_NODE_REQUEST;
+		NodeInformation info = (NodeInformation)nodes.get(contextName);
+		if (info == null)
+			return NodeManager.NODE_NEW;
+		if (info.getRevision().longValue() < revision.longValue())
+			return NodeManager.NODE_OUTDATED;
+		return NodeManager.NODE_SAVED;
+	}
+	
+	public void addNode(Long revision, String contextName) throws Exception
+	{
+		if ((contextName == null) || (revision == null))
+			return;
+		NodeInformation info = (NodeInformation)nodes.get(contextName);
+		if (info == null)
+		{
+			info = createNodeInformation();
+			info.setContextName(contextName);
+		}
+		info.setRevision(revision);
+		nodes.put(contextName, info);
+		save();
+	}
+
+	public void removeNode(String contextName) throws Exception
+	{
+		if (contextName == null)
+			return;
+		NodeInformation info = (NodeInformation)nodes.get(contextName);
+		if (info == null)
+			return;
+		nodes.remove(contextName);
+		save();
+	}
+	
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.jetspeed.profiler.Profiler#createRuleCriterion()
+     */
+    protected NodeInformation createNodeInformation() throws ClassNotFoundException
+    {
+        try
+        {
+            NodeInformation nodeInformation = (NodeInformation) beanFactory.getBean(
+                    this.nodeInformationBean, NodeInformation.class);
+            return nodeInformation;
+        } catch (Exception e)
+        {
+            log.error("Failed to create nodeInformation for " + nodeInformationBean
+                    + " error : " + e.getLocalizedMessage());
+            throw new ClassNotFoundException("Spring failed to create the "
+                    + " nodeInformation bean.", e);
+        }
+
+    }
+
+    /*
+     * Method called automatically by Spring container upon initialization
+     * 
+     * @param beanFactory automatically provided by framework @throws
+     * BeansException
+     */
+    public void setBeanFactory(BeanFactory beanFactory) throws BeansException
+    {
+        this.beanFactory = beanFactory;
+    }
+
+	public int getNumberOfNodes()
+	{
+		return nodes.size();
+	}    
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/cluster/NodeManagerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
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