Sandeep Nair 12 Years Ago Excellent post james. Thanks for sharing. I always wanted to have some logging in velocity template. Thanks for the share. Please sign in to reply. Reply as... Cancel
Armaz Mellati 12 Years Ago 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 Please sign in to reply. Reply as... Cancel Jeffrey Handa Armaz Mellati 12 Years Ago 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') Please sign in to reply. Reply as... Cancel
Jeffrey Handa Armaz Mellati 12 Years Ago 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') Please sign in to reply. Reply as... Cancel
Jay Patel 12 Years Ago Awesome post James...Now things will be much easier to write LR apps.. Please sign in to reply. Reply as... Cancel
Andrius Kurtinaitis 12 Years Ago 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? Please sign in to reply. Reply as... Cancel Andrius Kurtinaitis Andrius Kurtinaitis 12 Years Ago Strange enough, it even does not fill the reserved-*** variables... Please sign in to reply. Reply as... Cancel James Falkner Andrius Kurtinaitis 12 Years Ago Andrius - I think you want http://issues.liferay.com/browse/LPS-15096 Please add your comments there as it is an important missing functionality. Please sign in to reply. Reply as... Cancel
Andrius Kurtinaitis Andrius Kurtinaitis 12 Years Ago Strange enough, it even does not fill the reserved-*** variables... Please sign in to reply. Reply as... Cancel James Falkner Andrius Kurtinaitis 12 Years Ago Andrius - I think you want http://issues.liferay.com/browse/LPS-15096 Please add your comments there as it is an important missing functionality. Please sign in to reply. Reply as... Cancel
James Falkner Andrius Kurtinaitis 12 Years Ago Andrius - I think you want http://issues.liferay.com/browse/LPS-15096 Please add your comments there as it is an important missing functionality. Please sign in to reply. Reply as... Cancel
Laura Dylan 12 Years Ago 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. Please sign in to reply. Reply as... Cancel
Tejas Patel 12 Years Ago thanks for this post.it is very useful for me . Please sign in to reply. Reply as... Cancel Andrius Kurtinaitis Tejas Patel 12 Years Ago 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. Please sign in to reply. Reply as... Cancel
Andrius Kurtinaitis Tejas Patel 12 Years Ago 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. Please sign in to reply. Reply as... Cancel
Amey Panke 11 Years Ago Thanks James, the post really helped. thanks a ton..!!!!! Please sign in to reply. Reply as... Cancel