Robert Buchmann 8 Years Ago Hi Jan,This is absolutely awesome. I gave up on using liferay and angular without trying as you have and gave up. This looks really good!However, I tried getting your code from github and deploying it to liferay and unfortunately it isn't working This is the error I get when just loading the initial page:16:08:16,776 ERROR [http-bio-8080-exec-351][render_portlet_jsp:132] nulljavax.portlet.PortletException: Path /partials/list.html is not accessible by this portlet at com.liferay.portal.kernel.portlet.LiferayPortlet.checkPath(LiferayPortlet.java:194) at com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:360) at com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:378) at com.liferay.util.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:311)Any idea why this might be happening? Please sign in to reply. Reply as... Cancel Robert Buchmann Robert Buchmann 8 Years Ago Ok Jan, never mind I fixed it...By overriding the checkPath method implemented in the MVCPortlet as follows : @Override protected void checkPath(String path) throws PortletException { //do nothing }But this doesn't seem optimal. Anyway all seems to be working. Great job. Please sign in to reply. Reply as... Cancel Jan Eerdekens Robert Buchmann 8 Years Ago Hi Robert,Glad my post is of use. I haven't encountered this error myself (yet). Maybe it's something that happens in a specific Liferay version. Which version are you trying it on? Please sign in to reply. Reply as... Cancel Steve Kaminski Robert Buchmann 8 Years Ago I am facing the exact same error message. Could you please explain how you did the overriding, since this function is located in the com.liferay.portal.kernel package, which cannot be overridden out of the box with a liferay-hook, right? I am quite new to Liferay, so sorry if the answer to this question is rather obvious. By the way, I am using Liferay 6.2.4. Please sign in to reply. Reply as... Cancel Jan Eerdekens Steve Kaminski 8 Years Ago Hi Steve,I tried my latest version, using in my Liferay Devcon presentation, in a Liferay 6.2.4 CE, but didn't encounter the issue. The code I tried was the rest-promises portlet from https://github.com/planetsizebrain/angular-adventures (you'll also need to deploy the angular-hook).When looking at the code of the MVCPortlet class, it looks like you can just subclass it with a class in your own portlet and override the implementation of the checkPath method with your own. When even looking a bit deeper into the original implementation of the checkPath method it seems that the PortalUtil.isValidResourceId method might be the reason for the error. It uses a portal property, portlet.resource.id.banned.paths.regexp, to ban certain URLs. You might try changing the default value (to empty for example) for this property to see if that helps. Please sign in to reply. Reply as... Cancel Steve Kaminski Jan Eerdekens 8 Years Ago Hey Robert & Jan,thanks for the fast reply and the detailed information of how to proceed in order to get ui-router functionality to work in portlet environment. As far as I could figure out, the error occurs because of a validity check forcing the html resource to be located under META-INF/resources, at least in version 6.2.4. Indeed, I'm working under ubuntu so I will see, if I experience any issues too. Please sign in to reply. Reply as... Cancel Robert Buchmann Steve Kaminski 8 Years Ago Hey Steve... I am also using liferay 6.2.4 CE. The fix I did was to add :@Overrideprotected void checkPath(String path) throws PortletException {//do nothing}to the ResourcePortlet class which is in the github angular project . This is in the be.aca.liferay.angular.portlet.resource package. So you override in the ResourcePortlet class which is a sub-class of com.liferay.util.bridges.mvc.MVC$You will only need to change the ResourcePortlet class and this should work....By the way, are you by any chance running linux/ubuntu? Me and a friend have both had this issue on ubuntu setups. Doubt it has to do with it but worth a shot Please sign in to reply. Reply as... Cancel
Robert Buchmann Robert Buchmann 8 Years Ago Ok Jan, never mind I fixed it...By overriding the checkPath method implemented in the MVCPortlet as follows : @Override protected void checkPath(String path) throws PortletException { //do nothing }But this doesn't seem optimal. Anyway all seems to be working. Great job. Please sign in to reply. Reply as... Cancel Jan Eerdekens Robert Buchmann 8 Years Ago Hi Robert,Glad my post is of use. I haven't encountered this error myself (yet). Maybe it's something that happens in a specific Liferay version. Which version are you trying it on? Please sign in to reply. Reply as... Cancel Steve Kaminski Robert Buchmann 8 Years Ago I am facing the exact same error message. Could you please explain how you did the overriding, since this function is located in the com.liferay.portal.kernel package, which cannot be overridden out of the box with a liferay-hook, right? I am quite new to Liferay, so sorry if the answer to this question is rather obvious. By the way, I am using Liferay 6.2.4. Please sign in to reply. Reply as... Cancel Jan Eerdekens Steve Kaminski 8 Years Ago Hi Steve,I tried my latest version, using in my Liferay Devcon presentation, in a Liferay 6.2.4 CE, but didn't encounter the issue. The code I tried was the rest-promises portlet from https://github.com/planetsizebrain/angular-adventures (you'll also need to deploy the angular-hook).When looking at the code of the MVCPortlet class, it looks like you can just subclass it with a class in your own portlet and override the implementation of the checkPath method with your own. When even looking a bit deeper into the original implementation of the checkPath method it seems that the PortalUtil.isValidResourceId method might be the reason for the error. It uses a portal property, portlet.resource.id.banned.paths.regexp, to ban certain URLs. You might try changing the default value (to empty for example) for this property to see if that helps. Please sign in to reply. Reply as... Cancel Steve Kaminski Jan Eerdekens 8 Years Ago Hey Robert & Jan,thanks for the fast reply and the detailed information of how to proceed in order to get ui-router functionality to work in portlet environment. As far as I could figure out, the error occurs because of a validity check forcing the html resource to be located under META-INF/resources, at least in version 6.2.4. Indeed, I'm working under ubuntu so I will see, if I experience any issues too. Please sign in to reply. Reply as... Cancel Robert Buchmann Steve Kaminski 8 Years Ago Hey Steve... I am also using liferay 6.2.4 CE. The fix I did was to add :@Overrideprotected void checkPath(String path) throws PortletException {//do nothing}to the ResourcePortlet class which is in the github angular project . This is in the be.aca.liferay.angular.portlet.resource package. So you override in the ResourcePortlet class which is a sub-class of com.liferay.util.bridges.mvc.MVC$You will only need to change the ResourcePortlet class and this should work....By the way, are you by any chance running linux/ubuntu? Me and a friend have both had this issue on ubuntu setups. Doubt it has to do with it but worth a shot Please sign in to reply. Reply as... Cancel
Jan Eerdekens Robert Buchmann 8 Years Ago Hi Robert,Glad my post is of use. I haven't encountered this error myself (yet). Maybe it's something that happens in a specific Liferay version. Which version are you trying it on? Please sign in to reply. Reply as... Cancel
Steve Kaminski Robert Buchmann 8 Years Ago I am facing the exact same error message. Could you please explain how you did the overriding, since this function is located in the com.liferay.portal.kernel package, which cannot be overridden out of the box with a liferay-hook, right? I am quite new to Liferay, so sorry if the answer to this question is rather obvious. By the way, I am using Liferay 6.2.4. Please sign in to reply. Reply as... Cancel Jan Eerdekens Steve Kaminski 8 Years Ago Hi Steve,I tried my latest version, using in my Liferay Devcon presentation, in a Liferay 6.2.4 CE, but didn't encounter the issue. The code I tried was the rest-promises portlet from https://github.com/planetsizebrain/angular-adventures (you'll also need to deploy the angular-hook).When looking at the code of the MVCPortlet class, it looks like you can just subclass it with a class in your own portlet and override the implementation of the checkPath method with your own. When even looking a bit deeper into the original implementation of the checkPath method it seems that the PortalUtil.isValidResourceId method might be the reason for the error. It uses a portal property, portlet.resource.id.banned.paths.regexp, to ban certain URLs. You might try changing the default value (to empty for example) for this property to see if that helps. Please sign in to reply. Reply as... Cancel Steve Kaminski Jan Eerdekens 8 Years Ago Hey Robert & Jan,thanks for the fast reply and the detailed information of how to proceed in order to get ui-router functionality to work in portlet environment. As far as I could figure out, the error occurs because of a validity check forcing the html resource to be located under META-INF/resources, at least in version 6.2.4. Indeed, I'm working under ubuntu so I will see, if I experience any issues too. Please sign in to reply. Reply as... Cancel Robert Buchmann Steve Kaminski 8 Years Ago Hey Steve... I am also using liferay 6.2.4 CE. The fix I did was to add :@Overrideprotected void checkPath(String path) throws PortletException {//do nothing}to the ResourcePortlet class which is in the github angular project . This is in the be.aca.liferay.angular.portlet.resource package. So you override in the ResourcePortlet class which is a sub-class of com.liferay.util.bridges.mvc.MVC$You will only need to change the ResourcePortlet class and this should work....By the way, are you by any chance running linux/ubuntu? Me and a friend have both had this issue on ubuntu setups. Doubt it has to do with it but worth a shot Please sign in to reply. Reply as... Cancel
Jan Eerdekens Steve Kaminski 8 Years Ago Hi Steve,I tried my latest version, using in my Liferay Devcon presentation, in a Liferay 6.2.4 CE, but didn't encounter the issue. The code I tried was the rest-promises portlet from https://github.com/planetsizebrain/angular-adventures (you'll also need to deploy the angular-hook).When looking at the code of the MVCPortlet class, it looks like you can just subclass it with a class in your own portlet and override the implementation of the checkPath method with your own. When even looking a bit deeper into the original implementation of the checkPath method it seems that the PortalUtil.isValidResourceId method might be the reason for the error. It uses a portal property, portlet.resource.id.banned.paths.regexp, to ban certain URLs. You might try changing the default value (to empty for example) for this property to see if that helps. Please sign in to reply. Reply as... Cancel Steve Kaminski Jan Eerdekens 8 Years Ago Hey Robert & Jan,thanks for the fast reply and the detailed information of how to proceed in order to get ui-router functionality to work in portlet environment. As far as I could figure out, the error occurs because of a validity check forcing the html resource to be located under META-INF/resources, at least in version 6.2.4. Indeed, I'm working under ubuntu so I will see, if I experience any issues too. Please sign in to reply. Reply as... Cancel
Steve Kaminski Jan Eerdekens 8 Years Ago Hey Robert & Jan,thanks for the fast reply and the detailed information of how to proceed in order to get ui-router functionality to work in portlet environment. As far as I could figure out, the error occurs because of a validity check forcing the html resource to be located under META-INF/resources, at least in version 6.2.4. Indeed, I'm working under ubuntu so I will see, if I experience any issues too. Please sign in to reply. Reply as... Cancel
Robert Buchmann Steve Kaminski 8 Years Ago Hey Steve... I am also using liferay 6.2.4 CE. The fix I did was to add :@Overrideprotected void checkPath(String path) throws PortletException {//do nothing}to the ResourcePortlet class which is in the github angular project . This is in the be.aca.liferay.angular.portlet.resource package. So you override in the ResourcePortlet class which is a sub-class of com.liferay.util.bridges.mvc.MVC$You will only need to change the ResourcePortlet class and this should work....By the way, are you by any chance running linux/ubuntu? Me and a friend have both had this issue on ubuntu setups. Doubt it has to do with it but worth a shot Please sign in to reply. Reply as... Cancel
István Dézsi 7 Years Ago Hey Jan,Thank you for your awesome article.I'm building a little Liferay-AngularJS project myself, and your samples provide a wonderful foundation to that.When I tried to build the example with mvn, stumbled on this error:Caused by: java.io.FileNotFoundException: c:\angular-portlet\src\main\webapp\WEB-INF\wro.xml (File could not be found) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:146) at ro.isdc.wro.extensions.model.factory.SmartWroModelFactory.createAutoDetectedStream(SmartWroModelFactory.java:166) ... 46 more[WARNING] Couldn't load new model, reusing last Valid Model![ERROR] Exception occured while processing: ro.isdc.wro.WroRuntimeException: No valid model was found!, class: ro.isdc.wro.WroRuntimeException,caused by:ro.isdc.wro.WroRuntimeException: No valid model was found!The interesting thing is that it looks for wro.xml, but this file is indeed not existing. Instead, a wro.groovy file is under the same path, as is it described in your post.Do you guys have an idea how to overcome this?I searched various forums related to Maven and Wro, but could not find any solution so far. Thank you very much! Please sign in to reply. Reply as... Cancel Jan Eerdekens István Dézsi 7 Years Ago Hi István,I just tried to build the latest download of the master branch of the example portlet and for me the build went fine and the WRO4J Maven plugin did its job. What I did notice was that even though it works and uses my wro.groovy file, it also mentions wro.xml in the output.What you could try is to add <wroFile>${basedir}/src/main/webapp/WEB-INF/wro.groovy</wroFile> to the configuration section of the wro4j plugin. I did this myself locally and this also works for me. Please sign in to reply. Reply as... Cancel István Dézsi Jan Eerdekens 7 Years Ago Hi Jan,I did what you suggested and the compilation went smoothly.Thanks for great help! Please sign in to reply. Reply as... Cancel
Jan Eerdekens István Dézsi 7 Years Ago Hi István,I just tried to build the latest download of the master branch of the example portlet and for me the build went fine and the WRO4J Maven plugin did its job. What I did notice was that even though it works and uses my wro.groovy file, it also mentions wro.xml in the output.What you could try is to add <wroFile>${basedir}/src/main/webapp/WEB-INF/wro.groovy</wroFile> to the configuration section of the wro4j plugin. I did this myself locally and this also works for me. Please sign in to reply. Reply as... Cancel István Dézsi Jan Eerdekens 7 Years Ago Hi Jan,I did what you suggested and the compilation went smoothly.Thanks for great help! Please sign in to reply. Reply as... Cancel
István Dézsi Jan Eerdekens 7 Years Ago Hi Jan,I did what you suggested and the compilation went smoothly.Thanks for great help! Please sign in to reply. Reply as... Cancel