Brian Chan 14 Years Ago You're funny Ryan I got stuck on "Don't write anything in this method, this method will never ever run ". I was like, what is he talking about... Please sign in to reply. Reply as... Cancel
Jonas Yuan 14 Years Ago Hi Ryan, thank you. One question: how do you handle different DBMS when using same SQL script? Should it know DBMS first?protected void doUpgrade() throws Exception { runSQL("alter table sampleUpgradeTable add sampleUpgradeColumn LONG"); runSQL("update sampleUpgradeTable set sampleUpgradeColumn = 0");} Please sign in to reply. Reply as... Cancel
Nagendra Kumar Busam 12 Years Ago Really good info, thank you very much for sharing Please sign in to reply. Reply as... Cancel
Juan Alberto Lopez Cavallotti 12 Years Ago One question about this, if I'm on a development stage and I want the upgrade process to run always, is there any property for getting this done?Thanks! Please sign in to reply. Reply as... Cancel Ryan Park Juan Alberto Lopez Cavallotti 12 Years Ago Hi Juan,For allowing code to always run, I would not use the upgrade process because it is designed to run only once. If you'd like to run code at the beginning always I would consider using a StartupAction, see http://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+Plugins. Please sign in to reply. Reply as... Cancel
Ryan Park Juan Alberto Lopez Cavallotti 12 Years Ago Hi Juan,For allowing code to always run, I would not use the upgrade process because it is designed to run only once. If you'd like to run code at the beginning always I would consider using a StartupAction, see http://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+Plugins. Please sign in to reply. Reply as... Cancel
Barry Rowe 11 Years Ago - Edited Does the UpgradeProcess.doUpgrade() method get executed under full control Permissions (ie. Administrator SecurityContext) for purposes of using XXXLocalServiceUtil methods to manipulate data?I'm guessing the answer is yes if it allows access to execute custom SQL statements as in your example, but want to make sure. Thank you Please sign in to reply. Reply as... Cancel Ryan Park Barry Rowe 11 Years Ago Hi Barry, everything called under *LocalService will run with full privilege.If you'd like to access any service with permission checking, you'll need to call the *Service (without Local). However, since there are no users running an upgrade process, you'll likely run in to errors if you do not use *LocalService in your upgrade process. Please sign in to reply. Reply as... Cancel
Ryan Park Barry Rowe 11 Years Ago Hi Barry, everything called under *LocalService will run with full privilege.If you'd like to access any service with permission checking, you'll need to call the *Service (without Local). However, since there are no users running an upgrade process, you'll likely run in to errors if you do not use *LocalService in your upgrade process. Please sign in to reply. Reply as... Cancel
Joris Meijer 10 Years Ago Hello Ryan,Thanks for the blog. I just implemented an Upgrade Hook using 7cogs as an example. My upgrade hook doesn't seem to be "fired". I want to add a structure and a template.Can I do this using the UpgradeProcess, or do I need to use a StartupAction instead?Best regards,Joris Please sign in to reply. Reply as... Cancel Ryan Park Joris Meijer 10 Years Ago Hi Joris,After you've specified the location of your "portal.properties" file in liferay-hook.xml. Make sure that you've specified:release.info.build.number=release.info.previous.build.number=upgrade.processes="release.info.build.number" should be greater than "release.info.previous.build.number" and in your upgrade class the threshold should be set to "release.info.build.number".See Social Office as an example:https://github.com/liferay/liferay-plugins/blob/master/hooks/so-hook/docroot/WEB-INF/src/portal.properties Please sign in to reply. Reply as... Cancel Joris Meijer Ryan Park 10 Years Ago Hi Ryan,Thanks for your quick reply. I already specified those. It turned out I had the directory structure quite wrong. I am using maven artifacts and the structure thus is a little bit different from the plugins SDK structure. I now implemented a startupaction which adds the hook and template.thanks!Joris Please sign in to reply. Reply as... Cancel Ryan Park Joris Meijer 10 Years Ago I glad it worked out for you. Please sign in to reply. Reply as... Cancel
Ryan Park Joris Meijer 10 Years Ago Hi Joris,After you've specified the location of your "portal.properties" file in liferay-hook.xml. Make sure that you've specified:release.info.build.number=release.info.previous.build.number=upgrade.processes="release.info.build.number" should be greater than "release.info.previous.build.number" and in your upgrade class the threshold should be set to "release.info.build.number".See Social Office as an example:https://github.com/liferay/liferay-plugins/blob/master/hooks/so-hook/docroot/WEB-INF/src/portal.properties Please sign in to reply. Reply as... Cancel Joris Meijer Ryan Park 10 Years Ago Hi Ryan,Thanks for your quick reply. I already specified those. It turned out I had the directory structure quite wrong. I am using maven artifacts and the structure thus is a little bit different from the plugins SDK structure. I now implemented a startupaction which adds the hook and template.thanks!Joris Please sign in to reply. Reply as... Cancel Ryan Park Joris Meijer 10 Years Ago I glad it worked out for you. Please sign in to reply. Reply as... Cancel
Joris Meijer Ryan Park 10 Years Ago Hi Ryan,Thanks for your quick reply. I already specified those. It turned out I had the directory structure quite wrong. I am using maven artifacts and the structure thus is a little bit different from the plugins SDK structure. I now implemented a startupaction which adds the hook and template.thanks!Joris Please sign in to reply. Reply as... Cancel Ryan Park Joris Meijer 10 Years Ago I glad it worked out for you. Please sign in to reply. Reply as... Cancel
Ryan Park Joris Meijer 10 Years Ago I glad it worked out for you. Please sign in to reply. Reply as... Cancel
Chris Steinmeyer 10 Years Ago Is it possible to use a custome spring context xml in an UpgradeProcess? If it is possible, how i can retrieve it? Please sign in to reply. Reply as... Cancel