Wednesday, February 15, 2017

How to get current user group collection through Rest api in SharePoint 2013

<script type="text/javascript">
    $(document).ready(function () { getCurrentUser(); });
    function getCurrentUser() {

        $.ajax({
            url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/CurrentUser",
            method: "GET",
            headers: { "Accept": "application/json; odata=verbose" },
            success: function (data) {
                getCurrentUserGroupColl(data.d.Id);
            },
            error: function (data) {
                failure(data);
            }
        });

    }
    function getCurrentUserGroupColl(UserID) {
        $.ajax
        ({
            url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/GetUserById(" + UserID + ")/Groups",
            method: "GET",
            headers: { "Accept": "application/json; odata=verbose" },
            success: function (data) {
                /* get all group's title of current user. */
                var results = data.d.results; var InnrHtmlgrp = "<ul>";
                for (var i = 0; i < results.length; i++) {
                    lstgrp += "<li>" + results[i].Title + "</li>";
                }
                $("#bindGroup").append(lstgrp + "</ul>");
            }
        });
    }
</script>
 
      <div id="bindGroup"></div>

Office 2013 breaks Sharepoint 2010 – An exception of type Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown

Solution 1:

Uninstall your office 2013

Solution 2:
I have Office 2013 installed on my Server 2014 and after installing Sharepoint 2010 when I tried to configure Central Administration, I get the following error:
Failed to create the configuration database.An exception of type Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown.  Additional exception information: Failed to call GetTypes on assembly Microsoft.Office.InfoPath.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c. Could not load file or assembly 'Microsoft.Office.InfoPath, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'Microsoft.Office.InfoPath, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'Microsoft.Office.InfoPath, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'Microsoft.Office.InfoPath,

Solution :

Remove the following folders from the path

C:\Windows\assembly\GAC_MSIL

Policy.14.0.Microsoft.Office.InfoPath
Policy.14.0.Microsoft.Office.InfoPath.Client.Internal.Host
Policy.14.0.Microsoft.Office.InfoPath.FormControl

Re-run the Configuration wizard

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.

Monday, January 9, 2017

Difference between the SOAP and RestAPI

1)      SOAP is a protocol.                                                          REST is an architectural style.
2) SOAP stands for Simple Object Access Protocol.                 REST stands for REpresentational State Transfer.
3) SOAP can't use REST because it is a protocol.                    REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP.
4) SOAP uses services interfaces to expose the business logic. REST uses URI to expose business logic.
5) JAX-WS is the java API for SOAP web services.                 JAX-RS is the java API for RESTful web services.
6) SOAP defines standards to be strictly followed.                 REST does not define too much standards like SOAP.
7) SOAP requires more bandwidth and resource than REST.         REST requires less bandwidth and resource than SOAP.
8) SOAP defines its own security.                                 RESTful web services inherits security measures from the underlying transport.
9) SOAP permits XML data format only.                         REST permits different data format such as Plain text, HTML, XML, JSON etc.
10) SOAP is less preferred than REST.                         REST more preferred than SOAP.

Thursday, December 29, 2016

Increase performance of IF ELSE condition ASP.NET

static void Main(string[] args)
{
Stopwatch obj=new Stopwatch();
obj.Start();
for(int i=0;i<10000;i++)
{
string str=getdesignation('M');
}

obj.Stop();

console.WriteLine(obj.ElaspsedTicks.ToString());
}


When user login mostly give top wrost performance
public static string getdesignation(char c)
{
if(c=="M")
return "Manager";
else if(c=="W")
return "Worker";

}
Increase Performance:
public static string getdesignation(char c)
{
if(c=="W")
return "Worker";
else  if(c=="M")
return "Manager";


}