Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #15 from habuma/master
Browse files Browse the repository at this point in the history
Fixed some problems in GroupOperations involving creating and getting posts.
  • Loading branch information
habuma committed Apr 16, 2012
2 parents 5a2109c + f3ede0e commit e3a93d6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.springframework.social.linkedin.api;

import java.net.URI;

import org.springframework.social.linkedin.api.Group.GroupPosts;

/**
Expand Down Expand Up @@ -117,77 +119,78 @@ public interface GroupOperations {
* @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
*
* @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);

}
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ public static enum PostAvailableAction {
FLAG_AS_INAPPROPRIATE,
CATEGORIZE_AS_JOB,
CATEGORIZE_AS_PROMOTION,
DELETE,
FOLLOW,
LIKE,
REPLY_PRIVATELY
REPLY_PRIVATELY,
UNFOLLOW
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e3a93d6

Please sign in to comment.