├── myrestaurants-original ├── .gitignore ├── .settings │ ├── org.eclipse.wst.jsdt.ui.superType.name │ ├── org.eclipse.wst.jsdt.ui.superType.container │ ├── org.eclipse.jdt.core.prefs │ ├── org.maven.ide.eclipse.prefs │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── .jsdtscope │ ├── org.eclipse.wst.common.component │ └── org.eclipse.wst.validation.prefs ├── src │ └── main │ │ ├── webapp │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ ├── WEB-INF │ │ │ ├── classes │ │ │ │ ├── alt.properties │ │ │ │ └── standard.properties │ │ │ ├── views │ │ │ │ ├── index-template.jspx │ │ │ │ ├── header.jspx │ │ │ │ ├── index.jspx │ │ │ │ ├── restaurants │ │ │ │ │ ├── update.jspx │ │ │ │ │ ├── views.xml │ │ │ │ │ ├── show.jspx │ │ │ │ │ ├── list.jspx │ │ │ │ │ └── create.jspx │ │ │ │ ├── useraccounts │ │ │ │ │ ├── views.xml │ │ │ │ │ ├── update.jspx │ │ │ │ │ ├── list.jspx │ │ │ │ │ ├── create.jspx │ │ │ │ │ └── show.jspx │ │ │ │ ├── views.xml │ │ │ │ ├── resourceNotFound.jspx │ │ │ │ ├── uncaughtException.jspx │ │ │ │ ├── dataAccessFailure.jspx │ │ │ │ ├── footer.jspx │ │ │ │ └── menu.jspx │ │ │ ├── tags │ │ │ │ ├── util │ │ │ │ │ ├── placeholder.tagx │ │ │ │ │ ├── load-scripts.tagx │ │ │ │ │ ├── theme.tagx │ │ │ │ │ ├── language.tagx │ │ │ │ │ └── panel.tagx │ │ │ │ ├── menu │ │ │ │ │ ├── menu.tagx │ │ │ │ │ ├── category.tagx │ │ │ │ │ └── item.tagx │ │ │ │ └── form │ │ │ │ │ └── dependency.tagx │ │ │ ├── layouts │ │ │ │ ├── layouts.xml │ │ │ │ └── default.jspx │ │ │ └── i18n │ │ │ │ └── application.properties │ │ └── images │ │ │ ├── add.png │ │ │ ├── en.png │ │ │ ├── list.png │ │ │ ├── show.png │ │ │ ├── create.png │ │ │ ├── delete.png │ │ │ ├── update.png │ │ │ ├── fav-del.png │ │ │ ├── fav-new.png │ │ │ ├── favicon.ico │ │ │ ├── spring-logo.png │ │ │ ├── banner-graphic.png │ │ │ ├── resultset_last.png │ │ │ ├── resultset_next.png │ │ │ ├── resultset_first.png │ │ │ ├── resultset_previous.png │ │ │ └── springsource-logo.png │ │ ├── resources │ │ ├── META-INF │ │ │ ├── spring │ │ │ │ └── database.properties │ │ │ └── persistence.xml │ │ ├── schema.sql │ │ └── log4j.properties │ │ └── java │ │ └── com │ │ └── springone │ │ └── myrestaurants │ │ ├── dao │ │ ├── RestaurantDao.java │ │ └── UserAccountDao.java │ │ ├── web │ │ └── BaseApplicationController.java │ │ └── domain │ │ └── Restaurant.java ├── .springBeans ├── .classpath └── .project ├── myrestaurants-social ├── .gitignore ├── .settings │ ├── org.eclipse.wst.jsdt.ui.superType.name │ ├── org.eclipse.wst.jsdt.ui.superType.container │ ├── org.eclipse.wst.ws.service.policy.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.maven.ide.eclipse.prefs │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── .jsdtscope │ ├── org.eclipse.wst.common.component │ ├── org.eclipse.wst.validation.prefs │ └── org.eclipse.jst.jsp.core.prefs ├── src │ ├── main │ │ ├── webapp │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ ├── WEB-INF │ │ │ │ ├── classes │ │ │ │ │ ├── alt.properties │ │ │ │ │ └── standard.properties │ │ │ │ ├── views │ │ │ │ │ ├── topn │ │ │ │ │ │ ├── views.xml │ │ │ │ │ │ └── list.jspx │ │ │ │ │ ├── index-template.jspx │ │ │ │ │ ├── friends │ │ │ │ │ │ ├── show.jspx │ │ │ │ │ │ ├── update.jspx │ │ │ │ │ │ ├── list.jspx │ │ │ │ │ │ ├── create.jspx │ │ │ │ │ │ └── views.xml │ │ │ │ │ ├── header.jspx │ │ │ │ │ ├── index.jspx │ │ │ │ │ ├── restaurants │ │ │ │ │ │ ├── update.jspx │ │ │ │ │ │ ├── views.xml │ │ │ │ │ │ ├── show.jspx │ │ │ │ │ │ ├── list.jspx │ │ │ │ │ │ └── create.jspx │ │ │ │ │ ├── recommendations │ │ │ │ │ │ ├── show.jspx │ │ │ │ │ │ ├── list.jspx │ │ │ │ │ │ ├── views.xml │ │ │ │ │ │ ├── update.jspx │ │ │ │ │ │ └── create.jspx │ │ │ │ │ ├── useraccounts │ │ │ │ │ │ ├── views.xml │ │ │ │ │ │ ├── list.jspx │ │ │ │ │ │ ├── update.jspx │ │ │ │ │ │ ├── create.jspx │ │ │ │ │ │ └── show.jspx │ │ │ │ │ ├── views.xml │ │ │ │ │ ├── resourceNotFound.jspx │ │ │ │ │ ├── uncaughtException.jspx │ │ │ │ │ ├── dataAccessFailure.jspx │ │ │ │ │ └── footer.jspx │ │ │ │ ├── tags │ │ │ │ │ ├── util │ │ │ │ │ │ ├── placeholder.tagx │ │ │ │ │ │ ├── load-scripts.tagx │ │ │ │ │ │ ├── theme.tagx │ │ │ │ │ │ ├── language.tagx │ │ │ │ │ │ └── panel.tagx │ │ │ │ │ ├── menu │ │ │ │ │ │ ├── menu.tagx │ │ │ │ │ │ ├── category.tagx │ │ │ │ │ │ └── item.tagx │ │ │ │ │ └── form │ │ │ │ │ │ └── dependency.tagx │ │ │ │ └── layouts │ │ │ │ │ ├── layouts.xml │ │ │ │ │ └── default.jspx │ │ │ └── images │ │ │ │ ├── add.png │ │ │ │ ├── en.png │ │ │ │ ├── Thumbs.db │ │ │ │ ├── create.png │ │ │ │ ├── delete.png │ │ │ │ ├── list.png │ │ │ │ ├── show.png │ │ │ │ ├── update.png │ │ │ │ ├── fav-del.png │ │ │ │ ├── fav-new.png │ │ │ │ ├── favicon.ico │ │ │ │ ├── thumbsup.png │ │ │ │ ├── recommend.gif │ │ │ │ ├── spring-logo.png │ │ │ │ ├── banner-graphic.png │ │ │ │ ├── resultset_first.png │ │ │ │ ├── resultset_last.png │ │ │ │ ├── resultset_next.png │ │ │ │ ├── resultset_previous.png │ │ │ │ └── springsource-logo.png │ │ ├── resources │ │ │ ├── META-INF │ │ │ │ ├── spring │ │ │ │ │ ├── database.properties │ │ │ │ │ └── applicationContext-security.xml │ │ │ │ └── persistence.xml │ │ │ ├── schema.sql │ │ │ └── log4j.properties │ │ └── java │ │ │ └── com │ │ │ └── springone │ │ │ └── myrestaurants │ │ │ ├── web │ │ │ ├── FriendFormBean.java │ │ │ ├── RatedRestaurantBean.java │ │ │ └── RecommendationFormBean.java │ │ │ ├── domain │ │ │ ├── RatedRestaurant.java │ │ │ ├── Recommendation.java │ │ │ └── TopRatedRestaurantTraverser.java │ │ │ └── data │ │ │ └── RestaurantRepository.java │ └── test │ │ ├── resources │ │ └── com │ │ │ └── springone │ │ │ └── myrestaurants │ │ │ ├── domain │ │ │ └── TopRatedRestaurantFinderTest-context.xml │ │ │ └── data │ │ │ ├── RestaurantRepositoryTest-context.xml │ │ │ ├── UserAccountRepositoryTest-context.xml │ │ │ └── UserAccountRelationshipsTest-context.xml │ │ └── java │ │ └── com │ │ └── springdeveloper │ │ └── data │ │ └── neo │ │ └── PrintNeo4j.java ├── .springBeans ├── .classpath └── .project ├── imdb ├── .gitignore ├── src │ ├── main │ │ ├── webapp │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ ├── bg.png │ │ │ ├── menu.png │ │ │ ├── actor.png │ │ │ ├── movie.png │ │ │ ├── setup.png │ │ │ ├── favicon.ico │ │ │ ├── gradient.png │ │ │ ├── jsp │ │ │ │ ├── include.jsp │ │ │ │ ├── menu.jsp │ │ │ │ ├── setup-message.jsp │ │ │ │ ├── head.jsp │ │ │ │ ├── setup.jsp │ │ │ │ ├── actor.jsp │ │ │ │ ├── movie.jsp │ │ │ │ ├── actor-list.jsp │ │ │ │ └── movie-list.jsp │ │ │ ├── index.jsp │ │ │ └── WEB-INF │ │ │ │ └── web.xml │ │ ├── java │ │ │ └── org │ │ │ │ └── neo4j │ │ │ │ └── examples │ │ │ │ └── imdb │ │ │ │ ├── web │ │ │ │ ├── SetupForm.java │ │ │ │ ├── ActorForm.java │ │ │ │ ├── MovieForm.java │ │ │ │ ├── SetupControllerDelegate.java │ │ │ │ ├── FindControllerDelegate.java │ │ │ │ ├── SetupController.java │ │ │ │ ├── ActorInfo.java │ │ │ │ ├── MovieInfo.java │ │ │ │ ├── FindController.java │ │ │ │ └── ImdbSetupControllerDelegate.java │ │ │ │ ├── domain │ │ │ │ ├── RelTypes.java │ │ │ │ ├── ActorRepository.java │ │ │ │ ├── LookupRepository.java │ │ │ │ ├── MovieRepository.java │ │ │ │ ├── ImdbSearchEngine.java │ │ │ │ ├── Role.java │ │ │ │ ├── Movie.java │ │ │ │ ├── Actor.java │ │ │ │ ├── Lookup.java │ │ │ │ └── ImdbService.java │ │ │ │ └── parser │ │ │ │ ├── MovieData.java │ │ │ │ ├── ActorData.java │ │ │ │ ├── ImdbReader.java │ │ │ │ ├── RoleData.java │ │ │ │ └── ImdbReaderImpl.java │ │ ├── resources │ │ │ └── data │ │ │ │ ├── actors.list.gz │ │ │ │ ├── movies.list.gz │ │ │ │ └── actresses.list.gz │ │ └── assembly │ │ │ └── imdb-src.xml │ ├── test │ │ └── resources │ │ │ └── icons │ │ │ ├── IMDB.OUTGOING.png │ │ │ ├── ACTS_IN.INCOMING.png │ │ │ ├── ACTS_IN.OUTGOING.png │ │ │ ├── PART_OF_NAME.OUTGOING.png │ │ │ └── PART_OF_TITLE.OUTGOING.png │ └── site │ │ ├── apt │ │ └── index.apt │ │ └── site.xml ├── doc │ └── images │ │ └── IMDB1.png └── README.md ├── .gitignore ├── hello-worlds ├── .gitignore ├── README.md ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── data │ │ │ │ └── neo4j │ │ │ │ └── examples │ │ │ │ └── hellograph │ │ │ │ ├── RelationshipTypes.java │ │ │ │ ├── WorldRepository.java │ │ │ │ ├── WorldCounter.java │ │ │ │ ├── MyWorldRepository.java │ │ │ │ ├── App.java │ │ │ │ └── World.java │ │ └── resources │ │ │ ├── log4j.properties │ │ │ └── spring │ │ │ └── helloWorldContext.xml │ └── test │ │ └── java │ │ └── org │ │ └── springframework │ │ └── data │ │ └── neo4j │ │ └── examples │ │ └── hellograph │ │ ├── WorldCounterTest.java │ │ └── WorldTest.java ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.maven.ide.eclipse.prefs ├── build.gradle ├── .classpath ├── .project └── settings │ ├── ivy.xml │ ├── path.xml │ ├── ivysettings.xml │ └── install-ivy.xml └── readme.md /myrestaurants-original/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /myrestaurants-social/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /imdb/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | *.ipr 3 | *.iws 4 | *.iml 5 | 6 | -------------------------------------------------------------------------------- /myrestaurants-original/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /myrestaurants-social/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /imdb/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.ipr 3 | *.iws 4 | *.iml 5 | *.zip 6 | target 7 | *.log 8 | tmp 9 | 10 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/classes/alt.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/alt.css 2 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/classes/alt.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/alt.css 2 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/classes/standard.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/standard.css 2 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/classes/standard.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/standard.css 2 | -------------------------------------------------------------------------------- /myrestaurants-social/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /imdb/doc/images/IMDB1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/doc/images/IMDB1.png -------------------------------------------------------------------------------- /myrestaurants-original/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /imdb/src/main/webapp/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/main/webapp/bg.png -------------------------------------------------------------------------------- /imdb/src/main/webapp/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/main/webapp/menu.png -------------------------------------------------------------------------------- /hello-worlds/.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | .ivy 3 | .gradle 4 | target 5 | *.ipr 6 | *.iml 7 | *.iws 8 | .classpath 9 | .project 10 | 11 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/actor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/main/webapp/actor.png -------------------------------------------------------------------------------- /imdb/src/main/webapp/movie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/main/webapp/movie.png -------------------------------------------------------------------------------- /imdb/src/main/webapp/setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/main/webapp/setup.png -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/web/SetupForm.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.web; 2 | 3 | public class SetupForm { 4 | } 5 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/main/webapp/favicon.ico -------------------------------------------------------------------------------- /imdb/src/main/webapp/gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/main/webapp/gradient.png -------------------------------------------------------------------------------- /imdb/src/main/resources/data/actors.list.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/main/resources/data/actors.list.gz -------------------------------------------------------------------------------- /imdb/src/main/resources/data/movies.list.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/main/resources/data/movies.list.gz -------------------------------------------------------------------------------- /imdb/src/main/resources/data/actresses.list.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/main/resources/data/actresses.list.gz -------------------------------------------------------------------------------- /imdb/src/test/resources/icons/IMDB.OUTGOING.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/test/resources/icons/IMDB.OUTGOING.png -------------------------------------------------------------------------------- /imdb/src/test/resources/icons/ACTS_IN.INCOMING.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/test/resources/icons/ACTS_IN.INCOMING.png -------------------------------------------------------------------------------- /imdb/src/test/resources/icons/ACTS_IN.OUTGOING.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/test/resources/icons/ACTS_IN.OUTGOING.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/add.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/en.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/add.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/en.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/list.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/show.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/Thumbs.db -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/create.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/delete.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/list.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/show.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/update.png -------------------------------------------------------------------------------- /imdb/src/test/resources/icons/PART_OF_NAME.OUTGOING.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/test/resources/icons/PART_OF_NAME.OUTGOING.png -------------------------------------------------------------------------------- /imdb/src/test/resources/icons/PART_OF_TITLE.OUTGOING.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/imdb/src/test/resources/icons/PART_OF_TITLE.OUTGOING.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/create.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/delete.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/update.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/fav-del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/fav-del.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/fav-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/fav-new.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/favicon.ico -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/thumbsup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/thumbsup.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/fav-del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/fav-del.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/fav-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/fav-new.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/favicon.ico -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/recommend.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/recommend.gif -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/spring-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/spring-logo.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/spring-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/spring-logo.png -------------------------------------------------------------------------------- /myrestaurants-social/.settings/org.eclipse.wst.ws.service.policy.prefs: -------------------------------------------------------------------------------- 1 | #Wed Sep 29 14:35:52 EDT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.wst.ws.service.policy.projectEnabled=false 4 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/jsp/include.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/banner-graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/banner-graphic.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/resultset_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/resultset_last.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/resultset_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/resultset_next.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/banner-graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/banner-graphic.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/resultset_first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/resultset_first.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/resultset_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/resultset_last.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/resultset_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/resultset_next.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/resultset_first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/resultset_first.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/resultset_previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/resultset_previous.png -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/images/springsource-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-social/src/main/webapp/images/springsource-logo.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/resultset_previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/resultset_previous.png -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/images/springsource-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-graph-examples/HEAD/myrestaurants-original/src/main/webapp/images/springsource-logo.png -------------------------------------------------------------------------------- /imdb/src/main/webapp/jsp/menu.jsp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/resources/META-INF/spring/database.properties: -------------------------------------------------------------------------------- 1 | database.driverClassName=org.hsqldb.jdbcDriver 2 | database.url=jdbc:hsqldb:hsql://localhost:9001 3 | database.username=sa 4 | database.password= 5 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/resources/META-INF/spring/database.properties: -------------------------------------------------------------------------------- 1 | database.driverClassName=org.hsqldb.jdbcDriver 2 | database.url=jdbc:hsqldb:hsql://localhost:9001 3 | database.username=sa 4 | database.password= 5 | -------------------------------------------------------------------------------- /hello-worlds/README.md: -------------------------------------------------------------------------------- 1 | Hello Worlds 2 | ============ 3 | 4 | A simple Spring Data Graph example with just enough code to 5 | do something that works. 6 | 7 | Build and Run 8 | ------------- 9 | 10 | `mvn clean package exec:java` 11 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/domain/RelTypes.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.domain; 2 | 3 | import org.neo4j.graphdb.RelationshipType; 4 | 5 | public enum RelTypes implements RelationshipType { 6 | ACTS_IN, IMDB 7 | } 8 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE restaurant ( 2 | id BIGINT IDENTITY PRIMARY KEY, 3 | name VARCHAR(255), 4 | version BIGINT, 5 | zip_code VARCHAR(255), 6 | city VARCHAR(255), 7 | state VARCHAR(255) 8 | ); -------------------------------------------------------------------------------- /myrestaurants-social/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE restaurant ( 2 | id BIGINT IDENTITY PRIMARY KEY, 3 | name VARCHAR(255), 4 | version BIGINT, 5 | zip_code VARCHAR(255), 6 | city VARCHAR(255), 7 | state VARCHAR(255) 8 | ); -------------------------------------------------------------------------------- /hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/RelationshipTypes.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.neo4j.examples.hellograph; 2 | 3 | public abstract class RelationshipTypes 4 | { 5 | public static final String REACHABLE_BY_ROCKET = "REACHABLE_BY_ROCKET"; 6 | } 7 | -------------------------------------------------------------------------------- /hello-worlds/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 2 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 3 | 4 | # Print the date in ISO 8601 format 5 | log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 6 | 7 | log4j.rootLogger=ERROR, stdout 8 | -------------------------------------------------------------------------------- /hello-worlds/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Wed Jan 05 13:47:14 EST 2011 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 6 | org.eclipse.jdt.core.compiler.source=1.6 7 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/domain/ActorRepository.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.domain; 2 | 3 | import org.springframework.data.graph.neo4j.repository.GraphRepository; 4 | 5 | /** 6 | * @author mh 7 | * @since 01.04.11 8 | */ 9 | public interface ActorRepository extends GraphRepository { 10 | } 11 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/domain/LookupRepository.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.domain; 2 | 3 | import org.springframework.data.graph.neo4j.repository.GraphRepository; 4 | 5 | /** 6 | * @author mh 7 | * @since 01.04.11 8 | */ 9 | public interface LookupRepository extends GraphRepository { 10 | } 11 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/domain/MovieRepository.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.domain; 2 | 3 | import org.springframework.data.graph.neo4j.repository.GraphRepository; 4 | 5 | /** 6 | * @author mh 7 | * @since 01.04.11 8 | */ 9 | public interface MovieRepository extends GraphRepository { 10 | } 11 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/domain/ImdbSearchEngine.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.domain; 2 | 3 | public interface ImdbSearchEngine { 4 | void indexActor(Actor actor); 5 | 6 | void indexMovie(Movie movie); 7 | 8 | Actor searchActor(String name); 9 | 10 | Movie searchMovie(String title); 11 | } 12 | -------------------------------------------------------------------------------- /myrestaurants-original/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Tue Sep 28 12:45:37 EDT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 6 | org.eclipse.jdt.core.compiler.source=1.6 7 | -------------------------------------------------------------------------------- /myrestaurants-social/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Tue Sep 28 12:45:37 EDT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 6 | org.eclipse.jdt.core.compiler.source=1.6 7 | -------------------------------------------------------------------------------- /hello-worlds/.settings/org.maven.ide.eclipse.prefs: -------------------------------------------------------------------------------- 1 | #Wed Jan 05 13:47:13 EST 2011 2 | activeProfiles= 3 | eclipse.preferences.version=1 4 | fullBuildGoals=process-test-resources 5 | includeModules=false 6 | resolveWorkspaceProjects=true 7 | resourceFilterGoals=process-resources resources\:testResources 8 | skipCompilerPlugin=true 9 | version=1 10 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/web/ActorForm.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.web; 2 | 3 | public class ActorForm { 4 | private String name; 5 | 6 | public void setName(final String name) { 7 | this.name = name; 8 | } 9 | 10 | public String getName() { 11 | return this.name; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/web/MovieForm.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.web; 2 | 3 | public class MovieForm { 4 | private String title; 5 | 6 | public void setTitle(final String title) { 7 | this.title = title; 8 | } 9 | 10 | public String getTitle() { 11 | return this.title; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /myrestaurants-original/.settings/org.maven.ide.eclipse.prefs: -------------------------------------------------------------------------------- 1 | #Tue Sep 28 12:45:37 EDT 2010 2 | activeProfiles= 3 | eclipse.preferences.version=1 4 | fullBuildGoals=process-test-resources 5 | includeModules=false 6 | resolveWorkspaceProjects=true 7 | resourceFilterGoals=process-resources resources\:testResources 8 | skipCompilerPlugin=true 9 | version=1 10 | -------------------------------------------------------------------------------- /myrestaurants-social/.settings/org.maven.ide.eclipse.prefs: -------------------------------------------------------------------------------- 1 | #Tue Oct 05 19:39:51 EDT 2010 2 | activeProfiles= 3 | eclipse.preferences.version=1 4 | fullBuildGoals=process-test-resources 5 | includeModules=false 6 | resolveWorkspaceProjects=true 7 | resourceFilterGoals=process-resources resources\:testResources 8 | skipCompilerPlugin=true 9 | version=1 10 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/web/SetupControllerDelegate.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.web; 2 | 3 | import javax.servlet.ServletException; 4 | import java.util.Map; 5 | 6 | public interface SetupControllerDelegate { 7 | void getModel(Object command, Map model) 8 | throws ServletException; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/web/FindControllerDelegate.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.web; 2 | 3 | import javax.servlet.ServletException; 4 | import java.util.Map; 5 | 6 | public interface FindControllerDelegate { 7 | void getModel(Object command, Map model) throws ServletException; 8 | 9 | String getFieldName(); 10 | } -------------------------------------------------------------------------------- /imdb/src/main/webapp/jsp/setup-message.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/jsp/include.jsp"%> 2 | <%@ include file="/jsp/head.jsp"%> 3 | 4 | Setup : IMDB powered by Neo4j 5 | 6 | 7 |

