Class UserProfileService
java.lang.Object
com.avoka.component.sharepoint.AbstractService
com.avoka.component.sharepoint.service.UserProfileService
Provides UserProfileService SharePoint web service class.
User Profile Service SharePoint Example
The Groovy script example below illustrates using the UserProfileService
service to look up a User Profile and get
its user profile property data object. In this example the account name is specified by the accountname
String object.
import com.avoka.component.sharepoint.SPClient import com.avoka.component.sharepoint.service.UserProfileService import com.avoka.component.sharepoint.type.PropertyData import com.avoka.component.sharepoint.type.PropertyValue // Create a SharePoint client using the service parameters map with the configured connection details def spClient = new SPClient(serviceParameters) // Create a UserProfileService web service def userProfileServiceService = spClient.getUserProfileService() // Get a user profile property data object for the given account name def userPropertyData = userProfileServiceService.getUserProfileByName(accountname) // Iterate through Property Data Map Names Map<String, List> propMap = userPropertyData.getPropertyDataMap() Iterator propKeyIter = propMap.keySet().iterator() while (propKeyIter.hasNext()) { String propName = (String) propKeyIter.next() // Get Property Value, Type List and iterate through List propValueList = propMap.get(propName) Iterator propValueIter = propValueList.iterator() while (propValueIter.hasNext()) { PropertyValue propValue = (PropertyValue) propValueIter.next() def value = propValue.getValue() def type = propValue.getType() // Use type, value .. } }
- Since:
- 3.5.0
-
Constructor Summary
ConstructorDescriptionUserProfileService
(SPConnection sharePointConnection) Instantiate the UserProfileService Interface wrapper with Sharepoint Connection context -
Method Summary
Modifier and TypeMethodDescriptionReturn the web service name.getUserProfileByName
(String accountName) Gets the user profile property information by account name.Methods inherited from class com.avoka.component.sharepoint.AbstractService
buildAttributeMap, getByteStream, getDocumentElement, getDocumentTagValue, getRequestMessage, getSPConnection, getWsdlUrl, loadProperty, postMessage, postMessage
-
Constructor Details
-
Method Details
-
getServiceName
Return the web service name.- Specified by:
getServiceName
in classAbstractService
- Returns:
- the web service name
-
getUserProfileByName
Gets the user profile property information by account name.Groovy Example
The Groovy script example below illustrates using the
UserProfileService
service to look up a User Profile and get its user profile property data object. In this example the account name is specified by theaccountname
String object.import com.avoka.component.sharepoint.SPClient import com.avoka.component.sharepoint.service.UserProfileService import com.avoka.component.sharepoint.type.PropertyData import com.avoka.component.sharepoint.type.PropertyValue // Create a SharePoint client using the service parameters map with the configured connection details def spClient = new SPClient(serviceParameters) // Create a UserProfileService web service def userProfileServiceService = spClient.getUserProfileService() // Get a user profile property data object for the given account name def userPropertyData = userProfileServiceService.getUserProfileByName(accountname) // Iterate through Property Data Map Names Map<String, List
> propMap = userPropertyData.getPropertyDataMap() Iterator propKeyIter = propMap.keySet().iterator() while (propKeyIter.hasNext()) { String propName = (String) propKeyIter.next() // Get Property Value, Type List and iterate through List propValueList = propMap.get(propName) Iterator propValueIter = propValueList.iterator() while (propValueIter.hasNext()) { PropertyValue propValue = (PropertyValue) propValueIter.next() def value = propValue.getValue() def type = propValue.getType() // Use type, value .. } } Web Service Method
The Microsoft SharePoint Web Service SOAP Method:
http://microsoft.com/webservices/SharePointPortalServer/UserProfileService/GetUserProfileByName
The MSDN Method Reference:
- Parameters:
accountName
- The account name of the user profile to be retrieved.- Returns:
- PropertyData object representing the property information about the specified user profile.
- Throws:
SPException
- in case of Sharepoint error response
-