留言板

Change the original file liferay-display.xml

thumbnail
David García González,修改在12 年前。

Change the original file liferay-display.xml

Regular Member 帖子: 127 加入日期: 09-7-14 最近的帖子
Hi, I wanted to change the category where a portlet is displayed. In concrete, the portlet 129 that is in the category "category.hidden" and it is not showing. How could I achieve this in Liferay 6, with a hook plugin or ext plugin?

I only want to put this portlet on a page.

Thanks.
thumbnail
David García González,修改在12 年前。

RE: Change the original file liferay-display.xml

Regular Member 帖子: 127 加入日期: 09-7-14 最近的帖子
It is explained in the following development guide: Developing an Ext plugin
I created an ext plugin, then copy the file liferay-display.xml from root to the directory: docroot/WEB-INF/ext-web/docroot/WEB-INF
Then, deploy the ext plugin and restart the server.

It worked ok, I could overwrite the original liferay-display.xml file, but how could I revert the original file? Where does LR stores the original file?
thumbnail
David H Nebinger,修改在12 年前。

RE: Change the original file liferay-display.xml

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
When you undeploy the ext plugin, the file(s) that ext replaced should automagically be restored to their originals.
thumbnail
David García González,修改在12 年前。

RE: Change the original file liferay-display.xml

Regular Member 帖子: 127 加入日期: 09-7-14 最近的帖子
David H Nebinger:
When you undeploy the ext plugin, the file(s) that ext replaced should automagically be restored to their originals.


I removed the ext war, then restart the server but the original file was not restored. Do I have to execute some target? And where does liferay stores the original file to replace it later?
thumbnail
David H Nebinger,修改在12 年前。

RE: Change the original file liferay-display.xml

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Ext plugins can be kinda tricky in this way, that undeployments sometimes fail.

When LR is installing an ext plugin, the files in the ROOT webapp to be replaced are typically renamed in their current locations, i.e. from liferay-display.xml to something like liferay-display-orig.xml or something (I forget the exact syntax, but it will be a renamed file in the ROOT webapp).

After the file is renamed, the files from the ext plugin (in this case liferay-display.xml) are copied into the ROOT webapp. This is why a restart after deploy is sometimes required (as the runtime does not deal w/ some of these live file changes).

On undeploy, LR is supposed to drop the files added by the ext plugin and restore the originals. Again a restart is necessary for the same reason.
thumbnail
Prakash Khanchandani,修改在12 年前。

RE: Change the original file liferay-display.xml

Expert 帖子: 329 加入日期: 11-2-10 最近的帖子
On undeploy, LR is supposed to drop the files added by the ext plugin and restore the originals.


