You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Balaji Chandrasekaran <cb...@virtusa.com> on 2005/07/27 07:43:10 UTC

Portlet preferences problem

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.

RE: Portlet preferences problem

Posted by David Pankros <dp...@miragy.com>.
> [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

I get the same error, but I haven't looked into how to fix it yet.


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.5/58 - Release Date: 7/25/2005
 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org