GhInfrastructure.java 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. package hello;
  2. import com.techempower.gemini.*;
  3. import com.techempower.gemini.jsp.*;
  4. import com.techempower.util.*;
  5. /**
  6. * Provides a GeminiHello-specific Web Site Infrastructure.
  7. *
  8. * @see com.techempower.gemini.BasicInfrastructure
  9. * @see com.techempower.gemini.Infrastructure
  10. *
  11. * Development history:
  12. * 2012-04-19 - mh - Created
  13. *
  14. * @author mhixson
  15. */
  16. public class GhInfrastructure
  17. extends BasicInfrastructure
  18. {
  19. //
  20. // Member variables.
  21. //
  22. private boolean scheduledEvents = false;
  23. //
  24. // Member methods.
  25. //
  26. /**
  27. * Constructor. This GhInfrastructure creates a Scheduler
  28. * for running Events.
  29. */
  30. public GhInfrastructure(GeminiApplication application)
  31. {
  32. super(application);
  33. // Construct instances of application-specific Event subclasses.
  34. }
  35. // @see com.techempower.gemini.BasicInfrastructure#configureSas(com.techempower.gemini.jsp.ScriptsAndSheets)
  36. @Override
  37. protected void configureSas(ScriptsAndSheets applicationSas)
  38. {
  39. // Specify application-scope JavaScript and CSS dependencies. These
  40. // scripts and sheets are to be included on -all- pages rendered by
  41. // the application. Note that the configuration set up below by the
  42. // application template assumes that no unification and minification
  43. // are happening within the Test and Production environments.
  44. // TODO: If CSS and JS are being concatenated and/or minified for
  45. // test and production, modify the following accordingly.
  46. applicationSas.addSheet("gh.css");
  47. applicationSas.addScript("jquery.js");
  48. applicationSas.addScript("gh.js");
  49. applicationSas.addScript("gh.forms.js");
  50. // TODO: Change this to be an application-specific icon.
  51. applicationSas.setFavicon("alert.gif");
  52. }
  53. /**
  54. * Configure this component. (Called by BasicInfrastructure.configure.)
  55. */
  56. @Override
  57. public void customConfigure(EnhancedProperties props)
  58. {
  59. // Does nothing.
  60. }
  61. /**
  62. * Called by BasicInfrastructure's begin() method. BasicInfrastructure.
  63. * ensures that this method will only be called if the Infrastructure is
  64. * not already started.
  65. */
  66. @Override
  67. public void start()
  68. {
  69. // Add the standard events if they haven't already been added.
  70. if (!this.scheduledEvents)
  71. {
  72. /*
  73. // Example:
  74. eventMonthlyEmail = new EmployeeStatusEvent(application);
  75. scheduler.scheduleEvent(eventMonthlyEmail);
  76. */
  77. this.scheduledEvents = true;
  78. }
  79. }
  80. /**
  81. * Called by BasicInfrastructure's end() method. BasicInf. ensures
  82. * that this method will only be called if the Infrastructure is not
  83. * already shut down.
  84. */
  85. @Override
  86. public void shutdown()
  87. {
  88. // Do anything you need to at application shut-down time.
  89. }
  90. } // End GhInfrastructure.