Friday, December 13, 2013

Showing Bing Map in SharePoint App using NAPA Tool

In this article, I am going to share my first app for SharePoint creation. The goal of this app is, display a bing map.

About NAPA Tool

We may use this tool to start creating app for office/SharePoint. There is no dependency to have on your machine. We need to install it on developer site of O365 portal. We may have few step to add it on your site.

Find the above video to add NAPA tool on your developer site.

Add an App

Once NAPA tool is added with your site, you can find the NAPA tool in Site Contents page. Now you are ready to create an app. You may find project explorer screen when click the NAPA Tool. You have choose the project type after clicking Add New Project.
We have four project type here. I have chosen App for SharePoint and set the project name as Map. Then Click Create.

Develop an App

After creating a project, we can view the editor like visual studio with four modules,
  • Contents, which mainly holding the style sheets
  • Images, We can place the images which is need to an App
  • Pages, Which contains pages involved in App
  • Scripts, Which we have Scripts (JScripts.,) of an App
Initially we have default.aspx to write a code with two content placeholder. One is for Header which includes all the reference of scripts and css. Another one for, Body of the page.
For showing a bing map in App. We need to include a reference script of bingmap. Add this script on PlaceHolderAdditionalPageHead section.

      <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>

<script type="text/javascript">
      var map = null;           
      function getMap()
      {          map = new Microsoft.Maps.Map(document.getElementById('myMap'), {credentials: 'Your Bing map Key'});     }  
 </script>

Then, add this code in PlaceHolderMain section

<body onload="getMap();">
      <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
   </body>

That’s all, Coding part is over. Then Run the Project. Bing Map will be displayed on your page. J

Reference


Summary

I have gained some knowledge in SharePoint App. Happy Coding …. !!! J

Wednesday, December 11, 2013

SharePoint App Overview

In this article, I am going to share something about SharePoint App.

In SP 2013, we are calling all the components like list, library etc., as Apps. Users are having facility to create their own App and host in SharePoint store, this is called Cloud App Model. Let we see the overview of App.


An App is self-packaged piece of functionality which is adoptable with SharePoint site. User is looking for lightweight, easy to use and solving their need. These things are achieved by App model. Users find and download apps from Office Store or their organization private app catalog.

How we build apps

We have familiar tools and rich set of features to build Cloud App Model (CAM). Let us see some of key features of CAM.

Programming Model

We may choose any web application language (HTML, JS, .NET and PHP) to create an App. We may choose the development tool (VS 2012, “NAPA” O365 development tool) also. It supports tiered architecture to develop. We may connect App with internal/external web services by using new OAuth 2.0 support in SP, REST, and Client API (Java Script, .NET). We can use SP 2013 features (Search, Workflow, Social Networking, taxonomy, BCI and user profile) in App also.

Hosting Options

We are having multiple options to host an app. They are,
  •          Host in own web stack with provision of Windows Azure and SQL Azure
  •          Self-host on SharePoint site

End user Experience

An app gives immersive experience and optionally expand with SP UI. App content will be displayed in iframe. We may have ribbon items to show List and Library. 

App for Office 

It is based on new web-based extensibility model in Office 2013, which can integrate with apps for SharePoint.


What is an app

It’s a basic HTML form. We need to register an app in app manifest for SharePoint app. App manifest file is having basic properties of an app,
  •          Where – App is going to run
  •          What – App is going to do
  •          When – App is going to start

You may have different type of authentication in manifest file, this called app principals. In this, we need to set the permission which is essential to run the app.

Where the app code run

The app code will run in different places. Let we see about that,

SharePoint-hosted apps:

App web is a new site, it will create when you deploy SharePoint-hosted app. This site will allocate the space dynamically to store lists, libraries and pages.

Provider-hosted & auto-hosted apps (In Cloud): 

These apps are run in cloud. It is going to deploy into Windows Azure and SQL Azure. We have two option to host Provider-hosted app. One, we need to setup the dedicated server to install an app and another one is will host it on cloud service

Mix of components in SharePoint & Cloud

These type of apps will separate themselves to run. SharePoint Components runs in SharePoint and others in Cloud.

How an App communicate to SharePoint

We may interact from app with SharePoint feature (workflow, taxonomy, BCS, search,.) using SharePoint APIs. We have three more API to interact with SharePoint. They are, REST, JavaScript APIs and Managed API (.Net)

References 


Summary

I have explored my knowledge about SharePoint App. Happy Learning!!! 



Monday, December 9, 2013

Unexpected response from server. The status code of response is '0'. The status text of response is ''

We may get the above response while Client object model in SharePoint. In my case, I have received this issue when get the list information from SP App. The code is perfect to get info from List. But I ddn’t get result set. Then I found an issue. The issue is not in script side. Its is in HTML side.

                <button id=”btnGet” value=’’Get Info” onclick=’’getinfo(); />

                We need to change like this,
               
                <input type=”button” id=”btnGet” value=”Get Info” onclick=”getinfo();”></input>


