Scribe and Spring Social integration for accessing LinkedIn APIs - integration

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.

Related

Static notification in Android application [AS3]

A few days ago I've been looking for a solution to using a Push Notification, but I have not found ANE's functional for the problem.
I'm finalizing an application in the ActionScript3 language, and I only found something related to Cloud Messaging, which is something much more advanced than I need.
I try to present a simple Push Notification to the user, static, only with Title and Message. However, I could not find ways to find such a resource.
Does anyone using the ActionScript language have achieved the feat of using Push Notifications without Google's Cloud Messaging feature? Waiting for answers :)
I went after explanatory projects on GitHub, but 60% of ANE's content is cloud-centric or not working. In addition to having some I'm not targeting the AS3 language.
why you don't try local notification?
in this ANE you can display local notifications with only a few lines of code
I have the same project and use this ANE, it works like a charm
https://airnativeextensions.com/extension/com.distriqt.Notifications

Faye Client for ActionScript3

I'm looking for a pub/sub messaging system to connect various applications I'm building, some of them will be iOS, other ones AIR/AS3 and maybe some openFrameworks.
I found out Faye and it looks like really interesting. I've found libraries to integrate it in all my apps/languages, so I'm trying it out.
Now, the problems are with the AS3 implementation. I've found this great library and it's kind of working, BUT I've some issues I can't understand. My main problem is that I can build clients, connect them to a node.js server and exchange information between them, but after a while they stop receiving information.
So I was wondering:
do anyone of you have experience with Faye and this library, and knows if this behaviour it's normal and if there's a way to prevent it? I've done some tests using some html browser clients and everything was ok, so it's definitely a flash library problem
do you know any other library to implement Faye in AS3/AIR? I was browsing a lot but I couldn't find anyone
Do you know any alternative pub/sub messaging system I could implement (easily) in as3?
Thank you
We've open sourced our implementation of AS3 Faye client recently. You can find it here.
It's been in prod for more than a year and was tested by millions of users, without issues so far. It's used in Flash Player Web and AIR Mobile applications.
Interfaces mimic JS client interfaces, so its setup is as easy as JS client setup. Plus one additional feature: multiple urls for reconnection fallbacks.
Give it a try!

What is the purpose behind building of Apache Sling, Felix, Jackrabbit projects

I am asking a very basic question here.
Question is
I am using Apache Sling , Apache Jackrabbit, Apache Felix in my project as said by my instructor. I am trying to understand why these software is developed by Apache. I tried a lot on the internet,, but I didn't find any blog or wordpress blog, or any useful youtube video that explain all these projects. Can you explain me about these projects.
Why these projects developed?
What they do ?
and more questions like this
Previously I found the same doubt with Apache Hadoop, but all the material that I found on net is sufficient for me to get a feel of this project. This time I am struggling with Sling, Felix, Jackrabbit.
I will be very thankful for you. Waiting for your kind response.
The combination of Apache Jackrabbit, Apache Sling, and Apache Felix allows you to build web application.
Apache Jackrabbit is the reference implementation of the JCR API. The JCR API is to manage content repositories; to manage, for example, web content. A content repository is a mix between file system and a database.
The JCR API is specially made to deal with web content. Why use the JCR API, and why not use a relational database API? URLs are hierarchical, as in a file system. Relational databases don't easily support hierarchical access. Why not use a file system API? Because the JCR supports transactions, versioning, and a lot of other features that file system APIs don't support.
Apache Sling is a web framework based on the JCR API, and taking advantage of the features provided by the JCR API (15 Minute introduction).
Apache Felix is an OSGi container. It allows to seamlessly start, stop, and replace components of a web application (jar files, in a sense), while the web server is running. That means it allows you to change the application without having to restart the server.
Sling in very simple terms could be described as a REST API for JCR. you can use http requests to manage content inside the repository.
Additionally, Sling provides a mechanism to render that content in different ways for web consumption. you can use scripts (JSP for example) and the java code (servlets, pojos, etc) in the Felix container to process requests and deliver a request.
When a request is made for a particular node, Sling looks up for a property called sling:resourceType, this is a lookup key for rendering scripts. Then the appropiate script is executed using the node as input.
You could write different kinds for renderers and then use it to display your content in different ways.
For example, you could write two scripts full.json.jsp and short.json.jsp and then use them to render the same node in two different ways:
/content/app/node.full.json
OR
/content/app/node.short.json.
Sling basically matches tokens in the request URL to select an appropriate script.
They have a really nice cheat sheet that explains how request resolution and rendering works
it is a bit more complex than this, since everything is organized in resources and components. you want to check their site for more info
I had the same doubts. The best response I was able to find is in the official Sling page (https://sling.apache.org/)
(What is) Apache Sling, in a hundred words:
Apache Sling is a web framework that uses a Java Content Repository, such as Apache Jackrabbit, to store and manage content.
Sling applications use either scripts or Java servlets, selected based on simple name conventions, to process HTTP requests in a RESTful way.
The embedded Apache Felix OSGi framework and console provide a dynamic runtime environment, where code and content bundles can be loaded, unloaded and reconfigured at runtime.
So, resuming it:
Sling is a web framework --> using jackrabbit --> based/supported on JCR API.
You can see Apache Felix like a container with its manager.
Note that Sling started as an internal project at Day Software. It's the reason why some bundles/libraries are named like com.day, but in the ends they are two names for the same.
Also, if you want to be clear about Jackrabbit and JCR API you can visit the Jackrabbit's official page http://jackrabbit.apache.org/jcr/jackrabbit-architecture.html

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.

Using Liferay portlet in an external application

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.