portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Balaji Chandrasekaran" <cbal...@virtusa.com>
Subject Portlet preferences problem
Date Wed, 27 Jul 2005 05:43:10 GMT

Hi all,



I have got 5 portlets in my application that shares the same class.
Whenever I go to edit mode and return back to view mode I am getting
this warning message.



[org.apache.ojb.broker.core.PersistenceBrokerImpl] WARN: No running tx
found, please only store in context of an PB-transaction, to avoid
side-effects - e.g. when rollback of complex objects



And after some time the application is hanging.



Below is my class file.



Please reply ASAP. It is very urgent.









  package com.vericept.dashboard.portlets;



  import java.io.IOException;



  import javax.portlet.ActionRequest;

  import javax.portlet.ActionResponse;

  import javax.portlet.PortletContext;

  import javax.portlet.PortletException;

  import javax.portlet.PortletMode;

  import javax.portlet.PortletPreferences;

  import javax.portlet.PortletRequestDispatcher;

  import javax.portlet.RenderRequest;

  import javax.portlet.RenderResponse;



  import com.vericept.dashboard.business.ChartManager;

  import com.vericept.dashboard.business.IChartManager;

  import com.vericept.dashboard.dto.PortletDTO;



  public class DashboardPortlet extends VericeptBasePortlet {

    /** The name of a portlet.  */

    String portletName = "";



    /**The default view for a portlet.  */

    String viewtype = "";



    /**

     * Creates a new DashboardPortlet object.

     */

    public DashboardPortlet(  ) {

    }



    /**

     * The portlet is initialized with initial configuration.

     *

     * @param config PortletConfig

     *

     * @throws PortletException when initialization does not occur.

     */

    public void init(  ) throws PortletException {

      portletName = getPortletConfig(  ).getPortletName(  );

    }



    /**

     * Handles all the portlet edit requests.

     *

     * @param request RenderRequest

     * @param response RenderResponse

     *

     * @throws PortletException when there is error in edit mode.

     * @throws IOException when there is error in input/output.

     */

    public void doEdit( RenderRequest request, RenderResponse response )

                  throws PortletException, IOException {

      PortletPreferences pref = request.getPreferences(  );



      request.setAttribute( "viewtype", pref.getValue( "viewtype",
"viewtype" ) );



      request.setAttribute( "Fieldcount",

                              pref.getValue( "fieldcount", "fieldcount"
) );



      PortletContext context = getPortletContext(  );

      PortletRequestDispatcher rd = context.getRequestDispatcher(
"/jsp/PortletEdit.jsp" );



      rd.include( request, response );

    }



    /**

     * Handles all the portlet help requests.

     *

     * @param request RenderRequest

     * @param response RenderResponse

     *

     * @throws PortletException when there is error in help mode.

     * @throws IOException when there is error in input/output.

     */

    public void doHelp( RenderRequest request, RenderResponse response )

                  throws PortletException, IOException {

      PortletContext context = getPortletContext(  );

      PortletRequestDispatcher rd = context.getRequestDispatcher(
"/jsp/PortletHelp.jsp" );



      rd.include( request, response );

    }



    /**

     * Handles all the portlet view requests.

     *

     * @param request RenderRequest

     * @param response RenderResponse

     *

     * @throws PortletException when there is error in view mode.

     * @throws IOException when there is error in input/output.

     */

    public void doView( RenderRequest request, RenderResponse response )

                  throws PortletException, IOException {

           

   

      response.setContentType( "text/html" );



      PortletContext context = getPortletContext(  );

      PortletPreferences pref = request.getPreferences(  );

      PortletDTO portletDTO = new PortletDTO(  );



      portletDTO.setPortletName( portletName );

      portletDTO.setViewType( pref.getValue( "viewtype", "viewtype" ) );

      portletDTO.setCount( 10 );

      portletDTO.setContextPath( context.getRealPath( "/jrxml/" ) );

      portletDTO.setResponseObject( response.getWriter(  ) );



      IChartManager chartmanager = new ChartManager(  );



      chartmanager.generatePortletReport( portletDTO );

    }



    /**

     * Handles all the portlet event requests.

     *

     * @param request ActionRequest

     * @param response ActionResponse

     *

     * @throws PortletException when there is error in event handling.

     * @throws IOException when there is error in input/output.

     */

    public void processAction( ActionRequest request, ActionResponse
response )

                         throws PortletException, IOException {

      PortletPreferences pref = request.getPreferences(  );

      try

      {

            pref.setValue( "fieldcount", request.getParameter(
"fieldcount" ) );

   

            if( request.getParameter( "viewtype" ) != null ) {

                        viewtype = request.getParameter( "viewtype" );

                        pref.setValue( "viewtype", viewtype );

            }



            pref.store(  );

      }

      catch(Exception e)

      {

            System.out.println(e);

      }

      response.setPortletMode( PortletMode.VIEW );

    }

  }







Regards,

Balaji Chandrasekaran

















---------------------------------------------------------------------------------------------
This message, including any attachments, contains confidential information intended for a
specific individual and purpose, and is intended for the addressee only. Any unauthorized
disclosure, use, dissemination, copying, or distribution of this message or any of its attachments
or the information contained in this e-mail, or the taking of any action based on it, is strictly
prohibited. If you are not the intended recipient, please notify the sender immediately by
return e-mail and delete this message.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message