Class Webs
- java.lang.Object
-
- com.avoka.component.sharepoint.AbstractService
-
- com.avoka.component.sharepoint.service.Webs
-
public class Webs extends AbstractService
Provides Webs SharePoint web service class.Webs SharePoint Example
The Groovy script example below illustrates using the
Webs
service to get aWeb
object. In this example an absolute web URL parameter is specified by thewebUrl
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
Constructors Constructor Description Webs(SPConnection sharePointConnection)
Instantiate the Webs Interface wrapper with SharePoint Connection context
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getServiceName()
Return the web service name.Web
getWeb(String webUrl)
Return a Site's Properties.Map<String,String>
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 Detail
-
Webs
public Webs(SPConnection sharePointConnection)
Instantiate the Webs Interface wrapper with SharePoint Connection context- Parameters:
sharePointConnection
- SharePoint connection context
-
-
Method Detail
-
getServiceName
public String getServiceName()
Return the web service name.- Specified by:
getServiceName
in classAbstractService
- Returns:
- the web service name
-
getWeb
public Web getWeb(String webUrl) throws SPException
Return a Site's Properties.Groovy Example
The Groovy script example below illustrates using the
Webs
service to get aWeb
object. In this example an absolute web URL parameter is specified by thewebUrl
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 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
public Map<String,String> getWebCollection(String siteContext) throws SPException
Retrieve the Title and URL's of all Sites beneath the specified Site.Groovy Example
The Groovy script example below illustrates using the
Webs
service to get a Collection ofWeb
Titles and URls. In this example an optional site context parameter is specified by thesiteContext
String 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:
- Map
representing the of each Site belonging to the specified Site. - Throws:
SPException
- in case of SharePoint error response
-
-