SharePoint – Data ”; Previous Next In this chapter, we will be covering one of the most common tasks of SharePoint i.e. interacting with the various data sources such as lists or document libraries. A great thing about SharePoint is that you have a number of options available for interacting with data. Some examples are Server Object Model, Client-Side Object Model, REST services etc. Before you can do anything with SharePoint programmatically, you need to establish a connection and context with your SharePoint site. However, for this we need SharePoint on Premises, which can be installed on Window Server. You need to add reference in your project to Microsoft.SharePoint.dll or Microsoft.SharePoint.Client.dll. With the appropriate references added to your project, you can then begin to set the context and code within that context. Let us have a look at a simple example. Step 1 − Open Visual Studio and create a new project from File → New → Project menu option. Step 2 − Select Windows from Templates → Visual C# in the left pane and choose Console Application in the middle pane. Enter the name of your project and click OK. Step 3 − Once the project is created, right-click the project in Solution Explorer and select Add → References. Step 4 − Select Assemblies → Extensions in the left pane and check Microsoft.SharePoint in the middle pane and click OK. Now right-click the project again in Solution Explorer and select Properties. Step 5 − Click the Build Tab in the left pane and uncheck the Prefer 32-bit option. Step 6 − Now go back to the Program.cs file and replace it with the following code. using Microsoft.SharePoint; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SharePointData { class Program { static void Main(string[] args) { using (var site = new SPSite(“http://waqasserver/sites/demo”)) { var web = site.RootWeb; Console.WriteLine(web.Title); var lists = web.Lists; foreach (SPList list in lists) { Console.WriteLine(“t” + list.Title); } Console.ReadLine(); } } } } Note − In the above code first created a new SPSite object. This is a disposable object, so it is created within a using statement. The SPSite constructor takes in the URL to the site collection, which will be different in your case. The var web = site.RootWeb will get the root of the site collection. We can get the lists using web.Lists and print the title of the list items. When the above code is compiled and executed, you will see the following output − SharePoint Tutorials appdata Composed Looks Documents List Template Gallery Master Page Gallery Site Assets Site Pages Solution Gallery Style Library Theme Gallery User Information List Web Part Gallery Print Page Previous Next Advertisements ”;
Category: sharepoint
SharePoint – Server Object Model ”; Previous Next In this chapter, we will take a look at the SharePoint Server Object Model. You use the SharePoint Server Object Model when you are writing code that will run inside the context of SharePoint. Some common examples would be the code-behind in a page or a web part, event handlers behind a feature or a list, timer jobs etc. Features of Server Object Model Following are the key features of Server Object Model You can use the Server Object Model if you are programming an ASP.NET application inside the same application pool that is used by SharePoint. Server Object Model can be used if you are developing a client application such as console or Windows forms or a WPF app that will run on a SharePoint server. You cannot use the Server Object Model to connect remotely to a SharePoint Server. When you want to use the Server Object Model, you refer to the Microsoft.SharePoint assembly. There are other assemblies, which make up the Server Object Model, but Microsoft.SharePoint is the main one. The core types that you will use most commonly map to the components that you use as an end user, so things like site collections, sites, list, libraries, and list items are represented by the types SPSite, SPWeb, SPList, SPDocumentLibrary, and SPListItem. The type and the Server Object Model that represents a site collection is SPSite and the type that represents a SharePoint site in the Server Object Model is SPWeb. Therefore, when you go from the end user terms to the developer terms, you will just have to do that mental mapping. Now when you first start using SharePoint, it can be confusing because site is so overloaded and it means opposite things in the end user and developer vocabularies, not to mention the web vocabulary. Let us have a look at a simple example of Server Object Model. Step 1 − Open Visual Studio and create a new project from File → New → Project menu option. Step 2 − Select Windows from Templates → Visual C# in the left pane and choose Console Application in the middle pane. Enter the name of your project and click OK. Step 3 − Once the project is created, right-click the project in Solution Explorer and select Add → References. Step 4 − Select Assemblies → Extensions in the left pane and check Microsoft.SharePoint in middle pane and click Ok button. Now right-click again the project in Solution Explorer and select Properties. Step 5 − Click the Build Tab in the left pane and uncheck the Prefer 32-bit option. Step 6 − Now go back to the Program.cs file and replace it with the following code. using Microsoft.SharePoint; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SharePointData { class Program { static void Main(string[] args) { using (var site = new SPSite(“http://waqasserver/sites/demo”)) { var web = site.RootWeb; Console.WriteLine(web.Title); var lists = web.Lists; foreach (SPList list in lists) { Console.WriteLine(“t” + list.Title); } Console.ReadLine(); } } } } Note − In the above code first created a new SPSite object. This is a disposable object, so it is created within a using statement. The SPSite constructor takes in the URL to the site collection, which will be different in your case. The var web = site.RootWeb will get the root of the site collection. We can get the lists using web.Lists and print the title of the list items. When the above code is compiled and executed, you will see the following output − SharePoint Tutorials appdata Authors Composed Looks Contacts Course Documents Courses Documents List Template Gallery Master Page Gallery Site Assets Site Pages Solution Gallery Style Library Theme Gallery User Information List Web Part Gallery You can see that these titles are Solutions Gallery, the Style Library, Form Templates. These are lists that are used internally by SharePoint. Therefore, instead of displaying all the lists, maybe you only want to show the lists that the users would normally see. Hence, instead of getting the entire list collection, we want to get all the lists that are not hidden. We can do that using a link query as given below. using Microsoft.SharePoint; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ServerObjectModel { class Program { static void Main(string[] args) { using (var site = new SPSite(“http://waqasserver/sites/demo”)) { var web = site.RootWeb; Console.WriteLine(web.Title); var lists = from SPList list in web.Lists where list.Hidden == false select list; foreach (SPList list in lists) { Console.WriteLine(“t” + list.Title); } Console.ReadLine(); } } } } When the above code is compiled and executed, you will see the following output − SharePoint Tutorials Authors Contacts Course Documents Courses Documents Site Assets Site Pages Style Library You can see that this will give us back all the lists that are not hidden. Let us have a look at another simple example in which we will also display some information about the list items. using Microsoft.SharePoint; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ServerObjectModel { class Program { static void Main(string[] args) { using (var site = new SPSite(“http://waqasserver/sites/demo”)) { var web = site.RootWeb; Console.WriteLine(web.Title); var lists = from SPList list in web.Lists where list.Hidden == false select list; foreach (SPList list in lists) { Console.WriteLine(“t” + list.Title); var items = list.Items.OfType<SPListItem>().Take(5); var isDocLib = list is SPDocumentLibrary; foreach (SPListItem item in items) { var value = isDocLib ? item.Name : item.Title; Console.WriteLine(“tt” + value); } } Console.ReadLine(); } } } } When the above code is compiled and executed, you will see the following output − SharePoint Tutorials Authors Muhammad Waqas Mark Upston Allan Bommer Andy Onian Contacts Waqas Upston Bommer Course Documents Sample1.docx Sample2.docx Sample3.docx Courses SharePoint Tutorials C# Tutorials ASP.Net Tutorials NHibernate Tutorials Documents Site Assets Site Pages Home.aspx How To Use This Library.aspx Style Library List Data When you first create a list, it always has a title column.
SharePoint – Packaging & Deploying ”; Previous Next In this chapter, we will be covering packaging and Deploying of SharePoint solution. The first step in the deployment of a SharePoint solution is the creation of a Solution Package. A Solution Package is a CAB file with WSP extension, which contains all the files required to implement the Features in your Visual Studio project. The files required to implement the Features include − The feature manifest. Any element manifests. The dll, which contains the compiled managed code. Associated files like web pages, user controls, and web paired files. Another file contained in the solution package is the solution manifest. The solution manifest is a catalog of the files contained in the package. For Farm solutions, it also contains deployment instructions. Just like with the Feature manifest, Visual Studio automatically creates and maintains the solution manifest as you modify your project. You can see the solution manifest using the solution designer. In addition to creating and maintaining the solution manifest, Visual Studio is also automatically creating the solution package for our project. It does this behind the scenes every time you deploy your work for debugging. The generated solution package is placed in the same folder as the dll, so that will be the bin debug or the bin release folder. To view the contents of this file in Windows Explorer, just change the extension from WSP to CAB and then doubleclick on the file. Let us have a look at a simple example in which we will examine the solution packages associated with the SharePoint solution projects we have created in the previous chapter. Let us start with the features and elements project we have created earlier. As you know that in the project, we have one Feature, called Sample. This Feature references three element manifests Contacts, SitePage, and Action. You can also see that Action has the Element manifest, Contacts has its Element manifest, SitePage has the Element manifest, and a web page, which provisions this web page into the site. Hence, we should expect the solution package to contain the Feature manifest, the three Element Manifests, the web page and also the assembly that is created when we build the project. Step 1 − Right-click on your project in solution explorer and choose Open Folder in File Explorer. Step 2 − Go to bin and open the Debug folder. You will see the solution package. Step 3 − Make a copy of it and then change the extension of the Copy file from wsp to cab. Step 4 − Now double-click the cab file to open it and you will see the files. You will see the Feature manifest, three Element manifests, the aspx page, the dll, and one additional file, which is the Solution manifest. Step 5 − In the Solution Explorer, you will see a folder called Package and if you expand it, you will see a file called Package.package. Double-click that file and you will see the solution designer. This designer is showing that currently there is only one feature in the Solution and that feature references three Element manifests, Contacts, SitePage, and Action. This designer is an editor of an XML document just like feature designer. The solution manifest for this proxy is simple. It just indicates that here is an Assembly that needs to be deployed called FeaturesandElemenest.dll and we will be deploying that to the GlobalAssemblyCache. It also indicates we have one feature with this Feature Manifest. If we navigate back to the Feature and look at its Manifest, it indicates there are the three Element manifest, and our aspx page. Farm Solution Deployment Now that we know, what solution packages are and what they contain, we need to learn how to deploy them. To deploy a Farm solution, you give the solution package created by Visual Studio to your SharePoint administrator. They will use either PowerShell or Central Administration or a combination of both tools to deploy the package. Let us look at Farm solution deployment. Step 1 − Go to Features and elements in Visual Studio project. This project has one feature with three Elements. When you deploy a Farm solution, the contents of the solution are copied into the SharePoint system folders as shown below − Step 2 − Now let us go to the List Designer and then change the Title to Contacts-Change 1 and then click the Save button. Step 3 − Now go to the project properties and then select SharePoint in the left pane. In the Active Deployment Configuration option, choose the Default option from the dropdown list. Step 4 − In Solution Explorer, right-click the project and choose Deploy. Once the deployment is finished, refresh your site and you will see the change. Print Page Previous Next Advertisements ”;
Site Column & Content Types
SharePoint – Site Column and Content Types ”; Previous Next In this chapter, we will be covering the Site Columns. So far, we have been defining the list and library schemas on the lists and libraries themselves, but these are not reusable. Therefore, if you want to have two lists with the same schema, we would have to define the same schema twice. SharePoint has a solution for this, which is Site Columns and Content Types. Site Columns define reusable column definitions and Content Types, which are made up of Site Columns, define reusable schemas for both lists and libraries. In addition to defining schema, you can also attach workflows and event handlers to a Content Type. Site Columns and Content Types are stored in galleries at the site level and they are available to be used within that site and any of its children. If you declare a Site Column or a Content Type in a child site, it is only available in the branch underneath that. Unless there is a specific reason not to do so, the common practice is to declare your Site Columns and Content Types in the site collection root and that way they are available across the entire site collection. Now let us have a look at a simple example in which we will create and use Site Columns and Content Types. We have already seen Content Types, although it may not have been obvious Step 1 − Go to our Contacts list through Site Contents. Step 2 − If you scroll down, you will see a section called Columns. Step 3 − Go up to Advanced Settings. Select Yes for Allow Management of Content Types, and click OK. You will see that we have a new section here called Content Types. This indicates that this list is based on the Contact Content Type. Step 4 − Go to Site Settings. Step 5 − Under Web Designer Galleries, click Site Content Types. Step 6 − Scroll down the page and you will find the Contact Content Type, which is right there under List Content Types and then click the Contact link. Step 7 − If you take a look at the columns then you will see that it matches the columns in our list. Basically, when you create a list of the Contacts list template, it associates this content type with the list and that is why you get all of these fields. Now the fields here that make up the definition of a Content Type are known as Site Columns. To see the Site Columns, let us go to Site Settings and select Site Columns under Web Designer Galleries, Step 8 − You can see the columns that are associated with Contacts. So let us explore this a little bit further by creating our own custom site column and our own custom content type and then using those in lists. In our Course Documents Library, we have a column for the course and we defined this column in the library itself. Step 9 − Maybe while building out your site, you realize that you want to have a course column in a few lists and libraries and you want to reuse that definition. Hence, what we can do is create the course column as a site column and then use it in different lists and libraries. Let us go to the Site Column from the Site Settings. Step 10 − Click the Create link. Step 11 − Name this as the Course column and it will be a lookup field. Step 12 − Put this into a group called “SharePoint Basics” so that we can find it easily later. It will look up on the Courses list, and the field we want to look up is the Title. Click OK. Step 13 − You will see that a new group SharePoint Basics is created. Step 14 − Our new site column is created in the “SharePoint Basics” group. Step 15 − Let us go back to Course Documents and then go to the Library Settings. Go to Columns. Remove the Course column, which we created in the library itself. Step 16 − Let us add the new course column from the site columns. Therefore, instead of clicking Create Column, click Add from existing site columns. Step 17 − Change the group to “SharePoint Basics” and Select Course on the left side. Click Add to add that column to the list and then click OK. Step 18 − Let us go back to Course Documents. Step 19 − You can see our new Course column, but it is empty because the information that was here previously was deleted when we deleted the original course column. Hence, let us add that back as shown below. If this list had hundreds of items, it would turn a task that could take hours into a task that could take minutes. Content Types In this section, we will take a look at creating a custom content type. Step 1 − Let us go to the Site Settings, and then go to Site Content Types. Click the Create link. There are two key things to consider here when we are creating a content type. The first is that all content types are based on another content type or you could think of it as all content types inherit from another content type. The second is that a content type will either work with lists or it will work with libraries. Whether it works with lists or libraries depends on the type you inherit from. For example, if we want to create a custom contacts list, we would go to the List Content Types and then find Contact. We would create the content type, add things we need that were not already part of Contact, or remove things that were part of Contact that we do not want. One strategy you can use while creating content
SharePoint – Azure Platform
SharePoint – Azure Platform ”; Previous Next In this chapter, we will be covering the Microsoft Azure Platform. Microsoft Azure is Microsoft’s cloud platform technology, which is in itself a very powerful technology. It is not just a place to deploy your code, but it is a whole set of services exists that you as a developer can use in your SharePoint solution development. Cloud Computing To understand Microsoft Azure, you must first know a bit about the cloud. Cloud computing is all about leveraging the Web as a set of resources for the development and deployment of your solutions. Traditionally, cloud computing has been defined as categories of services. They are − Infrastructure as a Service (IAAS) Platform as a Service (PAAS) Software as a Service (SAAS) Each one of these categories is different in the context of development. For instance, you might think − IAAS as hosted virtual machines (VMs) you manage remotely. PAAS as where you deploy code, data, binary large objects (BLOBs), web apps, and other application artifacts to a cloud-based environment (such as Windows Server 2012 R2 and IIS). SAAS as subscription-based services that you can sign up to use, for example, Office 365. Although these three categories of services dominate the way in which the cloud is characterized, the cloud has four generally accepted pillars − Pool resources with other cloud users. Manage your own services and apps through the management portal. Apps and services can grow and contract with your business needs. Pay for only what you use in regards to the cloud. Azure Platform Overview The Microsoft Azure platform is composed of many different services. You can leverage them in your application design, deployment, and management such as Data, Service, and Integration, which is the Client layer in any application that consumes the services within Microsoft Azure. Data Layer In Data layer there are number of different types of data storage mechanisms or features that map directly to data storage which contains both non-relational and relational. Non-relational Feature The non-relational storage features enable you − To store assets such as virtual machine images or images or videos in Blobs Create non-relational tables Manage message queues along a service bus, and manage data caching in your distributed applications Relational Feature The relational data features are as follows − The core Azure SQL Database, which is the cloud version for the on-premises SQL Server Reporting services (SQL Reporting) The ability to stream near real-time data streams from data transactions (Stream Insight) Services Layer The Services layer contains a number of default services that you can use when building your solutions, ranging from Media Services to core Cloud Services such as − Creating websites Worker role classes Leveraging Hadoop on Microsoft Azure to process Big Data requests For many of these services, you can use baked-in functionality and a set of APIs within your application. For example, if you want to build a multimedia learning solution, you could leverage the Media Services − To upload WMVs Transcode them to MP4s Save them to BLOB storage Create a public URL for access and then stream them from Microsoft Azure Integration Layer The Integration layer contains some fundamental services such as − Geo-replicated content delivery network (CDN) Traffic Manager Virtual Private Network, which enables you to connect a virtual machine to your on-premises system Workflow and business process and integration services All of these capabilities enable you to integrate systems or secure them. Azure Apps Microsoft Azure is not just about services. Azure is an ever-evolving cloud platform that has a set of tools and SDKs that enable you to get started with the developing of cloud applications quickly. To start with Microsoft Azure you need the following − Visual Studio latest Microsoft Azure subscription Microsoft Azure subscription Step 1 − Let us have a look at a simple example in which we will deploy our web application to Microsoft Azure by creating a new ASP.NET MVC application. Step 2 − Click Ok and you will see the following dialog box. Select MVC template, check Host in the Cloud checkbox and then click OK. Step 3 − When the Configure Microsoft Azure Web App Settings dialog appears, make sure that you are signed in to Azure. If you are not signed in, then first sign in. You can see the default name, but you can change the Web App name. Step 4 − Enter the desired information as shown below. Select Create new server from the Database server dropdown list. Step 5 − You will see the additional field. Enter the Database server, username and password and click Ok. Once the project is created, run you application and you will see that it is running on localhost. Step 6 − To deploy these applications to Azure, right-click on the project in solution explorer and select Publish. Step 7 − You will see the following dialog box. Click the Microsoft Azure Web Apps. Step 8 − Select your application name from the Existing Web Apps and click OK. Step 9 − Click the Validate Connection button to check for the connection on Azure. Step 10 − Click Next to continue. Now you will see that the connection string is generated for you already, by default. Step 11 − Click Next to continue. Step 12 − To check all the files and dlls, which we will be publishing to Azure, click Start Preview. Step 13 − Click Publish to publish your application. Once the application is successfully published to Azure, you will see the message in output window. You will also see that your application is now running from the cloud. Now let us go to the Azure portal again and you will see the app here as well. SharePoint Apps and Microsoft Azure SharePoint and Microsoft Azure are two sizeable platforms unto themselves. SharePoint is one of Microsoft’s leading server productivity platforms or the collaborative platform for the enterprise and the Web. Microsoft Azure
SharePoint – APIs
SharePoint – APIs ”; Previous Next In this chapter, we will be covering the several sets of APIs to access the SharePoint platform. The selection of APIs depend upon the following different factors − Application type Developer existing skills Device on which the code runs Application Type There are different types of applications such as − SharePoint Add-in Web Part on a SharePoint page Silverlight application running on either a client computer or a client mobile device ASP.NET application exposed in SharePoint JavaScript running in a SharePoint site page SharePoint application page Microsoft .NET Framework application running on a client computer Windows PowerShell script Timer job running on a SharePoint server Developer Existing Skills You can easily create applications in SharePoint if you already have experience in any of the following programming models without needing to learn a lot about SharePoint programming − JavaScript ASP.NET REST/OData .NET Framework Windows Phone Silverlight Windows PowerShell Device on Which the Code Runs The device on which the code runs can be any of the following − Server in the SharePoint farm. An external server such as a server in the cloud. A client computer and a mobile device. The following table provides guidance for different set of APIs, which can be used for a selected list of common SharePoint extensibility projects. S.No. API & Usage 1 .NET Framework client object model, Silverlight client object model, REST/OData endpoints Create an ASP.NET web application that performs CRUD operations on SharePoint data or external data that is surfaced in SharePoint by a BCS external content type, but does not have to call SharePoint across a firewall. 2 REST/OData endpoints Create a LAMP web application that performs CRUD operations on SharePoint data or external data that is surfaced in SharePoint by a BCS external content type. Create an iOS or Android app that performs CRUD operations on SharePoint data. 3 Mobile client object model Create a Windows Phone app that performs CRUD operations on SharePoint data. 4 Mobile client object model and the server object model Create a Windows Phone app that uses the Microsoft Push Notification Service to alert the mobile device of events in SharePoint. 5 .NET Framework client object model Create a .NET Framework application that performs CRUD operations on SharePoint data. 6 Silverlight client object model Create a Silverlight application that performs CRUD operations on SharePoint data. 7 JavaScript client object model Create an HTML/JavaScript application that performs CRUD operations on SharePoint data. Create an Office Add-in that works with SharePoint 8 Server object model Create a custom Windows PowerShell command. Create a timer job. Create an extension of Central Administration. Create consistent branding across an entire SharePoint farm. Create a custom Web Part, application page, or ASP.NET user control. Print Page Previous Next Advertisements ”;
SharePoint – Capabilities
SharePoint – Capabilities ”; Previous Next In this chapter, we will be covering the default set of capabilities (or features) built into SharePoint that enables you to take advantage of the platform without doing any development. You can use or extend these core capabilities when building your Apps. Microsoft has historically referred to these capabilities as workloads. These workloads provide a way to talk about the different capabilities of SharePoint coming together. You should see these workloads as representing not only a core set of related applications but also as opportunities for your application development. Following are the workloads, which were added in SharePoint 2010 − Sites − Representing the different types of sites available for use and the features within these sites. Communities − Representing the community and social features such as blogs and wikis. Content − Representing core enterprise content management features. Search − Representing the search-driven features. Insights − Representing business intelligence features such as KPIs. Composites − Representing the ability to integrate external applications by using, for example, Business Connectivity Services. SharePoint 2013 – Capabilities In SharePoint 2013, Microsoft has extended the capabilities to add more features and provide tighter integration. Following are the core capabilities for SharePoint 2013 − Capability Native Features Example Extensibility Sites Sites is where you will find the collaborative aspects of SharePoint. Sites contain an abundance of features, including the capability to create, store, and retrieve data, and manage, tag, and search for content, documents, and information. You also have connectivity into the Microsoft Office 2013 client applications through the list and document library. Sites, site templates, Apps for SharePoint, workflow, master pages, site pages Social Provides social and social networking capabilities, newsfeeds, and profile searching and tagging, along with the capability to search, locate, and interact with people through their skills, organizational location, relationships, and rating of content. Search customization, rating and tagging capabilities, blogs, wikis, metadata tags Content Contains the capability to explore, search, and manage content using Web pages, apps, workflow, or content types. Apps for SharePoint, workflows, Word or Excel Services Search The ability to search content inside and outside of SharePoint in a rich and dynamic way with real-time document views through Office Web Apps. In addition, the integration of information in structured database systems and on-premises or cloud-based LOB systems such as SAP, Siebel, and Microsoft Dynamics. SharePoint Search, Search customization, Business Data Connectivity (BDC) Insights Predominantly about BI and support, for example, the capability to integrate Microsoft Access into SharePoint; leverage Excel and SQL Server to access and display data on a Web page; enable the use of dashboards and key performance indicators (KPIs) to transform raw data into actionable information. Excel Services, Access Services, dashboards, BDC, PerformancePoint Services Interoperability Ranges from LOB integration to Office integration, through the new Apps for Office application model; (think HTML and JavaScript-fueled custom task panes that link to cloud services instead of VSTO managed code add-ins) to custom solution development. BDC, Apps for Office, custom development Branding Changing the look and feel of your site through built-in template changes or more detailed and organizationally driven branding. Out of the box configuration, master pages and customized Apps for SharePoint Print Page Previous Next Advertisements ”;
SharePoint – Central Administration ”; Previous Next In this chapter, we will be covering the high-level introduction of SharePoint Central Administration. Central Administration is the place where you can perform administration tasks from a central location. As we have already signed up for an Office 365, so we also have an administration site. Open the URL https://portal.office.com/ in the browser. Step 1 − Select the Admin icon. Step 2 − Now select Admin centers → SharePoint in the left pane. The following page will open. You can see a variety of site collection administration features and manage the following activities − Application management Monitoring Security General application settings System settings Backup and restore Upgrade and migration Configuration wizard Apps Application Management In Application Management, you can perform tasks like creating new web applications and site collections. You can manage the services that are installed on your SharePoint site such as Word, Excel or BCS and manage your content database. You can also perform tasks like modifying the properties of the content database, activating features, and creating new site collections etc. Monitoring Monitoring is the central place wherein you can manage reporting, monitoring, and the status of your SharePoint site. The Monitoring site is divided into three areas, which are as follows − Health Status − You can see the status of different services on your SharePoint Server. Timer Jobs − You can define the specific jobs and decide when to run them. Reporting − A set of tools that enables you to create and manage reports, run diagnostic logging, and view reports on various server-side activities. Security Security settings is all about the security in the main browser UI, where the users and the site administrators can assess specific permissions that relate to users for their sites. Security covers many areas such as − Management of administrator accounts Configuration and management of service accounts. Management of password change settings and policies. Specifications of authentication providers, trusted identity providers. Antivirus settings. Blocked file types. Self-service security. Secure token services. General Application Settings In General Application Settings, you can configure a number of general options for your SharePoint site collections and sites such as send mail to users. You can also manage a number of deployment and approval options such as content deployment location and approvers of that content. In general, think of this site as the generic settings for your SharePoint sites. System Settings You can configure server-centric settings such as farm-level or access features, or even manage the services like Excel and Word Services, which are available to the users of the site collection. You manage these types of settings from within the System Settings site. Backup and Restore Sometimes, you might need to backup and restore your SharePoint site. The backup and restore feature enables you to create and schedule regular backups for your SharePoint, perform ad hoc backups, restore from a previously backed-up SharePoint site etc. Upgrade and Migration Sometimes, you might want to upgrade from one version of SharePoint to another version such as moving from SharePoint Standard to SharePoint Enterprise. This requires a license and some facility to upgrade the server. This type of activity can be done in the Upgrade and Migration section of the Central Administration site. You can also install service patches, check on installation, and upgrade progress from within this part of the administration toolset. Configuration wizard It is simply a step-by-step wizard that configures SharePoint Server for you. You should have seen this wizard when you first installed SharePoint. However, you can run it again after installation to change some of the configurations on your SharePoint server. Apps Apps is a new category within the Central Administration site that enables you to manage different facets of the apps that are installed on your SharePoint instance. For example, you can use Apps to manage the licenses, ensure that apps are running and performing in an error-free way, and also manage the App Catalog. Print Page Previous Next Advertisements ”;
SharePoint – App Model
SharePoint – App Model ”; Previous Next In this chapter, we will be covering the SharePoint deployment App models. Since, SharePoint is moving towards the cloud, the following deployment models are available to use Apps for SharePoint − SharePoint-hosted Autohosted SharePoint-hosted App The SharePoint-hosted deployment type represents a way to deploy client-side, lightweight apps to SharePoint. The easiest way to think about the SharePoint-hosted App as an application that has no server-side code. The key features of SharePoint-hosted App are − It is an application made up of static application files or pages that reside on your SharePoint like HTML and JavaScript files that enable client-side coding. When users access the SharePoint-hosted App, they are redirected to the page that contains your application. The SharePoint-hosted deployment type is good for lighter-weight Apps such as branded list views, media apps, or weather apps. If you decide to leverage the SharePoint-hosted deployment model, then you are limited to the code that does not run on the server. You can use Silverlight with SharePoint and take advantage of HTML along with JavaScript. Let us have a look at a simple example of SharePoint-hosted application. Step 1 − Open Visual Studio and select the File → New → Project menu. Step 2 − In the left pane select Templates → Visual C# → Office/SharePoint and then in the middle pane select App for SharePoint. Enter the Name in the Name field, Click OK and you will see the following dialog box. In the New App for SharePoint, we need to add the SharePoint site URL that we want to debug and then select the SharePoint-hosted model as the way you want to host your app for SharePoint. Step 3 − Go to the SharePoint admin center and copy the SharePoint URL. Step 4 − Paste the URL in the New App for SharePoint dialog box as shown below. Step 5 − Click Next and it will open the Connect to SharePoint dialog box where we need to login. Step 6 − Enter your credentials and click the Sign in button. Once you are successfully logged in to the SharePoint site, you will see the following dialog box − Step 7 − Click Finish. Once the project is created, click the AppMenifest.xml file in the Solution Explorer. Step 8 − Click the Permissions tab. A Scope dropdown list will open. Step 9 − In the Scope dropdown list, select Web, which is the scope of permissions that you are configuring. In the Permission drop-down list, select Read, which is the type of permission you are configuring. Step 10 − Open the Default.aspx file and replace it with the following code. <%– The following 4 lines are ASP.NET directives needed when using SharePoint components –%> <%@ Page Inherits = “Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version = 15.0.0.0, Culture = neutral, PublicKeyToken = 71e9bce111e9429c” MasterPageFile = “~masterurl/default.master” Language = “C#” %> <%@ Register TagPrefix = “Utilities” Namespace = “Microsoft.SharePoint.Utilities” Assembly = “Microsoft.SharePoint, Version = 15.0.0.0, Culture = neutral, PublicKeyToken = 71e9bce111e9429c” %> <%@ Register TagPrefix = “WebPartPages” Namespace = “Microsoft.SharePoint.WebPartPages” Assembly = “Microsoft.SharePoint, Version = 15.0.0.0, Culture = neutral, PublicKeyToken = 71e9bce111e9429c” %> <%@ Register TagPrefix = “SharePoint” Namespace = “Microsoft.SharePoint.WebControls” Assembly = “Microsoft.SharePoint, Version = 15.0.0.0, Culture = neutral, PublicKeyToken = 71e9bce111e9429c” %> <%– The markup and script in the following Content element will be placed in the <head> of the page –%> <asp:Content ID = “Content1” ContentPlaceHolderID = “PlaceHolderAdditionalPageHead” runat = “server”> <script type = “text/javascript” src = “../Scripts/jquery- 1.6.2.min.js”></script> <link rel = “Stylesheet” type = “text/css” href = “../Content/App.css” /> <script type = “text/javascript” src = “../Scripts/App.js”></script> </asp:Content> <asp:Content ID = “Content2” ContentPlaceHolderID = “PlaceHolderMain” runat = “server”> <script type = “text/javascript”> function hello() { var currentTime = new Date(); $get(“timeDiv”).innerHTML = currentTime.toDateString(); } </script> <div id = “timeDiv”></div> <input type = “button” value = “Push me!” onclick = “hello();” /> </asp:Content> Step 11 − Go to the Solution explorer, right-click the project and select Publish. Click the Package the app button. This builds your SharePoint-hosted app and prepares it for you for deployment to your SharePoint site. You will see the following folder, which contains the *.app file. Step 12 − Navigate to your SharePoint online site. Step 13 − Click Apps for SharePoint in the left pane. A new page will open. Step 14 − Drag your files here to upload. Once the file is uploaded, you will see the following page − Step 15 − Click the option – Site Contents in the left pane. Click the add an app icon as shown in the following screen shot − A new page will open. Step 16 − Select Your Apps → From Your Organization in the left pane and you will see that the app is available for installation. Click the app. Step 17 − When you click the app, a dialog box opens as shown in the following screen shot. Click Trust it. Step 18 − You will see that the app is installed. Once the installation is complete, you can click the app. You will see the following page, which contains one button − When you click the Push me button, it will display the current date. Autohosted The Autohosted deployment model is a significant departure from previous SharePoint applications. In this model, you build Apps for SharePoint, but the code is seamlessly deployed to Windows Azure in the background, so SharePoint automatically creates the cloud-hosted app for you. The important features are − It looks like it is running on SharePoint, but in the background it is actually deployed to a special Office 365 Windows Azure instance and registered as an authenticated and authorized App with SharePoint. You do not have complete access to the entire platform capabilities of the Windows Azure platform with the Autohosted deployment model, but you do have enough of the platform to build some interesting applications. Let us have a look at a simple example of Autohosted by creating a new project.