问题
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