Fórum

Rewrite a portlet definition in liferay-portlet-ext.xml doesn't work

Jordi Ribas Vila, modificado 16 Anos atrás.

Rewrite a portlet definition in liferay-portlet-ext.xml doesn't work

New Member Postagens: 15 Data de Entrada: 26/06/07 Postagens Recentes
Hello,

I'm trying to rewrite the definition of 'site_map' liferay portlet in liferay-portlet-ext.xml but the changes aren't loadeds. I want 'site_map' can be called in any community with a valid URL like 'my_account' portlet.
How can I make this?

Thank you!
thumbnail
Jorge Ferrer, modificado 16 Anos atrás.

RE: Rewrite a portlet definition in liferay-portlet-ext.xml doesn

Liferay Legend Postagens: 2871 Data de Entrada: 31/08/06 Postagens Recentes
Hi Jordi,

How do you know the changes are not being read? Can you be more explicit about the changes you've made?
Jordi Ribas Vila, modificado 16 Anos atrás.

RE: Rewrite a portlet definition in liferay-portlet-ext.xml doesn

New Member Postagens: 15 Data de Entrada: 26/06/07 Postagens Recentes
Hello Jorge,

I have added a new definition of 'site_map' portlet in liferay-portlet-ext.xml.
Because I want 'site_map' can be called in any community with a valid URL like 'my_account' portlet. Note that this definition is the same of 'my_account' portlet only changuing portlet-name, icon and struts-path.
I have added this changues:


<portlet>
		<portlet-name>85</portlet-name>
		<icon>/html/portlet/site_map/icon.png</icon>
		<struts-path>site_map</struts-path>
		<configuration-action-class>com.liferay.portlet.sitemap.action.ConfigurationActionImpl</configuration-action-class>
		<use-default-template>false</use-default-template>
		<restore-current-view>false</restore-current-view>
		<private-request-attributes>false</private-request-attributes>
		<private-session-attributes>false</private-session-attributes> 
		<render-weight>1</render-weight>
		<add-default-resource>true</add-default-resource>
		<system>true</system>
</portlet>


But, this only works if I delete the old portlet definition in liferay-portlet.xml.
Liferay-portlet-ext.xml only loads new portlets definitions and don't load rewrited definitions.
There are any possibility to make this without delete the old definition in liferay-portlet.xml?
thumbnail
Jorge Ferrer, modificado 16 Anos atrás.

RE: Rewrite a portlet definition in liferay-portlet-ext.xml doesn

Liferay Legend Postagens: 2871 Data de Entrada: 31/08/06 Postagens Recentes
Hi Jordi,

It should work as you expect. And it used to work that way. Can you debug the execution of PortletLocalServiceImpl._readLiferayPortletXML(..) to find out if there is a bug?

If you do find a bug, please add it to support.liferay.com and let me know through this thread.
thumbnail
Christophe Cariou, modificado 13 Anos atrás.

RE: Rewrite a portlet definition in liferay-portlet-ext.xml doesn

Junior Member Postagens: 57 Data de Entrada: 01/10/07 Postagens Recentes
Hi Jorge,

I need just a confirmation about extending native portlets definition:

- I'm on Liferay 6.0.5 GA CE
- Using an ext plugin, via Liferay IDE (1.2.x)
- I need to extend the DocumentLibrary application (id = 20) in order to inject a scheduled action.
- I'm using the new Message Listener method for my scheduled action
- I wrote a liferay-portlet-ext.xml, including only my scheduler entry for portlet class 20

liferay-portlet-app&gt;
	<portlet>
		<portlet-name>20</portlet-name>
			
			<scheduler-entry>
			        <scheduler-description>description</scheduler-description>
				 <scheduler-event-listener-class>
				                       fr.asten.dllifecycle.schedule.CheckDLLifeCycleMessageListener
				 </scheduler-event-listener-class>
				 <trigger>
					  <cron>
						<cron-trigger-value>00 * * * * ?</cron-trigger-value>
					</cron>
				</trigger>
			</scheduler-entry>	
			
	</portlet>


- It works (the scheduled action goes on) and I'm happyemoticon

But, my ask is :
Is it the right way? Is it OK that the native portlet definition (inside liferay-portlet.xml) will be "extended" and not "overrided" by mine ?

Regards

Christophe