org.sakaiproject.profile2.logic
Interface ProfileLogic


public interface ProfileLogic

An interface for working with profiles in Profile2.

Author:
Steve Swinsburg (s.swinsburg@lancaster.ac.uk)

Method Summary
 boolean addNewCompanyProfile(CompanyProfile companyProfile)
          Adds a new company profile to the database.
 List<String> getAllSakaiPersonIds()
          Get a list of all SakaiPerson's userIds (ie list of all people with profile records)
 int getAllSakaiPersonIdsCount()
          Get a count of all users with SakaiPerson records
 BasicPerson getBasicPerson(String userUuid)
          Get a BasicPerson
 BasicPerson getBasicPerson(org.sakaiproject.user.api.User user)
          Get a BasicPerson
 List<BasicPerson> getBasicPersons(List<org.sakaiproject.user.api.User> users)
          Get a List of BasicPersons for the given Users.
 List<CompanyProfile> getCompanyProfiles(String userId)
          Retrieves the company profiles from the database for the specified user.
 Person getPerson(String userUuid)
          Get a Person
 Person getPerson(org.sakaiproject.user.api.User user)
          Get a Person
 List<Person> getPersons(List<org.sakaiproject.user.api.User> users)
          Get a List of Persons for the given Users.
 SocialNetworkingInfo getSocialNetworkingInfo(String userId)
          Retrieves the social networking information for the specified user from the database.
 UserProfile getUserProfile(String userUuid)
          Get a UserProfile for the given userUuid
 boolean removeCompanyProfile(String userId, long companyProfile)
          Removes the specified company profile for the specified user.
 boolean saveSocialNetworkingInfo(SocialNetworkingInfo socialNetworkingInfo)
          Saves the social networking information to the database.
 boolean saveUserProfile(org.sakaiproject.api.common.edu.person.SakaiPerson sp)
          Persist a SakaiPerson object and send an email notification, if required.
 boolean updateCompanyProfile(CompanyProfile companyProfile)
          Saves an existing company profile in the database.
 

Method Detail

getUserProfile

UserProfile getUserProfile(String userUuid)
Get a UserProfile for the given userUuid

All users have profiles, even if they haven't filled it in yet. At a very minimum it will contain their name. Privacy checks will determine visibility of other fields

You must be logged-in in order to make requests to this method as the content returned will be tailored to be visible for the currently logged in user.

Parameters:
userUuid - uuid of the user to retrieve the profile for
Returns:
UserProfile for the user, that is visible to the requesting user, or null if the user does not exist.

saveUserProfile

boolean saveUserProfile(org.sakaiproject.api.common.edu.person.SakaiPerson sp)
Persist a SakaiPerson object and send an email notification, if required.

Note that this may eventually change to UserProfile, when SakaiPerson is reimplemented.

Parameters:
sp - SakaiPerson obj
Returns:

addNewCompanyProfile

boolean addNewCompanyProfile(CompanyProfile companyProfile)
Adds a new company profile to the database.

Parameters:
companyProfile - the company profile to add.
Returns:
the success of the operation.

getCompanyProfiles

List<CompanyProfile> getCompanyProfiles(String userId)
Retrieves the company profiles from the database for the specified user.

Parameters:
userId - the ID of the user to query by.

removeCompanyProfile

boolean removeCompanyProfile(String userId,
                             long companyProfile)
Removes the specified company profile for the specified user.

Parameters:
userId - the ID of the user to query by.
companyProfile - the ID of the company profile to remove.

updateCompanyProfile

boolean updateCompanyProfile(CompanyProfile companyProfile)
Saves an existing company profile in the database. New company profiles should be added using the addNewCompanyProfile method.

Parameters:
companyProfile - the existing company profile to be saved.
Returns:
the success of the operation.

getSocialNetworkingInfo

SocialNetworkingInfo getSocialNetworkingInfo(String userId)
Retrieves the social networking information for the specified user from the database.

Parameters:
userId - the user to query by.
Returns:
the social networking information for the specified user.

saveSocialNetworkingInfo

boolean saveSocialNetworkingInfo(SocialNetworkingInfo socialNetworkingInfo)
Saves the social networking information to the database.

Parameters:
socialNetworkingInfo -
Returns:

getBasicPerson

BasicPerson getBasicPerson(String userUuid)
Get a BasicPerson

Parameters:
userUuid -
Returns:

getBasicPerson

BasicPerson getBasicPerson(org.sakaiproject.user.api.User user)
Get a BasicPerson

Parameters:
user -
Returns:

getBasicPersons

List<BasicPerson> getBasicPersons(List<org.sakaiproject.user.api.User> users)
Get a List of BasicPersons for the given Users.

Parameters:
users -
Returns:

getPerson

Person getPerson(String userUuid)
Get a Person

Parameters:
userUuid -
Returns:

getPerson

Person getPerson(org.sakaiproject.user.api.User user)
Get a Person

Parameters:
user -
Returns:

getPersons

List<Person> getPersons(List<org.sakaiproject.user.api.User> users)
Get a List of Persons for the given Users.

Parameters:
users -
Returns:

getAllSakaiPersonIds

List<String> getAllSakaiPersonIds()
Get a list of all SakaiPerson's userIds (ie list of all people with profile records)

Returns:
List of Sakai userId's

getAllSakaiPersonIdsCount

int getAllSakaiPersonIdsCount()
Get a count of all users with SakaiPerson records

Returns:
count


Copyright © 2008-2012 The Sakai Foundation. All Rights Reserved.