Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Jordi Ribas Vila
Rewrite a portlet definition in liferay-portlet-ext.xml doesn't work
27 de Fevereiro de 2008 01:23
Resposta

Jordi Ribas Vila

Ranking: New Member

Mensagens: 15

Data de entrada: 26 de Junho de 2007

Mensagens 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!
Jorge Ferrer
RE: Rewrite a portlet definition in liferay-portlet-ext.xml doesn
9 de Março de 2008 14:25
Resposta

Jorge Ferrer

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 2768

Data de entrada: 31 de Agosto de 2006

Mensagens 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
RE: Rewrite a portlet definition in liferay-portlet-ext.xml doesn
13 de Março de 2008 02:08
Resposta

Jordi Ribas Vila

Ranking: New Member

Mensagens: 15

Data de entrada: 26 de Junho de 2007

Mensagens 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:

 1
 2<portlet>
 3        <portlet-name>85</portlet-name>
 4        <icon>/html/portlet/site_map/icon.png</icon>
 5        <struts-path>site_map</struts-path>
 6        <configuration-action-class>com.liferay.portlet.sitemap.action.ConfigurationActionImpl</configuration-action-class>
 7        <use-default-template>false</use-default-template>
 8        <restore-current-view>false</restore-current-view>
 9        <private-request-attributes>false</private-request-attributes>
10        <private-session-attributes>false</private-session-attributes>
11        <render-weight>1</render-weight>
12        <add-default-resource>true</add-default-resource>
13        <system>true</system>
14</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?
Jorge Ferrer
RE: Rewrite a portlet definition in liferay-portlet-ext.xml doesn
14 de Março de 2008 07:25
Resposta

Jorge Ferrer

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 2768

Data de entrada: 31 de Agosto de 2006

Mensagens 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.
Christophe Cariou
RE: Rewrite a portlet definition in liferay-portlet-ext.xml doesn
30 de Março de 2011 04:18
Resposta

Christophe Cariou

Ranking: Junior Member

Mensagens: 47

Data de entrada: 1 de Outubro de 2007

Mensagens 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
 1
 2liferay-portlet-app>
 3    <portlet>
 4        <portlet-name>20</portlet-name>
 5            
 6            <scheduler-entry>
 7                    <scheduler-description>description</scheduler-description>
 8                 <scheduler-event-listener-class>
 9                                       fr.asten.dllifecycle.schedule.CheckDLLifeCycleMessageListener
10                 </scheduler-event-listener-class>
11                 <trigger>
12                      <cron>
13                        <cron-trigger-value>00 * * * * ?</cron-trigger-value>
14                    </cron>
15                </trigger>
16            </scheduler-entry>   
17            
18    </portlet>
19</liferay-portlet-app>


- 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