cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/components Handler.java
Date Wed, 21 Aug 2002 13:36:11 GMT
cziegeler    2002/08/21 06:36:11

  Modified:    src/java/org/apache/cocoon/webapps/session/connector
                        Resource.java
               src/java/org/apache/cocoon/webapps/authentication/components
                        Handler.java
  Log:
  Fixing handling of cocoon: protocol for authentication and portal
  
  Revision  Changes    Path
  1.7       +4 -9      xml-cocoon2/src/java/org/apache/cocoon/webapps/session/connector/Resource.java
  
  Index: Resource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/webapps/session/connector/Resource.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Resource.java	12 Jul 2002 11:25:58 -0000	1.6
  +++ Resource.java	21 Aug 2002 13:36:11 -0000	1.7
  @@ -86,17 +86,12 @@
                       String identifier)
       throws ProcessingException, SAXException, IOException {
           // check for relative cocoon:/ protocol
  -        if (identifier.startsWith("cocoon:/")
  -            && identifier.charAt("cocoon:/".length()) != '/') {
  -
  -            // FIXME (CZ)
  -            throw new ProcessingException("Relative cocoon: URIs currently not supported.");
  +        if (identifier.startsWith("cocoon:") ) {
  +            this.resourceType = ResourceConnector.RESOURCE_TYPE_URI;
  +            this.resourceIdentifier = identifier;
           } else if ( identifier.startsWith("class://") ) {
               this.resourceType = ResourceConnector.RESOURCE_TYPE_CLASS;
               this.resourceIdentifier = identifier.substring("class://".length());
  -        } else if ( identifier.startsWith("cocoon:") ) {
  -            this.resourceType = ResourceConnector.RESOURCE_TYPE_URI;
  -            this.resourceIdentifier = identifier;
           } else {
               // resolve it first
               Source source = null;
  
  
  
  1.7       +11 -6     xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/components/Handler.java
  
  Index: Handler.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/components/Handler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Handler.java	12 Jul 2002 11:25:58 -0000	1.6
  +++ Handler.java	21 Aug 2002 13:36:11 -0000	1.7
  @@ -165,11 +165,16 @@
           if (child == null)
               throw new ConfigurationException("Handler '"+this.name+"' needs a redirect-to
URI.");
           this.redirectURI = child.getAttribute("uri");
  -        if ( this.redirectURI.startsWith("cocoon://") ) {
  -            this.redirectURI = this.redirectURI.substring("cocoon://".length()).trim();
  -            this.redirectURI = request.getContextPath()+"/"+this.redirectURI;
  -        } else if ( this.redirectURI.startsWith("cocoon:/") ) {
  -            this.redirectURI = this.redirectURI.substring("cocoon:/".length()).trim();
  +        if ( this.redirectURI.startsWith("cocoon:") ) {
  +            final int pos = this.redirectURI.indexOf('/');
  +            if ( pos != -1 && this.redirectURI.length() > pos) {
  +                if (this.redirectURI.charAt(pos+1) == '/') {
  +                    this.redirectURI = this.redirectURI.substring(pos+2).trim();
  +                    this.redirectURI = request.getContextPath()+"/"+this.redirectURI;
  +                } else {
  +                    this.redirectURI = this.redirectURI.substring(pos+1).trim();
  +                }
  +            }
           }
   
           this.redirectParameters = SourceParameters.create(child);
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message