Permalink
Browse files

Update modules to new structure, lift-* suffix finally gone

  • Loading branch information...
1 parent 065ae99 commit 20e009ed7e5ecbf1ff229d105e5a69920f80c63b @indrajitr indrajitr committed Feb 5, 2011
Showing with 0 additions and 4,262 deletions.
  1. 0 {lift-amqp → amqp}/pom.xml
  2. 0 {lift-amqp → amqp}/src/main/scala/net/liftweb/amqp/AMQPDispatcher.scala
  3. 0 {lift-amqp → amqp}/src/main/scala/net/liftweb/amqp/AMQPSender.scala
  4. 0 {lift-amqp → amqp}/src/packageLinkDefs.properties
  5. 0 {lift-xmpp → amqp}/src/site/site.xml
  6. 0 {lift-facebook → facebook}/pom.xml
  7. 0 {lift-facebook → facebook}/src/main/scala/net/liftweb/ext_api/facebook/Facebook.scala
  8. 0 {lift-facebook → facebook}/src/main/scala/net/liftweb/ext_api/facebook/FacebookConnect.scala
  9. 0 {lift-facebook → facebook}/src/main/scala/net/liftweb/ext_api/facebook/FacebookRestApi.scala
  10. 0 {lift-wiring → facebook}/src/packageLinkDefs.properties
  11. 0 {lift-wizard → facebook}/src/site/site.xml
  12. 0 {lift-imaging → imaging}/pom.xml
  13. 0 {lift-imaging → imaging}/src/main/scala/net/liftweb/imaging/ImageHelpers.scala
  14. 0 {lift-imaging → imaging}/src/main/scala/net/liftweb/imaging/ImageResizer.scala
  15. 0 {lift-oauth → imaging}/src/site/site.xml
  16. 0 {lift-imaging → imaging}/src/test/scala/net/liftweb/imaging/ImageResizerSpec.scala
  17. 0 {lift-jta → jta}/README.textile
  18. 0 {lift-jta → jta}/pom.xml
  19. 0 {lift-jta → jta}/src/main/resources/jta.properties
  20. 0 {lift-jta → jta}/src/main/resources/persistence.xml
  21. 0 {lift-jta → jta}/src/main/scala/net/liftweb/transaction/EntityManagerSynchronization.scala
  22. 0 {lift-jta → jta}/src/main/scala/net/liftweb/transaction/TransactionContext.scala
  23. 0 {lift-jta → jta}/src/main/scala/net/liftweb/transaction/TransactionService.scala
  24. 0 {lift-jta → jta}/src/main/scala/net/liftweb/transaction/atomikos/AtomikosTransactionService.scala
  25. 0 {lift-jta → jta}/src/main/scala/net/liftweb/transaction/hibernate/LiftTransactionManagerLookup.scala
  26. 0 {lift-jta → jta}/src/packageLinkDefs.properties
  27. 0 {lift-wiring → jta}/src/site/site.xml
  28. 0 {lift-jta → jta}/src/test/scala/TransactionMonadSpec.scala
  29. +0 −24 lift-amqp/src/site/site.xml
  30. +0 −3 lift-facebook/src/packageLinkDefs.properties
  31. +0 −24 lift-facebook/src/site/site.xml
  32. +0 −24 lift-jta/src/site/site.xml
  33. +0 −1 lift-ldap/.gitignore
  34. +0 −31 lift-ldap/README
  35. +0 −112 lift-ldap/pom.xml
  36. +0 −452 lift-ldap/src/main/scala/net/liftweb/ldap/LDAP.scala
  37. +0 −205 lift-ldap/src/main/scala/net/liftweb/ldap/LDAPProtoUser.scala
  38. +0 −8 lift-ldap/src/packageLinkDefs.properties
  39. +0 −24 lift-ldap/src/site/site.xml
  40. +0 −5 lift-ldap/src/test/resources/ldap.properties
  41. +0 −13 lift-ldap/src/test/resources/logback-test.xml
  42. +0 −24 lift-ldap/src/test/scala/LDAPTest.scala
  43. +0 −152 lift-ldap/src/test/scala/net/liftweb/ldap/LdapSpec.scala
  44. 0 lift-oauth-mapper/src/main/scala/net/liftweb/oauth/.keep
  45. +0 −88 lift-testkit/pom.xml
  46. +0 −957 lift-testkit/src/main/scala/net/liftweb/http/testing/TestFramework.scala
  47. +0 −207 lift-testkit/src/main/scala/net/liftweb/http/testing/TestRunner.scala
  48. +0 −537 lift-testkit/src/main/scala/net/liftweb/mocks/MockHttpServletRequest.scala
  49. +0 −142 lift-testkit/src/main/scala/net/liftweb/mocks/MockHttpServletResponse.scala
  50. +0 −191 lift-testkit/src/main/scala/net/liftweb/mocks/MockServletContext.scala
  51. +0 −3 lift-testkit/src/packageLinkDefs.properties
  52. +0 −77 lift-testkit/src/test/scala/net/liftweb/http/testing/MockHttpRequestSpec.scala
  53. +0 −69 lift-testkit/src/test/scala/net/liftweb/http/testing/TestObjects.scala
  54. +0 −67 lift-wiring/pom.xml
  55. +0 −93 lift-wizard/pom.xml
  56. +0 −558 lift-wizard/src/main/scala/net/liftweb/wizard/Wizard.scala
  57. +0 −5 lift-wizard/src/packageLinkDefs.properties
  58. +0 −166 lift-wizard/src/test/scala/net/liftweb/wizard/WizardTest.scala
  59. 0 {lift-machine → machine}/pom.xml
  60. 0 {lift-machine → machine}/src/main/scala/net/liftweb/machine/ProtoStateMachine.scala
  61. 0 {lift-machine → machine}/src/packageLinkDefs.properties
  62. 0 {lift-widgets → machine}/src/site/site.xml
  63. 0 {lift-machine → machine}/src/test/scala/bootstrap/liftweb/Boot.scala
  64. 0 {lift-oauth-mapper → oauth-mapper}/pom.xml
  65. 0 ...t-wiring/src/main/scala/net/liftweb/wiring → oauth-mapper/src/main/scala/net/liftweb/oauth}/.keep
  66. 0 {lift-oauth-mapper → oauth-mapper}/src/main/scala/net/liftweb/oauth/mapper/OAuthConsumer.scala
  67. 0 {lift-oauth-mapper → oauth-mapper}/src/main/scala/net/liftweb/oauth/mapper/OAuthNonce.scala
  68. 0 {lift-oauth-mapper → oauth-mapper}/src/main/scala/net/liftweb/oauth/mapper/OAuthToken.scala
  69. 0 {lift-oauth-mapper → oauth-mapper}/src/packageLinkDefs.properties
  70. 0 {lift-oauth-mapper → oauth-mapper}/src/site/site.xml
  71. 0 ...ets/src/main/resources/net/liftweb/widgets → oauth-mapper/src/test/scala/net/liftweb/oauth}/.keep
  72. 0 {lift-oauth → oauth}/pom.xml
  73. 0 {lift-oauth → oauth}/src/main/scala/net/liftweb/oauth/OAuth.scala
  74. 0 {lift-oauth → oauth}/src/main/scala/net/liftweb/oauth/OAuthAccessor.scala
  75. 0 {lift-oauth → oauth}/src/main/scala/net/liftweb/oauth/OAuthMessage.scala
  76. 0 {lift-oauth → oauth}/src/main/scala/net/liftweb/oauth/OAuthProblemException.scala
  77. 0 {lift-oauth → oauth}/src/main/scala/net/liftweb/oauth/OAuthSignatureMethod.scala
  78. 0 {lift-oauth → oauth}/src/main/scala/net/liftweb/oauth/OAuthTraits.scala
  79. 0 {lift-oauth → oauth}/src/main/scala/net/liftweb/oauth/OAuthValidator.scala
  80. 0 {lift-oauth → oauth}/src/packageLinkDefs.properties
  81. 0 {lift-imaging → oauth}/src/site/site.xml
  82. 0 {lift-openid/src/test/scala/net/liftweb/openid → oauth/src/test/scala/net/liftweb/oauth}/.keep
  83. 0 {lift-oauth → oauth}/src/test/scala/net/liftweb/oauth/OAuthSignatureMethodSpec.scala
  84. 0 {lift-openid → openid}/pom.xml
  85. 0 {lift-openid → openid}/src/main/scala/net/liftweb/openid/Extensions.scala
  86. 0 {lift-openid → openid}/src/main/scala/net/liftweb/openid/OpenID.scala
  87. 0 {lift-openid → openid}/src/main/scala/net/liftweb/openid/OpenIDProtoUser.scala
  88. 0 {lift-openid → openid}/src/packageLinkDefs.properties
  89. 0 {lift-textile → openid}/src/site/site.xml
  90. 0 {lift-oauth/src/test/scala/net/liftweb/oauth → openid/src/test/scala/net/liftweb/openid}/.keep
  91. 0 {lift-openid → openid}/src/test/scala/net/liftweb/openid/RawHelperSpecs.scala
  92. 0 {lift-osgi → osgi}/pom.xml
  93. 0 {lift-osgi → osgi}/src/main/scala/net/liftweb/osgi/OsgiBootable.scala
  94. 0 {lift-osgi → osgi}/src/main/scala/net/liftweb/osgi/internal/Activator.scala
  95. 0 {lift-osgi → osgi}/src/packageLinkDefs.properties
  96. 0 {lift-testkit → osgi}/src/site/site.xml
  97. 0 {lift-paypal → paypal}/pom.xml
  98. 0 {lift-paypal → paypal}/src/main/resources/toserve/paypal/en_buynow_107x26.gif
  99. 0 {lift-paypal → paypal}/src/main/resources/toserve/paypal/en_buynow_68x23.gif
  100. 0 {lift-paypal → paypal}/src/main/resources/toserve/paypal/en_buynow_cards_122x47.gif
  101. 0 {lift-paypal → paypal}/src/main/resources/toserve/paypal/en_paynow_107x26.gif
  102. 0 {lift-paypal → paypal}/src/main/resources/toserve/paypal/en_paynow_cards_144x47.gif
  103. 0 {lift-paypal → paypal}/src/main/scala/net/liftweb/paypal/Paypal.scala
  104. 0 {lift-paypal → paypal}/src/main/scala/net/liftweb/paypal/Rules.scala
  105. 0 {lift-paypal → paypal}/src/main/scala/net/liftweb/paypal/snippet/BuyNow.scala
  106. 0 {lift-paypal → paypal}/src/packageLinkDefs.properties
  107. 0 {lift-scalate/src/main → paypal/src}/site/site.xml
  108. 0 {lift-paypal → paypal}/src/test/scala/net/liftweb/paypal/PaypalIPNSpec.scala
  109. 0 {lift-scalate → scalate}/pom.xml
  110. 0 {lift-scalate → scalate}/src/main/scala/net/liftweb/scalate/LiftTemplateEngine.scala
  111. 0 {lift-scalate → scalate}/src/main/scala/net/liftweb/scalate/ScalateView.scala
  112. 0 {lift-paypal/src → scalate/src/main}/site/site.xml
  113. 0 {lift-textile → textile}/pom.xml
  114. 0 {lift-textile → textile}/src/main/scala/net/liftweb/textile/TextileParser.scala
  115. 0 {lift-osgi → textile}/src/site/site.xml
  116. 0 {lift-textile → textile}/src/test/scala/net/lift/textile/TextileSpec.scala
  117. 0 {lift-widgets → widgets}/pom.xml
  118. 0 ...h-mapper/src/test/scala/net/liftweb/oauth → widgets/src/main/resources/net/liftweb/widgets}/.keep
  119. 0 {lift-widgets → widgets}/src/main/resources/toserve/autocomplete/indicator.gif
  120. 0 {lift-widgets → widgets}/src/main/resources/toserve/autocomplete/jquery.autocomplete.css
  121. 0 {lift-widgets → widgets}/src/main/resources/toserve/autocomplete/jquery.autocomplete.js
  122. 0 {lift-widgets → widgets}/src/main/resources/toserve/calendars/dayview/style.css
  123. 0 {lift-widgets → widgets}/src/main/resources/toserve/calendars/js/calendarviews.js
  124. 0 {lift-widgets → widgets}/src/main/resources/toserve/calendars/monthview/style.css
  125. 0 {lift-widgets → widgets}/src/main/resources/toserve/calendars/weekview/style.css
  126. 0 ...s/src/main/resources/toserve/menu → widgets/src/main/resources/toserve/common}/jquery.bgiframe.js
  127. 0 {lift-widgets → widgets}/src/main/resources/toserve/common/jquery.dimensions.js
  128. 0 {lift-widgets → widgets}/src/main/resources/toserve/common/jquery.tooltip.js
  129. 0 {lift-widgets → widgets}/src/main/resources/toserve/flot/excanvas.js
  130. 0 {lift-widgets → widgets}/src/main/resources/toserve/flot/jquery.flot.css
  131. 0 {lift-widgets → widgets}/src/main/resources/toserve/flot/jquery.flot.js
  132. 0 {lift-widgets → widgets}/src/main/resources/toserve/logchanger/logchanger.css
  133. 0 {lift-widgets → widgets}/src/main/resources/toserve/menu/images/arrows-ffffff.png
  134. 0 {lift-widgets → widgets}/src/main/resources/toserve/menu/images/shadow.png
  135. 0 ...s/src/main/resources/toserve/common → widgets/src/main/resources/toserve/menu}/jquery.bgiframe.js
  136. 0 {lift-widgets → widgets}/src/main/resources/toserve/menu/jquery.hoverIntent.js
  137. 0 {lift-widgets → widgets}/src/main/resources/toserve/menu/superfish-navbar.css
  138. 0 {lift-widgets → widgets}/src/main/resources/toserve/menu/superfish-vertical.css
  139. 0 {lift-widgets → widgets}/src/main/resources/toserve/menu/superfish.css
  140. 0 {lift-widgets → widgets}/src/main/resources/toserve/menu/superfish.js
  141. 0 {lift-widgets → widgets}/src/main/resources/toserve/menu/supersubs.js
  142. 0 {lift-widgets → widgets}/src/main/resources/toserve/sparklines/sparklines.min.js
  143. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/addons/pager/icons/first.png
  144. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/addons/pager/icons/last.png
  145. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/addons/pager/icons/next.png
  146. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/addons/pager/icons/prev.png
  147. 0 ...dgets → widgets}/src/main/resources/toserve/tablesorter/addons/pager/jquery.tablesorter.pager.css
  148. 0 ...idgets → widgets}/src/main/resources/toserve/tablesorter/addons/pager/jquery.tablesorter.pager.js
  149. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/jquery.tablesorter.js
  150. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/themes/blue/asc.gif
  151. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/themes/blue/bg.gif
  152. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/themes/blue/desc.gif
  153. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/themes/blue/style.css
  154. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/themes/green/asc.png
  155. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/themes/green/bg.png
  156. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/themes/green/desc.png
  157. 0 {lift-widgets → widgets}/src/main/resources/toserve/tablesorter/themes/green/style.css
  158. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/file.gif
  159. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/folder-closed.gif
  160. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/folder.gif
  161. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/minus.gif
  162. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/plus.gif
  163. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/spinner.gif
  164. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/treeview-black-line.gif
  165. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/treeview-black.gif
  166. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/treeview-default-line.gif
  167. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/treeview-default.gif
  168. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/treeview-famfamfam-line.gif
  169. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/treeview-famfamfam.gif
  170. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/treeview-gray-line.gif
  171. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/treeview-gray.gif
  172. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/treeview-red-line.gif
  173. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/images/treeview-red.gif
  174. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/jquery.treeview.async.js
  175. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/jquery.treeview.css
  176. 0 {lift-widgets → widgets}/src/main/resources/toserve/tree/jquery.treeview.js
  177. 0 {lift-widgets → widgets}/src/main/resources/toserve/uploadprogress/uploadprogress.js
  178. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/autocomplete/AutoComplete.scala
  179. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/calendars/CalendarDayView.scala
  180. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/calendars/CalendarItem.scala
  181. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/calendars/CalendarMonthView.scala
  182. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/calendars/CalendarUtils.scala
  183. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/calendars/CalendarWeekView.scala
  184. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/calendars/ViewMeta.scala
  185. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/flot/Flot.scala
  186. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/flot/FlotAjax.scala
  187. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/flot/FlotCapability.scala
  188. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/flot/FlotOptions.scala
  189. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/flot/FlotOverview.scala
  190. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/flot/FlotSerie.scala
  191. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/flot/FlotUtils.scala
  192. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/gravatar/Gravatar.scala
  193. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/logchanger/LogLevelChanger.scala
  194. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/menu/MenuWidget.scala
  195. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/rssfeed/RSSfeed.scala
  196. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/sparklines/SparklineStyle.scala
  197. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/sparklines/Sparklines.scala
  198. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/tablesorter/TableSorter.scala
  199. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/tree/TreeView.scala
  200. 0 {lift-widgets → widgets}/src/main/scala/net/liftweb/widgets/uploadprogress/UploadProgress.scala
  201. 0 {lift-widgets → widgets}/src/packageLinkDefs.properties
  202. 0 {lift-openid → widgets}/src/site/site.xml
  203. 0 {lift-widgets → widgets}/src/test/scala/bootstrap/liftweb/Boot.scala
  204. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/AutoCompleteDemo.scala
  205. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/CalendarDayViewDemo.scala
  206. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/CalendarMonthViewDemo.scala
  207. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/CalendarWeekViewDemo.scala
  208. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/GravatarDemo.scala
  209. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/MenuSnippet.scala
  210. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/RSSFeedDemo.scala
  211. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/SparklinesDemo.scala
  212. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/TableSorterDemo.scala
  213. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/TreeViewDemo.scala
  214. 0 {lift-widgets → widgets}/src/test/scala/webapptest/snippet/UploadProgressDemo.scala
  215. 0 {lift-widgets → widgets}/src/test/webapp/WEB-INF/web.xml
  216. 0 {lift-widgets → widgets}/src/test/webapp/anothermenu1.html
  217. 0 {lift-widgets → widgets}/src/test/webapp/anothermenu2.html
  218. 0 {lift-widgets → widgets}/src/test/webapp/autocomplete.html
  219. 0 {lift-widgets → widgets}/src/test/webapp/calday.html
  220. 0 {lift-widgets → widgets}/src/test/webapp/calmonth.html
  221. 0 {lift-widgets → widgets}/src/test/webapp/calweek.html
  222. 0 {lift-widgets → widgets}/src/test/webapp/gravatar.html
  223. 0 {lift-widgets → widgets}/src/test/webapp/index.html
  224. 0 {lift-widgets → widgets}/src/test/webapp/rssfeed.html
  225. 0 {lift-widgets → widgets}/src/test/webapp/sparklines.html
  226. 0 {lift-widgets → widgets}/src/test/webapp/style/style.css
  227. 0 {lift-widgets → widgets}/src/test/webapp/submenu1.html
  228. 0 {lift-widgets → widgets}/src/test/webapp/submenu2.html
  229. 0 {lift-widgets → widgets}/src/test/webapp/submenu3.html
  230. 0 {lift-widgets → widgets}/src/test/webapp/templates-hidden/default.html
  231. 0 {lift-widgets → widgets}/src/test/webapp/tree.html
  232. 0 {lift-widgets → widgets}/src/test/webapp/uploadprogress.html
  233. 0 {lift-xmpp → xmpp}/pom.xml
  234. 0 {lift-xmpp → xmpp}/src/main/scala/net/liftweb/xmpp/XMPPDispatcher.scala
  235. 0 {lift-xmpp → xmpp}/src/packageLinkDefs.properties
  236. 0 {lift-machine → xmpp}/src/site/site.xml
