Italian SharePoint and Office Conference 2013 – What’s new in SharePoint Designer 2013 Workflows

(again, for my non-Italian readers, I’m switching to Italian language here)

What’s new in SharePoint Designer 2013 Workflows è la terza ed ultima sessione del “trittico” sui workflow che presenteremo alla SharePoint and Office Conference 2013.

Il titolo lascia immaginare quale sarà lo strumento che io e Riccardo useremo durante la sessione.

Uno strumento con cui si realizzano workflow dichiarativi – è sempre stato così, solamente che ora sono dichiarativi anche quelli sviluppati in Visual Studio J – in modo flessibile ed espressivo.

E questa è invece un’enorme novità, se pensate che su piattaforma 2010 non c’era verso (se non con forzature non prive di difetti) di definire loop e tantomeno blocchi di esecuzione non sequenziali.

Anche flussi semplice come quello rappresentato qui sotto diventavano “scomodi” per ragioni di struttura, ancor prima che di complessità nella logica.


Per inciso, questo qui su è un diagramma Visio, che si presenta così *nella* design surface di SPD, perfettamente modificabile quanto ad azioni e relative proprietà.

Insomma, persa(*) una Design View, ecco che ne spunta un’altra 😛

 

(*) Design view and Split view (MSDN)

Description of the change.

SharePoint Designer 2010 has three views for editing HTML and ASPX pages: Code view, Design view, and Split view. Design view and Split view are removed from SharePoint Designer 2013. The removal of Design view and Split view affects the features of SharePoint Designer 2013 that are used for editing Web Parts and master pages. If you edit pages in SharePoint Designer 2013, you must use Code view.

Reason for the change.

Compared to current versions of Internet Explorer, Design view is an older technology that does not support many new HTML5 and CSS tags.

Migration path.

If you edit pages in Code view, you can press F12 to preview the page in the browser. Alternatively, you can use Visual Studio to edit pages.

If you want to visually design or brand your site, and you want a WYSIWYG (“what you see is what you get”) page-editing experience, you can use any professional HTML editor, such as Microsoft Expression Web. Then you can import your HTML files into SharePoint Server 2013 by using the new Design Manager, which is a feature included in publishing sites, such as the Publishing Portal Site Collection site template.

Italian SharePoint and Office Conference 2013 – What’s new with Workflow in SharePoint 2013

(for my non-Italian readers, I’m swithcing to Italian language here, but you can use some online translation service to have this post translated… and have fun with the results J)

Credo che tutti sappiate che il 5-6-7 marzo si terrà a Milano la SharePoint and Office Conference.

Sul sito dell’evento trovate ogni tipo di informazione, dai contenuti alla logistica.

E ovviamente potete (dovete J) registrarvi, sfruttando, se siete veloci J, l’early bird ancora valido per alcuni giorni dal momento in cui scrivo.

Quest’anno terrò quattro sessioni, in coppia con Paolo Pialorsi, Riccardo Celesti ed Elisabetta Sasselli (in rigoroso ordine di agenda J).

Sempre nello stesso rigoroso ordine di cui sopra, inizio quindi a parlarvi della prima: What’s new with Workflow in SharePoint 2013.

La prima in cui sono coinvolto io, ma la seconda di un filotto di tre, tutte incentrate sul tema Workflow, affrontato da prospettive e con premesse diverse.

Paolo inizierà le danze ed introdurrà Workflow Foundation 4.x: chi ha utilizzato (configurato, sviluppato o… troubleshootato, se si può dire) workflow su SharePoint 2010 potrebbe non aver mai avuto modo di giocare con WF4, che è invece alla base di quanto Paolo ed io illustreremo nella sessione successiva.

Le novità legate all’ambito Workflow su SP2013 sono rilevanti (e forse dire rilevanti è poco).

Se mi aveste chiesto, un annetto fa, la mia previsione su questo tema, avrei scommesso in un’introduzione di WF4 (era scontato) su un’architettura analoga all’attuale, in cui SharePoint fa da host del nuovo workflow runtime, sfruttandone ovviamente le novità e i miglioramenti.

Avrei sbagliato!

Perché i workflow in SharePoint 2010 erano così:

E con qualche *lieve* facelifting sono diventati circa così:

Per i più attenti… spot the difference J

Dedicheremo un po’ di tempo a queste slide, nella nostra sessione.

E vedremo insieme che cosa si porta dietro la nuova architettura, sia dal punto di vista dell’infrastruttura (deployment, monitoring, governance) e soprattutto (visto che Paolo è un dev e io, nonostante i miei continui sforzi, un pochettino ancora J) dal punto di vista dello sviluppatore: nuovo framework, nuove API, nuovi tool, nuove modalità.

Ci si vede a Milano!

SharePoint MVP 2013

Yesterday I received an email from my MVP Lead.
I have been renewed as a SharePoint Server MVP for the fifth year in a row 🙂
It’s a great honor and a huge pleasure for me.

I wish to congratulate with all new and renewed MVPs.

