Scenario - Need to display recieved connection request count like in Facebook/LinkedIn in webcenter :-)
Implementation - There are two ways to implement -
1) We can use the ConnectionServiceFactory to get the ConnectionManager Instance and get all the information about the user's connection , his/her pending invitation , sent invitations etc.
Below i just explained few methods to get useful info about User's network.
public void connectionInfo() {
//Gets the ConnectionServicefactory
ConnectionsServiceFactory connService =
ConnectionsServiceFactory.getInstance();
ConnectionsManagerImpl connManager =
(ConnectionsManagerImpl)connService.getInstance().getConnectionsManager();
InvitationsManagerImpl inviteManager =
(InvitationsManagerImpl)connService.getInstance().getInvitationsManager();
List<Connection> ConnList;
List<Invitation> inviteListRecieved;
List<Invitation> inviteListSent;
try {
//Connection info of user "Weblogic", replace it with any userID
//Returns List of User's Connection Object , Each connection object returns all //info(user profile) about the connections
//Explore it :-)
ConnList = connManager.getConnections("weblogic");
//Returns List of User's recieved invitation object
inviteListRecieved = inviteManager.getReceivedInvitations();
//Returns List of User's sent invitation object
inviteListSent = inviteManager.getSentInvitations();
//TOTAL Recieved Connections request of the user
//This returns an int value of the recieved invitation
//Use this in the template so that the user's can get notified about their Friends request right away:-)
System.out.println("User's recieved connections request count" +
inviteListRecieved.size());
} catch (ConnectionsException e) {
System.out.println("Just caught it");
}
}
2) We can use PeopleManagementDataControl , anyhow we shall discuss it in the later :-)
Hope this helps to have a good social networking look and feel to your portal :-)
Implementation - There are two ways to implement -
1) We can use the ConnectionServiceFactory to get the ConnectionManager Instance and get all the information about the user's connection , his/her pending invitation , sent invitations etc.
Below i just explained few methods to get useful info about User's network.
public void connectionInfo() {
//Gets the ConnectionServicefactory
ConnectionsServiceFactory connService =
ConnectionsServiceFactory.getInstance();
ConnectionsManagerImpl connManager =
(ConnectionsManagerImpl)connService.getInstance().getConnectionsManager();
InvitationsManagerImpl inviteManager =
(InvitationsManagerImpl)connService.getInstance().getInvitationsManager();
List<Connection> ConnList;
List<Invitation> inviteListRecieved;
List<Invitation> inviteListSent;
try {
//Connection info of user "Weblogic", replace it with any userID
//Returns List of User's Connection Object , Each connection object returns all //info(user profile) about the connections
//Explore it :-)
ConnList = connManager.getConnections("weblogic");
//Returns List of User's recieved invitation object
inviteListRecieved = inviteManager.getReceivedInvitations();
//Returns List of User's sent invitation object
inviteListSent = inviteManager.getSentInvitations();
//TOTAL Recieved Connections request of the user
//This returns an int value of the recieved invitation
//Use this in the template so that the user's can get notified about their Friends request right away:-)
System.out.println("User's recieved connections request count" +
inviteListRecieved.size());
} catch (ConnectionsException e) {
System.out.println("Just caught it");
}
}
2) We can use PeopleManagementDataControl , anyhow we shall discuss it in the later :-)
Hope this helps to have a good social networking look and feel to your portal :-)