Using Liferay portlet in an external application - integration

I have a legacy web application that I want to enhance by adding a message board. Is it possible to add the message board portlet of liferay into this external application.
I am a newbie so pardon my naivity if I've overlooked something obvious.
Many Thanks

No this is not possible. Liferay is a portlet container that implements JSR 268 portlet specification. All portlets that can be installed in Liferay conform to this specification.
So, if you have a legacy application, which obviously isn't a portlet container, you can't install portlets into it.

Embedding a portlet container in your webapp, just for being able to use Liferay's Message Boards (which isn't THAT good anyway), seems like a huge overkill...
In which language is your application written and which framework(s) do you use? Do a Google to see if there are any projects that you can start from or integrate in your app.

Both the answers in my view are correct limburgie and kgiannakakis, still I would like to add something which may be a little useful.
There is an interesting feature of "Sharing" in liferay with which you can embed portlets as widgets into any application.
But the only catch is that Liferay Server should also be running while your Application is also running on the same or another server.
For more information on sharing you can visit this link.

Related

TideSDK with Spring MVC

Just wondering, is it possible to turn spring mvc web development content into a desktop application using TideSDK? Both are using HTML5 as the front-end. Then, as for the back-end process, it should be able to reuse the java code inside spring mvc.
I just finish a web project that was developed using spring mvc, and there is a request to turn it into a desktop application. I was looking around and found that you can use HTML5 for creating desktop application. It would be nice if I can directly convert it to desktop.
Thanks for the response :D
Unfortunately the answer is no. TideSDK has support for different server languages, such as PHP and Python, but Java is not one of them.
What you could try is to make the app a shell for the webpage. So when the app starts it immediately loads http://yoururl.com, the behavior would be exactly the same as in a webbrowser.
Note that when you load any remote URL, all native functionality would not be available to the page.

Is there a way to setup a Netbeans HTML5 and Web application project?

The new Netbeans 7.3 Beta 2 adds a really nice feature for creating an HTML5 application. It also provides a great way to create a Java Server based Web Application. But there does not appear to be any way, within the Netbeans IDE, to take advantage of both technologies in one project.
Is there a way combine these two type of projects, so there is only one web directory structure with both the HMTL5, js, and web services files?
This is definitely planned for the next release, but it is not yet possible in NetBeans 7.3. You can follow this enhancement request to see progress in this area: http://netbeans.org/bugzilla/show_bug.cgi?id=222236. If you'd like to experiment with this, you can build NetBeans with the patch attached to that issue.

How to integrate WebSockets on top of a classic ASP web application?

In one of my projects, I have a very active classic ASP site with a requirement to integrate live event-based feeds as part of the existing UI. There is a plan to upgrade the site architecture to either MVC or MVP in the future, but this new feature must be implemented in the meanwhile.
I have decided to go with a WebSocket approach for this, as this is ultimately what we will want to use in the future, and rebuilding this doesn't make sense. The question is, how to integrate this with the classic ASP "architecture"?
The site already implements the jQuery library, and was hoping to leverage jQuery's capabilities to create those streamed sections on a given page.
The current req's ask for this news feed to exist on every page. Thus, loading a new page will re-render the news feed, and should kick of from where it left on the last page. For this, I'm guessing a position indicator will need to be read (session variable I'm guessing).
Anyhow, those are the requirements. I was thinking of wrapping the the entire existing classic ASP site inside a MVC or MVP (C#/.Net) project to allow us to begin swapping out legacy features as they are developed, such as this one.
I would like to get some advice on some recommended approaches for this scenario.
Thanks.
I would do a SignalR app and integrate it in you old app.
It's easy to integrate ASP classic with ASP.net MVC. Just mix the projects and exclude *.asp from the routes
routes.IgnoreRoute("{resource}.asp/{*pathInfo}");
You will have some trouble in the root (/), but you can sort it with a redirect.
For a mixed authentication (if you need it) you will need to write your own authentication in MVC to use the same auth cookie that you use in Classic ASP. I've done this in the past with success.

Scribe and Spring Social integration for accessing LinkedIn APIs

A couple of days back I was tasked with integrating Scribe and Spring Social for accessing LinkedIn APIs. Development environment being Windows, Spring and Java.
Spring Social's (spring-social-core-1.0.0.M1.jar) LinkedInTemplate uses org.scribe.extensions.linkedin.LinkedInBaseStringExtractorImpl. (Log messages showed "NoClassDefFoundError" for LinkedInBaseStringExtractorImpl) This class is present in scribe-1.0.7.jar but not in the latest jar i.e scribe-1.1.0.jar (downloaded at https://github.com/fernandezpablo85/scribe-java).
I couldn't find a way to fix this issue. But I was able to do a quick hack: on my local machine, I copied LinkedInBaseStringExtractorImpl from scribe-1.0.7.jar into scribe-1.1.0.jar. Everything works like a charm now.
I am curious to know if anyone else faced similar issues.
What you say is right. Scribe changed it's internals from 1.0 to 1.1 (and greater), though the public apis didn't change, some internals did, and this class LinkedInBaseStringExtractorImpl is no longer part of the lib.
Anyway, you don't need SpringSocial at all, check the LinkedIn example to see how to consume LinkedIn's Api using just scribe.

Creating a Groovy Portlet

I am getting started researching / creating a groovy portlet that will connect to a REST based ESB service that returns JSON; I will also need to pass the username in the headers. I was wondering if there are any examples out there on how to create the portlet and set the headers? I am new to groovy and from what I understand this can be accomplished rather easily. Essentially I want a portlet that will allow a user to search for a widget via a search box and return a list of matches. Not sure that it matters but the portlet will be deployed to the Vignette Portal. Any info would be much appreciated!
Thanks in Advance!
Doing a portlet with Java/Groovy is very doable with Spring Portlet MVC. I used some sample code from various sources a year ago but googling on it will give you more modern examples and let you pick something more applicable to your app. The real issue comes up with how you plan on building your app. Gradle is the best option for writing a Groovy web app.
However if you are talking about using Grails, then it becomes much more difficult and I would not advise learning Grails as you are trying to get it jammed into a 'portal' implementation. There are plugins for Liferay and 'portlets' in Grails but when I last looked at them earlier this year, they did not seem fully baked.
Calling REST based services with JSON or whatever from your server code doesn't have to care that you are in a 'portal'. The big issues comes up when you are trying to create the UI with your portal provider specific APIs. Don't be fooled into thinking you won't be using portal specific stuff. We used Liferay a bit and from my perspective the Portlet spec was very slim so to do much of anything interesting in a portal, you have to use some portal specific stuff, at least for UI and authentication services.
So my suggestion is build a Gradle Groovy Web project and use the Spring Portlet MVC Java examples to get something going and then you can simplify with Groovy as it makes sense. Initially you might want to simply start with Java if that is your comfort zone because integrating with your portal might be daunting enough without trying to learn a new language to boot.