Setting Up SharePoint 2013 Dev Environment in Office 365

To get started in setting up a SharePoint 2013 development environment, watch the above video. I have also documented the procedure for setting up a SharePoint 2013 environment which can be read below.

The presentation slide for the video can be read below.

Disclaimer: I do not own the content of the video or PowerPoint slide. All credit goes to Microsoft Academy.

SharePoint 2013 BootStrap

Watch the above video to demonstrate how to create a simple mobile responsive branded SharePoint 2013 site using only CSS.

However when developing a complex branding site for SharePoint 2013, where the site needs to be mobile responsive and compatible across mobile devices and tablets, then the starting point is learning how to implement a master page that uses BootStrap.

Getting Started

There are three ways below to get started in using BootStrap framework for SharePoint 2013.

  • ShareBoot – It is a responsive SharePoint 2013 theme that is downloaded from a Zip file. When uncompressed, the zip contains a master page, three page layouts and bootstrap files;
  • CodePlex – There is an open community source code called “Responsive SharePoint” that contains the source code and WSP file to deploy a branded SharePoint 2013 site with BootStrap; and
  • Twitter BootStrap – Solutions in GitHub with its documentations.

“ShareBoot” and “Responsive SharePoint CodePlex” already has their solution with BootStrap integrated with SharePoint 2013. So it is quicker to get started using either of them in SharePoint 2013. However “Twitter Bootstrap” has standalone solution with just CSS3,  JavaScript & Font files.

This blog focuses on how to use ShareBoot.  So for a complete instructions on how to deploy ShareBoot in SharePoint 2013, read below:

Note that the documented instructions is a manual process of deploying ShareBoot as a drawback. So to automate the deployment process, I suggest packaging up all the deployment ShareBoot files into Visual Studio 2012-13 as a solution package WSP file.

 

References

  1. http://getbootstrap.com/
  1. W3School links below:

Bootstrap 3 Home

Bootstrap Grids

Bootstrap CSS Ref

Bootstrap Comps

Bootstrap JS Ref

  1. SharePoint 20103 Responsive – CodePlex

What is REST?

REST stands for Representational State Transfer. (It is sometimes spelled “ReST”.) It relies on a stateless, client-server, cacheable communications protocol — and in virtually all cases, the HTTP protocol is used.

REST is an architecture style for designing networked applications. The idea is that, rather than using complex mechanisms such as CORBA, RPC or SOAP to connect between machines, simple HTTP is used to make calls between machines.

In many ways, the World Wide Web itself, based on HTTP, can be viewed as a REST-based architecture.

RESTful applications use HTTP requests to post data (create and/or update), read data (e.g., make queries), and delete data. Thus, REST uses HTTP for all four CRUD (Create/Read/Update/Delete) operations.

REST is a lightweight alternative to mechanisms like RPC (Remote Procedure Calls) and Web Services (SOAP, WSDL, et al.). Later, we will see how much more simple REST is.

  • Despite being simple, REST is fully-featured; there’s basically nothing you can do in Web Services that can’t be done with a RESTful architecture.

REST is not a “standard”. There will never be a W3C recommendataion for REST, for example. And while there are REST programming frameworks, working with REST is so simple that you can often “roll your own” with standard library features in languages like Perl, Java, or C#.

  • Architecture style – concept / theory
  • Architecture pattern – Components and how they interact with each other
  • Design pattern – Solution at code level and talks about logic and classes

 

REST As Light Weight Web Services

As a programming approach, REST is a lightweight alternative to Web Services and RPC.

