├── src ├── main │ ├── webapp │ │ ├── WEB-INF │ │ │ ├── views │ │ │ │ ├── reset │ │ │ │ │ ├── invalidToken.jsp │ │ │ │ │ ├── reset.jsp │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── changePassword.jsp │ │ │ │ ├── home │ │ │ │ │ ├── contentNotSignedIn.jsp │ │ │ │ │ ├── header.jsp │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── contentSignedIn.jsp │ │ │ │ ├── events │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── list.jsp │ │ │ │ ├── settings │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── settings.jsp │ │ │ │ ├── admin │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── load.jsp │ │ │ │ ├── oauth │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── confirmAccess.jsp │ │ │ │ ├── invite │ │ │ │ │ ├── mail │ │ │ │ │ │ ├── tiles.xml │ │ │ │ │ │ └── invite.jsp │ │ │ │ │ ├── facebook │ │ │ │ │ │ ├── tiles.xml │ │ │ │ │ │ └── invite.jsp │ │ │ │ │ ├── twitter │ │ │ │ │ │ ├── friends.jsp │ │ │ │ │ │ ├── tiles.xml │ │ │ │ │ │ └── friendFinder.jsp │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── accept.jsp │ │ │ │ ├── signin │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── signin.jsp │ │ │ │ ├── signup │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── signup.jsp │ │ │ │ ├── connect │ │ │ │ │ ├── linkedInConnect.jsp │ │ │ │ │ ├── tripItConnect.jsp │ │ │ │ │ ├── twitterConnect.jsp │ │ │ │ │ ├── tripItConnected.jsp │ │ │ │ │ ├── twitterConnected.jsp │ │ │ │ │ ├── linkedInConnected.jsp │ │ │ │ │ ├── facebookConnected.jsp │ │ │ │ │ ├── facebookConnect.jsp │ │ │ │ │ └── tiles.xml │ │ │ │ ├── groups │ │ │ │ │ ├── view.jsp │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── event.jsp │ │ │ │ ├── members │ │ │ │ │ ├── tiles.xml │ │ │ │ │ └── view.jsp │ │ │ │ └── develop │ │ │ │ │ └── apps │ │ │ │ │ ├── view.jsp │ │ │ │ │ ├── appFormFragment.jsp │ │ │ │ │ ├── list.jsp │ │ │ │ │ ├── edit.jsp │ │ │ │ │ ├── new.jsp │ │ │ │ │ └── tiles.xml │ │ │ ├── layouts │ │ │ │ ├── mobile │ │ │ │ │ ├── footer.jsp │ │ │ │ │ ├── header.jsp │ │ │ │ │ └── page.jsp │ │ │ │ ├── standard │ │ │ │ │ ├── footer.jsp │ │ │ │ │ └── header.jsp │ │ │ │ └── tiles.xml │ │ │ ├── messages │ │ │ │ └── validation.properties │ │ │ └── tags │ │ │ │ ├── develop │ │ │ │ └── apps │ │ │ │ │ └── summary.tag │ │ │ │ ├── urls │ │ │ │ └── absoluteUrl.tag │ │ │ │ └── dates │ │ │ │ └── dateRange.tag │ │ └── resources │ │ │ ├── logo-header.png │ │ │ ├── members │ │ │ ├── male.jpg │ │ │ └── female.jpg │ │ │ ├── messages │ │ │ ├── info.png │ │ │ ├── error.png │ │ │ ├── success.png │ │ │ ├── warning.png │ │ │ └── messages.css │ │ │ ├── background-body.png │ │ │ ├── logo-springsource.png │ │ │ ├── mobile │ │ │ ├── logo-header.png │ │ │ ├── icon-apple-appstore.gif │ │ │ ├── icon-android-marketplace.gif │ │ │ ├── page.css │ │ │ └── form.css │ │ │ ├── social │ │ │ ├── tripit │ │ │ │ └── logo.png │ │ │ ├── facebook │ │ │ │ ├── logo.png │ │ │ │ └── connect_light_medium_short.gif │ │ │ ├── linkedin │ │ │ │ ├── logo.png │ │ │ │ └── connectWithLinkedIn_small.png │ │ │ ├── twitter │ │ │ │ ├── logo.png │ │ │ │ └── signin.png │ │ │ └── google │ │ │ │ └── logo-gmail.png │ │ │ └── profile-pics │ │ │ ├── male │ │ │ ├── large.jpg │ │ │ ├── small.jpg │ │ │ └── normal.jpg │ │ │ └── female │ │ │ ├── large.jpg │ │ │ ├── normal.jpg │ │ │ └── small.jpg │ └── java │ │ ├── com │ │ └── springsource │ │ │ └── greenhouse │ │ │ ├── database │ │ │ ├── upgrade │ │ │ │ ├── v3 │ │ │ │ │ ├── DropAccountConnectionTables.sql │ │ │ │ │ ├── PopulateUserConnectionTable.sql │ │ │ │ │ └── CreateUserConnectionTable.sql │ │ │ │ ├── v4 │ │ │ │ │ └── CreateTimeSlotTable.sql │ │ │ │ └── v2 │ │ │ │ │ └── AlterServiceProviderTable.sql │ │ │ └── install │ │ │ │ ├── Reset.sql │ │ │ │ ├── Group.sql │ │ │ │ ├── Member.sql │ │ │ │ ├── Invite.sql │ │ │ │ ├── Venue.sql │ │ │ │ ├── Activity.sql │ │ │ │ └── ConnectedApp.sql │ │ │ ├── validation │ │ │ └── package-info.java │ │ │ ├── config │ │ │ ├── test-data.sql │ │ │ ├── package-info.java │ │ │ ├── embedded.properties │ │ │ └── IntegrationConfig.java │ │ │ ├── connect │ │ │ └── package-info.java │ │ │ ├── invite │ │ │ ├── mail │ │ │ │ ├── package-info.java │ │ │ │ ├── invite-text.st │ │ │ │ ├── invite-text-body.st │ │ │ │ ├── MailInviteService.java │ │ │ │ └── MailInviteForm.java │ │ │ ├── package-info.java │ │ │ ├── NoSuchInviteException.java │ │ │ ├── InviteAlreadyAcceptedException.java │ │ │ ├── InviteException.java │ │ │ └── InviteAcceptAction.java │ │ │ ├── signup │ │ │ ├── package-info.java │ │ │ ├── welcome.st │ │ │ └── SignedUpGateway.java │ │ │ ├── utils │ │ │ ├── package-info.java │ │ │ ├── VisualResourceReference.java │ │ │ ├── EmailUtils.java │ │ │ ├── SubResourceReference.java │ │ │ ├── ResourceReference.java │ │ │ ├── MessageType.java │ │ │ └── SlugUtils.java │ │ │ ├── members │ │ │ ├── package-info.java │ │ │ ├── ConnectedProfile.java │ │ │ ├── ProfilePictureService.java │ │ │ ├── ProfileRepository.java │ │ │ └── Profile.java │ │ │ ├── account │ │ │ ├── package-info.java │ │ │ ├── InvalidPasswordException.java │ │ │ ├── PictureSize.java │ │ │ ├── SignInNotFoundException.java │ │ │ ├── AccountException.java │ │ │ ├── EmailAlreadyOnFileException.java │ │ │ ├── Gender.java │ │ │ ├── ProfileReference.java │ │ │ └── PictureUrlMapper.java │ │ │ ├── events │ │ │ ├── package-info.java │ │ │ ├── load │ │ │ │ ├── TimeSlotData.java │ │ │ │ ├── EventLoaderRepository.java │ │ │ │ ├── VenueData.java │ │ │ │ ├── EventLoadController.java │ │ │ │ └── LeaderData.java │ │ │ ├── EventSessionLeader.java │ │ │ ├── Rating.java │ │ │ └── RatingPeriodClosedException.java │ │ │ ├── reset │ │ │ ├── package-info.java │ │ │ ├── reset-password.st │ │ │ ├── ResetPasswordMailer.java │ │ │ ├── InvalidResetTokenException.java │ │ │ ├── ResetPasswordRequest.java │ │ │ ├── ChangePasswordForm.java │ │ │ └── AsyncResetPasswordMailer.java │ │ │ ├── settings │ │ │ └── package-info.java │ │ │ ├── activity │ │ │ ├── action │ │ │ │ ├── package-info.java │ │ │ │ ├── ActionGateway.java │ │ │ │ ├── SimpleAction.java │ │ │ │ └── ActionFactory.java │ │ │ ├── badge │ │ │ │ ├── package-info.java │ │ │ │ ├── BadgeAwarder.java │ │ │ │ ├── BadgeSystem.java │ │ │ │ ├── BadgeRepository.java │ │ │ │ ├── SimpleBadgeAwarder.java │ │ │ │ └── BadgeSystemFactoryBean.java │ │ │ └── integration-activity.xml │ │ │ ├── groups │ │ │ ├── package-info.java │ │ │ ├── GroupRepository.java │ │ │ └── Group.java │ │ │ ├── signin │ │ │ ├── package-info.java │ │ │ └── SigninController.java │ │ │ ├── home │ │ │ ├── package-info.java │ │ │ └── HomeController.java │ │ │ └── develop │ │ │ ├── package-info.java │ │ │ ├── oauth │ │ │ ├── package-info.java │ │ │ └── InvalidRequestTokenException.java │ │ │ ├── NoSuchAccountConnectionException.java │ │ │ ├── InvalidAccessTokenException.java │ │ │ ├── InvalidApiKeyException.java │ │ │ └── AppSummary.java │ │ ├── org │ │ └── springframework │ │ │ ├── jdbc │ │ │ ├── core │ │ │ │ └── package-info.java │ │ │ └── versioned │ │ │ │ ├── package-info.java │ │ │ │ ├── DatabaseChange.java │ │ │ │ ├── DatabaseUpgrader.java │ │ │ │ └── AbstractDatabaseChange.java │ │ │ ├── model │ │ │ ├── package-info.java │ │ │ └── FieldModel.java │ │ │ ├── social │ │ │ ├── mobile │ │ │ │ └── device │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── DeviceHandlerMethodArgumentResolver.java │ │ │ └── facebook │ │ │ │ └── web │ │ │ │ └── package-info.java │ │ │ ├── data │ │ │ ├── package-info.java │ │ │ ├── FileStorage.java │ │ │ └── FileData.java │ │ │ └── templating │ │ │ ├── package-info.java │ │ │ ├── StringTemplateFactory.java │ │ │ ├── StringTemplate.java │ │ │ ├── StringTemplateLoader.java │ │ │ ├── DelegatingStringTemplate.java │ │ │ ├── LocalStringTemplate.java │ │ │ └── StandardStringTemplateLoader.java │ │ └── log4j.xml └── test │ └── java │ ├── com │ └── springsource │ │ └── greenhouse │ │ ├── invite │ │ ├── mail │ │ │ └── MailInviteServiceTest.sql │ │ ├── TwitterInviteControllerTest.sql │ │ └── JdbcInviteRepositoryTest.sql │ │ ├── groups │ │ ├── JdbcGroupRepositoryTest.sql │ │ └── JdbcGroupRepositoryTest.java │ │ ├── events │ │ └── load │ │ │ ├── JdbcEventLoaderRepositoryTest.sql │ │ │ ├── JdbcEventLoaderRepositoryTest-context.xml │ │ │ ├── show_short_updated.json │ │ │ └── show_short.json │ │ ├── account │ │ ├── JdbcAccountRepositoryTest.sql │ │ ├── StubFileStorage.java │ │ └── WelcomeMailTransformerTest.java │ │ ├── settings │ │ └── SettingsControllerTest.sql │ │ ├── connect │ │ ├── JdbcServiceProviderFactoryTest.sql │ │ └── JdbcAccountConnectionRepositoryTest.sql │ │ ├── members │ │ └── JdbcProfileRepositoryTest.sql │ │ ├── utils │ │ ├── EmailUtilsTest.java │ │ └── SlugUtilsTest.java │ │ └── develop │ │ └── JdbcAppRepositoryTest.sql │ └── log4j.xml ├── Dockerfile ├── .gitignore ├── .rancher-pipeline.yml ├── .springBeans ├── NOTICE └── deployment.yaml /src/main/webapp/WEB-INF/views/reset/invalidToken.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 |

Invalid reset password token

