1 26 27 package org.nextime.ion.frontoffice.objectSelector; 28 29 import java.util.Collection ; 30 import java.util.Hashtable ; 31 import java.util.Vector ; 32 33 import javax.servlet.http.HttpServletRequest ; 34 import javax.servlet.http.HttpServletResponse ; 35 36 import org.nextime.ion.framework.business.Section; 37 import org.nextime.ion.framework.mapping.Mapping; 38 import org.nextime.ion.framework.logger.Logger; 39 40 43 public class FindParentSection implements ObjectSelector { 44 45 public Collection selectObjects(Hashtable params, HttpServletRequest request, HttpServletResponse response) throws SelectException { 46 try { 47 Vector v = new Vector (); 48 int level = Integer.parseInt(params.get("level")+""); 49 Section s = Section.getInstance(params.get("section")+""); 50 if( level > s.getLevel() ) return v; 51 Section parent = s; 52 while( parent.getLevel() > level ) { 53 parent = parent.getParent(); 54 } 55 v.add(parent); 56 return v; 57 } catch (Exception e) { 58 Logger.getInstance().error("Erreur du SelectObject : "+e.getMessage(),this,e); 59 throw new SelectException(e.getMessage()); 60 } 61 } 62 63 } | Popular Tags |