Sunday, March 31, 2019




                                                              Agile of Everybody

Agile Software development is a group of software development methodologies based on iterative and incremental development, where requirements and solutions evolve through collaboration between self-organizing, cross-functional teams. It promotes adaptive planning, evolutionary development, and delivery, a time-boxed iterative approach, and encourages rapid and flexible response to change.



Wednesday, October 26, 2016

JavaScript Object Model (ECMA) Programming In SharePoint 2016 And Office 365

Set User as Owner of Group

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>



D. Get All Folders

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 JSLink in List View

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>






Tuesday, October 25, 2016




SharePoint 2013 Content Databases and the AllUserData Table



Has anybody else noticed something’s changed with the schema of the Content Database in SharePoint 2013? The AllUserData table has changed.
Look, but don’t touch!
Try a SELECT * FROM AllUserData and see what you get:
SharePoint 2013 AllUserData Table
First of all, what’s happened to columns [nvarchar1], [nvarchar2] (skip a few) [nvarchar64]? How about [int1] to [int16]?
They’ve all been combined into a fragment of Xml, and stored in a single column [tp_ColumnSet].
Let’s zoom in and have a look at one of those Column Sets:
tp_ColumnSet from AllUserData Table
That’s interesting.

Wide List Issues

Firstly, this means “wide lists” are going to be potentially faster than under 2010. A “wide list” in SharePoint 2010 was one that had so many columns that it would cause an INSERT or UPDATE statement to affect more than 8000 bytes of row data.
To work around the problem, when SP2010 works out the column you’re about to add to a list could cause more than 8000 bytes to be written, it would instead create an additional row to hold the new columns. SharePoint used the [tp_RowOrdinal] column to number each of the rows accordingly for a wide list.
We expect SQL Server to start table locking the AllUserData table as the number of row locks approaches 5000. Wide list behaviour would potentially cause SQL Server to have locky behaviour at one-half as many rows (or one-third, or one-quarter – depending upon how many list columns and therefore SQL rows).
Now it’s all stored in one big column, that particular problem is going to go away.
I was bored, so I added 66 text columns to a list. It was all stored in one row, in that one column.
Wide List
However, the [tp_RowOrdinal] column still exists in the SharePoint 2013 content database, and I’m not sure why.

SharePoint 2013 Content Databases and Sparse Columns

SQL 2008, 2008R2 and SQL 2012 all support “sparse columns” and “column sets“. These are SQL technologies that allows a row to grow beyond the usual 8K-per-row limit (up to 2GB of data when expressed as Xml). Under the hood, the AllUserData table still has [nvarchar1] through to [nvarchar64] and beyond! In fact there are 262 nvarchars, 1000 bits, 550 datetimes, 550 floats, 750 ints, 262 ntexts, 262 sql_variants, 350 uniqueidentifiers and 2 geographies (in a pear tree). (Thank you to Lior Gal for pointing me in the right direction!)
See the MSDN reference article on SharePoint 2013 AllUserData table designhere: http://msdn.microsoft.com/en-us/library/hh625524.aspx.
But why didn’t these show up in SQL Management Studio? This is behaviour by designer to prevent poor performance when selecting form wide tables.

AllUserData Performance Issues in SharePoint 2013

Three general observations:
  1. For list sizes below 5000 SQL rows, lists that don’t use SharePoint indexed columns will probably be slower.
  2. For lists greater than 5000 SQL rows, unless we’re using SharePoint column indices in our query, SharePoint list throttling should kick in, and terminate the query before it gets started.
  3. For most list use cases, it is still massively important to use SharePoint column indices. But if you do decide to switch off throttling for a list, performance should be faster than under SharePoint 2007.
So, in summary: even in SharePoint 2013, make sure you have suitable indexed columns.

Tuesday, October 18, 2016

SharePoint Developer Tools 

There is quite a number of Must to Have developer tools that every SharePoint Developer must have in its arsenal in order to boost its own Productivity while developing solutions on SharePoint Platform.
Few of the tools which are my personal favorites also are listed below:
CAML Designer 2013
CAML Designer can generate the CAML Query Stubs based on the inputs provided by the developer and can quickly give a handle on even complex query formations.
It is not just about the Formation of Queries but also offers code Transition from actual CAML Query to
  • Corresponding Server Side Object Model Code
  • Corresponding Managed Client Side Object Model Code
  • Corresponding JSOM & REST API Calls
  • Corresponding PowerShell Code
1
SharePoint Manager 2013
SharePoint Manager has got quite a simple and intuitive interface which allows you to quickly and easily navigate down the farm and investigate settings, properties, schema XML and so on. Most of the things in your SharePoint environment can be investigated from this tool.
This tool allows you to quickly navigate the Site Hierarchy and objects, and you can also get a quick handle on Schema of List, Fields and on object properties like Object GUIDs, Object Titles and so on.
2
Download Path: http://spm.codeplex.com
ULS Viewer
ULS Viewer allows you to look into the SharePoint ULS Logs in real time by parsing the Logs. The information (Correlation ID, Date Time Stamp, Event Source Process and so on )exposed by this tool is really useful for productive debugging capabilities.
3
With the evolution of SharePoint 2013, Developer Dashboard also includes these capabilities of reading & parsing ULS logs. Developer Dashboard contains a separate tab by the name “ULS” where we can see the ULS log entries.
4
CKS Dev
CSK Dev is a Visual Studio extension which adds a bunch of new Project items for SharePoint Projects that are really helpful in increasing the productivity of a developer.
Extension Project Items included
  • WCF Service SPI template
  • Contextual Web Part SPI template
  • Branding SPI Template
  • ASHX SPI template
  • Upgrade Solution Step
  • Restart IIS Step
  • Copy To SharePoint Root Step