-------------------------------------------------------------------------------- /src/main/webapp/resources/logo-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/logo-header.png -------------------------------------------------------------------------------- /src/main/webapp/resources/members/male.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/members/male.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/messages/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/messages/info.png -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/upgrade/v3/DropAccountConnectionTables.sql: -------------------------------------------------------------------------------- 1 | drop table AccountConnection; 2 | drop table ServiceProvider; -------------------------------------------------------------------------------- /src/main/webapp/resources/background-body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/background-body.png -------------------------------------------------------------------------------- /src/main/webapp/resources/members/female.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/members/female.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/messages/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/messages/error.png -------------------------------------------------------------------------------- /src/main/webapp/resources/messages/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/messages/success.png -------------------------------------------------------------------------------- /src/main/webapp/resources/messages/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/messages/warning.png -------------------------------------------------------------------------------- /src/main/webapp/resources/logo-springsource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/logo-springsource.png -------------------------------------------------------------------------------- /src/main/webapp/resources/mobile/logo-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/mobile/logo-header.png -------------------------------------------------------------------------------- /src/main/webapp/resources/social/tripit/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/social/tripit/logo.png -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/validation/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Data validation extensions. 3 | */ 4 | package com.springsource.greenhouse.validation; -------------------------------------------------------------------------------- /src/main/java/org/springframework/jdbc/core/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring JDBC row mapping extensions. 3 | */ 4 | package org.springframework.jdbc.core; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/model/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring UI extensions for modeling forms. 3 | */ 4 | package org.springframework.model; 5 | 6 | -------------------------------------------------------------------------------- /src/main/webapp/resources/social/facebook/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/social/facebook/logo.png -------------------------------------------------------------------------------- /src/main/webapp/resources/social/linkedin/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/social/linkedin/logo.png -------------------------------------------------------------------------------- /src/main/webapp/resources/social/twitter/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/social/twitter/logo.png -------------------------------------------------------------------------------- /src/main/webapp/resources/social/twitter/signin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/social/twitter/signin.png -------------------------------------------------------------------------------- /src/main/webapp/resources/profile-pics/male/large.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/profile-pics/male/large.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/profile-pics/male/small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/profile-pics/male/small.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/mobile/icon-apple-appstore.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/mobile/icon-apple-appstore.gif -------------------------------------------------------------------------------- /src/main/webapp/resources/profile-pics/female/large.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/profile-pics/female/large.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/profile-pics/female/normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/profile-pics/female/normal.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/profile-pics/female/small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/profile-pics/female/small.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/profile-pics/male/normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/profile-pics/male/normal.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/social/google/logo-gmail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/social/google/logo-gmail.png -------------------------------------------------------------------------------- /src/main/java/org/springframework/social/mobile/device/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Mobile Device Extensions. 3 | */ 4 | package org.springframework.social.mobile.device; 5 | 6 | -------------------------------------------------------------------------------- /src/main/webapp/resources/mobile/icon-android-marketplace.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/mobile/icon-android-marketplace.gif -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/config/test-data.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/java/com/springsource/greenhouse/config/test-data.sql -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/connect/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Greenhouse-specific connection support classes 3 | */ 4 | package com.springsource.greenhouse.connect; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/invite/mail/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * For sending invites to email contacts. 3 | */ 4 | package com.springsource.greenhouse.invite.mail; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/signup/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Functionality for registering new member accounts. 3 | */ 4 | package com.springsource.greenhouse.signup; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/utils/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Common utilities and helpers used by other packages. 3 | */ 4 | package com.springsource.greenhouse.utils; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/social/facebook/web/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Social Facebook Web Extensions. 3 | */ 4 | package org.springframework.social.facebook.web; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/members/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Domain package for managing public member profiles. 3 | */ 4 | package com.springsource.greenhouse.members; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Data extensions for FileStorage; supports S3 and local file storage. 3 | */ 4 | package org.springframework.data; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/account/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Domain package for member accounts modeling user identity. 3 | */ 4 | package com.springsource.greenhouse.account; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/events/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Allows groups of members to organize events of interest. 3 | */ 4 | package com.springsource.greenhouse.events; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/reset/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Password reset behavior, for when you forget your password. 3 | */ 4 | package com.springsource.greenhouse.reset; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/settings/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Supports changes and customizations to a member account. 3 | */ 4 | package com.springsource.greenhouse.settings; 5 | 6 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tomcat 2 | RUN ["rm", "-rf", "/usr/local/tomcat/webapps/ROOT"] 3 | ADD target/greenhouse-1.0.0.BUILD-SNAPSHOT.war /usr/local/tomcat/webapps/ROOT.war 4 | 5 | CMD ["catalina.sh", "run"] 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/action/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Action framework for modeling member activity. 3 | */ 4 | package com.springsource.greenhouse.activity.action; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/groups/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Groups of members that work together or share common interests. 3 | */ 4 | package com.springsource.greenhouse.groups; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/signin/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Functionality for signing-in and authenticating existing members. 3 | */ 4 | package com.springsource.greenhouse.signin; 5 | 6 | -------------------------------------------------------------------------------- /src/main/webapp/resources/social/linkedin/connectWithLinkedIn_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/social/linkedin/connectWithLinkedIn_small.png -------------------------------------------------------------------------------- /src/main/java/org/springframework/jdbc/versioned/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring JDBC extensions for managing incremental database migrations. 3 | */ 4 | package org.springframework.jdbc.versioned; 5 | 6 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/layouts/mobile/footer.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 | <%@ page session="false" %> 3 | © Copyright 2010-2012 SpringSource, a division of VMware -------------------------------------------------------------------------------- /src/main/webapp/resources/social/facebook/connect_light_medium_short.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rancher/pipeline-example-maven/HEAD/src/main/webapp/resources/social/facebook/connect_light_medium_short.gif -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/home/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * UI control logic that applies to the application home page or across all pages. 3 | */ 4 | package com.springsource.greenhouse.home; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/invite/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Infrastructure for sending and accepting invites to join our community. 3 | */ 4 | package com.springsource.greenhouse.invite; 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | Thumbs.db 3 | bin 4 | target 5 | src/main/filters/* 6 | src/main/webapp/META-INF 7 | .classpath 8 | .project 9 | .settings 10 | *.iml 11 | *.ipr 12 | *.iws 13 | *.idea 14 | attendees.csv -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Framework extensions that aid in configuring the Greenhouse application. 3 | */ 4 | package com.springsource.greenhouse.config; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/develop/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Lets developers connect their apps to a server-side API securely with OAuth. 3 | */ 4 | package com.springsource.greenhouse.develop; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/badge/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Badge system that rewards members for participating in the community. 3 | */ 4 | package com.springsource.greenhouse.activity.badge; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/templating/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Framework extensions for string templating, particularly useful in constructing emails. 3 | */ 4 | package org.springframework.templating; 5 | 6 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/layouts/mobile/header.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | " alt="Greenhouse" /> -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/develop/oauth/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OAuth session management that integrates with the Spring Security-based OAuth Provider. 3 | */ 4 | package com.springsource.greenhouse.develop.oauth; 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/invite/mail/invite-text.st: -------------------------------------------------------------------------------- 1 | **** Your friend $account.fullName$ has sent you a personal invitation to join the Greenhouse! **** 2 | 3 | $body$ 4 | 5 | **** To accept this invitation, click $acceptUrl$ **** -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/invite/mail/MailInviteServiceTest.sql: -------------------------------------------------------------------------------- 1 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Roy', 'Clarkson', 'rclarkson@vmware.com', 'atlanta', 'rclarkson', 'M', '1977-12-01'); 2 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/install/Reset.sql: -------------------------------------------------------------------------------- 1 | create table ResetPassword (token varchar, 2 | createTime timestamp not null default now(), 3 | member bigint not null, 4 | primary key (token), 5 | foreign key (member) references Member(id)); -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/upgrade/v3/PopulateUserConnectionTable.sql: -------------------------------------------------------------------------------- 1 | insert into UserConnection (userId, providerId, providerUserId, rank, profileUrl, accessToken, secret) select member, provider, accountId, 1, profileUrl, accessToken, secret from AccountConnection; -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/reset/reset-password.st: -------------------------------------------------------------------------------- 1 | $firstName$, 2 | 3 | You, or someone on your behalf, requested a password reset. 4 | 5 | To reset your password, click the following link: 6 | $resetUrl$ 7 | 8 | Sincerely, 9 | 10 | The Greenhouse Development Team -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/layouts/standard/footer.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 | SpringSource 5 |

Version 1.0.0 (Beta) - © Copyright 2010-2012 SpringSource, a division of VMware

-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/messages/validation.properties: -------------------------------------------------------------------------------- 1 | com.springsource.greenhouse.validation.constraints.Confirm.message=could not confirm 2 | typeMismatch=invalid input 3 | eventForm.startDate.typeMismatch=start date should be formatted as mm/dd/yyyy 4 | typeMismatch.org.jodatime.LocalDate=date must be of format mm/dd/yyyy -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/invite/mail/invite-text-body.st: -------------------------------------------------------------------------------- 1 | \$invitee.firstName\$, 2 | 3 | Greenhouse is all about helping you connect with fellow application developers. 4 | 5 | It can help you stay on top of everything that's happening in the Spring community. 6 | 7 | Hope to see you there, 8 | $account.firstName$ -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/install/Group.sql: -------------------------------------------------------------------------------- 1 | create table MemberGroup (id identity, 2 | name varchar not null unique, 3 | slug varchar not null unique, 4 | description varchar, 5 | hashtag varchar unique, 6 | leader bigint not null, 7 | primary key (id), 8 | foreign key (leader) references Member(id)); -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/upgrade/v4/CreateTimeSlotTable.sql: -------------------------------------------------------------------------------- 1 | create table EventTimeSlot ( 2 | id identity, 3 | startTime timestamp not null, 4 | endTime timestamp not null, 5 | primary key (id) 6 | ); 7 | 8 | alter table EventSession add column timeslot bigint; 9 | alter table EventSession add foreign key (timeslot) references EventTimeSlot(id); -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/signup/welcome.st: -------------------------------------------------------------------------------- 1 | Welcome to the Greenhouse, $firstName$! 2 | 3 | The Greenhouse is a place for application developers to connect and stay on top of everything happening in the Spring community. 4 | 5 | View your member profile at: 6 | $profileUrl$ 7 | 8 | Download Greenhouse for iPhone: 9 | http://itunes.apple.com/us/app/greenhouse/id395862873 -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/groups/JdbcGroupRepositoryTest.sql: -------------------------------------------------------------------------------- 1 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Art', 'Names', 'artnames@habuma.com', 'password', 'artnames', 'M', '1977-12-01'); 2 | insert into MemberGroup (name, slug, description, hashtag, leader) values ('Test Group', 'test-group', 'This is a test group', '#test', 1); -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/events/load/JdbcEventLoaderRepositoryTest.sql: -------------------------------------------------------------------------------- 1 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Craig' , 'Walls', 'cwalls@vmware.com', 'denton', 'habuma', 'M', '1977-12-01'); 2 | insert into MemberGroup (name, slug, description, hashtag, leader) values ('SpringOne2gx', 's2gx', 'The premier Spring Framework event', '#s2gx', 1); 3 | -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/account/JdbcAccountRepositoryTest.sql: -------------------------------------------------------------------------------- 1 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Craig', 'Walls', 'cwalls@vmware.com', 'password', 'habuma', 'M', '1977-12-01'); 2 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Keith', 'Donald', 'kdonald@vmware.com', 'password', 'kdonald', 'M', '1977-12-01'); 3 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/home/contentNotSignedIn.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |
5 |

Welcome to the Greenhouse!

6 |

7 | We make it fun to be an application developer. 8 |

9 |

10 | We help you connect with fellow developers and take advantage of everything the Spring community has to offer. 11 |

12 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/events/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.rancher-pipeline.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - name: Build 3 | steps: 4 | - runScriptConfig: 5 | image: maven:3-jdk-7 6 | shellScript: |- 7 | mvn clean install 8 | - name: Publish 9 | steps: 10 | - publishImageConfig: 11 | dockerfilePath: ./Dockerfile 12 | buildContext: . 13 | tag: example-greenhouse:${CICD_EXECUTION_SEQUENCE} 14 | - name: Deploy 15 | steps: 16 | - applyYamlConfig: 17 | path: ./deployment.yaml 18 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/settings/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/admin/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/home/header.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |

">" alt="Greenhouse" />

5 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/oauth/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/invite/mail/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/tags/develop/apps/summary.tag: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 | <%@ attribute name="value" required="true" rtexprvalue="true" type="com.springsource.greenhouse.develop.AppSummary" %> 3 |
4 | App Icon 5 |

">

6 |

7 |
8 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/invite/facebook/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/install/Member.sql: -------------------------------------------------------------------------------- 1 | create table Member (id identity, 2 | firstName varchar not null, 3 | lastName varchar not null, 4 | email varchar(320) not null unique, 5 | password varchar not null, 6 | username varchar unique, 7 | gender varchar(1) not null check (gender in ('M', 'F')), 8 | birthdate date not null, 9 | reputation int default 0, 10 | pictureSet boolean default false, 11 | primary key (id)); -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/admin/load.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://www.springframework.org/spring-social/facebook/tags" prefix="facebook" %> 5 | 6 | 7 |

Admin: Load Event

8 | 9 |
10 |
11 | 12 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/signin/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/signup/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/invite/twitter/friends.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |

Find Results

5 | 6 | 7 | 12 | 13 | 14 |

No friends found

15 |
16 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/connect/linkedInConnect.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |
" method="POST"> 5 |
6 |

Connect to LinkedIn

7 |

Click the button to connect your Greenhouse account with your LinkedIn account.

8 |
9 | " /> 10 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/groups/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://www.springframework.org/spring-social/facebook/tags" prefix="facebook" %> 5 | 6 |

7 |

8 | 9 |
10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/members/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | src/test/java/com/springsource/greenhouse/events/load/JdbcEventLoaderRepositoryTest-context.xml 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/oauth/confirmAccess.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |

Grant access

5 | 6 |

The application ${clientApp.summary.name} would like the ability to read and update your data on Greenhouse.

7 | 8 | 9 |
10 | 11 |

12 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/connect/tripItConnect.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |
" method="POST"> 5 |
6 |

Connect to TripIt

7 |

8 | Click the button to connect your Greenhouse account with your TripIt account. 9 | You will be taken to TripIt for authorization and then will be brought back here. 10 |

11 |
12 | 13 |
-------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/settings/SettingsControllerTest.sql: -------------------------------------------------------------------------------- 1 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Keith' , 'Donald', 'youknow@vmware.com', 'whateveryouwantittobe', 'kdonald', 'M', '1977-12-01'); 2 | insert into App (name, slug, description, website, apiKey, secret, callbackUrl) values ('Greenhouse for the iPhone', 'greenhouse-for-the-iphone', 'Awesome', 'http://www.springsource.com', 'a08318eb478a1ee31f69a55276f3af64', '80e7f8f7ba724aae9103f297e5fb9bdf', 'x-com-springsource-greenhouse://oauth-response'); 3 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/invite/twitter/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/invite/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/upgrade/v3/CreateUserConnectionTable.sql: -------------------------------------------------------------------------------- 1 | drop table UserConnection if exists; 2 | create table UserConnection (userId varchar not null, 3 | providerId varchar not null, 4 | providerUserId varchar, 5 | rank int not null, 6 | displayName varchar, 7 | profileUrl varchar, 8 | imageUrl varchar, 9 | accessToken varchar not null, 10 | secret varchar, 11 | refreshToken varchar, 12 | expireTime bigint, 13 | primary key (userId, providerId, providerUserId)); 14 | create unique index UserConnectionRank on UserConnection(userId, providerId, rank); -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/install/Invite.sql: -------------------------------------------------------------------------------- 1 | create table Invite (token varchar, 2 | email varchar unique not null, 3 | firstName varchar, 4 | lastName varchar, 5 | text varchar, 6 | sentTime timestamp not null default now(), 7 | sentBy bigint not null, 8 | primary key (token), 9 | foreign key (sentBy) references Member(id)); 10 | 11 | create table InviteAcceptAction (invite varchar not null, 12 | memberAction bigint unique not null, 13 | primary key (invite), 14 | foreign key (memberAction) references MemberAction(id), 15 | foreign key (invite) references Invite(token)); -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/groups/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/install/Venue.sql: -------------------------------------------------------------------------------- 1 | create table Venue (id identity, 2 | name varchar not null, 3 | postalAddress varchar not null, 4 | latitude double not null, 5 | longitude double not null, 6 | locationHint varchar not null, 7 | createdBy bigint not null, 8 | primary key (id), 9 | foreign key (createdBy) references Member(id)); 10 | 11 | create table VenueRoom (venue bigint, 12 | id smallint not null, 13 | name varchar not null, 14 | capacity int not null, 15 | locationHint varchar not null, 16 | primary key (venue, id), 17 | foreign key (venue) references Venue(id) on delete cascade); -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/layouts/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/reset/reset.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 | 5 |
${message.text}
6 |
7 | 8 |
9 |
10 |

Reset Password

11 |
12 |
13 | 14 | 15 |
16 |

