Monday, March 31, 2014

Differebce between Sandboxed solution and Farm Solution in SharePoint

In this post we will discuss about what is difference between Sandboxed Solutions and Farm Solutions in SharePoint.

Also you can check out:

- Create a sequential workflow using Visual studio 2010 in SharePoint 2010

- Enable Sign in as Different User Option in SharePoint 2013

- SharePoint 2013 JavaScript Client Object Model Example

The sandbox is a separate process in which a SharePoint solution runs in isolation. Sandboxed solutions are managed through a new Solution Gallery at the site collection level. Also Visual Studio 2010 can deploy solutions directly to the sandbox during development. The User Code Service is responsible for managing the execution of sandboxed solutions across the farm. Sandboxed solutions are deployed directly to a site collection.

Both Sandboxed and Farm Solutions are packaged and built in same manner. The difference is with deployment target and the functionality available to the solution at run time.

Any SharePoint solution that can be deployed as a sandboxed solution can also be deployed as a farm solution.

In Visual Studio 2010, When the Sandboxed Solution property is set to True, selecting Build\Deploy Solution deploys
the solution to the site collection Solution Gallery. This new gallery is the repository for all sandboxed solutions deployed within the site collection.

Main difference between the deployment methods are: Farm solutions are installed and deployed. Sandboxed solutions are uploaded and activated. The install step in a farm deployment is similar to the upload step in a sandboxed deployment. The deploy step in a farm deployment is similar to the activate step in a sandboxed deployment. The one notable difference is that the activation of a sandboxed solution automatically activates any feature scoped to the level of the site collection.

When the Sandboxed Solution property is set to False, selecting Build\Deploy will deploy the solution to the Farm Solution Gallery.

The sandbox approach allows the site collection administrator to upload the solution and deploy it without involving the farm administrator.

Sandboxed solutions also support feature upgrading. Upgrading is accomplished by creating a solution (.wsp) file with a different name but the same solution Id. When you subsequently deploy the new solution version, SharePoint will see that the Id matches an existing solution and prompt you to upgrade the solution. Once upgraded, the old solution is automatically deactivated.

Apart from this check out some more differences:

Farm Solutions:
- Farm solutions are hosted in the IIS worker process (W3WP.exe).

- If you run any code in farm solution the whole farm will got affected.

- If you deploy any feature or retract any feature the whole application pool got recycled.

- Since they are scoped as farm level, they have full trust access to all the resources.

- When the Sandboxed Solution property is set to False, selecting Build\Deploy will deploy the solution to the Farm Solution Gallery.

Sandboxed Solution:
- Sandboxed solutionsare hosted in the SharePoint user code solution worker process (SPUCWorkerProcess.exe).

- The process runs under a CAS policy that restricts programmatic access to any resource outside the sandbox. So it never restart the IIS application pool.

- If you run any code it will affect only the site collection of the solution.

- Helpful if you have shared hosting.

- When the Sandboxed Solution property is set to True, selecting Build\Deploy Solution deploys the solution to the site collection Solution Gallery.


Sunday, March 23, 2014

SharePoint 2013 JavaScript Client Object Model Example

In this post we will discuss about an example in JavaScript example in SharePoint 2013.

Also you can check out:

- Shredded Storage new feature in SharePoint 2013

- Steps to create App Catalog site in SharePoint 2013

- Browsers supported in SharePoint 2013

In this example we will try to get the site collection url using JavaScript client object model.

var siteCollection;

var ctx = new SP.ClientContext.get_current();

siteCollection = ctx.get_site();

ctx.load(siteCollection);

ctx.executeQueryAsync(success, failure);

function success() {

var url = siteCollection.get_url();

}

function failure() {

alert("Failure!");

}


Friday, March 21, 2014

Create webpart page in SharePoint 2013

Here we will discuss how to create webpart page in SharePoint 2013. In SharePoint 2013 it is very much simple to create webpart pages. It is different to create webpart page in SharePoint 2013.
Also you can check out:

- Configure Following settings in SharePoint 2013

- Advantages of SharePoint Apps over SharePoint solutions

- What happen when you press F5 in Visual Studio in SharePoint 2013?

Approach-1:

