Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[maven-scm] copy for tag cocoon-2

git-svn-id: https://svn.apache.org/repos/asf/cocoon/tags/cocoon@486764 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 929ae25aab9707bc8e51cc2ce63b11369679faa0 1 parent b170a5a
@reinhard reinhard authored
Showing with 26,239 additions and 0 deletions.
  1. +6 −0 cocoon-2/DESKTOP.INI
  2. +97 −0 cocoon-2/README.txt
  3. +87 −0 cocoon-2/assembly.xml
  4. +32 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/build.xml
  5. +84 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/pom.xml
  6. +53 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/AjaxHelper.java
  7. +50 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/AjaxRequestMatcher.java
  8. +56 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/AjaxRequestSelector.java
  9. +188 −0 ...on-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/BrowserUpdateTransformer.java
  10. +82 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/GetContinuationAction.java
  11. +76 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/cocoon.js
  12. +117 −0 ...n-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js
  13. +163 −0 ...s/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/FormUploadProgress.js
  14. +67 −0 ...2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/PartialLink.js
  15. +23 −0 ...2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/__package__.js
  16. +79 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/common.js
  17. +258 −0 ...n-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/insertion.js
  18. +189 −0 ...on-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/macros/timedbrowserupdater.xml
  19. +79 −0 ...ocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/xslt/ajax-styling.xsl
  20. +128 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/system/System.JSON.js
  21. +108 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/system/System.Upload.js
  22. +34 −0 ...on-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/system/i18n/messages.xml
  23. +51 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/system/sitemap.xmap
  24. BIN  ...ocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/dojo/resources/dojo-0.3.1-widget.zip
  25. +73 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/status.xml
  26. +42 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-sample/pom.xml
  27. +27 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/ajax.xsamples
  28. +20 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/display-clock.xml
  29. +20 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/display-freememory.xml
  30. +22 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/linked-updater-content-1.xml
  31. +22 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/linked-updater-content-2.xml
  32. +20 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/linked-updater-content-3.xml
  33. +84 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/linked-updater.xml
  34. +82 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/sitemap.xmap
  35. +33 −0 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/welcome.xml
  36. +28 −0 ...ocoon-ajax/cocoon-ajax-sample/src/main/resources/META-INF/cocoon/spring/cocoon-ajax-sample-blockServlet.xml
  37. +39 −0 cocoon-2/blocks/cocoon-ajax/pom.xml
  38. +44 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-impl/pom.xml
  39. +40 −0 ...ocoon-apples/cocoon-apples-impl/src/main/java/org/apache/cocoon/components/flow/apples/AppleController.java
  40. +45 −0 ...ks/cocoon-apples/cocoon-apples-impl/src/main/java/org/apache/cocoon/components/flow/apples/AppleHelper.java
  41. +62 −0 ...s/cocoon-apples/cocoon-apples-impl/src/main/java/org/apache/cocoon/components/flow/apples/AppleRequest.java
  42. +32 −0 .../cocoon-apples/cocoon-apples-impl/src/main/java/org/apache/cocoon/components/flow/apples/AppleResponse.java
  43. +149 −0 ...ocoon-apples/cocoon-apples-impl/src/main/java/org/apache/cocoon/components/flow/apples/ApplesProcessor.java
  44. +69 −0 ...n-apples/cocoon-apples-impl/src/main/java/org/apache/cocoon/components/flow/apples/DefaultAppleRequest.java
  45. +63 −0 ...-apples/cocoon-apples-impl/src/main/java/org/apache/cocoon/components/flow/apples/DefaultAppleResponse.java
  46. +45 −0 ...pples/cocoon-apples-impl/src/main/java/org/apache/cocoon/components/flow/apples/ServiceApplesProcessor.java
  47. +27 −0 ...les/cocoon-apples-impl/src/main/java/org/apache/cocoon/components/flow/apples/StatelessAppleController.java
  48. +34 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-apples.xconf
  49. +90 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-impl/status.xml
  50. +88 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-sample/pom.xml
  51. +313 −0 .../cocoon-apples-sample/src/main/java/org/apache/cocoon/components/flow/apples/samples/BindingWoodyApple.java
  52. +124 −0 ...s/cocoon-apples-sample/src/main/java/org/apache/cocoon/components/flow/apples/samples/CalculationApple.java
  53. +74 −0 ...les/cocoon-apples-sample/src/main/java/org/apache/cocoon/components/flow/apples/samples/GuessGameApple.java
  54. +123 −0 ...-apples/cocoon-apples-sample/src/main/java/org/apache/cocoon/components/flow/apples/samples/HanoiApple.java
  55. +27 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-sample/src/main/resources/COB-INF/apples.xsamples
  56. +36 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-sample/src/main/resources/COB-INF/guess/guess.jx
  57. +34 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-sample/src/main/resources/COB-INF/guess/success.jx
  58. +48 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-sample/src/main/resources/COB-INF/hanoi/hanoi.jx
  59. +202 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-sample/src/main/resources/COB-INF/hanoi/hanoi.xsl
  60. +47 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-sample/src/main/resources/COB-INF/hanoi/intro.jx
  61. +165 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-sample/src/main/resources/COB-INF/sitemap.xmap
  62. +40 −0 cocoon-2/blocks/cocoon-apples/cocoon-apples-sample/src/main/resources/COB-INF/welcome.xml
  63. +39 −0 cocoon-2/blocks/cocoon-apples/pom.xml
  64. +49 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-impl/pom.xml
  65. +905 −0 ...s/cocoon-asciiart/cocoon-asciiart-impl/src/main/java/org/apache/cocoon/generation/asciiart/AsciiArtPad.java
  66. +358 −0 ...asciiart/cocoon-asciiart-impl/src/main/java/org/apache/cocoon/generation/asciiart/AsciiArtSVGGenerator.java
  67. +27 −0 ...ocoon-asciiart/cocoon-asciiart-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-asciiart-sitemap.xconf
  68. +25 −0 ...blocks/cocoon-asciiart/cocoon-asciiart-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-asciiart.xconf
  69. +195 −0 ...-asciiart/cocoon-asciiart-impl/src/test/java/org/apache/cocoon/generation/asciiart/AsciiArtPadTestCase.java
  70. +73 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-impl/status.xml
  71. +44 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/pom.xml
  72. +28 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/asciiart.xsamples
  73. +8 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/data/ascii-art-1.txt
  74. +472 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/data/ascii-art-10.txt
  75. +15 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/data/ascii-art-2.txt
  76. +33 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/data/ascii-art-3.txt
  77. +12 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/data/ascii-art-4.txt
  78. +12 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/data/ascii-art-5.txt
  79. +23 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/data/ascii-art-6.txt
  80. +17 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/data/ascii-art-7.txt
  81. +15 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/data/ascii-art-8.txt
  82. +122 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/data/ascii-art-9.txt
  83. +55 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/dir2html.xsl
  84. +83 −0 cocoon-2/blocks/cocoon-asciiart/cocoon-asciiart-sample/src/main/resources/COB-INF/sitemap.xmap
  85. +41 −0 cocoon-2/blocks/cocoon-asciiart/pom.xml
  86. +71 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/pom.xml
  87. +91 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/AbstractSecurityHandler.java
  88. +97 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/Application.java
  89. +87 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/ApplicationManager.java
  90. +49 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/ApplicationStore.java
  91. +136 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/ApplicationUtil.java
  92. +60 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/SecurityHandler.java
  93. +188 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/StandardApplication.java
  94. +126 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/StandardUser.java
  95. +83 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/User.java
  96. +58 −0 ...n-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/acting/AbstractAuthAction.java
  97. +86 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/acting/LoggedInAction.java
  98. +84 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/acting/LoginAction.java
  99. +79 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/acting/LogoutAction.java
  100. +54 −0 ...blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/impl/AnonymousSecurityHandler.java
  101. +94 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/impl/LoginInfo.java
  102. +333 −0 .../blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/impl/PipelineSecurityHandler.java
  103. +109 −0 ...2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/impl/ServletSecurityHandler.java
  104. +49 −0 ...2/blocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/impl/ServletSessionListener.java
  105. +335 −0 ...ocks/cocoon-auth/cocoon-auth-impl/src/main/java/org/apache/cocoon/auth/impl/StandardApplicationManager.java
  106. +29 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/resources/org/apache/cocoon/auth/roles.xconf
  107. +29 −0 cocoon-2/blocks/cocoon-auth/cocoon-auth-impl/src/main/resources/org/apache/cocoon/auth/sitemap-addons.xconf
  108. +39 −0 cocoon-2/blocks/cocoon-auth/pom.xml
  109. +47 −0 cocoon-2/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/pom.xml
  110. +43 −0 ...-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/AuthenticationConstants.java
  111. +89 −0 ...on-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/AuthenticationManager.java
  112. +84 −0 ...cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/acting/AuthAction.java
  113. +81 −0 ...on-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/acting/LoggedInAction.java
  114. +98 −0 ...ocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/acting/LoginAction.java
  115. +89 −0 ...coon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/acting/LogoutAction.java
  116. +86 −0 ...authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/Authenticator.java
  117. +553 −0 ...fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java
  118. +102 −0 ...cation-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultHandlerManager.java
  119. +306 −0 ...cation-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/PipelineAuthenticator.java
  120. +135 −0 ...ication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/ServletAuthenticator.java
  121. +176 −0 ...-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/configuration/ApplicationConfiguration.java
  122. +283 −0 ...tion-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/configuration/HandlerConfiguration.java
  123. +872 −0 ...ntication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java
  124. +91 −0 ...n-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContextProvider.java
  125. +840 −0 ...ation-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/generation/ConfigurationGenerator.java
  126. +147 −0 ...cation-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/generation/JaasSecurityGenerator.java
  127. +97 −0 ...cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/user/RequestState.java
  128. +144 −0 .../cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/user/UserHandler.java
  129. +57 −0 ...fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/user/UserState.java
  130. +38 −0 ...oon-authentication-fw-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-authentication-fw-sitemap.xconf
  131. +32 −0 ...n-fw/cocoon-authentication-fw-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-authentication-fw.xconf
  132. +24 −0 ...oon-authentication-fw-impl/src/main/resources/org/apache/cocoon/webapps/authentication/authentication.roles
  133. +99 −0 ...-authentication-fw-impl/src/main/resources/org/apache/cocoon/webapps/authentication/flow/javascript/auth.js
  134. +76 −0 cocoon-2/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/status.xml
  135. +42 −0 cocoon-2/blocks/cocoon-authentication-fw/cocoon-authentication-fw-sample/pom.xml
  136. +31 −0 ...oon-authentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/authentication-fw.xsamples
  137. +32 −0 ...n-authentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/conf/auth-manager-flow.xconf
  138. +50 −0 ...cocoon-authentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/conf/auth-manager.xconf
  139. +33 −0 ...2/blocks/cocoon-authentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/docs/login.xml
  140. +35 −0 ...ocks/cocoon-authentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/docs/protected.xml
  141. +32 −0 ...locks/cocoon-authentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/docs/userlist.xml
  142. +116 −0 cocoon-2/blocks/cocoon-authentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/flow.xmap
  143. +87 −0 ...2/blocks/cocoon-authentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/flow/sample.js
  144. +113 −0 ...n-2/blocks/cocoon-authentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/sitemap.xmap
  145. +49 −0 ...n-authentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/stylesheets/authenticate.xsl
  146. +89 −0 ...thentication-fw/cocoon-authentication-fw-sample/src/main/resources/COB-INF/stylesheets/simple-page2html.xsl
  147. +40 −0 cocoon-2/blocks/cocoon-authentication-fw/pom.xml
  148. +65 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-impl/pom.xml
  149. +85 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/components/axis/SoapServer.java
  150. +537 −0 ...n-2/blocks/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/components/axis/SoapServerImpl.java
  151. +23 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/components/axis/axis.roles
  152. +274 −0 .../cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/components/axis/providers/AvalonProvider.java
  153. +462 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/reading/AxisRPCReader.java
  154. +103 −0 ...cks/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/webservices/AbstractLogEnabledService.java
  155. +96 −0 ...ks/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/webservices/AbstractServiceableService.java
  156. +28 −0 ...ks/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/webservices/cache/DeploymentDescriptor.wsdd
  157. +26 −0 ...s/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/webservices/memory/DeploymentDescriptor.wsdd
  158. +56 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/webservices/memory/Memory.java
  159. +26 −0 ...s/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/webservices/system/DeploymentDescriptor.wsdd
  160. +66 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/webservices/system/System.java
  161. +34 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-axis.xconf
  162. +23 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-impl/src/main/resources/org/apache/cocoon/components/axis/axis.roles
  163. +28 −0 ...coon-axis/cocoon-axis-impl/src/main/resources/org/apache/cocoon/webservices/cache/DeploymentDescriptor.wsdd
  164. +26 −0 ...oon-axis/cocoon-axis-impl/src/main/resources/org/apache/cocoon/webservices/memory/DeploymentDescriptor.wsdd
  165. +26 −0 ...oon-axis/cocoon-axis-impl/src/main/resources/org/apache/cocoon/webservices/system/DeploymentDescriptor.wsdd
  166. +73 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-impl/status.xml
  167. +44 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-sample/pom.xml
  168. +25 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-sample/src/main/resources/COB-INF/axis.xsamples
  169. +72 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-sample/src/main/resources/COB-INF/sitemap.xmap
  170. +102 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-sample/src/main/resources/COB-INF/status.xsl
  171. +47 −0 cocoon-2/blocks/cocoon-axis/cocoon-axis-sample/src/main/resources/COB-INF/status.xsp
  172. +41 −0 cocoon-2/blocks/cocoon-axis/pom.xml
  173. +169 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-impl/pom.xml
  174. +91 −0 ...ik/cocoon-batik-impl/src/main/java/org/apache/cocoon/components/transcoder/ExtendableTranscoderFactory.java
  175. +35 −0 ...cocoon-batik/cocoon-batik-impl/src/main/java/org/apache/cocoon/components/transcoder/TranscoderFactory.java
  176. +108 −0 ...batik/cocoon-batik-impl/src/main/java/org/apache/cocoon/components/url/ParsedContextURLProtocolHandler.java
  177. +76 −0 ...atik/cocoon-batik-impl/src/main/java/org/apache/cocoon/components/url/ParsedResourceURLProtocolHandler.java
  178. +203 −0 ...ks/cocoon-batik/cocoon-batik-impl/src/main/java/org/apache/cocoon/components/url/SourceProtocolHandler.java
  179. +181 −0 ...s/cocoon-batik/cocoon-batik-impl/src/main/java/org/apache/cocoon/components/url/StreamJDKRegistryEntry.java
  180. +269 −0 ...on-2/blocks/cocoon-batik/cocoon-batik-impl/src/main/java/org/apache/cocoon/serialization/SVGSerializer.java
  181. +151 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-impl/src/main/java/org/apache/cocoon/xml/dom/SVGBuilder.java
  182. +35 −0 .../blocks/cocoon-batik/cocoon-batik-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-batik-sitemap.xconf
  183. +25 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-batik.xconf
  184. +111 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-impl/src/test/resources/anteater/samples-mime-types.xml
  185. +73 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-impl/status.xml
  186. +44 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-sample/pom.xml
  187. +694 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-sample/src/main/resources/COB-INF/anne.svg
  188. +27 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-sample/src/main/resources/COB-INF/batik.xsamples
  189. +174 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-sample/src/main/resources/COB-INF/batikLogo.svg
  190. +97 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-sample/src/main/resources/COB-INF/henryV.svg
  191. +33 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-sample/src/main/resources/COB-INF/opac.svg
  192. +92 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-sample/src/main/resources/COB-INF/samples.xml
  193. +109 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-sample/src/main/resources/COB-INF/sitemap.xmap
  194. +32 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-sample/src/main/resources/COB-INF/stylesheets/fragment-extractor.xsl
  195. +164 −0 cocoon-2/blocks/cocoon-batik/cocoon-batik-sample/src/main/resources/COB-INF/stylesheets/svg-samples2html.xsl
  196. +41 −0 cocoon-2/blocks/cocoon-batik/pom.xml
  197. +49 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-impl/pom.xml
  198. +116 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-impl/src/main/java/org/apache/cocoon/acting/ScriptAction.java
  199. +191 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-impl/src/main/java/org/apache/cocoon/generation/ScriptGenerator.java
  200. +34 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-bsf-sitemap.xconf
  201. +25 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-bsf.xconf
  202. +73 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-impl/status.xml
  203. +44 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/pom.xml
  204. +25 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/bsf.xsamples
  205. +38 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/generator/hello.gy
  206. +52 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/generator/helloGroovyMarkup.gy
  207. +35 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/samples.xml
  208. +107 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/script-action/addknowncourse.js
  209. +182 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/script-action/addunknowncse.js
  210. +195 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/script-action/addunknownte.js
  211. +122 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/script-action/createuser.js
  212. +83 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/script-action/deleteknown.js
  213. +78 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/script-action/deleteunknown.js
  214. +76 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/script-action/login.js
  215. +117 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/script-action/updateinfo.js
  216. +73 −0 cocoon-2/blocks/cocoon-bsf/cocoon-bsf-sample/src/main/resources/COB-INF/sitemap.xmap
  217. +41 −0 cocoon-2/blocks/cocoon-bsf/pom.xml
  218. +65 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-impl/pom.xml
  219. +310 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-impl/src/main/java/org/apache/cocoon/reading/CaptchaReader.java
  220. +29 −0 ...s/cocoon-captcha/cocoon-captcha-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-captcha-sitemap.xconf
  221. +73 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-impl/status.xml
  222. +42 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-sample/pom.xml
  223. +51 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-sample/src/main/resources/COB-INF/captcha.js
  224. +27 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-sample/src/main/resources/COB-INF/captcha.xsamples
  225. +70 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-sample/src/main/resources/COB-INF/custom.xhtml
  226. +40 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-sample/src/main/resources/COB-INF/simple-failure.jx
  227. +34 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-sample/src/main/resources/COB-INF/simple-success.jx
  228. +40 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-sample/src/main/resources/COB-INF/simple.jx
  229. +84 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-sample/src/main/resources/COB-INF/sitemap.xmap
  230. +49 −0 cocoon-2/blocks/cocoon-captcha/cocoon-captcha-sample/src/main/resources/COB-INF/welcome.xml
  231. +40 −0 cocoon-2/blocks/cocoon-captcha/pom.xml
  232. +92 −0 cocoon-2/blocks/cocoon-chaperon/cocoon-chaperon-impl/pom.xml
  233. +71 −0 ...ocoon-chaperon/cocoon-chaperon-impl/src/main/java/org/apache/cocoon/generation/ParseExceptionGenerator.java
  234. +248 −0 ...2/blocks/cocoon-chaperon/cocoon-chaperon-impl/src/main/java/org/apache/cocoon/generation/TextGenerator.java
  235. +308 −0 ...chaperon/cocoon-chaperon-impl/src/main/java/org/apache/cocoon/transformation/ExtendedParserTransformer.java
  236. +320 −0 ...cocoon-chaperon/cocoon-chaperon-impl/src/main/java/org/apache/cocoon/transformation/LexicalTransformer.java
  237. +328 −0 .../cocoon-chaperon/cocoon-chaperon-impl/src/main/java/org/apache/cocoon/transformation/ParserTransformer.java
  238. +511 −0 ...cocoon-chaperon/cocoon-chaperon-impl/src/main/java/org/apache/cocoon/transformation/PatternTransformer.java
  239. +35 −0 ...ocoon-chaperon/cocoon-chaperon-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-chaperon-sitemap.xconf
  240. +25 −0 ...blocks/cocoon-chaperon/cocoon-chaperon-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-chaperon.xconf
  241. +46 −0 .../cocoon-chaperon/cocoon-chaperon-impl/src/test/java/org/apache/cocoon/generation/TextGeneratorTestCase.java
  242. +48 −0 ...haperon/cocoon-chaperon-impl/src/test/java/org/apache/cocoon/transformation/LexicalTransformerTestCase.java
  243. +58 −0 ...chaperon/cocoon-chaperon-impl/src/test/java/org/apache/cocoon/transformation/ParserTransformerTestCase.java
  244. +39 −0 ...haperon/cocoon-chaperon-impl/src/test/java/org/apache/cocoon/transformation/PatternTransformerTestCase.java
  245. +43 −0 ...n-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/generation/TextGeneratorTestCase.xtest
  246. +1 −0  ...ks/cocoon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/generation/texttest-input1.txt
  247. +2 −0  ...ks/cocoon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/generation/texttest-input2.txt
  248. +18 −0 ...s/cocoon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/generation/texttest-result1.xml
  249. +19 −0 ...s/cocoon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/generation/texttest-result2.xml
  250. +43 −0 ...n/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/LexicalTransformerTestCase.xtest
  251. +48 −0 ...on/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/ParserTransformerTestCase.xtest
  252. +43 −0 ...n/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/PatternTransformerTestCase.xtest
  253. +21 −0 ...coon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/lexertest-input1.xml
  254. +18 −0 ...coon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/lexertest-input2.xml
  255. +62 −0 ...on-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/lexertest-lexicon1.xml
  256. +35 −0 ...on-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/lexertest-lexicon2.xml
  257. +34 −0 ...oon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/lexertest-result1.xml
  258. +25 −0 ...oon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/lexertest-result2.xml
  259. +61 −0 ...n-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/parsertest-grammar1.xml
  260. +34 −0 ...oon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/parsertest-input1.xml
  261. +22 −0 ...oon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/parsertest-input2.xml
  262. +23 −0 ...oon-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/parsertest-input3.xml
  263. +62 −0 ...on-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/parsertest-result1.xml
  264. +24 −0 ...on-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/parsertest-result2.xml
  265. +24 −0 ...on-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/parsertest-result3.xml
  266. +22 −0 ...on-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/patterntest-input1.xml
  267. +33 −0 ...-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/patterntest-lexicon1.xml
  268. +22 −0 ...n-chaperon/cocoon-chaperon-impl/src/test/resources/org/apache/cocoon/transformation/patterntest-result1.xml
  269. +73 −0 cocoon-2/blocks/cocoon-chaperon/cocoon-chaperon-impl/status.xml
  270. +44 −0 cocoon-2/blocks/cocoon-chaperon/cocoon-chaperon-sample/pom.xml
  271. +27 −0 cocoon-2/blocks/cocoon-chaperon/cocoon-chaperon-sample/src/main/resources/COB-INF/chaperon.xsamples
