掲示板

Liferay 7 JS-Hook

thumbnail
6年前 に Liferay Dev によって更新されました。

Liferay 7 JS-Hook

Junior Member 投稿: 81 参加年月日: 15/05/17 最新の投稿
Liferay DXP:
We have requirement like override the core js(logo_editor.js) plugin.
We have JSP hook, service hook and etc., but we didn't find a way to override the js plugin.
So what is the approach we will follow to override the core js. please share your inputs.

Thanks
thumbnail
6年前 に Olaf Kock によって更新されました。

RE: JS-Hook

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Liferay Dev:
We have requirement like override the core js(logo_editor.js) plugin.


I'm assuming that you are talking about Liferay 6.2, but you're not giving that detail.

However, that doesn't change the nature of my answer: You don't have a requirement to override a JS file. No sane business requirement would list this as a requirement. Instead, there's some functionality (not file) that someone would like to change. Please add this business requirement to your question.

Liferay does not have a JS-Hook, and while I've heard some people talk about being able to override JS files successfully, it's just not as simple as overriding JSP files. That's why JSP-Hooks are called JSP-Hooks and not Generic-File-Hooks.

A quick hack might be to delete the temp and work directories, but note that this is a quick hack, not guaranteed to work, and might lead to more problems when you deploy on yet another system. Plus, these files are there for a reason (e.g. performance) and you might pay with a big performance hit when all of those files have been deleted - until they're regenerated.
thumbnail
6年前 に Liferay Dev によって更新されました。

RE: JS-Hook

Junior Member 投稿: 81 参加年月日: 15/05/17 最新の投稿
It's in Liferay DXP not liferay 6 .
thumbnail
6年前 に Olaf Kock によって更新されました。

RE: JS-Hook

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Liferay Dev:
It's in Liferay DXP not liferay 6 .


That answers line 1 of my answer, not lines 2-4. And those are more important.
thumbnail
6年前 に Liferay Dev によって更新されました。

RE: JS-Hook

Junior Member 投稿: 81 参加年月日: 15/05/17 最新の投稿
In Liferay DXP we have different types of hooks like jsp-hook, service-hook and etc. But i didn't find any example to override the core js files.
If i want to override logo_edistor.js file of liferay , how can i achieve that?
thumbnail
6年前 に Olaf Kock によって更新されました。

RE: JS-Hook (回答)

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Liferay Dev:
In Liferay DXP we have different types of hooks like jsp-hook, service-hook and etc. But i didn't find any example to override the core js files.
If i want to override logo_edistor.js file of liferay , how can i achieve that?


Well... I have expected business requirements in the sense of "When the mouse hovers over the site logo, an animation should be played". This might or might not be solved through overriding JS files, and might teach you (and others) a bit about best practices to modify Liferay behavior. Now that you are persistently refusing to give such a usecase: Don't complain if the solution that you envision would be hard to maintain.

I'd recommend to check Chema's post for overriding JS files
thumbnail
6年前 に Liferay Dev によって更新されました。

RE: Liferay 7 JS-Hook (回答)

Junior Member 投稿: 81 参加年月日: 15/05/17 最新の投稿
Thanks alot ...