1 23 24 package org.infoglue.cms.controllers.kernel.impl.simple; 25 26 import java.util.ArrayList ; 27 import java.util.HashMap ; 28 import java.util.Iterator ; 29 import java.util.List ; 30 31 import org.infoglue.cms.entities.content.ContentVO; 32 import org.infoglue.cms.entities.content.ContentVersionVO; 33 import org.infoglue.cms.entities.kernel.BaseEntityVO; 34 import org.infoglue.cms.entities.structure.SiteNodeVO; 35 import org.infoglue.cms.security.InfoGluePrincipal; 36 37 public class PageTemplateController extends BaseController 38 { 39 40 43 44 public static PageTemplateController getController() 45 { 46 return new PageTemplateController(); 47 } 48 49 52 53 public List getPageTemplates(InfoGluePrincipal infoGluePrincipal, Integer languageId) throws Exception 54 { 55 List pageTemplates = getPageTemplates(infoGluePrincipal); 56 Iterator i = pageTemplates.iterator(); 57 while(i.hasNext()) 58 { 59 ContentVO contentVO = (ContentVO)i.next(); 60 ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentVO.getId(), languageId); 61 if(contentVersionVO == null) 62 { 63 i.remove(); 64 } 65 } 66 67 return pageTemplates; 68 } 69 70 73 74 public List getPageTemplates(InfoGluePrincipal infoGluePrincipal) throws Exception 75 { 76 HashMap arguments = new HashMap (); 77 arguments.put("method", "selectListOnContentTypeName"); 78 79 List argumentList = new ArrayList (); 80 HashMap argument = new HashMap (); 81 argument.put("contentTypeDefinitionName", "PageTemplate"); 82 argumentList.add(argument); 83 arguments.put("arguments", argumentList); 84 85 return ContentControllerProxy.getController().getACContentVOList(infoGluePrincipal, arguments); 86 } 88 89 90 91 92 93 97 98 public BaseEntityVO getNewVO() 99 { 100 return new SiteNodeVO(); 101 } 102 103 104 } 105 106 | Popular Tags |