Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added examples

  • Loading branch information...
commit 723b939b7fd9977cee0d5f25503e4e8984140564 1 parent 9a628b3
@jexp jexp authored
Showing with 14,819 additions and 0 deletions.
  1. +12 −0 spring-data-neo4j-examples/cineasts/.gitignore
  2. +16 −0 spring-data-neo4j-examples/cineasts/Readme.md
  3. BIN  spring-data-neo4j-examples/cineasts/cineasts.png
  4. +325 −0 spring-data-neo4j-examples/cineasts/pom.xml
  5. +63 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/controller/AuthController.java
  6. +64 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/controller/ImportController.java
  7. +122 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/controller/MovieController.java
  8. +61 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/controller/UserController.java
  9. +225 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/Movie.java
  10. +124 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/Person.java
  11. +52 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/Rating.java
  12. +38 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/Role.java
  13. +9 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/Roles.java
  14. +117 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/User.java
  15. +46 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/movieimport/MovieDbApiClient.java
  16. +14 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/movieimport/MovieDbException.java
  17. +128 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/movieimport/MovieDbImportService.java
  18. +704 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/movieimport/MovieDbJsonMapper.java
  19. +95 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/movieimport/MovieDbLocalStorage.java
  20. +12 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/repository/MovieRepository.java
  21. +11 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/repository/PersonRepository.java
  22. +11 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/repository/UserRepository.java
  23. +62 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/service/CineastsRepository.java
  24. +62 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/service/CineastsUserDetails.java
  25. +77 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/service/CineastsUserDetailsService.java
  26. +54 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/service/DatabasePopulator.java
  27. +74 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/service/FriendsMovieRecommendations.java
  28. +82 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/service/MovieRecommendations.java
  29. +67 −0 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/service/Neo4jDatabaseCleaner.java
  30. +7 −0 spring-data-neo4j-examples/cineasts/src/main/resources/log4j.properties
  31. +32 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/applicatioContext-security.xml
  32. +32 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/applicationContext.xml
  33. +8 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/decorators.xml
  34. +28 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/dispatcherServlet-servlet.xml
  35. +35 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/actors/show.jsp
  36. +7 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/auth/deniedpage.jsp
  37. +36 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/auth/loginpage.jsp
  38. +37 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/auth/registerpage.jsp
  39. +30 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/decorators/frontpage.jsp
  40. +31 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/decorators/main.jsp
  41. +15 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/import/result.jsp
  42. +5 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/includes/footer.jsp
  43. +3 −0  spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/includes/header-frontpage.jsp
  44. +3 −0  spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/includes/header.jsp
  45. +24 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/includes/header_login.jsp
  46. 0  spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/includes/js.jsp
  47. 0  spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/includes/links.jsp
  48. +15 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/includes/navigation.jsp
  49. +5 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/includes/search.jsp
  50. +4 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/includes/style.jsp
  51. +11 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/index.jsp
  52. +26 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/movies/list.jsp
  53. +170 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/movies/show.jsp
  54. +103 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/user/index.jsp
  55. +86 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/views/user/public.jsp
  56. +58 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/WEB-INF/web.xml
  57. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/actor-picture-frame.png
  58. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/cineasts.png
  59. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/filmroll-horizontal.png
  60. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/filmroll-vertical-full.png
  61. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/header-curtain.png
  62. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/header-splash-bg.png
  63. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/logo-splash.png
  64. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/logo.png
  65. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/logo/neo4j.png
  66. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/logo/springdata.jpg
  67. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/logo/springdatagraph.png
  68. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/logo/springsource.png
  69. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/movie-placeholder.png
  70. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/neo4j.png
  71. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/profile-placeholder-small.png
  72. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/profile-placeholder.png
  73. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/rated_0.png
  74. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/rated_1.png
  75. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/rated_2.png
  76. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/rated_3.png
  77. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/rated_4.png
  78. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/rated_5.png
  79. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/rating-active.png
  80. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/rating-disabled.png
  81. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/searchbar-big-searchicon.png
  82. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/searchbar-big.png
  83. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/springdata.jpg
  84. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/springdatagraph.png
  85. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/springsource.png
  86. BIN  spring-data-neo4j-examples/cineasts/src/main/webapp/images/star.png
  87. +13 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/resources/forms.css
  88. +18 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/resources/grid.css
  89. +328 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/resources/style.css
  90. +32 −0 spring-data-neo4j-examples/cineasts/src/main/webapp/resources/typography.css
  91. +82 −0 spring-data-neo4j-examples/cineasts/src/test/java/org/neo4j/cineasts/domain/DomainTest.java
  92. +28 −0 spring-data-neo4j-examples/cineasts/src/test/java/org/neo4j/cineasts/movieimport/MovieDbApiClientTest.java
  93. +51 −0 spring-data-neo4j-examples/cineasts/src/test/java/org/neo4j/cineasts/movieimport/MovieDbImportServiceTest.java
  94. +76 −0 spring-data-neo4j-examples/cineasts/src/test/java/org/neo4j/cineasts/movieimport/MovieDbLocalStorageTest.java
  95. +56 −0 spring-data-neo4j-examples/cineasts/src/test/java/org/neo4j/cineasts/service/MoviesRepositoryTest.java
  96. +34 −0 spring-data-neo4j-examples/cineasts/src/test/resources/movies-test-context.xml
  97. +10 −0 spring-data-neo4j-examples/hello-worlds/.gitignore
  98. +1 −0  spring-data-neo4j-examples/hello-worlds/.idea/.name
  99. +7 −0 spring-data-neo4j-examples/hello-worlds/.idea/ant.xml
  100. +28 −0 spring-data-neo4j-examples/hello-worlds/.idea/compiler.xml
  101. +5 −0 spring-data-neo4j-examples/hello-worlds/.idea/encodings.xml
  102. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml
  103. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__asm_asm_3_1.xml
  104. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__cglib_cglib_2_2.xml
  105. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__cglib_cglib_nodep_2_2.xml
  106. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml
  107. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__javax_validation_validation_api_1_0_0_GA.xml
  108. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__junit_junit_4_8_1.xml
  109. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__log4j_log4j_1_2_15.xml
  110. +13 −0 ...eo4j-examples/hello-worlds/.idea/libraries/Maven__org_apache_geronimo_specs_geronimo_jta_1_1_spec_1_1_1.xml
  111. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_apache_lucene_lucene_core_3_1_0.xml
  112. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_aspectj_aspectjrt_1_6_12_M1.xml
  113. +13 −0 ...s/hello-worlds/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_0_api_1_0_0_Final.xml
  114. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_neo4j_neo4j_1_4_1.xml
  115. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_neo4j_neo4j_graph_algo_1_4_1.xml
  116. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_neo4j_neo4j_graph_matching_1_4_1.xml
  117. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_neo4j_neo4j_jmx_1_4_1.xml
  118. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_neo4j_neo4j_kernel_1_4_1.xml
  119. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_neo4j_neo4j_kernel_test_jar_tests_1_4_1.xml
  120. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_neo4j_neo4j_lucene_index_1_4_1.xml
  121. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_neo4j_neo4j_udc_1_4_1.xml
  122. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_6_1.xml
  123. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_slf4j_slf4j_api_1_6_1.xml
  124. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_6_1.xml
  125. +13 −0 ...lo-worlds/.idea/libraries/Maven__org_springframework_data_spring_data_commons_core_1_2_0_BUILD_SNAPSHOT.xml
  126. +13 −0 ...les/hello-worlds/.idea/libraries/Maven__org_springframework_data_spring_data_neo4j_2_0_0_BUILD_SNAPSHOT.xml
  127. +13 −0 ...ng-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_aop_3_0_5_RELEASE.xml
  128. +13 −0 ...ng-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_asm_3_0_5_RELEASE.xml
  129. +13 −0 ...ata-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_aspects_3_0_5_RELEASE.xml
  130. +13 −0 ...-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_beans_3_0_5_RELEASE.xml
  131. +13 −0 ...ata-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_context_3_0_5_RELEASE.xml
  132. +13 −0 ...j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_context_support_3_0_5_RELEASE.xml
  133. +13 −0 ...g-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_core_3_0_5_RELEASE.xml
  134. +13 −0 ...-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_expression_3_0_5_RELEASE.xml
  135. +13 −0 ...g-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_jdbc_3_0_5_RELEASE.xml
  136. +13 −0 ...ng-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_orm_3_0_5_RELEASE.xml
  137. +13 −0 ...g-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_test_3_0_5_RELEASE.xml
  138. +13 −0 spring-data-neo4j-examples/hello-worlds/.idea/libraries/Maven__org_springframework_spring_tx_3_0_5_RELEASE.xml
  139. +222 −0 spring-data-neo4j-examples/hello-worlds/.idea/misc.xml
  140. +9 −0 spring-data-neo4j-examples/hello-worlds/.idea/modules.xml
  141. +5 −0 spring-data-neo4j-examples/hello-worlds/.idea/scopes/scope_settings.xml
  142. +7 −0 spring-data-neo4j-examples/hello-worlds/.idea/vcs.xml
  143. +618 −0 spring-data-neo4j-examples/hello-worlds/.idea/workspace.xml
  144. +6 −0 spring-data-neo4j-examples/hello-worlds/.settings/org.eclipse.jdt.core.prefs
  145. +9 −0 spring-data-neo4j-examples/hello-worlds/.settings/org.maven.ide.eclipse.prefs
  146. +10 −0 spring-data-neo4j-examples/hello-worlds/README.md
  147. +27 −0 spring-data-neo4j-examples/hello-worlds/build.gradle
  148. +75 −0 spring-data-neo4j-examples/hello-worlds/build.xml
  149. +177 −0 spring-data-neo4j-examples/hello-worlds/pom.xml
  150. +29 −0 spring-data-neo4j-examples/hello-worlds/settings/install-ivy.xml
  151. +14 −0 spring-data-neo4j-examples/hello-worlds/settings/ivy.xml
  152. +23 −0 spring-data-neo4j-examples/hello-worlds/settings/ivysettings.xml
  153. +30 −0 spring-data-neo4j-examples/hello-worlds/settings/path.xml
  154. +39 −0 ...-data-neo4j-examples/hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/App.java
  155. +23 −0 ...amples/hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/MyWorldRepository.java
  156. +6 −0 ...amples/hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/RelationshipTypes.java
  157. +63 −0 ...ata-neo4j-examples/hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/World.java
  158. +20 −0 ...4j-examples/hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/WorldCounter.java
  159. +11 −0 ...examples/hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/WorldRepository.java
  160. +73 −0 ...ples/hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/WorldRepositoryImpl.java
  161. +7 −0 spring-data-neo4j-examples/hello-worlds/src/main/resources/log4j.properties
  162. +20 −0 spring-data-neo4j-examples/hello-worlds/src/main/resources/spring/helloWorldContext.xml
  163. +45 −0 ...xamples/hello-worlds/src/test/java/org/springframework/data/neo4j/examples/hellograph/WorldCounterTest.java
  164. +129 −0 ...ples/hello-worlds/src/test/java/org/springframework/data/neo4j/examples/hellograph/WorldRepositoryTest.java
  165. +52 −0 ...neo4j-examples/hello-worlds/src/test/java/org/springframework/data/neo4j/examples/hellograph/WorldTest.java
  166. +5 −0 spring-data-neo4j-examples/imdb/.gitignore
  167. +63 −0 spring-data-neo4j-examples/imdb/README.md
  168. BIN  spring-data-neo4j-examples/imdb/doc/images/IMDB1.png
  169. +439 −0 spring-data-neo4j-examples/imdb/pom.xml
  170. +26 −0 spring-data-neo4j-examples/imdb/src/main/assembly/imdb-src.xml
  171. +47 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/Actor.java
  172. +11 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/ActorRepository.java
  173. +11 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/ImdbSearchEngine.java
  174. +98 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/ImdbSearchEngineImpl.java
  175. +58 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/ImdbService.java
  176. +91 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/ImdbServiceImpl.java
  177. +67 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/Lookup.java
  178. +11 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/LookupRepository.java
  179. +49 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/Movie.java
  180. +10 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/MovieRepository.java
  181. +7 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/RelTypes.java
  182. +36 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/domain/Role.java
  183. +25 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/parser/ActorData.java
  184. +223 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/parser/ImdbParser.java
  185. +26 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/parser/ImdbReader.java
  186. +41 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/parser/ImdbReaderImpl.java
  187. +25 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/parser/MovieData.java
  188. +33 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/parser/RoleData.java
  189. +89 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/ActorFindControllerDelegate.java
  190. +13 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/ActorForm.java
  191. +42 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/ActorInfo.java
  192. +31 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/FindController.java
  193. +10 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/FindControllerDelegate.java
  194. +33 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/ImdbSetupControllerDelegate.java
  195. +80 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/MovieFindControllerDelegate.java
  196. +13 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/MovieForm.java
  197. +42 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/MovieInfo.java
  198. +24 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/SetupController.java
  199. +10 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/SetupControllerDelegate.java
  200. +4 −0 spring-data-neo4j-examples/imdb/src/main/java/org/neo4j/examples/imdb/web/SetupForm.java
  201. +123 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.domain.impl.ucls
  202. +36 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.domain.interface.simple.ucls
  203. +66 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.domain.interface.ucls
  204. +107 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.domain.service.search.ucls
  205. +171 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.domain.service.ucls
  206. +76 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.packages.ucls
  207. +46 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.parser.data.ucls
  208. +78 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.parser.ucls
  209. +62 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.util.ucls
  210. +140 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.web.find.ucls
  211. +105 −0 spring-data-neo4j-examples/imdb/src/main/model/imdb.web.setup.ucls
  212. BIN  spring-data-neo4j-examples/imdb/src/main/resources/data/actors.list.gz
  213. BIN  spring-data-neo4j-examples/imdb/src/main/resources/data/actresses.list.gz
  214. BIN  spring-data-neo4j-examples/imdb/src/main/resources/data/movies.list.gz
  215. +3 −0  spring-data-neo4j-examples/imdb/src/main/webapp/META-INF/MANIFEST.MF
  216. +58 −0 spring-data-neo4j-examples/imdb/src/main/webapp/WEB-INF/imdb-app-servlet.xml
  217. +2,252 −0 spring-data-neo4j-examples/imdb/src/main/webapp/WEB-INF/tld/spring-form.tld
  218. +31 −0 spring-data-neo4j-examples/imdb/src/main/webapp/WEB-INF/web.xml
  219. BIN  spring-data-neo4j-examples/imdb/src/main/webapp/actor.png
  220. BIN  spring-data-neo4j-examples/imdb/src/main/webapp/bg.png
  221. BIN  spring-data-neo4j-examples/imdb/src/main/webapp/favicon.ico
  222. BIN  spring-data-neo4j-examples/imdb/src/main/webapp/gradient.png
  223. +17 −0 spring-data-neo4j-examples/imdb/src/main/webapp/index.jsp
  224. +21 −0 spring-data-neo4j-examples/imdb/src/main/webapp/jsp/actor-list.jsp
  225. +16 −0 spring-data-neo4j-examples/imdb/src/main/webapp/jsp/actor.jsp
  226. +9 −0 spring-data-neo4j-examples/imdb/src/main/webapp/jsp/head.jsp
  227. +3 −0  spring-data-neo4j-examples/imdb/src/main/webapp/jsp/include.jsp
  228. +1 −0  spring-data-neo4j-examples/imdb/src/main/webapp/jsp/menu.jsp
  229. +47 −0 spring-data-neo4j-examples/imdb/src/main/webapp/jsp/movie-list.jsp
  230. +16 −0 spring-data-neo4j-examples/imdb/src/main/webapp/jsp/movie.jsp
  231. +13 −0 spring-data-neo4j-examples/imdb/src/main/webapp/jsp/setup-message.jsp
  232. +15 −0 spring-data-neo4j-examples/imdb/src/main/webapp/jsp/setup.jsp
  233. BIN  spring-data-neo4j-examples/imdb/src/main/webapp/menu.png
  234. BIN  spring-data-neo4j-examples/imdb/src/main/webapp/movie.png
  235. BIN  spring-data-neo4j-examples/imdb/src/main/webapp/setup.png
  236. +118 −0 spring-data-neo4j-examples/imdb/src/main/webapp/style.css
  237. +28 −0 spring-data-neo4j-examples/imdb/src/site/apt/index.apt
  238. +33 −0 spring-data-neo4j-examples/imdb/src/site/site.xml
  239. BIN  spring-data-neo4j-examples/imdb/src/test/resources/icons/ACTS_IN.INCOMING.png
  240. BIN  spring-data-neo4j-examples/imdb/src/test/resources/icons/ACTS_IN.OUTGOING.png
  241. BIN  spring-data-neo4j-examples/imdb/src/test/resources/icons/IMDB.OUTGOING.png
  242. BIN  spring-data-neo4j-examples/imdb/src/test/resources/icons/PART_OF_NAME.OUTGOING.png
  243. BIN  spring-data-neo4j-examples/imdb/src/test/resources/icons/PART_OF_TITLE.OUTGOING.png
  244. +15 −0 spring-data-neo4j-examples/myrestaurants-original/.classpath
  245. +1 −0  spring-data-neo4j-examples/myrestaurants-original/.gitignore
  246. +44 −0 spring-data-neo4j-examples/myrestaurants-original/.project
  247. +12 −0 spring-data-neo4j-examples/myrestaurants-original/.settings/.jsdtscope
  248. +6 −0 spring-data-neo4j-examples/myrestaurants-original/.settings/org.eclipse.jdt.core.prefs
  249. +10 −0 spring-data-neo4j-examples/myrestaurants-original/.settings/org.eclipse.wst.common.component
  250. +9 −0 spring-data-neo4j-examples/myrestaurants-original/.settings/org.eclipse.wst.common.project.facet.core.xml
  251. +1 −0  spring-data-neo4j-examples/myrestaurants-original/.settings/org.eclipse.wst.jsdt.ui.superType.container
  252. +1 −0  spring-data-neo4j-examples/myrestaurants-original/.settings/org.eclipse.wst.jsdt.ui.superType.name
  253. +10 −0 spring-data-neo4j-examples/myrestaurants-original/.settings/org.eclipse.wst.validation.prefs
  254. +9 −0 spring-data-neo4j-examples/myrestaurants-original/.settings/org.maven.ide.eclipse.prefs
  255. +513 −0 spring-data-neo4j-examples/myrestaurants-original/pom.xml
  256. +37 −0 ...data-neo4j-examples/myrestaurants-original/src/main/java/com/springone/myrestaurants/dao/RestaurantDao.java
  257. +47 −0 ...ata-neo4j-examples/myrestaurants-original/src/main/java/com/springone/myrestaurants/dao/UserAccountDao.java
  258. +88 −0 ...data-neo4j-examples/myrestaurants-original/src/main/java/com/springone/myrestaurants/domain/Restaurant.java
  259. +113 −0 ...ata-neo4j-examples/myrestaurants-original/src/main/java/com/springone/myrestaurants/domain/UserAccount.java
  260. +53 −0 ...xamples/myrestaurants-original/src/main/java/com/springone/myrestaurants/web/BaseApplicationController.java
  261. +68 −0 ...o4j-examples/myrestaurants-original/src/main/java/com/springone/myrestaurants/web/RestaurantController.java
  262. +114 −0 ...a-neo4j-examples/myrestaurants-original/src/main/java/com/springone/myrestaurants/web/SignUpController.java
  263. +12 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/resources/META-INF/persistence.xml
  264. +37 −0 ...ta-neo4j-examples/myrestaurants-original/src/main/resources/META-INF/spring/applicationContext-security.xml
  265. +85 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/resources/META-INF/spring/applicationContext.xml
  266. +4 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/resources/META-INF/spring/database.properties
  267. +20 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/resources/log4j.properties
  268. +50 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/resources/restaurants-sample-data.sql
  269. +8 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/resources/schema.sql
  270. +3 −0  spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/META-INF/MANIFEST.MF
  271. +1 −0  spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/classes/alt.properties
  272. +1 −0  spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/classes/standard.properties
  273. +29 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/i18n/application.properties
  274. +94 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/i18n/messages.properties
  275. +27 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/layouts/default.jspx
  276. +19 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/layouts/layouts.xml
  277. +77 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/spring/webmvc-config.xml
  278. +29 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/create.tagx
  279. +25 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/dependency.tagx
  280. +37 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/checkbox.tagx
  281. +28 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/column.tagx
  282. +75 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/datetime.tagx
  283. +51 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/display.tagx
  284. +46 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/editor.tagx
  285. +79 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/input.tagx
  286. +42 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/reference.tagx
  287. +99 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/select.tagx
  288. +35 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/simple.tagx
  289. +159 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/table.tagx
  290. +47 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/fields/textarea.tagx
  291. +29 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/find.tagx
  292. +31 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/list.tagx
  293. +113 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/show.tagx
  294. +42 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/form/update.tagx
  295. +25 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/menu/category.tagx
  296. +29 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/menu/item.tagx
  297. +13 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/menu/menu.tagx
  298. +31 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/util/language.tagx
  299. +28 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/util/load-scripts.tagx
  300. +87 −0 spring-data-neo4j-examples/myrestaurants-original/src/main/webapp/WEB-INF/tags/util/pagination.tagx
