Foros de discusión

change css without restarting NOW

thumbnail
lou cat, modificado hace 11 años.

change css without restarting NOW

Regular Member Mensajes: 196 Fecha de incorporación: 26/01/12 Mensajes recientes
Hi guys, I have a simple and urgent question:

is it possible to change the css of a portal that is already live, without restarting the server?
I know about the possibility to use theme.css.fast.load=false but of course if I want to apply some changes to portal-ext.properties I have to restart the server afterwards, so I'd have the same problem.
Can I remove the cache in some way or overwrite the real file used (I've changed the custom.css belonging to webapps/my-theme , but that one is not used...)

Thanks thanks thanks for any feedback!
pranay rampally, modificado hace 11 años.

RE: change css without restarting NOW

New Member Mensajes: 8 Fecha de incorporación: 9/10/12 Mensajes recientes
I think you can apply changes to your theme, generate a war and hot deploy it. I dont think you have to restart your server when you are hot deploying any war .
thumbnail
lou cat, modificado hace 11 años.

RE: change css without restarting NOW

Regular Member Mensajes: 196 Fecha de incorporación: 26/01/12 Mensajes recientes
Thank you Pranay, but I forgot to mention that this is not my theme... in the sense that I didn't write that code so I don't have any previous project/war to deploy emoticon
I need to change just a super small css attribute emoticon
thumbnail
Rafael Lluis, modificado hace 11 años.

RE: change css without restarting NOW

Junior Member Mensajes: 30 Fecha de incorporación: 15/10/12 Mensajes recientes
Of cpurse you cand search for the css on the server (depending on the application server you'll find it in one directory or in another). Once localizated you can change it without problem and sooner or later it will be resended to the clients. Think that once istallad a theme is only a group of files that are on the server and that you can change without problem. Of course if you reinstall the theme you will lose every post-change.

For instance, (it depends on your LR version) You can find a file called portal-theme/css/custom.css where usually you will find all the personal classes of the theme. Of course i am supposing that you have access to the whole file system...
thumbnail
lou cat, modificado hace 11 años.

RE: change css without restarting NOW

Regular Member Mensajes: 196 Fecha de incorporación: 26/01/12 Mensajes recientes
Hi Rafael,

I have access and I already replaced the file you are mentioning (portal-theme/css/custom.css ), that is the only one I want to change, but it's not "picked up", I guess the old one in the cache is being used and I don't know how to force the system to apply the changes without restarting the server.
I know it would do it if I placed the war file in the deploy folder but I don't have any war file... I guess I should just restart emoticon

thanks anyway emoticon
pranay rampally, modificado hace 11 años.

RE: change css without restarting NOW

New Member Mensajes: 8 Fecha de incorporación: 9/10/12 Mensajes recientes
I hope you have access to portal administration, if so you can assign custom css in the "manage site pages" section under themes. I did not try this but It might work.
thumbnail
lou cat, modificado hace 11 años.

RE: change css without restarting NOW

Regular Member Mensajes: 196 Fecha de incorporación: 26/01/12 Mensajes recientes
thank you pranay, but it would work just in the page you are "managing", and unfortunately I need this change to be in all the pages of my portal.
I think there's also a way to change the css of a whole community, but unfortunately I would have too many communities and organizations to change emoticon
thumbnail
lou cat, modificado hace 11 años.

RE: change css without restarting NOW

Regular Member Mensajes: 196 Fecha de incorporación: 26/01/12 Mensajes recientes
Hi Jaid,

but did you do this in a live environment?
Honestly it scares me a bit emoticon
What happens when the web-inf folder has another name?
You mean webapps/ROOT/WEB-INF, right?
pranay rampally, modificado hace 11 años.

RE: change css without restarting NOW

New Member Mensajes: 8 Fecha de incorporación: 9/10/12 Mensajes recientes
Hi
did you try to clear the cache in portal administration under "server administration" category, because changing the custom.css does reflect the changes without the need to restart the server.
thumbnail
lou cat, modificado hace 11 años.

RE: change css without restarting NOW

Regular Member Mensajes: 196 Fecha de incorporación: 26/01/12 Mensajes recientes
jaid shaik:

after renaming the WEB-INF of particular portlet WEB-INF folder the [portlet,theme,hook] it will unregister that particular portlet or theme


but I guess it will take some time to undeploy and re-deploy it, even if I change it just for 5 seconds, no?
This is the theme for the whole portal, but I'll try test it in another environment and see how it works, thanks!

pranay rampally:
Hi
did you try to clear the cache in portal administration under "server administration" category, because changing the custom.css does reflect the changes without the need to restart the server.


Hi pranay,
Yes I used all the utilities under Server Administration, excluding "generate the thread dump"... but nothing emoticon
thumbnail
Adel Frad, modificado hace 11 años.

RE: change css without restarting NOW

New Member Mensajes: 24 Fecha de incorporación: 4/08/12 Mensajes recientes
Please modify the css directly under webapps (webapps/<your theme>). Then check if your theme folder exists under tomcat temp folder (should be called xx-<your theme> where xx is a number). Please delete this temp folder.
thumbnail
lou cat, modificado hace 11 años.

RE: change css without restarting NOW

Regular Member Mensajes: 196 Fecha de incorporación: 26/01/12 Mensajes recientes
Hi all!

Luckily after 2 days the server decided to use the new code, so I don't need to restart anymore! emoticon

Thanks anyway for all the suggestions... finding a solution could be useful later on or for someone else!


@Jaid: I tried your method in my test environment but the behaviour seemed a bit random...
I removed the "cache settings for fast load" first, I changed the code under webapps/my-theme/css folder and nothing happened (normal).
then I renamed the folder WEB-INF as you said, but nothing happened... it did take the changes the second time I did the procedure, but BEFORE renaming it with the original name (??)
And also Firefox Chrome and IE were having different behaviours... of course I deleted the browser history everytime, but one would keep the old file, the other didn't...
I did this a couple of times and everytime it was doing different things...

@Adel: I modified the css under webapps (webapps/<your theme>), but I couldn't find the right thing to delete in the temp folder! my theme wasn't there emoticon
thumbnail
David H Nebinger, modificado hace 11 años.

RE: change css without restarting NOW

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 Mensajes recientes
jaid shaik:
Rename the WEB-INF folder for short time (WEB-INF1) and again revert back with (WEB-INF)...


What an asinine suggestion. If anyone ever reads this in the future, totally ignore this suggestion. This has the potential to totally break your tomcat, and will not result in any reload.

If this guy knew what he was talking about, he would have said that most application containers (including tomcat) monitor the WEB-INF/web.xml file for changes, and all you need to do is touch the file (i.e. unix touch command or on windows open the file, add a space, and save it). When the container sees the timestamp has changed, it will reload the web application.

But if this guy also knew Liferay he would know that Liferay uses the theme artifact to get CSS, but it packages it and caches it within it's own context, so having the container reload the theme web application would not result in the desired effect.
thumbnail
jaid shaik, modificado hace 11 años.

RE: change css without restarting NOW

Regular Member Mensajes: 171 Fecha de incorporación: 8/10/10 Mensajes recientes
Hi David,

Thanks for the suggestion...

I already mentioned my post its not recommended way.......waiting for experts reply............

any how....

I deleted my post because no one can try that method....

and all you need to do is touch the file (i.e. unix touch command or on windows open the file, add a space, and save it). When the container sees the timestamp has changed, it will reload the web application.



Thanks for the above information.