This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" | |
version="1.0" exclude-result-prefixes="xsl ddwrt msxsl rssaggwrt" | |
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" | |
xmlns:rssaggwrt="http://schemas.microsoft.com/WebParts/v3/rssagg/runtime" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" | |
xmlns:rssFeed="urn:schemas-microsoft-com:sharepoint:RSSAggregatorWebPart" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:rss1="http://purl.org/rss/1.0/" xmlns:atom="http://www.w3.org/2005/Atom" | |
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" | |
xmlns:atom2="http://purl.org/atom/ns#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Example 1. Gets a value that specifies usage information about the site, including bandwidth, storage, and the number of visits to the site collection | |
$result = .\Invoke-RestSPO.ps1 -Url "https://contoso.sharepoint.com/_api/site/usage" -UserName "username@tenant.onmicrosoft.com" -Password "password" | |
write-host 'Total amount of disk space, currently being used by the site collection (Mb):' ([math]::round($result.Usage.Storage /1Mb)) | |
#Example 2. Get List Items | |
.\Invoke-RestSPO.ps1 -Url "https://contoso.sharepoint.com/_api/web/lists/getbytitle('Contacts')/title" -UserName "username@tenatnt.onmicrosoft.com" -Password "password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPClientForms.ClientValidation.RequiredValidator = function() { | |
}; | |
SPClientForms.ClientValidation.RequiredValidator.prototype.Validate = function(value) { | |
value = SPClientTemplates.Utility.Trim(value); | |
var hasError = value === ''; | |
var errorMsg = hasError ? Strings.STS.L_SPClientRequiredValidatorError : ''; | |
return new SPClientForms.ClientValidation.ValidationResult(hasError, errorMsg); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateEmail(email) { | |
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
return re.test(email); | |
} | |
function PreSaveAction(){ | |
var emailBox = getFieldControl('Email','Text'); | |
if (!validateEmail(emailBox.val())) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function PreSaveItem() | |
{ | |
if ("function"==typeof(PreSaveAction)) | |
{ | |
return PreSaveAction(); | |
} | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateListItem(webUrl,listName,itemId,itemProperties,success, failure) | |
{ | |
getListItemById(webUrl,listName,itemId,function(item){ | |
$.ajax({ | |
type: 'POST', | |
url: item.__metadata.uri, | |
contentType: 'application/json', | |
processData: false, | |
headers: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deleteListItem(webUrl, listName, itemId, success, failure) { | |
getListItemById(webUrl,listName,itemId,function(item){ | |
$.ajax({ | |
url: item.__metadata.uri, | |
type: "POST", | |
headers: { | |
"Accept": "application/json;odata=verbose", | |
"X-Http-Method": "DELETE", | |
"If-Match": item.__metadata.etag | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet | |
version="1.0" | |
exclude-result-prefixes="x d cmswrt xsl msxsl" | |
xmlns:x="http://www.w3.org/2001/XMLSchema" | |
xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" | |
xmlns:cmswrt="http://schemas.microsoft.com/WebPart/v3/Publishing/runtime" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:msxsl="urn:schemas-microsoft-com:xslt"> | |
<xsl:template name="node-template"> | |
<xsl:param name="is-horizontal" select="false()" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{'parameters': { | |
'__metadata': {'type': 'SP.WebInfoCreationInformation' }, | |
'Url': 'RestSubWeb', | |
'Title': 'RestSubWeb', | |
'Description': 'REST created web', | |
'Language':1033, | |
'WebTemplate':'sts', | |
'UseUniquePermissions':false | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/../../Faker/src/autoload.php'; //Faker library (https://github.com/fzaninotto/Faker) | |
require_once 'SPOClient.php'; | |
$username = 'username@tenant.onmicrosoft.com'; | |
$password = 'password'; | |
$url = "https://tenant.sharepoint.com/"; | |
generateContacts($url,$username,$password); |
OlderNewer