View
0 lift-amqp/pom.xml → amqp/pom.xml
File renamed without changes.
View
0 ...ala/net/liftweb/amqp/AMQPDispatcher.scala → ...ala/net/liftweb/amqp/AMQPDispatcher.scala
File renamed without changes.
View
0 ...n/scala/net/liftweb/amqp/AMQPSender.scala → ...n/scala/net/liftweb/amqp/AMQPSender.scala
File renamed without changes.
View
0 lift-amqp/src/packageLinkDefs.properties → amqp/src/packageLinkDefs.properties
File renamed without changes.
View
0 lift-xmpp/src/site/site.xml → amqp/src/site/site.xml
File renamed without changes.
View
0 lift-facebook/pom.xml → facebook/pom.xml
File renamed without changes.
View
0 ...t/liftweb/ext_api/facebook/Facebook.scala → ...t/liftweb/ext_api/facebook/Facebook.scala
File renamed without changes.
View
0 ...eb/ext_api/facebook/FacebookConnect.scala → ...eb/ext_api/facebook/FacebookConnect.scala
File renamed without changes.
View
0 ...eb/ext_api/facebook/FacebookRestApi.scala → ...eb/ext_api/facebook/FacebookRestApi.scala
File renamed without changes.
View
0 lift-wiring/src/packageLinkDefs.properties → facebook/src/packageLinkDefs.properties
File renamed without changes.
View
0 lift-wizard/src/site/site.xml → facebook/src/site/site.xml
File renamed without changes.
View
0 lift-imaging/pom.xml → imaging/pom.xml
File renamed without changes.
View
0 ...la/net/liftweb/imaging/ImageHelpers.scala → ...la/net/liftweb/imaging/ImageHelpers.scala
File renamed without changes.
View
0 ...la/net/liftweb/imaging/ImageResizer.scala → ...la/net/liftweb/imaging/ImageResizer.scala
File renamed without changes.
View
0 lift-oauth/src/site/site.xml → imaging/src/site/site.xml
File renamed without changes.
View
0 ...et/liftweb/imaging/ImageResizerSpec.scala → ...et/liftweb/imaging/ImageResizerSpec.scala
File renamed without changes.
View
0 lift-jta/README.textile → jta/README.textile
File renamed without changes.
View
0 lift-jta/pom.xml → jta/pom.xml
File renamed without changes.
View
0 lift-jta/src/main/resources/jta.properties → jta/src/main/resources/jta.properties
File renamed without changes.
View
0 lift-jta/src/main/resources/persistence.xml → jta/src/main/resources/persistence.xml
File renamed without changes.
View
0 ...action/EntityManagerSynchronization.scala → ...action/EntityManagerSynchronization.scala
File renamed without changes.
View
0 ...tweb/transaction/TransactionContext.scala → ...tweb/transaction/TransactionContext.scala
File renamed without changes.
View
0 ...tweb/transaction/TransactionService.scala → ...tweb/transaction/TransactionService.scala
File renamed without changes.
View
0 ...atomikos/AtomikosTransactionService.scala → ...atomikos/AtomikosTransactionService.scala
File renamed without changes.
View
0 ...ernate/LiftTransactionManagerLookup.scala → ...ernate/LiftTransactionManagerLookup.scala
File renamed without changes.
View
0 lift-jta/src/packageLinkDefs.properties → jta/src/packageLinkDefs.properties
File renamed without changes.
View
0 lift-wiring/src/site/site.xml → jta/src/site/site.xml
File renamed without changes.
View
0 ...src/test/scala/TransactionMonadSpec.scala → ...src/test/scala/TransactionMonadSpec.scala
File renamed without changes.
View
24 lift-amqp/src/site/site.xml
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- ~ Copyright 2009-2010 WorldWide Conferencing, LLC
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/DECORATION/1.0.1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.1 http://maven.apache.org/xsd/decoration-1.0.1.xsd"
- name="${project.name}">
-
-</project>
View
3 lift-facebook/src/packageLinkDefs.properties
@@ -1,3 +0,0 @@
-net.liftweb.common=${vscaladoc.links.liftweb.baseurl}/lift-base/lift-common/${vscaladoc.links.liftweb.pathsufix}
-net.liftweb.util=${vscaladoc.links.liftweb.baseurl}/lift-base/lift-util/${vscaladoc.links.liftweb.pathsufix}
-net.liftweb.http=${vscaladoc.links.liftweb.baseurl}/lift-base/lift-webkit/${vscaladoc.links.liftweb.pathsufix}
View
24 lift-facebook/src/site/site.xml
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- ~ Copyright 2009-2010 WorldWide Conferencing, LLC
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/DECORATION/1.0.1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.1 http://maven.apache.org/xsd/decoration-1.0.1.xsd"
- name="${project.name}">
-
-</project>
View
24 lift-jta/src/site/site.xml
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- ~ Copyright 2009-2010 WorldWide Conferencing, LLC
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/DECORATION/1.0.1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.1 http://maven.apache.org/xsd/decoration-1.0.1.xsd"
- name="${project.name}">
-
-</project>
View
1 lift-ldap/.gitignore
@@ -1 +0,0 @@
-server-work/
View
31 lift-ldap/README
@@ -1,31 +0,0 @@
-This module provides a LDAPVendor class to perform search and bind operations against a LDAP Server,
-and a base class to authentificate LDAP users (using the LDAPVendor)
-
-1: SimpleLDAPVendor
-SimpleLDAPVendor extends LDAPVendor class and provides a simple and functional LDAPVendor,
-that only needs to provide a parameters var to define the LDAP Server properties .
-
-SimpleLDAPVendor.parameters = () => Map("ldap.url" -> "ldap://localhost",
- "ldap.base" -> "dc=company,dc=com",
- "ldap.userName" -> "cn=query,dc=company,dc=com",
- "ldap.password" -> "password")
-
-or
-
-SimpleLDAPVendor.parameters = () => SimpleLDAPVendor.parametersFromFile("/some/directory/ldap.properties")
-
-2: LDAPProtoUser
-Base class of LDAP users
-
- We can define :
-
- - loginErrorMessage = Message displayed when user auth failed, default = "Unable to login with : %s"
- - ldapUserSearch = LDAP search sentence to search user object using login and password, default = (uid=%s)
- - rolesSearchFilter = LDAP search filter to get the user roles, default value = (&(objectClass=groupOfNames)(member=%s))
- - rolesNameRegex = Regular expression to get the role name from his dn (maybe we should get object cn attribute or something ?)
-
-
- - We can override setRoles function if we want to define roles search manually
-
-
-
View
112 lift-ldap/pom.xml
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright 2008-2010 WorldWide Conferencing, LLC
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<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/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <!--
- ~ The Basics
- -->
- <parent>
- <groupId>net.liftweb</groupId>
- <artifactId>lift-modules_2.8.1</artifactId>
- <version>2.3-SNAPSHOT</version>
- </parent>
- <artifactId>lift-ldap_2.8.1</artifactId>
-
- <!--
- ~ More Project Information
- -->
- <name>Lift LDAP</name>
- <description>LDAP Integration module</description>
-
- <!--
- ~ Environment Settings
- -->
- <!-- <properties/> -->
-
- <!--
- ~ Dependency Settings
- -->
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>lift-mapper_${scala.version}</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.scala-tools.testing</groupId>
- <artifactId>specs_${scala.version}</artifactId>
- </dependency>
- <dependency>
- <groupId>org.scala-tools.testing</groupId>
- <artifactId>scalacheck_${scala.version}</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.directory.server</groupId>
- <artifactId>apacheds-core</artifactId>
- <version>1.5.5</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.directory.server</groupId>
- <artifactId>apacheds-server-integ</artifactId>
- <version>1.5.5</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.directory.server</groupId>
- <artifactId>apacheds-core-integ</artifactId>
- <version>1.5.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <!--
- ~ Build Settings
- -->
- <build>
- <plugins>
- <plugin>
- <!-- We want to delete the LDAP server work directory between builds -->
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>.</directory>
- <includes>
- <include>server-work</include>
- </includes>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <!--
- ~ Reporting Settings
- -->
- <!-- <reporting/> -->
-
-</project>
View
452 lift-ldap/src/main/scala/net/liftweb/ldap/LDAP.scala
@@ -1,452 +0,0 @@
-/*
- * Copyright 2010 WorldWide Conferencing, LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.liftweb {
-package ldap {
-
-import java.io.{InputStream, FileInputStream}
-import java.util.{Hashtable, Properties}
-
-import javax.naming.{AuthenticationException,CommunicationException,Context,NamingException}
-import javax.naming.directory.{Attributes, BasicAttributes, SearchControls}
-import javax.naming.ldap.{InitialLdapContext,LdapName}
-
-import scala.collection.mutable.ListBuffer
-import scala.collection.JavaConversions._
-
-import _root_.net.liftweb.util.{ControlHelpers,Props,SimpleInjector,ThreadGlobal}
-import _root_.net.liftweb.common.{Box,Empty,Full,Loggable}
-
-/**
- * A simple extension to LDAPVendor to provide configuration
- * methods. The class, parameters* methods and variable are now
- * deprecated in favor of the configure methods on LDAPVendor.
- * See LDAPVendor for more details.
- *
- * @see LDAPVendor
- */
-@deprecated("Instantiate directly from LDAPVendor")
-object SimpleLDAPVendor extends LDAPVendor {
- @deprecated("Use the configure(filename : String) method")
- def parametersFromFile(filename: String) : Map[String, String] = {
- val input = new FileInputStream(filename)
- val params = parametersFromStream(input)
- input.close()
- params
- }
-
- @deprecated("Use the configure(stream : InputStream method")
- def parametersFromStream(stream: InputStream) : Map[String, String] = {
- val p = new Properties()
- p.load(stream)
-
- propertiesToMap(p)
- }
-
- @deprecated("Use the configure() method")
- def setupFromBoot = configure()
-}
-
-/**
- * This class provides functionality to allow us to search and
- * bind (authenticate) a username from a ldap server.
- *
- * To configure the LDAP Vendor parameters, use one of the configure
- * methods to provide a Map of string parameters.
- *
- * The primary parameters (with defaults) are:
- * <ul>
- * <li>ldap.url - The LDAP Server url : "ldap://localhost"</li>
- * <li>ldap.base - The base DN from the LDAP Server : ""</li>
- * <li>ldap.userName - The LDAP user dn to perform search operations : ""</li>
- * <li>ldap.password - The LDAP user password : ""</li>
- * <li>ldap.authType - The schema to use for authentication : "simple"</li>
- * <li>ldap.initial_context_factory - the factory class to use for
- * initial contexts : "com.sun.jndi.ldap.LdapCtxFactory"</li>
- * <li>
- * </ul>
- *
- * Optionally, you can set the following parameters to control context testing
- * and reconnect attempts:
- *
- * <ul>
- * <li>lift-ldap.testLookup - A DN to attempt to look up to validate the
- * current context. Defaults to no testing</li>
- * <li>lift-ldap.retryInterval - How many milliseconds to wait between connection
- * attempts due to communications failures. Defaults to 5000</li>
- * <li>lift-ldap.maxRetries - The maxiumum number of attempts to make to set up
- * the context before aborting. Defaults to 6</li>
- * </ul>
- *
- * In addition to configuration via a Map or Properties file, fine-grained control
- * over behaviors can be specified via Inject values corresponding to each
- * of the properties.
- *
- * To use LDAPVendor, you can simply create an object extending it
- * and configure:
- *
- * <pre id="code" class="scala">
- * object myLdap extends LDAPVendor
- * myLdap.configure()
- * </pre>
- *
- */
-class LDAPVendor extends Loggable with SimpleInjector {
- // =========== Constants ===============
- final val KEY_URL = "ldap.url"
- final val KEY_BASE_DN = "ldap.base"
- final val KEY_USER = "ldap.userName"
- final val KEY_PASSWORD = "ldap.password"
- final val KEY_AUTHTYPE = "ldap.authType"
- final val KEY_FACTORY = "ldap.initial_context_factory"
- final val KEY_LOOKUP = "lift-ldap.testLookup"
- final val KEY_RETRY_INTERVAL = "lift-ldap.retryInterval"
- final val KEY_MAX_RETRIES = "lift-ldap.maxRetries"
-
- final val DEFAULT_URL = "ldap://localhost"
- final val DEFAULT_BASE_DN = ""
- final val DEFAULT_USER = ""
- final val DEFAULT_PASSWORD = ""
- final val DEFAULT_AUTHTYPE = "simple"
- final val DEFAULT_FACTORY = "com.sun.jndi.ldap.LdapCtxFactory"
- final val DEFAULT_LOOKUP = Empty
- final val DEFAULT_RETRY_INTERVAL = 5000
- final val DEFAULT_MAX_RETRIES = 6
-
- // =========== Configuration ===========
- @deprecated("Use the configure(...) methods")
- def parameters : () => Map[String,String] =
- if (internal_config.isEmpty) {
- () => null
- } else {
- () => internal_config
- }
-
- @deprecated("Use the configure(...) methods")
- def parameters_= (newParams : () => Map[String,String]) {
- internal_config = processConfig(newParams())
- }
-
- /**
- * Configure straight from the Props object. This allows
- * you to use Lift's run modes for different LDAP configuration.
- */
- def configure() {
- configure(Props.props)
- }
-
- /**
- * Configure from the given file. The file is expected
- * to be in a format parseable by java.util.Properties
- */
- def configure(filename : String) {
- val stream = new FileInputStream(filename)
- configure(stream)
- stream.close()
- }
-
- /**
- * Configure from the given input stream. The stream is expected
- * to be in a format parseable by java.util.Properties
- */
- def configure(stream : InputStream) {
- val p = new Properties()
- p.load(stream)
-
- configure(propertiesToMap(p))
- }
-
- /**
- * Configure from the given Map[String,String]
- */
- def configure(props : Map[String,String]) {
- internal_config = processConfig(props)
- }
-
- /**
- * This controls the URL used to connect to the LDAP
- * server
- */
- val ldapUrl = new Inject[String](DEFAULT_URL){}
-
- /**
- * This controls the base DN used for searcheds
- */
- val ldapBaseDn = new Inject[String](DEFAULT_BASE_DN){}
-
- /**
- * This controls the username used to bind for
- * searches (not authentication)
- */
- val ldapUser = new Inject[String](DEFAULT_USER){}
-
- /**
- * This controls the password used to bind for
- * searches (not authentication)
- */
- val ldapPassword = new Inject[String](DEFAULT_PASSWORD){}
-
- /**
- * This controls the type of authentication to
- * use.
- */
- val ldapAuthType = new Inject[String](DEFAULT_AUTHTYPE){}
-
- /**
- * This controls the factory used to obtain an
- * InitialContext
- */
- val ldapFactory = new Inject[String](DEFAULT_FACTORY){}
-
- /**
- * This can be set to test the InitialContext on each LDAP
- * operation. It should be set to a search DN.
- */
- val testLookup = new Inject[Box[String]](Empty){}
-
- /**
- * This sets the interval between connection attempts
- * on the InitialContext. The default is 5 seconds
- */
- val retryInterval = new Inject[Long](5000){}
-
- /**
- * This sets the maximum number of connection
- * attempts before giving up. The default is 6
- */
- val retryMaxCount = new Inject[Int](6){}
-
- /**
- * This sets the Directory SearchControls instance
- * that is used to refine searches on the provider.
- */
- val searchControls = new Inject[SearchControls](defaultSearchControls){}
-
- /**
- * The default SearchControls to use: search the
- * base DN with a sub-tree scope, and return the
- * "cn" attribute.
- */
- def defaultSearchControls() : SearchControls = {
- val constraints = new SearchControls()
- constraints.setSearchScope(SearchControls.SUBTREE_SCOPE)
- constraints.setReturningAttributes(Array("cn"))
- return constraints
- }
-
- /**
- * The configuration to use for connecting to the
- * provider. It should be set via the configure methods
- */
- private var internal_config : Map[String,String] = Map.empty
-
- /**
- * The configuration to use for connecting to the
- * provider. It should be set via the configure methods
- */
- def configuration = internal_config
-
- /**
- * This method checks the configuration and sets defaults for any
- * properties that are required. It also processes any of the
- * optional configuration propertes related to context testing
- * and retries.
- *
- * This method is intended to be called during update of the default
- * configuration, not during granular override of the config.
- */
- def processConfig(input : Map[String,String]) : Map[String,String] = {
- var currentConfig = input
-
- def setIfEmpty(name : String, newVal : String) =
- if (currentConfig.get(name).isEmpty) {
- currentConfig += (name -> newVal)
- }
-
- // Verify the minimum config
- setIfEmpty(KEY_URL, DEFAULT_URL)
- setIfEmpty(KEY_BASE_DN, DEFAULT_BASE_DN)
- setIfEmpty(KEY_USER, DEFAULT_USER)
- setIfEmpty(KEY_PASSWORD, DEFAULT_PASSWORD)
- setIfEmpty(KEY_AUTHTYPE, DEFAULT_AUTHTYPE)
- setIfEmpty(KEY_FACTORY, DEFAULT_FACTORY)
-
- // Set individual properties
- ldapUrl.default.set(currentConfig(KEY_URL))
- ldapBaseDn.default.set(currentConfig(KEY_BASE_DN))
- ldapUser.default.set(currentConfig(KEY_USER))
- ldapPassword.default.set(currentConfig(KEY_PASSWORD))
- ldapAuthType.default.set(currentConfig(KEY_AUTHTYPE))
- ldapFactory.default.set(currentConfig(KEY_FACTORY))
-
- // Process the optional configuration properties
- currentConfig.get(KEY_LOOKUP).foreach{
- prop => testLookup.default.set(Full(prop))
- }
-
- ControlHelpers.tryo {
- currentConfig.get(KEY_RETRY_INTERVAL).foreach{
- prop => retryInterval.default.set(prop.toLong)
- }
- }
-
- ControlHelpers.tryo {
- currentConfig.get(KEY_MAX_RETRIES).foreach{
- prop => retryMaxCount.default.set(prop.toInt)
- }
- }
-
- currentConfig
- }
-
- protected def propertiesToMap(props: Properties) : Map[String,String] = {
- Map.empty ++ props
- }
-
- // =========== Code ====================
-
- /**
- * Obtains a (possibly cached) InitialContext
- * instance based on the currently set parameters.
- */
- def initialContext = getInitialContext()
-
- def attributesFromDn(dn: String): Attributes =
- initialContext.getAttributes(dn)
-
- /**
- * Searches the base DN for entities matching the given filter.
- */
- def search(filter: String): List[String] = {
- logger.debug("Searching for '%s'".format(filter))
-
- val resultList = new ListBuffer[String]()
-
- val searchResults = initialContext.search(ldapBaseDn.vend,
- filter,
- searchControls.vend)
-
- while(searchResults.hasMore()) {
- resultList += searchResults.next().getName
- }
-
- return resultList.reverse.toList
- }
-
- /**
- * Attempts to authenticate the given DN against the configured
- * LDAP provider.
- */
- def bindUser(dn: String, password: String) : Boolean = {
- logger.debug("Attempting to bind user '%s'".format(dn))
-
- try {
- val username = dn + "," + ldapBaseDn.vend
- var ctx =
- ldapUser.doWith(username) {
- ldapPassword.doWith(password) {
- openInitialContext()
- }
- }
-
- ctx.close
-
- logger.info("Successfully authenticated " + dn)
- true
- } catch {
- case ae : AuthenticationException => {
- logger.warn("Authentication failed for '%s' : %s".format(dn, ae.getMessage))
- false
- }
- }
- }
-
- // This caches the context for the current thread
- private[this] final val currentInitialContext = new ThreadGlobal[InitialLdapContext]()
-
- /**
- * This method attempts to fetch the cached InitialLdapContext for the
- * current thread. If there isn't a current context, open a new one. If a
- * test DN is configured, the connection (cached or new) will be validated
- * by performing a lookup on the test DN.
- */
- protected def getInitialContext() : InitialLdapContext = {
- val maxAttempts = retryMaxCount.vend
- var attempts = 0
-
- var context : Box[InitialLdapContext] = Empty
-
- while (context.isEmpty && attempts < maxAttempts) {
- try {
- context = (currentInitialContext.box, testLookup.vend) match {
- // If we don't want to test an existing context, just return it
- case (Full(ctxt), Empty) => Full(ctxt)
- case (Full(ctxt), Full(test)) => {
- logger.debug("Testing InitialContext prior to returning")
- ctxt.lookup(test)
- Full(ctxt)
- }
- case (Empty,_) => {
- // We'll just allocate a new InitialContext to the thread
- currentInitialContext(openInitialContext())
-
- // Setting context to Empty here forces one more iteration in case a test
- // DN has been configured
- Empty
- }
- }
- } catch {
- case commE : CommunicationException => {
- logger.error(("Communications failure on attempt %d while " +
- "verifying InitialContext: %s").format(attempts + 1, commE.getMessage))
-
- // The current context failed, so clear it
- currentInitialContext(null)
-
- // We sleep before retrying
- Thread.sleep(retryInterval.vend)
- attempts += 1
- }
- }
- }
-
- // We have a final check on the context before returning
- context match {
- case Full(ctxt) => ctxt
- case Empty => throw new CommunicationException("Failed to connect to '%s' after %d attempts".
- format(ldapUrl.vend, attempts))
- }
- }
-
- /**
- * This method does the actual work of setting up the environment and constructing
- * the InitialLdapContext.
- */
- protected def openInitialContext () : InitialLdapContext = {
- logger.debug("Obtaining an initial context from '%s'".format(ldapUrl.vend))
-
- var env = new Hashtable[String, String]()
- env.put(Context.PROVIDER_URL, ldapUrl.vend)
- env.put(Context.SECURITY_AUTHENTICATION, ldapAuthType.vend)
- env.put(Context.SECURITY_PRINCIPAL, ldapUser.vend)
- env.put(Context.SECURITY_CREDENTIALS, ldapPassword.vend)
- env.put(Context.INITIAL_CONTEXT_FACTORY, ldapFactory.vend)
- new InitialLdapContext(env, null)
- }
-}
-
-}} // Close nested packages
-
View
205 lift-ldap/src/main/scala/net/liftweb/ldap/LDAPProtoUser.scala
@@ -1,205 +0,0 @@
-/*
- * Copyright 2010 WorldWide Conferencing, LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.liftweb {
-package ldap {
-
-import javax.naming.directory.{Attributes}
-import scala.util.matching.{Regex}
-import scala.xml.{Elem, NodeSeq}
-import net.liftweb.http.{LiftResponse, RedirectResponse, S, SessionVar}
-import net.liftweb.http.js.{JsCmds}
-import net.liftweb.mapper.{BaseOwnedMappedField,
- MappedString,
- MetaMegaProtoUser,
- MegaProtoUser}
-import net.liftweb.sitemap.{Menu}
-import net.liftweb.util.{Helpers}
-import net.liftweb.common.{Box, Empty, Full}
-
-import Helpers._
-
-import scala.util.matching.{Regex}
-import scala.xml.{Elem, NodeSeq}
-
-trait MetaLDAPProtoUser[ModelType <: LDAPProtoUser[ModelType]] extends MetaMegaProtoUser[ModelType] {
- self: ModelType =>
-
- override def signupFields: List[FieldPointerType] = uid ::
- cn :: dn :: Nil
-
- override def fieldOrder: List[FieldPointerType] = uid ::
- cn :: dn :: Nil
-
- /**
- * The menu item for creating the user/sign up (make this "Empty" to disable)
- */
- override def createUserMenuLoc: Box[Menu] = Empty
-
- /**
- * The menu item for lost password (make this "Empty" to disable)
- */
- override def lostPasswordMenuLoc: Box[Menu] = Empty
-
- /**
- * The menu item for resetting the password (make this "Empty" to disable)
- */
- override def resetPasswordMenuLoc: Box[Menu] = Empty
-
- /**
- * The menu item for changing password (make this "Empty" to disable)
- */
- override def changePasswordMenuLoc: Box[Menu] = Empty
-
- /**
- * The menu item for validating a user (make this "Empty" to disable)
- */
- override def validateUserMenuLoc: Box[Menu] = Empty
-
- override def editUserMenuLoc: Box[Menu] = Empty
-
- /**
- * User search sentence
- */
- def ldapUserSearch: String = "(uid=%s)"
-
- /**
- * Error messages
- */
- def loginErrorMessage: String = "Unable to login with : %s"
-
- def commonNameAttributeName = "cn"
- def uidAttributeName = "uid"
-
- override def loginXhtml : Elem = {
- <form method="post" action={S.uri}>
- <table>
- <tr>
- <td colspan="2">{S.??("log.in")}</td>
- </tr>
- <tr>
- <td>Username</td><td><user:name /></td>
- </tr>
- <tr>
- <td>Password</td><td><user:password /></td>
- </tr>
- <tr>
- <td>&nbsp;</td><td><user:submit /></td>
- </tr>
- </table>
- </form>
- }
-
- def ldapVendor: LDAPVendor = SimpleLDAPVendor
-
- override def login : NodeSeq = {
- if (S.post_?) {
- if (!ldapLogin(S.param("username").openOr(""),
- S.param("password").openOr("")))
- S.error(loginErrorMessage.format(S.param("username").openOr("")))
- }
-
- Helpers.bind("user", loginXhtml,
- "name" -> (JsCmds.FocusOnLoad(<input type="text" name="username"/>)),
- "password" -> (JsCmds.FocusOnLoad(<input type="password" name="password"/>)),
- "submit" -> (<input type="submit" value={S.??("log.in")}/>))
- }
-
- def ldapLogin(username: String, password: String): Boolean = {
- def _getUserAttributes(dn: String) = ldapVendor.attributesFromDn(dn)
-
- val users = ldapVendor.search(ldapUserSearch.format(username))
-
- if (users.size >= 1) {
- val userDn = users(0)
- if (ldapVendor.bindUser(userDn, password)) {
- val completeDn = userDn + "," + ldapVendor.parameters().get("ldap.base").getOrElse("")
- logUserIn(this)
-
- bindAttributes(_getUserAttributes(completeDn))
-
- setRoles(completeDn, ldapVendor)
- S.redirectTo(homePage)
- }
- else return false
- }
- else return false
-
- return true
- }
-
- def bindAttributes(attrs: Attributes) = {
- for {
- theCn <- Box !! attrs.get(commonNameAttributeName).get
- theUid <- Box !! attrs.get(uidAttributeName).get
- }
- {
- cn(theCn.toString)
- uid(theUid.toString)
- }
- }
-}
-
-trait LDAPProtoUser[T <: LDAPProtoUser[T]] extends MegaProtoUser[T] {
- self: T =>
- /**
- * User Roles LDAP search filter
- */
- def rolesSearchFilter: String = "(&(objectclass=groupofnames)(member=%s))"
-
- /**
- * Regular expression to get user roles names
- */
- def rolesNameRegex = ".*cn=(.[^,]*),ou=.*"
-
- object ldapRoles extends SessionVar[List[String]](List())
-
- override def getSingleton: MetaLDAPProtoUser[T]
-
- object uid extends MappedString(this, 64) {
- override def dbIndexed_? = true
- }
-
- object dn extends MappedString(this, 64) {
- override def dbIndexed_? = true
- }
-
- object cn extends MappedString(this, 64) {
- override def dbIndexed_? = true
- }
-
- def getRoles: List[String] = {
- return ldapRoles.get
- }
-
- def setRoles(userDn: String, ldapVendor: LDAPVendor) {
- def getGroupNameFromDn(dn: String): String = {
- val regex = new Regex(rolesNameRegex)
-
- val regex(groupName) = dn
- return groupName
- }
-
- // Search for user roles
- val filter = rolesSearchFilter.format(userDn)
-
- val groups = ldapVendor.search(filter)
- groups foreach { g => ldapRoles.set(ldapRoles.get :+ getGroupNameFromDn(g)) }
- }
-}
-
-}
-}
View
8 lift-ldap/src/packageLinkDefs.properties
@@ -1,8 +0,0 @@
-net.liftweb.common=${vscaladoc.links.liftweb.baseurl}/lift-base/lift-common/${vscaladoc.links.liftweb.pathsufix}
-net.liftweb.json=${vscaladoc.links.liftweb.baseurl}/lift-base/lift-json/${vscaladoc.links.liftweb.pathsufix}
-net.liftweb.util=${vscaladoc.links.liftweb.baseurl}/lift-base/lift-util/${vscaladoc.links.liftweb.pathsufix}
-net.liftweb.http=${vscaladoc.links.liftweb.baseurl}/lift-base/lift-webkit/${vscaladoc.links.liftweb.pathsufix}
-net.liftweb.http.js=${vscaladoc.links.liftweb.baseurl}/lift-base/lift-webkit/${vscaladoc.links.liftweb.pathsufix}
-net.liftweb.sitemap=${vscaladoc.links.liftweb.baseurl}/lift-base/lift-webkit/${vscaladoc.links.liftweb.pathsufix}
-net.liftweb.proto=${vscaladoc.links.liftweb.baseurl}/lift-persistence/lift-proto/${vscaladoc.links.liftweb.pathsufix}
-net.liftweb.mapper=${vscaladoc.links.liftweb.baseurl}/lift-persistence/lift-mapper/${vscaladoc.links.liftweb.pathsufix}
View
24 lift-ldap/src/site/site.xml
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- ~ Copyright 2009-2010 WorldWide Conferencing, LLC
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/DECORATION/1.0.1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.1 http://maven.apache.org/xsd/decoration-1.0.1.xsd"
- name="${project.name}">
-
-</project>
View
5 lift-ldap/src/test/resources/ldap.properties
@@ -1,5 +0,0 @@
-# LDAP
-ldap.url = ldap://localhost
-ldap.base = dc=sample_company,dc=com
-ldap.userName = cn=admin,dc=sample_company,dc=com
-ldap.password = password
View
13 lift-ldap/src/test/resources/logback-test.xml
@@ -1,13 +0,0 @@
-<configuration>
- <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
- <layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>%d [%thread] %level %logger - %m%n</Pattern>
- </layout>
- </appender>
-
- <logger name="org.apache.directory" level="INFO" />
-
- <root level="${logging-level:-INFO}">
- <appender-ref ref="CONSOLE"/>
- </root>
-</configuration>
View
24 lift-ldap/src/test/scala/LDAPTest.scala
@@ -1,24 +0,0 @@
-import junit.framework._;
-import Assert._;
-
-import net.liftweb.ldap.SimpleLDAPVendor
-
-object LDAPTest {
- def suite: Test = new TestSuite(classOf[LDAPTest])
-
- def main(args : Array[String]) = junit.textui.TestRunner.run(suite)
-}
-
-class LDAPTest extends TestCase("ldap") {
- def testParameters = {
- SimpleLDAPVendor.parameters = () => Map("ldap.url" -> "localhost")
-
- assertTrue(SimpleLDAPVendor.parameters().get("ldap.url") == Some("localhost"))
- }
-
- def testLoadParametersFile = {
- SimpleLDAPVendor.parameters = () => SimpleLDAPVendor.parametersFromFile("src/test/resources/ldap.properties")
-
- assertTrue(SimpleLDAPVendor.parameters().get("ldap.url") == Some("ldap://localhost"))
- }
-}
View
152 lift-ldap/src/test/scala/net/liftweb/ldap/LdapSpec.scala
@@ -1,152 +0,0 @@
-/*
- * Copyright 2010 WorldWide Conferencing, LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.liftweb {
-package ldap {
-
-import common.Full
-
-import _root_.org.specs._
-import _root_.org.specs.runner.JUnit3
-import _root_.org.specs.runner.ConsoleRunner
-
-import javax.naming.CommunicationException
-
-import org.apache.mina.util.AvailablePortFinder
-import org.apache.directory.server.core.DefaultDirectoryService
-import org.apache.directory.server.core.partition.impl.btree.jdbm.{JdbmIndex,JdbmPartition}
-import org.apache.directory.server.ldap.LdapServer
-import org.apache.directory.server.protocol.shared.transport.TcpTransport
-import org.apache.directory.server.xdbm.Index
-import org.apache.directory.server.core.entry.ServerEntry
-import org.apache.directory.shared.ldap.name.LdapDN
-
-class LdapSpecsAsTest extends JUnit3(LdapSpecs)
-object LdapSpecsRunner extends ConsoleRunner(LdapSpecs)
-
-object LdapSpecs extends Specification {
- val ROOT_DN = "dc=ldap,dc=liftweb,dc=net"
-
- // Thanks to Francois Armand for pointing this utility out!
- val service_port = AvailablePortFinder.getNextAvailable(40000)
- val service = new DefaultDirectoryService
- val ldap = new LdapServer
-
-
- /*
- * The following is taken from:
- * http://directory.apache.org/apacheds/1.5/41-embedding-apacheds-into-an-application.html
- * http://stackoverflow.com/questions/1560230/running-apache-ds-embedded-in-my-application
- */
- doBeforeSpec {
- try {
- // Disable changelog
- service.getChangeLog.setEnabled(false)
-
- // Set up a partition
- val partition = new JdbmPartition
- partition.setId("lift-ldap")
- partition.setSuffix(ROOT_DN)
- service.addPartition(partition)
-
- // Index attributes (gnarly type due to poor type inferencing)
- val indices : java.util.Set[Index[_,ServerEntry]] = new java.util.HashSet()
-
- List("objectClass", "ou", "uid", "sn").foreach {
- attr : String => indices.add(new JdbmIndex(attr))
- }
-
- partition.setIndexedAttributes(indices)
-
- // Set up the transport to use our "available" port
- ldap.setTransports(new TcpTransport(service_port))
- ldap.setDirectoryService(service)
-
- service.startup()
-
- // Inject the root entry if it does not already exist
- if ( !service.getAdminSession().exists(partition.getSuffixDn)) {
- println("Adding root entry")
- val rootEntry = service.newEntry(new LdapDN(ROOT_DN))
- rootEntry.add( "objectClass", "top", "domain", "extensibleObject" );
- rootEntry.add( "dc", "ldap" );
- service.getAdminSession().add( rootEntry );
- }
-
- addTestData()
-
- ldap.start()
-
- println("Started LDAP server on port " + service_port)
- } catch {
- case e => e.printStackTrace
- }
- }
-
- "LDAPVendor" should {
- shareVariables()
-
- object myLdap extends LDAPVendor
-
- myLdap.configure(Map("ldap.url" -> "ldap://localhost:%d/".format(service_port),
- "ldap.base" -> "dc=ldap,dc=liftweb,dc=net"))
-
- "handle simple lookups" in {
- myLdap.search("objectClass=person") must_== List("cn=Test User")
- }
-
- "handle simple authentication" in {
- myLdap.bindUser("cn=Test User", "letmein")
- }
-
- "attempt reconnects" in {
- object badLdap extends LDAPVendor
- badLdap.configure()
-
- // Make sure that we use a port where LDAP won't live
- badLdap.ldapUrl.doWith("ldap://localhost:2") {
- // Let's not make this spec *too* slow
- badLdap.retryInterval.doWith(1000) {
- badLdap.search("objectClass=person") must throwA[CommunicationException]
- }
- }
- }
- }
-
-
- doAfterSpec {
- ldap.stop()
- service.shutdown()
- println("Stopped server")
- }
-
- def addTestData() {
- val username = new LdapDN("cn=Test User," + ROOT_DN)
- if (! service.getAdminSession().exists(username)) {
- println("Adding test user")
- // Add a test user. This will be used for searching and binding
- val entry = service.newEntry(username)
- entry.add("objectClass", "person", "organizationalPerson")
- entry.add("cn", "Test User")
- entry.add("sn", "User")
- entry.add("userpassword", "letmein")
- service.getAdminSession.add(entry)
- }
- }
-}
-
-
-}} // Close nested packages
View
0 lift-oauth-mapper/src/main/scala/net/liftweb/oauth/.keep
No changes.
View
88 lift-testkit/pom.xml
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- ~ Copyright 2008-2010 WorldWide Conferencing, LLC
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<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/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <!--
- ~ The Basics
- -->
- <parent>
- <groupId>net.liftweb</groupId>
- <artifactId>lift-modules_2.8.1</artifactId>
- <version>2.3-SNAPSHOT</version>
- </parent>
- <artifactId>lift-testkit_2.8.1</artifactId>
-
- <!--
- ~ More Project Information
- -->
- <name>Lift TestKit</name>
- <description>Tool to help creating tests</description>
-
- <!--
- ~ Environment Settings
- -->
- <!-- <properties/> -->
-
- <!--
- ~ Dependency Settings
- -->
- <dependencies>
- <dependency>
- <!-- need net.liftweb.util -->
- <groupId>${project.groupId}</groupId>
- <artifactId>lift-util_${scala.version}</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.scala-tools.testing</groupId>
- <artifactId>specs_${scala.version}</artifactId>
- </dependency>
- <dependency>
- <groupId>org.scala-tools.testing</groupId>
- <artifactId>scalacheck_${scala.version}</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- </dependencies>
-
- <!--
- ~ Build Settings
- -->
- <!-- <build/> -->
-
- <!--
- ~ Reporting Settings
- -->
- <!-- <reporting/> -->
-
-</project>
View
957 lift-testkit/src/main/scala/net/liftweb/http/testing/TestFramework.scala
@@ -1,957 +0,0 @@
-/*
- * Copyright 2008-2010 WorldWide Conferencing, LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.liftweb {
-package http {
-package testing {
-
-import _root_.net.liftweb.util.Helpers._
-import _root_.net.liftweb.util._
-import _root_.net.liftweb.json._
-import JsonDSL._
-import _root_.net.liftweb.common._
-import _root_.scala.xml._
-import _root_.scala.xml.Utility.trim
-import _root_.java.util.{Map => JavaMap, Set => JavaSet, Iterator => JavaIterator, List => JavaList}
-import _root_.java.util.regex.Pattern
-import _root_.java.io.IOException
-import _root_.org.apache.commons.httpclient._
-import _root_.org.apache.commons.httpclient.cookie._
-import methods._
-import _root_.java.io.OutputStream
-import _root_.org.apache.commons.httpclient.auth.AuthScope
-
-trait ToResponse {
- self: BaseGetPoster =>
-
- type ResponseType = TestResponse
-
- implicit def responseCapture(fullUrl: String,
- httpClient: HttpClient,
- getter: HttpMethodBase): ResponseType = {
-
- val ret: ResponseType = try {
- (baseUrl + fullUrl, httpClient.executeMethod(getter)) match {
- case (server, responseCode) =>
- val respHeaders = slurpApacheHeaders(getter.getResponseHeaders)
-
- new HttpResponse(baseUrl,
- responseCode, getter.getStatusText,
- respHeaders,
- for {st <- Box !! getter.getResponseBodyAsStream
- bytes <- tryo(readWholeStream(st))
- } yield bytes,
- httpClient)
- }
- } catch {
- case e: IOException => new CompleteFailure(baseUrl + fullUrl, Full(e))
- } finally {
- getter.releaseConnection
- }
-
- ret
- }
-}
-
-trait ToBoxTheResponse {
- self: BaseGetPoster =>
-
- type ResponseType = Box[TheResponse]
-
-
- implicit def responseCapture(fullUrl: String,
- httpClient: HttpClient,
- getter: HttpMethodBase):
- Box[TheResponse] = {
-
- val ret = try {
- (baseUrl + fullUrl, httpClient.executeMethod(getter)) match {
- case (server, responseCode) =>
- val respHeaders = slurpApacheHeaders(getter.getResponseHeaders)
-
- Full(new TheResponse(baseUrl,
- responseCode, getter.getStatusText,
- respHeaders,
- for {st <- Box !! getter.getResponseBodyAsStream
- bytes <- tryo(readWholeStream(st))
- } yield bytes,
- httpClient))
- }
- } catch {
- case e: IOException => Failure(baseUrl + fullUrl, Full(e), Empty)
- } finally {
- getter.releaseConnection
- }
-
- ret
- }
-
-}
-
-trait GetPoster extends BaseGetPoster with ToResponse
-
-/**
- * A trait that wraps the Apache Commons HTTP client and supports GET and POST
- */
-trait BaseGetPoster {
- type ResponseType
-
- /**
- * The base URL for all requests
- */
- def baseUrl: String
-
- protected def slurpApacheHeaders(in: Array[Header]):
- Map[String, List[String]] = {
- val headerSet: List[(String, String)] = for (e <- in.toList) yield (e.getName -> e.getValue)
-
- headerSet.foldLeft[Map[String, List[String]]](Map.empty)((acc, e) =>
- acc + (e._1 -> (e._2 :: acc.getOrElse(e._1, Nil))))
- }
-
-
- /**
- * Perform an HTTP GET
- *
- * @param url - the URL to append to the baseUrl
- * @param headers - any additional headers to include with the request
- * @param faux_params - the request parameters to include with the request
- */
- def get(url: String, httpClient: HttpClient,
- headers: List[(String, String)],
- faux_params: (String, Any)*)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType):
- ResponseType
- = {
- val params = faux_params.toList.map(x => (x._1, x._2.toString))
- val fullUrl = url + (params.map(v => urlEncode(v._1) + "=" + urlEncode(v._2)).mkString("&") match {case s if s.length == 0 => ""; case s => "?" + s})
- val getter = new GetMethod(baseUrl + fullUrl)
- getter.getParams().setCookiePolicy(CookiePolicy.RFC_2965)
- for ((name, value) <- headers) getter.setRequestHeader(name, value)
-
- capture(fullUrl, httpClient, getter)
- }
-
- /**
- * Perform an HTTP DELETE
- *
- * @param url - the URL to append to the baseUrl
- * @param headers - any additional headers to include with the request
- * @param faux_params - the request parameters to include with the request
- */
- def delete(url: String, httpClient: HttpClient,
- headers: List[(String, String)],
- faux_params: (String, Any)*)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType):
- ResponseType
- = {
- val params = faux_params.toList.map(x => (x._1, x._2.toString))
- val fullUrl = url + (params.map(v => urlEncode(v._1) + "=" + urlEncode(v._2)).mkString("&") match {case s if s.length == 0 => ""; case s => "?" + s})
- val getter = new DeleteMethod(baseUrl + fullUrl)
- getter.getParams().setCookiePolicy(CookiePolicy.RFC_2965)
- for ((name, value) <- headers) getter.setRequestHeader(name, value)
-
- capture(fullUrl, httpClient, getter)
- }
-
- /**
- * Perform an HTTP POST
- *
- * @param url - the URL to append to the baseUrl
- * @param headers - any additional headers to include with the request
- * @param faux_params - the request parameters to include with the request
- */
- def post(url: String, httpClient: HttpClient,
- headers: List[(String, String)],
- faux_params: (String, Any)*)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType):
- ResponseType
- = {
- val params = faux_params.toList.map(x => (x._1, x._2.toString))
- val poster = new PostMethod(baseUrl + url)
- poster.getParams().setCookiePolicy(CookiePolicy.RFC_2965)
- for ((name, value) <- headers) poster.setRequestHeader(name, value)
- for ((name, value) <- params) poster.setParameter(name, value)
-
- capture(url, httpClient, poster)
- }
-
- implicit def xmlToRequestEntity(body: NodeSeq): RequestEntity =
- new RequestEntity {
- val bytes = body.toString.getBytes("UTF-8")
-
- def getContentLength() = bytes.length
-
- def getContentType() = "text/xml; charset=utf-8"
-
- def isRepeatable() = true
-
- def writeRequest(out: OutputStream) {
- out.write(bytes)
- }
- }
-
- implicit def jsonToRequestEntity(body: JValue): RequestEntity =
- new RequestEntity {
- val bytes = compact(render(body)).toString.getBytes("UTF-8")
-
- def getContentLength() = bytes.length
-
- def getContentType() = "application/json"
-
- def isRepeatable() = true
-
- def writeRequest(out: OutputStream) {
- out.write(bytes)
- }
- }
-
- /**
- * Perform an HTTP POST with an XML body
- *
- * @param url - the URL to append to the baseUrl
- * @param headers - any additional headers to include with the request
- * @param body - the xml to post
- */
- def post[RT](url: String, httpClient: HttpClient,
- headers: List[(String, String)],
- body: RT)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType,
- bodyToRequestEntity: RT => RequestEntity): ResponseType
- = {
- val poster = new PostMethod(baseUrl + url)
- poster.getParams().setCookiePolicy(CookiePolicy.RFC_2965)
- for ((name, value) <- headers) poster.setRequestHeader(name, value)
- poster.setRequestEntity(bodyToRequestEntity(body))
-
- capture(url, httpClient, poster)
- }
-
- /**
- * Perform an HTTP POST with a pile of bytes in the body
- *
- * @param url - the URL to append to the baseUrl
- * @param headers - any additional headers to include with the request
- * @param body - the pile of bytes to POST to the target server
- * @param contentType - the content type of the pile of bytes
- */
- def post(url: String, httpClient: HttpClient,
- headers: List[(String, String)],
- body: Array[Byte],
- contentType: String)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType):
- ResponseType
- = {
- val poster = new PostMethod(baseUrl + url)
- poster.getParams().setCookiePolicy(CookiePolicy.RFC_2965)
- for ((name, value) <- headers) poster.setRequestHeader(name, value)
- poster.setRequestEntity(new RequestEntity {
- private val bytes = body
-
- def getContentLength() = bytes.length
-
- def getContentType() = contentType
-
- def isRepeatable() = true
-
- def writeRequest(out: OutputStream) {
- out.write(bytes)
- }
- })
- capture(url, httpClient, poster)
- }
-
- /**
- * Perform an HTTP PUT
- *
- * @param url - the URL to append to the baseUrl
- * @param headers - any additional headers to include with the request
- */
- def put(url: String, httpClient: HttpClient,
- headers: List[(String, String)])
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType):
- ResponseType
- = {
- val poster = new PutMethod(baseUrl + url)
- poster.getParams().setCookiePolicy(CookiePolicy.RFC_2965)
- for ((name, value) <- headers) poster.setRequestHeader(name, value)
-
- capture(url, httpClient, poster)
- }
-
- /**
- * Perform an HTTP PUT with an XML body
- *
- * @param url - the URL to append to the baseUrl
- * @param headers - any additional headers to include with the request
- * @param body - the xml to post
- */
- def put[RT](url: String, httpClient: HttpClient,
- headers: List[(String, String)],
- body: RT)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType,
- bodyToRequestEntity: RT => RequestEntity): ResponseType
- = {
- val poster = new PutMethod(baseUrl + url)
- poster.getParams().setCookiePolicy(CookiePolicy.RFC_2965)
- for ((name, value) <- headers) poster.setRequestHeader(name, value)
- poster.setRequestEntity(bodyToRequestEntity(body))
-
- capture(url, httpClient, poster)
- }
-
- /**
- * Perform an HTTP PUT with a pile of bytes in the body
- *
- * @param url - the URL to append to the baseUrl
- * @param headers - any additional headers to include with the request
- * @param body - the pile of bytes to POST to the target server
- * @param contentType - the content type of the pile of bytes
- */
- def put(url: String, httpClient: HttpClient,
- headers: List[(String, String)],
- body: Array[Byte],
- contentType: String)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType):
- ResponseType
- = {
- val poster = new PutMethod(baseUrl + url)
- poster.getParams().setCookiePolicy(CookiePolicy.RFC_2965)
- for ((name, value) <- headers) poster.setRequestHeader(name, value)
- poster.setRequestEntity(new RequestEntity {
- private val bytes = body
-
- def getContentLength() = bytes.length
-
- def getContentType() = contentType
-
- def isRepeatable() = true
-
- def writeRequest(out: OutputStream) {
- out.write(bytes)
- }
- })
-
- capture(url, httpClient, poster)
- }
-}
-
-/**
- * A trait for reporting failures
- */
-trait ReportFailure {
- def fail(msg: String): Nothing
-}
-
-trait GetPosterHelper {
- self: BaseGetPoster =>
-
- /**
- * Create the HTTP client for a new get/post request
- */
- def theHttpClient: HttpClient
-
-
- /**
- * Perform an HTTP GET with a newly minted httpClient
- *
- * @param url the URL to make the request on
- * @param params the parameters to pass
- */
- def get(url: String, params: (String, Any)*)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType):
- ResponseType =
- get(url, theHttpClient, Nil, params: _*)(capture)
-
- /**
- * Perform an HTTP DELETE with a newly minted httpClient
- *
- * @param url the URL to make the request on
- * @param params the parameters to pass
- */
- def delete(url: String, params: (String, Any)*)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType):
- ResponseType =
- delete(url, theHttpClient, Nil, params: _*)(capture)
-
- /**
- * Perform an HTTP POST with a newly minted httpClient
- *
- * @param url the URL to make the request on
- * @param params the parameters to pass
- */
- def post(url: String, params: (String, Any)*)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType):
- ResponseType =
- post(url, theHttpClient, Nil, params: _*)(capture)
-
- /**
- * Perform an HTTP POST with a newly minted httpClient
- *
- * @param url the URL to make the request on
- * @param xml the XML to POST to the server
- */
- def post[RT](url: String, xml: RT)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType,
- bodyToRequestEntity: RT => RequestEntity): ResponseType =
- post(url, theHttpClient, Nil, xml)(capture, bodyToRequestEntity)
-
- /**
- * Perform an HTTP POST with a newly minted httpClient
- *
- * @param url the URL to make the request on
- * @param body the bytes to POST to the server
- * @param contentType the content type of the message
- */
- def post(url: String, body: Array[Byte], contentType: String)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType): ResponseType =
- post(url, theHttpClient, Nil, body, contentType)(capture)
-
- /**
- * Perform an HTTP PUT with a newly minted httpClient
- *
- * @param url the URL to make the request on
- * @param xml the XML to PUT to the server
- */
- def put[RT](url: String, xml: RT)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType,
- bodyToRequestEntity: RT => RequestEntity): ResponseType =
- put(url, theHttpClient, Nil, xml)(capture, bodyToRequestEntity)
-
- /**
- * Perform an HTTP POST with a newly minted httpClient
- *
- * @param url the URL to make the request on
- * @param body the bytes to POST to the server
- * @param contentType the content type of the message
- */
- def put(url: String, body: Array[Byte], contentType: String)
- (implicit capture: (String, HttpClient, HttpMethodBase) => ResponseType): ResponseType =
- put(url, theHttpClient, Nil, body, contentType)(capture)
-
-}
-
-/**
- * Mix this trait into your test so you can make HTTP requests on a target
- */
-trait TestKit extends ClientBuilder with GetPoster with GetPosterHelper {
- /**
- * The base URL for all GET and POST requests
- */
- def baseUrl: String
-
- class TestHandler(res: TestResponse) {
- def then(f: TestResponse => TestResponse): TestResponse = f(res)
-
- def also(f: TestResponse => Any): TestResponse = {f(res); res}
- }
- implicit def reqToHander(in: TestResponse): TestHandler = new TestHandler(in)
-}
-
-trait ClientBuilder {
- /**
- * Create the HTTP client for a new get/post request
- */
- def theHttpClient: HttpClient = buildNoAuthClient
-
-
- /**
- * Create a new HTTP client that does not do any form of AUTH
- */
- def buildNoAuthClient =
- new HttpClient(new SimpleHttpConnectionManager(false))
-
- /**
- * Create a new HTTP client that does BASIC AUTH with username/pwd
- */
- def buildBasicAuthClient(name: String, pwd: String) = {
- val ret = new HttpClient(new SimpleHttpConnectionManager(false))
- val defaultcreds = new UsernamePasswordCredentials(name, pwd)
- ret.getState().setCredentials(AuthScope.ANY, defaultcreds)
-
- ret
- }
-
-}
-
-/**
- * Mix this trait into your test so you can make HTTP requests on a target
- */
-trait RequestKit extends ClientBuilder with BaseGetPoster with GetPosterHelper with ToBoxTheResponse {
- /**
- * The base URL for all GET and POST requests
- */
- def baseUrl: String
-}
-
-
-/**
- * A legacy test framework
- */
-trait TestFramework extends TestKit {
- // def runner: TestRunner
- def tests: List[Item]
-
- def buildRunner: TestRunner
-
- /**
- * Create the base HTTP client
- */
- override def theHttpClient: HttpClient = defaultHttpClient
-
- lazy val defaultHttpClient = buildNoAuthClient
-
- // protected lazy val httpClient = new HttpClient(new MultiThreadedHttpConnectionManager)
-
- def fork(cnt: Int)(f: Int => Any) {
- val threads = for (t <- (1 to cnt).toList) yield {
- val th = new Thread(new Runnable {def run {f(t)}})
- th.start
- th
- }
-
- def waitAll(in: List[Thread]) {
- in match {
- case Nil =>
- case x :: xs => x.join; waitAll(xs)
- }
- }
-
- waitAll(threads)
- }
-
-
-}
-
-object TestHelpers {
- /**
- * Get the function name given a particular comet actor name
- *
- * @param cometName the name (default prefix) for the comet actor
- * @param body the body of the response
- *
- * @return the name of the JSON function associated with the Comet actor
- */
- def jsonFuncForCometName(cometName: String, body: String): Box[String] = {
- val p = Pattern.compile("""JSON Func """ + cometName + """ \$\$ ([Ff][^ ]*)""")
- val m = p.matcher(body)
- if (m.find) Full(m.group(1))
- else Empty
- }
-
-
- /**
- * Given an HTML page, find the list of "lift_toWatch" names and values
- * These can be fed back into a comet request
- *
- * @param body the page body returned from an HTTP request
- *
- * @return a list of the "to watch" tokens and the last update tokens
- */
- def toWatchFromPage(body: String): List[(String, String)] = {
- val p = Pattern.compile("""lift_toWatch[ ]*\=[ ]*\{([^}]*)\}""")
- val rp = new REMatcher(body, p)
- val p2 = Pattern.compile("""'([^']*)'\: ([0-9]*)""")
-
- for (it <- rp.capture;
- val _ = println("Captured: " + it);
- val _ = println("Does match: " + p2.matcher(it).find);
- val q = new REMatcher(it, p2);
- em <- q.eachFound) yield (em(1), em(2))
- }
-
- /**
- * Given the body of a Comet response, parse for updates "lift_toWatch" values
- * and update the current sequence to reflect any updated values
- *
- * @param old the old toWatch sequence
- * @param body the body of the comet response
- *
- * @return the updated sequences
- */
- def toWatchUpdates(old: Seq[(String, String)], body: String): Seq[(String, String)] = {
- val p = Pattern.compile("""lift_toWatch\[\'([^\']*)\'] \= \'([0-9]*)""")
- val re = new REMatcher(body, p)
- val np = re.eachFound.foldLeft(Map(old: _*))((a, b) => a + ((b(1), b(2))))
- np.elements.toList
- }
-
-
- def getCookie(headers: List[(String, String)],
- respHeaders: Map[String, List[String]]): Box[String]
- =
- {
- val ret = (headers.filter {case (<