View Javadoc
1   package uk.ac.ebi.intenz.webapp.controller;
2   
3   import java.io.UnsupportedEncodingException;
4   import java.net.URLDecoder;
5   
6   import javax.servlet.ServletException;
7   
8   import org.apache.struts.action.ActionServlet;
9   import org.apache.struts.action.PlugIn;
10  import org.apache.struts.config.ModuleConfig;
11  
12  import uk.ac.ebi.intenz.webapp.utilities.EntryLockSingleton;
13  import uk.ac.ebi.xchars.SpecialCharacters;
14  
15  /**
16   * This plugin initialises necessary resources for the IntEnz web application.
17   *
18   * @author Michael Darsow
19   * @version $Revision: 1.2 $ $Date: 2008/01/28 12:33:04 $
20   */
21  public class IntEnzPlugInAction implements PlugIn {
22  
23  //  private static final Logger LOGGER = Logger.getLogger(IntEnzPlugInAction.class);
24  
25    public void init(ActionServlet actionServlet, ModuleConfig moduleConfig) throws ServletException {
26  //    String path = IntEnzPlugInAction.class.getClassLoader().getResource("specialCharacters.xml").getPath();
27  //    try {
28  //      path = URLDecoder.decode(path, "ISO-8859-1");
29  //    } catch (UnsupportedEncodingException e) {                            
30  //      throw new ServletException("Error during initialisation.", e);
31  //    }
32  //    path = path.replaceFirst("specialCharacters.xml", "");
33  //    SpecialCharacters.class.getClassLoader().getResource("specialCharacters.dtd");
34  //    SpecialCharacters.class.getClassLoader().getResource("specialCharactersMapping.dtd");
35      actionServlet.getServletContext().setAttribute("specialCharactersInstance", SpecialCharacters.getInstance(null));
36  
37      // Create object for locking entries in process.
38      actionServlet.getServletContext().setAttribute("entryLock", EntryLockSingleton.getInstance());
39    }
40  
41    public void destroy(){}
42  
43  }