Permalink
Browse files

initial commit to github

  • Loading branch information...
robhinds committed Jun 17, 2012
0 parents commit 2c1c3fc1f9d28b9681ba32c3af3708d08f31d964
@@ -0,0 +1,4 @@
+target/
+.settings/
+.classpath
+.project
@@ -0,0 +1,3 @@
+This is an implementation of the Spring-Social projects for GeekList.
+
+At the moment it is a very early work in progress and only currently supports the basic operation of returning User details or User Cards.
98 pom.xml
@@ -0,0 +1,98 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.springframework.social</groupId>
+ <artifactId>spring-social-geeklist</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <name>spring-social-geeklist</name>
+
+ <repositories>
+ <repository>
+ <id>com.springsource.repository.bundles.release</id>
+ <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
+ <url>http://repository.springsource.com/maven/bundles/release</url>
+ </repository>
+ <repository>
+ <id>spring-social</id>
+ <name>Spring Maven Release Repository</name>
+ <url>http://maven.springframework.org/release</url>
+ </repository>
+ <repository>
+ <id>spring-maven-snapshot</id>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <name>Springframework Maven SNAPSHOT Repository</name>
+ <url>http://maven.springframework.org/snapshot</url>
+ </repository>
+ <repository>
+ <id>spring-milestone</id>
+ <name>Spring Maven Milestone Repository</name>
+ <url>http://maven.springframework.org/milestone</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.social</groupId>
+ <artifactId>spring-social-web</artifactId>
+ <version>${spring-social.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.8.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test-mvc</artifactId>
+ <version>${spring-test-mvc.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.8.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>1.8.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.social</groupId>
+ <artifactId>spring-social-core</artifactId>
+ <version>${spring-social.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${org.springframework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${org.springframework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-crypto</artifactId>
+ <version>${spring-security-crypto.version}</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <spring.version>3.1.1.RELEASE</spring.version>
+ <spring-social.version>1.0.2.RELEASE</spring-social.version>
+ <spring-test-mvc.version>1.0.0.BUILD-SNAPSHOT</spring-test-mvc.version>
+ <org.springframework.version>3.1.0.RELEASE</org.springframework.version>
+ <spring-security-crypto.version>3.1.0.RC3</spring-security-crypto.version>
+ </properties>
+</project>
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
@@ -0,0 +1,28 @@
+package org.springframework.social.geeklist.api;
+
+import org.springframework.social.ApiBinding;
+import org.springframework.web.client.RestOperations;
+
+/**
+ * Specifies core operations available on GeekList. Currently a limited subset
+ * to just {@link GeekListUser} operations, but should be extended to handle the
+ * full API
+ *
+ * @author robert.hinds
+ *
+ */
+public interface GeekList extends ApiBinding {
+
+ /**
+ * Used to expose the GeekList API relating to Users.
+ *
+ * @return user operations
+ */
+ UserOperations userOperations();
+
+ /**
+ * Returns the underlying {@link RestOperations} to be used for any aspects
+ * of the GeekList API that are not yet supported by this binding
+ */
+ RestOperations restOperations();
+}
@@ -0,0 +1,73 @@
+/**
+ *
+ */
+package org.springframework.social.geeklist.api;
+
+import java.util.Date;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * A GeekList card
+ *
+ * @author robert.hinds
+ *
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class GeekListCard {
+
+ @JsonProperty("created_at")
+ private Date dateCreated;
+
+ @JsonProperty
+ private String headline;
+
+ @JsonProperty("is_active")
+ private boolean active;
+
+ @JsonProperty("short_code")
+ private ShortCode shortCode;
+
+ public Date getDateCreated() {
+ return dateCreated;
+ }
+
+ public void setDateCreated(Date dateCreated) {
+ this.dateCreated = dateCreated;
+ }
+
+ public String getHeadline() {
+ return headline;
+ }
+
+ public void setHeadline(String headline) {
+ this.headline = headline;
+ }
+
+ public boolean isActive() {
+ return active;
+ }
+
+ public void setActive(boolean active) {
+ this.active = active;
+ }
+
+ public String getUrl() {
+ return shortCode.getUrl();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public class ShortCode {
+ @JsonProperty("gklst_url")
+ private String url;
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String u) {
+ url = u;
+ }
+ }
+}
@@ -0,0 +1,38 @@
+/**
+ *
+ */
+package org.springframework.social.geeklist.api;
+
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * A GeekList card wrapper - as the API returns data that is nested one level
+ * down below data
+ *
+ * @author robert.hinds
+ *
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class GeekListCardWrapper {
+
+ @JsonProperty("data")
+ private InnerWrapper inner;
+
+ public List<GeekListCard> getCards() {
+ return inner.cards;
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public class InnerWrapper {
+ @JsonProperty("cards")
+ private List<GeekListCard> cards;
+
+ public void setCards(List<GeekListCard> c) {
+ cards = c;
+ }
+ }
+
+}
@@ -0,0 +1,88 @@
+/**
+ *
+ */
+package org.springframework.social.geeklist.api;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * A GeekList user
+ *
+ * @author robert.hinds
+ *
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class GeekListUser {
+
+ @JsonProperty("id")
+ private String userId;
+
+ @JsonProperty("name")
+ private String displayName;
+
+ @JsonProperty("screen_name")
+ private String userName;
+
+ @JsonProperty
+ private String location;
+
+ @JsonProperty
+ private String bio;
+
+ @JsonProperty
+ private GeekListUserStats stats;
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public String getBio() {
+ return bio;
+ }
+
+ public void setBio(String bio) {
+ this.bio = bio;
+ }
+
+ public GeekListUserStats getStats() {
+ return stats;
+ }
+
+ public void setStats(GeekListUserStats stats) {
+ this.stats = stats;
+ }
+
+ public String getUserProfileUrl() {
+ return "http://geekli.st/" + getUserName();
+ }
+
+}
Oops, something went wrong.

0 comments on commit 2c1c3fc

Please sign in to comment.