Wednesday, 28 November 2012

Sync SkyDrive Pro

With SkyDrive Pro, files can be synchronized easily between PC, SharePoint library, and other devices. Necessary are:
Office 2013
SharePoint 2013 or Office 365.
This functionality was previously known as SharePoint Workspace. It 2013 version it is just much simpler.


Run SkyDrive Pro

Enter URL of what you want to sync
Click Sync Now.

After just few minutes you will see SkyDrive folder in Windows Explorer…
…that is synchronized with SharePoint

Thursday, 15 November 2012

SharePoint 2013 Look & feel in WebApp

Include these files

Copy sp.ui.controls.js from
<15 Hive>\TEMPLATE\LAYOUTS

Also, add SPHostUrl variable to query string, so address is something like:
TestPage.aspx?SPHostUrl=https%3a%2f%2fmyofficethreesixtyfive.sharepoint.com
<head runat="server">
    <title></title>
    <script src="../Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="../Scripts/sp.ui.controls.js" type="text/javascript"></script>
    <script type="text/javascript">
        var hostweburl;
        $(document).ready(function () {
            hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
            var scriptbase = hostweburl + "/_layouts/15/";
            $.getScript(scriptbase + "SP.UI.Controls.js")
        });
        function getQueryStringParameter(paramToRetrieve) {
            var queryString = document.URL.split("?")
            if (queryString.length > 1) {
                var params = queryString[1].split("&");
                var strParams = "";
                for (var i = 0; i < params.length; i++) {
                    var singleParam = params[i].split("=");
                    if (singleParam[0] == paramToRetrieve) {
                       return singleParam[1];
                    }
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div
            id="chrome_ctrl_container"
            data-ms-control="SP.UI.Controls.Navigation"
            data-ms-options='{
                "appHelpPageUrl" : "HelpPage.html",
                "appTitle" : "Diff App",
                "settingsLinks" : [
                {
                    "linkUrl" : "Page1.html",
                    "displayName" : "Navigation 1"
                },
                {
                    "linkUrl" : "Page2.html",
                    "displayName" : "Navigation 2"
                }
            ]}'>
        </div>

Snippets can be downloaded from here:
Scripts snippet
Div container snippet


Tuesday, 13 November 2012

Step-by-step: creating Remote Event Receiver

In this example I will show, how to create autohosted SharePoint 2013 app with Remote Event Receiver, and then how to deploy it to Office 365 Developer Preview.

Start with creating a list in SharePoint site, to which you will attach Event Receiver.
Go to site contents and create new Announcements list.
In Visual Studio, create new project type: App for Office 2013. For hosting type, choose autohosted.
In Solution Explorer, right-click on newly created project and choose Add > New Item. Add Remote Event Receiver


In next dialog, choose list type and which events will be handled.

You will notice, that new project has been added to your solution. This is a web service, that will be hosted outside SharePoint, on Windows Azure. SharePoint will make calls to this web service, that contain code to handle remote events.
At this step, Visual Studio has generated some boilerplate code, that you will need to extend.
Notice 'TokenHelper.cs' file. This file contains ready to use methods, to retrieve SharePointContextToken. This context token can be later used to call back to SharePoint. You can make calls to SharePoint using Client-Side Object Model (CSOM).

If you selected several different events for your list, like eg. ItemAdded, ItemUpdated, ItemDeleted, etc., they will all be handled by ProcessEvent method in web service. To be able to differentiate between various event types, use RemoteEventProperties.EventType property.

    switch (properties.EventType)
    {
        case RemoteEventType.ItemAdding:
            break;
        case RemoteEventType.ItemUpdating:
            break;
        case RemoteEventType.ItemDeleting:
            break;
        default:
            break;
   }
When you finish writing Event Receiver code, deploy it to website.
You should have already Site URL in project properties set. Select Build > Deploy Solution. Visual Studio will connect to your website, ask you for login and password and then deploy solution. You will have to confirm, that you trust this app.

More reading on MSDN:
[3] Bing Video - Remote event receivers in SharePoint 2013 demo (video tutorial for preview version of SharePoint15)

Monday, 12 November 2012

Getting started with SharePoint 2013 development - prerequisites

What you need before you start:
1. You have to get Visual Studio 2012. Previous version is not enough.
2. You need to install Office Developer Tools for Visual Studio 2012. Get it from http://go.microsoft.com/fwlink/?LinkID=261869.

Unfortunately, the installation failed.

It says right there: "ensure that all instances of Visual Studio are closed". Then try again - go to Web Platform Installer 4.0 and search for "Office".

And now, it's all working.

Remember to start Visual Studio now as administrator.

Environment for creating farm solutions with SharePoint 2013

(Update from 2022: This article is about Preview version of SharePoint 2013. It may not be relevant anymore.)

Installing my development environment, I have:
1.  Virtual Machine with Windows Server 2012
2.  SharePoint Server 2013
3.  Visual Studio 2012
I need one more element - Visual Studio Tools

Using Platform Installer, I run into problems with Workflow Client 1.0 Beta

It seems, that Workflow Client 1.0 is already installed, and it is not Beta version.

UPDATE:
On 12 November, new version of Office Tools have been announced.  When you download this file, you will notice, that the name changes from "RTMPreview" to "GA".
I strongly recommend installing this version instead. Remember to close Visual Studio during installation.

Friday, 9 November 2012

Wstawianie pól wyboru w dokumencie Word 2010

Jak, korzystając z Worda 2010 dać możliwość wstawienia krzyżyka w kwadracie, tak aby w ten sposób móc zaznaczyć wybraną odpowiedź?

Aby dodać pole wyboru (pole, w którym użytkownik będzie mógł zaznaczyć krzyżykiem tak, czy nie) należy wykonać następujące kroki:

     1.  Najpierw należy kliknąć prawym klawiszem myszy (PKM) na wstążce i wybrać "Dostosuj wstążkę" 
  
2.  Następnie aktywować kartę "Developer" 
  
3.  Teraz, na karcie Deweloper, wybrać formant pola wyboru 
  
4.  Dodać wymaganą liczbę pól i opisy. Gotowe 

Tuesday, 6 November 2012

Cool feature of Excel 2013

I open new workbook in Excel 2013 and fill a column with some data.

Then I move to another column and start filling this one too. When I get to 3rd row and write first letter, it suggests a word. That was here before.

But watch me, as I continue typing:

And when I hit Enter, bam!, whole column filled with data. How cool is that?