Sorry, we could not display the entire diff because too many files (483) changed.
View
12 spring-data-neo4j-examples/cineasts/.gitignore
@@ -0,0 +1,12 @@
+.DS_Store
+*.ipr
+*.iws
+*.iml
+*.zip
+data
+target
+*.log
+tmp
+.classpath
+.project
+.settings
View
16 spring-data-neo4j-examples/cineasts/Readme.md
@@ -0,0 +1,16 @@
+![Cineasts.net Logo](https://github.com/jexp/cineasts/raw/master/cineasts.png)
+Cineasts.net
+============
+
+This project is the demo/tutorial application for the [Spring Data Graph](http://github.com/springsource/spring-data-graph) library which provides convenient access to the [Neo4j](http://neo4j.org) graph database.
+
+This tutorial creates a complete web application built on top of Spring Data Graph.
+
+It uses a domain that should be familiar to most - movies. So for cineasts.net we decided to add a social
+touch to the whole movie rating business, allowing friends to share their ratings and get recommendations
+for new friends and movies.
+
+The tutorial is presented as a colloquial description of the steps necessary to create the application.
+It provides the configuration and code examples that are needed to understand what's happening.
+
+The complete tutorial is contained in this projects [github wiki](https://github.com/jexp/cineasts/wiki).
View
BIN  spring-data-neo4j-examples/cineasts/cineasts.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
325 spring-data-neo4j-examples/cineasts/pom.xml
@@ -0,0 +1,325 @@
+<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>
+
+ <groupId>org.neo4j</groupId>
+ <artifactId>movies</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+
+ <name>Movies</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <spring.version>3.0.5.RELEASE</spring.version>
+ <slf4j.version>1.6.1</slf4j.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <neo4j.version>1.3</neo4j.version>
+ <spring-data-graph.version>1.0.0.RELEASE</spring-data-graph.version>
+ <aspectj.version>1.6.11.RELEASE</aspectj.version>
+ <org.slf4j-version>1.6.1</org.slf4j-version>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>spring-maven-release</id>
+ <name>Spring Maven Release Repository</name>
+ <url>http://maven.springframework.org/release</url>
+ </repository>
+ <repository>
+ <id>spring-maven-snapshot</id>
+ <name>Spring Maven Snapshot Repository</name>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <url>http://maven.springframework.org/snapshot</url>
+ </repository>
+ <repository>
+ <id>spring-maven-milestone</id>
+ <name>Spring Maven Milestone Repository</name>
+ <url>http://maven.springframework.org/milestone</url>
+ </repository>
+ <repository>
+ <id>neo4j-public-repository</id>
+ <url>http://m2.neo4j.org/</url>
+ <name>Publicly available Maven 2 repository for Neo4j</name>
+ </repository>
+ <repository>
+ <id>jboss-public-repo</id>
+ <url>http://repository.jboss.org/maven2/</url>
+ <name>JBoss public available repo</name>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>spring-maven-release</id>
+ <name>Spring Maven Release Repository</name>
+ <url>http://maven.springframework.org/release</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>spring-maven-milestone</id>
+ <name>Spring Maven Milestone Repository</name>
+ <url>http://maven.springframework.org/milestone</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <dependencies>
+ <!-- Spring dependencies -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>${spring.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aspects</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${spring.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-config</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${org.slf4j-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${org.slf4j-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${org.slf4j-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.data</groupId>
+ <artifactId>spring-data-neo4j</artifactId>
+ <version>${spring-data-graph.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>opensymphony</groupId>
+ <artifactId>sitemesh</artifactId>
+ <version>2.4.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.0.2.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>${aspectj.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>2.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <version>1.0.0.Final</version>
+ </dependency>
+
+ <!-- Neo4j Libraries -->
+
+ <dependency>
+ <groupId>org.neo4j</groupId>
+ <artifactId>neo4j-kernel</artifactId>
+ <version>${neo4j.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>7.1.2.v20100523</version>
+ <configuration>
+ <webAppConfig>
+ <contextPath>/</contextPath>
+ </webAppConfig>
+ <!--scanIntervalSeconds>1</scanIntervalSeconds -->
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <!-- Must use java 1.5 or higher for annotations -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <useFile>true</useFile>
+ <includes>
+ <include>**/*Tests.java</include>
+ <include>**/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Abstract*.java</exclude>
+ </excludes>
+ <junitArtifactName>junit:junit</junitArtifactName>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>aspectj-maven-plugin</artifactId>
+ <version>1.2</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>${aspectj.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjtools</artifactId>
+ <version>${aspectj.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>test-compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outxml>true</outxml>
+ <aspectLibraries>
+ <aspectLibrary>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aspects</artifactId>
+ </aspectLibrary>
+ <aspectLibrary>
+ <groupId>org.springframework.data</groupId>
+ <artifactId>spring-data-neo4j</artifactId>
+ </aspectLibrary>
+ </aspectLibraries>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
View
63 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/controller/AuthController.java
@@ -0,0 +1,63 @@
+package org.neo4j.cineasts.controller;
+
+
+import org.neo4j.cineasts.service.CineastsUserDetailsService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * Handles and retrieves the login or denied page depending on the URI template
+ */
+@Controller
+@RequestMapping("/auth")
+public class AuthController {
+
+ private final static Logger logger = LoggerFactory.getLogger(AuthController.class);
+
+ @Autowired
+ CineastsUserDetailsService userDetailsService;
+ @RequestMapping(value = "/login", method = RequestMethod.GET)
+ public String login(@RequestParam(value = "login_error", required = false) boolean error, Model model) {
+ logger.debug("Received request to show login page, error "+error);
+ if (error) {
+ model.addAttribute("error", "You have entered an invalid username or password!");
+ }
+ return "/auth/loginpage";
+ }
+
+ @RequestMapping(value = "/register", method = RequestMethod.POST)
+ public String register(
+ @RequestParam(value = "j_username") String login,
+ @RequestParam(value = "j_displayname") String name,
+ @RequestParam(value = "j_password") String password,
+ Model model) {
+
+ try {
+ userDetailsService.register(login,name,password);
+ return "forward:/user/"+login;
+ } catch(Exception e) {
+ model.addAttribute("j_username",login);
+ model.addAttribute("j_displayname",name);
+ model.addAttribute("error",e.getMessage());
+ return "/auth/registerpage";
+ }
+ }
+
+ @RequestMapping(value = "/denied", method = RequestMethod.GET)
+ public String denied() {
+ logger.debug("Received request to show denied page");
+ return "/auth/deniedpage";
+ }
+
+ @RequestMapping(value = "/registerpage", method = RequestMethod.GET)
+ public String registerPage() {
+ logger.debug("Received request to show register page");
+ return "/auth/registerpage";
+ }
+}
View
64 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/controller/ImportController.java
@@ -0,0 +1,64 @@
+package org.neo4j.cineasts.controller;
+
+import org.neo4j.cineasts.movieimport.MovieDbImportService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * @author mh
+ * @since 04.03.11
+ */
+@Controller
+public class ImportController {
+
+ private MovieDbImportService importService;
+ private static final Logger log = LoggerFactory.getLogger(ImportController.class);
+
+ @Autowired
+ public ImportController(MovieDbImportService importService) {
+ this.importService = importService;
+ }
+
+ @RequestMapping(value = "/import/{ids}", method = RequestMethod.GET)
+ public String importMovie(@PathVariable String ids, Model model) {
+ long start=System.currentTimeMillis();
+ final Map<Integer, String> movies = importService.importMovies(extractRanges(ids));
+ long duration = (System.currentTimeMillis() - start) / 1000;
+ model.addAttribute("duration", duration);
+ model.addAttribute("ids", ids);
+ model.addAttribute("movies", movies.entrySet());
+ return "import/result";
+ }
+
+
+ private Map<Integer, Integer> extractRanges(String ids) {
+ Map<Integer, Integer> ranges = new LinkedHashMap<Integer, Integer>();
+ StringBuilder errors = new StringBuilder();
+ for (String token : ids.split(",")) {
+ try {
+ if (token.contains("-")) {
+ String[] range = token.split("-");
+ ranges.put(Integer.parseInt(range[0]), Integer.parseInt(range[1]));
+ } else {
+ int id = Integer.parseInt(token);
+ ranges.put(id, id);
+ }
+ } catch (Exception e) {
+ errors.append(token).append(": ").append(e.getMessage()).append("\n");
+ }
+ }
+ if (errors.length() > 0) {
+ throw new RuntimeException("Error parsing ids\n" + errors);
+ }
+ return ranges;
+ }
+}
View
122 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/controller/MovieController.java
@@ -0,0 +1,122 @@
+package org.neo4j.cineasts.controller;
+
+import org.neo4j.cineasts.domain.Movie;
+import org.neo4j.cineasts.domain.Person;
+import org.neo4j.cineasts.domain.Rating;
+import org.neo4j.cineasts.domain.User;
+import org.neo4j.cineasts.service.CineastsUserDetailsService;
+import org.neo4j.cineasts.service.DatabasePopulator;
+import org.neo4j.cineasts.service.CineastsRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author mh
+ * @since 04.03.11
+ */
+@Controller
+public class MovieController {
+
+ private CineastsRepository moviesRepository;
+ private CineastsUserDetailsService userDetailsService;
+ private DatabasePopulator populator;
+ private static final Logger log = LoggerFactory.getLogger(MovieController.class);
+
+ @Autowired
+ public MovieController(CineastsRepository moviesRepository, DatabasePopulator populator, CineastsUserDetailsService userDetailsService) {
+ this.moviesRepository = moviesRepository;
+ this.populator = populator;
+ this.userDetailsService = userDetailsService;
+ }
+
+ // for web service (JSON) clients
+
+ /**
+ * Only matches 'GET /moviies/{id}}' requests for JSON content; a 404 is sent otherwise.
+ * TODO send a 406 if an unsupported representation, such as XML, is requested. See SPR-7353.
+ */
+ @RequestMapping(value = "/movies/{id}", method = RequestMethod.GET, headers = "Accept=application/json")
+ public
+ @ResponseBody
+ Movie getMovie(@PathVariable String id) {
+ return moviesRepository.getMovie(id);
+ }
+
+
+ @RequestMapping(value = "/movies/{movieId}", method = RequestMethod.GET, headers = "Accept=text/html")
+ public String singleMovieView(final Model model, @PathVariable String movieId) {
+ User user = addUser(model);
+ Movie movie = moviesRepository.getMovie(movieId);
+ model.addAttribute("id", movieId);
+ if (movie != null) {
+ model.addAttribute("movie", movie);
+ final int stars = movie.getStars();
+ model.addAttribute("stars", stars);
+ Rating rating = null;
+ if (user!=null) rating = movie.getRelationshipTo(user, Rating.class, "RATED");
+ if (rating == null) rating = new Rating().rate(stars,null);
+ model.addAttribute("userRating",rating);
+ }
+ return "/movies/show";
+ }
+
+ @RequestMapping(value = "/movies/{movieId}", method = RequestMethod.POST, headers = "Accept=text/html")
+ public String updateMovie(Model model, @PathVariable String movieId, @RequestParam(value = "rated",required = false) Integer stars, @RequestParam(value = "comment",required = false) String comment) {
+ Movie movie = moviesRepository.getMovie(movieId);
+ User user = userDetailsService.getUserFromSession();
+ moviesRepository.rateMovie(movie,user, stars==null ? -1 : stars,comment!=null ? comment.trim() : null);
+ return singleMovieView(model,movieId);
+ }
+
+ private User addUser(Model model) {
+ User user = userDetailsService.getUserFromSession();
+ model.addAttribute("user", user);
+ return user;
+ }
+
+ @RequestMapping(value = "/movies", method = RequestMethod.GET, headers = "Accept=text/html")
+ public String findMovies(Model model, @RequestParam("q") String query) {
+ List<Movie> movies = moviesRepository.findMovies(query, 20);
+ model.addAttribute("movies", movies);
+ model.addAttribute("query", query);
+ addUser(model);
+ return "/movies/list";
+ }
+
+ @RequestMapping(value = "/actors/{id}", method = RequestMethod.GET, headers = "Accept=text/html")
+ public String singleActorView(Model model, @PathVariable String id) {
+ Person person = moviesRepository.getPerson(id);
+ model.addAttribute("actor", person);
+ model.addAttribute("id", id);
+ addUser(model);
+ return "/actors/show";
+ }
+
+ //@RequestMapping(value = "/admin/populate", method = RequestMethod.GET)
+ @RequestMapping(value = "/populate", method = RequestMethod.GET)
+ public String populateDatabase(Model model) {
+ Collection<Movie> movies=populator.populateDatabase();
+ model.addAttribute("movies",movies);
+ addUser(model);
+ return "/movies/list";
+ }
+
+ @RequestMapping(value = "/admin/clean", method = RequestMethod.GET)
+ public String clean(Model model) {
+ populator.cleanDb();
+ return "movies/list";
+ }
+
+ @RequestMapping(value = "/", method = RequestMethod.GET)
+ public String index(Model model) {
+ addUser(model);
+ return "index";
+ }
+}
View
61 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/controller/UserController.java
@@ -0,0 +1,61 @@
+package org.neo4j.cineasts.controller;
+
+
+import org.neo4j.cineasts.domain.User;
+import org.neo4j.cineasts.service.CineastsRepository;
+import org.neo4j.cineasts.service.CineastsUserDetailsService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+/**
+ * Handles and retrieves the login or denied page depending on the URI template
+ */
+@Controller
+public class UserController {
+
+ @Autowired CineastsUserDetailsService userDetailsService;
+ @Autowired CineastsRepository repository;
+
+ private final static Logger logger = LoggerFactory.getLogger(UserController.class);
+
+ @RequestMapping(value = "/user", method = RequestMethod.GET)
+ public String profile(Model model) {
+ final User user = userDetailsService.getUserFromSession();
+ model.addAttribute("user", user);
+ model.addAttribute("recommendations", repository.recommendMovies(user, 3));
+ return "/user/index";
+ }
+
+ @RequestMapping(value = "/user/{login}/friends", method = RequestMethod.POST)
+ public String addFriend(Model model, @PathVariable("login") String login) {
+ userDetailsService.addFriend(login);
+ return "forward:/user/"+login;
+ }
+
+ @RequestMapping(value = "/user/{login}")
+ public String publicProfile(Model model, @PathVariable("login") String login) {
+ User profiled = userDetailsService.findUser(login);
+ User user = userDetailsService.getUserFromSession();
+
+ return publicProfile(model, profiled, user);
+ }
+
+ private String publicProfile(Model model, User profiled, User user) {
+ if (profiled.equals(user)) return profile(model);
+
+ model.addAttribute("profiled", profiled);
+ model.addAttribute("user", user);
+ model.addAttribute("isFriend", areFriends(profiled, user));
+ return "/user/public";
+ }
+
+ private boolean areFriends(User user, User loggedIn) {
+ return user!=null && user.isFriend(loggedIn);
+ }
+}
View
225 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/Movie.java
@@ -0,0 +1,225 @@
+package org.neo4j.cineasts.domain;
+
+import org.neo4j.helpers.collection.IteratorUtil;
+import org.springframework.data.graph.annotation.NodeEntity;
+import org.springframework.data.graph.annotation.RelatedTo;
+import org.springframework.data.graph.annotation.RelatedToVia;
+import org.springframework.data.graph.neo4j.annotation.Indexed;
+
+import java.util.*;
+
+import static org.springframework.data.graph.core.Direction.INCOMING;
+
+/**
+ * @author mh
+ * @since 04.03.11
+ */
+@NodeEntity
+public class Movie {
+
+ @Indexed
+ String id;
+
+ @Indexed(fulltext = true, indexName = "search")
+ String title;
+
+ String description;
+
+ @RelatedTo(type="DIRECTED", direction = INCOMING)
+ Person director;
+
+ @RelatedTo(elementClass = Person.class, type = "ACTS_IN", direction = INCOMING)
+ Set<Person> actors;
+
+ @RelatedToVia(elementClass = Role.class, type = "ACTS_IN", direction = INCOMING)
+ Iterable<Role> roles;
+
+ @RelatedToVia(elementClass = Rating.class, type = "RATED", direction = INCOMING)
+ Iterable<Rating> ratings;
+ private String language;
+ private String imdbId;
+ private String tagline;
+ private Date releaseDate;
+ private Integer runtime;
+ private String homepage;
+ private String trailer;
+ private String genre;
+ private String studio;
+ private Integer version;
+ private Date lastModified;
+ private String imageUrl;
+
+ public Movie() {
+ }
+
+ public Movie(String id, String title) {
+ this.id = id;
+ this.title = title;
+ }
+
+ public Collection<Person> getActors() {
+ return actors;
+ }
+
+ public Collection<Role> getRoles() {
+ return IteratorUtil.asCollection(roles);
+ }
+
+ public int getYear() {
+ if (releaseDate==null) return 0;
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(releaseDate);
+ return cal.get(Calendar.YEAR);
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("%s (%s) [%s]", title, releaseDate, id);
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public int getStars() {
+ Iterable<Rating> allRatings = ratings;
+
+ if (allRatings == null) return 0;
+ int stars=0, count=0;
+ for (Rating rating : allRatings) {
+ stars += rating.getStars();
+ count++;
+ }
+ return count==0 ? 0 : stars / count;
+ }
+
+ public Collection<Rating> getRatings() {
+ Iterable<Rating> allRatings = ratings;
+ return allRatings == null ? Collections.<Rating>emptyList() : IteratorUtil.asCollection(allRatings);
+ }
+
+ public Person getDirector() {
+ return director;
+ }
+
+ public void setTitle(String title) {
+ this.title=title;
+ }
+
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ public void setImdbId(String imdbId) {
+ this.imdbId = imdbId;
+ }
+
+ public void setTagline(String tagline) {
+ this.tagline = tagline;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public void setReleaseDate(Date releaseDate) {
+ this.releaseDate = releaseDate;
+ }
+
+ public void setRuntime(Integer runtime) {
+ this.runtime = runtime;
+ }
+
+ public void setHomepage(String homepage) {
+ this.homepage = homepage;
+ }
+
+ public void setTrailer(String trailer) {
+ this.trailer = trailer;
+ }
+
+ public void setGenre(String genre) {
+ this.genre = genre;
+ }
+
+ public void setStudio(String studio) {
+ this.studio = studio;
+ }
+
+ public void setVersion(Integer version) {
+ this.version = version;
+ }
+
+ public void setLastModified(Date lastModified) {
+ this.lastModified = lastModified;
+ }
+
+ public void setImageUrl(String imageUrl) {
+ this.imageUrl = imageUrl;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public String getImdbId() {
+ return imdbId;
+ }
+
+ public String getTagline() {
+ return tagline;
+ }
+
+ public Date getReleaseDate() {
+ return releaseDate;
+ }
+
+ public Integer getRuntime() {
+ return runtime;
+ }
+
+ public String getHomepage() {
+ return homepage;
+ }
+
+ public String getTrailer() {
+ return trailer;
+ }
+
+ public String getGenre() {
+ return genre;
+ }
+
+ public String getStudio() {
+ return studio;
+ }
+
+ public Integer getVersion() {
+ return version;
+ }
+
+ public Date getLastModified() {
+ return lastModified;
+ }
+
+ public String getImageUrl() {
+ return imageUrl;
+ }
+
+ public String getYoutubeId() {
+ String trailerUrl = trailer;
+ if (trailerUrl==null || !trailerUrl.contains("youtu")) return null;
+ String[] parts = trailerUrl.split("[=/]");
+ int numberOfParts = parts.length;
+ return numberOfParts > 0 ? parts[numberOfParts-1] : null;
+ }
+}
+
View
124 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/Person.java
@@ -0,0 +1,124 @@
+package org.neo4j.cineasts.domain;
+
+import org.springframework.data.graph.annotation.NodeEntity;
+import org.springframework.data.graph.annotation.RelatedTo;
+import org.springframework.data.graph.annotation.RelatedToVia;
+import org.springframework.data.graph.neo4j.annotation.Indexed;
+
+import java.util.Date;
+import java.util.Set;
+
+/**
+ * @author mh
+ * @since 12.03.11
+ */
+@NodeEntity
+public class Person {
+ @Indexed
+ String id;
+ String name;
+ private Date birthday;
+ private String birthplace;
+ private String biography;
+ private Integer version;
+ private Date lastModified;
+ private String profileImageUrl;
+
+ public Person(String id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public Person() {
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("%s [%s]", name, id);
+ }
+
+ public void setBirthday(Date birthday) {
+ this.birthday = birthday;
+ }
+
+ public void setBirthplace(String birthplace) {
+ this.birthplace = birthplace;
+ }
+
+ public void setBiography(String biography) {
+ this.biography = biography;
+ }
+
+ public void setVersion(Integer version) {
+ this.version = version;
+ }
+
+ public void setLastModified(Date lastModified) {
+ this.lastModified = lastModified;
+ }
+
+ public Date getBirthday() {
+ return birthday;
+ }
+
+ public String getBirthplace() {
+ return birthplace;
+ }
+
+ public String getBiography() {
+ return biography;
+ }
+
+ public Integer getVersion() {
+ return version;
+ }
+
+ public Date getLastModified() {
+ return lastModified;
+ }
+
+ public void setProfileImageUrl(String profileImageUrl) {
+ this.profileImageUrl = profileImageUrl;
+ }
+
+ public String getProfileImageUrl() {
+ return profileImageUrl;
+ }
+
+ @RelatedTo(elementClass = Movie.class, type = "DIRECTED")
+ private Set<Movie> directedMovies;
+
+ public Set<Movie> getDirectedMovies() {
+ return directedMovies;
+ }
+
+ public void directed(Movie movie) {
+ this.directedMovies.add(movie);
+ }
+
+ @RelatedToVia(elementClass = Role.class, type = "ACTS_IN")
+ Iterable<Role> roles;
+
+ public Iterable<Role> getRoles() {
+ return roles;
+ }
+
+ public Role playedIn(Movie movie, String roleName) {
+ Role role = relateTo(movie, Role.class, "ACTS_IN");
+ role.setName(roleName);
+ return role;
+ }
+
+}
View
52 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/Rating.java
@@ -0,0 +1,52 @@
+package org.neo4j.cineasts.domain;
+
+import org.springframework.data.graph.annotation.EndNode;
+import org.springframework.data.graph.annotation.RelationshipEntity;
+import org.springframework.data.graph.annotation.StartNode;
+
+/**
+ * @author mh
+ * @since 04.03.11
+ */
+@RelationshipEntity
+public class Rating {
+ private static final int MAX_STARS = 5;
+ private static final int MIN_STARS = 0;
+
+ @StartNode
+ User user;
+ @EndNode Movie movie;
+
+ int stars;
+ String comment;
+
+ public User getUser() {
+ return user;
+ }
+
+ public Movie getMovie() {
+ return movie;
+ }
+
+ public int getStars() {
+ return stars;
+ }
+
+ public void setStars(int stars) {
+ this.stars = stars;
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ public void setComment(String comment) {
+ this.comment = comment;
+ }
+
+ public Rating rate(int stars, String comment) {
+ if (stars>= MIN_STARS && stars <= MAX_STARS) this.stars=stars;
+ if (comment!=null && !comment.isEmpty()) this.comment = comment;
+ return this;
+ }
+}
View
38 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/Role.java
@@ -0,0 +1,38 @@
+package org.neo4j.cineasts.domain;
+
+import org.springframework.data.graph.annotation.EndNode;
+import org.springframework.data.graph.annotation.RelationshipEntity;
+import org.springframework.data.graph.annotation.StartNode;
+
+/**
+ * @author mh
+ * @since 04.03.11
+ */
+@RelationshipEntity
+public class Role {
+ @EndNode Movie movie;
+ @StartNode Person actor;
+
+ String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Movie getMovie() {
+ return movie;
+ }
+
+ public Person getActor() {
+ return actor;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("%s acts as %s in %s", actor, name, movie);
+ }
+}
View
9 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/Roles.java
@@ -0,0 +1,9 @@
+package org.neo4j.cineasts.domain;
+
+/**
+* @author mh
+* @since 12.03.11
+*/
+public enum Roles {
+ ACTS_IN, DIRECTED
+}
View
117 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/domain/User.java
@@ -0,0 +1,117 @@
+package org.neo4j.cineasts.domain;
+
+import org.neo4j.helpers.collection.IteratorUtil;
+import org.springframework.data.graph.annotation.NodeEntity;
+import org.springframework.data.graph.annotation.RelatedTo;
+import org.springframework.data.graph.annotation.RelatedToVia;
+import org.springframework.data.graph.core.Direction;
+import org.springframework.data.graph.neo4j.annotation.Indexed;
+import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
+import org.springframework.security.core.GrantedAuthority;
+
+import java.util.Collection;
+import java.util.Set;
+
+@NodeEntity
+public class User {
+ private static final String SALT = "cewuiqwzie";
+ public static final String FRIEND = "FRIEND";
+ public static final String RATED = "RATED";
+ @Indexed
+ String login;
+ String name;
+ String password;
+ String info;
+ private Roles[] roles;
+
+ public User() {
+ }
+
+ public User(String login, String name, String password, Roles... roles) {
+ this.login = login;
+ this.name = name;
+ this.password = encode(password);
+ this.roles = roles;
+ }
+
+ private String encode(String password) {
+ return new Md5PasswordEncoder().encodePassword(password, SALT);
+ }
+
+ @RelatedToVia(elementClass = Rating.class, type = RATED)
+ Iterable<Rating> ratings;
+
+ @RelatedTo(elementClass = Movie.class, type = RATED)
+ Set<Movie> favorites;
+
+
+ @RelatedTo(elementClass = User.class, type = FRIEND, direction = Direction.BOTH)
+ Set<User> friends;
+
+ public void addFriend(User friend) {
+ this.friends.add(friend);
+ }
+
+ public Rating rate(Movie movie, int stars, String comment) {
+ return relateTo(movie, Rating.class, RATED).rate(stars, comment);
+ }
+
+ public Collection<Rating> getRatings() {
+ return IteratorUtil.asCollection(ratings);
+ }
+
+ @Override
+ public String toString() {
+ return String.format("%s (%s)", name, login);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Set<User> getFriends() {
+ return friends;
+ }
+
+ public Roles[] getRole() {
+ return roles;
+ }
+
+
+ public String getLogin() {
+ return login;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public String getInfo() {
+ return info;
+ }
+ public void setInfo(String info) {
+ this.info = info;
+ }
+ public void updatePassword(String old, String newPass1, String newPass2) {
+ if (!password.equals(encode(old))) throw new IllegalArgumentException("Existing Password invalid");
+ if (!newPass1.equals(newPass2)) throw new IllegalArgumentException("New Passwords don't match");
+ this.password = encode(newPass1);
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isFriend(User other) {
+ return other!=null && getFriends().contains(other);
+ }
+
+ public enum Roles implements GrantedAuthority {
+ ROLE_USER, ROLE_ADMIN;
+
+ @Override
+ public String getAuthority() {
+ return name();
+ }
+ }
+}
View
46 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/movieimport/MovieDbApiClient.java
@@ -0,0 +1,46 @@
+package org.neo4j.cineasts.movieimport;
+
+import org.codehaus.jackson.map.ObjectMapper;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public class MovieDbApiClient {
+
+ private final String baseUrl = "http://api.themoviedb.org/";
+ private final String apiKey;
+ protected final ObjectMapper mapper;
+
+ public MovieDbApiClient(String apiKey) {
+ this.apiKey = apiKey;
+ mapper = new ObjectMapper();
+ }
+
+ public Map getMovie(String id) {
+ return loadJsonData(id, buildMovieUrl(id));
+ }
+
+ private Map loadJsonData(String id, String url) {
+ try {
+ List value = mapper.readValue(new URL(url), List.class);
+ if (value.isEmpty() || value.get(0).equals("Nothing found.")) return Collections.singletonMap("not_found",System.currentTimeMillis());
+ return (Map) value.get(0);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to get data from " + url, e);
+ }
+ }
+
+ private String buildMovieUrl(String movieId) {
+ return String.format("%s2.1/Movie.getInfo/en/json/%s/%s", baseUrl, apiKey, movieId);
+ }
+
+ public Map getPerson(String id) {
+ return loadJsonData(id, buildPersonUrl(id));
+ }
+
+ private String buildPersonUrl(String personId) {
+ return String.format("%s2.1/Person.getInfo/en/json/%s/%s", baseUrl, apiKey, personId);
+ }
+}
View
14 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/movieimport/MovieDbException.java
@@ -0,0 +1,14 @@
+package org.neo4j.cineasts.movieimport;
+
+public class MovieDbException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ public MovieDbException(String message) {
+ super(message);
+ }
+
+ public MovieDbException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
View
128 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/movieimport/MovieDbImportService.java
@@ -0,0 +1,128 @@
+package org.neo4j.cineasts.movieimport;
+
+import org.neo4j.cineasts.domain.*;
+import org.neo4j.cineasts.service.CineastsRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+@Service
+public class MovieDbImportService {
+
+ private static final Logger logger = LoggerFactory.getLogger(MovieDbImportService.class);
+ MovieDbJsonMapper movieDbJsonMapper = new MovieDbJsonMapper();
+
+ @Autowired
+ CineastsRepository moviesRepository;
+
+ @Autowired
+ MovieDbApiClient client;
+
+ @Autowired
+ MovieDbLocalStorage localStorage;
+
+ @Transactional
+ public Map<Integer, String> importMovies(Map<Integer, Integer> ranges) {
+ final Map<Integer,String> movies=new LinkedHashMap<Integer, String>();
+ for (Map.Entry<Integer, Integer> entry : ranges.entrySet()) {
+ for (int id = entry.getKey(); id <= entry.getValue(); id++) {
+ String result = importMovieFailsafe(id);
+ movies.put(id, result);
+ }
+ }
+ return movies;
+ }
+
+ private String importMovieFailsafe(Integer id) {
+ try {
+ Movie movie = doImportMovie(String.valueOf(id));
+ return movie.getTitle();
+ } catch (Exception e) {
+ return e.getMessage();
+ }
+ }
+
+ @Transactional
+ public Movie importMovie(String movieId) {
+ return doImportMovie(movieId);
+ }
+
+ private Movie doImportMovie(String movieId) {
+ logger.debug("Importing movie " + movieId);
+
+ Movie movie = moviesRepository.getMovie(movieId);
+ if (movie == null) { // Not found: Create fresh
+ movie = new Movie(movieId,null);
+ }
+
+ Map data = loadMovieData(movieId);
+ if (data.containsKey("not_found")) throw new RuntimeException("Data for Movie "+movieId+" not found.");
+ movieDbJsonMapper.mapToMovie(data, movie);
+ movie.persist();
+ relatePersonsToMovie(movie, data);
+ return movie;
+ }
+
+ private Map loadMovieData(String movieId) {
+ if (localStorage.hasMovie(movieId)) {
+ return localStorage.loadMovie(movieId);
+ }
+
+ Map data = client.getMovie(movieId);
+ localStorage.storeMovie(movieId, data);
+ return data;
+ }
+
+ private void relatePersonsToMovie(Movie movie, Map data) {
+ Collection<Map> cast = (Collection<Map>) data.get("cast");
+ for (Map entry : cast) {
+ String id = "" + entry.get("id");
+ String jobName = (String) entry.get("job");
+ Roles job = movieDbJsonMapper.mapToRole(jobName);
+ if (job==null) {
+ if (logger.isInfoEnabled()) logger.info("Could not add person with job "+jobName+" "+entry);
+ continue;
+ }
+ Person person = doImportPerson(id);
+ switch (job) {
+ case DIRECTED:
+ person.directed(movie);
+ break;
+ case ACTS_IN:
+ person.playedIn(movie, (String) entry.get("character"));
+ break;
+ }
+ }
+ }
+
+ @Transactional
+ public Person importPerson(String personId) {
+ return doImportPerson(personId);
+ }
+
+ private Person doImportPerson(String personId) {
+ logger.debug("Importing person " + personId);
+ Person person = moviesRepository.getPerson(personId);
+ if (person!=null) return person;
+ Map data = loadPersonData(personId);
+ if (data.containsKey("not_found")) throw new RuntimeException("Data for Person "+personId+" not found.");
+ Person newPerson=new Person(personId,null);
+ movieDbJsonMapper.mapToPerson(data, newPerson);
+ return newPerson.persist();
+ }
+
+ private Map loadPersonData(String personId) {
+ if (localStorage.hasPerson(personId)) {
+ return localStorage.loadPerson(personId);
+ }
+ Map data = client.getPerson(personId);
+ localStorage.storePerson(personId, data);
+ return localStorage.loadPerson(personId);
+ }
+}
View
704 spring-data-neo4j-examples/cineasts/src/main/java/org/neo4j/cineasts/movieimport/MovieDbJsonMapper.java
@@ -0,0 +1,704 @@
+package org.neo4j.cineasts.movieimport;
+
+import org.neo4j.cineasts.domain.Movie;
+import org.neo4j.cineasts.domain.Person;
+import org.neo4j.cineasts.domain.Roles;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class MovieDbJsonMapper {
+
+ public void mapToMovie(Map data, Movie movie) {
+ try {
+ movie.setTitle((String) data.get("name"));
+ movie.setLanguage((String) data.get("language"));
+ movie.setImdbId((String) data.get("imdb_id"));
+ movie.setTagline((String) data.get("tagline"));
+ movie.setDescription(limit((String) data.get("overview"), 500));
+ movie.setReleaseDate(toDate(data, "released", "yyyy-MM-dd"));
+ movie.setRuntime((Integer) data.get("runtime"));
+ movie.setHomepage((String) data.get("homepage"));
+ movie.setTrailer((String) data.get("trailer"));
+ movie.setGenre(extractFirst(data, "genres", "name"));
+ movie.setStudio(extractFirst(data,"studios", "name"));
+ movie.setVersion((Integer)data.get("version"));
+ movie.setLastModified(toDate(data,"last_modified_at","yyyy-MM-dd HH:mm:ss"));
+ movie.setImageUrl(selectImageUrl((List<Map>) data.get("posters"), "poster", "mid"));
+ } catch (Exception e) {
+ throw new MovieDbException("Failed to map json for movie", e);
+ }
+ }
+
+ private String selectImageUrl(List<Map> data, final String type, final String size) {
+ if (data==null) return null;
+ for (Map entry : data) {
+ Map image = (Map) entry.get("image");
+ if (image.get("type").equals(type) && image.get("size").equals(size)) return (String) image.get("url");
+ }
+ return null;
+ }
+
+
+ private String extractFirst(Map data, String field, String property) {
+ List<Map> inner = (List<Map>) data.get(field);
+ if (inner == null || inner.isEmpty()) return null;
+ return (String) inner.get(0).get(property);
+ }
+
+ private Date toDate(Map data, String field, final String pattern) throws ParseException {
+ String dateString = (String) data.get(field);
+ if (dateString == null || dateString.isEmpty()) return null;
+ return new SimpleDateFormat(pattern).parse(dateString);
+ }
+
+ /*
+ [{"popularity":3,
+"translated":true,
+"adult":false,
+"language":"en",
+"original_name":"[Rec]",
+"name":"[Rec]",
+"alternative_name":"[REC]",
+"movie_type":"movie",
+"id":8329,
+"imdb_id":"tt1038988",
+"url":"http://www.themoviedb.org/movie/8329",
+"votes":11,
+"rating":7.2,
+"status":"Released",
+"tagline":"One Witness. One Camera",
+"certification":"R",
+"overview":"\"REC\" turns on a young TV reporter and her cameraman who cover the night shift at the local fire station. Receiving a call from an old lady trapped in her house,
+they reach her building to hear horrifying screams -- which begin a long nightmare and a uniquely dramatic TV report.",
+"keywords":["terror",
+"lebende leichen",
+"obsession",
+"camcorder",
+"firemen",
+"reality tv ",
+"bite",
+"cinematographer",
+"attempt to escape",
+"virus",
+"lodger",
+"live-reportage",
+"schwerverletzt"],
+"released":"2007-08-29",
+"runtime":78,
+"budget":0,
+"revenue":0,
+"homepage":"http://www.3l-filmverleih.de/rec",
+"trailer":"http://www.youtube.com/watch?v=YQUkX_XowqI",
+"genres":[{"type":"genre",
+"url":"http://themoviedb.org/genre/horror",
+"name":"Horror",
+"id":27}],
+"studios":[{"url":"http://www.themoviedb.org/company/2270",
+"name":"Filmax Group",
+"id":2270}],
+"languages_spoken":[{"code":"es",
+"name":"Spanish",
+"native_name":"Espa\u00f1ol"}],
+"countries":[{"code":"ES",
+"name":"Spain",
+"url":"http://www.themoviedb.org/country/es"}],
+"posters":[{"image":{"type":"poster",
+"size":"original",
+"height":1000,
+"width":706,
+"url":"http://cf1.imgobject.com/posters/3a0/4cc8df415e73d650240003a0/rec-original.jpg",
+"id":"4cc8df415e73d650240003a0"}},
+{"image":{"type":"poster",
+"size":"mid",
+"height":708,
+"width":500,
+"url":"http://cf1.imgobject.com/posters/3a0/4cc8df415e73d650240003a0/rec-mid.jpg",
+"id":"4cc8df415e73d650240003a0"}},
+{"image":{"type":"poster",
+"size":"cover",
+"height":262,
+"width":185,
+"url":"http://cf1.imgobject.com/posters/3a0/4cc8df415e73d650240003a0/rec-cover.jpg",
+"id":"4cc8df415e73d650240003a0"}},
+{"image":{"type":"poster",
+"size":"thumb",
+"height":130,
+"width":92,
+"url":"http://cf1.imgobject.com/posters/3a0/4cc8df415e73d650240003a0/rec-thumb.jpg",
+"id":"4cc8df415e73d650240003a0"}},
+{"image":{"type":"poster",
+"size":"original",
+"height":1000,
+"width":711,
+"url":"http://cf1.imgobject.com/posters/1e7/4bc92117017a3c57fe00d1e7/rec-original.jpg",
+"id":"4bc92117017a3c57fe00d1e7"}},
+{"image":{"type":"poster",
+"size":"mid",
+"height":703,
+"width":500,
+"url":"http://cf1.imgobject.com/posters/1e7/4bc92117017a3c57fe00d1e7/rec-mid.jpg",
+"id":"4bc92117017a3c57fe00d1e7"}},
+{"image":{"type":"poster",
+"size":"cover",
+"height":260,
+"width":185,
+"url":"http://cf1.imgobject.com/posters/1e7/4bc92117017a3c57fe00d1e7/rec-cover.jpg",
+"id":"4bc92117017a3c57fe00d1e7"}},
+{"image":{"type":"poster",
+"size":"thumb",
+"height":129,
+"width":92,
+"url":"http://cf1.imgobject.com/posters/1e7/4bc92117017a3c57fe00d1e7/rec-thumb.jpg",
+"id":"4bc92117017a3c57fe00d1e7"}},
+{"image":{"type":"poster",
+"size":"original",
+"height":1500,
+"width":1000,
+"url":"http://cf1.imgobject.com/posters/1ec/4bc92118017a3c57fe00d1ec/rec-original.jpg",
+"id":"4bc92118017a3c57fe00d1ec"}},
+{"image":{"type":"poster",
+"size":"mid",
+"height":750,
+"width":500,
+"url":"http://cf1.imgobject.com/posters/1ec/4bc92118017a3c57fe00d1ec/rec-mid.jpg",
+"id":"4bc92118017a3c57fe00d1ec"}},
+{"image":{"type":"poster",
+"size":"cover",
+"height":278,
+"width":185,
+"url":"http://cf1.imgobject.com/posters/1ec/4bc92118017a3c57fe00d1ec/rec-cover.jpg",
+"id":"4bc92118017a3c57fe00d1ec"}},
+{"image":{"type":"poster",
+"size":"thumb",
+"height":138,
+"width":92,
+"url":"http://cf1.imgobject.com/posters/1ec/4bc92118017a3c57fe00d1ec/rec-thumb.jpg",
+"id":"4bc92118017a3c57fe00d1ec"}},
+{"image":{"type":"poster",
+"size":"original",
+"height":1429,
+"width":1000,
+"url":"http://cf1.imgobject.com/posters/1f1/4bc92118017a3c57fe00d1f1/rec-original.jpg",
+"id":"4bc92118017a3c57fe00d1f1"}},
+{"image":{"type":"poster",
+"size":"mid",
+"height":715,
+"width":500,
+"url":"http://cf1.imgobject.com/posters/1f1/4bc92118017a3c57fe00d1f1/rec-mid.jpg",
+"id":"4bc92118017a3c57fe00d1f1"}},
+{"image":{"type":"poster",
+"size":"cover",
+"height":265,
+"width":185,
+"url":"http://cf1.imgobject.com/posters/1f1/4bc92118017a3c57fe00d1f1/rec-cover.jpg",
+"id":"4bc92118017a3c57fe00d1f1"}},
+{"image":{"type":"poster",
+"size":"thumb",
+"height":132,
+"width":92,
+"url":"http://cf1.imgobject.com/posters/1f1/4bc92118017a3c57fe00d1f1/rec-thumb.jpg",
+"id":"4bc92118017a3c57fe00d1f1"}},
+{"image":{"type":"poster",
+"size":"original",
+"height":1125,
+"width":800,
+"url":"http://cf1.imgobject.com/posters/1f6/4bc92118017a3c57fe00d1f6/rec-original.jpg",
+"id":"4bc92118017a3c57fe00d1f6"}},
+{"image":{"type":"poster",
+"size":"mid",
+"height":703,
+"width":500,
+"url":"http://cf1.imgobject.com/posters/1f6/4bc92118017a3c57fe00d1f6/rec-mid.jpg",
+"id":"4bc92118017a3c57fe00d1f6"}},
+{"image":{"type":"poster",
+"size":"cover",
+"height":260,
+"width":185,
+"url":"http://cf1.imgobject.com/posters/1f6/4bc92118017a3c57fe00d1f6/rec-cover.jpg",
+"id":"4bc92118017a3c57fe00d1f6"}},
+{"image":{"type":"poster",
+"size":"thumb",
+"height":129,
+"width":92,
+"url":"http://cf1.imgobject.com/posters/1f6/4bc92118017a3c57fe00d1f6/rec-thumb.jpg",
+"id":"4bc92118017a3c57fe00d1f6"}}],
+"backdrops":[{"image":{"type":"backdrop",
+"size":"original",
+"height":1080,
+"width":1920,
+"url":"http://cf1.imgobject.com/backdrops/1df/4bc92117017a3c57fe00d1df/rec-original.jpg",
+"id":"4bc92117017a3c57fe00d1df"}},
+{"image":{"type":"backdrop",
+"size":"poster",
+"height":439,
+"width":780,
+"url":"http://cf1.imgobject.com/backdrops/1df/4bc92117017a3c57fe00d1df/rec-poster.jpg",
+"id":"4bc92117017a3c57fe00d1df"}},
+{"image":{"type":"backdrop",
+"size":"thumb",
+"height":169,
+"width":300,
+"url":"http://cf1.imgobject.com/backdrops/1df/4bc92117017a3c57fe00d1df/rec-thumb.jpg",
+"id":"4bc92117017a3c57fe00d1df"}},
+{"image":{"type":"backdrop",
+"size":"original",
+"height":1080,
+"width":1920,
+"url":"http://cf1.imgobject.com/backdrops/1d7/4bc92113017a3c57fe00d1d7/rec-original.jpg",
+"id":"4bc92113017a3c57fe00d1d7"}},
+{"image":{"type":"backdrop",
+"size":"poster",
+"height":439,
+"width":780,
+"url":"http://cf1.imgobject.com/backdrops/1d7/4bc92113017a3c57fe00d1d7/rec-poster.jpg",
+"id":"4bc92113017a3c57fe00d1d7"}},
+{"image":{"type":"backdrop",
+"size":"thumb",
+"height":169,
+"width":300,
+"url":"http://cf1.imgobject.com/backdrops/1d7/4bc92113017a3c57fe00d1d7/rec-thumb.jpg",
+"id":"4bc92113017a3c57fe00d1d7"}},
+{"image":{"type":"backdrop",
+"size":"original",
+"height":1080,
+"width":1920,
+"url":"http://cf1.imgobject.com/backdrops/1e3/4bc92117017a3c57fe00d1e3/rec-original.jpg",
+"id":"4bc92117017a3c57fe00d1e3"}},
+{"image":{"type":"backdrop",
+"size":"poster",
+"height":439,
+"width":780,
+"url":"http://cf1.imgobject.com/backdrops/1e3/4bc92117017a3c57fe00d1e3/rec-poster.jpg",
+"id":"4bc92117017a3c57fe00d1e3"}},
+{"image":{"type":"backdrop",
+"size":"thumb",
+"height":169,
+"width":300,
+"url":"http://cf1.imgobject.com/backdrops/1e3/4bc92117017a3c57fe00d1e3/rec-thumb.jpg",
+"id":"4bc92117017a3c57fe00d1e3"}},
+{"image":{"type":"backdrop",
+"size":"original",
+"height":1080,
+"width":1920,
+"url":"http://cf1.imgobject.com/backdrops/1d3/4bc92113017a3c57fe00d1d3/rec-original.jpg",
+"id":"4bc92113017a3c57fe00d1d3"}},
+{"image":{"type":"backdrop",
+"size":"poster",
+"height":439,
+"width":780,
+"url":"http://cf1.imgobject.com/backdrops/1d3/4bc92113017a3c57fe00d1d3/rec-poster.jpg",
+"id":"4bc92113017a3c57fe00d1d3"}},
+{"image":{"type":"backdrop",
+"size":"thumb",
+"height":169,
+"width":300,
+"url":"http://cf1.imgobject.com/backdrops/1d3/4bc92113017a3c57fe00d1d3/rec-thumb.jpg",
+"id":"4bc92113017a3c57fe00d1d3"}},
+{"image":{"type":"backdrop",
+"size":"original",
+"height":1080,
+"width":1920,
+"url":"http://cf1.imgobject.com/backdrops/1db/4bc92114017a3c57fe00d1db/rec-original.jpg",
+"id":"4bc92114017a3c57fe00d1db"}},
+{"image":{"type":"backdrop",
+"size":"poster",
+"height":439,
+"width":780,
+"url":"http://cf1.imgobject.com/backdrops/1db/4bc92114017a3c57fe00d1db/rec-poster.jpg",
+"id":"4bc92114017a3c57fe00d1db"}},
+{"image":{"type":"backdrop",
+"size":"thumb",
+"height":169,
+"width":300,
+"url":"http://cf1.imgobject.com/backdrops/1db/4bc92114017a3c57fe00d1db/rec-thumb.jpg",
+"id":"4bc92114017a3c57fe00d1db"}},
+{"image":{"type":"backdrop",
+"size":"original",
+"height":1080,
+"width":1920,
+"url":"http://cf1.imgobject.com/backdrops/6f4/4d0e39c25e73d637100016f4/rec-original.jpg",
+"id":"4d0e39c25e73d637100016f4"}},
+{"image":{"type":"backdrop",
+"size":"poster",
+"height":439,
+"width":780,
+"url":"http://cf1.imgobject.com/backdrops/6f4/4d0e39c25e73d637100016f4/rec-poster.jpg",
+"id":"4d0e39c25e73d637100016f4"}},
+{"image":{"type":"backdrop",
+"size":"thumb",
+"height":169,
+"width":300,
+"url":"http://cf1.imgobject.com/backdrops/6f4/4d0e39c25e73d637100016f4/rec-thumb.jpg",
+"id":"4d0e39c25e73d637100016f4"}},
+{"image":{"type":"backdrop",
+"size":"original",
+"height":1080,
+"width":1920,
+"url":"http://cf1.imgobject.com/backdrops/567/4d0e39dd5e73d6370a001567/rec-original.jpg",
+"id":"4d0e39dd5e73d6370a001567"}},
+{"image":{"type":"backdrop",
+"size":"poster",
+"height":439,
+"width":780,
+"url":"http://cf1.imgobject.com/backdrops/567/4d0e39dd5e73d6370a001567/rec-poster.jpg",
+"id":"4d0e39dd5e73d6370a001567"}},
+{"image":{"type":"backdrop",
+"size":"thumb",
+"height":169,
+"width":300,
+"url":"http://cf1.imgobject.com/backdrops/567/4d0e39dd5e73d6370a001567/rec-thumb.jpg",
+"id":"4d0e39dd5e73d6370a001567"}},
+{"image":{"type":"backdrop",
+"size":"original",
+"height":1080,
+"width":1920,
+"url":"http://cf1.imgobject.com/backdrops/58a/4d0e39fb5e73d6371c00158a/rec-original.jpg",
+"id":"4d0e39fb5e73d6371c00158a"}},
+{"image":{"type":"backdrop",
+"size":"poster",
+"height":439,
+"width":780,
+"url":"http://cf1.imgobject.com/backdrops/58a/4d0e39fb5e73d6371c00158a/rec-poster.jpg",
+"id":"4d0e39fb5e73d6371c00158a"}},
+{"image":{"type":"backdrop",
+"size":"thumb",
+"height":169,
+"width":300,
+"url":"http://cf1.imgobject.com/backdrops/58a/4d0e39fb5e73d6371c00158a/rec-thumb.jpg",