An error occurred while processing the template.
Invocation of method 'get' in class com.liferay.portal.kernel.util.UnmodifiableList threw exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at 20297PRODUCT-DYNAMIC-TEMPLATE[line 34, column 197]
1#set( $assetVocabularyLocalService = $serviceLocator.findService("com.liferay.portlet.asset.service.AssetVocabularyLocalService") ) 2#set( $regionsVocabularyId = $assetVocabularyLocalService.getGroupVocabulary($company.group.groupId, "Regions").getVocabularyId() ) 3 4#set( $assetCategoryLocalService = $serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryLocalService") ) 5#set( $categories = $assetCategoryLocalService.getCategories("com.liferay.portal.model.Group", $getterUtil.getLong($request.get("theme-display").get("scope-group-id"))) ) 6 7#foreach( $currentCategory in $categories) 8 #if( $currentCategory.getVocabularyId() == $regionsVocabularyId ) 9 #set( $region_name = $currentCategory.getName() ) 10 #break 11 #end 12#end 13 14#set( $country_id = 0 ) 15#set( $country_id = $getterUtil.getLong($request.parameters.get("country_id") )) 16 17#set( $country_name = '' ) 18#set( $country_name = $assetCategoryLocalService.getCategory($country_id).getName() ) 19 20#set( $divisionId = $request.parameters.get("division_id") ) 21#set( $productLineId = $request.parameters.get("product_line_id") ) 22#set( $productId = $request.parameters.get("product_id") ) 23 24#set ($wcRetriever = $utilLocator.findUtil('com.sensus.velotools.WCRetriever')) 25#set( $groupId = $getterUtil.getLong($groupId) ) 26#set( $companyGroupId = $company.group.groupId ) 27 28#set( $groupLocalService = $serviceLocator.findService("com.liferay.portal.service.GroupLocalService") ) 29#set( $guestCommunityGroupId = $groupLocalService.getGroup($getterUtil.getLong($companyId), "Guest").getGroupId() ) 30 31#set( $communityId = $getterUtil.getLong($request.get('theme-display').get('scope-group-id')) ) 32 33#set( $result = '' ) 34#set( $result = $wcRetriever.getWebContent($guestCommunityGroupId, $companyGroupId, {"Divisions" : [$divisionId], "Product Lines" : [$productLineId], "Products" : ["Product", $productId]}, $null).get(0) ) 35 36#if( "$!result" != "" ) 37#productDynamicTemplate_getArticleXmlDocument($result) 38 39#set( $regionSelector = $portal.getClass().forName('com.sensus.velotools.RegionSelectorUtil')) 40 41#set ($sensusVelocityTemplateParser = $utilLocator.findUtil('com.sensus.velotools.SensusVelocityTemplateParser')) 42#set( $articleTemplateNodes = $sensusVelocityTemplateParser.getNodes($articleXmlDocument.getRootElement()) ) 43#foreach( $currentTemplateNode in $articleTemplateNodes ) 44 #if( $currentTemplateNode.getName() == 'region' ) 45 #set( $region = $regionSelector.selectRegionCountry($region_name, $country_name, $currentTemplateNode.getSiblings()) ) 46 #end 47#end 48 49#parse("_JOURNAL_CONTEXT_/$companyId/$company.group.groupId/$articleTemplateId") 50#else 51 52 #set( $groupLocalService = $serviceLocator.findService("com.liferay.portal.service.GroupLocalService") ) 53 54 <script type="text/javascript"> 55 location.replace('$portalUtil.getPathFriendlyURLPublic()$groupLocalService.getGroup($communityId).getFriendlyURL()'); 56 </script> 57 58#end 59 60#macro( productDynamicTemplate_getArticleXmlDocument $currentResult ) 61 #set($journalArticleLocalService = $serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService")) 62 #set( $article = $journalArticleLocalService.getLatestArticle($currentResult.getClassPK()) ) 63 #set( $articleTemplateId = $article.getTemplateId() ) 64 #set( $articleXmlDocument = $saxReaderUtil.read($article.getContentByLocale($request.locale)) ) 65#end An error occurred while processing the template.
Invocation of method 'get' in class com.liferay.portal.kernel.util.UnmodifiableList threw exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at 20297PRODUCT-SOLUTIONS-TEMPLATE[line 62, column 134]
1#set( $assetVocabularyLocalService = $serviceLocator.findService("com.liferay.portlet.asset.service.AssetVocabularyLocalService") ) 2#set( $regionsVocabularyId = $assetVocabularyLocalService.getGroupVocabulary($company.group.groupId, "Regions").getVocabularyId() ) 3 4#set( $assetCategoryLocalService = $serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryLocalService") ) 5#set( $categories = $assetCategoryLocalService.getCategories("com.liferay.portal.model.Group", $getterUtil.getLong($request.get("theme-display").get("scope-group-id"))) ) 6 7#foreach( $currentCategory in $categories) 8 #if( $currentCategory.getVocabularyId() == $regionsVocabularyId ) 9 #set( $region_id = $currentCategory.getCategoryId() ) 10 #end 11#end 12 13#set( $product_id = $request.parameters.get("product_id") ) 14 15#set( $communityId = $getterUtil.getLong($request.get('theme-display').get('scope-group-id')) ) 16 17#set( $configurationArticleUtil = $portal.getClass().forName('com.sensus.velotools.ConfigurationArticleUtil') ) 18 19#set( $configurationArticle = $configurationArticleUtil.getRegionConfigurationArticle($communityId) ) 20 21#set( $np = $request.get("portlet-namespace") ) 22 23<style type="text/css"> 24 25#${np}content, .${np}separator { 26 margin: 0 20px 0 25px; 27} 28 29#${np}content { 30 padding: 15px 0 70px 5px; 31} 32 33#${np}title { 34 margin-bottom: 25px; 35} 36 37#${np}solutions .${np}solution { 38 text-align: center; 39} 40 41 42#${np}solutions .${np}solution .${np}solution-title a { 43 font-weight: bold; 44 color: #57B633; 45} 46 47#${np}content .${np}solution-image img { 48 width: 100%; 49} 50 51</style> 52 53#set( $solutions_url = $configurationArticleUtil.getPageUrl('solutions_url', $configurationArticle, $title) ) 54 55#set( $groupId = $getterUtil.getLong($groupId) ) 56#set( $companyGroupId = $company.group.groupId ) 57 58#set( $groupLocalService = $serviceLocator.findService("com.liferay.portal.service.GroupLocalService") ) 59#set( $guestCommunityGroupId = $groupLocalService.getGroup($getterUtil.getLong($companyId), "Guest").getGroupId() ) 60 61#set ($wcRetriever = $utilLocator.findUtil('com.sensus.velotools.WCRetriever')) 62#set( $product = $wcRetriever.getWebContent($guestCommunityGroupId, $companyGroupId, {"Products" : ["Product", $product_id]}, $null).get(0) ) 63 64#productSolutionsTemplate_getWebContentCategories( $product "Solutions" ) 65#set( $SolutionCategories = $webContentCategories ) 66 67#set($urlParser = $utilLocator.findUtil('com.sensus.velotools.UrlParser')) 68 69#set( $numCols = 8 ) 70 71#if ( !$SolutionCategories.isEmpty() ) 72<hr class="${np}separator" /> 73<div id="${np}content"> 74 <div id="${np}title"><h2>$title.getData()</h2></div> 75 <div id="${np}solutions"> 76 #set( $solCount = 0 ) 77 #foreach( $currentSolutionCategory in $SolutionCategories ) 78 #if($solCount % $numCols == 0) 79 <div class="${np}solutions-row yui3-g"> 80 #end 81 #set( $solutionResults = $wcRetriever.getWebContent($guestCommunityGroupId, $companyGroupId, {"Solutions" : ["Solution"]}, $null, [$region_id, $currentSolutionCategory.getCategoryId()], $null) ) 82 #if( $solutionResults.size() != 0 ) 83 #set( $currentSolution = $solutionResults.get(0) ) 84 #productSolutionsTemplate_getFields( $currentSolution ) 85 <div class="${np}solution yui3-u-1-$numCols"> 86 <div class="${np}solution-image"> 87 <a href="$urlParser.parseUrl("$solutions_url?solution_id=$currentSolutionCategory.getName()")"><img src="$solutionImage" alt="$solutionTitle Solution" /></a> 88 </div> 89 <div class="${np}solution-title"><a href="$urlParser.parseUrl("$solutions_url?solution_id=$currentSolutionCategory.getName()")">$solutionTitle</a></div> 90 </div> 91 #end 92 #if(($solCount + 1) % $numCols == 0) 93 </div> 94 #end 95 #set( $solCount = $solCount + 1 ) 96 #end 97 #if($solCount % $numCols != 0) 98 </div> 99 #end 100 </div> 101</div> 102 103#end 104 105 106#macro( productSolutionsTemplate_getFields $currentSolution ) 107 #set($journalArticleLocalService = $serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService")) 108 #set( $article = $journalArticleLocalService.getLatestArticle($currentSolution.getClassPK()) ) 109 #set( $theContent = $article.getContentByLocale($request.locale) ) 110 #set( $document = $saxReaderUtil.read($theContent) ) 111 112 #set( $solutionTitle = $document.selectSingleNode("/root/dynamic-element[@name='region']/dynamic-element[@name='country']/dynamic-element[@name='title']/dynamic-content").getText() ) 113 #set( $solutionImage = $document.selectSingleNode("/root/dynamic-element[@name='region']/dynamic-element[@name='country']/dynamic-element[@name='image']/dynamic-content").getText() ) 114#end 115 116 117 118#macro( productSolutionsTemplate_getWebContentCategories $currentWebContent $vocabularyName ) 119 #set( $vocabularyId = $assetVocabularyLocalService.getGroupVocabulary($company.group.groupId, $vocabularyName).getVocabularyId() ) 120 #set( $webContentCategories = [] ) 121 #foreach( $currentCategory in $currentWebContent.getCategories() ) 122 #if( $currentCategory.getVocabularyId() == $vocabularyId ) 123 #set( $boolean = $webContentCategories.add($currentCategory) ) 124 #end 125 #end 126#end In the News
(computing.co.uk, April 2013)
(metering.com, January 2013)
(Bloomberg, January 2013)
(Energy Management, January 2013)
(metering.com, December 2012)