17 |
-------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/upgrade/v2/AlterServiceProviderTable.sql: -------------------------------------------------------------------------------- 1 | alter table AccountProvider rename to ServiceProvider; 2 | update ServiceProvider set implementation = 'com.springsource.greenhouse.connect.providers.TwitterServiceProvider' where name = 'twitter'; 3 | update ServiceProvider set implementation = 'com.springsource.greenhouse.connect.providers.FacebookServiceProvider' where name = 'facebook'; 4 | update ServiceProvider set implementation = 'com.springsource.greenhouse.connect.providers.LinkedInServiceProvider' where name = 'linkedin'; 5 | update ServiceProvider set implementation = 'com.springsource.greenhouse.connect.providers.TripItServiceProvider' where name = 'tripit'; -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/connect/twitterConnect.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |
" method="POST"> 5 |
6 |

Connect to Twitter

7 |

Click the button to connect your Greenhouse account with your Twitter account.

8 |
9 |

10 |
11 | 12 |
13 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/home/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/connect/tripItConnected.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | 5 | 6 |
${message.text}
7 |
8 | 9 |
" method="post"> 10 |
11 |

12 | Your Greenhouse account is connected to your TripIt account. 13 | Click the button if you wish to disconnect. 14 |

15 |
16 | 17 | 18 |
19 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/connect/twitterConnected.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | 5 | 6 |
${message.text}
7 |
8 | 9 |
" method="post"> 10 |
11 |

12 | Your Greenhouse account is connected to your Twitter account. 13 | Click the button if you wish to disconnect. 14 |

15 |
16 | 17 | 18 |
19 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/connect/linkedInConnected.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | 5 | 6 |
${message.text}
7 |
8 | 9 |
" method="post"> 10 |
11 |

12 | Your Greenhouse account is connected to your LinkedIn account. 13 | Click the button if you wish to disconnect. 14 |

15 |
16 | 17 | 18 |
19 | -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/invite/TwitterInviteControllerTest.sql: -------------------------------------------------------------------------------- 1 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Craig', 'Walls', 'cwalls@vmware.com', 'password', 'habuma', 'M', '1977-12-01'); 2 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Keith', 'Donald', 'kdonald@vmware.com', 'password', 'kdonald', 'M', '1977-12-01'); 3 | insert into AccountProvider (name, apiKey, secret, requestTokenUrl, authorizeUrl, accessTokenUrl) values ('twitter', 'whatev', 'secret', 'http://www.twitter.com', 'http://www.twitter.com', 'http://www.twitter.com'); 4 | insert into AccountConnection (member, accountId, provider, accessToken) values (1, 'habuma', 'twitter', 'accesstoken'); 5 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/tags/urls/absoluteUrl.tag: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ attribute name="value" required="true" rtexprvalue="true" type="java.lang.String" %> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | ${scheme}://${pageContext.request.serverName}${port} -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/reset/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Greenhouse 1.0.0.BUILD-SNAPSHOT 2 | Copyright (c) 2010-2012 VMware, Inc. All Rights Reserved. 3 | 4 | This product is licensed to you under the Apache License, Version 2.0 (the "License"). 5 | You may not use this product except in compliance with the License. 6 | 7 | This product may include a number of subcomponents with separate copyright notices 8 | and license terms. Your use of these subcomponents is subject to the terms and 9 | conditions of the subcomponent's license, as noted in the LICENSE file. 10 | 11 | This software downloads additional open source software components upon install 12 | that are distributed under separate terms and conditions. Please see the license 13 | information provided in the individual software components for more information. 14 | 15 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/connect/facebookConnected.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | <%@ taglib uri="http://www.springframework.org/spring-social/facebook/tags" prefix="facebook" %> 5 | 6 | 7 |
${message.text}
8 |
9 | 10 |
11 |
12 |

13 | Your Greenhouse account is connected to your Facebook account. 14 | Click the button if you wish to disconnect. 15 |

16 |
17 | 18 | 19 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/develop/apps/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | <%@ taglib tagdir="/WEB-INF/tags/develop/apps" prefix="apps" %> 5 | 6 |

App Settings

7 | 8 | 9 | 10 |
11 |
API key
12 |
${app.apiKey}
13 |
Secret
14 |
${app.secret}
15 |
16 | 17 |
" method="post"> 18 | 19 |

20 |
21 | 22 | ">Edit details 23 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/config/embedded.properties: -------------------------------------------------------------------------------- 1 | # properties used in the embedded mode of operation 2 | application.url=http://localhost:8080/greenhouse 3 | application.secureUrl=http://localhost:8080/greenhouse 4 | application.secureChannel=http 5 | facebook.appId=21aa96c8bc23259d0dd2ab99e496c306 6 | facebook.appSecret=f9f627194d471fb915dfbc856d347288 7 | twitter.consumerKey=kqAm0GiPCT2owEtyTLPsug 8 | twitter.consumerSecret=3461TFWV52VJuppKeaWMi8lKOxXMZtYLPGISq4nJ5s 9 | linkedin.consumerKey=elcLPr8RxIXifjn5RKwaTNxKPap4dYrr9ANuJ-abZNkTjbT3mSOVT7IhSfsF27XP 10 | linkedin.consumerSecret=QiMWSBRBBM43wFuqpn8XtXqdfLB6A0TJUQslBjtuQAwYCOcIdvRaotT9c50I72pk 11 | tripit.consumerKey=739681c719f545d13d2376552d182b47c79b1d35 12 | tripit.consumerSecret=b6287a592afb3eccefb9261ee87c96d3b5f39286 -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/members/view.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://www.springframework.org/spring-social/facebook/tags" prefix="facebook" %> 5 | 6 |
7 | Profile Picture 8 |

