Foros de discusión

RE: Primefaces with Iframe login

S P, modificado hace 11 años.

Primefaces with Iframe login

Junior Member Mensajes: 58 Fecha de incorporación: 6/08/12 Mensajes recientes
Hello All,
I have created one portlet using primefaces template ,similiar looks like gmail inbox layout(header,left and center) ,all works fine.
in the header i have signout and signout ,which is liferay out of the box portlet(58).
i am not able to render login portlet inside the center layout..
i have thought of creating iframe and <iframe SRC="/c/portal/login"/>,its working fine but once logged in this opens with small liferay ,like inner portlet...
http://localhost:8080/web/guest/home..and if i do refresh again it fits into whole browser.


is there any way after logging in ,it should refresh whole browser,or any other idea please share,also i was thinking if we have liferay login porltet using jsf2/primefaces,
like https://github.com/liferay/liferay-faces/tree/master/demos/portal/jsf2-registration-portlet


Thanks in Advance.
thumbnail
Neil Griffin, modificado hace 11 años.

RE: Primefaces with Iframe login

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
When you wrote:
i am not able to render login portlet inside the center layout..


Is that the problem you are trying to solve? If so, then you can embed any portlet (like the out-of-the-box sign-in portlet) inside the page's Layout Template or in the Theme. Additionally, you can use the Nested Portlet to get portlets to be grouped together.
S P, modificado hace 11 años.

RE: Primefaces with Iframe login

Junior Member Mensajes: 58 Fecha de incorporación: 6/08/12 Mensajes recientes
Hi Neil,
I have tried to use your sample code for Login using primefaces on LiferayGa2 ,it works fine.but as my complete project suite runs on LiferayGa1.war ,
default liferay signin functionality is working in iframe but i need to refresh,could you suggest how to fix this.

Could you suggest or any sample or links how to do the following ...
how to do Nested Portlet to get portlets to be grouped together.?
or any other samples will be grateful.
Currently i am stuck emoticon
Thanks in Advance.
thumbnail
Neil Griffin, modificado hace 11 años.

RE: Primefaces with Iframe login

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Here is a Nested Portlets wiki page that might help.
S P, modificado hace 11 años.

RE: Primefaces with Iframe login

Junior Member Mensajes: 58 Fecha de incorporación: 6/08/12 Mensajes recientes
Hi Neil,
Thanks a lot for providing me the information for nested portlet.i have tried ,as per the nested portlet i can move portlets into nested portlets.
but it will be great if any solution around using jsf/primesfaces and liferay as all the solution i am building is based on jsf on top of liferay in 6.1 ga1 version.
Here i am able to do using primefaces p:layout and template pattern but when i tried to embed login using iframe ,its logging in but i need to refresh to disappear iframe screen and even i have tried using Nested portlet but its not fitting with the following layout,so any thoughts will be really appriciate.Also using jsf i donot have to worry about IPC as i have handlded through manage bean.and every time no need to reload the page.
top i am using header.xhtml
left i am using leftmenu.xhtml(inbox,compose functionlity) and inbox is pointing to inbox.xhtml etc
and center i have placed iframe login url emoticon

________________________________________________________
--------------------------------------------------------------------------------------------|SIGNOUT|
|--------------------------------------------------------------------------MYACCOUNT|LINK1 --|
| HEADER |
|----------------------------------------------------------------------------------------------- |
| | |
| | _______________________ |
|INBOX |
| | | |
|COMPOSE | LOGIN PORTLET BOX |
| | | | |
|SENTMAIL | |
| | | |
| | |_______________________|
| |
|

Thanks in Advane for your help.
thumbnail
Neil Griffin, modificado hace 11 años.

RE: Primefaces with Iframe login

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Let me ask a more basic question -- is there a reason/requirement why you need to use an <iframe> ? Wouldn't it be easier to simply have the login portlet directly on the page? That way, when you click submit, the full HTTP POST would cause the portal page to be refreshed.
S P, modificado hace 11 años.

RE: Primefaces with Iframe login

Junior Member Mensajes: 58 Fecha de incorporación: 6/08/12 Mensajes recientes
Hi Neil,
Thanks for the reply.
There is no requirement for using iframe but as i am using primefaces p:layout with template leftmenu ,header page and center in the main template.
so in the center layout i want to bring login portlet,it can be default login but default login is coming on the back side of the template frame to bring it forward i thought either i have to use iframe or any other solution.

basically to call the login portlet inside primefaces p:layout.

I am Sorry if i am not clear about the requirement.

Appriciate your help.
Thanks in Advance.
thumbnail
Neil Griffin, modificado hace 11 años.

RE: Primefaces with Iframe login

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
If possible, could you attach a screen shot of the way you would like it to look when finished?
S P, modificado hace 11 años.

