How to call web service method from Web content display in Liferay 6.2? - liferay-6

I am creating a page using Liferay 6.2 where i need to display html contents sent as response from web service method. After seeing the customization and features available in web content display, i am planning to use them. As i am new to VM and FTL, i am not sure how to call web service method from web content display content. Please help me.

You can create a custom velocity tool as explained in this post.

Related

Is it possible to create a MVC application that navigates like Facebook?

Facebook seems to have a single page where the content changes based on user interaction.
For example: If I click on somebody's post, the url changes to the user's profile/posts/.
Now I'm sure this is possible to implement on MVC.
Can somebody help me get started?
Perhaps some reference/sameple/tutorial (I believe this will heavily involve configuring the routings).
Sure, that's called Custom Routing. You can set up custom routing in the routeconfig.cs file in your project (for pre-MVC4, routing is in Gloabal.asax). Then you just use an Actionlink Helper to build your links.
Read More: http://www.codeproject.com/Articles/641783/Customizing-Routes-in-ASP-NET-MVC

How to hide a navigation bar in liferay theme based on the custom service response?

I am working on lIferay 6.2 portal developement where I have requirement where i have to hide a navigation bar in liferay theme based on the response from custom service. and let me know is it possible to make only one web service call for checking this condition in liferay theme and use the same response in liferay portlets present in same page? thanks in advance.
You can write hook with Custom ServicePreAction implementation.
By overriding servlet.service.events.pre=com.custom.CustomServicePreAction
In your Custom ServicePreAction, you can make call to webservice and set some request attribute to define whether navigation should be shown or not.
In theme's vm you can get request attributes by $request.getAttribute("attrname")
Haven't tried this but hope this would help you.
Regards,

Forcing page reload from Vaadin portlet

Is there an easy way to force the entire page to reload from Vaadin? I have a portlet which affects the header value displayed which is pulled from IBM WebSphere's dynamic cache in a separate JSP.
I am porting over an old JSF portlet to Vaadin which depending on page reloads between actions to reflect the new value in the header template. So now I need to force the entire page (not just the portlet) to reload to make it appear that the action took effect.
You can reload the hosting web page with JavaScript:
getMainWindow().executeJavaScript("window.location.reload();");
I think this should also do the trick in a portal.

Events triggering loading content on Facebook's timeline

I am working on Apache Nutch modification project. We already swapped Nutch's original module with ours built using HtmlUnit. I need to download whole Facebook user site (ex. http://www.facebook.com/profile.php?id=100002517096832), which is going to be parsed using our own parser. Unfortunately Facebook is using mechanism called BigPipe (http://www.facebook.com/note.php?note_id=389414033919). That's why most of current website is hidden in <.!-- --> tags.
Usually when we scroll down Facebook page, new content is being unpacked every time we are about to hit bottom of the page. I have tried to use Javascript that scroll my htmlPage (HtmlPage object from HtmlUnit project), but finally I realized that scrolling is not triggering loading new content on Facebook user site.
How can I check, what event on page triggers loading content on current Facebook page? Maybe I should approach problem from different side, for example try to extract BigPipe "things" on my own? Have you ever did that?
Before dealing to your question … what kind of project are you trying to build there?
Since Apache Nutch is an open source web-search software, I think you are trying to build some kind of search engine, that scrapes Facebook user profiles/feeds to get data and make it searchable on some third-party website?
Well, that would be a violoation of Facebook Platform Policies:
I. Features and Functionality
12. You must not include data obtained from us in any search engine or directory without our written permission.
So, do you have that written permission?

How to use normal ajax request on any jsp/servlet to get response

I want to create login form in CQ5 using normal JSP & AJAX request with database. Can any one tell me the steps how to use normal JSP and AJAX in CQ5?
At the server-side, an AJAX handler can be implemented the same way as an HTML handler, in CQ5. Create your CQ template with a standard backing component. In your component, code your JSP as your normally would, following CQ best practices such as including "/libs/foundation/global.jsp" (or your overridden version of this). You'll have access to all normal JSP objects such as request and response. global.jsp also includes JSTL, so you've got access to standard taglibs.
As for connecting to a database, see my other answer, External Database with Adobe CQ5.