Class People


  • public class People
    extends ModelRequest<People>
    Declares all Rest API under the /people path
    • Constructor Detail

      • People

        public People​(org.alfresco.utility.model.UserModel person,
                      RestWrapper restWrapper)
               throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • getPerson

        public RestPersonModel getPerson()
                                  throws java.lang.Exception
        Retrieve details of a specific person using GET call on "people/{personId}"
        Throws:
        java.lang.Exception
      • updatePerson

        public RestPersonModel updatePerson​(java.lang.String putBody)
                                     throws java.lang.Exception
        Update a person properties using PUT call on "people/{personId}"
        Throws:
        java.lang.Exception
      • getPersonActivitiesUntilEntriesCountIs

        public RestActivityModelsCollection getPersonActivitiesUntilEntriesCountIs​(int expectedNoOfEntries)
                                                                            throws java.lang.Exception
        Retrieve list of activities for a specific person using GET call on "people/{personId}/activities" Please note that it retries to get the list of activities several times before returning the empty list. The list of activities are not displayed as they are created.
        Throws:
        java.lang.Exception
      • getPersonActivities

        public RestActivityModelsCollection getPersonActivities()
                                                         throws java.lang.Exception
        Retrieve list of activities for a specific person using GET call on "people/{personId}/activities" without retry
        Throws:
        java.lang.Exception
      • getPersonPreferences

        public RestPreferenceModelsCollection getPersonPreferences()
                                                            throws java.lang.Exception
        Retrieve preferences of a specific person using GET call on "people/{personId}/preferences"
        Throws:
        java.lang.Exception
      • getSiteMembershipRequests

        public RestSiteMembershipRequestModelsCollection getSiteMembershipRequests()
                                                                            throws java.lang.Exception
        Retrieve the current site membership requests for a specific person using GET call on "/people/{personId}/site-membership-requests"
        Throws:
        java.lang.Exception
      • getFavoriteSites

        public RestSiteModelsCollection getFavoriteSites()
                                                  throws java.lang.Exception
        Retrieve a specific person's favorite sites using GET call on "people/{personId}/favorite-sites"
        Throws:
        java.lang.Exception
      • addFavoriteSite

        public RestFavoriteSiteModel addFavoriteSite​(org.alfresco.utility.model.SiteModel site)
                                              throws java.lang.Exception
        Add a favorite site for a specific person using POST call on "people/{personId}/favorite-sites"
        Throws:
        java.lang.Exception
      • getPersonPreferenceInformation

        public RestPreferenceModel getPersonPreferenceInformation​(java.lang.String preferenceName)
                                                           throws java.lang.Exception
        Retrieve a specific preference of a specific person using GET call on "people/{personId}/preferences/{preferenceName}"
        Throws:
        java.lang.Exception
      • removeFavoriteSite

        public void removeFavoriteSite​(org.alfresco.utility.model.SiteModel site)
                                throws java.lang.Exception
        Remove a specific site from favorite sites list of a person using DELETE call on "people/{personId}/favorite-sites/{siteId}"
        Throws:
        java.lang.Exception
      • getFavoriteSite

        public RestSiteModel getFavoriteSite​(org.alfresco.utility.model.SiteModel site)
                                      throws java.lang.Exception
        Returns information on favorite site siteId of person personId. GET call on "people/{personId}/favorite-sites/{siteId}"
        Throws:
        java.lang.Exception
      • deleteSiteMember

        public void deleteSiteMember​(org.alfresco.utility.model.SiteModel site)
                              throws java.lang.Exception
        Delete site member with DELETE call on "people/{personId}/sites/{siteId}"
        Throws:
        java.lang.Exception
      • addSiteMembershipRequest

        public RestSiteMembershipRequestModel addSiteMembershipRequest​(java.lang.String siteMembershipRequest)
                                                                throws java.lang.Exception
        Add new site membership request using POST call on "people/{personId}/site-membership-requests"
        Throws:
        java.lang.Exception
      • addSiteMembershipRequest

        public RestSiteMembershipRequestModel addSiteMembershipRequest​(org.alfresco.utility.model.SiteModel siteModel)
                                                                throws java.lang.Exception
        Add new site membership request using POST call on "people/{personId}/site-membership-requests"
        Throws:
        java.lang.Exception
      • addSiteMembershipRequest

        public RestSiteMembershipRequestModel addSiteMembershipRequest​(java.lang.String message,
                                                                       org.alfresco.utility.model.SiteModel siteModel,
                                                                       java.lang.String title)
                                                                throws java.lang.Exception
        Add new site membership request using POST call on "people/{personId}/site-membership-requests"
        Throws:
        java.lang.Exception
      • getSitesMembershipInformation

        public RestSiteMembershipModelsCollection getSitesMembershipInformation()
                                                                         throws java.lang.Exception
        Get site membership information using GET call on "/people/{personId}/sites"
        Throws:
        java.lang.Exception
      • getSiteMembership

        public RestSiteEntry getSiteMembership​(org.alfresco.utility.model.SiteModel site)
                                        throws java.lang.Exception
        Retrieve site membership information for a person using GET call on "people/{personId}/sites/{siteId}"
        Throws:
        java.lang.Exception
      • getSiteMembershipRequest

        public RestSiteMembershipRequestModel getSiteMembershipRequest​(org.alfresco.utility.model.SiteModel site)
                                                                throws java.lang.Exception
        Retrieve site membership request details for a person/site using GET call on "people/{personId}/site-membership-requests/{siteId}"
        Throws:
        java.lang.Exception
      • updateSiteMembershipRequest

        public RestSiteMembershipRequestModel updateSiteMembershipRequest​(org.alfresco.utility.model.SiteModel siteModel,
                                                                          java.lang.String message)
                                                                   throws java.lang.Exception
        Update site membership request using PUT call on "people/{personId}/site-membership-requests/{siteId}"
        Throws:
        java.lang.Exception
      • getFavorite

        public RestPersonFavoritesModel getFavorite​(java.lang.String favoriteId)
                                             throws java.lang.Exception
        Retrieve favorite site for a specific user using GET call on "people/{personId}/favorites/{favoriteId}"
        Throws:
        java.lang.Exception
      • getFavorites

        public RestPersonFavoritesModelsCollection getFavorites()
                                                         throws java.lang.Exception
        Retrieve specific favorites for a specific user using GET call on "people/{personId}/favorites"
        Throws:
        java.lang.Exception
      • addFolderToFavorites

        public RestPersonFavoritesModel addFolderToFavorites​(org.alfresco.utility.model.FolderModel folderModel)
                                                      throws java.lang.Exception
        Add a folder to favorites for a specific user using POST call on "people/{personId}/favorites"
        Throws:
        java.lang.Exception
      • addFileToFavorites

        public RestPersonFavoritesModel addFileToFavorites​(org.alfresco.utility.model.FileModel fileModel)
                                                    throws java.lang.Exception
        Add a folder to favorites for a specific user using POST call on "people/{personId}/favorites"
        Throws:
        java.lang.Exception
      • addSiteToFavorites

        public RestPersonFavoritesModel addSiteToFavorites​(org.alfresco.utility.model.SiteModel siteModel)
                                                    throws java.lang.Exception
        Add a site to favorites for a specific user using POST call on "people/{personId}/favorites"
        Throws:
        java.lang.Exception
      • deleteSiteFromFavorites

        public RestWrapper deleteSiteFromFavorites​(org.alfresco.utility.model.SiteModel site)
                                            throws java.lang.Exception
        Delete site from favorites for a specific user using DELETE call on "people/{personId}/favorites/{favoriteId}"
        Throws:
        java.lang.Exception
      • deleteFolderFromFavorites

        public RestWrapper deleteFolderFromFavorites​(org.alfresco.utility.model.FolderModel folderModel)
                                              throws java.lang.Exception
        Delete a folder from favorites for a specific user using DELETE call on "people/{personId}/favorites/{favoriteId}"
        Throws:
        java.lang.Exception
      • deleteFileFromFavorites

        public RestWrapper deleteFileFromFavorites​(org.alfresco.utility.model.FileModel fileModel)
                                            throws java.lang.Exception
        Delete a file from favorites for a specific user using DELETE call on "people/{personId}/favorites/{favoriteId}"
        Throws:
        java.lang.Exception
      • getNetwork

        public RestNetworkModel getNetwork()
                                    throws java.lang.Exception
        Retrieve details of the current user network using GET call on "people/{personId}/networks/{networkId}"
        Throws:
        java.lang.Exception
      • getNetwork

        public RestNetworkModel getNetwork​(org.alfresco.utility.model.UserModel tenant)
                                    throws java.lang.Exception
        Retrieve details of a specific network using GET call on "people/{personId}/networks/{networkId}"
        Throws:
        java.lang.Exception
      • getNetworks

        public RestNetworkModelsCollection getNetworks()
                                                throws java.lang.Exception
        Retrieve details of all networks related to the current person using GET call on "people/{personId}/networks"
        Throws:
        java.lang.Exception
      • getNetworks

        public RestNetworkModelsCollection getNetworks​(org.alfresco.utility.model.UserModel tenant)
                                                throws java.lang.Exception
        Retrieve details of all networks related to a specific person using GET call on "people/{personId}/networks"
        Throws:
        java.lang.Exception
      • createPerson

        public RestPersonModel createPerson​(RestPersonModel newPerson)
                                     throws java.lang.Exception
        Create new person with given newPerson details using POST call on "people"
        Throws:
        java.lang.Exception
      • downloadAvatarContent

        public RestResponse downloadAvatarContent()
                                           throws java.lang.Exception
        Get people avatar image using GET call on '/people/{personId}/avatar Please note that it retries to get the renditions response several times because on the alfresco server the rendition can take a while to be created.
        Throws:
        java.lang.Exception
      • uploadAvatarContent

        public io.restassured.response.ValidatableResponse uploadAvatarContent​(java.lang.String fullServerUrL,
                                                                               java.io.File avatarFile)
                                                                        throws java.lang.Exception
        Update avatar image PUT call on 'people/{nodeId}/children
        Throws:
        java.lang.Exception
      • listGroupMemberships

        public RestGroupsModelsCollection listGroupMemberships()
                                                        throws java.lang.Exception
        List group memberships for a person using GET on '/people/{personId}/groups
        Throws:
        java.lang.Exception