Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed some problems in GroupOperations involving creating and getting posts. #15

Merged
merged 2 commits into from

1 participant

@habuma
Owner

No description provided.

Craig Walls added some commits
Craig Walls Polish 78fbfd5
Craig Walls Fixed a problem with GroupOperations.getPosts() due to some missing P…
…ostAvailableAction entries. Also exposed the URI of a newly created Post as the returned value of createPost()
f3ede0e
@habuma habuma merged commit e3a93d6 into spring-projects:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 16, 2012
  1. Polish

    Craig Walls authored
  2. Fixed a problem with GroupOperations.getPosts() due to some missing P…

    Craig Walls authored
    …ostAvailableAction entries. Also exposed the URI of a newly created Post as the returned value of createPost()
This page is out of date. Refresh to see the latest.
View
25 spring-social-linkedin/src/main/java/org/springframework/social/linkedin/api/GroupOperations.java
@@ -15,6 +15,8 @@
*/
package org.springframework.social.linkedin.api;
+import java.net.URI;
+
import org.springframework.social.linkedin.api.Group.GroupPosts;
/**
@@ -117,56 +119,57 @@
* @param groupId Group to Create Post on
* @param title Title of Post
* @param summary Text of Post
+ * @return the URI of the newly created Post
*/
- public void createPost(Integer groupId, String title, String summary);
+ URI createPost(Integer groupId, String title, String summary);
/**
* Like a Post
*
* @param postId Id of Post
*/
- public void likePost(String postId);
+ void likePost(String postId);
/**
* Unlike a Post
* @param postId Id of Post
*/
- public void unlikePost(String postId);
+ void unlikePost(String postId);
/**
* Follow a Post
*
* @param postId Id of Post
*/
- public void followPost(String postId);
+ void followPost(String postId);
/**
* Like a Post
*
* @param postId Id of Post
*/
- public void unfollowPost(String postId);
+ void unfollowPost(String postId);
/**
* Flag a Post as a Job
*
* @param postId Id of Post
*/
- public void flagPostAsJob(String postId);
+ void flagPostAsJob(String postId);
/**
* Flag a Post as a Promotion
*
* @param postId Id of Post
*/
- public void flagPostAsPromotion(String postId);
+ void flagPostAsPromotion(String postId);
/**
* Delete a Post (if group administrator) or flag as inappropriate
*
* @param postId Id of Post
*/
- public void deleteOrFlagPostAsInappropriate(String postId);
+ void deleteOrFlagPostAsInappropriate(String postId);
/**
* Add a Comment to a Post
@@ -174,20 +177,20 @@
* @param postId Id of Post
* @param text Text of Comment
*/
- public void addCommentToPost(String postId, String text);
+ void addCommentToPost(String postId, String text);
/**
* Delete a Comment (if group administrator) or flag as inappropriate
*
* @param commentId Id of Comment
*/
- public void deleteOrFlagCommentAsInappropriate(String commentId);
+ void deleteOrFlagCommentAsInappropriate(String commentId);
/**
* Delete Group Suggestion
*
* @param groupId Id of Group
*/
- public void deleteGroupSuggestion(Integer groupId);
+ void deleteGroupSuggestion(Integer groupId);
}
View
4 spring-social-linkedin/src/main/java/org/springframework/social/linkedin/api/Post.java
@@ -174,9 +174,11 @@ public String getTitle() {
FLAG_AS_INAPPROPRIATE,
CATEGORIZE_AS_JOB,
CATEGORIZE_AS_PROMOTION,
+ DELETE,
FOLLOW,
LIKE,
- REPLY_PRIVATELY
+ REPLY_PRIVATELY,
+ UNFOLLOW
}
}
View
5 spring-social-linkedin/src/main/java/org/springframework/social/linkedin/api/impl/GroupTemplate.java
@@ -15,6 +15,7 @@
*/
package org.springframework.social.linkedin.api.impl;
+import java.net.URI;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -86,11 +87,11 @@ public void leaveGroup(Integer groupId) {
restOperations.delete(GROUP_JOIN_LEAVE_URL, groupId);
}
- public void createPost(Integer groupId, String title, String summary) {
+ public URI createPost(Integer groupId, String title, String summary) {
Map<String, String> post = new HashMap<String,String>();
post.put("title", title);
post.put("summary", summary);
- restOperations.postForObject(GROUP_CREATE_POST_URL, post, String.class, groupId);
+ return restOperations.postForLocation(GROUP_CREATE_POST_URL, post, groupId);
}
public void likePost(String postId) {
Something went wrong with that request. Please try again.