IT tutorials
 
Applications Server
 

Developing, Integrating, and Building Applications in Sharepoint 2013 (part 5) - Data Integration

1/12/2014 8:57:36 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

2.3 Data Integration

At the heart of every application is data, which is typically what users want to work with within your application. SharePoint provides a number of out-of-the-box options for storing and working with data. These options fall into two categories:

  • Storing and manipulating data within SharePoint
  • Working with data that lives external to SharePoint

From the very first version of SharePoint, the goal has been to make working with data simple and straightforward for users. The simplest example of this is the concept of list data. Users are able to store and work with tabular style data via a common Web interface. Many see using lists analogous to using a table of data in a database. SharePoint applications can also take advantage of these same data storage capabilities natively. By using lists SharePoint offers developers the ability to take advantage of many of the data storage capabilities that SharePoint provides without having to reinvent the wheel. If used properly, SharePoint can save time and effort and potentially reduce the management and support costs of your operation.

At the core of the data storage capabilities within SharePoint are the following:

  • Lists: For storing structured data, much like in a table
  • Libraries: For storing unstructured data, such as in a document or file

SharePoint provides a comprehensive set of APIs for developers to use within applications to interact with and manipulate data that resides in SharePoint. For SharePoint applications those APIs are exposed in the Client-Side Object Model (CSOM).



To get a better feel for the data storage capabilities SharePoint provides, try out storing data in lists within SharePoint in the following exercise.


TRY IT OUT: Storing Data in SharePoint Using the Client-Side Object Model (DataIntegration.zip)

In this exercise you create new items in a SharePoint list using the CSOM API set. You must have completed the “Building Your First SharePoint Application” in the “App Parts and Pages” section before starting this example.
1. Ensure you have the MyFirstSharePointApp solution open in Visual Studio 2012.
2. If you haven’t already done so in a previous exercise create a new custom list in your site called My Custom List (choose Site Contents ⇒ Add an App ⇒ Custom List. Call it My Custom List and then click Create.)
3. Open the Default.aspx file under the MyFirstSharePointAppWeb project in Visual Studio.
4. Open the Default.aspx.cs file and replace the Button1_Click method with the following:
protected void Button1_Click(object sender, EventArgs e)
{
var contextToken = ((Button)sender).CommandArgument;
var hostWeb = Page.Request["SPHostUrl"];

using (var clientContext =
TokenHelper.GetClientContextWithContextToken(hostWeb, contextToken,
Request.Url.Authority))
{
Microsoft.SharePoint.Client.List list =
clientContext.Web.Lists.GetByTitle("My Custom List");

for (int i = 0; i < 10; i++)
{
ListItemCreationInformation itemCreateInfo =
new ListItemCreationInformation();
Microsoft.SharePoint.Client.ListItem newListItem =
list.AddItem(itemCreateInfo);
newListItem["Title"] = "New Item " + i.ToString();
newListItem.Update();
}

clientContext.ExecuteQuery();
}
}
5. Press F5 to package and deploy your application.
6. After the app deploys, add your app’s App Part to the homepage of your site by selecting Page ⇒ Edit ⇒ Insert ⇒ App Part. Select MyAppPart from the list, and then click Add.
7. Inside your App Part you should now see a button called Do Something. Click it. A ServerUnauthorizedAccessException error appears, as shown in Figure 15. This is because your application currently only has Read access to your SharePoint site. You need to modify your app’s permissions.

FIGURE 15

image
8. Click Stop Debugging in Visual Studio.
9. Double-click the AppManifest.xml file under MyFirstSharePointApp.
10. Under Permission Settings, add the following options:
  • Scope: List
  • Permission: Write
11. Press F5 to package and deploy your application.
12. Notice that SharePoint now asks you which list you want to allow it access to edit or delete items in. Select My Custom List from the drop-down menu. Click Trust It to continue.
13. You might need to re-add your App Part due to the change in app security settings.
14. Click Do Something in your App Part.
15. After the operation completes, open My Custom List in the SharePoint site. You should see that ten items have been added to the list, as shown in Figure 16.

FIGURE 16

image

How It Works
In this exercise you added list items to a SharePoint list. You configured your application to ask for permission to have edit rights on the list. SharePoint apps can ask for access to various security scopes of varying levels. Your application should only demand the permissions it needs to operate correctly. An app asking for too many permissions might make a user unwilling to grant them and therefore unable to use the app. Additionally, users cannot grant applications permission to resources that they themselves do not have appropriate access to.

NOTE You can read more about all the available permission scopes and rights on MSDN (http://msdn.microsoft.com/en-us/library/fp142383(v=office.15).aspx).


Additionally, SharePoint offers developers a range of mechanisms and APIs for integrating with data that lives outside of SharePoint. Although the data exists external to SharePoint, these APIs and features offer the ability to integrate with data much the same way you would with data stored inside SharePoint itself.

 
Others
 
- Developing, Integrating, and Building Applications in Sharepoint 2013 (part 4) - Events and Logic Integration
- Developing, Integrating, and Building Applications in Sharepoint 2013 (part 3) - User Interface Integration - Ribbon and Action Menus
- Developing, Integrating, and Building Applications in Sharepoint 2013 (part 2) - User Interface Integration - App Parts and Pages
- Developing, Integrating, and Building Applications in Sharepoint 2013 (part 1)
- Microsoft Lync Server 2013 Front End Server : Installing the Front End Role
- Microsoft Lync Server 2013 Front End Server : Installation - Topology Builder for Standard Edition Deployments
- Microsoft Lync Server 2013 Front End Server : Installation - Lync Server 2013 Topology Builder
- Microsoft Lync Server 2013 Front End Server : Active Directory Preparation
- Sharepoint 2013 : Understanding SharePoint app model architecture (part 7) - Working with app user-interface entry points - Building UI custom actions
- Sharepoint 2013 : Understanding SharePoint app model architecture (part 6) - Working with app user-interface entry points - Building app part
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us