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-LINE-DYNAMIC-TEMPLATE[line 33, column 175]
1#set( $assetVocabularyLocalService = $serviceLocator.findService("com.liferay.portlet.asset.service.AssetVocabularyLocalService") ) 
2#set( $regionsVocabularyId = $assetVocabularyLocalService.getGroupVocabulary($getterUtil.getLong($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 
23#set( $wcRetriever = $utilLocator.findUtil('com.sensus.velotools.WCRetriever')) 
24#set( $groupId = $getterUtil.getLong($groupId) ) 
25#set( $companyGroupId = $company.group.groupId ) 
26 
27#set( $groupLocalService = $serviceLocator.findService("com.liferay.portal.service.GroupLocalService") ) 
28#set( $guestCommunityGroupId = $groupLocalService.getGroup($getterUtil.getLong($companyId), "Guest").getGroupId() ) 
29 
30#set( $communityId = $getterUtil.getLong($request.get('theme-display').get('scope-group-id')) ) 
31 
32#set( $result = '' ) 
33#set( $result = $wcRetriever.getWebContent($guestCommunityGroupId, $companyGroupId, {"Divisions" : [$divisionId], "Product Lines" : ["Product Line", $productLineId]}, $null).get(0) ) 
34 
35#if( "$!result" != ""  ) 
36#productLineDynamicTemplate_getArticleXmlDocument($result) 
37 
38#set( $regionSelector = $portal.getClass().forName('com.sensus.velotools.RegionSelectorUtil')) 
39 
40#set ($sensusVelocityTemplateParser = $utilLocator.findUtil('com.sensus.velotools.SensusVelocityTemplateParser')) 
41#set( $articleTemplateNodes = $sensusVelocityTemplateParser.getNodes($articleXmlDocument.getRootElement()) ) 
42#foreach( $currentTemplateNode in $articleTemplateNodes ) 
43   #if( $currentTemplateNode.getName() == 'region' ) 
44      #set( $region =  $regionSelector.selectRegionCountry($region_name, $country_name, $currentTemplateNode.getSiblings()) ) 
45   #end 
46#end 
47 
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( productLineDynamicTemplate_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 

Documentation and Support Materials