You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ra...@apache.org on 2005/04/12 23:46:48 UTC

cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/url/impl FusionPathInfoEncodingPortalURL.java

raphael     2005/04/12 14:46:48

  Added:       portal/src/java/org/apache/jetspeed/container/url/impl
                        FusionPathInfoEncodingPortalURL.java
  Log:
  New NavigationState behaving like PathEncodingPortletURL but compatible
  with Turbine path info parameter parsing rule.
  
  Can be used in Jetspeed 2 stand-alone but required for proper Fusion
  behavior in Jetspeed 1.
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/url/impl/FusionPathInfoEncodingPortalURL.java
  
  Index: FusionPathInfoEncodingPortalURL.java
  ===================================================================
  /*
   * Copyright 2000-2001,2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.container.url.impl;
  
  import java.util.StringTokenizer;
  
  import javax.servlet.http.HttpServletRequest;
  
  import org.apache.jetspeed.container.state.NavigationalState;
  
  /**
   * Special version of PathInfoEncodingPortalURL that plays nice with Turbine
   * path-info management and thus can be safely used with FUsion for encapsulation
   * within Jetspeed 1
   * *
   * @version $Id: FusionPathInfoEncodingPortalURL.java,v 1.1 2005/04/12 21:46:48 raphael Exp $
   */
  public class FusionPathInfoEncodingPortalURL extends PathInfoEncodingPortalURL
  {
      public FusionPathInfoEncodingPortalURL(HttpServletRequest request, String characterEncoding, NavigationalState navState)
      {
          super(request, characterEncoding, navState);
      }
      
      protected void decodePathAndNavigationalState(HttpServletRequest request)
      {
          String path = null;
          String encodedNavState = null;
  
          String pathInfo = request.getPathInfo();
          if (pathInfo != null)
          {
              StringTokenizer tokenizer = new StringTokenizer(request.getPathInfo(),"/");
              StringBuffer buffer = new StringBuffer();
              String token;
              boolean foundNavState = false;
              String navStatePrefix = getNavigationalStateParameterName() +":";
              while (tokenizer.hasMoreTokens())
              {
                  token = tokenizer.nextToken();
                  if (!foundNavState && token.startsWith(navStatePrefix))
                  {
                      foundNavState = true;
                      if ( token.length() > navStatePrefix.length() )
                      {
                          encodedNavState = token.substring(navStatePrefix.length());
                      }
                  }
                  else
                  {
                      if (!foundNavState && token.equals(getNavigationalStateParameterName()))
  					{
  							// Remove any path component that exactly matchs the navigation
  							// state name and is found before the state token. This is assumed
  							// to be the Turbine compatible varaible name for Fusion.
  					}
                      else
  					{
  						buffer.append("/");
  						buffer.append(token);
  					}
                  }
              }
              if ( buffer.length() > 0 )
              {
                  path = buffer.toString();
              }
              else
              {
                  path = "/";
              }
          }
          setPath(path);
          setEncodedNavigationalState(encodedNavState);
      }
  
      protected String createPortletURL(String encodedNavState, boolean secure)
      {
          StringBuffer buffer = new StringBuffer(getBaseURL(secure));
          buffer.append(getBasePath());
          if ( encodedNavState != null )
          {
  			// Duplication of parameter name to be compatible with Turbine 
  			// handling of path info
  			buffer.append("/");
              buffer.append(getNavigationalStateParameterName());
              buffer.append("/");
              buffer.append(getNavigationalStateParameterName());
              buffer.append(":");
              buffer.append(encodedNavState);
          }
          if ( getPath() != null )
          {
              buffer.append(getPath());
          }
          return buffer.toString();
      }  }
  
  
  

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


Execption while Starting JetSpeed-2

Posted by Rajesh Jain <rj...@yahoo.com>.
I built against M3-dev and there seems to be a
mismatch in the column names in the Client Table when
I start jetspeed. The database column name is
Eval_Order

regards
Rajesh

----------------------------------------

org.apache.jasper.JasperException: Bad SQL grammar []
in task 'OJB operation'; nested exception is
java.sql.SQLException: Column not found: EVALORDER in
statement [SELECT
A0.VERSION,A0.MODEL,A0.PREFERRED_MIMETYPE_ID,A0.MANUFACTURER,A0.NAME,A0.USER_AGENT_PATTERN,A0.CLIENT_ID,evalOrder
as ojb_col_8 FROM CLIENT A0 ORDER BY 8]

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

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