And special compliments to Igor (my friend, colleague and boss @ Green Team) and Robi Voncina, whom I met in Slovenia during the local SharePoint Events and who has been awarded for the first time.
Thank you!

SharePoint Future 2012

SharePoint Future 2012
SharePoint Future 2012

We launched the SharePoint Future brand back in 2009, during the very early days of the SharePoint 2010 beta timeframe.

It was the first event in Italy (and probably the first or the second one in Europe) about SharePoint 2010, just a week after the public disclosure, which took place during the SharePoint Conference in Vegas.

Three years after, the new “15” wave is the new “future”: SharePoint 2013 reached RTM some weeks ago, bringing to the masses a plethora of new and exciting features in most, if not all, of the pillars that constitute the SharePoint platform.

It’s time for a new edition of the SharePoint Future event!

SharePoint Future 2012 will take place in Milan on November 27.

On the event website, you can find all the information you need: content, logistics, registration.

I will be presenting 2 sessions about Search and Web Content Management and about the new Developer stuff, with special emphasis on the new Workflow platform.

And… well, this is just a small prelude of what we’ll be talking about during the SharePoint and Office Conference 2013.

See you in Milan!

 

 

It’s new, it’s green

And it’s finally live: the new Green Team web site!

It’s been rebuilt from scratch, using SharePoint 2010 as the CMS publishing infrastructure.

The web design was created independently from the SharePoint-isms using a Responsive Layout pattern based on plain HTML5/CSS3. Then it was “applied”, i.e. converted into SharePoint master pages and page layouts.

Most of the content targeting is driven by Managed Metadata terms and rollup techniques leveraging CQWP and Search.

There’s some multimedia content also, produced internally by our multimedia gurus Smile… they have almost succeeded in making myself an actor (take a look at the video from the home page).

Hope you like it!

Office 365 – Porta il tuo business sulla “nuvola”

During the last month Igor and I have been working on a new book, which has finally been published.

It is all about (guess what…) the Office365 platform 🙂

The first chapters represent a high level overview of the services, explaining what you get “out of the cloud” and how you can configure your subscription according to business requirements and user needs.

Then, a section is dedicated to the administration of these services.

Specific chapters are dedicated to Exchange Online, Lync Online and the Office WebApps.

And… oh, yes, SharePoint Online: end-user experience, customizations, workflows and even a short appendix on SharePoint development.

The book is available both in bookstores and online.

A huge, special thank you goes to Riccardo Celesti (who wrote the chapter about Workflows in SharePoint Online) and to Roberto D’Angelo (who wrote such a wonderful foreword).

