组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
lou cat
change css without restarting NOW
2013年1月29日 上午6:41
答复

lou cat

等级: Regular Member

帖子: 196

加入日期: 2012年1月26日

最近的帖子

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
RE: change css without restarting NOW
2013年1月29日 上午7:35
答复

pranay rampally

等级: New Member

帖子: 8

加入日期: 2012年10月9日

最近的帖子

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 .
lou cat
RE: change css without restarting NOW
2013年1月29日 上午7:44
答复

lou cat

等级: Regular Member

帖子: 196

加入日期: 2012年1月26日

最近的帖子

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
Rafael Lluis
RE: change css without restarting NOW
2013年1月29日 上午11:03
答复

Rafael Lluis

等级: Junior Member

帖子: 29

加入日期: 2012年10月15日

最近的帖子

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...
lou cat
RE: change css without restarting NOW
2013年1月30日 上午1:30
答复

lou cat

等级: Regular Member

帖子: 196

加入日期: 2012年1月26日

最近的帖子

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
RE: change css without restarting NOW
2013年1月30日 上午7:57
答复

pranay rampally

等级: New Member

帖子: 8

加入日期: 2012年10月9日

最近的帖子

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.
lou cat
RE: change css without restarting NOW
2013年1月30日 上午8:12
答复

lou cat

等级: Regular Member

帖子: 196

加入日期: 2012年1月26日

最近的帖子

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
lou cat
RE: change css without restarting NOW
2013年1月31日 上午1:22
答复

lou cat

等级: Regular Member

帖子: 196

加入日期: 2012年1月26日

最近的帖子

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
RE: change css without restarting NOW
2013年1月31日 上午2:38
答复

pranay rampally

等级: New Member

帖子: 8

加入日期: 2012年10月9日

最近的帖子

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.
lou cat
RE: change css without restarting NOW
2013年1月31日 上午2:48
答复

lou cat

等级: Regular Member

帖子: 196

加入日期: 2012年1月26日

最近的帖子

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
Adel Frad
RE: change css without restarting NOW
2013年1月31日 上午3:08
答复

Adel Frad

等级: New Member

帖子: 23

加入日期: 2012年8月4日

最近的帖子

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.
lou cat
RE: change css without restarting NOW
2013年1月31日 上午8:05
答复

lou cat

等级: Regular Member

帖子: 196

加入日期: 2012年1月26日

最近的帖子

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
David H Nebinger
RE: change css without restarting NOW
2013年1月31日 上午8:24
答复

David H Nebinger

等级: Liferay Legend

帖子: 6977

加入日期: 2006年9月1日

最近的帖子

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.
jaid shaik
RE: change css without restarting NOW
2013年2月1日 上午3:35
答复

jaid shaik

等级: Regular Member

帖子: 170

加入日期: 2010年10月7日

最近的帖子

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....

1and 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.