4 Replies Latest reply on Mar 13, 2009 1:29 AM by Jason Long

    Seam Excel w async problem

    Jason Long Novice

      I am trying to have a spreadsheet sent via quartz nightly.


      I have two problems.  I would like the seam excel template to be packaged in a jar, but I see no way to render a resource from the classpath.


      Is there a way to do


      Renderer.instance().render(viewId);



      but render this from the classpath instead of using a viewId?


      The only way I can get this to work async is to directly reference the SLSB that provides the List that I use to render the template.


      <e:worksheet value="#{costDAO.getSummaryList()}">



      This causes this method, which is expensive, to be called many when rendering the template.
      I tried a @Factory with EVENT and CONVERSATION scope that this could not be resolved.



      Do anyone have any suggestions?

        • 1. Re: Seam Excel w async problem
          Jason Long Novice

          After looking through the Seam source I see that it tries to load from the classpath if the resource cannot be located in via the ServletContext.


          So my first  question was not necessary.  I was just confused by the method signature of



          public String render(final String viewId) 



          in


          org.jboss.seam.ui.facelet.FaceletsRenderer



          I assumed that is would only work with a viewId from the ServletContext.



          I would still appreciate any advice on using a Factory or similar caching strategy to keep the value method from being called many times during rendering.




          • 2. Re: Seam Excel w async problem
            Stuart Douglas Master

            If you set up another method on the same bean to access this list annoted with @BypassInterceptors it should speed things up considerably

            • 3. Re: Seam Excel w async problem
              Jason Long Novice

              How will this help?


              The problem is not that interceptors are slowing this down.
              The problem is that my db query is executed many times because I cannot put this variable in an appropriate scope using a factory method or alternative.


              What contexts are available to an async quartz job?

              • 4. Re: Seam Excel w async problem
                Jason Long Novice

                Setting the value manually in the EVENT context solved the problem I was having.


                Contexts.getEventContext().set("costExportList", costDAO.getSummaryList());



                Is the factory method expected to work in this case because it does not for me?