SharePoint 2013 Provider Hosted - sharepoint

I want to create a web application that uses a custom database with a web api where javascript calls the api from html pages to perform basic crud operations.
The end game though is to surface this through SharePoint 2013 as a provider hosted application.
Can anyone advise on how I might go about this? I am particularly wondering how making ajax api calls to the application via the html pages surfaced from within sharepoint 2013 will work and authenticate.

Is the application using SharePoint data or are you just using your custom database? If you are just using your custom database, you can use the page viewer web part to display the application: http://office.microsoft.com/en-us/sharepoint-foundation-help/display-a-web-page-on-a-sharepoint-page-by-adding-the-page-viewer-web-part-HA101857182.aspx
If you are consuming SharePoint data, that is a different beast and your best bet is reading the docs here: http://msdn.microsoft.com/en-us/library/office/fp142381(v=office.15).aspx

Related

How do I get started from reading SharePoint list information from outside of SharePoint?

We have a SharePoint subscription and an Azure subscription. I want to make a web app that is hosted in Azure, but the database for the app would basically be SharePoint lists. I'm looking up documentation on how to do this, but I'm just finding how to make "web parts" and they keep assuming I want to build my website inside SharePoint rather than outside.
How do I access a user's SharePoint lists from outside of SharePoint?
The easy part is the request for data. Use the SharePoint REST API. The harder part is authentication. How is the Azure app related to the SharePoint app? Same user login?
A sample REST call for select columns from a list:
https://yourDoamin/sites/yourSite/_api/web/lists/getbytitle('My List')/items?$select=Title,Price,Qty
The REST API also support filtering and sorting along with insert, update and delete.
A filter example:
https://yourDoamin/sites/yourSite/_api/web/lists/getbytitle('My List')/items?$select=Title,Price,Qty&$filter=Title eq 'Toys'
If you would like to experiment with the REST API from your SharePoint site, I have "REST tester" you can add to a Content Editor Web Part.
https://github.com/microsmith/SharePointRESTtester

How to perform a post to sharepoint server using nodejs http-ntlm?

I am synchronising with a Sharepoint server in a nodejs application using node-webkit...
I was able to receive the Sharepoint resources I want, using http-ntlm. However, I do not know how correctly send new resources to Sharepoint.

Outofbox SharePoint Presence Control to use UCWA Lync API

Our SharePoint 2013 customer need to display Lync presence on the client web browsers without installing Lync Client on the client PC
I am not familiar a lot with Lync development and SharePoint integration with it however I know for SharePoint 2013 and Lync 2013 was impossible because presence control is based on browser plugin as mentioned here
http://blogs.msdn.com/b/tomholl/archive/2013/03/02/integrate-lync-into-your-intranet-sites-using-the-namectrl-plug-in.aspx
I make a search and found that there is a new API for Lync UCWA that target mobile and web development
I think SharePoint team will use this Lync API on the future (or maybe they already use it) to display users presence without require Lync client to be installed
The Question is:
Is their any news about this from SharePoint team? Or no news till now?
I'm quite sure in saying that there's been no announcement around this.
The components in SharePoint 2013 (also SharePoint Online / 365) are still using the ActiveX control you mention, which requires Lync client running and signed in on client machines indeed.
However UCWA could address the requirement of retrieving and displaying users' presence. The challenge in this is how to perform the authentication: we'd need to authenticate the user or a valid Lync user in order to use UCWA and perform our queries.
Viable option is to use Integrated Windows Authentication, but is very subject to browsers and users configuration.
http://ucwa.lync.com/documentation/gettingstarted-authentication
Whenever we're authenticated with UCWA, we need to replace the OOB controls and views to make use of UCWA in place of namectrl.
This goes over:
XSLT used by Content Query Web Parts
Display Templates used by Content By Search Web Parts
Client Side Rendering (CSR) templates for lists and fields (JSLink)
Web Parts as Contact Person, Site Members, ..
probably more..
This article provides a detailed overview about the different templates for contact presence included in SharePoint 2013
http://www.sharepointcolumn.com/lync-presence-indicators-in-sharepoint-2013/
As I mentioned, authentication can be a challenge, so you may want to move the communication with UCWA in a server component, and expose more friendly APIs to use in your components, maybe not requiring authentication (for intranet use), or having another type of authentication in place for this.
An old project actually doing this:
https://htmlpresencecontrols.codeplex.com/
This is build using UCMA on the server, because UCWA wasn't available at that time. The UCMA part could be replaced with UCWA right now, having much less installation impact.

How to retrieve data from SharePoint?

I have a web application. When the user clicks on a button in my web application, I'd like to retrieve data from SharePoint on behalf of the user. I have read quite a few articles on SharePoint but I'm still not sure how to proceed. Should I create a provider hosted SharePoint App and use the SharePointREST API? Thank you in advance for your help.
You don't need to create a Provider to use the SharePoint Rest Services.
Quoting http://msdn.microsoft.com/en-us/library/office/jj164022(v=office.15).aspx :
One advantage of using REST is that you don’t have to add references to any SharePoint 2013 libraries or client assemblies. Instead, you make HTTP requests to the appropriate endpoints to retrieve or update SharePoint entities, such as webs, lists, and list items. See Get started with the SharePoint 2013 REST service for a thorough introduction to the SharePoint 2013 REST interface and its architecture.
Inside the page you will find videos and code examples that will help you to connect and execute operations.
It's Correct. Data in SharePoint is Stored in Lists or Libraries (to files).
You can use the Client Object Model, to get data remotely from a SharePoint Server (on-premise or Online). The Client Object Model can be used through Assemblies (DLL files) or REST services provided by SharePoint. Generally you should know the location of the data you are going to get, that is, as I initially mentioned, the data in SharePoint are stored in Lists or Libraries, therefore you must know the name of the List or Library Additional Site or Sub-site of the List or Library is.
If the name of the list where the information is stored is "employees" and the HR website, the URL could be formed as follows:
http://spserver.company.com/HR/Employees
For REST services, simply complete URL of the list you want to see, so that you retrieve the information from the list. If you want to apply filters, sorting, to retrieve specific columns, you must do it through CAML queries which the add on REST service call.

Access sharepoint list from windows application

Can anyone tell me if I have some ways to access to sharepoint list from windows app?
I've tryed following way (i'm under user that is sharepoint member):
SPUserToken token = new SPUserToken(
BitConverter.GetBytes(WindowsIdentity.GetCurrent().Token.ToInt32()));
SPSite site = new SPSite(siteName, token);
but no luck...
Your best bet is to use a web reference to query the SharePoint WebService's GetListItems web method:
http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems.aspx
Like Jason said, to be able to use the SharePoint Object model (i.e. the sharepoint dll's) the app needs to be running on the same machine as SharePoint. If it is anywhere else you can only use the Web Services provided by SharePoint (or create your own and deploy that to your sharepoint server).
P.S. In SharePoint 2010 you have the client object model at your disposal, basically a subset of the full sharepoint object model (Kinda like Silverlight). Of course sp2010 is still in beta....
This article provides an excellent and detailed step by step tutorial on how to do this using Linq and Web services. It does create a console application instead of a Windows application but it is very easy to translate this into a Windows Form app if needed. I found this article very useful when I started working on programatically communicating with SharePoint lists because it clearly demonstrates how easy it is to work with the web service response from SharePoint using LINQ.
Is siteName on the same computer that you are running the windows application from? If not, then you won't be able to access that site if you're using SharePoint 2007.
If the above isn't the problem, then check that the user account WindowsIdentity.GetCurrent() is at least a site owner on siteName.

Resources