Return-Path: Delivered-To: apmail-incubator-click-commits-archive@minotaur.apache.org Received: (qmail 17251 invoked from network); 28 Jul 2009 21:22:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Jul 2009 21:22:53 -0000 Received: (qmail 57519 invoked by uid 500); 28 Jul 2009 20:56:13 -0000 Delivered-To: apmail-incubator-click-commits-archive@incubator.apache.org Received: (qmail 57505 invoked by uid 500); 28 Jul 2009 20:56:13 -0000 Mailing-List: contact click-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@incubator.apache.org Delivered-To: mailing list click-commits@incubator.apache.org Received: (qmail 57495 invoked by uid 99); 28 Jul 2009 20:56:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jul 2009 20:56:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jul 2009 20:56:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 46CFD2388877; Tue, 28 Jul 2009 20:55:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r798708 - in /incubator/click/trunk/click: documentation/docs/ documentation/xdocs/src/docbook/click/ extras/src/org/apache/click/extras/gae/ Date: Tue, 28 Jul 2009 20:55:47 -0000 To: click-commits@incubator.apache.org From: sabob@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090728205548.46CFD2388877@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sabob Date: Tue Jul 28 20:55:47 2009 New Revision: 798708 URL: http://svn.apache.org/viewvc?rev=798708&view=rev Log: added docs: deploying resources in restricted environments Modified: incubator/click/trunk/click/documentation/docs/faq.html incubator/click/trunk/click/documentation/docs/roadmap-changes.html incubator/click/trunk/click/documentation/docs/upgrade-path.html incubator/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-configuration.xml incubator/click/trunk/click/extras/src/org/apache/click/extras/gae/GoogleAppEngineListener.java Modified: incubator/click/trunk/click/documentation/docs/faq.html URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/documentation/docs/faq.html?rev=798708&r1=798707&r2=798708&view=diff ============================================================================== --- incubator/click/trunk/click/documentation/docs/faq.html (original) +++ incubator/click/trunk/click/documentation/docs/faq.html Tue Jul 28 20:55:47 2009 @@ -78,13 +78,15 @@
  • What is the performance of Click?
  • How do I unit test Click pages? -
  • + +
  • How do I deploy Click resources in restricted environments? +
  • Why doesn't Click use Commons Logging / Log4J for logging?
  • Why doesn't Click use FreeMarker as the default rendering engine? -
  • +
  • Why develop a new Web Application Framework? -
  • +

     

    @@ -94,8 +96,8 @@ 1.  How to get help?
    - OK you have read the documentation and reviewed the - Examples applications, but there is still something + OK you have read the documentation and reviewed the + Examples applications, but there is still something you still don't understand. What do you do?

    You go to the click-user or click-development mail @@ -757,8 +759,30 @@

    +
    + 21.  How do I deploy Click resources in restricted environments? +
    +
    + Often times one need to run Click applications in restricted environments. + Examples include: +

    +

      +
    • WAR/EAR is not unpacked - common with WebLogic and Websphere servers
    • +
    • File system permissions are restricted
    • +
    • Hosting applications on Google App Engine
    • +
    + Click works perfectly fine in these environments. The only issue one might + encounter is Click's auto-deploy feature where static resources are copied + to the webapp root directory at application startup. In restricted environments + it might not be possible for Click to deploy its resources. +

    + Please see the user-guide section, Deploying resources in a restricted environment, + for various solutions. +

    + +
    - 21.  Why doesn't Click use Commons Logging / Log4J for logging? + 22.  Why doesn't Click use Commons Logging / Log4J for logging?
    Click by default does not use Commons Logging / Log4J to avoid the class @@ -771,7 +795,7 @@
    - 22.  Why doesn't Click use FreeMarker instead of Velocity as the default template engine? + 23.  Why doesn't Click use FreeMarker instead of Velocity as the default template engine?
    FreeMarker is a powerful templating engine which was evaluated along side @@ -785,7 +809,7 @@
    - 23.  Why develop a new Web Application Framework? + 24.  Why develop a new Web Application Framework?
    Because the existing frameworks did not meet my needs. Struts doesn't really do much, Modified: incubator/click/trunk/click/documentation/docs/roadmap-changes.html URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/documentation/docs/roadmap-changes.html?rev=798708&r1=798707&r2=798708&view=diff ============================================================================== --- incubator/click/trunk/click/documentation/docs/roadmap-changes.html (original) +++ incubator/click/trunk/click/documentation/docs/roadmap-changes.html Tue Jul 28 20:55:47 2009 @@ -147,6 +147,13 @@ here and the section on Control HEAD elements here. +
  • + Added a new section, Deploying resources in a restricted environment, + describing how to deploy static resources in environments where + WAR/EAR are not unpacked or where file system permissions are + restricted, such as + Google App Engine. +
  • @@ -202,9 +209,8 @@
  • Added support to deploy resources inside JARs from the Servlet 3.0 compliant - location, META-INF/resources. If Click is running on a Servlet 3.0 - server, it won't deploy its resources, but rely on the container to - serve the resources directly + location, META-INF/resources. Click's own pre-packaged resources + are now also located in the JAR under META-INF/resources [570].
  • Modified: incubator/click/trunk/click/documentation/docs/upgrade-path.html URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/documentation/docs/upgrade-path.html?rev=798708&r1=798707&r2=798708&view=diff ============================================================================== --- incubator/click/trunk/click/documentation/docs/upgrade-path.html (original) +++ incubator/click/trunk/click/documentation/docs/upgrade-path.html Tue Jul 28 20:55:47 2009 @@ -99,8 +99,8 @@ Page.getHeadElements().
  • - Click automatically deploy resources from the classpath that are located - under the directory META-INF/web. + Click automatically deploy resources from JARs and folders on the + classpath that are located under the directory META-INF/web.

    The Servlet 3.0 specification introduced a similar concept where resources can be packaged in a JAR and served directly without having to be Modified: incubator/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-configuration.xml URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-configuration.xml?rev=798708&r1=798707&r2=798708&view=diff ============================================================================== --- incubator/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-configuration.xml (original) +++ incubator/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-configuration.xml Tue Jul 28 20:55:47 2009 @@ -1010,29 +1010,153 @@ for that control. - It is generally easier to work with unpacked WARs and most servlet - containers do just that. However some contains such as WebLogic (at least - version 10) does not. To enable WebLogic to unpack the WAR go to the - Admin Console > server node > Web Applications - tab and check the Archived Real Path Enabled parameter. - + + Deploying resources in a restricted environment - If Click cannot deploy resources because of restricted file system - permissions, warning messages will be logged. - + It is generally easier to work with unpacked WARs and most servlet + containers do just that. However some contains such as WebLogic (at least + version 10) does not. To enable WebLogic to unpack the WAR go to the + Admin Console > server node > Web Applications + tab and check the Archived Real Path Enabled parameter. + + + If Click cannot deploy resources because the WAR/EAR is not unpacked + or because of restricted file system permissions, warning messages will be + logged. + + + Note: if your application is + running on a Servlet 3.0 compliant server, there is + no need to deploy resources in restricted environments. Servlet 3.0 + provide a feature where if the server cannot find a resource in the root + directory of the webapp, it will look for the resource under + 'META-INF/resources', and if found, serve it up. + Since Click packages its resources under + 'META-INF/resources' as well, there is no need to + deploy the resources. + - If your application server does not unpack the WAR/EAR or has restricted - permissions, you will need to package up these auto deployed files in your web - applications WAR file. To do this you should run you application on a development - machine without these restrictions and then package up the deployed files into - the WAR/EAR before deployment. - + Click also provides a number of options to make resources available + in restricted environments which is covered below: + + + + + Add a mapping in web.xml to inform + ClickServlet to serve static resources. This feature is made available + through the ResourceService + interface and its default implementation, + ClickResourceService. + Below is an example: + + + ClickServlet + org.apache.click.ClickServlet + 0 + + + + ClickServlet + *.htm + + + + + ClickServlet + /click/* +]]> + + Now ClickServlet will serve all static /click/* + resources directly from Click's JAR files. + + + One restriction of ClickResourceService is it only serves + resources from the /click/* folder. So if you use + third-party Click libraries that serve their resources from a different + folder e.g. /clickclick/*, this option won't work + out-of-the-box. + + + Also note that with this option Click's resources are served + directly from the JAR files, you won't be able to customize the resources, + if for example you want change the default styling through CSS. + + + + Use the DeployTask to deploy Click's static resources at build + time to your web application. With this option Click's static resources + can be copied to the root directory of your webapp, where you can + customize the resources as you see fit. The DeployTask is an Ant Task + you can incorporate into your build script. + + Currently the DeployTask is part of the click-dev-tools-xxx.jar + which can be found in your Click distribution under the lib + folder. + + To use this Ant Task, ensure the click-dev-tools-xxx.jar + is available on your build classpath and add the following target to your + build.xml: + + + + + +]]> + + We use the <deploy> Ant Task and specify + the attributes dir and todir. + dir specifies the source + directory to scan for JARs and folders containing static resources, + while todir specifies the target + directory where the resources should be copied to. + + + dir should point to your web application's + WEB-INF folder, since that is where Click's JARs + will be located. todir should point to your web + application's root directory, since that is where Click's resources + will be served from. + + + The DeployTask also generates an HTML report in the same folder + where the build script is executed from. The report will indicate + which resources was deployed and also which resources in your webapp + root directory is outdated. Resources can become outdated if you + upgrade to a new version of Click and certain Click resources were + updated. + + + + Click resources are packaged in JARs under the directory + META-INF/resources. You can use your favorite IDE + to navigate into the JARs and copy all the resources from + META-INF/resources to your webapp root directory. + Just remember to copy the resources in the same structure as they + appear under META-INF/resources. + + + + You can also access Click's resources by deploying your + application on a development machine where there are no file system + restrictions and the WAR/EAR is unpacked. Then you can copy the + deployed resources to your webapp root directory. + + + + + Deploying Custom Resources Click supports two ways of deploying pre-configured resources (templates, stylesheets, JavaScript etc.) from a Jar to a web application. + (This assumes that the environment Click is running in supports having + write access to the file system and that the WAR is unpacked.) @@ -1046,12 +1170,6 @@ By packaging the resources (stylesheets, JavaScript, Images etc.) into a special folder called 'META-INF/resources'. - Please note that if Click is executing inside a Servlet 3.0 compliant - server, it won't deploy its resources. Instead it will rely on the - Servlet 3.0 feature where if the server cannot find a resource - in the root directory of the webapp, it will look for the resource - under 'META-INF/resources', and if it is found, - serve it up. @@ -1060,9 +1178,9 @@ Controls, lets look at option #2. - When Click starts up, it scans each Jar in the classpath for - specially marked entries starting with 'META-INF/resources/'. (Please note - that even though Click will scan the entire classpath it is strongly + When Click starts up, it scans each Jar and folder on the classpath + for specially marked entries starting with 'META-INF/resources/'. (Please + note that even though Click will scan the entire classpath it is strongly recommended to host your Jar files under your WAR lib folder e.g. WEB-INF/lib. Sharing Jars on the classpath can lead to class loading issues.) @@ -1097,9 +1215,9 @@ 'webapp/mycorp/edit_customer.css'. - Option #2 is especially useful when you need to deploy a large number - of resources from a Jar. Note, only Jars placed under the - 'WEB-INF/lib' folder will be deployed. + Option #2 is the recommended approach for deploying your own + resources since it makes the managing and maintenance of resources much + easier. Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/gae/GoogleAppEngineListener.java URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/gae/GoogleAppEngineListener.java?rev=798708&r1=798707&r2=798708&view=diff ============================================================================== --- incubator/click/trunk/click/extras/src/org/apache/click/extras/gae/GoogleAppEngineListener.java (original) +++ incubator/click/trunk/click/extras/src/org/apache/click/extras/gae/GoogleAppEngineListener.java Tue Jul 28 20:55:47 2009 @@ -133,16 +133,9 @@ * the webapp. Since GAE doesn't allow writing to disk, Click cannot * automatically deploy its resources. *

    - * Instead you will have to manually add Click's resources in your GAE - * application's "/war" folder. To do this create a click - * folder under your /war directory -> "/war/click". - *

    - * Next you need to copy the resources from the click-core.X.X.X.jar and - * click-extras.X.X.X.jar. Use your favorite IDE or ZIP utility to open the - * jars and navigate to "META-INF/resources/" where you will find the - * "/click" folder with all the resources packaged for that jar. Simply - * copy the content of the "/click" folder to your GAE folder: - * "/war/click". + * Please see the user-guide section, + * Deploying resources in a restricted environment, + * for various solutions. */ public class GoogleAppEngineListener implements ServletContextListener {