9 | 14 | 15 |
16 |
17 | 18 | -------------------------------------------------------------------------------- /src/main/webapp/resources/mobile/page.css: -------------------------------------------------------------------------------- 1 | @import url("../messages/messages.css"); 2 | @import url("form.css"); 3 | 4 | a img, frameset, fieldset { 5 | border: 0; 6 | } 7 | 8 | body { 9 | margin: 0px; 10 | margin-bottom: 10px; 11 | font-family: "lucida grande", lucida, tahoma, helvetica, arial, sans-serif !important; 12 | font-size: 1em; 13 | color: #666666; 14 | } 15 | 16 | #content { 17 | margin-left: 36px; 18 | margin-right: 36px; 19 | } 20 | 21 | #footer { 22 | font-size: .625em; 23 | text-align: center; 24 | } 25 | 26 | h2 { 27 | font-size: 1.075em; 28 | font-weight: bold; 29 | text-transform: uppercase; 30 | } 31 | 32 | ul { 33 | padding: 0px; 34 | } 35 | 36 | li { 37 | list-style-type: none; 38 | margin-bottom: 2px; 39 | } 40 | 41 | #nav ul { 42 | padding: 5px; 43 | } -------------------------------------------------------------------------------- /deployment.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: greenhouse-service 5 | spec: 6 | selector: 7 | app: greenhouse 8 | type: NodePort 9 | ports: 10 | - protocol: TCP 11 | port: 8080 12 | targetPort: 8080 13 | --- 14 | apiVersion: apps/v1 15 | kind: Deployment 16 | metadata: 17 | name: example-greenhouse 18 | labels: 19 | app: greenhouse 20 | spec: 21 | replicas: 1 22 | selector: 23 | matchLabels: 24 | app: greenhouse 25 | template: 26 | metadata: 27 | labels: 28 | app: greenhouse 29 | spec: 30 | imagePullSecrets: 31 | - name: pipeline-docker-registry 32 | containers: 33 | - name: maven 34 | image: ${CICD_IMAGE}:${CICD_EXECUTION_SEQUENCE} 35 | ports: 36 | - containerPort: 8080 37 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/reset/changePassword.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> 4 | 5 | 6 |
7 |

Reset password

8 |
9 |
10 | Password (at least 6 characters) 11 | 12 | Confirm Password 13 | 14 | 15 |
16 |

17 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/develop/apps/appFormFragment.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> 4 |
5 | Name 6 | 7 | Description 8 | 9 | Organization 10 | 11 | Website 12 | 13 | Callback URL 14 | 15 |
-------------------------------------------------------------------------------- /src/main/webapp/resources/messages/messages.css: -------------------------------------------------------------------------------- 1 | div.info,div.success,div.warning,div.error { 2 | border: 1px solid; 3 | margin: 10px 0px; 4 | padding: 15px 10px 15px 50px; 5 | background-repeat: no-repeat; 6 | background-position: 10px center; 7 | } 8 | 9 | div.info { 10 | color: #00529B; 11 | background-color: #BDE5F8; 12 | background-image: url('info.png'); 13 | } 14 | 15 | div.success { 16 | color: #4F8A10; 17 | background-color: #DFF2BF; 18 | background-image: url('success.png'); 19 | } 20 | 21 | div.warning { 22 | color: #9F6000; 23 | background-color: #FEEFB3; 24 | background-image: url('warning.png'); 25 | } 26 | 27 | div.error { 28 | color: #D8000C; 29 | background-color: #FFBABA; 30 | background-image: url('error.png'); 31 | } 32 | 33 | span.success { 34 | color: #4F8A10; 35 | } 36 | 37 | span.error { 38 | color: #D8000C; 39 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/develop/apps/list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 5 | <%@ taglib tagdir="/WEB-INF/tags/develop/apps" prefix="apps" %> 6 | 7 |

Greenhouse Apps

8 | 9 | 10 |

You have not registered any apps.

11 |
12 | 13 |

You have registered the following apps:

14 |
15 | 16 | 17 |
    18 |
  • 19 |
20 |
21 | 22 | ">Register App -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/develop/apps/edit.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> 5 | 6 | 7 | 8 |
9 |

Edit App

10 | 11 | 12 |
Unable to save edits. Please fix the errors below and try again.
13 |
14 |
15 |
16 | 17 | 18 | 19 | 20 |

21 |
-------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/invite/JdbcInviteRepositoryTest.sql: -------------------------------------------------------------------------------- 1 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Roy', 'Clarkson', 'rclarkson@vmware.com', 'atlanta', 'rclarkson', 'M', '1977-12-01'); 2 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Craig', 'Walls', 'cwalls@vmware.com', 'plano', 'habuma', 'M', '1977-12-01'); 3 | 4 | insert into Invite (token, firstName, lastName, email, sentBy) values ('abc', 'Keith', 'Donald', 'keith.donald@springsource.com', 1); 5 | 6 | insert into Invite (token, firstName, lastName, email, sentBy) values ('def', 'Craig', 'Walls', 'cwalls@vmware.com', 1); 7 | insert into MemberAction (actionType, performTime, member) values ('InviteAccept', '2010-10-18 22:00:00Z', 2); 8 | insert into InviteAcceptAction (invite, memberAction) values ('def', 1); -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/develop/apps/new.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> 5 | 6 | 7 | 8 |
9 |

Register App

10 | 11 | 12 |
Unable to register. Please fix the errors below and resubmit.
13 |
14 |
15 |

Connect one of your apps to Greenhouse by completing the following form.

16 |
17 | 18 | 19 | 20 |

21 |
-------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/connect/JdbcServiceProviderFactoryTest.sql: -------------------------------------------------------------------------------- 1 | insert into ServiceProvider (name, displayName, implementation, apiKey, secret, requestTokenUrl, authorizeUrl, accessTokenUrl) values ('twitter', 'Twitter', 'com.springsource.greenhouse.connect.providers.TwitterServiceProvider', '76926d574e7ff5dabb94b5df23b6add6', 'ea448a2cc81b84da29b3eeaf1e0242a1', 'http://www.twitter.com/request', 'http://www.twitter.com/authorize?oauth_token={token}', 'http://www.twitter.com/access'); 2 | insert into ServiceProvider (name, displayName, implementation, apiKey, secret, requestTokenUrl, authorizeUrl, accessTokenUrl) values ('facebook', 'Facebook', 'com.springsource.greenhouse.connect.providers.FacebookServiceProvider', '8d4c8b1930b25c4ea1a923fb9c213f4d', 'ea448a2cc81b84da29b3eeaf1e0242a1', 'http://www.facebook.com/request', 'http://www.facebook.com/authorize', 'http://www.facebook.com/access'); 3 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/layouts/standard/header.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |

">" alt="Greenhouse" />

5 | 20 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/develop/apps/tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/home/contentSignedIn.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |
5 |

Welcome to the Greenhouse!

6 |

7 | We make it fun to be an application developer. 8 |

9 |

10 | We help you connect with fellow developers and take advantage of everything the Spring community has to offer. 11 |

12 |

13 | If this is your first time here, start by ">connecting your Greenhouse account to your social networks, then grab the mobile client. 14 |

15 |
16 |
17 | " /> 18 | " /> 19 |
-------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/install/Activity.sql: -------------------------------------------------------------------------------- 1 | create table MemberAction (id identity, 2 | actionType varchar not null, 3 | performTime timestamp not null, 4 | latitude double, 5 | longitude double, 6 | member bigint, 7 | primary key (id), 8 | foreign key (member) references Member(id)); 9 | 10 | create table Badge (name varchar, 11 | description varchar not null, 12 | level tinyint not null, 13 | primary key (name)); 14 | 15 | create table AwardedBadge(id identity, 16 | badge varchar not null, 17 | awardTime timestamp not null, 18 | member bigint not null, 19 | memberAction bigint, 20 | primary key (id), 21 | foreign key (badge) references Badge(name), 22 | foreign key (member) references Member(id), 23 | foreign key (memberAction) references MemberAction(id)); 24 | 25 | insert into Badge (name, description, level) values ('Newbie', 'You joined!', 1); -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/invite/twitter/friendFinder.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |
" method="post"> 5 |
6 |

Find Twitter Friends

7 |

See who you follow is also a member of the Greenhouse.

8 |
9 |
10 | 11 | 12 |
13 |

14 | 15 |

16 |
17 | 18 | 19 | 29 | 30 |
31 |
-------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/events/load/JdbcEventLoaderRepositoryTest-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/signup/signup.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> 5 | 6 | 7 |
${message.text}
8 |
9 | 10 | 11 | 12 |
13 |

Sign Up at the Greenhouse

14 | 15 | 16 | 17 |
Unable to sign up. Please fix the errors below and resubmit.
18 |
19 |
20 |
21 |

Join Greenhouse to connect with other application developers using Spring.

22 |
23 | <%@ include file="signupForm.jspf" %> 24 |

25 |
-------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/groups/GroupRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.groups; 17 | 18 | /** 19 | * Data access interface for groups. 20 | * @author Keith Donald 21 | */ 22 | public interface GroupRepository { 23 | 24 | /** 25 | * Find a group by its slug, a short, meaningful, and unique name for the organization. 26 | */ 27 | Group findGroupBySlug(String slug); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/events/load/TimeSlotData.java: -------------------------------------------------------------------------------- 1 | package com.springsource.greenhouse.events.load; 2 | 3 | class TimeSlotData { 4 | 5 | private final long eventId; 6 | private final String label; 7 | private final String startTime; 8 | private final String endTime; 9 | private final String source; 10 | private final long sourceId; 11 | 12 | public TimeSlotData(long eventId, String label, String startTime, String endTime, String source, long sourceId) { 13 | this.eventId = eventId; 14 | this.label = label; 15 | this.startTime = startTime; 16 | this.endTime = endTime; 17 | this.source = source; 18 | this.sourceId = sourceId; 19 | } 20 | 21 | public long getEventId() { 22 | return eventId; 23 | } 24 | 25 | public String getLabel() { 26 | return label; 27 | } 28 | 29 | public String getStartTime() { 30 | return startTime; 31 | } 32 | 33 | public String getEndTime() { 34 | return endTime; 35 | } 36 | 37 | public String getSource() { 38 | return source; 39 | } 40 | 41 | public long getSourceId() { 42 | return sourceId; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/account/InvalidPasswordException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.account; 17 | 18 | /** 19 | * The password entered during an sign-in attempt was invalid. 20 | * @author Keith Donald 21 | */ 22 | @SuppressWarnings("serial") 23 | public final class InvalidPasswordException extends AccountException { 24 | 25 | public InvalidPasswordException() { 26 | super("invalid password"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/events/list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | <%@ taglib tagdir="/WEB-INF/tags/dates" prefix="d" %> 5 | 6 |

Upcoming Events

7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 | at
22 | 23 |
24 |
25 |
26 |
-------------------------------------------------------------------------------- /src/main/java/org/springframework/jdbc/versioned/DatabaseChange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.jdbc.versioned; 17 | 18 | import java.sql.Connection; 19 | 20 | /** 21 | * A single change within a change set. 22 | * Never applied independently, always applied as part of an atomic {@link DatabaseChangeSet}. 23 | * @author Keith Donald 24 | */ 25 | public interface DatabaseChange { 26 | 27 | /** 28 | * Apply this change. 29 | */ 30 | void apply(Connection connection); 31 | 32 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/reset/ResetPasswordMailer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.reset; 17 | 18 | /** 19 | * Sends out reset password emails. 20 | * @author Keith Donald 21 | */ 22 | public interface ResetPasswordMailer { 23 | 24 | /** 25 | * Send a reset password mail as part of fulfilling the member's reset password request. 26 | * @param request the member's reset password request 27 | */ 28 | void send(ResetPasswordRequest request); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/groups/event.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 5 | <%@ taglib tagdir="/WEB-INF/tags/dates" prefix="d" %> 6 | 7 |

8 |
9 |
When
10 |
11 |
Where
12 |
13 |
Description
14 |
15 |
16 |

17 | Grab the Greenhouse mobile client to follow this Event as it happens. 18 |

19 |
20 | " /> 21 | " /> 22 |
-------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/account/StubFileStorage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.account; 17 | 18 | import org.springframework.data.FileData; 19 | import org.springframework.data.FileStorage; 20 | 21 | public class StubFileStorage implements FileStorage { 22 | 23 | public String absoluteUrl(String fileName) { 24 | return "http://localhost:8080/resources/" + fileName; 25 | } 26 | 27 | public String storeFile(FileData file) { 28 | return absoluteUrl(file.getName()); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/invite/NoSuchInviteException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.invite; 17 | 18 | /** 19 | * Thrown when an invite could not be found because one indexed by the provided token does not exist. 20 | * @author Keith Donald 21 | */ 22 | @SuppressWarnings("serial") 23 | public final class NoSuchInviteException extends InviteException { 24 | 25 | public NoSuchInviteException(String token) { 26 | super(token, "No such invite with token '" + token + "'"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/templating/StringTemplateFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.templating; 17 | 18 | /** 19 | * Factory for a fresh StringTemplate instance that can be used in the local thread of execution. 20 | * @author Keith Donald 21 | */ 22 | public interface StringTemplateFactory { 23 | 24 | /** 25 | * Get a fresh StringTemplate instance that can be safely used in the current thread of execution. 26 | * StringTemplates should not be shared between threads. 27 | */ 28 | StringTemplate getStringTemplate(); 29 | 30 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/events/load/EventLoaderRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.events.load; 17 | 18 | 19 | 20 | /** 21 | * Data access interface for loading {@link Event} data. 22 | * @author Craig Walls 23 | */ 24 | public interface EventLoaderRepository { 25 | 26 | long loadEvent(EventData eventData, VenueData venueData); 27 | 28 | long loadLeader(LeaderData leaderData); 29 | 30 | long loadTimeSlot(TimeSlotData timeSlotData); 31 | 32 | int loadEventSession(EventSessionData eventSessionData); 33 | 34 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/invite/InviteAlreadyAcceptedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.invite; 17 | 18 | /** 19 | * Thrown if an invite has already been accepted and you try to accept it again. 20 | * You can only accept an invite once. 21 | * @author Keith Donald 22 | */ 23 | @SuppressWarnings("serial") 24 | public final class InviteAlreadyAcceptedException extends InviteException { 25 | 26 | public InviteAlreadyAcceptedException(String token) { 27 | super(token, "Invite already accepted with token '" + token + "'"); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/tags/dates/dateRange.tag: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 3 | <%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %> 4 | <%@ attribute name="startTime" required="true" rtexprvalue="true" type="org.joda.time.DateTime" %> 5 | <%@ attribute name="endTime" required="true" rtexprvalue="true" type="org.joda.time.DateTime" %> 6 | <%@ attribute name="timeZone" required="false" rtexprvalue="true" type="org.joda.time.DateTimeZone" %> 7 | 8 | 9 | 10 | 11 | 12 | - 13 | 14 | 15 | - 16 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/account/PictureSize.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.account; 17 | 18 | /** 19 | * Enum constants for the various member profile picture sizes. 20 | * @author Keith Donald 21 | */ 22 | public enum PictureSize { 23 | 24 | /** 25 | * The small picture size, used for profile link thumbnails. 26 | */ 27 | SMALL, 28 | 29 | /** 30 | * The normal or medium picture size, used in the default case. 31 | */ 32 | NORMAL, 33 | 34 | /** 35 | * The large picture size, used when viewing a detailed profile of the member. 36 | */ 37 | LARGE 38 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/account/SignInNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.account; 17 | 18 | /** 19 | * The provided signin name could not be mapped 20 | * @author Keith Donald 21 | */ 22 | @SuppressWarnings("serial") 23 | public final class SignInNotFoundException extends AccountException { 24 | 25 | private final String username; 26 | 27 | public SignInNotFoundException(String username) { 28 | super("username not found"); 29 | this.username = username; 30 | } 31 | 32 | public String getUsername() { 33 | return username; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/badge/BadgeAwarder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.activity.badge; 17 | 18 | import com.springsource.greenhouse.activity.action.Action; 19 | 20 | /** 21 | * Determines if a badge should be awarded when an Action is performed. 22 | * @author Keith Donald 23 | */ 24 | public interface BadgeAwarder { 25 | 26 | /** 27 | * Award a badge for the Action performed. 28 | * Returns null if no badge is to be awarded for the Action. 29 | */ 30 | public AwardedBadge awardBadgeForAction(A action); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/invite/InviteException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.invite; 17 | 18 | /** 19 | * Base class for invite exceptions. 20 | * @author Keith Donald 21 | */ 22 | @SuppressWarnings("serial") 23 | public abstract class InviteException extends Exception { 24 | 25 | private final String token; 26 | 27 | public InviteException(String token, String message) { 28 | super(message); 29 | this.token = token; 30 | } 31 | 32 | /** 33 | * The token identifying the invite. 34 | */ 35 | public String getToken() { 36 | return token; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/badge/BadgeSystem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.activity.badge; 17 | 18 | import com.springsource.greenhouse.activity.action.Action; 19 | 20 | /** 21 | * Entry point into the badge system. 22 | * Actions that are performed are routed to this system and may result in awarded badges. 23 | * @author Keith Donald 24 | */ 25 | public interface BadgeSystem { 26 | 27 | /** 28 | * Award a badge for the action performed, if appropriate. 29 | * Returns null if no badge was awarded. 30 | */ 31 | AwardedBadge awardBadgeForAction(Action action); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/utils/VisualResourceReference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.utils; 17 | 18 | /** 19 | * A resource reference that includes a picture of the resource. 20 | * @author Keith Donald 21 | */ 22 | public class VisualResourceReference extends ResourceReference { 23 | 24 | private final String imageUrl; 25 | 26 | public VisualResourceReference(T id, String label, String imageUrl) { 27 | super(id, label); 28 | this.imageUrl = imageUrl; 29 | } 30 | 31 | /** 32 | * A link to a picture of the resource. 33 | */ 34 | public String getImageUrl() { 35 | return imageUrl; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/members/JdbcProfileRepositoryTest.sql: -------------------------------------------------------------------------------- 1 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Craig' , 'Walls', 'whatever@vmware.com', 'letmein', 'habuma', 'M', '1977-12-01'); 2 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Roy' , 'Clarkson', 'roy@vmware.com', 'password', 'roy', 'M', '1977-12-01'); 3 | 4 | insert into ServiceProvider (name, displayName, implementation, apiKey, secret, requestTokenUrl, authorizeUrl, accessTokenUrl) values ('twitter', 'Twitter', 'whatev', 'whatev', 'secret', 'http://www.twitter.com', 'http://www.twitter.com', 'http://www.twitter.com'); 5 | insert into ServiceProvider (name, displayName, implementation, apiKey, secret, requestTokenUrl, authorizeUrl, accessTokenUrl) values ('facebook', 'Facebook', 'whatev', 'whatev', 'secret', 'http://www.facebook.com', 'http://www.facebook.com', 'http://www.facebook.com'); 6 | 7 | insert into AccountConnection (member, provider, accessToken, accountId, profileUrl) values (1, 'twitter', 'twitter-token', 'habuma', 'http://www.twitter.com/habuma'); 8 | insert into AccountConnection (member, provider, accessToken, accountId, profileUrl) values (1, 'facebook', 'facebook-token', '123456789', 'http://www.facebook.com/profile.php?id=123456789'); 9 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/reset/InvalidResetTokenException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.reset; 17 | 18 | /** 19 | * The reset password request token presented is not valid. 20 | * It may have expired or been already used. 21 | * @author Keith Donald 22 | */ 23 | @SuppressWarnings("serial") 24 | public class InvalidResetTokenException extends Exception { 25 | 26 | private final String token; 27 | 28 | public InvalidResetTokenException(String token) { 29 | this.token = token; 30 | } 31 | 32 | /** 33 | * The invalid request token value. 34 | */ 35 | public String getToken() { 36 | return token; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/account/AccountException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.account; 17 | 18 | /** 19 | * Base class of the AccountException hierarchy. 20 | * Marked abstract, as its designed to be subclasses. 21 | * A checked Exception, as AccountExceptions are recoverable business exceptions. 22 | * @author Keith Donald 23 | */ 24 | @SuppressWarnings("serial") 25 | public abstract class AccountException extends Exception { 26 | 27 | public AccountException(String message) { 28 | super(message); 29 | } 30 | 31 | public AccountException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/utils/EmailUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.utils; 17 | 18 | import java.util.regex.Pattern; 19 | 20 | /** 21 | * Email parsing/validation utilities. 22 | * @author Keith Donald 23 | */ 24 | public final class EmailUtils { 25 | 26 | /** 27 | * Returns true if the String is a valid email address. 28 | */ 29 | public static boolean isEmail(String string) { 30 | return emailPattern.matcher(string).matches(); 31 | } 32 | 33 | private static final Pattern emailPattern = Pattern.compile("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"); 34 | 35 | private EmailUtils() { 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/utils/SubResourceReference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.utils; 17 | 18 | /** 19 | * A resource that is the child of another. 20 | * @author Keith Donald 21 | */ 22 | public final class SubResourceReference extends ResourceReference { 23 | 24 | private final P parentId; 25 | 26 | public SubResourceReference(P parentId, C id, String label) { 27 | super(id, label); 28 | this.parentId = parentId; 29 | } 30 | 31 | /** 32 | * The parent id. 33 | * Used to generate a link to the child resource, where the parent is scoping. 34 | */ 35 | public P getParentId() { 36 | return parentId; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/account/EmailAlreadyOnFileException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.account; 17 | 18 | /** 19 | * Sign-up failed because the email address the Person provided is already on file. 20 | * The same email address can not be shared by different people. 21 | * @author Keith Donald 22 | */ 23 | @SuppressWarnings("serial") 24 | public class EmailAlreadyOnFileException extends AccountException { 25 | 26 | private String email; 27 | 28 | public EmailAlreadyOnFileException(String email) { 29 | super("email already on file"); 30 | this.email = email; 31 | } 32 | 33 | public String getEmail() { 34 | return email; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/templating/StringTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.templating; 17 | 18 | /** 19 | * A template that generates text document as a String from a map of model attributes. 20 | * Stateful and not designed to be shared between threads. 21 | * @author Keith Donald 22 | */ 23 | public interface StringTemplate { 24 | 25 | /** 26 | * Put an attribute in the model of this template. 27 | */ 28 | void put(String attribute, Object value); 29 | 30 | /** 31 | * Generate the final text by rendering this template. 32 | * Model attributes referenced in the template have their values resolved during rendering. 33 | */ 34 | String render(); 35 | 36 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/connect/facebookConnect.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://www.springframework.org/spring-social/facebook/tags" prefix="facebook" %> 5 | 6 | 7 |
${message.text}
8 |
9 | 10 |
" method="POST"> 11 |
12 |

Connect to Facebook

13 |

Click the button to connect your Greenhouse account with your Facebook account.

14 |
15 | 16 |

17 |
18 | 19 |
20 |
21 | 22 |
23 |
24 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/account/Gender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.account; 17 | 18 | /** 19 | * Male or Female. 20 | * Used to customize Account messages (e.g. he or she usage) and to choose the default profile picture. 21 | * @author Keith Donald 22 | */ 23 | public enum Gender { 24 | 25 | MALE ('M'), FEMALE ('F'); 26 | 27 | private char code; 28 | 29 | private Gender(char code) { 30 | this.code = code; 31 | } 32 | 33 | public char code() { 34 | return code; 35 | } 36 | 37 | public static Gender valueOf(char charAt) { 38 | if (charAt == 'M') { 39 | return Gender.MALE; 40 | } else { 41 | return Gender.FEMALE; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/connect/JdbcAccountConnectionRepositoryTest.sql: -------------------------------------------------------------------------------- 1 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Craig', 'Walls', 'cwalls@vmware.com', 'password', 'habuma', 'M', '1977-12-01'); 2 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Keith', 'Donald', 'kdonald@vmware.com', 'password', 'kdonald', 'M', '1977-12-01'); 3 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Roy', 'Clarkson', 'rclarkson@vmware.com', 'password', 'rclarkson', 'M', '1977-12-01'); 4 | insert into ServiceProvider (name, displayName, implementation, apiKey, secret, requestTokenUrl, authorizeUrl, accessTokenUrl) values ('twitter', 'Twitter', 'com.springsource.greenhouse.connect.providers.TwitterServiceProvider', '76926d574e7ff5dabb94b5df23b6add6', 'ea448a2cc81b84da29b3eeaf1e0242a1', 'http://www.twitter.com', 'http://www.twitter.com', 'http://www.twitter.com'); 5 | insert into AccountConnection (member, accountId, provider, accessToken, secret) values (1, 'habuma', 'twitter', '8d4c8b1930b25c4ea1a923fb9c213f4d', '75ad6993ccabf71f0fd3314f8e2d5ed8'); 6 | insert into AccountConnection (member, accountId, provider, accessToken, secret) values (3, 'rclarkson', 'twitter', 'df007a91474c6fb314afce38943f2ae7', '4925a46855cf18a22e5cf0e41c6aff9f'); 7 | -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/utils/EmailUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.utils; 17 | 18 | import static org.junit.Assert.*; 19 | 20 | import org.junit.Test; 21 | 22 | public class EmailUtilsTest { 23 | @Test 24 | public void shouldRecognizeAnEmail() { 25 | assertTrue(EmailUtils.isEmail("test@test.com")); 26 | } 27 | 28 | @Test 29 | public void shouldRecognizeANonEmail() { 30 | assertFalse(EmailUtils.isEmail("chuck")); 31 | assertFalse(EmailUtils.isEmail("@")); 32 | assertFalse(EmailUtils.isEmail("a@b.c")); 33 | assertFalse(EmailUtils.isEmail("a@b.chuck")); 34 | assertFalse(EmailUtils.isEmail("a@b.cd1")); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/database/install/ConnectedApp.sql: -------------------------------------------------------------------------------- 1 | create table App (id identity, 2 | name varchar not null unique, 3 | slug varchar not null unique, 4 | description varchar not null, 5 | organization varchar, 6 | website varchar, 7 | apiKey varchar unique, 8 | secret varchar not null unique, 9 | callbackUrl varchar, 10 | primary key (id)); 11 | 12 | create table AppDeveloper (app bigint, 13 | member bigint, 14 | primary key (app, member), 15 | foreign key (app) references App(id) on delete cascade, 16 | foreign key (member) references Member(id)); 17 | 18 | create table oauth_client_token ( 19 | token_id VARCHAR(256), 20 | token LONGVARBINARY, 21 | authentication_id VARCHAR(256), 22 | user_name VARCHAR(256), 23 | client_id VARCHAR(256)); 24 | 25 | create table oauth_access_token ( 26 | token_id VARCHAR(256), 27 | token LONGVARBINARY, 28 | authentication_id VARCHAR(256), 29 | user_name VARCHAR(256), 30 | client_id VARCHAR(256), 31 | authentication LONGVARBINARY, 32 | refresh_token VARCHAR(256)); 33 | 34 | create table oauth_refresh_token ( 35 | token_id VARCHAR(256), 36 | token LONGVARBINARY, 37 | authentication LONGVARBINARY 38 | ); 39 | 40 | create table oauth_code ( 41 | code VARCHAR(256), authentication LONGVARBINARY 42 | ); 43 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/FileStorage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data; 17 | 18 | /** 19 | * Portable service abstraction for storing files. 20 | * @author Keith Donald 21 | */ 22 | public interface FileStorage { 23 | 24 | /** 25 | * Get a storage URL for the file identified with the following name. 26 | * @param fileName the relative file name 27 | * @return the full path to the file in the store 28 | */ 29 | String absoluteUrl(String fileName); 30 | 31 | /** 32 | * Put a file into storage. 33 | * @param file the file data 34 | * @return a URL that can be used to obtain the file 35 | */ 36 | // TODO exception hierarchy 37 | String storeFile(FileData file); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/templating/StringTemplateLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.templating; 17 | 18 | import org.springframework.core.io.Resource; 19 | 20 | /** 21 | * Loads String templates from resource files. 22 | * @author Keith Donald 23 | */ 24 | public interface StringTemplateLoader { 25 | 26 | /** 27 | * Load the StringTemplate from the file-based resource. 28 | * The template text is generally parsed into a structure that is subsequently cached. 29 | * StringTemplate instances returned to callers of this method are prototypes that may be safely modified and used in the current thread of execution. 30 | */ 31 | StringTemplate loadStringTemplate(Resource resource); 32 | 33 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/develop/oauth/InvalidRequestTokenException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.develop.oauth; 17 | 18 | /** 19 | * Thrown when a request token submitted by the client is invalid. 20 | * This can happen if the OAuthSession has completed or expired. 21 | * @author Keith Donald 22 | */ 23 | @SuppressWarnings("serial") 24 | public class InvalidRequestTokenException extends Exception { 25 | 26 | private String requestToken; 27 | 28 | public InvalidRequestTokenException(String requestToken) { 29 | super("invalid request token"); 30 | this.requestToken = requestToken; 31 | } 32 | 33 | public String getRequestToken() { 34 | return requestToken; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/develop/NoSuchAccountConnectionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.develop; 17 | 18 | import com.springsource.greenhouse.account.AccountException; 19 | 20 | /** 21 | * Indicates no connection exists between a member and a service provider with the submitted access token. 22 | * @author Keith Donald 23 | */ 24 | @SuppressWarnings("serial") 25 | public final class NoSuchAccountConnectionException extends AccountException { 26 | 27 | private String accessToken; 28 | 29 | public NoSuchAccountConnectionException(String accessToken) { 30 | super("invalid access token"); 31 | } 32 | 33 | public String getAccessToken() { 34 | return accessToken; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/badge/BadgeRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.activity.badge; 17 | 18 | import com.springsource.greenhouse.account.Account; 19 | 20 | import com.springsource.greenhouse.activity.action.Action; 21 | 22 | /** 23 | * Manages records of awarded badges. 24 | * @author Keith Donald 25 | */ 26 | public interface BadgeRepository { 27 | 28 | /** 29 | * Save a record of an Awarded badge in this repository. 30 | * @param badge the name of the badge 31 | * @param account the member account being awarded the badge 32 | * @param action the action that is cause for the award 33 | */ 34 | AwardedBadge createAwardedBadge(String badge, Account account, Action action); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/utils/ResourceReference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.utils; 17 | 18 | /** 19 | * A reference to another REST-ful resource. 20 | * @author Keith Donald 21 | */ 22 | public class ResourceReference { 23 | 24 | private final T id; 25 | 26 | private final String label; 27 | 28 | public ResourceReference(T id, String label) { 29 | this.id = id; 30 | this.label = label; 31 | } 32 | 33 | /** 34 | * The id of the refernced entity. 35 | * Used to generate a hyperlink to the resource. 36 | */ 37 | public T getId() { 38 | return id; 39 | } 40 | 41 | /** 42 | * A caption or label for the entity. 43 | */ 44 | public String getLabel() { 45 | return label; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/develop/InvalidAccessTokenException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.develop; 17 | 18 | import com.springsource.greenhouse.account.AccountException; 19 | 20 | /** 21 | * Thrown when the access token provided by a client application on behalf of a member is invalid. 22 | * It may have expired or the connection may have been explicitly severed. 23 | * @author Keith Donald 24 | */ 25 | @SuppressWarnings("serial") 26 | public final class InvalidAccessTokenException extends AccountException { 27 | 28 | private String accessToken; 29 | 30 | public InvalidAccessTokenException(String accessToken) { 31 | super("invalid access token"); 32 | } 33 | 34 | public String getAccessToken() { 35 | return accessToken; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/signin/SigninController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.signin; 17 | 18 | import org.springframework.stereotype.Controller; 19 | import org.springframework.web.bind.annotation.RequestMapping; 20 | import org.springframework.web.bind.annotation.RequestMethod; 21 | 22 | /** 23 | * UI Controller that renders the signin-form. 24 | * @author Keith Donald 25 | */ 26 | @Controller 27 | public class SigninController { 28 | 29 | /** 30 | * Render the signin form to the person as HTML in their web browser. 31 | * Returns void and relies in request-to-view-name translation to kick-in to resolve the view template to render. 32 | */ 33 | @RequestMapping(value="/signin", method=RequestMethod.GET) 34 | public void signin() { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/action/ActionGateway.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.activity.action; 17 | 18 | import org.springframework.integration.annotation.Gateway; 19 | 20 | /** 21 | * Spring Integration Message Gateway for sending action performed Messages. 22 | * @author Keith Donald 23 | */ 24 | public interface ActionGateway { 25 | 26 | /** 27 | * Called by the producer of an Action to send an action performed message. 28 | * Subscribers attached to the action channel can then process the action notification. 29 | * Decouples the message sender from the messaging infrastructure. 30 | * Generally called after Action details are recorded in the system of record. 31 | */ 32 | @Gateway 33 | void actionPerformed(Action action); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/invite/accept.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> 5 | 6 | 7 | 8 | 9 |

Welcome to the Greenhouse, ${invitee.firstName}!

10 |
11 | 12 | 13 | 14 |
30 | <%@ include file="../signup/signupForm.jspf" %> 31 | 32 |

33 | 34 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/develop/InvalidApiKeyException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.develop; 17 | 18 | import com.springsource.greenhouse.account.AccountException; 19 | 20 | /** 21 | * The key submitted by the client application to identify itself with the server is invalid. 22 | * Will be thrown if the app has been deleted or a developer reset the keys but forgot to update the client code. 23 | * @author Keith Donald 24 | */ 25 | @SuppressWarnings("serial") 26 | public class InvalidApiKeyException extends AccountException { 27 | 28 | private String apiKey; 29 | 30 | public InvalidApiKeyException(String apiKey) { 31 | super("invalid api key " + apiKey); 32 | this.apiKey = apiKey; 33 | } 34 | 35 | public String getApiKey() { 36 | return apiKey; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/webapp/resources/mobile/form.css: -------------------------------------------------------------------------------- 1 | form { 2 | text-align: left; 3 | } 4 | 5 | /* Elements */ 6 | form label, form legend { 7 | padding: 0; 8 | margin: 0.3em 0; 9 | } 10 | 11 | form label { 12 | font-weight: bold; 13 | } 14 | 15 | form input, form textarea, form select { 16 | display: block; 17 | margin-bottom: 1em; 18 | font-size: 1em; 19 | border: 1px solid #bbb; 20 | padding: 0.15em; 21 | margin-right: 1em; 22 | } 23 | 24 | form input[type="text"], form input[type="password"] { 25 | width: 100%; 26 | line-height: 1.5em; 27 | } 28 | 29 | form .radio input, form .checkbox input { 30 | width: auto; 31 | border: none; 32 | } 33 | 34 | form .radio label, form .radio input, form .checkbox label, form .checkbox input { 35 | display: inline; 36 | margin: 0 1.5em 0 0 37 | } 38 | 39 | form .radio input, form .checkbox input { 40 | margin: 0 0.3em 0 0 41 | } 42 | 43 | form .multiple label { 44 | float: left; 45 | width: 29%; 46 | overflow: hidden; 47 | padding-left: 1px; 48 | } 49 | 50 | form .multiple input { 51 | cursor: pointer; 52 | } 53 | 54 | /* Button */ 55 | form button { 56 | margin: 0.3em 0; 57 | border: 1px solid #ccc; 58 | background-color: #eee; 59 | font-size: 1em; 60 | cursor: pointer; 61 | padding: 0.5em 62 | } 63 | 64 | form button:hover { 65 | background-color: #E6EFC2; 66 | border: 1px solid #C6D880; 67 | color: #529214; 68 | } 69 | 70 | form button:active { 71 | background-color: #333; 72 | color: white; 73 | border: 1px solid #000; 74 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/members/ConnectedProfile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.members; 17 | 18 | /** 19 | * A reference to a profile a member has on another network, such as Facebook or Twitter. 20 | * @author Keith Donald 21 | */ 22 | public final class ConnectedProfile { 23 | 24 | private final String name; 25 | 26 | private final String url; 27 | 28 | public ConnectedProfile(String name, String url) { 29 | this.name = name; 30 | this.url = url; 31 | } 32 | 33 | /** 34 | * The display name of the service provider or network the member has connected to. 35 | */ 36 | public String getName() { 37 | return name; 38 | } 39 | 40 | /** 41 | * The URL of the member's profile on the provider's network. 42 | */ 43 | public String getUrl() { 44 | return url; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/events/EventSessionLeader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.events; 17 | 18 | /** 19 | * A person who leads or delivers a session at an event. 20 | * Can also be thought of as the speaker. 21 | * @author Keith Donald 22 | */ 23 | public class EventSessionLeader { 24 | 25 | private String name; 26 | 27 | public EventSessionLeader(String name) { 28 | this.name = name; 29 | } 30 | 31 | /** 32 | * The full name of the leader. 33 | */ 34 | public String getName() { 35 | return name; 36 | } 37 | 38 | // TODO remains for iPhone Client Compatibility 39 | public String getFirstName() { 40 | return name.split(" ")[0]; 41 | } 42 | 43 | // TODO remains for iPhone Client Compatibility 44 | public String getLastName() { 45 | return name.split(" ")[1]; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/home/HomeController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.home; 17 | 18 | import java.security.Principal; 19 | 20 | import org.springframework.stereotype.Controller; 21 | import org.springframework.web.bind.annotation.RequestMapping; 22 | import org.springframework.web.bind.annotation.RequestMethod; 23 | 24 | /** 25 | * Controller for the homepage of the application. 26 | * @author Keith Donald 27 | */ 28 | @Controller 29 | public class HomeController { 30 | 31 | /** 32 | * Renders the home page as HTML in thw web browser. 33 | * The home page is different based on whether the user is signed in or not. 34 | */ 35 | @RequestMapping(value="/", method=RequestMethod.GET) 36 | public String home(Principal user) { 37 | return user != null ? "homeSignedIn" : "homeNotSignedIn"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/members/ProfilePictureService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.members; 17 | 18 | import java.io.IOException; 19 | 20 | /** 21 | * A service for storing profile pictures. 22 | * @author Keith Donald 23 | * @author Craig Walls 24 | */ 25 | public interface ProfilePictureService { 26 | 27 | /** 28 | * Save the imageBytes as the profile picture for the member account. 29 | * The bytes are generally converted to JPG format for space, then scaled to produce multiple picture dimensions, such as a small, normal, and large. 30 | * @param accountId the member account id 31 | * @param imageBytes the image bytes 32 | * @throws IOException failed to store the image due to an output failure 33 | */ 34 | void saveProfilePicture(Long accountId, byte[] imageBytes) throws IOException; 35 | 36 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/invite/mail/MailInviteService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.invite.mail; 17 | 18 | import java.util.List; 19 | 20 | import com.springsource.greenhouse.account.Account; 21 | import com.springsource.greenhouse.invite.Invitee; 22 | 23 | /** 24 | * A service for sending invites out by email. 25 | * @author Keith Donald 26 | */ 27 | public interface MailInviteService { 28 | 29 | /** 30 | * Send an invite from the member to the list of invitees. 31 | * @param from the member account 32 | * @param to the list of invitees 33 | * @param invitationBody the member's personalized invitation body, which may be a template that contains $invitee$ variable references referring to Invitee properties. 34 | */ 35 | void sendInvite(Account from, List to, String invitationBody); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/templating/DelegatingStringTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.templating; 17 | 18 | /** 19 | * Package-private helper that delegates to org.antlr.stringtemplate as the actual StringTemplate implementation. 20 | * Encapsulates the dependency on Terrence Parr's StringTemplate implementation. 21 | * @author Keith Donald 22 | */ 23 | class DelegatingStringTemplate implements StringTemplate { 24 | 25 | private org.antlr.stringtemplate.StringTemplate delegate; 26 | 27 | public DelegatingStringTemplate(org.antlr.stringtemplate.StringTemplate delegate) { 28 | this.delegate = delegate; 29 | } 30 | 31 | public void put(String name, Object value) { 32 | delegate.removeAttribute(name); 33 | delegate.setAttribute(name, value); 34 | } 35 | 36 | public String render() { 37 | return delegate.toString(); 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/main/java/org/springframework/templating/LocalStringTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.templating; 17 | 18 | /** 19 | * A StringTemplate implementation constructed from template text. 20 | * The text is parsed and the template is readied for rendering. 21 | * Instances of this object are stateful and should not be shared between threads. 22 | * @author Keith Donald 23 | */ 24 | public class LocalStringTemplate implements StringTemplate { 25 | 26 | private StringTemplate template; 27 | 28 | public LocalStringTemplate(String template) { 29 | this.template = new DelegatingStringTemplate(new org.antlr.stringtemplate.StringTemplate(template)); 30 | } 31 | 32 | public void put(String attribute, Object value) { 33 | template.put(attribute, value); 34 | } 35 | 36 | public String render() { 37 | return template.render(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/log4j.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 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/jdbc/versioned/DatabaseUpgrader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.jdbc.versioned; 17 | 18 | /** 19 | * Service interface for a Database migrator or upgrader. 20 | * @author Keith Donald 21 | */ 22 | public interface DatabaseUpgrader { 23 | 24 | /** 25 | * The current version of the Database. 26 | * Returns {@link DatabaseVersion#zero()} if no database has been installed. 27 | */ 28 | public DatabaseVersion getCurrentDatabaseVersion(); 29 | 30 | /** 31 | * Run this Database upgrader. 32 | * The upgrader will upgrade the database to the latest version. 33 | * It will first determine the current version of the Database, then apply the change sets needed to upgrade the Database to the latest version. 34 | * If the Database is already at the latest version, no action is taken. 35 | */ 36 | public void run(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/signup/SignedUpGateway.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.signup; 17 | 18 | import org.springframework.integration.annotation.Gateway; 19 | import com.springsource.greenhouse.account.Account; 20 | 21 | /** 22 | * Spring Integration Message Gateway for sending member signed up Messages. 23 | * @author Keith Donald 24 | */ 25 | public interface SignedUpGateway { 26 | 27 | /** 28 | * Called by the SignupController after signing up a new user to broadcast a signup notification. 29 | * Subscribers attached to the signup channel can then process the notification. 30 | * Decouples the message sender from the messaging infrastructure and message handling pipeline. 31 | * Generally called after the new member Account has been saved in the system of record. 32 | */ 33 | @Gateway 34 | void signedUp(Account account); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/account/ProfileReference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.account; 17 | 18 | import com.springsource.greenhouse.utils.VisualResourceReference; 19 | 20 | /** 21 | * A reference to a member profile. 22 | * Used to render a link to the profile. 23 | * The link may contain text and a img. 24 | * The link text is generally the member's full name. 25 | * @author Keith Donald 26 | */ 27 | public class ProfileReference extends VisualResourceReference { 28 | 29 | public ProfileReference(String id, String label, String imageUrl) { 30 | super(id, label, imageUrl); 31 | } 32 | 33 | public static ProfileReference textOnly(Long id, String username, String firstName, String lastName) { 34 | return new ProfileReference(username != null && username.length() > 0 ? username : id.toString(), firstName + " " + lastName, null); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/develop/JdbcAppRepositoryTest.sql: -------------------------------------------------------------------------------- 1 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Keith', 'Donald', 'kdonald@vmware.com', 'password', 'kdonald', 'M', '1977-12-01'); 2 | 3 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Craig', 'Walls', 'cwalls@vmware.com', 'password', 'habuma', 'M', '1977-12-01'); 4 | insert into App (name, slug, description, organization, website, apiKey, secret, callbackUrl) values ('Greenhouse for Facebook', 'greenhouse-for-facebook', 'Awesome', 'SpringSource', 'http://www.springsource.com', 'apikey1', 'secret1', null); 5 | insert into AppDeveloper (app, member) values (1, 2); 6 | 7 | insert into Member (firstName, lastName, email, password, username, gender, birthdate) values ('Roy' , 'Clarkson', 'roy@vmware.com', 'password', 'roy', 'M', '1977-12-01'); 8 | insert into App (name, slug, description, organization, website, apiKey, secret, callbackUrl) values ('Greenhouse for the iPhone', 'greenhouse-for-the-iphone', 'Awesome', 'SpringSource', 'http://www.springsource.com', '123456789', '987654321', 'x-com-springsource-greenhouse://oauth-response'); 9 | insert into AppDeveloper (app, member) values (2, 3); 10 | insert into App (name, slug, description, organization, website, apiKey, secret, callbackUrl) values ('Greenhouse for the Android', 'greenhouse-for-the-android', 'Awesome', 'SpringSource', 'http://www.springsource.com', 'apikey2', 'secret2', null); 11 | insert into AppDeveloper (app, member) values (3, 3); 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/reset/ResetPasswordRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.reset; 17 | 18 | import com.springsource.greenhouse.account.Account; 19 | 20 | /** 21 | * A request made by a member, or someone on behalf of the member, to reset the member's password. 22 | * @author Keith Donald 23 | */ 24 | public class ResetPasswordRequest { 25 | 26 | private String token; 27 | 28 | private Account account; 29 | 30 | public ResetPasswordRequest(String token, Account account) { 31 | this.token = token; 32 | this.account = account; 33 | } 34 | 35 | /** 36 | * The token that identifies this reset password request. 37 | */ 38 | public String getToken() { 39 | return token; 40 | } 41 | 42 | /** 43 | * The member Account for which this reset password request was made. 44 | */ 45 | public Account getAccount() { 46 | return account; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/FileData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data; 17 | 18 | /** 19 | * Data needed to put a file into {@link FileStorage}. 20 | * @author Keith Donald 21 | */ 22 | public final class FileData { 23 | 24 | private final String name; 25 | 26 | private final byte[] bytes; 27 | 28 | private final String contentType; 29 | 30 | public FileData(String name, byte[] bytes, String contentType) { 31 | this.name = name; 32 | this.bytes = bytes; 33 | this.contentType = contentType; 34 | } 35 | 36 | /** 37 | * The name of the file. 38 | */ 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | /** 44 | * The file data as a byte array. 45 | */ 46 | public byte[] getBytes() { 47 | return bytes; 48 | } 49 | 50 | /** 51 | * The file content type. 52 | */ 53 | public String getContentType() { 54 | return contentType; 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/utils/SlugUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.utils; 17 | 18 | import static org.junit.Assert.*; 19 | 20 | import org.junit.Test; 21 | 22 | public class SlugUtilsTest { 23 | 24 | @Test 25 | public void toSlug() { 26 | assertEquals("test", SlugUtils.toSlug("test")); 27 | assertEquals("test-message", SlugUtils.toSlug("test message")); 28 | assertEquals("test-message-with-more-than-five-words", 29 | SlugUtils.toSlug("test message with more than five words")); 30 | assertEquals("test-message-colon-edition", SlugUtils.toSlug("test message: colon edition")); 31 | assertEquals("test-message-number-5", SlugUtils.toSlug("test message number 5")); 32 | assertEquals("another--test-messages", SlugUtils.toSlug("another @%$#! test messages")); 33 | assertEquals("this-one-was-in-caps", SlugUtils.toSlug("This ONE wAs In CaPs")); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/settings/settings.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | 5 |

Settings

6 | 7 |

Connected Accounts

8 | 26 | 27 |
28 |

Connected Apps

29 |
    30 | 31 |
  • 32 |

    ${app.name}

    33 |
    34 |

    35 | 36 |
    37 |
  • 38 |
    39 |
40 |
41 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/integration-activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/log4j.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 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/config/IntegrationConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2011 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.config; 17 | 18 | import org.springframework.context.annotation.Configuration; 19 | import org.springframework.context.annotation.ImportResource; 20 | 21 | /** 22 | * Imports the Spring Integration pipelines defined in the Greenhouse application. 23 | * This includes: 24 | *
    25 | *
  • A "signup" pipeline for sending welcome emails to new users
  • 26 | *
  • An "activity" pipeline for sending recent activity notifications and awarding badges.
  • 27 | *
28 | * Spring Integration pipelines are components best defined in XML so there's very little here other than some imports. 29 | * @author Keith Donald 30 | */ 31 | @Configuration 32 | @ImportResource({ 33 | "classpath:com/springsource/greenhouse/activity/integration-activity.xml", 34 | "classpath:com/springsource/greenhouse/signup/integration-signup.xml" } 35 | ) 36 | public class IntegrationConfig { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/events/Rating.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.events; 17 | 18 | /** 19 | * A value object representing a session rating entered by an attendee. 20 | * @author Keith Donald 21 | */ 22 | public final class Rating { 23 | 24 | private final Short value; 25 | 26 | private final String comment; 27 | 28 | public Rating(Short value, String comment) { 29 | if (value <= 0 || value > 5) { 30 | throw new IllegalArgumentException("Rating value must be between 1 and 5"); 31 | } 32 | this.value = value; 33 | this.comment = comment; 34 | } 35 | 36 | /** 37 | * The rating value between 1 and 5. 38 | * 1 = Poor 39 | * 2 = Needs Development 40 | * 3 = Average 41 | * 4 = Good 42 | * 5 = Excellent 43 | */ 44 | public Short getValue() { 45 | return value; 46 | } 47 | 48 | /** 49 | * A comment explaining the rating for the benefit of the session leaders. 50 | */ 51 | public String getComment() { 52 | return comment; 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/invite/facebook/invite.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://www.springframework.org/spring-social/facebook/tags" prefix="facebook" %> 5 | <%@ taglib tagdir="/WEB-INF/tags/urls" prefix="u" %> 6 | 7 |

Invite Facebook Friends

8 | 9 | 10 |

Some of your friends are already in the Greenhouse

11 | 16 |
Invite more...
17 |
18 | 19 | 20 |

None of your friends have Greenhouse accounts connected to Facebook

21 |
Invite some...
22 |
23 | 24 | 25 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/events/load/VenueData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.events.load; 17 | 18 | class VenueData { 19 | 20 | private final String name; 21 | private final String postalAddress; 22 | private final double latitude; 23 | private final double longitude; 24 | private final String locationHint; 25 | 26 | public VenueData(String name, String postalAddress, double latitude, double longitude, String locationHint) { 27 | this.longitude = longitude; 28 | this.latitude = latitude; 29 | this.postalAddress = postalAddress; 30 | this.name = name; 31 | this.locationHint = locationHint; 32 | } 33 | 34 | public String getName() { 35 | return name; 36 | } 37 | 38 | public String getPostalAddress() { 39 | return postalAddress; 40 | } 41 | 42 | public double getLatitude() { 43 | return latitude; 44 | } 45 | 46 | public double getLongitude() { 47 | return longitude; 48 | } 49 | 50 | public String getLocationHint() { 51 | return locationHint; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/events/load/EventLoadController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.events.load; 17 | 18 | import javax.inject.Inject; 19 | 20 | import org.springframework.stereotype.Controller; 21 | import org.springframework.web.bind.annotation.RequestMapping; 22 | import org.springframework.web.bind.annotation.RequestMethod; 23 | import org.springframework.web.bind.annotation.RequestParam; 24 | 25 | @Controller 26 | @RequestMapping("/admin") 27 | public class EventLoadController { 28 | 29 | private NFJSLoader loader; 30 | 31 | @Inject 32 | public EventLoadController(NFJSLoader loader) { 33 | this.loader = loader; 34 | } 35 | 36 | @RequestMapping(value="/load", method=RequestMethod.GET) 37 | public String showEventLoadForm() { 38 | return "admin/load"; 39 | } 40 | 41 | @RequestMapping(value="/load", method=RequestMethod.POST) 42 | public String updateEvent(@RequestParam("showId") int showId) { 43 | loader.loadEventData(showId); 44 | return "redirect:/admin/load"; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/utils/MessageType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.utils; 17 | 18 | /** 19 | * Enumeration of Message types. 20 | * @author Keith Donald 21 | */ 22 | public enum MessageType { 23 | 24 | /** 25 | * The message is informative in nature, like a note or notice. 26 | */ 27 | INFO, 28 | 29 | /** 30 | * The message indicates that an action initiated by the user was performed successfully. 31 | */ 32 | SUCCESS, 33 | 34 | /** 35 | * The message warns the user something is not quite right. 36 | * Corrective action is generally recommended but not required. 37 | */ 38 | WARNING, 39 | 40 | /** 41 | * The message reports an error condition that needs to be addressed by the user. 42 | */ 43 | ERROR; 44 | 45 | private final String cssClass; 46 | 47 | private MessageType() { 48 | cssClass = name().toLowerCase(); 49 | } 50 | 51 | /** 52 | * The css class for styling messages of this type. 53 | */ 54 | public String getCssClass() { 55 | return cssClass; 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/org/springframework/templating/StandardStringTemplateLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.templating; 17 | 18 | import java.util.Map; 19 | import java.util.concurrent.ConcurrentHashMap; 20 | 21 | import org.springframework.core.io.Resource; 22 | 23 | /** 24 | * StringTemplateLoader that caches parsed templates in a concurrent map. 25 | * @author Keith Donald 26 | */ 27 | public class StandardStringTemplateLoader implements StringTemplateLoader { 28 | 29 | private Map templateFactories; 30 | 31 | public StandardStringTemplateLoader() { 32 | templateFactories = new ConcurrentHashMap(); 33 | } 34 | 35 | public StringTemplate loadStringTemplate(Resource resource) { 36 | ResourceStringTemplateFactory factory = templateFactories.get(resource); 37 | if (factory == null) { 38 | factory = new ResourceStringTemplateFactory(resource); 39 | templateFactories.put(resource, factory); 40 | } 41 | return factory.getStringTemplate(); 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /src/main/java/org/springframework/model/FieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.model; 17 | 18 | /** 19 | * A model for a form field. 20 | * TODO experimental. 21 | * @author Keith Donald 22 | */ 23 | public class FieldModel { 24 | 25 | private String errorMessage; 26 | 27 | private T value; 28 | 29 | public FieldModel() { 30 | } 31 | 32 | public FieldModel(String errorMessage, T value) { 33 | this.errorMessage = errorMessage; 34 | this.value = value; 35 | } 36 | 37 | /** 38 | * True if the field value is invalid. 39 | */ 40 | public boolean isError() { 41 | return errorMessage != null; 42 | } 43 | 44 | /** 45 | * Get the reason the field is in an invalid state. 46 | */ 47 | public String getErrorMessage() { 48 | return errorMessage; 49 | } 50 | 51 | /** 52 | * Get the actual field value. 53 | */ 54 | public T getValue() { 55 | return value; 56 | } 57 | 58 | public static FieldModel error(String errorMessage, T value) { 59 | return new FieldModel(errorMessage, value); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/badge/SimpleBadgeAwarder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.activity.badge; 17 | 18 | import com.springsource.greenhouse.activity.action.Action; 19 | 20 | /** 21 | * Simple Badge Award rule that always awards a badge when invoked. 22 | * @author Keith Donald 23 | */ 24 | public final class SimpleBadgeAwarder implements BadgeAwarder { 25 | 26 | private final String badgeName; 27 | 28 | private final BadgeRepository badgeRepository; 29 | 30 | /** 31 | * Creates a SimpleBadgeAwarder. 32 | * @param badgeName the name of the badge to award 33 | * @param badgeRepository the badge repository used to save the record of the awarded badge 34 | */ 35 | public SimpleBadgeAwarder(String badgeName, BadgeRepository badgeRepository) { 36 | this.badgeName = badgeName; 37 | this.badgeRepository = badgeRepository; 38 | } 39 | 40 | public AwardedBadge awardBadgeForAction(Action action) { 41 | return badgeRepository.createAwardedBadge(badgeName, action.getAccount(), action); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/members/ProfileRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.members; 17 | 18 | import java.util.List; 19 | 20 | /** 21 | * Data access interface for public member profiles. 22 | * @author Keith Donald 23 | */ 24 | public interface ProfileRepository { 25 | 26 | /** 27 | * Find a profile by it is id. 28 | * The id may be the member's public username or their internal account id if no username is set. 29 | */ 30 | Profile findById(String profileId); 31 | 32 | /** 33 | * Find a profile by the member's internal account identifier. 34 | */ 35 | Profile findByAccountId(Long accountId); 36 | 37 | /** 38 | * Get references to the member's profiles at service providers the member has connected their local account with. 39 | * For example, the member may have connected their local account with their Facebook account. 40 | * In that case, a ConnectedProfile instance pointing to their Facebook profile will be returned by this method. 41 | */ 42 | List findConnectedProfiles(Long accountId); 43 | 44 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/action/SimpleAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.activity.action; 17 | 18 | import org.joda.time.DateTime; 19 | import com.springsource.greenhouse.account.Account; 20 | import com.springsource.greenhouse.utils.Location; 21 | 22 | /** 23 | * A SimpleAction definition. 24 | * Has a single String 'type' field that captures the type of action that was performed e.g signedUp. 25 | * @author Keith Donald 26 | */ 27 | public final class SimpleAction extends Action { 28 | 29 | private final String type; 30 | 31 | public SimpleAction(String type, Long id, DateTime time, Account account, Location location) { 32 | super(id, time, account, location); 33 | this.type = type; 34 | } 35 | 36 | /** 37 | * The type of action that was performed. 38 | */ 39 | public String getType() { 40 | return type; 41 | } 42 | 43 | public String toString() { 44 | // TODO do not hardcode 45 | String actionText = "SignedUp".equals(getType()) ? "signed up" : getType(); 46 | return getAccount().getFullName() + " " + actionText; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/groups/Group.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.groups; 17 | 18 | /** 19 | * A shared space where members can participate in communal activities like group chat, e-mail lists, document sharing and group photo-tagging. 20 | */ 21 | public class Group { 22 | 23 | private String name; 24 | 25 | private String description; 26 | 27 | private String hashtag; 28 | 29 | /** 30 | * The name of the group. 31 | */ 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | 40 | /** 41 | * A description of the group. 42 | */ 43 | public String getDescription() { 44 | return description; 45 | } 46 | 47 | public void setDescription(String description) { 48 | this.description = description; 49 | } 50 | 51 | /** 52 | * The Twitter hashtag used to identify conversations held by group members. 53 | */ 54 | public String getHashtag() { 55 | return hashtag; 56 | } 57 | 58 | public void setHashtag(String hashtag) { 59 | this.hashtag = hashtag; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/events/load/LeaderData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.events.load; 17 | 18 | public class LeaderData { 19 | 20 | private final String name; 21 | private final String bio; 22 | private final String personalUrl; 23 | private final String twitterId; 24 | private final String source; 25 | private final long sourceId; 26 | 27 | public LeaderData(String name, String bio, String personalUrl, String twitterId, String source, long sourceId) { 28 | this.name = name; 29 | this.bio = bio; 30 | this.personalUrl = personalUrl; 31 | this.twitterId = twitterId; 32 | this.source = source; 33 | this.sourceId = sourceId; 34 | } 35 | 36 | public String getName() { 37 | return name; 38 | } 39 | 40 | public String getBio() { 41 | return bio; 42 | } 43 | 44 | public String getPersonalUrl() { 45 | return personalUrl; 46 | } 47 | 48 | public String getTwitterId() { 49 | return twitterId; 50 | } 51 | 52 | public String getSource() { 53 | return source; 54 | } 55 | 56 | public long getSourceId() { 57 | return sourceId; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/reset/ChangePasswordForm.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.reset; 17 | 18 | import javax.validation.constraints.Size; 19 | 20 | import com.springsource.greenhouse.validation.Confirm; 21 | 22 | /** 23 | * Model for a change password or reset password form. 24 | * @author Keith Donald 25 | */ 26 | @Confirm(field="password") 27 | public class ChangePasswordForm { 28 | 29 | @Size(min=6, message="must be at least 6 characters") 30 | private String password; 31 | 32 | private String confirmPassword; 33 | 34 | /** 35 | * The desired new password. 36 | */ 37 | public String getPassword() { 38 | return password; 39 | } 40 | 41 | public void setPassword(String password) { 42 | this.password = password; 43 | } 44 | 45 | /** 46 | * A confirmation of the desired password. 47 | * Must match {@link ChangePasswordForm#getPassword()}. 48 | */ 49 | public String getConfirmPassword() { 50 | return confirmPassword; 51 | } 52 | 53 | public void setConfirmPassword(String confirmPassword) { 54 | this.confirmPassword = confirmPassword; 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /src/main/java/org/springframework/social/mobile/device/DeviceHandlerMethodArgumentResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.mobile.device; 17 | 18 | import org.springframework.core.MethodParameter; 19 | import org.springframework.mobile.device.Device; 20 | import org.springframework.mobile.device.DeviceUtils; 21 | import org.springframework.web.bind.support.WebDataBinderFactory; 22 | import org.springframework.web.context.request.NativeWebRequest; 23 | import org.springframework.web.method.support.HandlerMethodArgumentResolver; 24 | import org.springframework.web.method.support.ModelAndViewContainer; 25 | 26 | public class DeviceHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { 27 | 28 | public boolean supportsParameter(MethodParameter parameter) { 29 | return Device.class.isAssignableFrom(parameter.getParameterType()); 30 | } 31 | 32 | public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer modelAndViewContainer, NativeWebRequest request, 33 | WebDataBinderFactory binderFactory) throws Exception { 34 | return DeviceUtils.getCurrentDevice(request); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/utils/SlugUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.utils; 17 | 18 | import java.text.Normalizer; 19 | import java.text.Normalizer.Form; 20 | import java.util.Locale; 21 | import java.util.regex.Pattern; 22 | 23 | /** 24 | * Utilities for generating slugs: a short, meaningful name for a resource that can be used in the resource's friendly URL path. 25 | * @author Keith Donald 26 | */ 27 | public class SlugUtils { 28 | 29 | private static final Pattern NONLATIN = Pattern.compile("[^\\w-]"); 30 | 31 | private static final Pattern WHITESPACE = Pattern.compile("[\\s]"); 32 | 33 | /** 34 | * Convert the String input to a slug. 35 | */ 36 | public static String toSlug(String input) { 37 | if (input == null) { 38 | throw new IllegalArgumentException("Input cannot be null"); 39 | } 40 | String nowhitespace = WHITESPACE.matcher(input).replaceAll("-"); 41 | String normalized = Normalizer.normalize(nowhitespace, Form.NFD); 42 | String slug = NONLATIN.matcher(normalized).replaceAll(""); 43 | return slug.toLowerCase(Locale.ENGLISH); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/connect/tiles.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 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/badge/BadgeSystemFactoryBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.activity.badge; 17 | 18 | import javax.inject.Inject; 19 | 20 | import org.springframework.beans.factory.FactoryBean; 21 | 22 | /** 23 | * Factory that configures the BadgeSystem and returns it as a Bean that can be invoked by the integration-activity.xml pipeline. 24 | * Registers the various badge award rules. 25 | * @author Keith Donald 26 | */ 27 | public class BadgeSystemFactoryBean implements FactoryBean { 28 | 29 | private final BadgeRepository badgeRepository; 30 | 31 | @Inject 32 | public BadgeSystemFactoryBean(BadgeRepository badgeRepository) { 33 | this.badgeRepository = badgeRepository; 34 | } 35 | 36 | public Class getObjectType() { 37 | return BadgeSystem.class; 38 | } 39 | 40 | public boolean isSingleton() { 41 | return true; 42 | } 43 | 44 | public BadgeSystem getObject() throws Exception { 45 | StandardBadgeSystem badgeSystem = new StandardBadgeSystem(); 46 | badgeSystem.add(new SimpleBadgeAwarder("Newbie", badgeRepository), "SignedUp"); 47 | return badgeSystem; 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/members/Profile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.members; 17 | 18 | /** 19 | * The public record containing information about a Member of our community. 20 | * @author Keith Donald 21 | */ 22 | public class Profile { 23 | 24 | private Long accountId; 25 | 26 | private String displayName; 27 | 28 | private String pictureUrl; 29 | 30 | public Profile(Long accountId, String displayName, String pictureUrl) { 31 | this.accountId = accountId; 32 | this.displayName = displayName; 33 | this.pictureUrl = pictureUrl; 34 | } 35 | 36 | /** 37 | * The member's account identifier. 38 | */ 39 | public Long getAccountId() { 40 | return accountId; 41 | } 42 | 43 | /** 44 | * The member's display name. 45 | * Typically their full name but may be just their first name or a nick name. 46 | */ 47 | public String getDisplayName() { 48 | return displayName; 49 | } 50 | 51 | /** 52 | * A link to the member's picture. 53 | * Typically a larger version of their picture suitable for display on their own profile page. 54 | */ 55 | public String getPictureUrl() { 56 | return pictureUrl; 57 | } 58 | } -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/events/load/show_short_updated.json: -------------------------------------------------------------------------------- 1 | { 2 | "abreviation": "SGX", 3 | "appId": 3, 4 | "cacheDir": "chicago/2011/10", 5 | "canceled": false, 6 | "dates": "October 25 - 28, 2011", 7 | "firstDay": "2012-06-09T00:00:00", 8 | "id": 271, 9 | "lastDay": "2012-06-12T23:59:59", 10 | "latitude": 41.8920052, 11 | "location": { 12 | "address1": "1234 South Arizona Drive", 13 | "address2": null, 14 | "altMapLink": "", 15 | "city": "Pocatello", 16 | "country": "United States", 17 | "countryCode": "US", 18 | "description": "Pocatello Convention Center", 19 | "googleMapLink": "http://maps.google.com/maps?q=1234+South+Arizona+Drive,+Pocatello,+ID+83201&hl=en", 20 | "latitude": 41.8920052, 21 | "longitude": -87.6247001, 22 | "mapLink": "http://maps.google.com/maps?q=1234+South+Arizona+Drive,+Pocatello,+ID+83201&hl=en", 23 | "metro": "Pocatello", 24 | "metroArea": "Pocatello, ID", 25 | "metroNoSpace": "Pocatello", 26 | "otherState": null, 27 | "state": "Idaho", 28 | "stateCode": "ID", 29 | "stateCodeDisplay": "ID", 30 | "timeZoneName": "America/Boise", 31 | "utcOffset": -7, 32 | "zip": "83201" 33 | }, 34 | "longitude": -87.6247001, 35 | "mediumDates": "Oct 25 - 28, 2011", 36 | "modified": "2011-10-27T14:33:09", 37 | "name": "SpringOne/2GX", 38 | "publishAgenda": true, 39 | "publishRegistration": true, 40 | "publishSessions": true, 41 | "publishSlides": false, 42 | "publishVideo": false, 43 | "roomsAssigned": false, 44 | "shortDates": "Oct 25 - 28", 45 | "urlBase": "/conference/chicago/2011/10", 46 | "year": 2011 47 | } 48 | -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/events/load/show_short.json: -------------------------------------------------------------------------------- 1 | { 2 | "abreviation": "S2GX", 3 | "appId": 3, 4 | "cacheDir": "chicago/2011/10", 5 | "canceled": false, 6 | "dates": "October 25 - 28, 2011", 7 | "firstDay": "2011-10-25T00:00:00", 8 | "id": 271, 9 | "lastDay": "2011-10-28T23:59:59", 10 | "latitude": 41.8920052, 11 | "location": { 12 | "address1": "540 North Michigan Avenue", 13 | "address2": null, 14 | "altMapLink": "", 15 | "city": "Chicago", 16 | "country": "United States", 17 | "countryCode": "US", 18 | "description": "Chicago Marriott Downtown Magnificent Mile", 19 | "googleMapLink": "http://maps.google.com/maps?q=540+North+Michigan+Avenue,+Chicago,+IL+60611&hl=en", 20 | "latitude": 41.8920052, 21 | "longitude": -87.6247001, 22 | "mapLink": "http://maps.google.com/maps?q=540+North+Michigan+Avenue,+Chicago,+IL+60611&hl=en", 23 | "metro": "Chicago", 24 | "metroArea": "Chicago, IL", 25 | "metroNoSpace": "Chicago", 26 | "otherState": null, 27 | "state": "Illinois", 28 | "stateCode": "IL", 29 | "stateCodeDisplay": "IL", 30 | "timeZoneName": "America/Chicago", 31 | "utcOffset": -6, 32 | "zip": "60611" 33 | }, 34 | "longitude": -87.6247001, 35 | "mediumDates": "Oct 25 - 28, 2011", 36 | "modified": "2011-10-27T14:33:09", 37 | "name": "SpringOne 2GX", 38 | "publishAgenda": true, 39 | "publishRegistration": true, 40 | "publishSessions": true, 41 | "publishSlides": false, 42 | "publishVideo": false, 43 | "roomsAssigned": false, 44 | "shortDates": "Oct 25 - 28", 45 | "urlBase": "/conference/chicago/2011/10", 46 | "year": 2011 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/activity/action/ActionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.activity.action; 17 | 18 | import org.joda.time.DateTime; 19 | 20 | import com.springsource.greenhouse.account.Account; 21 | import com.springsource.greenhouse.utils.Location; 22 | 23 | /** 24 | * Callback interface for constructing an Action instance. 25 | * @author Keith Donald 26 | * @param the Action type 27 | */ 28 | public interface ActionFactory { 29 | 30 | /** 31 | * Create an Action instance of type A. 32 | * This callback allows the caller to specify the Action implementation and populate its specific fields. 33 | * It also allows the additional properties of this Action specialization to be persisted with the system record, if required. 34 | * @param id the assigned internal action id 35 | * @param time the time the action was performed, just now 36 | * @param account the member who performed the action 37 | * @param location the resolved member location where the action was performed 38 | * @return the Action instance 39 | */ 40 | A createAction(Long id, DateTime time, Account account, Location location); 41 | } -------------------------------------------------------------------------------- /src/main/java/org/springframework/jdbc/versioned/AbstractDatabaseChange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.jdbc.versioned; 17 | 18 | import java.sql.Connection; 19 | import java.sql.SQLException; 20 | import java.sql.Statement; 21 | 22 | public abstract class AbstractDatabaseChange implements DatabaseChange { 23 | 24 | /** 25 | * Apply this change. 26 | */ 27 | public void apply(Connection connection) { 28 | Statement statement = getStatement(connection); 29 | try { 30 | doExecuteStatement(statement); 31 | } catch (SQLException e) { 32 | throw new RuntimeException("Failed to apply", e); 33 | } finally { 34 | try { 35 | statement.close(); 36 | } catch (SQLException e) { 37 | } 38 | } 39 | } 40 | 41 | private Statement getStatement(Connection connection) { 42 | try { 43 | return doCreateStatement(connection); 44 | } catch (SQLException e) { 45 | throw new IllegalStateException("Could not create statement", e); 46 | } 47 | } 48 | 49 | protected abstract Statement doCreateStatement(Connection connection) throws SQLException; 50 | 51 | protected abstract void doExecuteStatement(Statement statement) throws SQLException; 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/events/RatingPeriodClosedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.events; 17 | 18 | import org.springframework.http.HttpStatus; 19 | import org.springframework.web.bind.annotation.ResponseStatus; 20 | 21 | /** 22 | * Thrown when an attendee attempts to rate a session and the rating period is closed. 23 | * The rating period opens 10 minutes before the session ends and closes when the event ends. 24 | * @author Keith Donald 25 | */ 26 | @SuppressWarnings("serial") 27 | @ResponseStatus(HttpStatus.PRECONDITION_FAILED) 28 | public final class RatingPeriodClosedException extends Exception { 29 | 30 | private final Long eventId; 31 | 32 | private final Integer sessionId; 33 | 34 | public RatingPeriodClosedException(Long eventId, Integer sessionId) { 35 | super("Session has not yet ended"); 36 | this.eventId = eventId; 37 | this.sessionId = sessionId; 38 | } 39 | 40 | /** 41 | * The internal id of the event. 42 | */ 43 | public Long getEventId() { 44 | return eventId; 45 | } 46 | 47 | /** 48 | * The internal id of the session. 49 | */ 50 | public Integer getSessionId() { 51 | return sessionId; 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/account/PictureUrlMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.account; 17 | 18 | import java.sql.ResultSet; 19 | import java.sql.SQLException; 20 | 21 | import org.springframework.jdbc.core.RowMapper; 22 | 23 | /** 24 | * A RowMapper that maps a group of Account fields to a absolute profile picture URL String using a {@link PictureUrlFactory} and {@link PictureSize}. 25 | * @author Keith Donald 26 | */ 27 | public final class PictureUrlMapper implements RowMapper { 28 | 29 | private final PictureUrlFactory urlFactory; 30 | 31 | private final PictureSize pictureSize; 32 | 33 | public PictureUrlMapper(PictureUrlFactory urlFactory, PictureSize pictureSize) { 34 | this.urlFactory = urlFactory; 35 | this.pictureSize = pictureSize; 36 | } 37 | 38 | public String mapRow(ResultSet rs, int row) throws SQLException { 39 | Gender gender = Gender.valueOf(rs.getString("gender").charAt(0)); 40 | return urlFactory.pictureUrl(rs.getLong("id"), pictureSize, rs.getBoolean("pictureSet"), gender); 41 | } 42 | 43 | public String defaultPictureUrl(Gender gender) { 44 | return urlFactory.defaultPictureUrl(gender, pictureSize); 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/invite/mail/invite.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 4 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> 5 | 6 | 7 |
${message.text}
8 |
9 | 10 | 11 | 12 |
13 |

Email Invites

14 | 15 | 16 | 17 |
18 | Unable to send invite. 19 | 20 | 21 | Please ensure your invitees have been entered using the correct format and resubmit. 22 | 23 | 24 | 25 | 26 | All fields are required. 27 | 28 |
29 |
30 |
31 |

Send a personal Greenhouse invitation to your friends and colleagues.

32 |
33 |
34 | Tell us who you'd like to send an invite to 35 | Invitees, separated by commas in format firstName lastName <email> 36 | 37 |
38 |
39 | Personalize your invitation 40 | Invitation Text 41 | 42 |
43 |

44 |
-------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/invite/mail/MailInviteForm.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.invite.mail; 17 | 18 | import java.util.List; 19 | 20 | import org.hibernate.validator.constraints.NotEmpty; 21 | 22 | import com.springsource.greenhouse.invite.Invitee; 23 | 24 | /** 25 | * Model backing the email invite form. 26 | * @author Keith Donald 27 | */ 28 | public class MailInviteForm { 29 | 30 | @NotEmpty 31 | private List invitees; 32 | 33 | @NotEmpty 34 | private String invitationText; 35 | 36 | /** 37 | * The list of inviteees to send the invite to. 38 | * Submitted as a comma-delimited string value and converted to a List by the conversion system. 39 | */ 40 | public List getInvitees() { 41 | return invitees; 42 | } 43 | 44 | public void setInvitees(List invitees) { 45 | this.invitees = invitees; 46 | } 47 | 48 | /** 49 | * The body text of the invitation. 50 | * May be personalized by the member sending out the invite. 51 | */ 52 | public String getInvitationText() { 53 | return invitationText; 54 | } 55 | 56 | public void setInvitationText(String invitationText) { 57 | this.invitationText = invitationText; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/signin/signin.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://www.springframework.org/tags" prefix="s" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://www.springframework.org/spring-social/facebook/tags" prefix="facebook" %> 5 | 6 | 7 |
${message.text}
8 |
9 | 10 |
" method="post"> 11 | 20 |
21 | 22 | value="${SPRING_SECURITY_LAST_USERNAME}" /> 23 | 24 | 25 |
26 |

27 |

">Forgot your password?

28 |
29 | 30 | 31 |
" method="post"> 32 | 33 |
34 |
" method="post"> 35 | 36 |
37 |
" method="post"> 38 | 39 |
40 |
-------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/develop/AppSummary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.develop; 17 | 18 | /** 19 | * A short summary for the application, suitable for display as a listing. 20 | * @author Keith Donald 21 | */ 22 | public class AppSummary { 23 | 24 | private final String name; 25 | 26 | private final String iconUrl; 27 | 28 | private final String description; 29 | 30 | private final String slug; 31 | 32 | public AppSummary(String name, String iconUrl, String description, String slug) { 33 | this.name = name; 34 | this.iconUrl = iconUrl; 35 | this.description = description; 36 | this.slug = slug; 37 | } 38 | 39 | /** 40 | * The name of the app. 41 | */ 42 | public String getName() { 43 | return name; 44 | } 45 | 46 | /** 47 | * A link to the application's icon, suitable for display as a thumbnail. 48 | */ 49 | public String getIconUrl() { 50 | return iconUrl; 51 | } 52 | 53 | /** 54 | * Short description of the app. 55 | */ 56 | public String getDescription() { 57 | return description; 58 | } 59 | 60 | /** 61 | * Short, unique, and meaningful key for the application. 62 | * Used in browser URLs that reference the app resource. 63 | */ 64 | public String getSlug() { 65 | return slug; 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/reset/AsyncResetPasswordMailer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.reset; 17 | 18 | import javax.inject.Inject; 19 | 20 | import org.springframework.core.convert.converter.Converter; 21 | import org.springframework.mail.MailSender; 22 | import org.springframework.mail.SimpleMailMessage; 23 | import org.springframework.scheduling.annotation.Async; 24 | import org.springframework.stereotype.Component; 25 | 26 | /** 27 | * A ResetPasswordMailer implementation that mails asynchronously in a separate thread. 28 | * Uses a Coverter to transform a RequestPasswordRequest into a mailable SimpleMailMessage. 29 | * @author Keith Donald 30 | */ 31 | @Component 32 | public final class AsyncResetPasswordMailer implements ResetPasswordMailer { 33 | 34 | private final Converter converter; 35 | 36 | private final MailSender mailSender; 37 | 38 | @Inject 39 | public AsyncResetPasswordMailer(Converter converter, MailSender mailSender) { 40 | this.converter = converter; 41 | this.mailSender = mailSender; 42 | } 43 | 44 | @Async 45 | public void send(final ResetPasswordRequest request) { 46 | SimpleMailMessage mail = converter.convert(request); 47 | mailSender.send(mail); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/layouts/mobile/page.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %> 4 | 5 | 6 | 7 | 8 | <tiles:insertAttribute name="title" defaultValue="Greenhouse" /> 9 | 10 | 11 | " type="text/css" media="screen" /> 12 | 13 | 14 | " type="text/css" media="all" /> 15 | 16 | 17 | 20 | 21 | 22 | 25 |
26 | 27 |
28 | 29 | 36 | 37 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/groups/JdbcGroupRepositoryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.groups; 17 | 18 | import static org.junit.Assert.*; 19 | 20 | import org.junit.After; 21 | import org.junit.Before; 22 | import org.junit.Test; 23 | import org.springframework.jdbc.core.JdbcTemplate; 24 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; 25 | 26 | import com.springsource.greenhouse.database.GreenhouseTestDatabaseBuilder; 27 | 28 | public class JdbcGroupRepositoryTest { 29 | 30 | private EmbeddedDatabase db; 31 | 32 | private JdbcTemplate jdbcTemplate; 33 | 34 | private GroupRepository groupRepository; 35 | 36 | @Before 37 | public void setup() { 38 | db = new GreenhouseTestDatabaseBuilder().member().group().testData(getClass()).getDatabase(); 39 | jdbcTemplate = new JdbcTemplate(db); 40 | groupRepository = new JdbcGroupRepository(jdbcTemplate); 41 | } 42 | 43 | @After 44 | public void destroy() { 45 | if (db != null) { 46 | db.shutdown(); 47 | } 48 | } 49 | 50 | @Test 51 | public void shouldFindGroupByProfileKey() { 52 | Group group = groupRepository.findGroupBySlug("test-group"); 53 | assertEquals("Test Group", group.getName()); 54 | assertEquals("This is a test group", group.getDescription()); 55 | assertEquals("#test", group.getHashtag()); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/test/java/com/springsource/greenhouse/account/WelcomeMailTransformerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.account; 17 | 18 | import static org.junit.Assert.*; 19 | 20 | import org.junit.Test; 21 | import org.springframework.mail.SimpleMailMessage; 22 | import org.springframework.web.util.UriTemplate; 23 | 24 | import com.springsource.greenhouse.signup.WelcomeMailTransformer; 25 | 26 | public class WelcomeMailTransformerTest { 27 | 28 | private static final String NEWLINE = System.getProperty("line.separator"); 29 | 30 | @Test 31 | public void welcomeMail() { 32 | WelcomeMailTransformer transformer = new WelcomeMailTransformer(); 33 | 34 | Account account = new Account(1L, "Roy", "Clarkson", "rclarkson@vmware.com", "rclarkson", "http://foo.com/bar.jpg", new UriTemplate("http://greenhouse.springsource.org/members/{id}")); 35 | SimpleMailMessage welcomeMail = (SimpleMailMessage) transformer.welcomeMail(account); 36 | 37 | assertEquals("rclarkson@vmware.com", welcomeMail.getTo()[0]); 38 | assertEquals("Greenhouse ", welcomeMail.getFrom()); 39 | assertEquals("Welcome to the Greenhouse!", welcomeMail.getSubject()); 40 | String mailText = welcomeMail.getText(); 41 | assertTrue(mailText.contains("View your member profile at:" + NEWLINE + "http://greenhouse.springsource.org/members/rclarkson")); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/springsource/greenhouse/invite/InviteAcceptAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.springsource.greenhouse.invite; 17 | 18 | import org.joda.time.DateTime; 19 | 20 | import com.springsource.greenhouse.account.Account; 21 | import com.springsource.greenhouse.activity.action.Action; 22 | import com.springsource.greenhouse.utils.Location; 23 | 24 | /** 25 | * Indicates that a invitee has accepted his or her invite by signing up as a member of our community. 26 | * @author Keith Donald 27 | */ 28 | public final class InviteAcceptAction extends Action { 29 | 30 | private final Long sentBy; 31 | 32 | private final DateTime sentTime; 33 | 34 | public InviteAcceptAction(Long id, DateTime time, Account account, Location location, Long sentBy, DateTime sentTime) { 35 | super(id, time, account, location); 36 | this.sentBy = sentBy; 37 | this.sentTime = sentTime; 38 | } 39 | 40 | /** 41 | * The id of the member account that sent the invite. 42 | */ 43 | public Long getSentBy() { 44 | return sentBy; 45 | } 46 | 47 | /** 48 | * The time the invite was originally sent. 49 | */ 50 | public DateTime getSentTime() { 51 | return sentTime; 52 | } 53 | 54 | public String toString() { 55 | // TODO Account.gender needs to be preserved for his/her text 56 | return getAccount().getFullName() + " accepted his Greenhouse invitation"; 57 | } 58 | 59 | } 60 | --------------------------------------------------------------------------------