1 40 41 package org.jahia.services.containers; 42 43 import org.jahia.data.containers.*; 44 import org.jahia.exceptions.JahiaException; 45 import org.jahia.params.ParamBean; 46 import org.jahia.services.version.EntryLoadRequest; 47 48 import java.util.Hashtable ; 49 50 51 56 57 public class ContainerListFactoryProxy { 58 59 private static org.apache.log4j.Logger logger = 60 org.apache.log4j.Logger.getLogger (ContainerListFactoryProxy.class); 61 62 private int loadFlag; 63 private ParamBean jParams; 64 private EntryLoadRequest loadRequest; 65 private Hashtable cachedFieldsFromContainers; 66 private Hashtable cachedContainersFromContainerLists; 67 private Hashtable cachedContainerListsFromContainers; 68 69 79 public ContainerListFactoryProxy (int loadFlag, 80 ParamBean jParams, 81 EntryLoadRequest loadRequest, 82 Hashtable cachedFieldsFromContainers, 83 Hashtable cachedContainersFromContainerLists, 84 Hashtable cachedContainerListsFromContainers) 85 { 86 this.loadFlag = loadFlag; 87 this.jParams = jParams; 88 this.loadRequest = loadRequest; 89 this.cachedFieldsFromContainers = cachedFieldsFromContainers; 90 if ( this.cachedFieldsFromContainers == null ){ 91 this.cachedFieldsFromContainers = new Hashtable (); 92 } 93 this.cachedContainersFromContainerLists = cachedContainersFromContainerLists; 94 if ( this.cachedContainersFromContainerLists == null ){ 95 this.cachedContainersFromContainerLists = new Hashtable (); 96 } 97 this.cachedContainerListsFromContainers = cachedContainerListsFromContainers; 98 if ( this.cachedContainerListsFromContainers == null ){ 99 this.cachedContainerListsFromContainers = new Hashtable (); 100 } 101 } 102 103 107 public void load(JahiaContainerList containerList){ 108 if ( containerList == null || containerList.isContainersLoaded() ){ 109 return; 110 } 111 try { 112 ContainerFactory.getInstance() 113 .fullyLoadContainerList(containerList, 114 loadFlag, jParams, loadRequest, cachedFieldsFromContainers, 115 this.cachedContainersFromContainerLists, 116 this.cachedContainerListsFromContainers); 117 containerList.setIsContainersLoaded(true); 118 } catch ( JahiaException je){ 119 logger.debug("Exception occured when loading Container List [" 120 + containerList.getID() + "]", je); 121 } 122 } 123 } 124 | Popular Tags |