And much more…
5
6
Color Palette Tool for Branding
Color Palette allows you create a composed looks for SharePoint 2013.
7
SharePoint 2013 Search Tool
SharePoint Search Tool allows to you create and test SharePoint Search Keyword Query backed up by SharePoint REST API paradigm. It also allows you to analyze the Query Stats and adjust them as per the required output.
8
Fiddler
Fiddler is a Web Proxy that allows to Debug Web Traffic, do Performance Testing, HTTP/HTTPs Traffic Recording, Security Testing and so on.
The use of Fiddler becomes utmost necessary now with the evolution of SharePoint 2013 which is more focused on Development Strategies based on Client Side Scripting Technologies.
9
SPCAF – SharePoint Code Analysis Framework
SharePoint Code Analysis Framework helps to validate your custom SharePoint Solutions and Apps against Best Coding Practices prescribed the industry drawn by various industry standards.
This framework can be really helpful to let you verify if your custom solutions are Stable, Complying with Company Policies, Following Coding Best Practices, Well Designed and Maintainable and much more.
10
Download Path: http://www.spcaf.com
.NET Reflector from Red Gate
.Net Reflector is one of the best tools I have ever used for understanding the code of Third Party DLLs for which I even did not have the Source Code.
Reflector allows you to look into the DLLs to see the code encapsulating inside it to understand its functioning.
11
PowerShell Tools for Visual Studio
This is an excellent Visual Studio Extensions for PowerShell which enables code IntelliSense for PowerShell Scripts within Visual Studio Editor.
12
SPFastDeploy
This tool is specially designed to enhance the productivity while working with SharePoint App.
This tool is best suited for pushing the code changes quickly to SharePoint Apps without re-deploying the Apps. This could save a significant amount of time during App Development.
13
Advanced REST Client plugin for Google Chrome
This is a Chrome Plugin that allows you configure and investigate REST Queries by configuring and executing REST API Call through the tool UI. It also allows us to look for the Stats of the REST Queries in execution.
14
Postman – REST Client plugin for Google Chrome
This is again a Chrome Plugin that allows you deal with REST Calls same as “Advanced REST Client plugin for Google Chrome”.
It is just a matter of choice which one you prefer to work with.
15
SharePoint 2013 Client Browser
This is the similar tool as SharePoint Manager with the only difference that it allows us to connect to SharePoint Sites Remotely using Client APIs. So now no more need to login to SharePoint Server to browser SharePoint Site Objects using this tool.
16
smtp4dev
This is an awesome tool for testing SharePoint Send Mail Functionalities no matter if it is Custom or OOB functionality that we are testing.
It is used to verify if the SharePoint is sending emails to the recipients properly. This tool intercepts the emails that were sending to the recipients by SharePoint and allows you to view them in its own UI.
17
PowerGUI
PowerGUI is one of the best tools available for PowerShell Programming. It provides IntelliSense support for writing PowerShell Scripts at the same time provides a lot of useful windows for Debugging purposes.
18
SharePoint Software Factory
The SharePoint Software Factory is a Visual Studio Extension helping SharePoint Beginners, as well as experienced developers to create, manage and deploy SharePoint solutions without having to know schema internals of the SharePoint Artifacts.
19
Following is the list of few of the features offered by this extension-
20
And much more…
For a detailed list of available features, you can visit http://www.matthiaseinig.de/docs/SPSF/OutputHTML/SPSF_RECIPES_INDEX...
SharePoint Solution Deployer
SharePoint Solution Deployer helps you to deploy SharePoint solution packages (.wsp) to multiple SharePoint environments. It deploys, retracts and upgrades one or more WSPs and can be extended to perform additional custom tasks in PowerShell before or afterward.
It provides a simple XML configuration file which allows you to define the deployment environment by using variables i.e. to perform different actions on different URLs depending to which farm you are currently deploying.
21
SharePoint Diagnostic Studio 2010
Microsoft SharePoint Diagnostic Studio 2010 (SPDiag version 3.0) was created to simplify and standardize troubleshooting of Microsoft SharePoint 2010 Products, and to provide a unified view of collected data.
This tool can be used for-
  • Gathering relevant information from a farm
  • Displaying the results in a meaningful way
  • Identifying performance issues
  • Sharing or exporting the collected data
  • Providing reports for analysis
And much more…
22
SPServices
SPServices is a jQuery library which abstracts SharePoint’s Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install.
23
SharePoint LogViewer
SharePoint Log Viewer is a Windows application for reading and filtering Microsoft SharePoint ULS Logs.
It offers the following key features-
  • View multiple SharePoint log files at once
  • Search by any field
  • Filter the log by any field
  • File drag & drop support
  • Live monitoring for entire farm
  • Export filtered log entries
  • Bookmark log entries
  • Get popup notification of SharePoint log events from system tray
  • Receive email notifications on errors
  • Redirect log entries to event log
  • Supports SharePoint 2007, 2010 and 2013
24
FxCop
FxCop is an application that analyzes managed code assemblies (code that targets the .NET Framework common language runtime) and reports information about the assemblies, such as possible design, localization, performance, and security improvements. Many of the issues concern violations of the programming and design rules set forth in the Design Guidelines, which are the Microsoft guidelines for writing robust and easily maintainable code by using the .NET Framework.
25
JavaScript Beautifier
This online tool is used to beautify, unpack or De-obfuscate JavaScript and HTML, make JSON/JSONP readable, etc.
26
Download Path: http://jsbeautifier.org/
JSON Formatter & Validator
This is an online tool to that can be used to validate the JSON Packets
27
28
Being a SharePoint Developer I can say using these tools should be the second habit for SharePoint Developers to enhance their development capabilities which result in the quick delivery turn around.
Hope you all find it helpful.