Then it was working fine for me. J

How to use CAML Query in Client Object Model


Most of us may face this issue in their application while using CAML in COM. That is,

var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml("<Query><Where><BeginsWith><FieldRef Name='Name'/><Value Type='Text'>asdf</Value></BeginsWith></Where></Query>");
                this.listItemCollection = oList.getItems(camlQuery);
                context.load(listItemCollection);

The above mentioned code may not give you the result. Replace CAML query like this,

var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml("<query><Query><Where><BeginsWith><FieldRef Name='Name'/><Value Type='Text'>asdf</Value></BeginsWith></Where></Query></query>");
                this.listItemCollection = oList.getItems(camlQuery);
                context.load(listItemCollection);

Enjoy Coding !!!! :) 

Tuesday, December 3, 2013

SharePoint 2013 New Features

In this article, I am going to share something about SharePoint 2013 new features.

Social and Collaboration

Community Site

A wonderful newly added feature in SharePoint 2013 is “Community Site”. This is used to get and post the information on their interested community. It’s a new site template which is having extended discussion board. Let we go through some of the major features,
  • Reputation score for each post
  • Categorize the questions
  • Will choose question based discussion
  • Find the best reply (it must be one reply)
  • Popular Discussion and replies

Follow People and Site

We will get the information about interested people in the News feed and People I’m Following pages. SharePoint 2013 is allowing us to follow the people by using SPSocialFollowingManager (Server object model) programmatically.


Addition to this, we may follow documents and sites, we will get the status update of document in News Feed and get the conversation on sites which we followed.

OneNote Integration

OneNote shared notebook is automatically created and inherits the permission when you created team site. We can use this for capture, compile and share the information. We can able to embed the documents with notebook. Those documents will be uploaded separately in document library.

Search

In SP 2013, we have an enhanced search feature like KQL (Keyword Query language) and FAST – search technology. We have custom content processing with Content Enrichment service and result will be displayed by their type.

Crawling, its capturing all metadata associated documents and content resides in whole site collection. Content Processing, It is redirecting process to link database. Analyzing Processing, It’s used to filter the content based on their popularity. Anchor text within the text also counted for ranking purpose. Indexing, the architecture of indexing is works like FAST – search. The separation of indexing like row and column to scale both data volumes and query loads. So the content changes will reflect in the index within seconds.

Apps

In SP 2013, we are calling all the components like list, library etc., as Apps. Users are having facility to create their own App and host in SharePoint store, this is called Cloud App Model.
Some Protocols for Apps:
  • Few/No dependency on any other software on the device
  • Doesn’t have any custom code with dependency
  • May include SP components like List, Workflows, etc.,

We can choose any web application language (HTML, JS, PHP, .NET) to create an App. We can choose the development tool (VS 2012, “NAPA” O365 development tool) also. It supports tiered architecture to develop. Office Store, users around the world can publish and sell their app in office store.  An app catalog is a document library on SharePoint where manifest files for task pane and content apps can be published. 

Project Site

It’s a kind of site template to handle lightweight projects. The Project Manager can easily track, what is going around the project. Team members can see how their work fit to entire context. We can able to share project related data, documents and communication. Some notable features in project site are:
  • Project Summary webpart
  • Task’s Timeline
  • Notebook for quick capturing
  • Ability to connect project server 2013 client application

Business Intelligence in Excel Service

SharePoint 2013 is support enhanced BI features and functionality in Excel Service:
  • New data navigation features, such as Quick Explore and make it easier to drill into data displayed in reports and dashboards
  • Slicers and Timeline control render the excel in browser like excel client
  •  The ability to open and use the Fields list for a PivotTable report or PivotChart report enables you to add, change, or remove items from a view. You can focus on the information that you want to see without having to open the Excel client.
  • Choose between worksheet view and gallery view when publishing workbooks. You can display an entire worksheet in a browser window, or display content so that one report at a time is featured in the center of the screen.
  • If Excel Services is configured to support Data Models, you can view and interact with PowerPivot and Power View content in a browser window.

Workflow

In SP 2013, Workflow architecture is redesigned by WF4. It was enhanced with Windows Workflow Foundation, built in messaging functionality which is provided by WCF. Workflows are no longer compiled into managed assemblies and deployed to assemble cache. In tool wise, SharePoint designer has updated with authoring environment of choice for authoring SharePoint workflows. And you can do the custom actions in visual studio and import them into SPD 2013, where they can accessed from workflow designer. Some of new actions added in designer,
  • Assign Task
  • Start a task process
  • Go to this stage
  • Start site workflow
  • Trim String
  • Find substring in string
  • Replace substring in string
  • Translate document
  • Set workflow status


We have more new actions in workflow. I explored some of those here.

References

http://msdn.microsoft.com/en-us/library/jj163177.aspx

http://msdn.microsoft.com/en-us/library/office/jj163091.aspx


Summary

 I have explored some of newly added SP 2013 features. Happy Learning!!!