Access SharePoint document library using ASP.Net MVC - asp.net-mvc

I have developed an ASP.Net MVC application which is Azure Single-Sign-On supported.
In the existing application, I wanted to consume online SharePoint REST API's to work with the document library(Get folders/files,upload, add, replace and delete etc.)
Is there any way to do/achieve this task.
Thanks in advance!

yes, the supported way is to use SharePoint CSOM which is now in .net standard. Please see this article were you may find a movie that shows the whole process to add nuget, authenticate the app and get some data from SharePoint, and here is he msdn support.
Some CSOM examples how this works

Related

How to call Microsoft Graph from non-MVC Web app c#

I've got an existing ASP.NET web app which is non-MVC and I would like to get it to call the Microsoft graph. I read up on the ASPNET MVC tutorials and got those to work but I am looking for some code samples of calling the Microsoft Graph that don't use MVC or OWIN to acquire an access token. This is because I would like to avoid rewriting my entire app into MVC. Any pointers?
Microsoft has a number of samples on Github. Here's a console app one.

How to add a MVC Rest API to a Sharepoint 2013 App and how to consume it?

When creating a Sharepoint 2013 App project in Visual Studio you get a project that can be deployed and debugged against a Sharepoint Server.
In that application you have access to a lot of Sharepoint Specific REST API functions that work with the Sharepoint Specific Data (User information, documents, lists, etc.). But what if I now want to add domain specific functionality that is backed by a specific Database that only contains those domain specific structure and data?
Do I have to set up the asp.net MVC application on an IIS myself and authenticate the calls to the API myself or is there a way to let the API reside in the Sharepoint Web App Domain and be deployed side by side with the Sharepoint App itself?
Or is it even possible to extend the Javascript- and REST API of that specific Sharpoint Installation?
I haven't found a way to add an asp.net MVC web api project to the SharePoint IIS site. I think you need access to the application_start event to set up route rules so that makes it difficult. You can deploy your own wcf or asmx services to the layouts directory. Or you can cheat and create an aspx page that returns JSON data.
I would create my own asp.net web api on a different web application (and domain). You can use CORS to allow cross-site scripting from SharePoint to your custom api. If you go with this approach, the api and SharePoint will have to leverage the same identity provider. So SharePoint's NTLM is no longer an option.

Is it possible to post from an external RoR site to Sitecore

Looking into possibly doing an integration with a blog that is powered by Sitecore. Is there anyway to use data from our site (RoR) to create a post on an external Sitecore blog? I guess something analogous to the Wordpress XML-RPC api or the Tumblr Restful API.
Thanks!
You should look into using the Sitecore Item Web API module, it's officially support by Sitecore and will give you CRUD access to Sitecore items.
You can restrict access to operations using standard Sitecore Security and passing in the user credentials when building the request. Additionally, like all things Sitecore, you can extend the API with pipeline processors to add anything else you require.
You could use the Visual Sitecore Service to create new items from your RoR website.
The Visual Sitecore Service is a webservice that is standard installed in Sitecore which enables you to read/write/create to and from Sitecore.
See this link for more information about the Visual Sitecore Service webservice.
You could also create your own webservice in Sitecore, that is what I mostly prefer to gain full control of the functionalities of the webservice.
Another option could be to read the data (periodically or realtime) from a JSON (or other) service from your RoR website and save it in Sitecore or XML format in file or custom database table. Whatever you prefer and fits your requirements.

ASP.Net MVC4 Web Api with Help Page of WCF possible?

I am starting to develop with Web Api MVC 4 and created the whole stack. My services are working but I wonder if it is possible to see a Help Page similar to what exists on WCF.
Does anyone know?
Thanks
Checkout the ASP.NET Web API Help Page which is available as a NuGet package:
http://blogs.msdn.com/b/yaohuang1/archive/2012/08/15/introducing-the-asp-net-web-api-help-page-preview.aspx
Not currently but this is in the MVC 4 roadmap:
http://aspnet.codeplex.com/wikipage?title=ASP.NET%20MVC%204%20RoadMap
Web API Help page generation: We want to make it easy to generate rich, web-based documentation
for your web APIs, including the resource URIs, the allowed HTTP methods, expected parameters, and
sample message payloads.

Asp.net MVC/Silverlight and Sharepoint 2010 integration

Just a sidenote: I'm not sure whether I should post this to serverfault as well, because some MOSS admin may have some info for me as well?
Additional note 1: I've found this document (Asp.net MVC 2 & Sharepoint integration) if anybody with sufficient expirience is willing to comment on its content whether this can be used in my described scenario or not.
Additional note 2: I've discovered (later) that Silverlight is supported in Sharepoint 2010 so I'm considering it as well. So if anyone would comment on silverlight integration as well.
A bit of explanation first (without Asp.net MVC/Silverlight)
Is it possible to integrate the two? Is it possible to write an application that would share at least credential information with MOSS?
I have to write a MOSS application that has to do with these technologies:
MOSS 2010
Personal client certificates authentication (most probably on USB keys)
Active Directory Federation Services
Separate SQL DB that would serve application specific data (separate as not being part of MOSS DB)
How should it work?
Users should authenticate using personal certificates into MOSS 2010
There would be a certain part of MOSS that would be related to my custom application
This application should only authorize certain users via AD FS - I guess these users should have a certain security claim attached to them
This application should manage users (that have access to this app) with additional (app specific) security claims related to this application (as additional application level authorization rights for individual application parts)
This application should use custom SQL 2008 DB heavily with its own data
This application should have the possibility to integrate with external systems as well (Exchange for instance to inject calendar entries, ERP systems etc)
This application should be able to export its data (from its DB) to files. I don't know if it's possible, but it would be nice if the app could add these files to MOSS and attach authorization info to them so only users with sufficient rights would be able to view/open these files.
Why Asp.net MVC/Silverlight then?
I'm very well versed in Asp.net MVC (also with the latest version) and I haven't done anything on Sharepoint since version 2003 (which doesn't do me no good or prepare me for the latest version in any way shape or form). This project will most probably be a death march project so I would rather write my application as a UI rich Asp.net MVC application and somehow integrate it into MOSS. But not only via a link, because I would like to at least share credentials, so users wouldn't need to re-login when accessing my app. Using Asp.net MVC I would at least have the possibility to finish on time or be less death marching. Is this at all possible?
I haven't done any serious project using SIlverlight, but I will sooner or later have to. So I'm also considering a jump into it at this moment, because it still might make this application development easier than strict Sharepoint 2010.
Questions
Is it possible to integrate Asp.net MVC/Silverlight into MOSS as described above?
If integration is not possible, would it be possible to create a completely MOSS based application that would work as described?
Which parts of MOSS 2010 should I use to accomplish what I need?
The Patterns and Practices Sharepoint Guidance release on CodePlex has a model-view-presenter equivalent to MVC but targeted at SharePoint development.

Resources