Much like Web Services, a REST service is:

  • Platform-independent (you don’t care if the server is Unix, the client is a Mac, or anything else),
  • Language-independent (C# can talk to Java, etc.),
  • Standards-based (runs on top of HTTP), and
  • Can easily be used in the presence of firewalls.

Like Web Services, REST offers no built-in security features, encryption, session management, QoS guarantees, etc. But also as with Web Services, these can be added by building on top of HTTP:

  • For security, username/password tokens are often used.
  • For encryption, REST can be used on top of HTTPS (secure sockets).
  • … etc.

One thing that is not part of a good REST design is cookies: The “ST” in “REST” stands for “State Transfer”, and indeed, in a good REST design operations are self-contained, and each request carries with it (transfers) all the information (state) that the server needs in order to complete it.

How To Deploy InfoPath 2010 Form Templates with Administrative Approvals

The YouTube video above is base on the following set of instructions below about how to publish an InfoPath 2010 form template with admin approval in Central Administration.

  1. Update the existing InfoPath form in InfoPath 2010 Designer and make the request changes
  2. Once update changes is completed, save the file.

Publish

Before publish any forms, always perform a BACK UP of the current existing InfoPath form template(s) that will later be overwritten with the new changes. See Appendix A for more details.

3. Go to File tab->Info and click “Forms Options”

4. Go to Versioning section and ensure the “Automatically upgrade existing forms” has been selected. Take a note of the next version number

5. To publish, go to File tab->Publish and click “Quick Publish” button (Accept the default path location)

Upload and activate

To upload a new/existing InfoPath template form, do the following:

6. Go to SharePoint Central Administration site

7. Under “General Application Settings”, click “Manage form templates”

8. Click “Upload form template” link

9. Browse and select the InfoPath template form that is located in the path you had publish in step 5, for upload. Accept the default settings and click Upload button

10. A successful upload will display the message below. Click OK

11. Check that the form has successfully been uploaded. Note that the version number of the form must be the last version number (e.g. 10.0.2) observed in step 4. The status field should display “Ready”NOTE: Skip step 12 & 13 if the uploaded form was an existing form.

12. If this is a NEW form, then select the uploaded form and select “Activate to a site collection”.

13. Select the destination site collection to activate the form.

  1. Go the destination site collection where the form was activated and check the “Form Template” library to check that the form has been successfully published, by viewing the last modified date.
  2. Notify the user that UAT is in progress, and ignore any test emails (if any).
  3. Test the form by submitting with test data to verify that the changes worked.

References:

 

AutoSPInstallerGUI

Overview

AutoSPInstallerGUI was originally a windows UI to create config files to automate deployment of SharePoint 2010 & 2013. AutoSPInstallerGUI was originally developed by Ivan and he published it to CodePlex in April 2015.

Since then NOTE that, AutoSPInstallerGUI is now depreciated. It has been replaced with the online version at  http://autospinstaller.com or http://autospinstaller.azurewebsites.net homepage

 

Getting started

  1. Read the AutoSPInstaller Guide
  2. Download and extract the zip file for the AutoSPInstaller PowerScript version here
  3. After step 1 and 2 has been done, at this point you want to begin configuring AutoSPInstaller via online by going to Load Default Template section of the farm config webpage and click “Begin with Template” button (**if you don’t have an existing config file). Follow the instruction to save and download the configuration as an XML file
  4. Follow the installation step section from the AutoSPInstaller Guide. In summary:
    • Drop the XML into the extracted \SP\AutoSPInstaller folder that was done in stp 2
    • Run AutoSPInstaller.bat on each farm

**If you already have a config file, then upload the XML file by clicking the Browse button from Load from my XML section

A Beginner’s Tutorial on Implementing IEnumerable Interface

This article discusses how to implement IEnumerable interface and using yield keyword.

Introduction

In this article we will discuss about the IEnumerable interface. We will discuss how IEnumerable interface facilitate the use of foreach statement to iterate through a set of data. We will then look how to implement our own collections that implement IEnumerable interface. The use of yield keyword and Enumerating generic collections will also be discussed in this article.

Background

Whenever we work with collection of objects, we might find ourselves in need to iterate the collection. The best way to iterate through a collection is by implementing the Iterator pattern. (refer: Understanding and Implementing the Iterator Pattern in C# and C++[^]). C# provides a very clean construct of foreach statement to iterate in a read only manner over a collection.

C# also provides us the possibility of using the same foreach construct and all the enumeration techniques on our custom collection objects by implementing the IEnumerable interface. So let us see how we can implement IEnumerable interface with our custom collection classes.

Using the code

Enumerating the Collection classes

Before starting the discussion let us see how we can use the Built-in classes and iterate over them. Lets start by looking into the ArrayList class that implements IEnumerable and see how we can have read only iteration over that using foreach statement.

// Let us first see how we can enumerate an object implementing IEnumerable
ArrayList list = new ArrayList();

list.Add("1");
list.Add(2);
list.Add("3");
list.Add('4');

foreach (object s in list)
{
    Console.WriteLine(s);
}

Enumerating the Generic Collection classes

The Arraylist class is a generalized class that let us keep a collection. We can also have a generic class in which we can provide the type along with the data. Iterating over generic collection classes is also possible because they implementIEnumerable<T> interface. Lets see how we can enumerate over a generic collection.

// Let us first see how we can enumerate an object implementing IEnumerable<T>
List<string> listOfStrings = new List<string>();

listOfStrings.Add("one");
listOfStrings.Add("two");
listOfStrings.Add("three");
listOfStrings.Add("four");

foreach (string s in listOfStrings)
{
    Console.WriteLine(s);
}

Now our objective is to have our own custom collection class and a generic collection class that should implement the IEnumerable and IEnumerable<T> interface respectively to provide the possibility of enumerating over them.

Understanding the yield keyword

Before jumping into the Implementation of these classes, we need to understand a very important keyword yield which actually facilitate the enumeration over collection. yield statement is used while returning a value from a function.

A normal method call like the one shown below will return only the first value no matter how many times it is called.

static int SimpleReturn()
{
    return 1;
    return 2;
    return 3;
}

static void Main(string[] args)
{
    // Lets see how simeple return works
    Console.WriteLine(SimpleReturn());
    Console.WriteLine(SimpleReturn());
    Console.WriteLine(SimpleReturn());
    Console.WriteLine(SimpleReturn());
}

The reason for this is that the normal return statement does not preserve the state of the function while returning. i.e. every call to this function is a new call and it will return the first value only.

Where as if I replace the return keyword by yield return then the function will become capable of saving its state while returning the value. i.e. when the function is called second time, it will continue the processing from where is has returned in the previous call.

static IEnumerable<int> YieldReturn()
{
    yield return 1;
    yield return 2;
    yield return 3;
}
static void Main(string[] args)
{
    // Lets see how yield return works
    foreach (int i in YieldReturn())
    {
        Console.WriteLine(i);
    }
}

When we run the above code it will return 1,2 and then 3. The only catch while using the yield return statement is that the function should return an IEnumerable and should be called from an iteration block i.e. foreach statement.

Implementing IEnumerable in our custom Collection class

Now in our custom collection classes, if we define a function that will iterate over all the elements in the collection and return then using the yield keyword, we will be able to get hold of all the elements in the the collection.

So let us define our own MyArrayList class and implement IEnumerable interface, which will force us to implement the GetEnumerator function. This function will iterate over the collection and do a yield return on all the elements.

class MyArrayList : IEnumerable
{
    object[] m_Items = null;
    int freeIndex = 0;

    public MyArrayList()
    {
        // For the sake of simplicity lets keep them as arrays
        // ideally it should be link list
        m_Items = new object[100];
    }

    public void Add(object item)
    {
        // Let us only worry about adding the item 
        m_Items[freeIndex] = item;
        freeIndex++;
    }

    // IEnumerable Member
    public IEnumerator GetEnumerator()
    {
        foreach (object o in m_Items)
        {
            // Lets check for end of list (its bad code since we used arrays)
            if(o == null)
            {
                break;
            }

            // Return the current element and then on next function call 
            // resume from next element rather than starting all over again;
            yield return o;
        }
    }
}

This class will now let us enumerate all the elements using a foreach stemement.

static void Main(string[] args)
{
    //Let us now go ahead and use our custom MyArrayList with IEnumerable implemented
    MyArrayList myList = new MyArrayList();

    myList.Add("1");
    myList.Add(2);
    myList.Add("3");
    myList.Add('4');

    foreach (object s in myList)
    {
        Console.WriteLine(s);
    }
}

Note: This class is neither complete not a very good implementation. The only purpose of the sample implementation is to demonstrate the implementation of IEnumerable interface.

Implementing IEnumerable<T> in our custom Generic Collection class

Let us now take this approach a little further and define a generic collection class capable of being enumerated. To do this we need to implement IEnumerable<T> interface.

class MyList<T> : IEnumerable<T>
{
    T[] m_Items = null;
    int freeIndex = 0;

    public MyList()
    {
        // For the sake of simplicity lets keep them as arrays
        // ideally it should be link list
        m_Items = new T[100];
    }

    public void Add(T item)
    {
        // Let us only worry about adding the item 
        m_Items[freeIndex] = item;
        freeIndex++;
    }

    #region IEnumerable<T> Members

    public IEnumerator<T> GetEnumerator()
    {
        foreach (T t in m_Items)
        {
            // Lets check for end of list (its bad code since we used arrays)
            if (t == null) // this wont work is T is not a nullable type
            {
                break;
            }

            // Return the current element and then on next function call 
            // resume from next element rather than starting all over again;
            yield return t;
        }
    }

    #endregion

    #region IEnumerable Members

    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
    {
        // Lets call the generic version here
        return this.GetEnumerator();
    }

    #endregion
}

This class will now let us enumrate all the elements using a foreach stemement.

static void Main(string[] args)
{
    // Let us first see how we can enumerate an custom MyList<t> class implementing IEnumerable<T>
    MyList<string> myListOfStrings = new MyList<string>();

    myListOfStrings.Add("one");
    myListOfStrings.Add("two");
    myListOfStrings.Add("three");
    myListOfStrings.Add("four");

    foreach (string s in myListOfStrings)
    {
        Console.WriteLine(s);
    }
}
</t>

So now we have a collection class and a generic collectio class that implement IEnumerable and IEnumerable<T> respectively. Althogh These class is neither complete not a very good implementation but they do serve the purpose of the article i.e. to demonstrate the implementation of IEnumerable interface.

Point of interest

What we have tried to do in this article is see how can we implement the IEnumerable andIEnumberable<T> interface. We have looked into the significance of yield keyword. This stuff is known to most experienced C# programmers but the beginners might find it useful. I hope this has been informative.

 

Reference

 

Customising SharePoint 2013 Search Result Page

How search works in a few words
In case you’re not so familiar with how search works, here’s a high level representation that might be useful for this series.

searchindex

  1. Content is stored in lists and libraries. Site columns are used to store values, or in other words information, about each item in a list or library.
  2. When lists and libraries are crawled, site columns and the site column values are added to the search index.
  3. In the search index, site columns are “transformed” into managed properties. Site column values are “transformed” into managed property values
  4. On a search page, a user enters a query in a Search Box Web Part. The query is sent to the search index.
  5. Search results are sent from the search index to a search results page, and displayed in a Search Results Web Part.  The Search Results Web Part uses display templates that specify which managed property values should be displayed.

 

Overview

 

 

Customising SharePoint 2013 Search Scope

To create a scope search, use Manage Result Sources feature. After configure managed result source, the next step is to configure search result page (See appendix 3.2 for more detail instructions not related to SAO).

    1. Go the search centre search site collection that was created
    2. Go to site settings from top right side drop down menu

search0

 

 

 

3. Click on Result Sources link under Site Collection Administrator

search1

 

 

4. Click “New Result Source” button

  1. Enter the following details below and click the save button when finish:

search2

search3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The query builder looks like this:

search4

 

 

 

 

 

 

After saving the result source, it should look like this:

search5

Introduction to REST in SharePoint 2010

Summary

What I really like about SharePoint 2010 is all of the new ways we can get at list data.  You can always use the Client Object Model, Linq to SharePoint, or the existing object model, but one neat new way to get at list data is with listdata.svc.  ListData.svc provides a way of getting information from a list (or lists using joins) using REST.

 

What is REST?

Rest stands for Representational State Transfer. It is an interface with WCF Data Service that allows you to use construct HTTP requests to query SharePoint list data. Like all RESTful Web services, the SharePoint REST interface maps HTTP verbs to data operations, as shown in the following table.

HTTP verb Data operation
GET Retrieve
POST Create
PUT Update (update all fields and use default values for any undefined fields)
DELETE Delete
MERGE Update (update only the fields that are specified and changed from current version)

What you end up with is a nice RSS feed of list data, that you can consume with whatever client you would like.  You can construct URLs in various manners to get specific records, do joins, or perform simple queries.  I won’t go through everything that you can do with it today, but I’ll point you towards resources to do the more advanced things.

 

Getting Started

When you are getting started, the first thing you want to do is check and see if you have ListData.svc up and running.  Like any SharePoint web service, it’s located in the _vti_bin folder of any existing site, so it will work with items relative to that site.  Here is what a typical URL might look like.

http://<sharepoint-server>/_vti_bin/ListData.svc

Try hitting that URL on your SharePoint 2010 server and see if it works.  There is a good chance that you will get a 404 error.  This happened to me, so I did some searching and found Rob Garret’s post stating to go out and install ADO.NET Data Services 1.5 CTP 2.  There are a few choices, but I have seen others recommend you go with the runtime only.  I had issues installing the full package.  Once you have it installed, it still didn’t work for me, so I rebooted my server and everything worked fine when it booted back up.  My guess is you probably could just reset IIS though.

Once you have a working ListData.svc, hitting it you should get results like this.

ListDataSvcNoParameters

You get an XML document of all lists available to be queried.  If you notice the href on each collection it gives you an idea of how you can construct subsequent URLs to get data.  In today’s example, we’re going to work with a simple task list.  We’ll look at the various ways we can get data from this list.

ListDataSvcTaskList

To get the data for this list via REST we simply just add the list name to the URL.  In my case the name of the list is called Tasks.  Here is what the URL would look like.

http://<sharepoint-server>/_vti_bin/ListData.svc/<ListName&gt;

In my case:

http://sp2010/_vti_bin/ListData.svc/Tasks

Here is what the results look like.

ListDataSvcTasksAll

As you can see we get an RSS feed and this is how Internet Explorer renders it.  However, if we look at the actual XML of the feed, we’ll find that we get quite a bit of data back about the list.  Here is a snippet of the XML.

<feed xml:base=”http://sp2010/_vti_bin/ListData.svc/&#8221; xmlns:d=”http://schemas.microsoft.com/ado/2007/08/dataservices&#8221; xmlns:m=”http://schemas.microsoft.com/ado/2007/08/dataservices/metadata&#8221; xmlns=”http://www.w3.org/2005/Atom”&gt;

<title type=”text”>Tasks</title>

<id>http://sp2010/_vti_bin/ListData.svc/Tasks</id&gt;

<updated>2010-01-21T19:21:27Z</updated>

<link rel=”self” title=”Tasks” href=”Tasks” />

<entry m:etag=”W/&quot;1&quot;”>

<id>http://sp2010/_vti_bin/ListData.svc/Tasks(1)</id&gt;

<title type=”text”>Test 1</title>

<updated>2010-01-21T09:26:51-06:00</updated>

<author>

<name />

</author>

<link rel=”edit” title=”TasksItem” href=”Tasks(1)” />

<link rel=”http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments&#8221; type=”application/atom+xml;type=feed” title=”Attachments” href=”Tasks(1)/Attachments” />

<link rel=”http://schemas.microsoft.com/ado/2007/08/dataservices/related/Predecessors&#8221; type=”application/atom+xml;type=feed” title=”Predecessors” href=”Tasks(1)/Predecessors” />

<link rel=”http://schemas.microsoft.com/ado/2007/08/dataservices/related/Priority&#8221; type=”application/atom+xml;type=entry” title=”Priority” href=”Tasks(1)/Priority” />

<link rel=”http://schemas.microsoft.com/ado/2007/08/dataservices/related/Status&#8221; type=”application/atom+xml;type=entry” title=”Status” href=”Tasks(1)/Status” />

<category term=”Microsoft.SharePoint.DataService.TasksItem” scheme=”http://schemas.microsoft.com/ado/2007/08/dataservices/scheme&#8221; />

<content type=”application/xml”>

<m:properties>

<d:ID m:type=”Edm.Int32″>1</d:ID>

<d:ContentTypeID>0x01080085FF0E1548B7414787A693232497B24E</d:ContentTypeID>

<d:ContentType>Task</d:ContentType>

<d:Title>Test 1</d:Title>

<d:Modified m:type=”Edm.DateTime”>2010-01-21T09:26:51</d:Modified>

<d:Created m:type=”Edm.DateTime”>2010-01-21T09:26:51</d:Created>

<d:CreatedByID m:type=”Edm.Int32″>1</d:CreatedByID>

<d:ModifiedByID m:type=”Edm.Int32″>1</d:ModifiedByID>

<d:Owshiddenversion m:type=”Edm.Int32″>1</d:Owshiddenversion>

<d:Version>1.0</d:Version>

<d:Path>/Lists/Tasks</d:Path>

<d:PriorityValue>(2) Normal</d:PriorityValue>

<d:StatusValue>In Progress</d:StatusValue>

<d:Complete m:type=”Edm.Double” m:null=”true” />

<d:AssignedToID m:type=”Edm.Int32″ m:null=”true” />

<d:TaskGroupID m:type=”Edm.Int32″ m:null=”true” />

<d:Description>&lt;div&gt;Test 1 Task&lt;/div&gt;</d:Description>

<d:StartDate m:type=”Edm.DateTime”>2010-01-21T00:00:00</d:StartDate>

<d:DueDate m:type=”Edm.DateTime” m:null=”true” />

</m:properties>

</content>

</entry>

As you can see in the content element, we can see the various site columns on a particular list item.  Of course, there is more we can do with REST than just view everything in a list.  If you want a specific item, you can use parenthesis and specify an indexer.  Note that it is unit-indexed, not zero-indexed.

http://<sharepoint-server>/_vti_bin/ListData.svc/<ListName>(<Index&gt;)

In my case:

http://sp2010/_vti_bin/ListData.svc/Tasks(3)

However, when you do this, Internet Explorer will give you an error that it cannot display this feed.

ListDataSvcTaskListIndexerIeError

Not to worry though, if you view source, you still have a working XML document.  It will pretty much look like the one above minus the initial feed information.  You can take the query above and go one step further.  Say, you just want to know the status for a specific task (note that the site column is actually called StatusValue here), you can simply add it to the URL like this.

http://<sharepoint-server>/_vti_bin/ListData.svc/<ListName>(<Index&gt;)/(<Field>)

In my case:

http://sp2010/_vti_bin/ListData.svc/Tasks(3)/StatusValue

You’ll get an even simpler XML document that looks like this.  It will create an element named after whichever site column you passed to it.

<?xml version=”1.0″ encoding=”utf-8″ standalone=”yes” ?>

<StatusValue xmlns=”http://schemas.microsoft.com/ado/2007/08/dataservices”>Completed</StatusValue&gt;

The last thing I will cover is simple queries.  You can do this with $filter.  There are a number of operators you can use here, but the one I will start with today is eq (or equals).  For example, say I want to see all tasks that are completed, I would use a URL like this.  Put any literals inside quotes.

http://sp2010/_vti_bin/ListData.svc/Tasks?$filter=StatusValue eq ‘Completed’

This returns results that look like this and of course the content element in the XML has the complete data on each list item returned.

ListDataSvcTaskListQuery

You can also use various other types of predicates, such as ne, gt, ge, lt, le, and, or, not, etc.  What each one does is probably pretty obvious, but if its not take a look at this MSDN reference for more information on the various filters and parameters you can use.  Skip the code stuff at the begging and scroll down a bit to find the good stuff.  This is a good start to working with REST in SharePoint, but this really is just the tip of it.  What you are learning here isn’t really just specific to SharePoint but it applies to anything you do with ADO.NET Data Services, so it might be useful elsewhere later.

One thing I will point out is that I was not able to use this with an external list.  I am guessing this is by design (which sucks), but it doesn’t look like it’s going to work.  Of course, my install could just be broken or this could be subject to change.

 

Other Reference

SPMeta2

When using SPMeta 2, the first starting point is to read the two links below to find out more about what is SPMeta2:

Then the next step is to Learn the basics

Finally lets get cracking on how to implement and use SPMeta2. You can follow this link  Get started from scratch or alternately follow my instructions below.

Step 1: Installing NuGet

The pre-requisite is to ensure that you have NuGet installed for your Visual Studio (VS). NuGet is available for the following clients:

  1. Follow my blog here on how to install NuGet in VS.

 

Step 2: Setting up SPMeta2

  1. Go to SubPointSolutions homepage on Github and download the latest SPMeat2. NOTE: Check the release note first to ensure that you are downloading the latest stable version and NOT the beta (still have bugs) version.
  2.  Extract the zip file.
  3.  One you have SPMeta2 solutions open (SPMeta2.sln) in VS 2013, you can either build it with Visual Studio 2013 or use “build.ps1″ script located in /SPMeta2/SPMeta2.Build folder. NOTE: Trying to open the solution in previous version of VS lower than 2013 will fail in opening a project such as SPMeta2\SPMeta2.Containers.O365\SPMeta2.Containers.AppContainer\SPMeta2.Containers.AppContainer.csproj

 

Step 3: Create a CSOM Solution for SharePoint 2013

  1. Create a new Console Application in VS 2013
  2. In Console App, right click “References”->Manage NuGet Packages
  3. Search and install SPMeta2.CSOM.Foundation package
  4. Search and install SPMeta2.SSOM.Foundation package
  5. Add reference Microsoft.SharePoint.Client (v15)
  6. Add reference Microsoft.SharePoint.Client.Runtime (v15)

 

Step 4: Setup your definitions, model and provision service
Keep Reading More!

How to Create CSOM App in SharePoint 2013

To learn how to create a Client Side Object Model (CSOM) project solution in SharePoint 2013 app in visual studio 2013, do the following:

A provider hosted app is one way to go.  Autohosted is another.

You can select either of those options when you create a new app for SharePoint. With that you get a very simple template that already has some basic code calling back to SharePoint via CSOM.

There is a more advanced option as well. If you already have an existing Visual Studio solution with a SharePoint-hosted app and you’d like to continue using it:

  1. Add New Project
  2. Select the “Web” category
  3. Select any of the available web project types. e.g. MVC or Web Forms
  4. Select SharePoint App project
  5. Locate Web Project Property
  6. Select your new web project from the drop down

When you do that, VS will automatically reconfigure your app for SharePoint to an autohosted app and add TokenHelper.cs to the web project.

Installing NuGet in Visual Studio

Disclaimer: Acknowledgement on the content for this post was taken from NuGet site

Using the Visual Studio Extension Manager

In Visual Studio, click Tools and then Extension Manager. Naviging to Online, find the NuGet Package Manager extension and click Download.

Extension Manager showing NuGet

In the Installer dialog box, click Install.

Visual Studio Extension Installer

When installation is complete, close and re-open Visual Studio.

Visual Studio Extension Installer Complete

NuGet is now ready to use.

Updating NuGet in Visual Studio

You can update NuGet using the Visual Studio Extension Manager. Navigate to the Extension Manager and click on the Updates tab to check for updates.

If there is a new version of NuGet you will see it in the list of available updates.

Extension Manager showing a new version of NuGet available

Select NuGet in the list and click Update. When the update is complete, close and re-open all open instances of Visual Studio.

 

References

 

SharePoint 2013 Workflow Development for App Solutions

Below are some useful links about developing SharePoint 2013 Workflows.

Getting Started with using Visual Studio 2013 to developed workflow:

  1. Developing SharePoint 2013 workflow with VS introductory video
  2. Deploying first workflow with VS 2013 video
  3. Deploying approval workflow in SharePoint 2013 hosted app with VS 2013 video

Scripts for Workflow Deployment

How to find a way to use PowerShell or CSOM to upload and deploy a sandboxed workflow .wsp file?

  1. “Add-SPSolution” command is not available in SharePoint Online management shell. So, we cannot use PowerShell to update and deploy a solution in SharePoint Online environment. Meanwhile, here is index of Windows PowerShell for SharePoint Online cmdlets for your reference: http://technet.microsoft.com/en-us/library/fp161364.aspx

2. Used the helper class from CodePlex. The activation code is as follows below in CSOM:

SandboxSolutions.ActivateSolution(siteCollectionURl, cookies, “solution_name.wsp”);

3. Use PowerShell Script to deploy a Workflow WSP Sandbox  solution to the solution gallery. (You may find this link useful on how to deploy SPD WF with PowerShell script)

4. Alternatively, the manual way is to follow this steps.


MSDN:


Video:

  1. Tech Week 2014 SP2013 Workflow using SPD 2013  – http://www.theregister.co.uk/2014/06/03/webinar_creating_custom_workflows_for_sharepoint_2013/
  2. SP 2013 Workflow using SPD 2013 – https://www.youtube.com/watch?v=j4CU5UwtOBo
  3. Channel 9 – SharePoint 2013 Workflow Development for Apps and Solutions with VS 2012
  4. Channel 9 – SharePoint 2013 Workflow: Architecture & Configuration
  5. Developing SharePoint 2013 workflow in VS video – By Andrew Connell
  6. Start a FREE trail with Lynda.com –

Safari books online:

  1. Prof SP 2013 Development -Ch 15: WF Dev in SP 2013- https://www.safaribooksonline.com/library/view/professional-sharepoint-2013/9781118654965/xhtml/Chapter15.html
  2. SP2013 Unleashed – Ch 28: OOTB WF and SPD 2013 WF – https://www.safaribooksonline.com/library/view/sharepoint-2013-unleashed/9780133143416/ch28.html
  3. MS SP2013 step by step – Ch 11: Working with WF – https://www.safaribooksonline.com/library/view/microsoft-sharepoint-2013/9780735676527/ch11.html
  4. InfoPath with SP13 how to – Ch 11: Using forms in SP WF – https://www.safaribooksonline.com/library/view/infopath-with-sharepoint/9780133476125/ch11.html