Friday, 17 April 2015

CSOM vs JSOM vs SSOM vs REST


2013

Model Types:
  • CSOM: Client-side object model. C# (or Visual Basiconly, use NuGet, at the moment same package for both 2010 and 2013.
  • JSOM: JavaScript object model. JavaScript only.
    • SP.ClientContext.get_current() for normal use. new SP.ClientContext('url...') for specific SPSite. Note this works cross-SPSite in 2013.
  • SSOM: Server-side object model. C# (or Visual Basiconly, use Microsoft.SharePoint (15) DLL. Must be deployed on same farm.
  • REST: REST web technologies and standard Open Data Protocol (OData) syntax.
Hosting:
  • SharePoint hostedJavaScript and templates only. By templates I mean list templates, content types, etc. Anything that can be uploaded to the SharePoint virtual file system can also be added, such as .aspx-pages.
  • AutohostedC# (or Visual Basic) only. Currently only supported on Office 365. On app purchase an Azure instance will be automatically provisioned. Uses OAuth to comunicate to SharePoint site.
  • Provider hostedC# (or Visual Basic). Similar to Autohosted, but is meant to be hosted more manually (i.e. On Azure). So you fire up a web application, on any server, and then use S2S to connect to SharePoint.
  • Sandboxed: Remnant from 2010, can be uploaded to Solution gallery. Support for limited subset of the SSOM. No file access, so can not deploy anything to _layouts folder. If you use the limited SSOM-part (C#) your solution will be considered deprecated. Support for templates such as list templates and content types, deployed directly to host web.
  • Farm solution: Full access, deploy through PowerShell.
Technologies table:
+--------------------------------------------------------+
¦               ¦ CSOM ¦ JSOM ¦ SSOM ¦ REST JS ¦ REST C# ¦
¦---------------+------+------+------+---------+---------¦
¦ JavaScript    ¦      ¦  x   ¦      ¦  x      ¦         ¦  
¦ C#            ¦      ¦      ¦  x   ¦         ¦  x      ¦  
¦ From browser  ¦      ¦  x   ¦      ¦  x      ¦         ¦  
¦ From server   ¦  x   ¦      ¦  x   ¦         ¦  x      ¦  
¦ OAuth2        ¦  x   ¦  x   ¦  x   ¦  x      ¦  x      ¦  
¦ S2S           ¦  x   ¦      ¦  x   ¦         ¦         ¦ 
+--------------------------------------------------------+
Hosting table:
+---------------------------------------------------------------------+
¦                     ¦ CSOM ¦ JSOM ¦ SSOM        ¦ REST JS ¦ REST C# ¦
¦---------------------+------+------+-------------+---------+---------¦
¦ SharePoint hosted   ¦      ¦  x   ¦             ¦         ¦         ¦
¦ Autohosted          ¦  x   ¦      ¦             ¦         ¦  x      ¦ 
¦ Provider hosted     ¦  x   ¦      ¦             ¦         ¦         ¦ 
¦ Sandboxed solution  ¦  x   ¦  x   ¦  x(limited) ¦  x      ¦  x      ¦
¦ Farm solution       ¦  x   ¦  x   ¦  x          ¦  x      ¦  x      ¦ 
+---------------------------------------------------------------------+

2010

Model Types:
  • CSOM: Client-side object model. C# (or Visual BasicNuGet and JavaScript.
    • SP.ClientContext.get_current() for normal use. new SP.ClientContext('url...') for specific SPWeb.
  • SSOM: Server-side object model. C# (or Visual Basiconly, use Microsoft.SharePoint (14) DLL. Must be deployed on same farm.
  • REST: REST in 2010 is only for ListData.svc. Note that SPServices (jQuery plugin) utilizes the.asmx services in _/vti/bin , such as /_vti_bin/Webs.asmx
Technologies table:
+-------------------------------------+
¦               ¦ CSOM ¦ SSOM ¦ REST  ¦
¦---------------+------+------+-------¦
¦ JavaScript    ¦  x   ¦      ¦  x    ¦  
¦ C#            ¦  x   ¦  x   ¦  x    ¦  
¦ From browser  ¦      ¦  x   ¦  x    ¦  
¦ From server   ¦  x   ¦  x   ¦       ¦  
+-------------------------------------+
Hosting table:
+---------------------------------------------------------------------+
¦                     ¦ CSOM ¦ JSOM ¦ SSOM        ¦ REST JS ¦ REST C# ¦
¦---------------------+------+------+-------------+---------+---------¦
¦ Sandboxed solution  ¦  x   ¦  x   ¦  x(limited) ¦  x      ¦  x      ¦
¦ Farm solution       ¦  x   ¦  x   ¦  x          ¦  x      ¦  x      ¦ 
+---------------------------------------------------------------------+
Ref: http://sharepoint.stackexchange.com/questions/93269/csom-vs-jsom-vs-ssom-vs-rest



Monday, 9 February 2015

Open PDF files in browser - SharePoint (Secure Way)

SharePoint 2010 prompts to save PDF documents when opening.

Most of the blogs will offer you a solution to change the Browser File Handling property to Permissive in Central Administration for that particular web application.

First of all there are good reasons why SP2010 does not render files in browser, this change was made due to security reasons in SharePoint 2010. PDF included.

After considering the possible dangers you Could enable permissive mode, but that works for all file types. Instead it is much less of a security hole to just enable pdf as allowed inline mime types for the web application:


$webapp = Get-SPWebApplication <your webapp url> 
$webapp.AllowedInlineDownloadedMimeTypes.Add(“application/pdf”)
$webapp.Update()

Hope this helps.......

Tuesday, 28 October 2014

Delete all attachments from custom SharePoint list without code

There are some times when you asked to delete all attachments from a SharePoint list. SharePoint itself has given simple solution for this which will not require knowledge about coding or PowerShell or any difficult and time consuming techniques.

Few clicks and your work is done.

  1. Open your list
  2. Go to list settings
  3. Advanced Settings
  4. In Attachments option select radio button "Disabled" and click OK
  5. It will ask you for confirmation
  6. And once you confirmed, it will delete all attachments from SharePoint list
Done....

Hope this helps...


Tuesday, 2 September 2014

Adding user in SharePoint group programmatically

Below is the code to add user in SharePoint group programmatically:


 using (SPSite site = new SPSite(Respective Site URL))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    try
                    {
                        SPUser requiredUser = web.EnsureUser("domainname\\username");

                        if (requiredUser != null)
                        {
                            SPGroup requiredGroup = web.Groups["groupName"];
                            if (requiredGroup != null)
                                requiredGroup.AddUser(requiredUser);
                        }
                   
                    }
                    catch (Exception ex)
                    {
                     
                    }                 
                }
            }

Monday, 1 September 2014

Error occurred in deployment step 'Retract Solution': Object reference not set to an instance of an object.

Today while deploying a custom solution on our development server using Visual Studio 2012, I received below error in Visual Studio: 
"Error occurred in deployment step 'Retract Solution': Object reference not set to an instance of an object."

This was working well till day before and suddenly it started to throw same error again and again.
Then I went to retract same solution through Central Administration, and it shown me actual error that was happening.

The SharePoint_Config log file got full. After shrinking the log file, solution got deployed without any error.

Thursday, 21 August 2014

How to check which edition of SharePoint is running on server?

You can check the SharePoint Edition by going into Central Administration.

In Central Administration go to Upgrade and Migration --> Convert farm license type.
It will show you current edition. For e.g. SharePoint Server with Enterprise Client Access License.

Hope this helps.!!!!!


Related Posts Plugin for WordPress, Blogger...