Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Archive for April, 2015

App Errors

Posted by Paul on April 25, 2015

In this post we can consolidate all the possible errors that can occur during App development.

Error 1

To interact with SharePoint projects in Visual Studio, your system user account must have administrator privileges.

Error 2

Error occurred in deployment step ‘Uninstall app for SharePoint’: Only users who can View Pages can list Apps.

Solution

Please ensure the App User (current user) is given appropriate permissions as per this post.

http://www.jeanpaulva.com/index.php/2015/04/24/app-user-permissions/

Advertisements

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »

App Development Steps (end-to-end)

Posted by Paul on April 25, 2015

In this post we can see the pre-requisites for App Development using Visual Studio 2013 for a SharePoint 2013 On-Premise installation.

Pre-Requisites

Following are the pre-requisites for App Development.

  1. Install SharePoint 2013 link
  2. Promote as Domain Controller link
  3. Configure App Service Applications link
  4. Configure Subscription Service link
  5. Manage App Catalog link
  6. Configure Zone link
  7. Create App User link
  8. Configure App User Permissions link

Once the above steps are performed, you can try create SharePoint Hosted App Or Provider Hosted App following the steps below.

SharePoint Hosted App

  1. Install Visual Studio 2015 link
  2. Create SharePoint Hosted App link
  3. Test SHA link

Provider Hosted App

  1. Create Certificate link
  2. Export Certificate link
  3. Sign Certificate link
  4. Create Provider Hosted App link
  5. Test PHA link

Summary

In this post we have explored on how to setup a machine for App Development.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , , | Leave a Comment »

SharePoint Hosted App

Posted by Paul on April 24, 2015

In this article we can quickly create a SharePoint Hosted App on SharePoint 2013 On-Premises.

About SharePoint Hosted App

SharePoint Hosted App (SHA) will have all components deployed to SharePoint server. Optionally there can be JavaScript components running in the client side.

App Pre-Requisites

You should have the following pre-requisites done to create a SharePoint Hosted App.

http://www.jeanpaulva.com/index.php/2015/04/25/app-development-pre-requisites/

Steps

Open Visual Studio 2013 in Administrator mode. Choose New Project > SharePoint > App for SharePoint 2013 option as shown below.

image

In the next dialog choose the SharePoint-hosted app option.

image

You will get the following items created in Solution Explorer.

image

Examining the Content

The Page default.aspx is the main page.

image

The page displays a Hello message with the current user name. The current user name is displayed using a JavaScript which you can find in the App.js.

image

References

https://msdn.microsoft.com/en-us/library/office/fp179930.aspx

Summary

In this article we have seen how to create a SharePoint Hosted App.

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »

App User Permissions

Posted by Paul on April 24, 2015

In this post we can explore how to configure App User Permissions.

image

App User should not be System Account.  If you have not created an App User, you can follow the post below to create one.

http://www.jeanpaulva.com/index.php/2015/04/20/create-app-user/

Farm Administrator Permission

Login as Administrator to the machine. Open Central Administration > Farm Administrators.

image

Add App User to the group.

image

Site Collection Administrator Permission

Login as Administrator to the SharePoint site. Open Site Settings > Site Permissions.

image

Add the App User to the group.

image

Click Ok to save changes.

Database Owner Permission

Login as Administrator to the machine. Open SQL Server Management Studio. Create a new Login for App User.

image

Once the user is created, open the user properties > User Mapping section and assign db_owner permission on all SharePoint databases. You need to select each database and check the db_owner property. Once you checked for all the databases Click the Ok button to save changes.

image

 

Summary

In this post we have explored how to configure App User Permissions.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

Create App User

Posted by Paul on April 20, 2015

In this article we can see how to create an app user.

App User

Separate App User is required for development purposes. We cannot use the SharePoint System Account for App Installations as it will run in high-permission mode.

Create User

Open Active Directory Users & Computers to create the new user.

image

In the appearing application, choose the New User as following.

image

Enter the user information.

image

Click the Next button. Enter the password and you may choose to use the Password never expires option.

image

Click the Finish button in the next page.

Give Access

Open Control Panel > Users > Give other users access to this computer.

image

In the next tab choose Administrator option.

image

In the next page click the Finish button.

Now the user is created & assigned permission to the computer. You can test by logging in as the new user.

Summary

In this post we have created an App User.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

Ensure Services are Running

Posted by Paul on April 15, 2015

SharePoint Apps requires the following Services to be running:

  1. App Management Service
  2. Subscription Service

Ensure Services are Running

You can open Central Administration > Manage Services link as shown below.

image

In the appearing page, ensure the following services are Started.

image

image

If they are not started, click the Start link to start them.

Note: If any of the services are not running, you will get the following error message.

“The Subscription Settings service and corresponding application and proxy needs to be running in order to make changes to these settings”

image

Posted in SharePoint, SharePoint 2013 | Tagged: , , , , | Leave a Comment »

SharePoint Server 2013 Search Features

Posted by Paul on April 14, 2015