[OT] Translations :-(

I know that literally thousands of posts have been written complaining about (or just making fun of) automatic translations. Anyway… here’s the last one I have come across, after clicking on a download link:

image

For non Italian readers, here’s a little bit of background.

“To download” (verb) is translated as “scaricare”.

“Download” (noun) is translated as “scaricamento” (well, it should not be translated at all, English terms should be used IMHO especially for technical words).

But the Italian verb “scaricare” is also used in completely different contexts: for example when an electronic device emits an electric shock, we use to say that it is producing a “scarica”.

That’s it!

This web site was so kind to inform me that the link that I had clicked would eventually produce an electric shock. Strange… I didn’t feel any!

Oh wait… I have instructions too. “If there’s no electric shock, I should check the security bar on the bottom of the page, or click here to try again”.

😛

Extending Base Xslt Web Parts with custom control bindings

What a long title! Maybe it requires a little bit of explanation. Here it is.

First of all, by Base XSLT Web Parts I mean a whole family of OOTB SharePoint Web Parts that leverage XSLT transformation to produce markup out of XML data coming from a data source. If you dig into the class hierarchy starting, say, from the XsltListViewWebPart or the ContentByQueryWebPart, you’ll find something like this:

image

If you navigate up the hierarchy, you’ll see that several features are implemented by the base DataFormWebPart class. One of these features is the capability to resolve dynamic parameters, i.e. values that come from query string, postback parameters and a few other sources.

More accurately speaking, the sources for dynamic parameters and the logics of parameters substitution are defined by an internal method of DataFormWebPart, named ResolveParameterBindingsToParameterValues.

Below you can find an excerpt of the method implementation:

image

As you can observe, you can actually set the ParameterBindings web part property to an XML string with proper semantics, thus inject dynamic values as XSLT parameters for the rendering transformation.

You can choose from the following sources:

  • Query String
  • Postback Parameters
  • Form Parameters
  • Web Part Connections
  • Web Part Variables
  • Resources
  • Server Variables
  • CAML Variables
  • Controls

Since XSLT and XPath are a powerful query and transformation engine, you will be able to define conditional blocks and data manipulation expressions based on these dynamic bindings.

But there’s more!

Did you notice the last binding source, the Control source?

The way it works is easy: you have to specify the server ID of an ASP.NET control available on the page and the name of one of its properties. The implementation of DataForWebPart will recursively walk the ASP.NET control tree upwards until it finds a control with the specified ID: then, with a couple of Reflection tricks the value of the specified property will be retrieved and made available to the web part rendering.

You can try this behavior adding, say, a TextBox or a DropDownList control on the page and using the value coming from the Text and SelectedValue properties respectively.

What I like most of this approach (hence the reason of this post’s title) is that you are not limited to OOTB web controls: you can “attach” pretty much any kind of control which exposes a readable property in a plain format (complex data types would be serialized using the ToString method, so the usefulness of these properties really depends on the overridden implementation of the ToString method).

By any kind of control I mean any kind of controls, including any custom control that you may develop in order to extend the XSLT* Web Parts capabilities.

From the extensibility point of view, this means that you (as a developer) can write a suite of simple web controls that are not meant to be used for their output markup, but just as a data source for existing, SharePoint web parts. Then, a colleague who is capable of building no-code solutions using SharePoint Designer will be able to leverage your extensions, using CQWPs or CoreResultsWPs without reinventing the wheel (i.e. building everything from scratch).

Nice, isn’t it?

Below you can find a sample implementation of a web control that exposes the current UI culture, and that may be useful in multilingual scenarios where you want your aggregation web parts (CQWPs, etc…) to behave differently according the the selected language.

But you can easily imagine that this technique can be applied in an infinite number of ways!

   1:  namespace GreenTeam.SharePoint2010.Multilanguage
   2:  {
   3:    public class CultureControl : Control
   4:    {
   5:      [WebBrowsable]
   6:      public Int32 UICultureLCID 
   7:      {
   8:        get
   9:        {
  10:          return Thread.CurrentThread.CurrentUICulture.LCID;
  11:        }      
  12:      }
  13:   
  14:      [WebBrowsable]
  15:      public Int32 CultureLCID
  16:      {
  17:        get
  18:        {
  19:          return Thread.CurrentThread.CurrentCulture.LCID;
  20:        }
  21:      }
  22:   
  23:      protected override void Render(HtmlTextWriter writer)
  24:      {
  25:        // Do not emit markup at all!
  26:      }
  27:    }
  28:  }

How to issue Http Web Requests to a SharePoint 2010 site with FBA and SSL

The .NET Framework provides some handy classes that help you manage HTTP communication through requests and response objects.

Everything is plain and simple, as long as you are connecting to a resource endpoint that does not require authentication and is available through an unsecure channel (i.e. HTTP). Which, of course, is not always the case.

I had a requirement to “invoke” a SharePoint 2010 resource (a file, for example) that is protected by Forms Based Authentication and is exposed by a secured SSL channel. The task is slightly more complicated, since it has to be performed by a client that has no easy way to invoke web services using an autogenerated proxy. That is, no “Add Web Reference” available. Indeed, no RAD environment at all.

You can find my solution in the code snippet below. I have written it with PowerShell just as a prototyping tool, it will have to be translated. But anyway some interesting points can be highlighted:

  • I used the .NET Fx API to “ignore” SSL certificate warnings. This may not be an option sometimes, but the solution can be extended adding some certificate chain verification or whatever you need to check. This is done setting the ServerCertificateValidationCallback static property (line 1).
  • I had to invoke the Authentication.asmx SharePoint Web Service in order to authenticate and, then, reuse the authentication cookie in subsequent requests. This is a requirement for FBA access. I handcrafted the SOAP message since there’s no easy-to-use helper/proxy (line 2-24).
  • I finally issued my HTTP request, using the authentication cookie and adding an HTTP header (line 26-28).
   1: [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

   2: $cookieContainer = new-object System.Net.CookieContainer

   3: $authEnvelope = '<?xml version="1.0" encoding="utf-8"?>

   4:                 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

   5:                   <soap:Body>

   6:                     <Login xmlns="http://schemas.microsoft.com/sharepoint/soap/">

   7:                       <username>yourusername</username>

   8:                       <password>yourpassword</password>

   9:                     </Login>

  10:                   </soap:Body>

  11:                 </soap:Envelope>';

  12: $encoder = [System.Text.Encoding]::UTF8

  13: $authEnvelopeBytes = $encoder.GetBytes($authEnvelope)

  14:  

  15: $authRequest = [System.Net.HttpWebRequest]([System.Net.HttpWebRequest]::Create("https://yoursite/_vti_bin/authentication.asmx"))

  16: $authRequest.CookieContainer = $cookieContainer

  17: $authRequest.Headers.Add("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/Login");

  18: $authRequest.ContentType = "text/xml; charset=utf-8";

  19: $authRequest.ContentLength = $authEnvelopeBytes.Length

  20: $authRequest.Method = "POST";

  21: $authRequestStream = $authRequest.GetRequestStream()

  22: $authRequestStream.Write($authEnvelopeBytes, 0, $authEnvelope.Length)

  23: $authRequestStream.Flush()

  24: $authRequest.GetResponse()

  25:  

  26: $request = [System.Net.HttpWebRequest]([System.Net.HttpWebRequest]::Create("https://yoursite/yourcontent"))

  27: $request.CookieContainer = $authRequest.CookieContainer

  29: $request.GetResponse()