Sandeep Nair 12 年之前 Excellent post james. Thanks for sharing. I always wanted to have some logging in velocity template. Thanks for the share. 请登录以投票。 以……回复 取消
Armaz Mellati 12 年之前 Very useful, thanks. I am also thinking combining this with the information from this blog : http://www.liferay.com/web/jeffrey.handa/blog/-/blogs/11281793 (using java-code inside a hook accessible through Spring) It should be a good alternative in many usecases 请登录以投票。 以……回复 取消 Jeffrey Handa Armaz Mellati 12 年之前 Thank James, this is great. @ Armaz - I was thinking the exact same thing for logging from the script console. The following works when you set the script type to Groovy.logFactory = String.getClass().forName('com.liferay.portal.kernel.log.LogFactoryUtil')log = logFactory.getLog('mylog')log.error('Logging from Groovy Script') 请登录以投票。 以……回复 取消
Jeffrey Handa Armaz Mellati 12 年之前 Thank James, this is great. @ Armaz - I was thinking the exact same thing for logging from the script console. The following works when you set the script type to Groovy.logFactory = String.getClass().forName('com.liferay.portal.kernel.log.LogFactoryUtil')log = logFactory.getLog('mylog')log.error('Logging from Groovy Script') 请登录以投票。 以……回复 取消
Jay Patel 12 年之前 Awesome post James...Now things will be much easier to write LR apps.. 请登录以投票。 以……回复 取消
Andrius Kurtinaitis 12 年之前 A few more gotchas using preview mode (view_article_content) action:- no javascript (AUI., Liferay.) works out of the box. It would be very usefull for rendering collapsible lists etc. What do I need to include to have it working?- no $request variable, because the view_article_content action does not fill it. What can do here? 请登录以投票。 以……回复 取消 Andrius Kurtinaitis Andrius Kurtinaitis 12 年之前 Strange enough, it even does not fill the reserved-*** variables... 请登录以投票。 以……回复 取消 James Falkner Andrius Kurtinaitis 12 年之前 Andrius - I think you want http://issues.liferay.com/browse/LPS-15096 Please add your comments there as it is an important missing functionality. 请登录以投票。 以……回复 取消
Andrius Kurtinaitis Andrius Kurtinaitis 12 年之前 Strange enough, it even does not fill the reserved-*** variables... 请登录以投票。 以……回复 取消 James Falkner Andrius Kurtinaitis 12 年之前 Andrius - I think you want http://issues.liferay.com/browse/LPS-15096 Please add your comments there as it is an important missing functionality. 请登录以投票。 以……回复 取消
James Falkner Andrius Kurtinaitis 12 年之前 Andrius - I think you want http://issues.liferay.com/browse/LPS-15096 Please add your comments there as it is an important missing functionality. 请登录以投票。 以……回复 取消
Laura Dylan 12 年之前 Is this a joke? You're trying to convince me that this is a "feature"? The hoops you had to jump through above is astounding. In a JSP with the proper tags this all would have been reduced to ~10-15 lines. Instead, you're trying to use the wrong tools for the job.. you're developing crazy code in a textarea, it isn't versioned or deployable between different environments (e.g. QA to Prod), and it's in Velocity. This is a bad approach all around. Stop using Velocity. Stop convincing people to paste their code into a text area. And make it really easy for me to query and transform content in my own custom portlets.This is a huge example where Liferay is out of touch with developers and the marketplace. 请登录以投票。 以……回复 取消
Tejas Patel 12 年之前 thanks for this post.it is very useful for me . 请登录以投票。 以……回复 取消 Andrius Kurtinaitis Tejas Patel 12 年之前 Thank you James for the link to JIRA. I agree with the conclusions of the discussion there. I just wanted a small workaround until the issue is resolved.I was wrong about the $reserved-* variables. They are in place.Remaining problems concerning the preview are the following:- no usual JavaScripts included- no $request variable.If I try to preview an article using a template depending on these features, I get garbage.I think, it is possible to solve these issues without doing a full "preview in a page" functionality. It is possible to include default JavaScript and fill the $request with all info excluding the page context if the page is not currently available. 请登录以投票。 以……回复 取消
Andrius Kurtinaitis Tejas Patel 12 年之前 Thank you James for the link to JIRA. I agree with the conclusions of the discussion there. I just wanted a small workaround until the issue is resolved.I was wrong about the $reserved-* variables. They are in place.Remaining problems concerning the preview are the following:- no usual JavaScripts included- no $request variable.If I try to preview an article using a template depending on these features, I get garbage.I think, it is possible to solve these issues without doing a full "preview in a page" functionality. It is possible to include default JavaScript and fill the $request with all info excluding the page context if the page is not currently available. 请登录以投票。 以……回复 取消