I am new to liferay and using Liferay7. Now Instead of adding iframe manually in the portal i want to make a module and add it as a portlet and then want to make the iframe url dynamic so that i can change the url of the iframe based on some UI action in the portal. Any suggestions as to how it can be done?
If you aware, there's already liferay iframe portlet available.
http://www.liferay.com/community/wiki/-/wiki/Main/Iframe%20Portlet
You can either customize it or write your custom iframe event portlet.
Custom iframe event portlet will listen to any events from other portlet and act accordingly. You can write event portlet using following link, check for Event Inter-portlet Communication
https://web.liferay.com/community/wiki/-/wiki/Main/Portlet+to+Portlet+Communication
From other portlet you can either trigger this event which will force iframe portlet to change url.
Related
Does anybody know how can I log to a file the creation/deletion event for an user in Liferay 6.2? Is there any 'listener' that I must watch for or any action (struts action) that can be overwritten to achieve this?
I successfully used a hook to log the login and logout events, using custom action and portal properties.
If anybody knows a way to log certain events (e.g. adding user to an usergroup or something similar) using custom code (maybe JSP), please share with me.
This will be helpful
Its a tutorial to override liferay service action.
http://proliferay.com/liferay-service-hook-override-liferay-service/
I am working on a portlet which accepts the portlet ids and renders those portlets. So, basically you can think of something like a container portlet.
When the container portlet has a value <use-default-template>false</use-default-template> in liferay-portlet.xml, everything works fine. It is able to render the portlet via tag <liferay-portlet:runtime portletName="1_WAR_sampleportlet" />
But, if I make the entry <use-default-template>true</use-default-template> for the container portlet (or just remove the tag, as default is true), it simply ignore the <liferay-portlet:runtime /> tag and shows nothing.
The other information are
Liferay version : liferay 6.2 EE
Java version : Java 7
Portlet Type : Spring MVC portlet
Please refer below links, as this question is already answered earlier in stackoverflow.
use-default-template configuration tag does not work
Also, not that if you disable "use-default-template" then Liferay is doing exactly what you requested: It does not display any default controls and only shows the content created by the portlet's render() method.
So if you need to have a configuration link (or a remove button or any other control present in the default template), your portlet has to render it on its own.
I have to create a little webshop for a school-project, but entered in to a problem during the process by updating/refreshing the Servlets.
Description:
I created an index.html file which includes two servlets via iframes, the left side for Navigation-Servlet and on the right the Controller-Servlet does something to show a welcome page (or shows off the categories etc.) - works all fine.
But now I have to implement a login with an small administration.
By clicking in the navigation on Administration, it leads to another Servlet called Administration-Servlet, in the right iframe (actually not over the Controller-Servlet).
There comes up a login mask, where the user put in his username and password. If the login was correct, it leads then to the administration content (not finished by now).
The upcoming problem is now that I somehow have to update/refresh the Navigation iframe too, when the login was successful because there must be the Logout-Button and some entries have to be hidden.
By which "technique" or pattern I can solve this problem? Maybe a little code example would be helpful. :)
Best greets.
Instead of using Iframes to put together the different parts of your site, use dynamic include in your servlets. This will allow you to build the response page server side and therefore dynamically change what is included in a page. When you log in you send the authentication request to the servlet which will then dynamically construct the new response from multiple JSP files.
<jsp:include page="..." />
Another solution is to use a scripting language like Apache Velocity Template scripts to build your responses dynamically. Allowing you to include or exclude information depending on parameters or session context.
I have created a liferay portlet using mvc (jsp ) and i'm using JQuery for datatable.
I have succeeded to bring a list and display it on a table using Jquery.
Now, I'm trying to make it editable to use CRUD functions.
The problem that i'm using java not php and i couldn't assign a servlet function (doget).i didn't understand it well (how to use it) and they set the url of this class to jquery.
If i'm not wrong this would be configured in web.xml (servlet mapping). So i wonder how to properly configured and use it?
Also, i don't know jquery but it seems that the buttons needs to be manually included. is there any method to include them directly? (with jquery looks and pop up).
Servlet comes in 2.4 version i had troubles changing it to 3.0 using eclipse.
Best Regards
If you use web.xml and servlets, you are out of liferay and the implementation for user login, themeDisplay, permissions and other features. This way is dificult and improductive.
Better choice is override the method "serveResource" of your portlet, in this method you have all control like in servlets and you can use other features of liferay.
In this question you have an example and more information:
respond to http request with json object in portlet
Currently I am working on liferay 6.0
In my project I need to show a page in iframe. I have added iframe in my jsf page. When user request that jsf page whole page works fine but that iframe doesnt show respective page. Except that it shows that page not found and in console side gives message Current URL generates exception:null.
Please somedbody tell me how can I use iframe in portlet.
You should set the URL of the desired JSF page as the src of the iframe, and set the iframe as the content of the portlet.