In this post we can quickly explore the SharePoint 2013 Search features for the Server edition.

Search by Metadata

Additional to Search by Content, SharePoint provides search on Enterprise keywords & Managed Metadata

Refiners

Search Refiners provides quick filtering of search results using common properties. Search Refiners are displayed in the left pane of the search results page.

Query Suggestions

This feature provides automatic suggestions based on the query string.

Promoted Results

Search Administrator can promote results based on keywords.

KQL

Keyword Query Language provides advanced syntax & filtering for query construction.

Search Scopes

Search Scopes allows limiting the search content boundary within a site or site collection.

Search Verticals

Allows filtering of search results by:

1. Everything

2. People

3. Conversations

4. Videos

We can also create custom search verticals.

Result Sources

Result Sources allow to configure external content sources like another SharePoint site, External web site, Federated Bing search etc.

Document Preview

Document Preview allows previewing of Office documents within the search results.

Continuous Crawl

Continuous Crawl enables fresh content to appear in search results.

Display Templates

Allows custom formatting of search results.

Summary

In this article we have explored the Search features in SharePoint 2013 Server edition. I believe this will be serve as a quick-reference in SharePoint world.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , | Leave a Comment »

Create Hierarchical Data Store

Posted by Paul on April 12, 2015

In this article we can explore how to create a Hierarchical Data Store in SharePoint 2013.

Hierarchical Data Store

SharePoint 2013 allows Hierarchical Data Storage using the SPPersistedObject class. Hierarchy means we can store key/value pairs using parent/child hierarchy.

Hierarchical Data Store allows global storage and thus a solution spanned to multiple-sites can store common data without the need to remember the location.

image

Example

Step 1: Create Project

Create a Farm Solution and add a Visual Web Part into it.

image

Step 2: Create Class

Create a class as following.

namespace HierachicalObject_WebPart

{

[Guid(“0A93ED9E-04DB-4754-B463-C91E542D1308”)]

public class MyAppSettings : SPPersistedObject

{

public MyAppSettings()

{

}

public MyAppSettings(string name, SPPersistedObject parent)

: base(name, parent)

{

}

public MyAppSettings(string name, SPPersistedObject parent, Guid id)

: base(name, parent, id)

{

}

[Persisted]

private string _databaseName;

public string DatabaseName

{

get { return _databaseName; }

set { _databaseName = value; }

}

protected override bool HasAdditionalUpdateAccess()

{

return true;

}

}

}

The class does the following:

1. Specifies 2 constructors

2. Create 1 property

3. Mark 1 field for Persistence

4. Enable Override for Data update

Step 3: Save & Load Code

Create 2 buttons on the visual web part and add the following code on their click events.

protected void Button1_Click(object sender, EventArgs e)

{

MyAppSettings myapp = new MyAppSettings(“MyAppSettings”, SPFarm.Local);

myapp.DatabaseName = TextBox1.Text;

myapp.Update(true);

}

protected void Button2_Click(object sender, EventArgs e)

{

SPSite site = SPContext.Current.Site;

MyAppSettings myapp = SPFarm.Local.GetChild<MyAppSettings>(“MyAppSettings”);

Label1.Text = myapp.DatabaseName;

myapp.Delete();

}

Step 4: Test the Code

You can run the solution, create a new test page & add the visual web part to it. You can see the Load & Save working if everything went well.

image

Advantages

To summarize the advantages of Hierarchical Data Store:

1. Configuration values can be stored for global access

2. Data can be stored in Hierarchical manner

3. Custom Properties can be created

4. Data is saved in XML serialization

5. Content is persisted on backups

References

https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.sppersistedobject.aspx

Summary

In this article we have explored Hierarchical Data Store in SharePoint 2013. You can refer the source code here.

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »

Web Part Maintenance Page

Posted by Paul on April 5, 2015

In this article we can explore the web part maintenance page feature of SharePoint.

Scenario

While working with web parts in a page, we might encounter a situation where one of the web parts malfunctioned and the whole page stopped from loading.

image

We may wish to open the page in edit-mode and fix the web part. But, in few cases the edit-mode itself won’t work leading the user to re-create the page with web parts.

Maintenance Mode

To our help there is a maintenance mode for pages. It helps to close any malfunctioning web part from the page. To open the page in maintenance mode we need to use the query-string contents=1

Example

For the following URL I am using the maintenance mode.

http://sharepoint/sites/test/SitePages/Test.aspx?contents=1

You can see the page will be displayed as below.

image

Here you can select a web part & close / reset / delete it.

There is an option named Go Back to Web Part Page to return to the non-maintenance page.

image

You need to have appropriate permissions to use the maintenance mode.

References

http://bit.ly/1ctw75S

Summary

In this article we have explored the web part maintenance page feature of SharePoint.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

Laptop Configuration for SharePoint 2013

Posted by Paul on April 3, 2015

The article can be found in hubpages > http://jeanpaulva.hubpages.com/hub/sharepointlaptop

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »