* Construct SPDocument object for representing Web application policy
* ACL information
*/
public SPDocument getWebApplicationPolicy(WebState webState,
String strFeedType) {
GssGetAclForUrlsResult result = Util.makeWSRequest(
sharepointClientContext, aclWS,
new Util.RequestExecutor<GssGetAclForUrlsResult>() {
public GssGetAclForUrlsResult onRequest(final BaseWS ws)
throws Throwable {
return ((AclWS) ws).getAclForWebApplicationPolicy();
}
public void onError(final Throwable e) {
LOGGER.log(Level.WARNING,
"Call to getAclForWebApplicationPolicy failed.", e);
}
});
FeedType feedType = FeedType.getFeedType(strFeedType);
SPDocument webAppPolicy = null;
if (result == null) {
return webAppPolicy;
}
String siteCollectionUrlToUse;
if (sharepointClientContext.isIncludedUrl(result.getSiteCollectionUrl())) {
siteCollectionUrlToUse = result.getSiteCollectionUrl();
} else {
LOGGER.log(Level.INFO,
"Changing web app policy URL to connector URL ["
+ sharepointClientContext.getSiteURL() + "] as policy URL [ "
+ result.getSiteCollectionUrl() + " ] is not included.");
siteCollectionUrlToUse = sharepointClientContext.getSiteURL();
}
String docID = siteCollectionUrlToUse;
if (feedType == FeedType.CONTENT_FEED) {
docID = docID + "|{" + result.getSiteCollectionGuid().toUpperCase() +"}";
}
// TODO Set SPType and Last Modified correctly.
webAppPolicy = new SPDocument(docID, siteCollectionUrlToUse,
Calendar.getInstance(), SPConstants.NO_AUTHOR, SPConstants.NO_OBJTYPE,
siteCollectionUrlToUse, feedType, SPType.SP2007);
webAppPolicy.setDocumentType(DocumentType.ACL);
Map<String, SPDocument> urlToDocMap = Maps.newHashMap();
urlToDocMap.put(result.getSiteCollectionUrl(), webAppPolicy);
try {
processWsResponse(result, urlToDocMap, webState);
} catch (SharepointException ex) {
LOGGER.log(Level.WARNING,
"Error processing ACL response for web application policy", ex);