Fórum

[Resolved] Unexpected EDIT mode for my portlet on welcome pag

Nicolas BODIN, modificado 16 Anos atrás.

[Resolved] Unexpected EDIT mode for my portlet on welcome pag

New Member Postagens: 13 Data de Entrada: 29/11/07 Postagens Recentes
Using in Windows VISTA, tomcat and JDK 1.5 Liferay 4.3.4

I have defined two portlets (deployed as a war file).
My portlets supports EDIT and VIEW

When I am logged in i can create a page a place my portlet on a public welcome page. The administrator use the edit mode
to configure the portlets, then restore them to VIEW Mode.

So far everything is fine.
Then I Sign out from liferay portal (log out) and I am redirected as a guest to the welcome page :

unfortunately, some (3 out of 6) of my portlets instances are in EDIT mode !

Additonally, the portlet in EDIT mode have on the title bar the message "Return to full page" (And they are NOT maximized).

Even if as a guest I click on the portlet to force them back to VIEW mode (it works), if I come back late the
portlets (the same) are STILL in EDIT MODE.

Any Idea ? A Liferay bug or an issue in my (simple) config files ???

Thanks to all

<!--?xml version="1.0"?-->


<liferay-portlet-app>
	<portlet>
		<portlet-name>simpleATPIPortlet</portlet-name>
		<instanceable>true</instanceable>
	</portlet>
	<portlet>
		<portlet-name>chartATPI</portlet-name>
		<!--icon>/icon.png</icon-->
		<instanceable>true</instanceable>
		<!--header-portlet-css>/css/test.css</header-portlet-css>
		<header-portlet-javascript>/js/test.js</header-portlet-javascript-->
	</portlet>
	<portlet>
		<portlet-name>tableATPI</portlet-name>
		<instanceable>true</instanceable>
		<header-portlet-css>/css/bv_styles.css</header-portlet-css>
		<header-portlet-javascript>/jsp/application/constantes_js.jsp</header-portlet-javascript>
		<header-portlet-javascript>/js/TreePI.js</header-portlet-javascript>
	</portlet>
</liferay-portlet-app>



Event the database seems to be unconsitent (the view seems to be in VIEW mode on the screen but a select in the db returns :
select name, typeSettings from layout where typeSettings like '%chartATPI_WAR_dovapplication_INSTANCE_Axnl%'

(my portlet name)


column-2=tableATPI_WAR_dovapplication_INSTANCE_FZjm,chartATPI_WAR_dovapplication_INSTANCE_tuEN,
column-1=tableATPI_WAR_dovapplication_INSTANCE_ZdgM,tableATPI_WAR_dovapplication_INSTANCE_VQ23,chartATPI_WAR_dovapplication_INSTANCE_Axnl,chartATPI_WAR_dovapplication_INSTANCE_D2JS,
[color=#F50F0F]mode-edit[/color]=tableATPI_WAR_dovapplication_INSTANCE_FZjm,tableATPI_WAR_dovapplication_INSTANCE_ZdgM,tableATPI_WAR_dovapplication_INSTANCE_VQ23,chartATPI_WAR_dovapplication_INSTANCE_Axnl,chartATPI_WAR_dovapplication_INSTANCE_tuEN,chartATPI_WAR_dovapplication_INSTANCE_D2JS,
state-max=
state-min=
layout-template-id=2_columns_i
Nicolas BODIN, modificado 16 Anos atrás.

RE: Unexpected EDIT mode for my portlet on welcome page

New Member Postagens: 13 Data de Entrada: 29/11/07 Postagens Recentes
I am using Liferay Enterprise Portal 4.3.4 (Owen / Build 4304 / November 5, 2007)

I made some tests with a dynamic view of my database :
the database in layout.typeSettings seems to be completely inconsistent.



The portlet names are always OK, the column for the portlet also, but the mode-edit property is completely different from what I have on the screen, and if I close and reopen my browser, I retrieve the values from the database


column-2=chartATPI_WAR_dovapplication_INSTANCE_BbDE,
column-1=tableATPI_WAR_dovapplication_INSTANCE_8U5p,tableATPI_WAR_dovapplication_INSTANCE_R0ne,
mode-edit=tableATPI_WAR_dovapplication_INSTANCE_Wyhz,
state-max=
state-min=
layout-template-id=2_columns_i


This is db content above, however nothing in on EDIT mode on the screen.

I do not really know what to do ? I hope I won't need to update the DB with my own request when closing the portlets ?

Any idea .P
Nicolas BODIN, modificado 16 Anos atrás.

RE: Unexpected EDIT mode for my portlet on welcome page

New Member Postagens: 13 Data de Entrada: 29/11/07 Postagens Recentes
I download the LIFERAY sources and followed step by step in java code what happens and now I can figure out what
happens !

The layout I am working on is a public page (I'm just begining with liferay but it seems in the code that this kind of layouts are SHARED).

In ServicePreAction.java class :


		if ((layout != null) &amp;&amp; layout.isShared()) {

			// Updates to shared layouts are not reflected until the next time
			// the user logs in because group layouts are cached in the session

			layout = (Layout)((LayoutImpl)layout).clone();

			LayoutClone layoutClone = LayoutCloneFactory.getInstance();

			if (layoutClone != null) {
				String typeSettings = layoutClone.get(req, layout.getPlid());


the codes makes a COPY to reflect the effect only on next session.

Then I have many layout instances, and if I switch one portlet to EDIT mode, the back to VIEW mode it is done on my layout instance but not globally. I I open another portlet in EDIT mode then back in view mode, in the second layout it is OK, but this is resetting the first portlet to its original state since the second layout is setting all properties overriding what the first session has done.

What I can not really understand yet is why I have one layout copy for every portlet and why we clone it each time ! and not one for the user session;

Likely a bug, and likely it happens only on public pages.
thumbnail
JR Houn, modificado 16 Anos atrás.

RE: Unexpected EDIT mode for my portlet on welcome page

Expert Postagens: 488 Data de Entrada: 19/11/07 Postagens Recentes
Hey Nicolas-
I'm glad to hear you were able to figure our the source of your problems with the portlets you created. Could you please add (Resolved) to the subject header of your thread? However, if you do believe you've found a bug try submitting it as an issue in support.liferay.com.
jr
Nicolas BODIN, modificado 16 Anos atrás.

RE: Unexpected EDIT mode for my portlet on welcome page

New Member Postagens: 13 Data de Entrada: 29/11/07 Postagens Recentes
reported as bug http://support.liferay.com/browse/LEP-4395