Search for the app name as "Site Pages" and then click on that. Then click on the Files tab and then "New Document" -> then select Web Part Page as shown in the fig below:


Then that will open the New Web Part Page, there you can give the name, you can choose the Layout template as well as the Save Location. Then click on Create.

Approach-2:

From the Site, from the Ribbon on the Page tab click on "View All Pages".

Then Click on the Files tab, then New Document and then select "Web Part Page".


Then that will open the New Web Part Page, there you can give the name, you can choose the Layout template as well as the Save Location. Then click on Create.


Thursday, March 20, 2014

Steps to create App Catalog site in SharePoint 2013

In this post we will discuss how to create an app catalog site in SharePoint 2013 using SharePoint 2013 central administration.

Also you can check out some posts on:

- New actions in SharePoint designer 2013 workflow: Call Web Service Action and Start workflow action

- Get user profile properties using JavaScript object model

- Advantages of SharePoint Apps over SharePoint solutions

An app catalog site contains a special type of document library that is used to upload and store app package files. Along with storing the app package file, this document library also tracks various types of metadata for each app.
We can create an app catalog site by using SharePoint 2013 central administration. You must have farm administrator permissions within an on-premises farm to create an app catalog site.

Follow below steps:

- Open SharePoint 2013 central administration (Start > All Programs > Microsoft SharePoint 2013 Products > SharePoint 2013 Central Administration).

- Then choose Apps from the left hand side and this will open the Apps page.

- There click on Manage App Catalog from the App Management section in the Apps page.

- Then in the Manage App Catalog page click on Create a new app catalog site and then click on OK. Before that you can also check the Web Application or if you want you can change the web application. Check the fig below:


- Then this will open the Create App Catalog page, there you can Enter the Title, Description, URL and Site Collection Administrator and then click on "Create". Check the fig below:


- Then the app catalog site will be created successfully.


Friday, March 14, 2014

Advantages of SharePoint Apps over SharePoint solutions

In this post we will discuss some of the advantages of SharePoint app over SharePoint solutions. Also you can check out:

- Steps to create private App Catalog and upload our app in SharePoint 2013

- Different ways to access SharePoint 2013 list data

- Vertical flyout menus in SharePoint 2010

- Apps must be supported in Office 365 and in on-premises farms. SharePoint solutions will not support office 365. Only supports on-premises farms.

- App code never runs within the SharePoint host environment. But SharePoint solutions codes runs within SharePoint hosted environment. Like farm solutions runs within SharePoint worker process (w3wp.exe) and sandboxed solutions runs within SharePoint sandboxed worker process (SPUCWorker-Process.exe).

- App code programs against SharePoint sites by using web service entry points to minimize version-specific dependencies. But in case of SharePoint Apps, they need to check against whether it is working with the newer version of Microsoft.SharePoint.dll.

- App code is authenticated and runs under a distinct identity. But in SharePoint solutions, the code runs under the identity and with the permissions of a specific user.

- App permissions can be configured independently of user permissions. But in case of SharePoint solutions you can not configure permissions for a specific SharePoint solution.

- Apps are deployed by using a publishing scheme based on app catalogs. But to deploy a SharePoint solution you need a farm administrator and also sometimes you need to restart IIS.

- Apps that are published in a catalog are easier to discover, install, and upgrade. To upgrade a SharePoint from one version to another version is not an easy task.


Tuesday, March 11, 2014

Backup and Restore SharePoint 2013 site collection using PowerShell

In this post we will discuss how to take back and restore in SharePoint 2013 site collection using PowerShell.

Also you can check out some posts on:

- Apps packaging in SharePoint 2013

- What happen when you press F5 in Visual Studio in SharePoint 2013?

- Advantages of SharePoint 2013 Apps

Below are the PowerShell command:

Backup:

Syntax:
Backup-spsite  -Identity <sitecollectionname>  -path <location to store the backup>

Example:
Backup-spsite  -Identity http://MySiteColURL  -path C:\MySiteBackup.bak

Restore:

Syntax:
Restore-SPSite -Identity <create new site collection> -path <location to restore the backup>

Example:
Restore-SPSite -Identity http://MyNewSiteColURL -path C:\MySiteBackup.bak


Twitter Delicious Facebook Digg Favorites More