IMDB Setup

8 |

Result

9 |
10 |

11 | <%@ include file="/jsp/menu.jsp"%> 12 | 13 | 14 | -------------------------------------------------------------------------------- /myrestaurants-original/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /myrestaurants-social/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /myrestaurants-original/.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/topn/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/WorldRepository.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.neo4j.examples.hellograph; 2 | 3 | import org.springframework.data.graph.neo4j.repository.GraphRepository; 4 | import org.springframework.data.graph.neo4j.repository.NamedIndexRepository; 5 | 6 | /** 7 | * @author mh 8 | * @since 01.04.11 9 | */ 10 | public interface WorldRepository extends MyWorldRepository, GraphRepository, NamedIndexRepository { 11 | } 12 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/java/com/springone/myrestaurants/web/FriendFormBean.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.web; 2 | 3 | public class FriendFormBean { 4 | 5 | private long id; 6 | 7 | private String userName; 8 | 9 | public String getUserName() { 10 | return userName; 11 | } 12 | 13 | public void setUserName(String userName) { 14 | this.userName = userName; 15 | } 16 | 17 | public long getId() { 18 | return id; 19 | } 20 | 21 | public void setId(long id) { 22 | this.id = id; 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/jsp/head.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/index-template.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

7 | 8 |

9 |
10 |
-------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/index-template.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

7 | 8 |

9 |
10 |
-------------------------------------------------------------------------------- /myrestaurants-social/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/jsp/setup.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/jsp/include.jsp"%> 2 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 3 | <%@ include file="/jsp/head.jsp"%> 4 | 5 | IMDB powered by Neo4j 6 | 7 | 8 |

IMDB powered by Neo4j

9 | 10 |
Inject data into the graph 11 |
12 |
13 | <%@ include file="/jsp/menu.jsp"%> 14 | 15 | 16 | -------------------------------------------------------------------------------- /myrestaurants-original/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/tags/util/placeholder.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/tags/util/placeholder.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/friends/show.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /hello-worlds/build.gradle: -------------------------------------------------------------------------------- 1 | sourceCompatibility = 1.6 2 | targetCompatibility = 1.6 3 | 4 | apply plugin: 'idea' 5 | apply plugin: 'eclipse' 6 | 7 | 8 | springVersion = "3.0.5.RELEASE" 9 | springDataGraphVersion = "1.0.0.RELEASE" 10 | aspectjVersion = "1.6.11.RELEASE" 11 | 12 | apply from:'https://github.com/SpringSource/spring-data-graph/raw/master/build/gradle/springdatagraph.gradle' 13 | 14 | configurations { 15 | runtime 16 | testCompile 17 | } 18 | repositories { 19 | mavenCentral() 20 | mavenLocal() 21 | mavenRepo urls: "https://maven.springframework.org/release" 22 | } 23 | 24 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/jsp/include.jsp"%> 2 | <%@ include file="/jsp/head.jsp"%> 3 | 4 | IMDB powered by Neo 5 | 6 | 7 |

IMDB powered by Neo4j

8 | 9 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # spring-data-graph-examples is no longer actively maintained by VMware. 2 | 3 | This repository contains examples for using the Spring Data Graph Library, 4 | currently the examples all use the 1.0.0.M4 release. 5 | 6 | * HelloWorlds is a simple application showing the basic setup, annotations and usage 7 | * Imdb is a graph based webapp for a movie - actor database using an older spring-web stack and an example for in graph indexes 8 | * Myrestaurants-Social is a spring-roo generated and then modified restaurant - rating webapp that was extended using a social graph with ratings and recommendations 9 | -------------------------------------------------------------------------------- /hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/WorldCounter.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.neo4j.examples.hellograph; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * @author mh 8 | * @since 17.02.11 9 | */ 10 | public class WorldCounter { 11 | 12 | public Map countMoons(Iterable worlds) { 13 | Map moons = new HashMap(); 14 | for (World world : worlds) { 15 | moons.put(world.getName(), world.getMoons()); 16 | } 17 | return moons; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/jsp/actor.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/jsp/include.jsp"%> 2 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 3 | <%@ include file="/jsp/head.jsp"%> 4 | 5 | IMDB powered by Neo4j 6 | 7 | 8 |

IMDB powered by Neo4j

9 | 10 |
Find actor
12 |
13 |
14 | <%@ include file="/jsp/menu.jsp"%> 15 | 16 | 17 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/jsp/movie.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/jsp/include.jsp"%> 2 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 3 | <%@ include file="/jsp/head.jsp"%> 4 | 5 | IMDB powered by Neo4j 6 | 7 | 8 |

IMDB powered by Neo4j

9 | 10 |
Find movie
12 |
13 |
14 | <%@ include file="/jsp/menu.jsp"%> 15 | 16 | 17 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/friends/update.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /hello-worlds/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/header.jspx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/header.jspx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/index.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

7 | 8 |

9 |

10 | 11 |

12 |
13 |
-------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/index.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

7 | 8 |

9 |

10 | 11 |

12 |
13 |
-------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/parser/MovieData.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.parser; 2 | 3 | public class MovieData { 4 | private final String title; 5 | private final int year; 6 | 7 | /** 8 | * Create container for movie data. 9 | * 10 | * @param title title of movie 11 | * @param year release year of movie 12 | */ 13 | MovieData(final String title, final int year) { 14 | this.title = title; 15 | this.year = year; 16 | } 17 | 18 | public String getTitle() { 19 | return title; 20 | } 21 | 22 | public int getYear() { 23 | return year; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /myrestaurants-social/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /myrestaurants-original/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /hello-worlds/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | hello-worlds 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.ajdt.core.ajbuilder 10 | 11 | 12 | 13 | 14 | org.maven.ide.eclipse.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.ajdt.ui.ajnature 21 | org.eclipse.jdt.core.javanature 22 | org.maven.ide.eclipse.maven2Nature 23 | 24 | 25 | -------------------------------------------------------------------------------- /hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/MyWorldRepository.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.neo4j.examples.hellograph; 2 | 3 | import org.springframework.transaction.annotation.Transactional; 4 | 5 | import java.util.Collection; 6 | 7 | /** 8 | * @author mh 9 | * @since 01.04.11 10 | */ 11 | public interface MyWorldRepository { 12 | @Transactional 13 | Collection makeSomeWorlds(); 14 | 15 | @Transactional 16 | World world(String name, int moons); 17 | 18 | World findWorldNamed(String name); 19 | 20 | Iterable findWorldsWithMoons(int moonCount); 21 | 22 | Iterable exploreWorldsBeyond(World homeWorld); 23 | } 24 | -------------------------------------------------------------------------------- /imdb/src/main/assembly/imdb-src.xml: -------------------------------------------------------------------------------- 1 | 2 | src 3 | 4 | tar.gz 5 | zip 6 | 7 | 8 | 9 | 10 | README* 11 | LICENSE* 12 | NOTICE* 13 | pom.xml 14 | 15 | true 16 | 17 | 18 | src 19 | true 20 | 21 | **/main/model/** 22 | **/main/assembly/** 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/parser/ActorData.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.parser; 2 | 3 | public class ActorData { 4 | private final String name; 5 | private final RoleData[] movieRoles; 6 | 7 | /** 8 | * Create container for actor data. 9 | * 10 | * @param name name of actor 11 | * @param movieRoles movie roles of actor 12 | */ 13 | ActorData(final String name, final RoleData[] movieRoles) { 14 | this.movieRoles = movieRoles; 15 | this.name = name; 16 | } 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public RoleData[] getMovieRoles() { 23 | return movieRoles; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /hello-worlds/settings/ivy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=error, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | 6 | # Print the date in ISO 8601 format 7 | log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 8 | 9 | log4j.appender.R=org.apache.log4j.RollingFileAppender 10 | log4j.appender.R.File=application.log 11 | 12 | log4j.appender.R.MaxFileSize=100KB 13 | # Keep one backup file 14 | log4j.appender.R.MaxBackupIndex=1 15 | 16 | log4j.appender.R.layout=org.apache.log4j.PatternLayout 17 | log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n 18 | 19 | log4j.category.org.springframework.jdbc=INFO 20 | 21 | -------------------------------------------------------------------------------- /myrestaurants-original/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | #Tue Oct 05 19:38:41 EDT 2010 2 | DELEGATES_PREFERENCE=delegateValidatorList 3 | USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator; 4 | USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator; 5 | USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.200.v201005271900 6 | eclipse.preferences.version=1 7 | override=true 8 | suspend=false 9 | vals/org.eclipse.jst.jsp.core.JSPContentValidator/global=FF01 10 | vf.version=3 11 | -------------------------------------------------------------------------------- /myrestaurants-social/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | #Mon Oct 04 16:34:14 EDT 2010 2 | DELEGATES_PREFERENCE=delegateValidatorList 3 | USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.jst.j2ee.internal.web.validation.UIWarValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator; 4 | USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.jst.j2ee.internal.web.validation.UIWarValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator; 5 | USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.200.v201005271900 6 | eclipse.preferences.version=1 7 | override=true 8 | suspend=false 9 | vals/org.eclipse.jst.jsp.core.JSPContentValidator/global=FF01 10 | vf.version=3 11 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/jsp/actor-list.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/jsp/include.jsp"%> 2 | <%@ include file="/jsp/head.jsp"%> 3 | 4 | <c:out value="${model.movieTitle}" /> : IMDB powered by Neo4j 5 | 6 | 7 |

8 |

Actors

9 |
    10 | 11 | 12 | 13 | 14 |
  • as
  • 17 |
    18 |
19 | <%@ include file="/jsp/menu.jsp"%> 20 | 21 | 22 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/friends/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=error, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | 6 | # Print the date in ISO 8601 format 7 | log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 8 | 9 | log4j.appender.R=org.apache.log4j.RollingFileAppender 10 | log4j.appender.R.File=application.log 11 | 12 | log4j.appender.R.MaxFileSize=100KB 13 | # Keep one backup file 14 | log4j.appender.R.MaxBackupIndex=1 15 | 16 | log4j.appender.R.layout=org.apache.log4j.PatternLayout 17 | log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n 18 | 19 | log4j.category.org.springframework=WARN 20 | log4j.category.org.springframework.datastore=ERROR 21 | #log4j.category.org.neo4j=INFO 22 | 23 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/parser/ImdbReader.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.parser; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Reads events from the {@link ImdbParser}. 7 | */ 8 | public interface ImdbReader { 9 | /** 10 | * Creates new movies with specified title and 11 | * year from a {@link MovieData} list. 12 | * Every movie will be indexed. 13 | * 14 | * @param movieList movies to create and index 15 | */ 16 | void newMovies(List movieList); 17 | 18 | /** 19 | * Creates new actors specifying what movies the actors acted in 20 | * from a {@link ActorData} list. 21 | * Every actor will be indexed. 22 | * 23 | * @param actorList actors to create and index 24 | */ 25 | void newActors(List actorList); 26 | } 27 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/restaurants/update.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/restaurants/update.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/layouts/layouts.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/layouts/layouts.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/recommendations/show.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/java/com/springone/myrestaurants/domain/RatedRestaurant.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.domain; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | 6 | /** 7 | * @author Michael Hunger 8 | * @since 02.10.2010 9 | */ 10 | public class RatedRestaurant { 11 | private final Restaurant restaurant; 12 | private final Collection recommendations = new ArrayList(); 13 | 14 | public RatedRestaurant(final Restaurant restaurant) { 15 | this.restaurant = restaurant; 16 | } 17 | 18 | public void add(final Recommendation recommendation) { 19 | recommendations.add(recommendation); 20 | } 21 | 22 | public Collection getRecommendations() { 23 | return recommendations; 24 | } 25 | 26 | public Restaurant getRestaurant() { 27 | return restaurant; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/friends/create.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/web/SetupController.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.web; 2 | 3 | import org.springframework.web.servlet.ModelAndView; 4 | import org.springframework.web.servlet.mvc.SimpleFormController; 5 | 6 | import javax.servlet.ServletException; 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | public class SetupController extends SimpleFormController { 11 | private final SetupControllerDelegate delegate; 12 | 13 | public SetupController(final SetupControllerDelegate delegate) { 14 | super(); 15 | this.delegate = delegate; 16 | } 17 | 18 | @Override 19 | protected ModelAndView onSubmit(final Object command) throws ServletException { 20 | final Map model = new HashMap(); 21 | delegate.getModel(command, model); 22 | return new ModelAndView(getSuccessView(), "model", model); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/tags/menu/menu.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
    10 | 11 |
12 |
13 |
-------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/tags/menu/menu.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
    10 | 11 |
12 |
13 |
-------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/topn/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/domain/Role.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.domain; 2 | 3 | import org.springframework.data.graph.annotation.EndNode; 4 | import org.springframework.data.graph.annotation.RelationshipEntity; 5 | import org.springframework.data.graph.annotation.StartNode; 6 | 7 | @RelationshipEntity 8 | public class Role { 9 | String role; 10 | @StartNode 11 | Actor actor; 12 | @EndNode 13 | Movie movie; 14 | 15 | @Override 16 | public String toString() { 17 | return String.format("%s-[%s]->%s", this.getActor(), role, this.getMovie()); 18 | } 19 | 20 | public Actor getActor() { 21 | return actor; 22 | } 23 | 24 | public Movie getMovie() { 25 | return movie; 26 | } 27 | 28 | public String getName() { 29 | return role; 30 | } 31 | 32 | public Role play(String name) { 33 | this.role = name; 34 | return this; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/parser/RoleData.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.parser; 2 | 3 | /** 4 | * Holds information about what role an actor has in a movie 5 | */ 6 | public class RoleData { 7 | private final String title; 8 | private final String role; 9 | 10 | RoleData(final String title, final String role) { 11 | this.title = title; 12 | this.role = role; 13 | } 14 | 15 | /** 16 | * Returns the title of the movie, never null. 17 | * 18 | * @return title of the movie 19 | */ 20 | public String getTitle() { 21 | return this.title; 22 | } 23 | 24 | /** 25 | * Returns the role the actor had in the movie, may be null 26 | * if no information is available. 27 | * 28 | * @return actor role or null if information not avilable 29 | */ 30 | public String getRole() { 31 | return this.role; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/friends/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /myrestaurants-original/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/recommendations/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/restaurants/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/restaurants/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | imdb-app 11 | org.springframework.web.servlet.DispatcherServlet 12 | 1 13 | 14 | 15 | 16 | imdb-app 17 | *.html 18 | 19 | 20 | 21 | index.jsp 22 | 23 | 24 | 25 | 26 | /spring 27 | /WEB-INF/tld/spring-form.tld 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/useraccounts/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/useraccounts/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /hello-worlds/settings/path.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/restaurants/show.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/restaurants/show.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/recommendations/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/restaurants/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /myrestaurants-social/.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | src/test/resources/com/springone/myrestaurants/data/RestaurantRepositoryTest-context.xml 11 | src/test/resources/com/springone/myrestaurants/data/DataStore-context.xml 12 | src/test/resources/com/springone/myrestaurants/data/UserAccountRelationshipsTest-context.xml 13 | src/test/resources/com/springone/myrestaurants/data/UserAccountRepositoryTest-context.xml 14 | src/test/resources/com/springone/myrestaurants/domain/DataStore-context.xml 15 | src/test/resources/com/springone/myrestaurants/domain/TopRatedRestaurantFinderTest-context.xml 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/java/com/springone/myrestaurants/domain/Recommendation.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.domain; 2 | 3 | import org.springframework.data.graph.annotation.EndNode; 4 | import org.springframework.data.graph.annotation.RelationshipEntity; 5 | import org.springframework.data.graph.annotation.StartNode; 6 | 7 | @RelationshipEntity 8 | public class Recommendation { 9 | @StartNode 10 | private UserAccount user; 11 | @EndNode 12 | private Restaurant restaurant; 13 | 14 | private int stars; 15 | private String comment; 16 | 17 | 18 | public Recommendation() { 19 | } 20 | 21 | public void rate(int stars, String comment) { 22 | this.stars = stars; 23 | this.comment = comment; 24 | } 25 | 26 | public int getStars() { 27 | return stars; 28 | } 29 | 30 | public String getComment() { 31 | return comment; 32 | } 33 | 34 | public UserAccount getUser() { 35 | return user; 36 | } 37 | 38 | public Restaurant getRestaurant() { 39 | return restaurant; 40 | } 41 | 42 | 43 | 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/restaurants/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/recommendations/update.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.hibernate.ejb.HibernatePersistence 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/restaurants/create.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/restaurants/create.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /myrestaurants-social/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/web/ActorInfo.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.web; 2 | 3 | import org.neo4j.examples.imdb.domain.Actor; 4 | import org.neo4j.examples.imdb.domain.Role; 5 | 6 | /** 7 | * @author mh 8 | * @since 01.04.11 9 | */ 10 | public final class ActorInfo implements Comparable { 11 | private String name; 12 | private String role; 13 | 14 | public ActorInfo(final Actor actor, final Role role) { 15 | setName(actor.getName()); 16 | if (role == null || role.getName() == null) { 17 | setRole("(unknown)"); 18 | } else { 19 | setRole(role.getName()); 20 | } 21 | } 22 | 23 | public void setName(final String name) { 24 | this.name = name; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setRole(final String role) { 32 | this.role = role; 33 | } 34 | 35 | public String getRole() { 36 | return role; 37 | } 38 | 39 | public int compareTo(ActorInfo otherActorInfo) { 40 | return getName().compareTo(otherActorInfo.getName()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/java/com/springone/myrestaurants/web/RatedRestaurantBean.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.web; 2 | 3 | public class RatedRestaurantBean { 4 | 5 | private long id; 6 | 7 | // Restaurant name 8 | private String name; 9 | 10 | private long recommendations; 11 | 12 | private double rating; 13 | 14 | public String getName() { 15 | return name; 16 | } 17 | 18 | public void setName(String name) { 19 | this.name = name; 20 | } 21 | 22 | public long getId() { 23 | return id; 24 | } 25 | 26 | public void setId(long restaurantId) { 27 | this.id = restaurantId; 28 | } 29 | 30 | public long getRecommendations() { 31 | return recommendations; 32 | } 33 | 34 | public void setRecommendations(long recommendations) { 35 | this.recommendations = recommendations; 36 | } 37 | 38 | public double getRating() { 39 | return rating; 40 | } 41 | 42 | public void setRating(double rating) { 43 | this.rating = rating; 44 | } 45 | 46 | @Override 47 | public String toString() { 48 | return "RatedRestaurantBean [restaurantId=" + id + ", name=" 49 | + name + ", rating=" + rating + "]"; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/useraccounts/update.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /hello-worlds/settings/ivysettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/web/MovieInfo.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.web; 2 | 3 | import org.neo4j.examples.imdb.domain.Movie; 4 | import org.neo4j.examples.imdb.domain.Role; 5 | 6 | /** 7 | * @author mh 8 | * @since 01.04.11 9 | */ 10 | public final class MovieInfo implements Comparable { 11 | private String title; 12 | private String role; 13 | 14 | MovieInfo(final Movie movie, final Role role) { 15 | setTitle(movie.getTitle()); 16 | if (role == null || role.getName() == null) { 17 | setRole("(unknown)"); 18 | } else { 19 | setRole(role.getName()); 20 | } 21 | } 22 | 23 | public final void setTitle(final String title) { 24 | this.title = title; 25 | } 26 | 27 | public String getTitle() { 28 | return title; 29 | } 30 | 31 | public final void setRole(final String role) { 32 | this.role = role; 33 | } 34 | 35 | public String getRole() { 36 | return role; 37 | } 38 | 39 | public int compareTo(final MovieInfo otherMovieInfo) { 40 | return getTitle().compareTo(otherMovieInfo.getTitle()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /myrestaurants-social/src/test/resources/com/springone/myrestaurants/domain/TopRatedRestaurantFinderTest-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/layouts/default.jspx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | <spring:message code="welcome_h3" arguments="${app_name}" /> 15 | 16 | 17 | 18 |
19 | 20 | 21 |
22 | 23 | 24 |
25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/layouts/default.jspx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | <spring:message code="welcome_h3" arguments="${app_name}" /> 15 | 16 | 17 | 18 |
19 | 20 | 21 |
22 | 23 | 24 |
25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/useraccounts/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/useraccounts/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/web/FindController.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.web; 2 | 3 | import org.springframework.web.servlet.ModelAndView; 4 | import org.springframework.web.servlet.mvc.SimpleFormController; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | public class FindController extends SimpleFormController { 12 | private final FindControllerDelegate delegate; 13 | 14 | public FindController(final FindControllerDelegate delegate) { 15 | super(); 16 | this.delegate = delegate; 17 | } 18 | 19 | @Override 20 | protected ModelAndView onSubmit(final Object command) throws ServletException { 21 | final Map model = new HashMap(); 22 | delegate.getModel(command, model); 23 | return new ModelAndView(getSuccessView(), "model", model); 24 | } 25 | 26 | @Override 27 | protected boolean isFormSubmission(final HttpServletRequest request) { 28 | final String field = request.getParameter(delegate.getFieldName()); 29 | return field != null && field.trim().length() > 0; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/useraccounts/create.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /hello-worlds/settings/install-ivy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/useraccounts/show.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/useraccounts/update.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.hibernate.ejb.HibernatePersistence 5 | com.springone.myrestaurants.domain.UserAccount 6 | com.springone.myrestaurants.domain.Restaurant 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/java/com/springone/myrestaurants/web/RecommendationFormBean.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.web; 2 | 3 | public class RecommendationFormBean { 4 | 5 | private long id; 6 | 7 | private long restaurantId; 8 | 9 | // Restaurant name 10 | private String name; 11 | 12 | private int rating; 13 | 14 | private String comments; 15 | 16 | //ID is here as we need to mirror for the moment all the (graph) domain Recommendation properties in a simple javabean. 17 | 18 | public long getId() { 19 | return id; 20 | } 21 | 22 | public void setId(long id) { 23 | this.id = id; 24 | } 25 | 26 | 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | public void setName(String name) { 33 | this.name = name; 34 | } 35 | 36 | public long getRestaurantId() { 37 | return restaurantId; 38 | } 39 | 40 | public void setRestaurantId(long restaurantId) { 41 | this.restaurantId = restaurantId; 42 | } 43 | 44 | public int getRating() { 45 | return rating; 46 | } 47 | 48 | 49 | 50 | public void setRating(int rating) { 51 | this.rating = rating; 52 | } 53 | 54 | public String getComments() { 55 | return comments; 56 | } 57 | 58 | public void setComments(String comments) { 59 | this.comments = comments; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/domain/Movie.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.domain; 2 | 3 | import org.springframework.data.graph.annotation.NodeEntity; 4 | import org.springframework.data.graph.annotation.RelatedTo; 5 | import org.springframework.data.graph.core.Direction; 6 | import org.springframework.data.graph.neo4j.annotation.Indexed; 7 | 8 | import java.util.Set; 9 | 10 | // START SNIPPET: MovieClass 11 | @NodeEntity 12 | public class Movie { 13 | @Indexed 14 | String title; 15 | int year; 16 | 17 | @RelatedTo(type = "ACTS_IN", elementClass = Actor.class, direction = Direction.INCOMING) 18 | Set actors; 19 | 20 | public Set getActors() { 21 | return actors; 22 | } 23 | 24 | @Override 25 | public String toString() { 26 | return String.format("%s (%d)", getTitle(), getYear()); 27 | } 28 | 29 | public String getTitle() { 30 | return title; 31 | } 32 | 33 | public void setTitle(String title) { 34 | this.title = title; 35 | } 36 | 37 | public int getYear() { 38 | return year; 39 | } 40 | 41 | public void setYear(int year) { 42 | this.year = year; 43 | } 44 | 45 | int getActorsCount() { 46 | return getActors().size(); 47 | } 48 | } 49 | // END SNIPPET: MovieClass 50 | -------------------------------------------------------------------------------- /hello-worlds/src/main/resources/spring/helloWorldContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/java/com/springone/myrestaurants/dao/RestaurantDao.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.dao; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | import javax.persistence.PersistenceContext; 7 | 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.springone.myrestaurants.domain.Restaurant; 11 | 12 | @Repository 13 | public class RestaurantDao { 14 | 15 | @PersistenceContext 16 | private EntityManager entityManager; 17 | 18 | public Restaurant findRestaurant(Long id) { 19 | if (id == null) return null; 20 | return entityManager.find(Restaurant.class, id); 21 | } 22 | 23 | @SuppressWarnings("unchecked") 24 | public List findAllRestaurants() { 25 | return entityManager.createQuery("select o from Restaurant o").getResultList(); 26 | } 27 | 28 | @SuppressWarnings("unchecked") 29 | public List findRestaurantEntries(int firstResult, int maxResults) { 30 | return entityManager.createQuery("select o from Restaurant o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList(); 31 | } 32 | 33 | public long countRestaurants() { 34 | return ((Number) entityManager.createQuery("select count(o) from Restaurant o").getSingleResult()).longValue(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/useraccounts/create.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/domain/Actor.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.domain; 2 | 3 | import org.springframework.data.graph.annotation.NodeEntity; 4 | import org.springframework.data.graph.annotation.RelatedTo; 5 | import org.springframework.data.graph.neo4j.annotation.Indexed; 6 | 7 | import java.util.Set; 8 | 9 | // START SNIPPET: ActorClass 10 | @NodeEntity 11 | public class Actor { 12 | @Indexed 13 | private String name; 14 | 15 | @RelatedTo(type = "ACTS_IN", elementClass = Movie.class) 16 | private Set movies; 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | 26 | public Set getMovies() { 27 | return movies; 28 | } 29 | 30 | public Role getRole(final Movie inMovie) { 31 | return getRelationshipTo(inMovie, Role.class, RelTypes.ACTS_IN.name()); 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return "Actor '" + this.getName() + "'"; 37 | } 38 | 39 | public void actsIn(Movie movie, final String role) { 40 | relateTo(movie, Role.class, RelTypes.ACTS_IN.name()).play(role); 41 | } 42 | 43 | public int getMovieCount() { 44 | return getMovies().size(); 45 | } 46 | } 47 | // END SNIPPET: ActorClass 48 | -------------------------------------------------------------------------------- /imdb/src/site/apt/index.apt: -------------------------------------------------------------------------------- 1 | The Neo4j - Datastore Graph IMDB Example 2 | 3 | Imagine a number of actors, acting in Movies and thus forming a graph of relationships between Actors and Movies. The 4 | Spring Datastore Graph project provides an annotation-based approach to map objects onto Neo4j. The current annotations 5 | supported (still subject to change) are: 6 | 7 | * @NodeEntity - class annotation for POJOs backed by a graph node. 8 | 9 | * @RelationshipEntity - class annotation for POJOs containing relationship properties. 10 | 11 | * @GraphProperty - field annotation used to specify indexing. 12 | 13 | * @RelatedTo - for fields denoting relationships (either one-to-one or one-to-many). 14 | 15 | * @StartNode - the start node for a @GraphRelationship.. 16 | 17 | * @EndNode - the end node for a @GraphRelationship. 18 | 19 | In order to persist objects in Spring into Neo4j, simply do something like this (the full code is available over at the 20 | {{{https://github.com/neo4j-examples/spring-datastore-graph-imdb} Spring Datastore Graph IMDB example}}: 21 | 22 | %{source-code|snippet=MovieClass|file=src/main/java/org/neo4j/examples/imdb/domain/Movie.java} 23 | 24 | and the Actor class, 25 | 26 | %{source-code|snippet=ActorClass|file=src/main/java/org/neo4j/examples/imdb/domain/Actor.java} 27 | 28 | This will produce something like {{{https://neo4j.com/docs/} this graph}} -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/useraccounts/show.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/resourceNotFound.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

${fn:escapeXml(title)}

6 |

7 | 8 |

9 | 10 |

11 |

12 | 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 |
25 |

26 |
27 |
28 |
-------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/resourceNotFound.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

${fn:escapeXml(title)}

6 |

7 | 8 |

9 | 10 |

11 |

12 | 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 |
25 |

26 |
27 |
28 |
-------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/uncaughtException.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

${fn:escapeXml(title)}

6 |

7 | 8 |

9 | 10 |

11 |

12 | 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 |
25 |

26 |
27 |
28 |
-------------------------------------------------------------------------------- /hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/App.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.neo4j.examples.hellograph; 2 | 3 | import org.springframework.context.ConfigurableApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | /** 7 | * Hello world(s)! 8 | *

9 | * An example application for exploring Spring Data Graph. 10 | */ 11 | public class App 12 | { 13 | 14 | public static void main( String[] args ) 15 | { 16 | 17 | ConfigurableApplicationContext applicationContext = 18 | new ClassPathXmlApplicationContext( "/spring/helloWorldContext.xml"); 19 | 20 | WorldRepositoryImpl galaxy = applicationContext.getBean(WorldRepositoryImpl.class); 21 | 22 | Iterable worlds = galaxy.makeSomeWorlds(); 23 | 24 | World homeWorld = worlds.iterator().next(); 25 | System.out.println("At home on: " + homeWorld); 26 | 27 | World foundHomeWorld = galaxy.findWorldNamed( homeWorld.getName() ); 28 | System.out.println( "found home world: " + foundHomeWorld ); 29 | 30 | Iterable worldsBeyond = galaxy.exploreWorldsBeyond( homeWorld ); 31 | for (World world : worldsBeyond) { 32 | System.out.println( "found worlds beyond: " + world ); 33 | } 34 | 35 | applicationContext.close(); 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/uncaughtException.jspx: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 |

${fn:escapeXml(title)}

6 |

7 | 8 |

9 | 10 |

11 |

12 | 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 |
25 |

26 |
27 |
28 |
-------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/tags/menu/category.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
  • 16 |

    17 | 18 |

    19 |
      20 | 21 |
    22 |
  • 23 | 24 |
    25 |
    -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/dataAccessFailure.jspx: -------------------------------------------------------------------------------- 1 |
    2 | 3 | 4 | 5 |

    ${fn:escapeXml(title)}

    6 |

    7 | 8 |

    9 | 10 |

    11 |

    12 | 13 |

    14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
    23 |
    24 |
    25 |

    26 |
    27 |
    28 |
    29 | 30 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/tags/menu/category.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
  • 16 |

    17 | 18 |

    19 |
      20 | 21 |
    22 |
  • 23 | 24 |
    25 |
    -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/dataAccessFailure.jspx: -------------------------------------------------------------------------------- 1 |
    2 | 3 | 4 | 5 |

    ${fn:escapeXml(title)}

    6 |

    7 | 8 |

    9 | 10 |

    11 |

    12 | 13 |

    14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
    23 |
    24 |
    25 |

    26 |
    27 |
    28 |
    29 | 30 | -------------------------------------------------------------------------------- /imdb/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ${project.name} 6 | images/logos/logo-dark.png 7 | https://neo4j.com 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 25 | 26 | 27 | 28 | 29 | ${skinGroupId} 30 | ${skinArtifactId} 31 | ${skinVersion} 32 | 33 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/recommendations/create.jspx: -------------------------------------------------------------------------------- 1 | 2 |
    3 | 4 | 5 | 6 | 7 | 8 |
    9 | 10 | 11 |
    12 |
    13 | 14 |
    15 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/footer.jspx: -------------------------------------------------------------------------------- 1 | 2 | 37 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/views/footer.jspx: -------------------------------------------------------------------------------- 1 | 2 | 37 | -------------------------------------------------------------------------------- /myrestaurants-social/.settings/org.eclipse.jst.jsp.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Oct 04 16:27:22 EDT 2010 2 | eclipse.preferences.version=1 3 | validateFragments=false 4 | validation.actions-missing-required-attribute=1 5 | validation.actions-non-empty-inline-tag=2 6 | validation.actions-unexpected-rtexprvalue=2 7 | validation.actions-unknown-attribute=2 8 | validation.directive-include-fragment-file-not-found=-1 9 | validation.directive-include-fragment-file-not-specified=-1 10 | validation.directive-taglib-duplicate-prefixes-different-uris=-1 11 | validation.directive-taglib-duplicate-prefixes-same-uris=-1 12 | validation.directive-taglib-missing-prefix=-1 13 | validation.directive-taglib-missing-uri-or-tagdir=-1 14 | validation.directive-taglib-unresolvable-uri-or-tagdir=-1 15 | validation.el-general-syntax=1 16 | validation.el-lexical-failure=-1 17 | validation.java-=-1 18 | validation.java-local-variable-is-never-used=-1 19 | validation.java-null-local-variable-reference=-1 20 | validation.java-potential-null-local-variable-reference=-1 21 | validation.java-unused-import=-1 22 | validation.translation-tag-class-not-found=2 23 | validation.translation-tei-class-not-found=2 24 | validation.translation-tei-class-not-instantiated=2 25 | validation.translation-tei-class-runtime-exception=2 26 | validation.translation-tei-message=1 27 | validation.translation-usebean-ambiguous-type-info=2 28 | validation.translation-usebean-invalid-id=1 29 | validation.translation-usebean-missing-type-info=1 30 | validation.use-project-settings=true 31 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/web/ImdbSetupControllerDelegate.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.web; 2 | 3 | import org.neo4j.examples.imdb.domain.ImdbService; 4 | import org.neo4j.examples.imdb.parser.ImdbParser; 5 | import org.neo4j.examples.imdb.parser.ImdbReader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | import javax.servlet.ServletException; 9 | import java.io.IOException; 10 | import java.util.Map; 11 | 12 | public class ImdbSetupControllerDelegate implements SetupControllerDelegate { 13 | private static final String IMDB_DATADIR = "data/"; 14 | @Autowired 15 | private ImdbReader imdbReader; 16 | @Autowired 17 | private ImdbService imdbService; 18 | 19 | public void getModel(final Object command, final Map model) 20 | throws ServletException { 21 | 22 | final ImdbParser parser = new ImdbParser(imdbReader); 23 | StringBuffer message = new StringBuffer(200); 24 | try { 25 | message.append(parser.parseMovies(IMDB_DATADIR + "movies.list.gz")).append('\n'); 26 | message.append(parser.parseActors(IMDB_DATADIR + "actors.list.gz", IMDB_DATADIR + "actresses.list.gz")).append('\n'); 27 | imdbService.setupReferenceRelationship(); 28 | } catch (IOException e) { 29 | message.append("Something went wrong during the setup process:\n").append(e.getMessage()); 30 | } 31 | model.put("setupMessage", message.toString()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/parser/ImdbReaderImpl.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.parser; 2 | 3 | import org.neo4j.examples.imdb.domain.*; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import java.util.List; 8 | 9 | class ImdbReaderImpl implements ImdbReader { 10 | @Autowired 11 | private ImdbService imdbService; 12 | 13 | @Transactional 14 | public void newActors(final List actorList) { 15 | for (ActorData actorData : actorList) { 16 | newActor(actorData.getName(), actorData.getMovieRoles()); 17 | } 18 | } 19 | 20 | @Transactional 21 | public void newMovies(final List movieList) { 22 | for (MovieData movieData : movieList) { 23 | newMovie(movieData.getTitle(), movieData.getYear()); 24 | } 25 | } 26 | 27 | private void newMovie(final String title, final int year) { 28 | imdbService.createMovie(title, year); 29 | } 30 | 31 | private void newActor(final String name, final RoleData[] movieRoles) { 32 | final Actor actor = imdbService.createActor(name); 33 | for (RoleData movieRole : movieRoles) { 34 | final Movie movie = imdbService.getExactMovie(movieRole.getTitle()); 35 | if (movie != null) { 36 | actor.actsIn(movie, movieRole.getRole()); 37 | } 38 | } 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/java/com/springone/myrestaurants/dao/UserAccountDao.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.dao; 2 | 3 | import javax.persistence.EntityManager; 4 | import javax.persistence.PersistenceContext; 5 | import javax.persistence.Query; 6 | 7 | import org.springframework.stereotype.Repository; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.springone.myrestaurants.domain.UserAccount; 11 | 12 | @Repository 13 | public class UserAccountDao { 14 | 15 | @PersistenceContext 16 | private EntityManager entityManager; 17 | 18 | public UserAccount findUserAccount(Long id) { 19 | if (id == null) return null; 20 | return entityManager.find(UserAccount.class, id); 21 | } 22 | 23 | public UserAccount findByName(String name) { 24 | if (name == null) return null; 25 | Query q = entityManager.createQuery("SELECT u FROM UserAccount u WHERE u.userName = :username"); 26 | q.setParameter("username", name); 27 | 28 | java.util.List resultList = q.getResultList(); 29 | if (resultList.size() > 0) 30 | { 31 | return (UserAccount) resultList.get(0); 32 | } 33 | return null; 34 | } 35 | 36 | @Transactional 37 | public void persist(UserAccount userAccount) { 38 | this.entityManager.persist(userAccount); 39 | } 40 | 41 | @Transactional 42 | public UserAccount merge(UserAccount userAccount) { 43 | UserAccount merged = this.entityManager.merge(userAccount); 44 | this.entityManager.flush(); 45 | return merged; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/java/com/springone/myrestaurants/data/RestaurantRepository.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.data; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | import javax.persistence.PersistenceContext; 7 | 8 | import org.springframework.stereotype.Repository; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.springone.myrestaurants.domain.Restaurant; 12 | 13 | @Repository 14 | public class RestaurantRepository { 15 | 16 | @PersistenceContext 17 | private EntityManager entityManager; 18 | 19 | @Transactional 20 | public Restaurant findRestaurant(Long id) { 21 | if (id == null) return null; 22 | final Restaurant rest = entityManager.find(Restaurant.class, id); 23 | if (rest != null) { 24 | rest.persist(); 25 | } 26 | return rest; 27 | } 28 | 29 | @SuppressWarnings("unchecked") 30 | @Transactional(readOnly=true) 31 | public List findAllRestaurants() { 32 | return entityManager.createQuery("select o from Restaurant o").getResultList(); 33 | } 34 | 35 | @SuppressWarnings("unchecked") 36 | @Transactional(readOnly=true) 37 | public List findRestaurantEntries(int firstResult, int maxResults) { 38 | return entityManager.createQuery("select o from Restaurant o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList(); 39 | } 40 | 41 | @Transactional 42 | public long countRestaurants() { 43 | return ((Number) entityManager.createQuery("select count(o) from Restaurant o").getSingleResult()).longValue(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /myrestaurants-original/.project: -------------------------------------------------------------------------------- 1 | 2 | myrestaurants-original 3 | 4 | 5 | 6 | 7 | org.eclipse.wst.jsdt.core.javascriptValidator 8 | 9 | 10 | org.eclipse.ajdt.core.ajbuilder 11 | 12 | 13 | org.eclipse.wst.common.project.facet.core.builder 14 | 15 | 16 | org.eclipse.wst.validation.validationbuilder 17 | 18 | 19 | org.springframework.ide.eclipse.core.springbuilder 20 | 21 | 22 | org.eclipse.ajdt.core.ajbuilder 23 | 24 | 25 | aspectPath 26 | org.springframework.aspects 27 | 28 | 29 | 30 | 31 | org.maven.ide.eclipse.maven2Builder 32 | 33 | 34 | 35 | org.eclipse.ajdt.ui.ajnature 36 | org.springframework.ide.eclipse.core.springnature 37 | org.maven.ide.eclipse.maven2Nature 38 | org.eclipse.wst.common.project.facet.core.nature 39 | org.eclipse.jdt.core.javanature 40 | org.eclipse.wst.common.modulecore.ModuleCoreNature 41 | org.eclipse.jem.workbench.JavaEMFNature 42 | org.eclipse.wst.jsdt.core.jsNature 43 | 44 | -------------------------------------------------------------------------------- /imdb/src/main/webapp/jsp/movie-list.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/jsp/include.jsp"%> 2 | <%@ include file="/jsp/head.jsp"%> 3 | 4 | <c:out value="${model.actorName}" /> : IMDB powered by Neo4j 5 | 6 | 7 |

    8 | 9 |

    Kevin Bacon number:

    11 |

    Bacon path

    12 |
      13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
    • ${pathElement}
    • 31 |
      32 |
    33 |

    Movies

    34 |
      35 | 36 | 37 | 38 | 39 |
    • in
    • 42 |
      43 |
    44 |
    45 | <%@ include file="/jsp/menu.jsp"%> 46 | 47 | 48 | -------------------------------------------------------------------------------- /hello-worlds/src/test/java/org/springframework/data/neo4j/examples/hellograph/WorldCounterTest.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.neo4j.examples.hellograph; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.graph.neo4j.support.GraphDatabaseContext; 7 | import org.springframework.data.graph.neo4j.support.node.Neo4jHelper; 8 | import org.springframework.test.annotation.Rollback; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | import org.springframework.test.context.transaction.BeforeTransaction; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import java.util.Map; 15 | 16 | import static java.util.Arrays.asList; 17 | import static org.junit.Assert.assertEquals; 18 | 19 | /** 20 | * @author mh 21 | * @since 17.02.11 22 | * Added to check for some aspectj-snapshot build errors. 23 | */ 24 | @ContextConfiguration(locations = "classpath:spring/helloWorldContext.xml") 25 | @RunWith(SpringJUnit4ClassRunner.class) 26 | @Transactional 27 | public class WorldCounterTest { 28 | 29 | @Autowired 30 | private GraphDatabaseContext graphDatabaseContext; 31 | 32 | @Rollback(false) 33 | @BeforeTransaction 34 | public void clearDatabase() 35 | { 36 | Neo4jHelper.cleanDb(graphDatabaseContext); 37 | } 38 | 39 | @Test 40 | public void testCountMoons() throws Exception { 41 | WorldCounter counter = new WorldCounter(); 42 | Map result = counter.countMoons(asList(new World("earth", 1))); 43 | assertEquals("earth has one moon",(Integer)1,result.get("earth")); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/tags/util/load-scripts.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/tags/util/load-scripts.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/domain/Lookup.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.domain; 2 | 3 | import org.springframework.data.graph.annotation.NodeEntity; 4 | import org.springframework.data.graph.annotation.RelatedTo; 5 | import org.springframework.data.graph.neo4j.annotation.Indexed; 6 | 7 | import java.util.Set; 8 | 9 | /** 10 | * @author mh 11 | * @since 16.03.11 12 | */ 13 | @NodeEntity 14 | public class Lookup { 15 | private 16 | @Indexed 17 | String word; 18 | private int count; 19 | 20 | @RelatedTo(elementClass = Movie.class, type = "title.part") 21 | private Set movies; 22 | @RelatedTo(elementClass = Actor.class, type = "name.part") 23 | private Set actors; 24 | 25 | public Lookup(String word) { 26 | this.word = word; 27 | } 28 | 29 | public Lookup() { 30 | } 31 | 32 | public void addActor(Actor actor) { 33 | relateTo(actor, "name.part"); 34 | count++; 35 | } 36 | 37 | public void addMovie(Movie movie) { 38 | this.movies.add(movie); 39 | count++; 40 | } 41 | 42 | public String getWord() { 43 | return word; 44 | } 45 | 46 | public int getCount() { 47 | return count; 48 | } 49 | 50 | public Set getMovies() { 51 | return movies; 52 | } 53 | 54 | public Set getActors() { 55 | return actors; 56 | } 57 | 58 | public Movie getMovie() { 59 | Set allMovies = getMovies(); 60 | return allMovies != null && !allMovies.isEmpty() ? allMovies.iterator().next() : null; 61 | } 62 | 63 | public Actor getActor() { 64 | Set allActors = getActors(); 65 | return allActors != null && !allActors.isEmpty() ? allActors.iterator().next() : null; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/tags/util/theme.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ${theme_standard} 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ${theme_alt} 34 | 35 | 36 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/tags/util/theme.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ${theme_standard} 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ${theme_alt} 34 | 35 | 36 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/i18n/application.properties: -------------------------------------------------------------------------------- 1 | #Updated at Wed Sep 22 21:53:31 EDT 2010 2 | #Wed Sep 22 21:53:31 EDT 2010 3 | label_com_springone_myrestaurants_domain_useraccount_username=User Name 4 | label_com_springone_myrestaurants_domain_useraccount_birthdate=Birth Date 5 | label_com_springone_myrestaurants_domain_useraccount_favorites=Favorites 6 | label_com_springone_myrestaurants_domain_restaurant_city=City 7 | menu_item_restaurant_new_label=Restaurant 8 | menu_item_restaurant_fav_label=Restaurants 9 | label_com_springone_myrestaurants_domain_useraccount_lastname=Last Name 10 | menu_item_useraccount_new_label=User Account 11 | label_com_springone_myrestaurants_domain_restaurant_plural=Restaurants 12 | label_com_springone_myrestaurants_domain_restaurant_id=Id 13 | label_com_springone_myrestaurants_domain_useraccount=User Account 14 | label_com_springone_myrestaurants_domain_restaurant_name=Name 15 | label_com_springone_myrestaurants_domain_restaurant=Restaurant 16 | menu_item_restaurant_list_label=Restaurants 17 | menu_category_restaurant_label=Restaurant 18 | label_com_springone_myrestaurants_domain_useraccount_plural=User Accounts 19 | label_com_springone_myrestaurants_domain_useraccount_version=Version 20 | label_com_springone_myrestaurants_domain_useraccount_firstname=First Name 21 | menu_category_useraccount_label=User Account 22 | label_com_springone_myrestaurants_domain_restaurant_state=State 23 | menu_item_useraccount_list_label=User Accounts 24 | label_com_springone_myrestaurants_domain_restaurant_zipcode=Zip Code 25 | menu_item_useraccount_login_label=User Account 26 | menu_item_useraccount_logout_label=User Account 27 | label_com_springone_myrestaurants_domain_restaurant_version=Version 28 | label_com_springone_myrestaurants_domain_useraccount_id=Id 29 | application_name=MyRestaurants 30 | -------------------------------------------------------------------------------- /hello-worlds/src/main/java/org/springframework/data/neo4j/examples/hellograph/World.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.neo4j.examples.hellograph; 2 | 3 | import org.springframework.data.graph.annotation.GraphProperty; 4 | import org.springframework.data.graph.annotation.NodeEntity; 5 | import org.springframework.data.graph.annotation.RelatedTo; 6 | import org.springframework.data.graph.core.Direction; 7 | import org.springframework.data.graph.core.NodeBacked; 8 | import org.springframework.data.graph.neo4j.annotation.Indexed; 9 | 10 | import java.util.Set; 11 | 12 | /** 13 | * A Spring Data Graph enhanced World entity. 14 | *

    15 | * This is the initial POJO in the Universe. 16 | */ 17 | @NodeEntity 18 | public class World 19 | { 20 | @Indexed 21 | private String name; 22 | 23 | @Indexed(indexName = "moon-index") 24 | private int moons; 25 | 26 | @RelatedTo(type = "REACHABLE_BY_ROCKET", elementClass = World.class, direction = Direction.BOTH) 27 | private Set reachableByRocket; 28 | 29 | public World( String name, int moons ) 30 | { 31 | this.name = name; 32 | this.moons = moons; 33 | } 34 | 35 | public World() 36 | { 37 | } 38 | 39 | public String getName() 40 | { 41 | return name; 42 | } 43 | 44 | public int getMoons() 45 | { 46 | return moons; 47 | } 48 | 49 | @Override 50 | public String toString() 51 | { 52 | return String.format("World{name='%s, moons=%d}", name, moons); 53 | } 54 | 55 | public void addRocketRouteTo( World otherWorld ) 56 | { 57 | relateTo( otherWorld, RelationshipTypes.REACHABLE_BY_ROCKET ); 58 | } 59 | 60 | public boolean canBeReachedFrom( World otherWorld ) 61 | { 62 | return reachableByRocket.contains( otherWorld ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/tags/util/language.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | ${fn:escapeXml(lang_label)} 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/tags/util/language.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | ${fn:escapeXml(lang_label)} 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /hello-worlds/src/test/java/org/springframework/data/neo4j/examples/hellograph/WorldTest.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.neo4j.examples.hellograph; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.graph.neo4j.support.GraphDatabaseContext; 7 | import org.springframework.data.graph.neo4j.support.node.Neo4jHelper; 8 | import org.springframework.data.neo4j.examples.hellograph.World; 9 | import org.springframework.test.annotation.Rollback; 10 | import org.springframework.test.context.ContextConfiguration; 11 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 12 | import org.springframework.test.context.transaction.BeforeTransaction; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | import static org.junit.Assert.assertNull; 16 | 17 | /** 18 | * Exploratory unit-tests for the Spring Data Graph annotated World entity. 19 | * 20 | * Since the World is a @NodeEntity, the SpringDataGraph must 21 | * be setup before you can even create instances of the POJO. 22 | */ 23 | @ContextConfiguration(locations = "classpath:spring/helloWorldContext.xml") 24 | @RunWith(SpringJUnit4ClassRunner.class) 25 | @Transactional 26 | public class WorldTest 27 | { 28 | 29 | @Autowired 30 | private GraphDatabaseContext graphDatabaseContext; 31 | 32 | @Rollback(false) 33 | @BeforeTransaction 34 | public void clearDatabase() 35 | { 36 | Neo4jHelper.cleanDb(graphDatabaseContext); 37 | } 38 | 39 | @Test 40 | public void shouldBeSimpleToCreateNewEntities() 41 | { 42 | @SuppressWarnings("unused") 43 | World w = new World(); 44 | } 45 | 46 | @Test 47 | public void shouldHaveNullNameUsingDefaultConstructor() 48 | { 49 | World w = new World(); 50 | assertNull(w.getName()); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/tags/menu/item.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |

  • 22 | 23 | 24 | 25 | 26 |
  • 27 | 28 | 29 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/tags/menu/item.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
  • 22 | 23 | 24 | 25 | 26 |
  • 27 | 28 |
    29 |
    -------------------------------------------------------------------------------- /myrestaurants-social/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | myrestaurants-social 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.ajdt.core.ajbuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.common.project.facet.core.builder 20 | 21 | 22 | 23 | 24 | org.eclipse.wst.validation.validationbuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.ajdt.core.ajbuilder 30 | 31 | 32 | aspectPath 33 | org.springframework.aspects 34 | 35 | 36 | 37 | 38 | org.springframework.ide.eclipse.core.springbuilder 39 | 40 | 41 | 42 | 43 | org.maven.ide.eclipse.maven2Builder 44 | 45 | 46 | 47 | 48 | 49 | org.maven.ide.eclipse.maven2Nature 50 | org.eclipse.wst.common.project.facet.core.nature 51 | org.eclipse.ajdt.ui.ajnature 52 | org.eclipse.jdt.core.javanature 53 | org.eclipse.wst.common.modulecore.ModuleCoreNature 54 | org.eclipse.jem.workbench.JavaEMFNature 55 | org.springframework.ide.eclipse.core.springnature 56 | org.eclipse.wst.jsdt.core.jsNature 57 | 58 | 59 | -------------------------------------------------------------------------------- /myrestaurants-social/src/test/resources/com/springone/myrestaurants/data/RestaurantRepositoryTest-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /myrestaurants-social/src/test/resources/com/springone/myrestaurants/data/UserAccountRepositoryTest-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /myrestaurants-social/src/test/resources/com/springone/myrestaurants/data/UserAccountRelationshipsTest-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /imdb/src/main/java/org/neo4j/examples/imdb/domain/ImdbService.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.examples.imdb.domain; 2 | 3 | import java.util.List; 4 | 5 | public interface ImdbService { 6 | /** 7 | * Store a new actor in the graph and add the name to the index. 8 | * 9 | * @param name 10 | * @return the new actor 11 | */ 12 | Actor createActor(String name); 13 | 14 | /** 15 | * Store a new movie and add the title to the index. 16 | * 17 | * @param title title of the movie 18 | * @param year year of release 19 | * @return the new movie 20 | */ 21 | Movie createMovie(String title, int year); 22 | 23 | /** 24 | * Returns the actor with the given name or null 25 | * if not found. 26 | * 27 | * @param name name of actor 28 | * @return actor or null if not found 29 | */ 30 | Actor getActor(String name); 31 | 32 | /** 33 | * Return the movie with given title or null if 34 | * not found. 35 | * 36 | * @param title movie title 37 | * @return movie or null if not found 38 | */ 39 | Movie getMovie(String title); 40 | 41 | Movie getExactMovie(String title); 42 | 43 | /** 44 | * Returns a list with first element {@link Actor} followed by {@link Movie} 45 | * ending with an {@link Actor}. The list is one of the shortest paths 46 | * between the actor and actor Kevin Bacon. 47 | * 48 | * @param actor name of actor to find shortest path to Kevin Bacon 49 | * @return one of the shortest paths to Kevin Bacon 50 | */ 51 | List getBaconPath(Actor actor); 52 | 53 | /** 54 | * Add a relationship from some node to the reference node. 55 | * Will make it easy and fast to retrieve this node. 56 | */ 57 | void setupReferenceRelationship(); 58 | } 59 | -------------------------------------------------------------------------------- /imdb/README.md: -------------------------------------------------------------------------------- 1 | The IMDB Example Application for Neo4j written with Spring Datastore Graph 2 | ========================================================================== 3 | 4 | ![Web UI](https://github.com/neo4j-examples/spring-datastore-graph-imdb/raw/master/doc/images/IMDB1.png) 5 | 6 | 7 | This application serves as a boilerplate to illustrate the use of annotations to persist objects in Spring to Neo4j, along the lines of 8 | 9 | 10 | @NodeEntity 11 | public class Actor { 12 | @GraphProperty(index = true) 13 | private String name; 14 | 15 | @RelatedTo(type="ACTS_IN",elementClass = Movie.class) 16 | 17 | private Set movies; 18 | static final String NAME_INDEX = "name"; 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | 28 | public Iterable getMovies() { 29 | return movies; 30 | } 31 | 32 | public Role getRole(final Movie inMovie) { 33 | return (Role)getRelationshipTo((Movie)inMovie, Role.class, RelTypes.ACTS_IN.name()); 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "Actor '" + this.getName() + "'"; 39 | } 40 | } 41 | 42 | Which produces a graph similar to 43 | 44 | ![Graph](https://neo4j.com/docs/) 45 | 46 | 47 | 48 | The documentation of the IMDB Example domain is found at [https://neo4j.com/docs/] 49 | 50 | 51 | Run build and run the example: 52 | git clone git://github.com/neo4j-examples/spring-datastore-graph-imdb.git 53 | cd spring-datastore-graph-imdb 54 | mvn clean install jetty:run 55 | 56 | browse to [http://localhost:8080/imdb/setup.html](http://localhost:8080/imdb/setup.html), insert the data and wait until it is completed (that may take some seconds). After that, you should be able to surf the data and look for actors and movies. 57 | 58 | Stop the application with 59 | mvn jetty:stop 60 | 61 | If you inspect the graph using Neoclipse, 62 | node-icons are found in 63 | src/test/resources/icons 64 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/java/com/springone/myrestaurants/web/BaseApplicationController.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.web; 2 | 3 | import org.joda.time.format.DateTimeFormat; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.i18n.LocaleContextHolder; 6 | import org.springframework.core.convert.converter.Converter; 7 | import org.springframework.security.core.context.SecurityContextHolder; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.ModelAttribute; 10 | 11 | import com.springone.myrestaurants.dao.RestaurantDao; 12 | import com.springone.myrestaurants.dao.UserAccountDao; 13 | import com.springone.myrestaurants.domain.Restaurant; 14 | import com.springone.myrestaurants.domain.UserAccount; 15 | 16 | public class BaseApplicationController { 17 | 18 | @Autowired 19 | RestaurantDao restaurantDao; 20 | 21 | @Autowired 22 | UserAccountDao userAccountDao; 23 | 24 | @ModelAttribute("currentUserAccountId") 25 | public String populateCurrentUserName() { 26 | String currentUser = SecurityContextHolder.getContext() 27 | .getAuthentication().getName(); 28 | UserAccount userAccount = userAccountDao.findByName(currentUser); 29 | if (userAccount != null) { 30 | return userAccount.getId().toString(); 31 | } else { 32 | return "USER-ID-NOT-AVAILABLE"; 33 | } 34 | } 35 | 36 | void addDateTimeFormatPatterns(Model model) { 37 | model.addAttribute( 38 | "userAccount_birthdate_date_format", 39 | DateTimeFormat.patternForStyle("S-", 40 | LocaleContextHolder.getLocale())); 41 | } 42 | 43 | protected Converter getRestaurantConverter() { 44 | return new Converter() { 45 | public String convert(Restaurant restaurant) { 46 | return new StringBuilder().append(restaurant.getName()) 47 | .append(" ").append(restaurant.getCity()).append(" ") 48 | .append(restaurant.getState()).toString(); 49 | } 50 | }; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /myrestaurants-social/src/test/java/com/springdeveloper/data/neo/PrintNeo4j.java: -------------------------------------------------------------------------------- 1 | package com.springdeveloper.data.neo; 2 | 3 | import org.neo4j.graphdb.GraphDatabaseService; 4 | import org.neo4j.graphdb.Node; 5 | import org.neo4j.graphdb.Relationship; 6 | import org.neo4j.graphdb.RelationshipType; 7 | import org.neo4j.graphdb.Transaction; 8 | import org.neo4j.kernel.EmbeddedGraphDatabase; 9 | 10 | 11 | public class PrintNeo4j { 12 | 13 | public static void main(String[] args) { 14 | System.out.println("Hello Neo4j!"); 15 | // GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "target/data/test" ); 16 | GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "/Users/trisberg/neo4j/imdb" ); 17 | Transaction tx = graphDb.beginTx(); 18 | 19 | tx = graphDb.beginTx(); 20 | try { 21 | for (Node n : graphDb.getAllNodes()) { 22 | System.out.print("=> " + n.getId() + " :: "); 23 | for (String s : n.getPropertyKeys()) { 24 | System.out.print(" : " + s + " = " + n.getProperty(s)); 25 | } 26 | for (Relationship r : n.getRelationships()) { 27 | long start = r.getStartNode().getId(); 28 | long end = r.getEndNode().getId(); 29 | if (n.getId() == start) { 30 | System.out.print(" ** " + r.getType().name() + "--> " + end); 31 | 32 | } 33 | if (n.getId() == end) { 34 | System.out.print(" ** " + start + " <--" + r.getType().name()); 35 | 36 | } 37 | for (String s : r.getPropertyKeys()) { 38 | System.out.print(" :: " + s + " = " + r.getProperty(s)); 39 | } 40 | } 41 | System.out.println("!"); 42 | } 43 | tx.success(); 44 | } catch (Exception e) { 45 | // TODO Auto-generated catch block 46 | e.printStackTrace(); 47 | } 48 | finally { 49 | tx.finish(); 50 | } 51 | try { 52 | Thread.sleep(5000); 53 | } catch (InterruptedException e) { 54 | // TODO Auto-generated catch block 55 | e.printStackTrace(); 56 | } 57 | graphDb.shutdown(); 58 | System.out.println("Done!"); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/java/com/springone/myrestaurants/domain/TopRatedRestaurantTraverser.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.domain; 2 | 3 | import org.neo4j.graphdb.DynamicRelationshipType; 4 | import org.neo4j.graphdb.traversal.BranchOrderingPolicy; 5 | import org.neo4j.graphdb.traversal.BranchSelector; 6 | import org.neo4j.graphdb.traversal.TraversalBranch; 7 | import org.neo4j.graphdb.traversal.TraversalDescription; 8 | import org.neo4j.kernel.impl.traversal.TraversalDescriptionImpl; 9 | import org.springframework.data.graph.core.FieldTraversalDescriptionBuilder; 10 | import org.springframework.data.graph.core.NodeBacked; 11 | 12 | import java.lang.reflect.Field; 13 | 14 | /** 15 | * @author Michael Hunger 16 | * @since 02.10.2010 17 | * TODO: calculate a rating assigned to each restaurant that is the sum of its stars 18 | * the stars are multiplied by pow(1/2,distance to startNode==path.depth) 19 | */ 20 | class TopRatedRestaurantTraverser implements FieldTraversalDescriptionBuilder { 21 | @Override 22 | public TraversalDescription build(NodeBacked start, Field field, String... params) { 23 | return new TraversalDescriptionImpl() 24 | .breadthFirst() 25 | .relationships(DynamicRelationshipType.withName("friends")) 26 | .order(new BranchOrderingPolicy() { 27 | @Override 28 | public BranchSelector create(final TraversalBranch startBranch) { 29 | return new BranchSelector(){ 30 | @Override 31 | public TraversalBranch next() { 32 | TraversalBranch branch=startBranch; 33 | while (branch!=null) { 34 | if (branch.depth() 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ${id} 16 | 17 | 18 | 19 | ${openPane} 20 | 21 | 22 | 23 | ${title} 24 | 25 | 26 | 27 |
    28 | 29 | 30 |
    31 |
    32 | 33 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/tags/util/panel.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ${id} 16 | 17 | 18 | 19 | ${openPane} 20 | 21 | 22 | 23 | ${title} 24 | 25 | 26 | 27 |
    28 | 29 | 30 |
    31 |
    32 |
    33 | -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/views/menu.jspx: -------------------------------------------------------------------------------- 1 | 2 | 37 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/webapp/WEB-INF/tags/form/dependency.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |

    20 | 21 |

    22 |
    23 |
    24 |
    25 |
    -------------------------------------------------------------------------------- /myrestaurants-original/src/main/webapp/WEB-INF/tags/form/dependency.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |

    20 | 21 |

    22 |
    23 |
    24 |
    25 |
    -------------------------------------------------------------------------------- /myrestaurants-original/src/main/java/com/springone/myrestaurants/domain/Restaurant.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.domain; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.GeneratedValue; 6 | import javax.persistence.GenerationType; 7 | import javax.persistence.Id; 8 | import javax.persistence.Version; 9 | 10 | @Entity 11 | public class Restaurant { 12 | 13 | private String name; 14 | 15 | private String city; 16 | 17 | private String state; 18 | 19 | private String zipCode; 20 | 21 | public String getName() { 22 | return this.name; 23 | } 24 | 25 | public void setName(String name) { 26 | this.name = name; 27 | } 28 | 29 | public String getCity() { 30 | return this.city; 31 | } 32 | 33 | public void setCity(String city) { 34 | this.city = city; 35 | } 36 | 37 | public String getState() { 38 | return this.state; 39 | } 40 | 41 | public void setState(String state) { 42 | this.state = state; 43 | } 44 | 45 | public String getZipCode() { 46 | return this.zipCode; 47 | } 48 | 49 | public void setZipCode(String zipCode) { 50 | this.zipCode = zipCode; 51 | } 52 | 53 | @Id 54 | @GeneratedValue(strategy = GenerationType.AUTO) 55 | @Column(name = "id") 56 | private Long id; 57 | 58 | @Version 59 | @Column(name = "version") 60 | private Integer version; 61 | 62 | public Long getId() { 63 | return this.id; 64 | } 65 | 66 | public void setId(Long id) { 67 | this.id = id; 68 | } 69 | 70 | public Integer getVersion() { 71 | return this.version; 72 | } 73 | 74 | public void setVersion(Integer version) { 75 | this.version = version; 76 | } 77 | 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append("Id: ").append(getId()).append(", "); 81 | sb.append("Version: ").append(getVersion()).append(", "); 82 | sb.append("Name: ").append(getName()).append(", "); 83 | sb.append("City: ").append(getCity()).append(", "); 84 | sb.append("State: ").append(getState()).append(", "); 85 | sb.append("ZipCode: ").append(getZipCode()); 86 | return sb.toString(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /myrestaurants-social/src/main/resources/META-INF/spring/applicationContext-security.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | --------------------------------------------------------------------------------