Sorry, we could not display the entire diff because too many files (6,088) changed.
View
6 cocoon-2/DESKTOP.INI
@@ -0,0 +1,6 @@
+; see http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/custom.asp
+[.ShellClassInfo]
+IconFile=src\documentation\src\content\xdocs\images\cocoon.ico
+IconIndex=0
+ConfirmFileOp=0
+InfoTip=Apache Cocoon, the XML application framework!
View
97 cocoon-2/README.txt
@@ -0,0 +1,97 @@
+This is some quick info about the Mavenization (m10n) of Cocoon 2.2.
+
+There are also some Daisy documentation pages about this, for more "stable" information:
+
+ http://cocoon.zones.apache.org/daisy/documentation/g2/756.html
+ http://cocoon.zones.apache.org/daisy/documentation/g1/798.html
+
+
+PREREQUISITES
+-------------
+You need a JDK, 1.4.x or 1.5.x.
+
+Maven 2 must be installed (at least 2.0.4??).
+
+
+MAVEN REPOSITORY MIRRORS
+------------------------
+To avoid very slow builds due to slow or inaccessible Maven repositories,
+it is recommended to setup your closest/fastest/preferred Maven mirror,
+as explained in
+
+ http://maven.apache.org/guides/mini/guide-mirror-settings.html
+
+People have been reporting good results with the dotsrc repo
+(mirrors.dotsrc.org/maven2), at least from Europe.
+A good US based repo is the one from mergere (repo.mergere.com/maven2).
+
+Build times will vary dramatically depending on how good your connectivity
+to the Maven repository/mirror is, how well it performs, and whether
+you already have a loaded local Maven repository.
+
+
+HOW TO BUILD THE COCOON WEBAPP
+------------------------------
+
+Since Cocoon release 2.2, Cocoon relies on Maven 2 for its build
+process.
+
+To build Cocoon, use the following command:
+
+ $ mvn -Dmaven.test.skip=true -Dallblocks install
+
+In case of any failures, repeat command as necessary till you see
+the message:
+
+ BUILD SUCCESSFUL
+
+
+See also MAVEN REPOSITORY MIRRORS above.
+
+
+HOW TO MOUNT THE PROJECTS IN ECLIPSE
+------------------------------------
+
+from /trunk, run mvn eclipse:clean first to remove any left over eclipse
+files. Then run mvn eclipse:eclipse.
+
+Next go to eclipse, and make sure you haven't got trunk mounted as a
+project already. Also remove .classpath and .project files possibly
+remaining in /trunk from a previous project mount.
+Do File-Import->Existing projects into workspace, then
+point to your trunk directory and it should detect the newly created
+blocks as projects.
+
+Note that you need to declare the M2_REPO classpath variable in your
+workspace, it should point to your local m2 repository.
+
+You can also get eclipse to download the sources of the dependent libraries and attach them
+to the jars in eclipse :
+
+ $ mvn -Declipse.downloadSources=true eclipse:eclipse
+
+For further information about the maven eclipse plugin visit
+
+ http://maven.apache.org/plugins/maven-eclipse-plugin/
+
+
+HOW TO START THE COCOON WEBAPP
+------------------------------
+
+Checkout complete trunk and build it. If clean rebuild is desired,
+use command:
+
+ $ mvn -Dallblocks clean install
+
+Call this until you get "BUILD SUCCESSFUL" - sometimes downloads from maven
+repositories are temporarily unaccessible and cause the build to fail.
+
+Go to core/cocoon-webapp:
+ $ mvn jetty6:run
+
+Point your browser to http://localhost:8888/
+
+(Don't use jetty:run-exploded as in this case the jetty6 plugin will
+ alter the webapp build by the Cocoon deployer again!)
+
+See also MAVEN REPOSITORY MIRRORS above.
View
87 cocoon-2/assembly.xml
@@ -0,0 +1,87 @@
+<?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 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.
+-->
+
+<assembly>
+ <id>bin</id>
+
+ <formats>
+ <!--
+ <format>tar.gz</format>
+ <format>tar.bz2</format>
+ <format>zip</format>
+ -->
+ <format>dir</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <moduleSets>
+ <moduleSet>
+ <excludes>
+ <exclude>org.apache.cocoon:cocoon-webapp</exclude>
+ <exclude>org.apache.cocoon:cocoon-deployer-minimal-webapp</exclude>
+ <exclude>org.apache.cocoon:cocoon-dists-modules</exclude>
+ </excludes>
+ <!--
+ <sources>
+ <outputDirectory></outputDirectory>
+ </sources>
+ -->
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <outputDirectory>lib</outputDirectory>
+ </binaries>
+ </moduleSet>
+ </moduleSets>
+
+ <moduleSets>
+ <moduleSet>
+ <includes>
+ <include>org.apache.cocoon:cocoon-webapp</include>
+ </includes>
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <outputDirectory>www</outputDirectory>
+ </binaries>
+ </moduleSet>
+ </moduleSets>
+
+ <fileSets>
+ <fileSet>
+ <includes>
+ <include>README*</include>
+ <include>LICENSE*</include>
+ <include>NOTICE*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+ <!--
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>dependencies</outputDirectory>
+ <unpack>true</unpack>
+ <scope>runtime</scope>
+ </dependencySet>
+ </dependencySets>
+ -->
+</assembly>
View
32 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/build.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<project name="cocoon-ajax-dojo" default="unzip-dojo" basedir=".">
+ <target name="unzip-dojo" description="Uncompressing dojo zip file and include the content into the ajax jar file" >
+ <!-- FIXME : Use maven built-in properties to locate source and destination folders -->
+ <property name="srcDir" location="src/main/resources/org/apache/cocoon/dojo/resources"/>
+ <property name="destDir" location="target/classes/org/apache/cocoon/dojo/resources"/>
+ <unzip dest="${destDir}">
+ <fileset dir="${srcDir}">
+ <include name="dojo-*.zip"/>
+ </fileset>
+ </unzip>
+ <delete>
+ <fileset dir="${destDir}" includes="dojo-*.zip"/>
+ </delete>
+ </target>
+</project>
View
84 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/pom.xml
@@ -0,0 +1,84 @@
+<?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 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.
+-->
+<!--+
+ | @version $Id$
+ |
+ +-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-ajax</artifactId>
+ <version>2-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cocoon-ajax-impl</artifactId>
+ <version>1.0.0-M2-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Ajax Block Implementation</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-core</artifactId>
+ <version>2.2.0-M3-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <distributionManagement>
+ <site>
+ <id>website</id>
+ <url>${docs.deploymentBaseUrl}/blocks/ajax/${docs.version}/</url>
+ </site>
+ </distributionManagement>
+ <properties>
+ <docs.name>Cocoon Ajax</docs.name>
+ <docs.version>1.0</docs.version>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <configuration>
+ <tasks>
+ <ant antfile="${basedir}/build.xml" inheritRefs="true">
+ <target name="unzip-dojo"/>
+ </ant>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.daisycms</groupId>
+ <artifactId>daisy-maven-plugin</artifactId>
+ <configuration>
+ <navDocId>1221</navDocId>
+ <collection>cdocs-ajax</collection>
+ <skipFirstNavigationDocumentLevel>true</skipFirstNavigationDocumentLevel>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
53 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/AjaxHelper.java
@@ -0,0 +1,53 @@
+/*
+ * 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.cocoon.ajax;
+
+import org.apache.cocoon.environment.Request;
+
+/**
+ * Helper class to handle Ajax requests
+ *
+ * @version $Id$
+ * @since 2.1.8
+ */
+public class AjaxHelper {
+
+ private AjaxHelper() {
+ // Forbid instanciation
+ }
+
+ /**
+ * The request parameter that, if set, indicates an Ajax request.
+ */
+ public static final String AJAX_REQUEST_PARAMETER = "cocoon-ajax";
+
+ /**
+ * The namespace URI of the "browser update" xml dialect
+ */
+ public static final String BROWSER_UPDATE_URI = "http://apache.org/cocoon/browser-update/1.0";
+
+ /**
+ * Is the request an Ajax request?
+ *
+ * @param req the request
+ * @return true if this is an Ajax request
+ */
+ public static boolean isAjaxRequest(Request req) {
+ return req.getParameter(AJAX_REQUEST_PARAMETER) != null;
+ }
+
+}
View
50 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/AjaxRequestMatcher.java
@@ -0,0 +1,50 @@
+/*
+ * 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.cocoon.ajax;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.matching.Matcher;
+import org.apache.cocoon.sitemap.PatternException;
+
+/**
+ * A matcher that tests if the current request is an Ajax request. This matcher
+ * provides no sitemap variables.
+ * <p>
+ * Example:
+ * <pre>
+ * &lt;map:match type="ajax-request"&gt;
+ * ... ajax request ...
+ * &lt;/map:match&gt;
+ * </pre>
+ *
+ * @since 2.1.8
+ * @version $Id$
+ */
+public class AjaxRequestMatcher implements Matcher, ThreadSafe {
+
+ public Map match(String pattern, Map objectModel, Parameters parameters) throws PatternException {
+ Request req = ObjectModelHelper.getRequest(objectModel);
+
+ return AjaxHelper.isAjaxRequest(req) ? Collections.EMPTY_MAP : null;
+ }
+}
View
56 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/AjaxRequestSelector.java
@@ -0,0 +1,56 @@
+/*
+ * 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.cocoon.ajax;
+
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.selection.AbstractSwitchSelector;
+import org.apache.commons.lang.BooleanUtils;
+
+/**
+ * Choose a select branch depending on if the current request is an Ajax request.
+ * The test value can be either "<code>true</code>" or "<code>false</code>".
+ *
+ * <pre>
+ * &lt;map:select type="ajax-request"&gt;
+ * &lt;map:when test="true"&gt;
+ * ... ajax request ...
+ * &lt;/map:when&gt;
+ * &lt;map:otherwise&gt;
+ * ... non ajax request ...
+ * &lt;/map:otherwise&gt;
+ * &lt;/map:select&gt;
+ * </pre>
+ *
+ * @since 2.1.8
+ * @version $Id$
+ */
+public class AjaxRequestSelector extends AbstractSwitchSelector {
+
+ public Object getSelectorContext(Map objectModel, Parameters parameters) {
+ Request req = ObjectModelHelper.getRequest(objectModel);
+ return BooleanUtils.toBooleanObject(AjaxHelper.isAjaxRequest(req));
+ }
+
+ public boolean select(String expression, Object selectorContext) {
+ boolean test = BooleanUtils.toBoolean(expression);
+ return test == ((Boolean)selectorContext).booleanValue();
+ }
+}
View
188 ...2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/BrowserUpdateTransformer.java
@@ -0,0 +1,188 @@
+/*
+ * 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.cocoon.ajax;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.transformation.AbstractTransformer;
+import org.apache.cocoon.xml.AttributesImpl;
+import org.apache.cocoon.xml.RedundantNamespacesFilter;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ *
+ * @version $Id$
+ */
+
+public class BrowserUpdateTransformer extends AbstractTransformer {
+
+ public static final String AJAXMODE_PARAM = "cocoon-ajax";
+ public static final String BU_NSURI = "http://apache.org/cocoon/browser-update/1.0";
+
+ private boolean ajaxRequest = false;
+
+ private int replaceDepth = 0;
+
+ private boolean inUpdateTag = false;
+ private String updateTagId = null;
+
+ Locator locator;
+
+ public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException {
+
+ Request request = ObjectModelHelper.getRequest(objectModel);
+ this.ajaxRequest = request.getParameter(AJAXMODE_PARAM) != null;
+ this.replaceDepth = 0;
+ this.inUpdateTag = false;
+ }
+
+ public void setDocumentLocator(Locator locator) {
+ super.setDocumentLocator(locator);
+ this.locator = locator;
+ }
+
+ public void startDocument() throws SAXException {
+
+ if (ajaxRequest) {
+ // Add the namespace filter to our own output.
+ // This is needed as flattening bu:* elements can lead to some weird reordering of
+ // namespace declarations...
+ RedundantNamespacesFilter nsPipe = new RedundantNamespacesFilter();
+ if (this.xmlConsumer != null) {
+ nsPipe.setConsumer(this.xmlConsumer);
+ } else {
+ nsPipe.setContentHandler(this.contentHandler);
+ }
+ setConsumer(nsPipe);
+ }
+
+ super.startDocument();
+ if (ajaxRequest) {
+ // Add a root element. The original one is very likely to be stripped
+ super.startPrefixMapping("bu", BU_NSURI);
+ super.startElement(BU_NSURI, "document", "bu:document", new AttributesImpl());
+ }
+ }
+
+ public void startPrefixMapping(String prefix, String uri) throws SAXException {
+ // Passthrough if not in ajax mode or if in a bu:replace
+ if (!this.ajaxRequest || this.replaceDepth > 0) {
+ super.startPrefixMapping(prefix, uri);
+ }
+ }
+
+ public void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException {
+ if (BU_NSURI.equals(uri) && "replace".equals(loc)) {
+ // Keep the id attribute. It may be null, in which case the one of the
+ // child element will be used.
+ this.updateTagId = attrs.getValue("id");
+ this.inUpdateTag = true;
+ if (this.ajaxRequest && this.replaceDepth == 0) {
+ // Pass this element through
+ super.startElement(uri, loc, raw, attrs);
+ }
+ replaceDepth++;
+ } else {
+ // Passthrough if not in ajax mode or if in a bu:replace
+
+ // Is the enclosing element a bu:replace?
+ if (this.inUpdateTag) {
+ this.inUpdateTag = false;
+ // Is there already an id?
+ String localId = attrs.getValue("id");
+ if (localId != null) {
+ // Yes: check it's the same
+ if (this.updateTagId != null && !localId.equals(this.updateTagId)) {
+ throw new SAXParseException("Id on bu:replace (" + this.updateTagId + ") and " + raw + " (" +
+ localId + ") don't match.", this.locator);
+ }
+ } else {
+ // No: add it
+ if (this.updateTagId == null) {
+ throw new SAXParseException("Neither bu:replace nor " + raw + " have an id attribute.", this.locator);
+ }
+ AttributesImpl newAttrs = new AttributesImpl(attrs);
+ newAttrs.addCDATAAttribute("id", this.updateTagId);
+ attrs = newAttrs;
+ }
+ this.updateTagId = null;
+ }
+ if (!this.ajaxRequest || this.replaceDepth > 0) {
+ super.startElement(uri, loc, raw, attrs);
+ }
+ }
+ }
+
+ public void characters(char[] buffer, int offset, int len) throws SAXException {
+ if (this.inUpdateTag) {
+ // Check that it's only spaces
+ for (int i = offset; i < len; i++) {
+ if (!Character.isWhitespace(buffer[i])) {
+ throw new SAXParseException("bu:replace must include a single child element and no text.", this.locator);
+ }
+ }
+ }
+ if (!this.ajaxRequest || this.replaceDepth > 0) {
+ super.characters(buffer, offset, len);
+ }
+ }
+
+ public void endElement(String uri, String loc, String raw) throws SAXException {
+ if (BU_NSURI.equals(uri) && "replace".equals(loc)) {
+ replaceDepth--;
+ if (this.ajaxRequest && this.replaceDepth == 0) {
+ // Pass this element through
+ super.endElement(uri, loc, raw);
+ }
+ } else {
+ // Passthrough if not in ajax mode or if in a bu:replace
+ if (!this.ajaxRequest || this.replaceDepth > 0) {
+ super.endElement(uri, loc, raw);
+ }
+ }
+ }
+
+ public void endPrefixMapping(String prefix) throws SAXException {
+ // Passthrough if not in ajax mode or if in a bu:replace
+ if (!this.ajaxRequest || this.replaceDepth > 0) {
+ super.endPrefixMapping(prefix);
+ }
+ }
+
+ public void endDocument() throws SAXException {
+ if (ajaxRequest) {
+ super.endElement(BU_NSURI, "document", "bu:document");
+ super.endPrefixMapping("bu");
+ }
+ super.endDocument();
+ }
+
+ public void recycle() {
+ this.locator = null;
+ this.updateTagId = null;
+ super.recycle();
+ }
+}
View
82 ...on-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/GetContinuationAction.java
@@ -0,0 +1,82 @@
+/*
+ * 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.cocoon.ajax;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.acting.ServiceableAction;
+import org.apache.cocoon.components.flow.ContinuationsManager;
+import org.apache.cocoon.components.flow.FlowHelper;
+import org.apache.cocoon.components.flow.WebContinuation;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Redirector;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.sitemap.SitemapParameters;
+
+/**
+ * Get a continuation knowing its identifier, and set it as the current continuation
+ * in the object model, in the same manner as <code>cocoon.sendPageAndWait()</code> does.
+ * This action is useful when an Ajax request is made that needs to access data related
+ * to the continuation that originally displayed the current page.
+ * <p>
+ * The continuation id is either the <code>src</code> attribute in <code>&lt;map:act&gt;</code>
+ * or, if not specified, the <code>continuation-id</code> request parameter.
+ * <p>
+ * This action is successful if the continuation exists and is still valid.
+ *
+ * @since 2.1.8
+ * @version $Id$
+ */
+public class GetContinuationAction extends ServiceableAction implements ThreadSafe, Disposable {
+ ContinuationsManager contManager;
+
+ public void service(ServiceManager manager) throws ServiceException {
+ super.service(manager);
+ this.contManager = (ContinuationsManager)manager.lookup(ContinuationsManager.ROLE);
+ }
+
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception {
+ String continuationId;
+ if (source == null) {
+ continuationId = ObjectModelHelper.getRequest(objectModel).getParameter("continuation-id");
+ } else {
+ continuationId = source;
+ }
+
+ // The interpreter id is the sitemap's URI
+ String interpreterId = SitemapParameters.getLocation(parameters).getURI();
+ WebContinuation wk = this.contManager.lookupWebContinuation(continuationId, interpreterId);
+ if (wk == null || wk.disposed()) {
+ return null;
+ } else {
+ // Getting the continuation updates the last access time
+ wk.getContinuation();
+ FlowHelper.setWebContinuation(objectModel, wk);
+ return Collections.EMPTY_MAP;
+ }
+ }
+
+ public void dispose() {
+ this.manager.release(this.contManager);
+ }
+}
View
76 cocoon-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/cocoon.js
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+/**
+ * Bootstrap file to plug Cocoon in the Dojo package system. It declares the
+ * "cocoon" root package and hooks in the script loading engine to handle
+ * the per-block organization of JS files in Cocoon.
+ * <p>
+ * A typical usage scenario would be:
+ * <pre>
+ * <script src="resources/dojo/dojo.js">
+ * <script src="resources/ajax/cocoon.js"/>
+ * <script>
+ * dojo.require("cocoon.forms.Form");
+ * ...
+ * </script>
+ * </pre>
+ *
+ * @version $Id$
+ */
+
+dojo.provide("cocoon");
+
+// Setup hooks to load JS files provided by Cocoon blocks
+(function() {
+ // base path is "resources/dojo". Move to back to "resources"
+ var rsrcPath = "../";
+
+ // cocoon.foo.bar is loaded from "resources/foo/js/bar.js"
+ var orgRequire = dojo.require;
+ dojo.require = function() {
+ var module = arguments[0];
+ var match = module.match(/^(cocoon\.([^\.]*))/);
+ if (match) {
+ var block = match[1];
+ var name = match[2];
+ if (dojo.hostenv.getModulePrefix(block) == block) {
+ // Register the block's path
+ //dojo.debug("Registering Cocoon module = " + arguments[0]);
+ var prefix = rsrcPath + name + "/js";
+ dojo.hostenv.setModulePrefix(block, prefix);
+ //dojo.debug("calling setModulePrefix("+block+", "+ prefix +")");
+ }
+ }
+ // Continue normal processing
+ return orgRequire.apply(this, arguments);
+ };
+
+ // cocoon.foo (single JS file for a block) is loaded from "resources/foo/js/common.js"
+ var orgLoadUri = dojo.hostenv.loadUri;
+ dojo.hostenv.loadUri = function(uri) {
+ // match 'xxx/dojo/../yyy/js.js
+ var match = uri.match(/^(.*)\/dojo\/\.\.\/([^\/]*)\/js.js$/);
+ dojo.debug("Loading URI" + uri);
+ if (match) {
+ //dojo.debug("matched cocoon package " + uri);
+ arguments[0] = match[1] + "/" + match[2] + "/js/common.js";
+ //dojo.debug("arg " + arguments[0]);
+
+ }
+ return orgLoadUri.apply(this, arguments);
+ }
+})();
View
117 .../blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js
@@ -0,0 +1,117 @@
+/*
+ * 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.
+ */
+
+/**
+ * General purpose AJAX infrastructure to handle a BU ("browser update") response
+ *
+ * To add a new handler for a given request, create a new BUHandler and update its
+ * handlers property.
+ *
+ * @version $Id$
+ */
+
+dojo.require("dojo.dom");
+dojo.require("dojo.html");
+dojo.require("cocoon.ajax.insertion");
+dojo.provide("cocoon.ajax.BUHandler");
+
+cocoon.ajax.BUHandler = function() { };
+
+cocoon.ajax.BUHandler.fade = function(node) {
+ dojo.require("dojo.fx.*");
+ dojo.fx.highlight(element, dojo.graphics.color.hex2rgb("#ffc"), 700, 300);
+}
+
+dojo.lang.extend(cocoon.ajax.BUHandler, {
+ // Default highlight effect
+ highlight: null,
+
+ processResponse: function(doc, request) {
+ var base = doc.documentElement;
+
+ var nodes = [];
+ if (base.nodeName.toLowerCase() == "bu:document") {
+ nodes = base.childNodes;
+ dojo.debug("got response using: XMLHTTPTransport");
+ } else {
+ base = dojo.byId("browser-update", doc);
+ if (base) {
+ nodes = base.childNodes;
+ dojo.debug("got response using: IframeTransport");
+ } else {
+ this.handleError("No response data found", doc);
+ }
+ }
+ for (var i = 0; i < nodes.length; i++) {
+ var node = nodes[i];
+ if (node.nodeType == dojo.dom.ELEMENT_NODE) {
+ var handler = node.nodeName.replace(/.*:/, "").toLowerCase();
+ if (handler == "textarea") handler = node.getAttribute("name");
+ var handlerFunc = this.handlers[handler];
+ if (handlerFunc) {
+ handlerFunc(node);
+ } else {
+ this.handleError("No handler found for element " + handler, doc);
+ }
+ }
+ }
+ },
+
+ handleError: function(message, response) {
+ if (confirm(message + "\nShow server response?")) {
+ var w = window.open(undefined, "Cocoon Error", "location=no,resizable=yes,scrollbars=yes");
+ if (w == undefined) {
+ alert("You must allow popups from this server to display the response.");
+ } else {
+ var doc = w.document;
+ if (response.responseText) {
+ doc.open();
+ doc.write(response.responseText);
+ doc.close();
+ } else if (response.childNodes) {
+ dojo.dom.copyChildren(doc,response);
+ }
+ }
+ }
+ },
+
+ handlers: {
+ replace: function(element) {
+ var id = element.getAttribute("id");
+ if (!id) {
+ alert("no id found on update element");
+ return;
+ }
+ // Get the first child element (the first child may be some text!)
+ var firstChild = dojo.dom.getFirstChildElement(element);
+ if (!firstChild && element.nodeName.toLowerCase() == "textarea")
+ firstChild = dojo.dom.createDocumentFromText(element.value).documentElement;
+
+ var oldElement = document.getElementById(id);
+
+ if (!oldElement) {
+ alert("no element '" + id + "' in source document");
+ return;
+ }
+ var newElement = cocoon.ajax.insertion.replace(oldElement, firstChild);
+
+ if (this.highlight) {
+ this.highlight(newElement);
+ }
+ }
+ }
+});
View
163 ...ocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/FormUploadProgress.js
@@ -0,0 +1,163 @@
+/*
+ * 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.
+ */
+
+ /*
+ FormUploadProgress Widget
+
+ This is a Dojo Widget for Cocoon that monitors the progress of uploads from a form.
+
+ It works by sending periodical XMLHttp calls to Cocoon in the background, while the files are being uploaded.
+ Cocoon responds with JSON data which is used to draw the progress bar and status strings.
+
+ @version $Id$
+
+ */
+
+dojo.provide("cocoon.ajax.FormUploadProgress");
+dojo.require("dojo.event");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.animation.Timer");
+
+dojo.widget.defineWidget(
+ "cocoon.ajax.FormUploadProgress",
+ dojo.widget.HtmlWidget,
+ {
+ // override properties (these may be overridden by using the same-named attributes on the widget tag)
+ background: "", // the colour of the progress bar
+ color: "", // the colour of the text and border
+ ready: "Ready.", // Strings the widget needs, that may require external i18n transformation
+ connecting: "Connecting ...",
+
+ // widget API properties
+ widgetType: "FormUploadProgress",
+ isContainer: true,
+ templateString: '<div class="FormUpload">' +
+ '<div class="FormUploadUser" dojoAttachPoint="containerNode"></div>' +
+ '<div class="FormUploadProgress" style="border:1px solid #336699;margin:2px;height: 16px;position:relative;">' +
+ '<div style="width:0px;background:#BFCCDF;position:absolute;top:0;left:0;width:0;right:0;" class="bar" dojoAttachPoint="barNode">&nbsp;</div>' +
+ '<div style="color:#336699;position:absolute;top:0;left:0;bottom:0;right:0;background:none;padding:2px;font-size:10px;overflow:hidden;" class="data" dojoAttachPoint="msgNode">&nbsp;</div>' +
+ '</div>' +
+ '</div>',
+
+ // DOM Nodes in the template
+ containerNode: null, // the node containing the user content
+ msgNode: null, // the node containing the progress status text
+ barNode: null, // the progress bar node
+
+ // private properties
+ _form: null, // this widget's form
+ _target: null, // the form's widget
+ _timer: null, // timer for periodical updates
+ _busy: false, // busy getting the status
+ _delay: 2000, // 2 secs between status calls
+
+ // widget interface
+ postCreate: function(){
+ // optional styling
+ if (this.background) this.barNode.style.background = this.background;
+ if (this.color) {
+ this.barNode.parentNode.style.borderColor = this.color;
+ this.msgNode.style.color = this.color;
+ }
+ // work out where to attach the event listener
+ this._form = dojo.dom.getFirstAncestorByTag(this.domNode, "form");
+ if (this._form) {
+ var dojoId = this._form.getAttribute("dojoWidgetId");
+ var formWidget = dojo.widget.byId(dojoId);
+ if (formWidget) { // use the CFormsForm Widget if there is one
+ this._target = formWidget;
+ dojo.event.connect("after", this._target, "submit", this, "_startUpload");
+ } else { // otherwise use the form itself
+ dojo.event.connect("after", this._form, "onsubmit", this, "_startUpload");
+ }
+ } else {
+ dojo.debug("WARNING: The FormUploadProgress widget may only be used inside a form.");
+ }
+ this.msgNode.innerHTML = this.ready;
+ },
+
+ // widget interface
+ destroy: function(){
+ if (this._target) {
+ dojo.event.disconnect("after", this._target, "submit", this, "_startUpload");
+ } else {
+ if (this._form) dojo.event.disconnect("after", this._form, "onsubmit", this, "_startUpload");
+ }
+ },
+
+ // private widget funtions
+
+ // event handler should fire after the forms starts submitting
+ _startUpload: function(event) {
+ if (this._checkForActiveFile(this._form)) {
+ var self = this;
+ this._timer = new dojo.animation.Timer(this._delay);
+ this._timer.onTick = function() { self._getStatus() };
+ this._timer.onStart = this._timer.onTick;
+ this._timer.start();
+ this.msgNode.innerHTML = this.connecting;
+ }
+ },
+
+ // get the current upload status from Cocoon
+ _getStatus: function() {
+ if (this._busy) return; // only one request at a time
+ var self = this;
+ dojo.io.bind({
+ url: new dojo.uri.Uri(djConfig["baseRelativePath"], "../../../_cocoon/system/ajax/upload/status"),
+ mimetype: "text/json",
+ handle: function(type, data, evt) {
+ if (type == "load") {
+ if (!data) return;
+ self._update(data);
+ self._busy = false;
+ } else if (type == "error") {
+ dojo.debug("FormUploadProgress - status request failed");
+ }
+ }
+ });
+ this._busy = true;
+ },
+
+ // perform the display update
+ _update: function(status) {
+ if (status.sent) {
+ if (status.finished) {
+ this.barNode.style.width = "100%";
+ this._timer.stop();
+ } else {
+ this.barNode.style.width = status.percent + "%";
+ }
+ }
+ if (status.message) this.msgNode.innerHTML = status.message;
+ },
+
+ // look to see if there are active file-upload fields in the form
+ _checkForActiveFile: function(node) {
+ var hasFile = false;
+ var inputs = node.getElementsByTagName("input");
+ dojo.lang.forEach(inputs, function(input){
+ if(hasFile){ return; }
+ if(input.getAttribute("type")=="file" && input.value){
+ hasFile = true;
+ }
+ });
+ return hasFile;
+ }
+
+});
+
View
67 ...locks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/PartialLink.js
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+dojo.provide("cocoon.ajax.PartialLink");
+
+dojo.require("dojo.widget.DomWidget");
+dojo.require("dojo.io");
+dojo.require("cocoon.ajax.common");
+
+/**
+ * Dojo widget for links that partially update the page.
+ *
+ * @version $Id$
+ */
+
+cocoon.ajax.PartialLink = function() {
+ dojo.widget.DomWidget.call(this);
+};
+
+dojo.inherits(cocoon.ajax.PartialLink, dojo.widget.DomWidget);
+
+dojo.lang.extend(cocoon.ajax.PartialLink, {
+ // Properties
+ href: "",
+ target: "",
+
+ // Widget definition
+ widgetType: "PartialLink",
+ isContainer: true,
+
+ buildRendering: function(args, parserFragment, parentWidget) {
+
+ // Magical statement to get the dom node, stolen in DomWidget
+ this.domNode = parserFragment["dojo:"+this.widgetType.toLowerCase()].nodeRef;
+
+ if (this.target.indexOf("#") < 0) {
+ dojo.debug("PartialLink: wrong value for 'target' attribute: " + this.target);
+ return;
+ }
+
+ dojo.event.connect(this.domNode, "onclick", this, "onClick");
+ },
+
+ onClick: function(event) {
+ event.preventDefault();
+ var _this = this;
+ cocoon.ajax.update(_this.href, _this.target);
+ }
+});
+
+dojo.widget.tags.addParseTreeHandler("dojo:PartialLink");
+// Register this module as a widget package
+dojo.widget.manager.registerWidgetPackage("cocoon.ajax");
+
View
23 ...locks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/__package__.js
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+dojo.kwCompoundRequire({
+ common: [
+ "cocoon.ajax.BUHandler"
+ ]
+});
+
+dojo.provide("cocoon.ajax.*");
View
79 ...n-2/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/common.js
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+
+/**
+ * Frequently used Ajax functions
+ */
+
+dojo.provide("cocoon.ajax");
+dojo.provide("cocoon.ajax.common");
+dojo.require("cocoon.ajax.insertion");
+
+dojo.lang.mixin(cocoon.ajax, {
+ /**
+ * Update the current page with some remote content.
+ * @param href the URL of the remote content
+ * @param target the update target. It can be either an element (DOM element or id), or
+ * a string in the "{insertion}#{target-id}" format (e.g. "bottom#event-list").
+ * @param insertion the insertion method (see cocoon.ajax.insertion), either a sa function
+ * or as a string. If the insertion is specified in target, that last one has
+ * precedence. If no insertion is speficied, it default to "inside".
+ */
+ update: function(href, target, insertion) {
+
+ // If target is a string, parse it. Otherwise, assume it's an element
+ if (dojo.lang.isString(target)) {
+ var split = target.split("#");
+ if (split.length == 2) {
+ insertion = split[0];
+ target = dojo.byId(split[1]);
+ } else {
+ target = dojo.byId(target);
+ }
+ }
+
+ if (dojo.lang.isString(insertion)) {
+ insertion = cocoon.ajax.insertion[insertion];
+ }
+
+ insertion = insertion || cocoon.ajax.insertion.inside;
+
+ dojo.io.bind({
+ url: href,
+ load: function(type, data, evt){
+ insertion(target, data);
+ },
+ mimetype: "text/plain"
+ // TODO: add an error-handling function
+ });
+
+ },
+
+ /**
+ */
+ periodicalUpdate: function(delay, href, target, insertion) {
+ dojo.require("dojo.animation.Timer");
+ var timer = new dojo.animation.Timer(delay);
+ timer.onTick = function() {
+ cocoon.ajax.update(href, target, insertion);
+ };
+
+ timer.onStart = timer.onTick;
+ timer.start();
+ return timer;
+ }
+});
View
258 .../blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/insertion.js
@@ -0,0 +1,258 @@
+/*
+ * 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.
+ */
+
+/**
+ * Implementation of Prototype's Insertion class with Dojo
+ *
+ * @version $Id$
+ */
+
+dojo.provide("cocoon.ajax.insertion");
+dojo.require("dojo.dom");
+
+cocoon.ajax.insertion = {};
+
+dojo.lang.mixin(cocoon.ajax.insertion, {
+
+ /**
+ * Inserts before the reference node
+ */
+ before: function (refElt, content) {
+ return cocoon.ajax.insertionHelper.insert(refElt, content, function(refElt, newElt) {
+ refElt.parentNode.insertBefore(newElt, refElt);
+ });
+ },
+
+ /**
+ * Inserts after the reference node
+ */
+ after: function (refElt, content) {
+ return cocoon.ajax.insertionHelper.insert(refElt, content, function(refElt, newElt) {
+ // There's no node.insertAfter...
+ if (refElt.nextSibling) {
+ refElt.parentNode.insertBefore(newElt, refElt.nextSibling);
+ } else {
+ refElt.parentNode.appendChild(newElt);
+ }
+ });
+ },
+
+ /**
+ * Inserts at the top of the reference node children (i.e. as the first child)
+ */
+ top: function (refElt, content) {
+ return cocoon.ajax.insertionHelper.insert(refElt, content, function(refElt, newElt) {
+ if (refElt.firstChild) {
+ refElt.insertBefore(newElt, refElt.firstChild);
+ } else {
+ refElt.appendChild(newElt);
+ }
+ })
+ },
+
+ /**
+ * Inserts at the bottom of the reference node children (i.e. as the last child)
+ */
+ bottom: function (refElt, content) {
+ return cocoon.ajax.insertionHelper.insert(refElt, content, function(refElt, newElt) {
+ refElt.appendChild(newElt);
+ })
+ },
+
+ /**
+ * Inserts as the contents of the reference node (i.e. replaces all children)
+ */
+ inside: function (refElt, content) {
+ return cocoon.ajax.insertionHelper.insert(refElt, content, function(refElt, newElt) {
+ // Destroy and remove all children
+ while (refElt.hasChildNodes()) {
+ var firstChild = refElt.firstChild;
+ if (firstChild.nodeType == dojo.dom.ELEMENT_NODE) {
+ cocoon.ajax.insertionHelper.destroy(firstChild);
+ }
+ refElt.removeChild(firstChild);
+ }
+
+ // Insert the new one
+ refElt.appendChild(newElt);
+ })
+ },
+
+ /**
+ * Replaces the reference element
+ */
+ replace: function (refElt, content) {
+ return cocoon.ajax.insertionHelper.insert(refElt, content, function(refElt, newElt) {
+ refElt.parentNode.replaceChild(newElt, refElt);
+ cocoon.ajax.insertionHelper.destroy(refElt);
+ })
+ }
+});
+
+cocoon.ajax.insertionHelper = {};
+
+dojo.lang.mixin(cocoon.ajax.insertionHelper, {
+ /**
+ * Imports an element into a document, taking care of using the correct implementation
+ * so that the browser interprets it as displayable XML.
+ *
+ * Any <script> in the imported node are collected and for post-import evaluation
+ * FIXME: only inline script are considered, but not <script src="">
+ *
+ * @return { element: <em>imported_element</em>, scripts: <em>array_of_script_text</em> }
+ */
+ importNode: function(node, targetDoc) {
+ if(node.xml || dojo.lang.isString(node)) {
+ // IE or text
+ var text = dojo.lang.isString(node) ? node : node.xml;
+ var div = targetDoc.createElement("DIV");
+
+ // Code below heavily inspired by the Prototype library
+ var scriptExpr = "(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)";
+ var textWithoutScripts = text.replace(new RegExp(scriptExpr, 'img'), '');
+
+ // Internet Explorer can't handle empty <textarea .../> elements, so replace
+ // them with <textarea></textarea>
+ var textareaExpr = "(<textarea[^<]*)\/>";
+ var textAreaMatches = textWithoutScripts.match(textareaExpr);
+ var textFixed = textWithoutScripts.replace(new RegExp(textareaExpr, 'img'), "$1></textarea>");
+
+ // Update screen with removed scripts
+ div.innerHTML = textFixed;
+
+ var matchAll = new RegExp(scriptExpr, 'img');
+ var matchOne = new RegExp(scriptExpr, 'im');
+ var allMatches = text.match(matchAll);
+ var scripts = new Array();
+ if (allMatches) {
+ for (var i = 0; i < allMatches.length; i++) {
+ scripts.push(allMatches[i].match(matchOne)[1]);
+ }
+ }
+ return { element: dojo.dom.getFirstChildElement(div), scripts: scripts };
+
+ } else {
+ var scripts = new Array();
+ var element = this._importDomNode(node, targetDoc, scripts);
+ return { element: element, scripts: scripts }
+ }
+ },
+
+ /**
+ * DOM implementation of importNode, recursively creating nodes.
+ * Scripts are collected in the "scripts" parameter
+ */
+ _importDomNode: function(node, targetDoc, scripts) {
+ switch(node.nodeType) {
+ case dojo.dom.ELEMENT_NODE:
+ if (node.nodeName.toLowerCase() == "script") {
+ // Collect scripts
+ scripts.push(node.firstChild && node.firstChild.nodeValue);
+ return;
+ }
+ var element = targetDoc.createElement(node.nodeName);
+ //var element = targetDoc.createElementNS(node.namespaceURI, node.nodeName);
+ var attrs = node.attributes;
+ for (var i = 0; i < attrs.length; i++) {
+ var attr = attrs[i];
+ element.setAttribute(attr.nodeName, attr.nodeValue);
+ //element.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.nodeValue);
+ }
+ var children = node.childNodes;
+ for (var j = 0; j < children.length; j++) {
+ var imported = this._importDomNode(children[j], targetDoc, scripts);
+ if (imported) element.appendChild(imported);
+ }
+ return element;
+ break;
+
+ case dojo.dom.TEXT_NODE:
+ return targetDoc.createTextNode(node.nodeValue);
+ break;
+
+ case dojo.dom.CDATA_SECTION_NODE:
+ return targetDoc.createTextNode(node.nodeValue);
+ break;
+ }
+ },
+
+ _runScripts: function(imported) {
+ // Evaluate scripts
+ for (var i = 0; i < imported.scripts.length; i++) {
+ eval(imported.scripts[i]);
+ }
+ },
+
+ insert: function(refElt, content, insertFunc) {
+ refElt = dojo.byId(refElt, content);
+ var imports = this.importNode(content, refElt.ownerDocument);
+ insertFunc(refElt, imports.element);
+ this._runScripts(imports);
+ return this.parseDojoWidgets(imports.element);
+ },
+
+ destroy: function(element) {
+ var widget = dojo.widget.byNode(element);
+ if (widget) {
+ // Dojo will destroy all its children
+ widget.destroy(true, true);
+ } else {
+ // Recurse until we eventually find a widget
+ var children = element.childNodes;
+ for (var i = 0; i < children.length; i++) {
+ var child = children[i];
+ if (child.nodeType == dojo.dom.ELEMENT_NODE) {
+ this.destroy(child);
+ }
+ }
+ }
+ },
+
+ parseDojoWidgets: function(element) {
+ // Find a parent widget (if any) so that Dojo can maintain its widget tree
+ var parentWidget = this.findParentWidget(element);
+ var parser = new dojo.xml.Parse();
+
+ // FIXME: parser.parseElement() parses the _children_ of an element, whereas we want here
+ // the element itself to be parsed. Parsing its parent is not an option as we don't want
+ // to parse the siblings. So place it in a temporary div that we'll trash afterwards.
+ var div = document.createElement("DIV");
+ element.parentNode.replaceChild(div, element);
+ div.appendChild(element);
+ var frag = parser.parseElement(div, null, true);
+ dojo.widget.getParser().createComponents(frag, parentWidget);
+ // Get again the first child of the div, which may no more be the original one
+ // if it's a widget
+ element = div.firstChild;
+ div.parentNode.replaceChild(element, div);
+ parentWidget && parentWidget.onResized();
+
+ return element;
+ },
+
+ findParentWidget: function(element) {
+ var parent = element.parentNode;
+ var widget;
+ while (parent && !widget) {
+ var widget = dojo.widget.byNode(parent);
+ if (widget) {
+ return widget;
+ }
+ parent = parent.parentNode;
+ }
+ }
+});
View
189 ...ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/macros/timedbrowserupdater.xml
@@ -0,0 +1,189 @@
+<?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
+ 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.
+-->
+<!--
+ @version $Id$
+-->
+
+<!-- An implementation of the TimedBrowserUpdate template engine as a JXTemplate tag library -->
+
+ <!--+ Usage Instructions
+ +
+ + The purpose of this Macro is to make regions in a webpage
+ + that update themselves periodically without user interaction.
+ + This is implemented using AJAX techniques taken from CForms.
+ +
+ + 1. Import this macro into your JXTemplate :
+ +
+ + <jx:import uri="resource://org/apache/cocoon/ajax/resources/macros/timedbrowserupdater.xml"/>
+ +
+ + 2. Use the tags in your page where you want auto-updating to occur :
+ +
+ + <tbu:replace id="element.id" state="${change.value}">
+ + <td id="element.id">
+ + Your value is: <b>${change.value}</b>
+ + </td>
+ + </tbu:replace>
+ +
+ + Where:
+ + "element.id" is an id that is unique to your page
+ + "change.value" is the value that you are primarilily interested in tracking
+ + i.e. the update is only made if this value changes.
+ +
+ + Note: The id attribute of both the <tbu:replace> and the child of <tbu:replace>
+ + would normally be the same as this indicates that this is the element being replaced.
+ + Only the first child of <tbu:replace> is used.
+ +
+ + 3. Add the BrowserUpdateTransformer to your pipeline, after the JXTGenerator.
+ +
+ + <map:transform type="browser-update"/>
+ +
+ + 4. Have your page load the JavaScript.
+ +
+ + <script type="text/javascript" src="resources/ajax/js/cocoon-ajax.js"/>
+ + <script type="text/javascript" src="resources/ajax/js/timedbrowserupdater.js"/>
+ +
+ + 5. Effect
+ +
+ + When the page is first loaded, it will display all of it's content normally,
+ + including the content of the <tbu:replace> tags.
+ + Thereafter, every 5 minutes, the regions inside <tbu:replace> tags will
+ + automatically update, having retrieved any changed values via an XMLHTTPRequest
+ + in the background, to the same URI as the page.
+ +
+ + 6. Console
+ +
+ + There is an optional sample console to control TimedBrowserUpdate.
+ +
+ + <tbu:console i18nCatalogue="catalogue.name"/>
+ +
+ + This outputs a simple form to control the Updater.
+ + It is not designed to be placed on the page more than once.
+ +
+ + You need to supply the name of an i18n Catalogue that contain terms used by the console
+ + and you need to ensure that the I18nTransformer is in your pipeline.
+ +
+ + The Console used these i18n keys :
+ +
+ + tbu.name.title the label in the console
+ + tbu.name.hint the hint of the console
+ + tbu.delay.title the label of the delay control
+ + tbu.delay.hint the hint of the delay control
+ + tbu.delay.30 delay for 300 secs
+ + tbu.delay.60 delay for 60 secs
+ + tbu.delay.120 delay for 120 secs
+ + tbu.delay.300 delay for 300 secs
+ + tbu.delay.600 delay for 600 secs
+ + tbu.isrunning.title button text for running state
+ + tbu.isrunning.hint button hint for running state
+ + tbu.notrunning.title button text for not running state
+ + tbu.notrunning.hint button hint for not running state
+ +
+ +-->
+
+
+
+<jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+ xmlns:bu="http://apache.org/cocoon/browser-update/1.0"
+ xmlns:tbu="http://apache.org/cocoon/timed-browser-update/1.0"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+
+ <jx:macro name="replace" targetNamespace="http://apache.org/cocoon/timed-browser-update/1.0">
+ <jx:parameter name="id"/>
+ <jx:parameter name="state"/>
+ <jx:choose>
+ <jx:when test="${cocoon.request.getParameter('cocoon-ajax') == 'true' &amp;&amp; cocoon.request.getParameter(id) != state}">
+ <bu:replace id="${id}" state="${state}">
+ <jx:evalBody/>
+ </bu:replace>
+ </jx:when>
+ <jx:otherwise>
+ <script type="text/javascript">
+ TimedBrowserUpdaterInstance.registerWidget("${id}","${state}");
+ </script>
+ <jx:evalBody/>
+ </jx:otherwise>
+ </jx:choose>
+ </jx:macro>
+
+
+ <jx:macro name="console" targetNamespace="http://apache.org/cocoon/timed-browser-update/1.0">
+ <jx:parameter name="i18nCatalogue"/>
+
+ <form id="tbuconsole" name="tbuconsole">
+ <table class="tbuConsole" title="${i18nCatalogue}:tbu.name.hint" i18n:attr="title">
+ <tr>
+ <th class="tbuName">
+ <i18n:text i18n:catalogue="${i18nCatalogue}">tbu.name.title</i18n:text>
+ </th>
+ <td class="tbuRunning">
+ <input id="tbuToggleRunButton"
+ type="button"
+ title=""
+ value=""
+ onClick="TimedBrowserConsole.toggleTimer();"
+ tabindex="32000"
+ />
+ </td>
+ </tr>
+ <tr>
+ <th class="tbuFrequencyTitle">
+ <i18n:text i18n:catalogue="${i18nCatalogue}">tbu.frequency.title</i18n:text>
+ </th>
+ <td class="tbuFrequency">
+ <select id="tbuFrequencySelector"
+ size="1"
+ onchange="TimedBrowserConsole.setFrequency();"
+ title="${i18nCatalogue}:tbu.frequency.hint"
+ i18n:attr="title"
+ tabindex="32001"
+ >
+ <option value="30"><i18n:text i18n:catalogue="${i18nCatalogue}">tbu.frequency.30</i18n:text></option>
+ <option value="60"><i18n:text i18n:catalogue="${i18nCatalogue}">tbu.frequency.60</i18n:text></option>
+ <option value="120"><i18n:text i18n:catalogue="${i18nCatalogue}">tbu.frequency.120</i18n:text></option>
+ <option value="300"><i18n:text i18n:catalogue="${i18nCatalogue}">tbu.frequency.300</i18n:text></option>
+ <option value="600"><i18n:text i18n:catalogue="${i18nCatalogue}">tbu.frequency.600</i18n:text></option>
+ </select>
+ </td>
+ </tr>
+ <!-- uncomment this row to see the debug console -->
+ <!--<tr>
+ <th align="top">console</th>
+ <td class="tbuDebugConsole">
+ <textarea id="tbuConsole" rows="10" cols="40"></textarea>
+ </td>
+ </tr>-->
+ </table>
+ </form>
+ <script language="Javascript">
+ TimedBrowserConsole = new Cocoon.Ajax.TimedBrowserUpdater.Console (
+ TimedBrowserUpdaterInstance,
+ {
+ frequencyControl: $("tbuFrequencySelector"),
+ toggleControl: $("tbuToggleRunButton"),
+ console: $("tbuDebugConsole"),
+ isRunningTitle: "<i18n:text i18n:catalogue="${i18nCatalogue}">tbu.isrunning.title</i18n:text>",
+ notRunningTitle: "<i18n:text i18n:catalogue="${i18nCatalogue}">tbu.notrunning.title</i18n:text>",
+ isRunningHint: "<i18n:text i18n:catalogue="${i18nCatalogue}">tbu.isrunning.hint</i18n:text>",
+ notRunningHint: "<i18n:text i18n:catalogue="${i18nCatalogue}">tbu.notrunning.hint</i18n:text>"
+ }
+ )
+ </script>
+ </jx:macro>
+
+
+</jx:template>
View
79 ...s/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/xslt/ajax-styling.xsl
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:bu="http://apache.org/cocoon/browser-update/1.0"
+ xmlns:xl="http://www.w3.org/1999/xlink"
+ >
+
+
+ <!-- first version of tag -->
+
+ <xsl:template match="a[@bu:target]">
+ <xsl:variable name="loc" select="generate-id()"/>
+ <xsl:variable name="verb" select="substring-before(@bu:target,'#')"/>
+ <xsl:variable name="id" select="substring-after(@bu:target,'#')"/>
+ <xsl:variable name="params" select="substring-after(@href,'?')"/>
+ <xsl:variable name="url">
+ <xsl:choose>
+ <xsl:when test="$params != ''"><xsl:value-of select="substring-before(@href,'?')"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="@href"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="insertion">
+ <xsl:choose>
+ <xsl:when test="$verb = 'insert-before'">Insertion.Before</xsl:when>
+ <xsl:when test="$verb = 'insert-after'">Insertion.After</xsl:when>
+ <xsl:when test="$verb = 'insert-top'">Insertion.Top</xsl:when>
+ <xsl:when test="$verb = 'insert-bottom'">Insertion.Bottom</xsl:when>
+ <xsl:otherwise>Cocoon.Ajax.Insertion.Replace</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="effect-target">
+ <xsl:choose>
+ <xsl:when test="$verb = 'insert-before'">.previousSibling</xsl:when>
+ <xsl:when test="$verb = 'insert-after'">.nextSibling</xsl:when>
+ <xsl:when test="$verb = 'insert-top'">.firstChild</xsl:when>
+ <xsl:when test="$verb = 'insert-bottom'">.lastChild</xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <script type="text/javascript">
+ function ajax<xsl:value-of select="$loc"/>() {
+ var up = new Ajax.Updater(
+ {success: "<xsl:value-of select="$id"/>"},
+ "<xsl:value-of select="$url"/>",
+ {
+ parameters: "<xsl:value-of select="$params"/>",
+ onFailure: Cocoon.Ajax.BrowserUpdater.handleError,
+ onComplete: function(request) { new Effect.Highlight($("<xsl:value-of select="$id"/>")<xsl:value-of select="$effect-target"/>); },
+ insertion: <xsl:value-of select="$insertion"/>
+ }
+ );
+ }
+ </script>
+ <a href="#" onclick="{concat('ajax',$loc,'();')}" title="{@title}"><xsl:apply-templates/></a>
+ </xsl:template>
+
+
+ <!-- Catches all unrecognised elements as they are-->
+ <xsl:template match="*|@*|node()|text()" priority="-1">
+ <xsl:copy><xsl:apply-templates select="*|@*|node()|text()"/></xsl:copy>
+ </xsl:template>