As I have found out with Ext plugins, for only liferay-display.xml, liferay just replaces the original liferay-display.xml and it does not create a copy of the original (I have searched but didn't find out any).
For other xml files they are copied to the ROOT WEB-INF with a filename of "original-ext.xml". For eg: liferay-portlet.xml and liferay-portlet-ext.xml.
For classes they go in separate jar files starting with "ext-".jar

So for liferay-display.xml no copy is created as I have found out.

My Enviornment: Liferay 6.0.6 with Tomcat bundle.

I may be incorrect, but that is what I have found out while using ext plugins.

Thanks.
thumbnail
Brian Jamieson,修改在12 年前。

RE: Change the original file liferay-display.xml

Junior Member 帖子: 51 加入日期: 10-10-15 最近的帖子
David García González:
It worked ok, I could overwrite the original liferay-display.xml file, ...


David, did you need to do anything other than tweak the liferay-display.xml file?

I'm trying to get the Workflow Tasks to appear but I end up with an ADDTOPAGE error.

ERROR [AdvancedPermissionChecker:651] com.liferay.portal.NoSuchResourceActionException: 153#ADD_TO_PAGE


I'm figuring you had the same with yours, portlet 129, cause I get the same error with it too ?

Hope you can help me out.

Thanks,

Brian
thumbnail
David García González,修改在12 年前。

RE: Change the original file liferay-display.xml

Regular Member 帖子: 127 加入日期: 09-7-14 最近的帖子
It is very strange, I could put the portlet in the page without any
problem and I have done anything special. I tested it with Liferay 6.0.5.
thumbnail
Brian Jamieson,修改在12 年前。

RE: Change the original file liferay-display.xml

Junior Member 帖子: 51 加入日期: 10-10-15 最近的帖子
Hi David,

I repeated the creation of the ext plugin with a new clean 6.0.5.ce installation (I used the hypersonic database, and left the seven-cogs stuff in as well), and I got the same error occuring.

Liferay itself was running with good old Bruno Admin...
I used the Liferay IDE, and got it to create an Ext project.

In there, I placed a copy of the 'real' liferay-display.xml, but I made the following changes:

<category name="CWFI Lines Kaleo">
	<portlet id="47" /><!-- Hello World portlet -->
	<portlet id="153" /><!-- Tasks assigned to me -->
	<portlet id="158" /><!-- Tasks submitted by me -->
</category>


The new category is available, but only the Hello World portlet (47) is available - the others give the error
ERROR [AdvancedPermissionChecker:651] com.liferay.portal.NoSuchResourceActionException: 153#ADD_TO_PAGE
ERROR [AdvancedPermissionChecker:651] com.liferay.portal.NoSuchResourceActionException: 158#ADD_TO_PAGE


If it's not too much bother, can you explain the method you used to create your ext plugin, and whatever user security you have in place?

Thanks.
thumbnail
David García González,修改在12 年前。

RE: Change the original file liferay-display.xml

Regular Member 帖子: 127 加入日期: 09-7-14 最近的帖子
Hi Brian, I have done the same as you, but only with portlet "129" (Password Policies).


<category name="AAAA">
		<portlet id="129" />
</category>


I could arrange this portlet to the page without any problem, perhaps with other portlet it would throw the same excepcion.

If I were you I would debug the liferay source code to know the source of the exception.
thumbnail
Brian Jamieson,修改在12 年前。

RE: Change the original file liferay-display.xml

Junior Member 帖子: 51 加入日期: 10-10-15 最近的帖子
Hi David,

Thanks for getting back to me on this.

I've tried adding your 'AAAA' category, and I'm finding the same issue with it. The other thing that happens is that if the category has portlets that are truly hidden, and only configured to be seen from the control panel, the actual category itself does not appear in the 'Add - More' dialog. As soon as you put the Hello World portlet into the category, it does appear.

This post has the same issue, so I can't figure out how you managed to get it to work. I tried on a single page, and I tried with portlet 129 too.

It's just not working for me emoticon

Is your installation of Liferay from a bundle, or has it been built from the source?
thumbnail
David García González,修改在12 年前。

RE: Change the original file liferay-display.xml

Regular Member 帖子: 127 加入日期: 09-7-14 最近的帖子
It's very strange. My liferay installation is tomcat bundle, version 6.0.5.
thumbnail
Brian Jamieson,修改在12 年前。

RE: Change the original file liferay-display.xml

Junior Member 帖子: 51 加入日期: 10-10-15 最近的帖子
Thanks David,

We'll need to leave this as unresolved.

I've tried with 6.0.5 and 6.0.6 on linux, and get the error.

Thanks for trying to help.
thumbnail
Hitoshi Ozawa,修改在12 年前。

RE: Change the original file liferay-display.xml

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
I think the intent of the ext plugin was just to make modification separate from the original Liferay so when Liferay is versioned up,the modifications can again be more easily installed. I don't think it was designed to make modifications "undeployable". You'll have to reinstall Liferay and deploy the other plugins back in again to remove ext plugin.
thumbnail
Brian Jamieson,修改在12 年前。

RE: Change the original file liferay-display.xml

Junior Member 帖子: 51 加入日期: 10-10-15 最近的帖子
Hi Hitoshi,

Understood about the limitations of ext plugins, I can't have been very clear.

My ext plugin was made for two completely separate liferay bundles, 6.0.5 and 6.0.6.

In each one, I simply 'over-rode' the default liferay-display.xml file, and the way I did it was to basically duplicate the hidden category as a new non-hidden category (I also left the original definitions in place).

Several of the hidden portlets DID get displayed in my new category, and, as Test Test, I was able to add them to a 'front-end' page correctly.
Several could NOT be added, and gave the error described above.

The mystery is why David could add 120 (or whatever it was), and when I tried with the same portlet, it failed.
thumbnail
David García González,修改在12 年前。

RE: Change the original file liferay-display.xml

Regular Member 帖子: 127 加入日期: 09-7-14 最近的帖子
Hitoshi Ozawa:
I think the intent of the ext plugin was just to make modification separate from the original Liferay so when Liferay is versioned up,the modifications can again be more easily installed. I don't think it was designed to make modifications "undeployable". You'll have to reinstall Liferay and deploy the other plugins back in again to remove ext plugin.


Thanks for the explanation, I was misunderstood, I thought tha ext plugins were undeployable as they were hooks.

Thanks!
thumbnail
Hitoshi Ozawa,修改在12 年前。

RE: Change the original file liferay-display.xml

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
Ext plugin modifies the original Liferay package while hooks don't. It's one of the major draw backs of ext plugins especially because ext plugins can't be overwritten again.
The topic has came up several times in the IDE forum because since it can't be undeployed nor overwriiten even during development and testing.