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
//Author: Shantha Kumar T | |
//This getContentTypes method returns only the content types associated to the particular website | |
//Property used: SP.Web.ContentTypes property (sp.js) | |
//Supports SharePoint 2013 + and SharePoint Online | |
function getwebContentTypes(siteurl) { | |
//var clientContext = SP.ClientContext.get_current(); This line returns the current context | |
var clientContext = new SP.ClientContext(siteurl); //This line return the context based on the siteurl | |
oContentTypes = clientContext.get_web().get_contentTypes(); | |
clientContext.load(oContentTypes); |
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
//Author: Shantha Kumar T | |
//This getallContentTypes method returns all content types available in the site collection (site or any parent sites) | |
//Property used: SP.Web.availableContentTypes property (sp.js) | |
//Supports SharePoint 2013 + and SharePoint Online | |
function getallContentTypes() { | |
var clientContext = SP.ClientContext.get_current(); | |
oContentTypes = clientContext.get_web().get_availableContentTypes(); | |
clientContext.load(oContentTypes); | |
clientContext.executeQueryAsync( |
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
<!-- Author: Shantha Kumar T --> | |
<!-- HTML snippet returns the collection of role definitions attached to the web --> | |
<!-- webroledefinitioans-rest-jQuery.html - Role definitins associated to the web --> | |
<!-- Style required for HTML Snippet --> | |
<style type="text/css"> | |
.tbl-roles th{ background-color:#ddd; border:2px solid #fff; text-align:left} | |
.tbl-roles td{ background-color:#eee; border:2px solid #fff;} | |
.web-heading{ padding:2px;} | |
</style> | |
<!--Include jQuery library to perform dynamic html dom manipulation --> |
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
//Author - Shantha Kumar T | |
//This Javascript snippet to get the gists details from gist web page through browser console | |
// | |
var snips = document.getElementsByClassName("gist-snippet"); | |
for(i=0; i< snips.length; i++){ | |
var strvalue = ""; | |
var sniname = snips[i]; | |
var nn = $(sniname).find('.css-truncate-target'); | |
strvalue += "Title: " + $(nn).text().trim()+"\r\n"; | |
strvalue += "Link: "+ location.protocol+"//"+location.hostname+$(nn).parent().attr('href')+"\r\n"; |
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
//CSOM Assembly version - 16.1.4727.1200 | |
//using Microsoft.SharePoint.Client; | |
//using System.Net | |
//GetItemChanges(credentials, weburl, listtitle, itemid); | |
//This method returns all the changes (add, update & delete) happened to the list item | |
private static void GetItemChanges(ICredentials credentials, string weburl, string listTitle, int itemid) | |
{ | |
using (ClientContext ctx = new ClientContext(weburl)) | |
{ |
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
//using Microsoft.SharePoint.Client; | |
//using System.Net | |
//GetAllLists(credentials, weburl); | |
//This method returns all the lists and libraries from SharePoint website | |
private static void GetAllLists(ICredentials credentials, string weburl) | |
{ | |
using (ClientContext ctx = new ClientContext(weburl)) | |
{ | |
ctx.Credentials = credentials; |
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
//using Microsoft.SharePoint.Client; | |
//using Microsoft.Online.SharePoint.TenantAdministration; | |
//string weburl = "https://site-admin.sharepoint.com"; | |
//GetSite(credentials, weburl); | |
//This method returns the site collection object based on the url. | |
//shows the count of all subwebs available with in SharePoint online Site Collection | |
//Microsoft.Online.SharePoint.TenantAdministration.SiteProperties.WebsCount property | |
private static void GetSite(SharePointOnlineCredentials credentials, string weburl) |