How to resolve conflict between hooks modifying the same jsp?

强颜欢笑 提交于 2019-12-11 20:13:34

问题


We have downloaded the Notifications portlet from liferay which modifies the JSP:

html/portlet/dockbar/view_user_account.jspf

And we are also modifying this particular jspf in our hook.

Currently what we are doing is we are copying the code from notifications portlet in our custom hook and are deploying our custom hook at the end so that our changes are applied.

Or else we would need to remove the JSP hook from notifications portlet by modifying the notification portlet's source.

Are there any better ways to achieve this?

Thanks


回答1:


Unfortunately you're stuck between a rock and a hard place. You'll need to modify one of the plugins to not contain the JSP. Liferay can handle each JSP to be overridden max once.

An alternative might be to "hack" your changes through JS DOM manipulation after the page is displayed. This makes maintenance harder, but eases daily business and updates.

The big problem with any workarounds that involve two plugins changing the same JSP is that order is not defined. Also, it can be destructive: After deploying and undeploying two plugins that modify the same JSP, the original JSP is gone :(

Deploying plugin A, then B, followed by undeployment of A will leave you with only plugin B deployed, but use A's version of the overridden JSP.



来源:https://stackoverflow.com/questions/25399323/how-to-resolve-conflict-between-hooks-modifying-the-same-jsp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!