1 7 package mc.formgenerator.servlets.bonita; 8 9 import hero.client.importLdap.SimpleCallbackHandler; 10 import hero.interfaces.UserSessionHome; 11 import hero.interfaces.UserSessionUtil; 12 import hero.util.HeroException; 13 import hero.util.StrutsProjectValue; 14 15 import java.rmi.RemoteException ; 16 import java.util.Collection ; 17 import java.util.Iterator ; 18 import java.util.Vector ; 19 20 import javax.ejb.CreateException ; 21 import javax.naming.NamingException ; 22 import javax.security.auth.login.LoginContext ; 23 import javax.security.auth.login.LoginException ; 24 25 import hero.interfaces.*; 26 27 32 public class ModeleAccueil { 33 34 35 38 private Collection modelProjectList; 39 40 41 44 public ModeleAccueil() { 45 } 46 47 48 49 50 59 public Collection getAllModelProjects() throws LoginException , NamingException , CreateException , RemoteException , HeroException { 60 61 boolean isAnInstance; 62 63 Vector listeResultat = new Vector (); 64 hero.interfaces.AllProjectsSessionLocalHome projecth = (AllProjectsSessionLocalHome)hero.interfaces.AllProjectsSessionUtil.getLocalHome(); 65 hero.interfaces.AllProjectsSessionLocal allProject = projecth.create(); 66 67 Collection listeProjets = allProject.getProjects(); 69 70 Iterator it = listeProjets.iterator(); 72 while (it.hasNext()) { 73 StrutsProjectValue struts = (StrutsProjectValue)it.next(); 75 String name = struts.getName(); 76 77 isAnInstance = name.matches(".*_instance.*"); 79 if (!isAnInstance) { 80 listeResultat.addElement(name); 81 } 82 } 83 84 return listeResultat; 85 } 86 87 88 89 90 98 public void process() throws LoginException , RemoteException , NamingException , CreateException , HeroException { 99 100 Collection list = this.getAllModelProjects(); 101 102 this.setModelProjectList(list); 103 } 104 105 106 107 108 112 public void setModelProjectList(Collection col) { 113 114 this.modelProjectList = col; 115 } 116 117 118 119 120 124 public Collection getModelProjectList() { 125 126 return this.modelProjectList; 127 } 128 129 130 } 131 | Popular Tags |