Brian Chan Vor 14 Jahren Thanks for writing this Amos Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Jonas Yuan Vor 14 Jahren Very nice. Thank you, Amos. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Julio Camarero Vor 14 Jahren Great summary Amos, this is very helpful! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Tina Agrawal Vor 14 Jahren Really helpful!! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Bavithra Rajendran Vor 14 Jahren Sir, Thanks for this helpful feature Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Gwenaël Gourevich Vor 14 Jahren That is very useful ... thank you! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Shagul Khaja Vor 14 Jahren Nice job Amos. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Jignesh Vachhani Vor 14 Jahren Really helpful amos,Thanks Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Joao Sequeira Vor 14 Jahren Very nice article I was trying to use your example but the class "UserLocalServiceWrapper" or "UserWrapper" are not on the liferay distribution (5.2.3), only on SVN, is it possible to use this with the official distribution?Best Regards,Joao Sequeira Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Joao Sequeira Vor 14 Jahren Hi Joao,Sorry I didn't specify versions. Number 1 is only available in 6.0, 5.2 EE SP 2, 5.1 EE SP 5 or later. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Joao Sequeira Vor 14 Jahren Hi Joao,Sorry I didn't specify versions. Number 1 is only available in 6.0, 5.2 EE SP 2, 5.1 EE SP 5 or later. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Anand Barhate Vor 14 Jahren Hi Amos,Thanks for the article I have couple of questions. I am using 5.2.2 in the first half it says about using plugin for extending the user attributes. When I added that in hooks I am getting error about service tags. Secondly in later part it talks about changing struts xml. Does it need to be done in plugin/hooks?Please let me know.Thanks Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Anand Barhate Vor 14 Jahren Hi Anand,Making changes to struts-config.xml has to be done in ext environment. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Deepak Kenchamba Amos Fong Vor 13 Jahren Hi Team, You need to edit the "struts-config-ext.xml" file to point to your custom Action class.Assuming Liferay is deployed in "D:\liferay-portal-6.0.5" folder. A blank "struts-config-ext.xml" can be found atD:\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\ folder <action path="/login/create_account" type="ae.rak.hook.portlet.login.action.MyCreateAccountAction"> <forward name="portlet.login.create_account" path="portlet.login.create_account" /> </action> Next add the custom action class into the classes folder of the portal.D:\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\classesIt is easy to compile your custom Action java file.1. Install Liferay IDE2. Create a new 'Liferay Hook Plug-in Project'3. Create your custom Action java file & compile The IDE provides all help in compiling your .java file to a .class file Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Henrique Fernandes Deepak Kenchamba Vor 13 Jahren Hi Deepak,Is there any way of doing this using the deploy process of a Hook Plug-in? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Luis Rodríguez Fernández Henrique Fernandes Vor 13 Jahren Hi Henrique, I have tried overriding the action class with a hook plugin, but it seems to be problems with the classloader: http://www.liferay.com/community/forums/-/message_boards/message/7817764#_19_message_7817764I am afraid that the EXT approach is going to be the best solution...Hope it helps, Luis Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Anand Barhate Vor 14 Jahren Hi Anand,Making changes to struts-config.xml has to be done in ext environment. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Deepak Kenchamba Amos Fong Vor 13 Jahren Hi Team, You need to edit the "struts-config-ext.xml" file to point to your custom Action class.Assuming Liferay is deployed in "D:\liferay-portal-6.0.5" folder. A blank "struts-config-ext.xml" can be found atD:\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\ folder <action path="/login/create_account" type="ae.rak.hook.portlet.login.action.MyCreateAccountAction"> <forward name="portlet.login.create_account" path="portlet.login.create_account" /> </action> Next add the custom action class into the classes folder of the portal.D:\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\classesIt is easy to compile your custom Action java file.1. Install Liferay IDE2. Create a new 'Liferay Hook Plug-in Project'3. Create your custom Action java file & compile The IDE provides all help in compiling your .java file to a .class file Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Henrique Fernandes Deepak Kenchamba Vor 13 Jahren Hi Deepak,Is there any way of doing this using the deploy process of a Hook Plug-in? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Luis Rodríguez Fernández Henrique Fernandes Vor 13 Jahren Hi Henrique, I have tried overriding the action class with a hook plugin, but it seems to be problems with the classloader: http://www.liferay.com/community/forums/-/message_boards/message/7817764#_19_message_7817764I am afraid that the EXT approach is going to be the best solution...Hope it helps, Luis Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Deepak Kenchamba Amos Fong Vor 13 Jahren Hi Team, You need to edit the "struts-config-ext.xml" file to point to your custom Action class.Assuming Liferay is deployed in "D:\liferay-portal-6.0.5" folder. A blank "struts-config-ext.xml" can be found atD:\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\ folder <action path="/login/create_account" type="ae.rak.hook.portlet.login.action.MyCreateAccountAction"> <forward name="portlet.login.create_account" path="portlet.login.create_account" /> </action> Next add the custom action class into the classes folder of the portal.D:\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\classesIt is easy to compile your custom Action java file.1. Install Liferay IDE2. Create a new 'Liferay Hook Plug-in Project'3. Create your custom Action java file & compile The IDE provides all help in compiling your .java file to a .class file Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Henrique Fernandes Deepak Kenchamba Vor 13 Jahren Hi Deepak,Is there any way of doing this using the deploy process of a Hook Plug-in? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Luis Rodríguez Fernández Henrique Fernandes Vor 13 Jahren Hi Henrique, I have tried overriding the action class with a hook plugin, but it seems to be problems with the classloader: http://www.liferay.com/community/forums/-/message_boards/message/7817764#_19_message_7817764I am afraid that the EXT approach is going to be the best solution...Hope it helps, Luis Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Henrique Fernandes Deepak Kenchamba Vor 13 Jahren Hi Deepak,Is there any way of doing this using the deploy process of a Hook Plug-in? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Luis Rodríguez Fernández Henrique Fernandes Vor 13 Jahren Hi Henrique, I have tried overriding the action class with a hook plugin, but it seems to be problems with the classloader: http://www.liferay.com/community/forums/-/message_boards/message/7817764#_19_message_7817764I am afraid that the EXT approach is going to be the best solution...Hope it helps, Luis Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Luis Rodríguez Fernández Henrique Fernandes Vor 13 Jahren Hi Henrique, I have tried overriding the action class with a hook plugin, but it seems to be problems with the classloader: http://www.liferay.com/community/forums/-/message_boards/message/7817764#_19_message_7817764I am afraid that the EXT approach is going to be the best solution...Hope it helps, Luis Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Peter Pastrnak Vor 13 Jahren Nice article, thank you.I would like to ask you, how is possible to use the extended User object (TestUserImpl) from the test-hook example in a JSP code - f.e. in the portlet/blogs/view.jsp.It seems the JSP compiler does not see the class, so I cannot import it:<%@ page import="com.liferay.testhook.hook.model.impl.TestUserImpl" %>Only a type can be imported. com.liferay.testhook.hook.model.impl.TestUserImpl resolves to a packageIs there an easy way, how to do it?Thanks. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Alessandro Cosenza Vor 13 Jahren Helloif I want to override the AssetEntryLocalServiceImpl.updateEntry method in a hook, what I have to do?Extending AssetEntryLocalServiceWrapper seems to be very tricky, because I have to substitute all the *persistence variables with corresponding *LocalServiceUtil class. And it still doesn't work, because how can I replace assetEntryPersistence.setAssetCategories? Does anyone help me? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Brian Chan Alessandro Cosenza Vor 13 Jahren See svn://svn.liferay.com/repos/public/plugins/trunkThere's one called /hooks/sample-wrapper-hookWe'll be releasing that soon. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Brian Chan Alessandro Cosenza Vor 13 Jahren See svn://svn.liferay.com/repos/public/plugins/trunkThere's one called /hooks/sample-wrapper-hookWe'll be releasing that soon. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Fernando O Vor 13 Jahren Hi!I'm triying to override a method in com.liferay.portal.service.LayoutLocalService.I use this code in liferay-hook.xml:<service><service-type>com.liferay.portal.service.LayoutLocalService</service-type><service-impl>com.prueba.portal.service.MyLayoutLocalService</service-impl></service>and override the method in this class (MyLayoutLocalService) (it extends LayoutLocalServiceWrapper).But when I deploy the hook and use the method, it doesn't use the new method and stills using the old one.How can I made this work? Where could I find lifeary-hook_6_0_0.dtd?Kind regards! and thank you for the blog entry! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Fernando O Fernando O Vor 13 Jahren Finally I found the problem, there were some code that was executed before tue function I wanted to override, once I remove this wrong code everithing works as expected. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Fernando O Fernando O Vor 13 Jahren Finally I found the problem, there were some code that was executed before tue function I wanted to override, once I remove this wrong code everithing works as expected. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Prasanna Kumar Vor 13 Jahren Hi All,I need some solution on user management module.When we create new user in liferay it will go to user_ table in lportal database. But our requirement is we want to store the userdetails to be stored in our database as well.I mean.. When we create new user, details should be stored in both the database (user_ table in lportal database and user table in our database).Can anybody suggest where to write the code to do above task?we are working in ext environment...Thanks in advance.... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Prasanna Kumar Vor 13 Jahren Hi Prasana,There a couple ways to do this, the best way I can think of is to create a model listener for add user and update user that will update your own database. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Jakub Liska Amos Fong Vor 13 Jahren Hi Amos,regarding the hint about overriding classes listed in liferay-hook.dtd, I suppose we can't change for example " login.events.post=com.liferay.portal.events.LoginPostAction " to " login.events.post=com.liferay.portal.events.MyOwnLoginPostAction "in other words, we can override the properties, but the new classes that we need to use instead, like MyOwnLoginPostAction, must be added via ext, right? Overriding portal-impl or portal-service classes, can be done only via ext, except of the custom services that can be overridden by hook. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Jakub Liska Jakub Liska Vor 13 Jahren I got it, we can do it. It's like a list of classes that can be overridden no matter if they are portal-impl. It's good to know, thank you Amos Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Prasanna Kumar Vor 13 Jahren Hi Prasana,There a couple ways to do this, the best way I can think of is to create a model listener for add user and update user that will update your own database. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Jakub Liska Amos Fong Vor 13 Jahren Hi Amos,regarding the hint about overriding classes listed in liferay-hook.dtd, I suppose we can't change for example " login.events.post=com.liferay.portal.events.LoginPostAction " to " login.events.post=com.liferay.portal.events.MyOwnLoginPostAction "in other words, we can override the properties, but the new classes that we need to use instead, like MyOwnLoginPostAction, must be added via ext, right? Overriding portal-impl or portal-service classes, can be done only via ext, except of the custom services that can be overridden by hook. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Jakub Liska Jakub Liska Vor 13 Jahren I got it, we can do it. It's like a list of classes that can be overridden no matter if they are portal-impl. It's good to know, thank you Amos Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Jakub Liska Amos Fong Vor 13 Jahren Hi Amos,regarding the hint about overriding classes listed in liferay-hook.dtd, I suppose we can't change for example " login.events.post=com.liferay.portal.events.LoginPostAction " to " login.events.post=com.liferay.portal.events.MyOwnLoginPostAction "in other words, we can override the properties, but the new classes that we need to use instead, like MyOwnLoginPostAction, must be added via ext, right? Overriding portal-impl or portal-service classes, can be done only via ext, except of the custom services that can be overridden by hook. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Jakub Liska Jakub Liska Vor 13 Jahren I got it, we can do it. It's like a list of classes that can be overridden no matter if they are portal-impl. It's good to know, thank you Amos Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Jakub Liska Jakub Liska Vor 13 Jahren I got it, we can do it. It's like a list of classes that can be overridden no matter if they are portal-impl. It's good to know, thank you Amos Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Prasanna Kumar Vor 13 Jahren Amos Fong, Thanks for your reply...I am very new to liferay Can you explain in detail? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Prasanna Kumar Vor 13 Jahren There is a short tutorial in this wiki:http://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+PluginsAnd there is a sample test hook here that has an example of a model listener:http://svn.liferay.com/repos/public/plugins/trunk/portlets/test-hook-portlet/user: guest, no password Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Prasanna Kumar Vor 13 Jahren There is a short tutorial in this wiki:http://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+PluginsAnd there is a sample test hook here that has an example of a model listener:http://svn.liferay.com/repos/public/plugins/trunk/portlets/test-hook-portlet/user: guest, no password Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Prasanna Kumar Vor 13 Jahren Thanks Amos...We are using openSSO ... we need to sync openSSO data with liferay data. Can you suggest some solution? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
prakash harigopal Vor 13 Jahren Hi Amos,Can you give me some instructions to implement the custom services(which connects to a different database) in liferay action classes. Plz let me know the way to handle creating services through service builder and Spring and Hibernate configurations in the plugin hook.thanksprakash Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Sandeep Nair Vor 13 Jahren In sample wrapper user of type SampleUserImpl is returned. How can it be accessed from other class?? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Brahim TARNAOUI Sandeep Nair Vor 13 Jahren Hello,i use a hook to extend a jsp page and i will use in my jsp a code like this <%@page import="my.packahe.my.classes"%>where can'i put my jar file? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Brahim TARNAOUI Sandeep Nair Vor 13 Jahren Hello,i use a hook to extend a jsp page and i will use in my jsp a code like this <%@page import="my.packahe.my.classes"%>where can'i put my jar file? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Peter Davison Vor 13 Jahren Hi.Does anyone know if it is possible to override a workflow handler via the hook mechanism, or does that need to be done via ext?Thanks,Pete Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prakash harigopal Peter Davison Vor 13 Jahren Hi Peter,If i listen correctly , you want to override the default workflow thats available in liferay. You can override that by selecting the workflow from controlpanel and paste the XML document thats available in Kaleo-web\web-inf\src\meta-inf\definitions\single-approver.xml. Liferay by default provided single approver workflow , you can override how ever you want by adding multiple tasks and transitions.And you can add a new workflow using controlpanel also , just go to workflow and click on add and upload the xml document to that ....thanksPrakash. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Peter Davison prakash harigopal Vor 13 Jahren Thanks for your reply. Yeah, I've created my own workflow which is essentially the single approver workflow with an additional step added when the workflow is approved. I want to send an email notification out to all interested users that a new piece of content is available in the portal. In this case it happens to be a new document library document.I want to include in the email a link to the new document. I'm struggling trying to build that URL given the data that is available in the velocity context that is available at the point that the email is generated.I'd like to override the code that creates the starts the workflow so that the URL to the document (as well as some other data like the list of roles that have access to the folder in which the document lives) is pre-populated in the workflow context. The code I'd like to override is the DLFileEntryWorkflowHandler. This seemed like a good place to build the URL to the newly uploaded document given that the DLFileEntry is passed into the startWorkflowInstance method. The default behaviour of this method (inherited from BaseWorkflowHandler) is to ignore the the model object passed in. I'd like to override that method to do something useful like build the URL to the document and stick it in the workflowContext. I'm attempting to do this via the ext method of overriding but if it is at all possible to do this via a hook I would prefer that approach.Pete Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
prakash harigopal Peter Davison Vor 13 Jahren Hi Peter,If i listen correctly , you want to override the default workflow thats available in liferay. You can override that by selecting the workflow from controlpanel and paste the XML document thats available in Kaleo-web\web-inf\src\meta-inf\definitions\single-approver.xml. Liferay by default provided single approver workflow , you can override how ever you want by adding multiple tasks and transitions.And you can add a new workflow using controlpanel also , just go to workflow and click on add and upload the xml document to that ....thanksPrakash. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Peter Davison prakash harigopal Vor 13 Jahren Thanks for your reply. Yeah, I've created my own workflow which is essentially the single approver workflow with an additional step added when the workflow is approved. I want to send an email notification out to all interested users that a new piece of content is available in the portal. In this case it happens to be a new document library document.I want to include in the email a link to the new document. I'm struggling trying to build that URL given the data that is available in the velocity context that is available at the point that the email is generated.I'd like to override the code that creates the starts the workflow so that the URL to the document (as well as some other data like the list of roles that have access to the folder in which the document lives) is pre-populated in the workflow context. The code I'd like to override is the DLFileEntryWorkflowHandler. This seemed like a good place to build the URL to the newly uploaded document given that the DLFileEntry is passed into the startWorkflowInstance method. The default behaviour of this method (inherited from BaseWorkflowHandler) is to ignore the the model object passed in. I'd like to override that method to do something useful like build the URL to the document and stick it in the workflowContext. I'm attempting to do this via the ext method of overriding but if it is at all possible to do this via a hook I would prefer that approach.Pete Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Peter Davison prakash harigopal Vor 13 Jahren Thanks for your reply. Yeah, I've created my own workflow which is essentially the single approver workflow with an additional step added when the workflow is approved. I want to send an email notification out to all interested users that a new piece of content is available in the portal. In this case it happens to be a new document library document.I want to include in the email a link to the new document. I'm struggling trying to build that URL given the data that is available in the velocity context that is available at the point that the email is generated.I'd like to override the code that creates the starts the workflow so that the URL to the document (as well as some other data like the list of roles that have access to the folder in which the document lives) is pre-populated in the workflow context. The code I'd like to override is the DLFileEntryWorkflowHandler. This seemed like a good place to build the URL to the newly uploaded document given that the DLFileEntry is passed into the startWorkflowInstance method. The default behaviour of this method (inherited from BaseWorkflowHandler) is to ignore the the model object passed in. I'd like to override that method to do something useful like build the URL to the document and stick it in the workflowContext. I'm attempting to do this via the ext method of overriding but if it is at all possible to do this via a hook I would prefer that approach.Pete Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Luis Rodríguez Fernández Vor 13 Jahren Thanks Amos, great post, really useful!!!1. Do you need to override any *Action.java classes? For doing this couldn't you create a hook pluging?Thanks in advance, Luis Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Nguyen Trung Kien Vor 13 Jahren Hi AmosIf I define new method in TestUserLocalServiceImpl, can I use it in other portlet made by Liferay Plugin SDK?Can I use hook plugin to define new method in userService?Thanks. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Nguyen Trung Kien Vor 13 Jahren No you cannot define a new method using a hook because it doesn't override the Util class, only the Impl class. You should use ext to define a new method in a Liferay Service. But it actually might be better to create your own service/class so there's better separation between your code and Liferay's. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Nguyen Trung Kien Vor 13 Jahren No you cannot define a new method using a hook because it doesn't override the Util class, only the Impl class. You should use ext to define a new method in a Liferay Service. But it actually might be better to create your own service/class so there's better separation between your code and Liferay's. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
(Sie) Vor 12 Jahren [...] Shahin Ali: Can i change the sorting order of message thread posts in the message boards to 'last posted first' present order is first posted first using liferay 6 EE Thanks. Try a hook on the... [...] Read More Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Jakub Liska Vor 12 Jahren I'm wondering what is the best way to implement custom Store. I'd need an alternative to JcrStore. I'm not using JackRabbit but ModeShape. And I'm wondering if I should use Hook or Ext. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Jakub Liska Jakub Liska Vor 12 Jahren I implemented it with Ext, no other means possible I think... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Jakub Liska Vor 12 Jahren @Jakub, do you mean another Document Library store using this property, (dl.store.impl)? I know it used to be possible and I think it should still be. Did you try specifying that property in your hook's portal.properties and making your store extend BaseStore? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Jakub Liska Vor 12 Jahren I'm wondering what is the best way to implement custom Store. I'd need an alternative to JcrStore. I'm not using JackRabbit but ModeShape. And I'm wondering if I should use Hook or Ext. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Jakub Liska Jakub Liska Vor 12 Jahren I implemented it with Ext, no other means possible I think... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Jakub Liska Vor 12 Jahren @Jakub, do you mean another Document Library store using this property, (dl.store.impl)? I know it used to be possible and I think it should still be. Did you try specifying that property in your hook's portal.properties and making your store extend BaseStore? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Jakub Liska Jakub Liska Vor 12 Jahren I implemented it with Ext, no other means possible I think... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Jakub Liska Vor 12 Jahren @Jakub, do you mean another Document Library store using this property, (dl.store.impl)? I know it used to be possible and I think it should still be. Did you try specifying that property in your hook's portal.properties and making your store extend BaseStore? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Jakub Liska Vor 12 Jahren @Jakub, do you mean another Document Library store using this property, (dl.store.impl)? I know it used to be possible and I think it should still be. Did you try specifying that property in your hook's portal.properties and making your store extend BaseStore? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Rajesh Chaurasia Vor 12 Jahren I want to extend the EditPagesAction class of Lifreay I want to add a tab in look and feel section of edit_pages_look_and_feel.jsp.I want to know how I Can use hook here .public class NPPEditPagesAction extends EditPagesAction { public void processAction(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { System.out.println("Inside processAction...createTheme()"); String cmd = ParamUtil.getString(actionRequest, Constants.CMD); try { if (cmd.equals("createtheme")) { createTheme(actionRequest); } super.processAction(mapping, form, portletConfig, actionRequest,actionResponse); } catch (Exception e) { } } public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { return super.render(mapping, form, portletConfig, renderRequest, renderResponse); //return mapping.findForward(getForward(renderRequest, "portlet.communities.edit_pages")); } @SuppressWarnings("static-access") public static void createTheme(ActionRequest actionRequest) { System.out.println("Inside createTheme..."); ThemeUtil themeUtil = new ThemeUtil(); final String themeZipFilePath = ThemeUtil.SAMPLE_THEMES_PATH; final String themeConfigFilePath = ThemeUtil.THEMES_CONFIG_PATH; try{ //To Modify liferay-look-and-feel.xml themeUtil.getXMLDetails(themeConfigFilePath); //To Extract the sample themes zip folder to tomcat location themeUtil.extractFolder(themeZipFilePath); } catch (Exception ex) { ex.printStackTrace(); } }<custom-jsp-dir>/WEB-INF</custom-jsp-dir> <struts-action> <struts-action-path>/layout_management/edit_pages</struts-action-path> <struts-action-impl>com.liferay.portlet.communities.action.NPPEditPagesAction</struts-action-impl> </struts-action>I am unable to execute my java code.please let me know where I am going wrong Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Rajesh Chaurasia Vor 12 Jahren Hi Rajesh,You cannot override struts action in a hook. You'll need to use the ext-plugin/environment to do that. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Brian Chan Amos Fong Vor 12 Jahren No, you can now.See http://www.liferay.com/web/mika.koivisto/blog/-/blogs/overriding-and-adding-struts-actions-from-hook-plugins Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Rajesh Chaurasia Vor 12 Jahren Hi Rajesh,You cannot override struts action in a hook. You'll need to use the ext-plugin/environment to do that. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Brian Chan Amos Fong Vor 12 Jahren No, you can now.See http://www.liferay.com/web/mika.koivisto/blog/-/blogs/overriding-and-adding-struts-actions-from-hook-plugins Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Brian Chan Amos Fong Vor 12 Jahren No, you can now.See http://www.liferay.com/web/mika.koivisto/blog/-/blogs/overriding-and-adding-struts-actions-from-hook-plugins Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
(Sie) Vor 12 Jahren [...] The below blog may help on how to extend a services via hook. http://www.liferay.com/web/amos.fong/blog/-/blogs/minimizing-the-ext-environment Mark as an Answer [...] Read More Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Suraj Bihari Vor 12 Jahren Thanks Amos! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Abu Muhammad Suraj Bihari Vor 12 Jahren Hi Amos, how to make user can post comment ? In my liferay, error "Blogs in temporarily unavailable" when submit comment. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Carlo G. Abu Muhammad Vor 12 Jahren In your code you write:throw new RequiredFieldException("favoriteColor", "favoriteColorLabel"); // v6.0/EE specific code Is there a suitable exception in the Community Edition (6.1) ? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Carlo G. Vor 12 Jahren I believe since writing the post it has been added to CE so it should be in 6.1. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Abu Muhammad Suraj Bihari Vor 12 Jahren Hi Amos, how to make user can post comment ? In my liferay, error "Blogs in temporarily unavailable" when submit comment. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Carlo G. Abu Muhammad Vor 12 Jahren In your code you write:throw new RequiredFieldException("favoriteColor", "favoriteColorLabel"); // v6.0/EE specific code Is there a suitable exception in the Community Edition (6.1) ? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Carlo G. Vor 12 Jahren I believe since writing the post it has been added to CE so it should be in 6.1. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Carlo G. Abu Muhammad Vor 12 Jahren In your code you write:throw new RequiredFieldException("favoriteColor", "favoriteColorLabel"); // v6.0/EE specific code Is there a suitable exception in the Community Edition (6.1) ? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Carlo G. Vor 12 Jahren I believe since writing the post it has been added to CE so it should be in 6.1. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Carlo G. Vor 12 Jahren I believe since writing the post it has been added to CE so it should be in 6.1. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
(Sie) Vor 11 Jahren [...] This article will share two cool features - Hooks and Plugins Ext - in Liferay portal 6. Speciall thanks to Amos Fong, so that we could minimize the ext environment by using hooks. A lot of thanks to... [...] Read More Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Elijah Mangason Vor 11 Jahren Hello Liferay Community,I am very new to Liferay, and am trying to program a Hook using 6.1 that will override CreateAccountAction as shown in this post. Is it possible??? If not, in what type of Liferay project would one include the code shown in this post (i.e. ext, new portlet, etc.)Thanks in advance for your response. I'm really stuck!E. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Elijah Mangason Vor 11 Jahren - Bearbeitet @ElijahYes, you can override CreateAccountAction in hook now, not by methods in this post, but see this post:http://www.liferay.com/web/mika.koivisto/blog/-/blogs/overriding-and-adding-struts-actions-from-hook-plugins Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren Hello Amos,Thank you for your response.I've read link on overriding struts actions several times. It is mentioned in the link that only two interfaces can be overridden: BaseStrutsPortletAction and BaseStrutsAction. Neither of these allows for directly extending CreateAccountAction, which is in portal-impl.jar. I need to validate existing users on login by simply comparing their input with what is already in the database. I would like to extend and override CreateAccountAction.java to do this, as you have shown above in THIS post. To implement as above, where would I place the code, in a hook, ext? Your help would be greatly appreciated.E. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Elijah Mangason Vor 11 Jahren Following this post, you would use ext plugin and edit struts-action-ext.xml to point to your own implementation. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren Thanks, Amos, for your response. I may have to do my implementation as an ext plugin rather than a hook. I'm wondering, however, how what you have shown in this post minimizes the ext environment if it needs to be implemented as an ext anyway. Could you please clarify? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Elijah Mangason Vor 11 Jahren It may not be obvious that it is possible to extend struts action classes through struts-config-ext.xml rather than having override the entire class which is more work and less maintainable. So this was just a tip for those who weren't already aware of it. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren It wasn't obvious to me, but I am new to Liferay, so that may be the reason why.Is there a tutorial or working example I could reference on how to extend or access methods within a struts action class such as CreateAccountAction without overriding the entire class? I've reference the post from Mika Koivisto (http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115) several times.... what am I missing? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Elijah Mangason Vor 11 Jahren - Bearbeitet @ElijahYes, you can override CreateAccountAction in hook now, not by methods in this post, but see this post:http://www.liferay.com/web/mika.koivisto/blog/-/blogs/overriding-and-adding-struts-actions-from-hook-plugins Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren Hello Amos,Thank you for your response.I've read link on overriding struts actions several times. It is mentioned in the link that only two interfaces can be overridden: BaseStrutsPortletAction and BaseStrutsAction. Neither of these allows for directly extending CreateAccountAction, which is in portal-impl.jar. I need to validate existing users on login by simply comparing their input with what is already in the database. I would like to extend and override CreateAccountAction.java to do this, as you have shown above in THIS post. To implement as above, where would I place the code, in a hook, ext? Your help would be greatly appreciated.E. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Elijah Mangason Vor 11 Jahren Following this post, you would use ext plugin and edit struts-action-ext.xml to point to your own implementation. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren Thanks, Amos, for your response. I may have to do my implementation as an ext plugin rather than a hook. I'm wondering, however, how what you have shown in this post minimizes the ext environment if it needs to be implemented as an ext anyway. Could you please clarify? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Elijah Mangason Vor 11 Jahren It may not be obvious that it is possible to extend struts action classes through struts-config-ext.xml rather than having override the entire class which is more work and less maintainable. So this was just a tip for those who weren't already aware of it. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren It wasn't obvious to me, but I am new to Liferay, so that may be the reason why.Is there a tutorial or working example I could reference on how to extend or access methods within a struts action class such as CreateAccountAction without overriding the entire class? I've reference the post from Mika Koivisto (http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115) several times.... what am I missing? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Elijah Mangason Amos Fong Vor 11 Jahren Hello Amos,Thank you for your response.I've read link on overriding struts actions several times. It is mentioned in the link that only two interfaces can be overridden: BaseStrutsPortletAction and BaseStrutsAction. Neither of these allows for directly extending CreateAccountAction, which is in portal-impl.jar. I need to validate existing users on login by simply comparing their input with what is already in the database. I would like to extend and override CreateAccountAction.java to do this, as you have shown above in THIS post. To implement as above, where would I place the code, in a hook, ext? Your help would be greatly appreciated.E. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Elijah Mangason Vor 11 Jahren Following this post, you would use ext plugin and edit struts-action-ext.xml to point to your own implementation. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren Thanks, Amos, for your response. I may have to do my implementation as an ext plugin rather than a hook. I'm wondering, however, how what you have shown in this post minimizes the ext environment if it needs to be implemented as an ext anyway. Could you please clarify? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Elijah Mangason Vor 11 Jahren It may not be obvious that it is possible to extend struts action classes through struts-config-ext.xml rather than having override the entire class which is more work and less maintainable. So this was just a tip for those who weren't already aware of it. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren It wasn't obvious to me, but I am new to Liferay, so that may be the reason why.Is there a tutorial or working example I could reference on how to extend or access methods within a struts action class such as CreateAccountAction without overriding the entire class? I've reference the post from Mika Koivisto (http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115) several times.... what am I missing? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Elijah Mangason Vor 11 Jahren Following this post, you would use ext plugin and edit struts-action-ext.xml to point to your own implementation. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren Thanks, Amos, for your response. I may have to do my implementation as an ext plugin rather than a hook. I'm wondering, however, how what you have shown in this post minimizes the ext environment if it needs to be implemented as an ext anyway. Could you please clarify? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Elijah Mangason Vor 11 Jahren It may not be obvious that it is possible to extend struts action classes through struts-config-ext.xml rather than having override the entire class which is more work and less maintainable. So this was just a tip for those who weren't already aware of it. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren It wasn't obvious to me, but I am new to Liferay, so that may be the reason why.Is there a tutorial or working example I could reference on how to extend or access methods within a struts action class such as CreateAccountAction without overriding the entire class? I've reference the post from Mika Koivisto (http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115) several times.... what am I missing? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Elijah Mangason Amos Fong Vor 11 Jahren Thanks, Amos, for your response. I may have to do my implementation as an ext plugin rather than a hook. I'm wondering, however, how what you have shown in this post minimizes the ext environment if it needs to be implemented as an ext anyway. Could you please clarify? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Amos Fong Elijah Mangason Vor 11 Jahren It may not be obvious that it is possible to extend struts action classes through struts-config-ext.xml rather than having override the entire class which is more work and less maintainable. So this was just a tip for those who weren't already aware of it. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren It wasn't obvious to me, but I am new to Liferay, so that may be the reason why.Is there a tutorial or working example I could reference on how to extend or access methods within a struts action class such as CreateAccountAction without overriding the entire class? I've reference the post from Mika Koivisto (http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115) several times.... what am I missing? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Amos Fong Elijah Mangason Vor 11 Jahren It may not be obvious that it is possible to extend struts action classes through struts-config-ext.xml rather than having override the entire class which is more work and less maintainable. So this was just a tip for those who weren't already aware of it. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Elijah Mangason Amos Fong Vor 11 Jahren It wasn't obvious to me, but I am new to Liferay, so that may be the reason why.Is there a tutorial or working example I could reference on how to extend or access methods within a struts action class such as CreateAccountAction without overriding the entire class? I've reference the post from Mika Koivisto (http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115) several times.... what am I missing? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Elijah Mangason Amos Fong Vor 11 Jahren It wasn't obvious to me, but I am new to Liferay, so that may be the reason why.Is there a tutorial or working example I could reference on how to extend or access methods within a struts action class such as CreateAccountAction without overriding the entire class? I've reference the post from Mika Koivisto (http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115) several times.... what am I missing? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen