« Back

Scala infrastructure in plugins SDK

Company Blogs March 26, 2012 By Miguel Ángel Pastor Olivar Staff

 

I am an Scala enthusiast; I must to admit it :) ! It allows me writing clear and concise code having all the advantages of an extremely powerful type system, functional and object paradigms  among another such things.
 
But this is not a blog post introducing Scala benefits (you can see a very quick intro to the language https://github.com/migue/blog-examples/tree/scala-blog-examples/scala-talk) but talking about including it in the Plugins SDK so we can use it to develop our new portlets based on Scala.
 
This is a very quick overview on what you can do with the ongoing work (https://github.com/migue/liferay-plugins/tree/scala-support-infrastructure). I need to make some minor hacking but I hope to be pushing it to master during this week (if the child allows me to do it). Let's get started:
 
  • You can create a new Scala based portlet by executing the create script: create.sh portlet_name porlet_display scala
  • The previous command line execution will create a basic infrastructure with all the artifacts we need: a build.xml file, all the Scala library needed and a simple portlet class.
  • Using the previous build.xml file we can compile Scala code, Java code, use scalac (the single one compiler and the daemon) and make our deployments. This infrastructure will take care of the mixed compilation process if you are using both Java and Scala as your development languages for your new portlet.

I have some more work to do, like including a command in order to allow updating the Scala libraries with a specific version or generating IDE files in an automatic way. The current version is working fine but I hope to improve during this weekend and push it to master.

Short entry; hopefully I will write a more detailed one with some more news: I am working on building an Scala wrapper on top of the Liferay API . . . so stay tunned!! 

Hope you like it!

 

Threaded Replies Author Date
Great work! I haven't used Scala yet, but I've... Jeffrey Paul Handa March 27, 2012 8:35 AM
Any plans to also provide a scala portlet... Jonas Fonseca March 28, 2012 7:50 AM
Not for the moment (at least for me :) ) Miguel Ángel Pastor Olivar March 28, 2012 7:56 AM
pretty cool Arcko Duan April 1, 2012 2:02 AM
[...] Liferay is Java-based, but you don't have... Anonymous April 11, 2012 8:48 AM
Great! I'm enjoying learning some Scala and I'd... Cleydyr de Albuquerque August 17, 2012 12:17 PM
Any recent updates on where we are with scala? ... Atul Patel March 12, 2013 11:09 AM
the code is very old, is this reported as a... Avinash R January 29, 2014 11:15 PM
I did a quick announcement here... Miguel Ángel Pastor Olivar January 30, 2014 5:09 AM
I am just getting into Scala , love it ! For... Jack Bakker April 4, 2015 12:55 PM

Great work! I haven't used Scala yet, but I've had a few people in training ask about our support. I'll be sure to point them to this post.
Posted on 3/27/12 8:35 AM.
Any plans to also provide a scala portlet archetype in the liferay-maven-plugin project?
Posted on 3/28/12 7:50 AM.
Not for the moment (at least for me emoticon )
Posted on 3/28/12 7:56 AM in reply to Jonas Fonseca.
Posted on 4/1/12 2:02 AM.
[...] Liferay is Java-based, but you don't have to be a Java expert to use it or create websites with it. In fact, suppose you are a Scala expert? Miguel demonstrates that even Scala fits into the Liferay... [...] Read More
Posted on 4/11/12 8:48 AM.
Great! I'm enjoying learning some Scala and I'd like to have some hands-on with that language developing some portlets. Good work!
Posted on 8/17/12 12:17 PM.
Any recent updates on where we are with scala? Will it be added as an option to LDS?
Posted on 3/12/13 11:09 AM in reply to Cleydyr de Albuquerque.
the code is very old, is this reported as a feature in liferay issues? I'd like to see this in the main SDK.

github status: "This branch is 7 commits ahead and 3502 commits behind master".
Posted on 1/29/14 11:15 PM.
I did a quick announcement here https://www.liferay.com/web/miguel.pastor/blog/-/blogs/a-quick-update-about-the-­scala-support-in-liferay-sdk

We are doing a refactor of the SDK so I haven't pushed it yet but I hope it will be available in the near future.

I will rebase my changes in top of the latest commits of the master branch and update my Github repo
Posted on 1/30/14 5:09 AM in reply to Avinash R.
I am just getting into Scala , love it ! For maven users, any plans for a liferay-portlet-scala-archetype ?
Posted on 4/4/15 12:55 PM.