Class UserProfileService
- java.lang.Object
-
- com.avoka.component.sharepoint.AbstractService
-
- com.avoka.component.sharepoint.service.UserProfileService
-
public class UserProfileService extends AbstractService
Provides UserProfileService SharePoint web service class.User Profile Service SharePoint Example
The Groovy script example below illustrates using the
UserProfileServiceservice to look up a User Profile and get its user profile property data object. In this example the account name is specified by theaccountnameString 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
> 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
Constructors Constructor Description UserProfileService(SPConnection sharePointConnection)Instantiate the UserProfileService Interface wrapper with Sharepoint Connection context
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetServiceName()Return the web service name.PropertyDatagetUserProfileByName(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 Detail
-
UserProfileService
public UserProfileService(SPConnection sharePointConnection)
Instantiate the UserProfileService Interface wrapper with Sharepoint Connection context- Parameters:
sharePointConnection- Sharepoint connection context
-
-
Method Detail
-
getServiceName
public String getServiceName()
Return the web service name.- Specified by:
getServiceNamein classAbstractService- Returns:
- the web service name
-
getUserProfileByName
public PropertyData getUserProfileByName(String accountName) throws SPException
Gets the user profile property information by account name.Groovy Example
The Groovy script example below illustrates using the
UserProfileServiceservice to look up a User Profile and get its user profile property data object. In this example the account name is specified by theaccountnameString 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
> 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
-
-