click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r958333 - in /click/trunk/click: extras/src/org/apache/click/extras/cayenne/ framework/src/org/apache/click/ framework/src/org/apache/click/control/ framework/src/org/apache/click/service/ framework/src/org/apache/click/util/
Date Sun, 27 Jun 2010 06:29:07 GMT
Author: sabob
Date: Sun Jun 27 06:29:06 2010
New Revision: 958333

URL: http://svn.apache.org/viewvc?rev=958333&view=rev
Log:
removed spaces

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/cayenne/CayenneForm.java
    click/trunk/click/framework/src/org/apache/click/ActionEventDispatcher.java
    click/trunk/click/framework/src/org/apache/click/Context.java
    click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java
    click/trunk/click/framework/src/org/apache/click/control/AbstractLink.java
    click/trunk/click/framework/src/org/apache/click/control/RadioGroup.java
    click/trunk/click/framework/src/org/apache/click/service/DefaultMessagesMapService.java
    click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java
    click/trunk/click/framework/src/org/apache/click/util/ClickUtils.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/cayenne/CayenneForm.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/cayenne/CayenneForm.java?rev=958333&r1=958332&r2=958333&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/cayenne/CayenneForm.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/cayenne/CayenneForm.java Sun Jun
27 06:29:06 2010
@@ -308,7 +308,7 @@ public class CayenneForm extends Form {
                 String id = oidField.getValue();
                 if (StringUtils.isNotBlank(id)) {
 
-                    dataObject = 
+                    dataObject =
                         CayenneUtils.getObjectForPK(getDataContext(),
                                                     dataClass,
                                                     id);

Modified: click/trunk/click/framework/src/org/apache/click/ActionEventDispatcher.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/ActionEventDispatcher.java?rev=958333&r1=958332&r2=958333&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/ActionEventDispatcher.java (original)
+++ click/trunk/click/framework/src/org/apache/click/ActionEventDispatcher.java Sun Jun 27
06:29:06 2010
@@ -201,7 +201,7 @@ public class ActionEventDispatcher {
      *
      * @return true if the page should continue processing or false otherwise
      */
-    protected boolean fireActionEvents(Context context, 
+    protected boolean fireActionEvents(Context context,
         List<Control> eventSourceList, List<ActionListener> eventListenerList)
{
 
         boolean continueProcessing = true;

Modified: click/trunk/click/framework/src/org/apache/click/Context.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/Context.java?rev=958333&r1=958332&r2=958333&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/Context.java (original)
+++ click/trunk/click/framework/src/org/apache/click/Context.java Sun Jun 27 06:29:06 2010
@@ -627,10 +627,10 @@ public class Context {
 
     /**
      * Return a new messages map for the given baseClass (a page or control)
-     * and the given global resource bundle name. 
+     * and the given global resource bundle name.
      *
      * @param baseClass the target class
-     * @param globalResource the global resource bundle name     
+     * @param globalResource the global resource bundle name
      * @return a new messages map with the messages for the target.
      */
     public Map<String, String> createMessagesMap(Class<?> baseClass, String globalResource)
{

Modified: click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java?rev=958333&r1=958332&r2=958333&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java (original)
+++ click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java Sun Jun
27 06:29:06 2010
@@ -248,7 +248,7 @@ public abstract class AbstractControl im
 
     /**
      * Adds an AJAX Behavior.
-     *  
+     *
      * @param behavior the AJAX behavior
      */
     public void addBehavior(Behavior behavior) {
@@ -266,7 +266,7 @@ public abstract class AbstractControl im
 
     /**
      * Removes form this Control a <tt>behavior</tt>.
-     *  
+     *
      * @param behavior the <tt>behavior</tt> to remove.
      */
     public void removeBehavior(Behavior behavior) {
@@ -288,7 +288,7 @@ public abstract class AbstractControl im
     /**
      * Returns this Control's CSS selector or <tt>null</tt>null if no selector
      * can be found.
-     * 
+     *
      * @return this Control's CSS selector or <tt>null</tt> if no selector
      * can be found.
      */
@@ -299,14 +299,12 @@ public abstract class AbstractControl im
         return ClickUtils.getCssSelector(this);
     }
 
-
     /**
      * Returns <tt>true</tt> if this is an AJAX control,
      * <tt>false</tt> otherwise.
      *
-     * @param context the Click context.      
-     * @return <tt>true</tt> if this is an AJAX control,
-     * <tt>false</tt> otherwise.  
+     * @param context the Click context.
+     * @return <tt>true</tt> if this is an AJAX control, <tt>false</tt>
otherwise.
      */
     public boolean isAjaxTarget(Context context) {
         // TODO each control could have an optimized version of isAjaxTarget

Modified: click/trunk/click/framework/src/org/apache/click/control/AbstractLink.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/control/AbstractLink.java?rev=958333&r1=958332&r2=958333&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/control/AbstractLink.java (original)
+++ click/trunk/click/framework/src/org/apache/click/control/AbstractLink.java Sun Jun 27
06:29:06 2010
@@ -635,7 +635,7 @@ public abstract class AbstractLink exten
             }
 
             buffer.elementEnd("span");
-                       
+
         } else {
             buffer.elementStart(getTag());
 

Modified: click/trunk/click/framework/src/org/apache/click/control/RadioGroup.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/control/RadioGroup.java?rev=958333&r1=958332&r2=958333&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/control/RadioGroup.java (original)
+++ click/trunk/click/framework/src/org/apache/click/control/RadioGroup.java Sun Jun 27 06:29:06
2010
@@ -236,7 +236,7 @@ public class RadioGroup extends Field {
             throw new IllegalArgumentException(msg);
         }
         for (Map.Entry<?, ?> entry : options.entrySet()) {
-            Radio radio = new Radio(entry.getKey().toString(), 
+            Radio radio = new Radio(entry.getKey().toString(),
                                     entry.getValue().toString());
             add(radio);
         }

Modified: click/trunk/click/framework/src/org/apache/click/service/DefaultMessagesMapService.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/service/DefaultMessagesMapService.java?rev=958333&r1=958332&r2=958333&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/service/DefaultMessagesMapService.java
(original)
+++ click/trunk/click/framework/src/org/apache/click/service/DefaultMessagesMapService.java
Sun Jun 27 06:29:06 2010
@@ -27,7 +27,7 @@ import org.apache.click.util.MessagesMap
 
 /**
  * Provides a default MessagesMapService which returns MessagesMap implementations
- * of the messages map. 
+ * of the messages map.
  */
 public class DefaultMessagesMapService implements MessagesMapService {
 

Modified: click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java?rev=958333&r1=958332&r2=958333&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java (original)
+++ click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java Sun Jun
27 06:29:06 2010
@@ -141,6 +141,8 @@ public class XmlConfigService implements
         DEFAULT_HEADERS.put("Expires", new Date(1L));
     }
 
+    private static final String GOOGLE_APP_ENGINE = "Google App Engine";
+
     // ------------------------------------------------ Package Private Members
 
     /** The Map of global page headers. */
@@ -200,6 +202,9 @@ public class XmlConfigService implements
     /** The application TemplateService. */
     private MessagesMapService messagesMapService;
 
+    /** Flag indicating whether Click is running on Google App Engine. */
+    private boolean onGoogleAppEngine = false;
+
     // --------------------------------------------------------- Public Methods
 
     /**
@@ -214,6 +219,8 @@ public class XmlConfigService implements
 
         this.servletContext = servletContext;
 
+        onGoogleAppEngine = servletContext.getServerInfo().startsWith(GOOGLE_APP_ENGINE);
+
         // Set default logService early to log errors when services fail.
         logService = new ConsoleLogService();
         messagesMapService = new DefaultMessagesMapService();
@@ -366,7 +373,7 @@ public class XmlConfigService implements
     public MessagesMapService getMessagesMapService() {
         return messagesMapService;
     }
-    
+
     /**
      * @see ConfigService#createFormat()
      *
@@ -1307,43 +1314,45 @@ public class XmlConfigService implements
      */
     private void deployFiles(Element rootElm) throws Exception {
 
-        boolean isResourcesDeployable = isResourcesDeployable();
+        // Guard agaist GAE which can report that resources are deployable even when they
are not
+        boolean isResourcesDeployable = onGoogleAppEngine ? false : isResourcesDeployable();
 
         if (isResourcesDeployable) {
-            try {
-                if (getLogService().isTraceEnabled()) {
-                    String deployTarget = servletContext.getRealPath("/");
-                    getLogService().trace("resource deploy folder: "
-                        + deployTarget);
-                }
-
-                deployControls(getResourceRootElement("/click-controls.xml"));
-                deployControls(getResourceRootElement("/extras-controls.xml"));
-                deployControls(rootElm);
-                deployControlSets(rootElm);
-                deployResourcesOnClasspath();
-
-            } catch (Error ignore) {
-                // Google App Engine (GAE) can indicate that resources are deployable
-                // when they are not, and will throw an error if restricted classes
-                // such as FileOutputStream are accessed. We will log a warning
-                // to indicate that resources could not be deployed.
-                isResourcesDeployable = false;
+            if (getLogService().isTraceEnabled()) {
+                String deployTarget = servletContext.getRealPath("/");
+                getLogService().trace("resource deploy folder: "
+                    + deployTarget);
             }
+
+            deployControls(getResourceRootElement("/click-controls.xml"));
+            deployControls(getResourceRootElement("/extras-controls.xml"));
+            deployControls(rootElm);
+            deployControlSets(rootElm);
+            deployResourcesOnClasspath();
         }
 
         if (!isResourcesDeployable) {
-            String msg = "could not deploy Click resources to the"
-                + " 'click' web folder.\nThis can occur if the call to"
-                + " ServletContext.getRealPath(\"/\") returns null, which means"
-                + " the web application cannot determine the file system path"
-                + " to deploy files to. Another common problem is if the web"
-                + " application is not allowed to write to the file"
-                + " system.\nTo resolve this issue please see the Click user-guide:"
-                + " http://click.apache.org/docs/user-guide/html/ch04s03.html#deploying-restricted-env"
-                + " \nIgnore this warning in the future once you have settled on a"
-                + " deployment strategy";
-            getLogService().warn(msg);
+
+            HtmlStringBuffer buffer = new HtmlStringBuffer();
+            if (onGoogleAppEngine) {
+                buffer.append("Google App Engine does not support deploying");
+                buffer.append(" resources to the 'click' web folder.\n");
+
+            } else {
+                buffer.append("could not deploy Click resources to the 'click'");
+                buffer.append(" web folder.\nThis can occur if the call to");
+                buffer.append(" ServletContext.getRealPath(\"/\") returns null, which means");
+                buffer.append(" the web application cannot determine the file system path");
+                buffer.append(" to deploy files to. This issue also occurs if the web");
+                buffer.append(" application is not allowed to write to the file");
+                buffer.append(" system.\n");
+            }
+
+            buffer.append("To resolve this issue please see the Click user-guide:");
+            buffer.append(" http://click.apache.org/docs/user-guide/html/ch04s03.html#deploying-restricted-env");
+            buffer.append(" \nIgnore this warning once you have settled on a");
+            buffer.append(" deployment strategy");
+            getLogService().warn(buffer.toString());
         }
     }
 
@@ -1759,6 +1768,18 @@ public class XmlConfigService implements
         List fileList = new ArrayList();
 
         Set resources = servletContext.getResourcePaths("/");
+        if (onGoogleAppEngine) {
+            // resources could be immutable so create copy
+            Set tempResources = new HashSet();
+
+            // Load the two GAE preconfigured automapped folders
+            tempResources.addAll(servletContext.getResourcePaths("/page"));
+            tempResources.addAll(servletContext.getResourcePaths("/pages"));
+            tempResources.addAll(resources);
+
+            // assign copy to resources
+            resources = Collections.unmodifiableSet(tempResources);
+        }
 
         // Add all resources within web application
         for (Iterator i = resources.iterator(); i.hasNext();) {

Modified: click/trunk/click/framework/src/org/apache/click/util/ClickUtils.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/util/ClickUtils.java?rev=958333&r1=958332&r2=958333&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/util/ClickUtils.java (original)
+++ click/trunk/click/framework/src/org/apache/click/util/ClickUtils.java Sun Jun 27 06:29:06
2010
@@ -1342,7 +1342,7 @@ public class ClickUtils {
      * @param targetDir target directory where to deploy the files to. In most cases this
      * is only the reserved directory <code>click</code>
      */
-    public static void deployFileList(ServletContext servletContext, 
+    public static void deployFileList(ServletContext servletContext,
             Class<? extends Control> controlClass, String targetDir) {
 
         String packageName = ClassUtils.getPackageName(controlClass);



Mime
View raw message