RE: Primefaces with Iframe login

Junior Member Mensajes: 58 Fecha de incorporación: 6/08/12 Mensajes recientes
Hi Neil,
Sorry for late reply.
Sorry i could not get much time so draw in paper and uploaded the url,i will be sening soon the proper screen shot,but roughly i am trying to achive as per the screens.
Please find the link
screen1
screen2

Ist image which is before login and 2nd image is after login.

Please suggest how to display default liferay out of the box sign-in portlet in the center p:layout.

screen1 i have developed using primefaces p:layout
primefaces
in the maintemplate i am unable to call login portlet which is liferay login
so i have tried to use iframe,please suggest me if any other way is there.


Thanks in Advance.
thumbnail
Neil Griffin, modificado hace 11 años.

RE: Primefaces with Iframe login

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
When you wrote:
screen1 i have developed using primefaces p:layout


Is the top rectangle/banner in screen1 (test image, logout/signout) part of the Liferay Theme or is that part of your PrimeFaces p:layout?
S P, modificado hace 11 años.

RE: Primefaces with Iframe login

Junior Member Mensajes: 58 Fecha de incorporación: 6/08/12 Mensajes recientes
Hi Neil,
Thanks Neil.yes i have created top header banner page using primefaces p:layout on the top page
<p:layoutUnit position="north" size="100" header="Top" resizable="true" closable="true" collapsible="true">
<h:form>
<ui:include src="/templates/top.xhtml" />
</h:form>
</p:layoutUnit>


Thanks in Advance.

Appreciate your help.
thumbnail
Neil Griffin, modificado hace 11 años.

RE: Primefaces with Iframe login

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
If you have a custom Liferay theme (not using an out-of-the-box one), then when you get a chance, please paste the the portal_normal.vm file from your theme. Thanks.
S P, modificado hace 11 años.

RE: Primefaces with Iframe login

Junior Member Mensajes: 58 Fecha de incorporación: 6/08/12 Mensajes recientes
Hi Neil,
Please find the portal_normal.vm i am using,Also please suggest if you have any idea how to fix the above issue .i am stuck now emoticon
portal_normal.vm

<!DOCTYPE html>

#parse ($init)

<html class="#language("lang.dir")" dir="#language("lang.dir")" lang="$w3c_language_id">

<head>
<title>$the_title - $company_name</title>

$theme.include($top_head_include)
</head>

<body class="$css_class">

$theme.include($body_top_include)

#if ($is_signed_in)
#dockbar()
#end

<div id="wrapper">
<a href="#main-content" id="skip-to-content">#language("skip-to-content")</a>



<div id="content">

#if ($selectable)
$theme.include($content_include)
#else
$portletDisplay.recycle()

$portletDisplay.setTitle($the_title)

$theme.wrapPortlet("portlet.vm", $content_include)
#end
</div>

<footer id="footer" role="contentinfo">

</footer>
</div>

$theme.include($body_bottom_include)

</body>

$theme.include($bottom_include)

</html>
thumbnail
Neil Griffin, modificado hace 11 años.

RE: Primefaces with Iframe login

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Thanks for sending all the screenshots and code. I think I now understand the requirements that you are trying to satisfy. emoticon

I would recommend that you not pursue the <iframe> approach, as I don't think it is going to work out in the end.

Instead, there are two approaches that I can think of that will satisfy your requirements:

Approach #1) Use the Velocity Template features inside the Liferay Theme (or perhaps the Liferay Layout Template) in order to dynamically render the jsf2-login-portlet and jsf2-registration-portlet.

Benefit: The jsf2-login-portlet and jsf2-registration-portlet remain in their existing (separate) WARs, which is very modular.

Drawback: You can't use PrimeFaces to layout the jsf2-login-portlet and jsf2-registration-portlet.

Approach #2) Develop a monolithic-primefaces-portlet that contains all of the source code (Java, XHTML, etc) from the jsf2-login-portlet, jsf2-registration-portlet, and your custom mail-portlet. You would need to use <ui:include src="..." /> in order to include the appropriate Facelet compositions, depending on whether-or-not the user is logged-in.

Benefit: You can basically have a full-screen PrimeFaces portlet and allow PrimeFaces to control the layout of everything.

Drawback: You lose the modularity of separate portlet WARs.

I think that Approach #1 might be better, because the modularity would be more flexible when you need to develop other portlets (other than your custom-mail-portlet).
S P, modificado hace 11 años.

RE: Primefaces with Iframe login

Junior Member Mensajes: 58 Fecha de incorporación: 6/08/12 Mensajes recientes
Hi Neil,
Thank you very much.
I will ist try with jsf/primefaces and i will keep posting,on this.

Thanks in Advance.