Posts

Showing posts with the label App

SharePoint 2013 apps - communicate with host SharePoint without using SP.RequestExecutor

In a previous post  I wrote an app to read and write data from the Host-SharePoint. To do this I made use of the SP.RequestExecutor. This class is used to get the permissions for reading and writing data into the Host-SharePoint. But there is a way to skip the authentification and using the URL directly. This makes your code much more beautiful and easy to read. All you need to do is to call a function (_spPageContextInfo.siteAbsoluteUrl). That function returns an URL and makes it possible to communicate with the SharePoint per JSOM and REST.  I also tried to call the URL with the function and make a context with another URL and this does not work. Even the Host-URL does not work. Another disgusting point is that the URL, which is returned by the function, is that it not contains the URL of the app and not of the host. It is a 'hybrid' that begins like the app URL, but ends earlier. 1 2 3 4 var url = _spPageContextInfo.siteAbsoluteUrl; context = new SP.ClientContext(u...

SharePoint 2013 app - get data from the SharePoint

Image
For safety reasons apps are seperated from the SharePoint where they are installed on. Apps are installed on other domains and that is how the seperation works. Apps can't contact the SharePoint, because Cross-Site-Scriptingis blocking it. But there is still a way to get data from the SharePoint and with this way comes a permission concept into the app world. Permissions There is a library, called the Cross Domain Library, that allows to communicate with a SharePoint from app site. This library is aviable on every SharePoint 2013 and is easy to call. But wait.. if it is so easy to call a library that can get SharePoint data it is not saver than before. This library contains more than communication.. it authentificates the app against the SharePoint and asks for permissions. This happens right after the installation of the app. The installing user will be asked to grand permissions for the app. But how does the app know what permissions are needed? Asking for permissions is you...

Basics for SharePoint 2013 app development

Image
The biggest innovation in SharePoint 2013 is the app-architecture. With this innovation it is possible to install applications (apps) on a SharePoint. This applications can be developed by yourself or you can buy them in the SharePoint Store. They are totally detached of the SharePoint and got their own area. They can contain own lists, have own sites with custom code and they have their own interfaces. But it is possible to communicate with the SharePoint. My first app To develop an app you need Visual Studio 2012 or above and a development SharePoint. To begin start Visual Studio as administrator and click 'New project...'. A mask opens where you can choose a template. Go to 'Templates' → 'Visual C#' → 'Office/SharePoint' → 'Apps' and select 'App for SharePoint'.

How to set up a SharePoint 2013 app development environment (without DNS)

Image
With SharePoint 2013 Microsoft integrated the app contept into the SharePoint world. This gives us new opportunities, but also sets new requirements. SharePoint apps got their own enviroment where they will be installed and run. With this step Microsoft made sure the SharePoint experience will not be affected negativ by bad running apps or apps that want to steal data. But this isolation requires, that apps got their new oen DNS entry. The app do not have the same URL as the SharePoint. An app URL looks like this: <prefix>-<GUID of the app (will be generated automatic)>.<appdomain> (example: http://app-005f804530bdb6.app.development/). To create and manage a new DNS entry is way to much work for a development enviroment and that is the reason why there is a way to do it without DNS.

Remove the title area in SharePoint apps

Image
Sometimes it is nice, sometimes it is annoying. Yes I am talking of the titlearea of SharePoint 2013 Apps. But don't worry, it is easy to remove it from your app. All you need to do is to paste some css into your stylesheet. I recommend to use a css-file that is used in every site. This way you need to do the change on just one place. 1 2 3 #s4-titlerow { display : none !important ; } After pasting the code into your app you won a lot of space and you can build your own design.