Introducing the Liferay SDK for Windows

Greetings to all! smiley

As a proud member of this community, I always wanted to show my appreciation towards Liferay, its philosophy and the great people behind it. And that's why I spent the last few weeks building something to share with the whole community, in the hope that it will be useful in your projects and with the ultimate goal to enrich the Liferay ecosystem. So, without further ado, let me introduce...

Liferay SDK for Windows

The Liferay SDK for Windows is a new block in the Liferay Mobile SDK project. It consists of a Portable Class Library (PCL) for the .NET platform which enables your apps to easily consume the JSON web services exposed by Liferay and your plugins. It is written in C# and to date it targets the following platforms:

  • .NET Framework 4.5.1
  • Windows 8.1
  • Windows Phone 8.1

Anyway, it should be relatively easy to extend support for older platforms, so let me know if you're interested!

The Liferay SDK for Windows is an accurate port of the official Android and iOS SDKs and therefore it supports the same set of features, such as batch and asynchronous requests, non-primitive and binary arguments, and so on. But a simple example is worth a thousand words:

using Liferay.SDK;
using Liferay.SDK.Service.V62.BlogsEntry;
----
var session = new Session(new Uri("http://localhost:8080"), "test@liferay.com", "test");

var service = new BlogsEntryService(session);

var entries = await service.GetGroupEntriesAsync(10184, 0, -1, -1);   // Async call!

// entries is a IEnumerable<dynamic> collection

foreach (var entry in entries)
{
    Console.WriteLine(entry.title);   // Duck typing!
}

The SDK library is generated by a template-based builder written in Java which integrates with the official Liferay Mobile SDK (thanks to Bruno for his help!) and can be used to generate the service classes for your custom plugins.

So now, where can you find it?

The Liferay SDK for Windows is available on NuGet:

Install-Package Liferay.SDK

While the source code of the SDK and the Java builder is available on GitHub!

I hope this little project will be useful, and let me know what you think, if you find any bugs, etc. Any feedback is more than welcome! smiley

5
Blogs
Wow Andrea! This is so AMAZING!! Thanks a lot for contributing this to the Liferay community!
Juan
You did an awesome job! Really interesting to see how you applied the some concepts of Mobile SDK to a completely different platform.

Congratulations!
Great work Andrea! ;)
You rock! ;)

I'm a little bit far from developing solutions using M$ applications but I think that your SDK could be a great starting point for developers that want to, for example, integrate some Liferay Services -native or custom- inside a SharePoint server or in a Dynamics CRM! ;)

Thanks for your effort! emoticon

Ciao, J.
Hi! Awesome, but, this would be even MORE awesome if it was compiled for use with iOS/Android for Xamarin!
Just hopeful, I tried to add the nuget package into a Xamarin ios project, and, not unexpectedly, got:

Adding Liferay.SDK...
Adding 'Liferay.SDK 6.2.0.3' to MyFirstXamarin.
Could not install package 'Liferay.SDK 6.2.0.3'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Anyway the package could be rebuilt to support Xamarin?

I'm very new to C#, but, I'm thinking this code should work without changes.
Sorry, my response was to Jader, meant it to be to Andrea, re: Xamarin port.