Class Webs
Webs SharePoint Example
The Groovy script example below illustrates using the Webs service to get a Web object.
In this example an absolute web URL parameter is specified by the webUrl String object.
import com.avoka.component.sharepoint.SPClient import com.avoka.component.sharepoint.service.Webs import com.avoka.component.sharepoint.type.Web // Create a SharePoint client using the service parameters map with the configured connection details def spClient = new SPClient(serviceParameters) // Create a Webs web service def websService = spClient.getWebs() // Get a web object for the given url def web = websService.getWeb(url) // Get web properties .. def title = web.getTitle() def url = web.getUrl()
- Since:
- 3.5.0
-
Constructor Summary
ConstructorsConstructorDescriptionWebs(SPConnection sharePointConnection) Instantiate the Webs Interface wrapper with SharePoint Connection context -
Method Summary
Modifier and TypeMethodDescriptionReturn the web service name.Return a Site's Properties.getWebCollection(String siteContext) Retrieve the Title and URL's of all Sites beneath the specified Site.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:
getServiceNamein classAbstractService- Returns:
- the web service name
-
getWeb
Return a Site's Properties.Groovy Example
The Groovy script example below illustrates using the
Websservice to get aWebobject. In this example an absolute web URL parameter is specified by thewebUrlString object.import com.avoka.component.sharepoint.SPClient import com.avoka.component.sharepoint.service.Webs import com.avoka.component.sharepoint.type.Web // Create a SharePoint client using the service parameters map with the configured connection details def spClient = new SPClient(serviceParameters) // Create a Webs web service def websService = spClient.getWebs() // Get a web object for the given url def web = websService.getWeb(url) // Get web properties .. def webTitle = web.getTitle() def webUrl = web.getUrl()
Web Service Method
The Microsoft SharePoint Web Service SOAP Method:
http://schemas.microsoft.com/sharepoint/soap/GetWeb
http://msdn.microsoft.com/en-us/library/webs.webs.getweb.aspx
- Parameters:
webUrl- Absolute URL of the Site, or a period (".") to return information about the current site.- Returns:
- Web object representing the Site's properties.
- Throws:
SPException- in case of SharePoint error response
-
getWebCollection
Retrieve the Title and URL's of all Sites beneath the specified Site.Groovy Example
The Groovy script example below illustrates using the
Websservice to get a Collection ofWebTitles and URls. In this example an optional site context parameter is specified by thesiteContextString object.import com.avoka.component.sharepoint.SPClient import com.avoka.component.sharepoint.service.Webs // Create a SharePoint client using the service parameters map with the configured connection details def spClient = new SPClient(serviceParameters) // Create a Webs web service def websService = spClient.getWebs() // Get map of web titles and urls def webCollection = websService.getWebCollection(siteContext) // Iterate through Sites Iterator webKeyIter = webCollection.keySet().iterator() while (webKeyIter.hasNext()) { def webTitle = (String) webKeyIter.next() def webUrl = webCollection.get(webTitle) }Web Service Method
The Microsoft SharePoint Web Service SOAP Method:
http://schemas.microsoft.com/sharepoint/soap/GetWebCollection
http://msdn.microsoft.com/en-us/library/webs.webs.getweb.aspx
- Parameters:
siteContext- (Optional) Provide SharePoint Site context if accessing a non-default site.- Returns:
- Mapinvalid input: '<'String,String> representing the invalid input: '<'Title, URL> of each Site belonging to the specified Site.
- Throws:
SPException- in case of SharePoint error response
-