Showing posts with label SharePoint 2016 And Office 365. Show all posts
Showing posts with label SharePoint 2016 And Office 365. Show all posts

Tuesday, January 17, 2017

16 Hive Folder in SharePoint 2016


In this article we will learn about the 16 hive folder in Microsoft SharePoint 2016. The 16 hive folder gets created while you install SharePoint 2016. It includes several important files to effectively support SharePoint.


Following is the location of 16 Hive folder –

C:\Program Files\Common files\Microsoft Shared\Web Server Extensions\16


ADMISAPI :

It includes Central Administration soap services. If this directory gets altered, remote site creation as well as all other methods that have been exposed in the service will function incorrectly.


Bin :

This directory includes all core binary files and utilities that are deployed by SharePoint Services.


Client :

This directory includes files used for creation of Office apps.


Config :

This directory includes files used for extending IIS Web sites with SharePoint Server. If in any case, any change is made in this directory or its contents, web application will malfunction.


GAC :

This folder contains following –

Microsoft.SharePoint.Client.Runtime.Portable.Resources.dll

Microsoft.SharePoint.Client.Runtime.Resources.DLL


HCCab :

This directory includes a complete set of cab files that includes content information deployed by SharePoint help system.


Help :

This folder contains the html help file (.chm) that is deployed by configuration wizard.


ISAPI :

This directory contains standard Web Services for SharePoint besides the resources & configuration files that are used by the web services.


Logs :

This folder provides all SharePoint related logs


Policy :

This directory includes Server policy files of SharePoint 2016


Resources :

This directory includes core.resx file that allows creating SharePoint language packs.


Template :

It includes core web site functionality such as configurations, features, templates, and entire resources of a web site.


UserCode :

This directory includes all files that are used for supporting sandbox solution.


Web Clients :

It contains files pertaining to Client Object Model.


Web Services :

This is the root directory for hosting SharePoint back-end Web services.

Tuesday, December 20, 2016

Set JSLink in List View using JavaScript Object Model (ECMA) Programming In SharePoint 2016 And Office 365




Steps:

  • Add Content Editor Web part (CEWP) to the SharePoint page.
  • Save the below script as a text file and upload it to Site Assets page.
  • Refer the script file from the CEWP.

Script:

<script language="javascript" type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
 <script language="javascript" type="text/javascript">
 $(document).ready(function() {
 SP.SOD.executeFunc('sp.js', 'SP.ClientContext', setJSLink);
 });
var oView;
function setJSLink() {
 //Get the client context,web and list object
 var clientContext = new SP.ClientContext();
 var oWebsite = clientContext.get_web();
 var oList = oWebsite.get_lists().getByTitle('Products');
 //Get the view object and set the jsLink property
 oView = oList.get_views().getByTitle('CustomProductView');
 oView.set_jsLink("~site/siteassets/ListViewModification.js");
oView.update();
 //Load the client context and execute the batch
 clientContext.load(oView);
 clientContext.executeQueryAsync(QuerySuccess, QueryFailure);
}
function QuerySuccess() {
 console.log("JSLink has been set to the view.");
}
function QueryFailure(sender,args) {
 console.log('Request failed'+ args.get_message());
}
</script>

Get All Folders using JavaScript Object Model (ECMA) Programming In SharePoint 2016 And Office 365

Steps:

  • Add Content Editor Web part (CEWP) to the SharePoint page.
  • Save the below script as a text file and upload it to Site Assets page.
  • Refer the script file from the CEWP.

Script:

<script language="javascript" type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
 SP.SOD.executeFunc('sp.js', 'SP.ClientContext', getAllFolders);
});
var oListItem,collListItem,clientContext;
function getAllFolders() {
 //Get client context,web and list object
 clientContext = new SP.ClientContext();
 var oWeb= clientContext.get_web();
 var oList = oWeb.get_lists().getByTitle('Demo Library');
 //use caml query to get the folder collection
 var camlQuery = new SP.CamlQuery();
 camlQuery.set_viewXml("<View Scope='RecursiveAll'><Query><Where><Eq><FieldRef
Name='FSObjType'/><Value Type='Text'>1</Value></Eq></Where></Query></View>");
 camlQuery.set_folderServerRelativeUrl('/Sites/Playground/Demo
Library/NewFolder');
 collListItem = oList.getItems(camlQuery)
 //Load the client context and execute the batch
 clientContext.load(collListItem);
 clientContext.executeQueryAsync(Success, Failure);
}
function Success() {
 //get the folder collection and loop through it
 var listItemEnumerator = collListItem.getEnumerator();
 var oListItem;
 while (listItemEnumerator.moveNext()) {
 oListItem = listItemEnumerator.get_current();
 console.log(oListItem.get_item('FileLeafRef'));
 }
}
function Failure(sender,args) {
 console.log('Request failed with error message - '+ args.get_message()+' .
Stack Trace - '+ args.get_stackTrace());
}
</script>

Set User as Owner of Group using JavaScript Object Model (ECMA) Programming In SharePoint 2016 And Office 365



Steps:

  •  Add Content Editor Web part (CEWP) to the SharePoint page.
  •  Save the below script as a text file and upload it to Site Assets page.
  •  Refer the script file from the CEWP.
Script:

<script language="javascript" type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
 SP.SOD.executeFunc('sp.js', 'SP.ClientContext', setAsOwner);
});
var oGroupUsers;
function setAsOwner() {
 //Get client context and web object
 var clientContext = new SP.ClientContext();
 var oWeb = clientContext.get_web();
 //Get group collection and specific group
 var groupCollection = oWeb.get_siteGroups();
 oGroup = groupCollection.getByName("HR Group");
//Set as owner
 var oUser =
clientContext.get_web().ensureUser('i:0#.f|membership|User@abc.on
microsoft.com');
 oGroup.set_owner(oUser);
 oGroup.update();
 //Load the client context and execute the batch
 clientContext.load(oGroup);
 clientContext.executeQueryAsync(QuerySuccess, QueryFailure);
}
function QuerySuccess() {
 console.log("Group Owner set.");
}
function QueryFailure(sender,args) {
 console.log('Request failed'+ args.get_message());
}

</script>


#SharePoint2016 And #Office365