Olaf Kock 8 Years Ago Caveat: Use Startup Actions wisely, mainly for constructive work, never for destructive work, because they will run again on next startup. In case you need something running truly once and never again, it's safer to implement an Upgrade Action. Liferay will take care of it never to run a second time. For Startup Actions you'll have to pay attention yourself. Creating an Expando Field is no problem - you automatically won't create them again. But if you reset your portal to a baseline (potentially deleting existing content), you rather want that to be done once and never again when someone deploys the plugin again. Fun fact: The ancient SevenCogs implementation was first implemented as Startup Action. As it could be quite destructive, it was quickly migrated into an Upgrade Action Please sign in to reply. Reply as... Cancel Lauri Hiltunen Olaf Kock 8 Years Ago Thank you for your input, Olaf, you're correct! Creating expando fields with the start up action is a good feature because it enables you to easily update and also add new expando fields (or roles for instance) when necessary. With upgrade actions you have to make sure it runs again (or create a new one) if something more is added. Though maybe I'll write something about the upgrade action in the near future as well. Please sign in to reply. Reply as... Cancel Boris Gligorijević Olaf Kock 7 Years Ago Hi Olaf,Do you know a solution for DXP? How does one create start-up hook within OSGI? Please sign in to reply. Reply as... Cancel Renáta Kovács Boris Gligorijević 7 Years Ago Hooks are deprecated in DXP. https://github.com/liferay/liferay-blade-samples (look for: "Extension point description:" and "application.startup.events") Please sign in to reply. Reply as... Cancel Alexander Schmacks Renáta Kovács 5 Years Ago Where does it say that these events ( startup action discussed here) are deprecated? Both search terms don't yield helpful insights for me... On the other hand Portal Properties documentation for 7.1 here https://docs.liferay.com/ce/portal/7.1-latest/propertiesdoc/portal.properties.html#Startup%20Events still refers to class SimpleAction (though in wrong, old 'struts' package). And class SimpleAction on Github https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/portal/kernel/events/SimpleAction.java has no deprecation marker (and sadly no documentation at all, as so many other classes... But that's another topic). Please sign in to reply. Reply as... Cancel Olaf Kock Alexander Schmacks 5 Years Ago Hm - I didn't get the earlier discussion. But I believe that LifecycleAction is the new kid on the block - with various possible key-properties https://github.com/liferay/liferay-blade-samples/blob/7.1/liferay-workspace/extensions/lifecycle-login-preaction/src/main/java/com/liferay/blade/samples/lifecycle/loginpreaction/LoginPreAction.java Please sign in to reply. Reply as... Cancel
Lauri Hiltunen Olaf Kock 8 Years Ago Thank you for your input, Olaf, you're correct! Creating expando fields with the start up action is a good feature because it enables you to easily update and also add new expando fields (or roles for instance) when necessary. With upgrade actions you have to make sure it runs again (or create a new one) if something more is added. Though maybe I'll write something about the upgrade action in the near future as well. Please sign in to reply. Reply as... Cancel
Boris Gligorijević Olaf Kock 7 Years Ago Hi Olaf,Do you know a solution for DXP? How does one create start-up hook within OSGI? Please sign in to reply. Reply as... Cancel Renáta Kovács Boris Gligorijević 7 Years Ago Hooks are deprecated in DXP. https://github.com/liferay/liferay-blade-samples (look for: "Extension point description:" and "application.startup.events") Please sign in to reply. Reply as... Cancel Alexander Schmacks Renáta Kovács 5 Years Ago Where does it say that these events ( startup action discussed here) are deprecated? Both search terms don't yield helpful insights for me... On the other hand Portal Properties documentation for 7.1 here https://docs.liferay.com/ce/portal/7.1-latest/propertiesdoc/portal.properties.html#Startup%20Events still refers to class SimpleAction (though in wrong, old 'struts' package). And class SimpleAction on Github https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/portal/kernel/events/SimpleAction.java has no deprecation marker (and sadly no documentation at all, as so many other classes... But that's another topic). Please sign in to reply. Reply as... Cancel Olaf Kock Alexander Schmacks 5 Years Ago Hm - I didn't get the earlier discussion. But I believe that LifecycleAction is the new kid on the block - with various possible key-properties https://github.com/liferay/liferay-blade-samples/blob/7.1/liferay-workspace/extensions/lifecycle-login-preaction/src/main/java/com/liferay/blade/samples/lifecycle/loginpreaction/LoginPreAction.java Please sign in to reply. Reply as... Cancel
Renáta Kovács Boris Gligorijević 7 Years Ago Hooks are deprecated in DXP. https://github.com/liferay/liferay-blade-samples (look for: "Extension point description:" and "application.startup.events") Please sign in to reply. Reply as... Cancel Alexander Schmacks Renáta Kovács 5 Years Ago Where does it say that these events ( startup action discussed here) are deprecated? Both search terms don't yield helpful insights for me... On the other hand Portal Properties documentation for 7.1 here https://docs.liferay.com/ce/portal/7.1-latest/propertiesdoc/portal.properties.html#Startup%20Events still refers to class SimpleAction (though in wrong, old 'struts' package). And class SimpleAction on Github https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/portal/kernel/events/SimpleAction.java has no deprecation marker (and sadly no documentation at all, as so many other classes... But that's another topic). Please sign in to reply. Reply as... Cancel Olaf Kock Alexander Schmacks 5 Years Ago Hm - I didn't get the earlier discussion. But I believe that LifecycleAction is the new kid on the block - with various possible key-properties https://github.com/liferay/liferay-blade-samples/blob/7.1/liferay-workspace/extensions/lifecycle-login-preaction/src/main/java/com/liferay/blade/samples/lifecycle/loginpreaction/LoginPreAction.java Please sign in to reply. Reply as... Cancel
Alexander Schmacks Renáta Kovács 5 Years Ago Where does it say that these events ( startup action discussed here) are deprecated? Both search terms don't yield helpful insights for me... On the other hand Portal Properties documentation for 7.1 here https://docs.liferay.com/ce/portal/7.1-latest/propertiesdoc/portal.properties.html#Startup%20Events still refers to class SimpleAction (though in wrong, old 'struts' package). And class SimpleAction on Github https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/portal/kernel/events/SimpleAction.java has no deprecation marker (and sadly no documentation at all, as so many other classes... But that's another topic). Please sign in to reply. Reply as... Cancel Olaf Kock Alexander Schmacks 5 Years Ago Hm - I didn't get the earlier discussion. But I believe that LifecycleAction is the new kid on the block - with various possible key-properties https://github.com/liferay/liferay-blade-samples/blob/7.1/liferay-workspace/extensions/lifecycle-login-preaction/src/main/java/com/liferay/blade/samples/lifecycle/loginpreaction/LoginPreAction.java Please sign in to reply. Reply as... Cancel
Olaf Kock Alexander Schmacks 5 Years Ago Hm - I didn't get the earlier discussion. But I believe that LifecycleAction is the new kid on the block - with various possible key-properties https://github.com/liferay/liferay-blade-samples/blob/7.1/liferay-workspace/extensions/lifecycle-login-preaction/src/main/java/com/liferay/blade/samples/lifecycle/loginpreaction/LoginPreAction.java Please sign in to reply. Reply as... Cancel