portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r391539 - in /portals/jetspeed-2/trunk: applications/demo/src/webapp/WEB-INF/portlet.xml components/rewriter/src/java/org/apache/jetspeed/rewriter/Rewriter.java components/rewriter/src/java/org/apache/jetspeed/rewriter/WebContentRewriter.java
Date Wed, 05 Apr 2006 06:30:22 GMT
Author: taylor
Date: Tue Apr  4 23:30:20 2006
New Revision: 391539

URL: http://svn.apache.org/viewcvs?rev=391539&view=rev
Log:
authentication implemented: Form-based, URL (request params), and Basic
contribution from David Young

Modified:
    portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/portlet.xml
    portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/Rewriter.java
    portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/WebContentRewriter.java

Modified: portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/portlet.xml?rev=391539&r1=391538&r2=391539&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/portlet.xml Tue Apr  4 23:30:20
2006
@@ -77,7 +77,7 @@
         <value>http://portals.apache.org/jetspeed-2/</value>    
       </preference>                               		
       <preference>                            
-        <name>Bluesunrise Site</name>                    
+        <name>Bluesunrise Site</name>
         <value>http://www.bluesunrise.com/</value>    
       </preference>                               
       <preference>                            
@@ -574,7 +574,7 @@
         <portlet-preferences>
             <preference>
                 <name>SRC</name>
-				<value>http://www.apache.org</value>
+				<value>http://www.google.com</value>
             </preference>
         </portlet-preferences>
         <supported-locale>en</supported-locale>
@@ -604,11 +604,32 @@
             <portlet-mode>VIEW</portlet-mode>
          </supports>
         <portlet-preferences>
+            <!--  NY TIMES EXAMPLE, user ID is 'jetspeed_test0' and password is 'jetspeed'
-->
             <preference>
                 <name>SRC</name>
-				<value>http://www.apache.org</value>
+				<value>http://www.nytimes.com</value>
+            </preference>
+            <preference>
+                <name>sso.type</name>
+				<value>form</value>
+            </preference>
+            <preference>
+                <name>sso.form.Action</name>
+				<value>http://www.nytimes.com/auth/login</value>
+            </preference>
+            <preference>
+                <name>sso.form.Principal</name>
+				<value>USERID</value>
+            </preference>
+            <preference>
+                <name>sso.form.Credential</name>
+				<value>PASSWORD</value>
+            </preference>
+            <preference>
+                <name>sso.form.Args</name>
+				<value>Submit2=Log In;OP=;OQ=;is_continue=false</value>
             </preference>
-			</portlet-preferences>
+		</portlet-preferences>
         <supported-locale>en</supported-locale>
         <portlet-info>
             <title>WebContent Prototype Portlet</title>

Modified: portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/Rewriter.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/Rewriter.java?rev=391539&r1=391538&r2=391539&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/Rewriter.java
(original)
+++ portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/Rewriter.java
Tue Apr  4 23:30:20 2006
@@ -107,6 +107,14 @@
     String getBaseUrl();
     
     /**
+     * Gets a new URL relative to Base according to the site / and URL
+     * rewriting rules of java.net.URL
+     * 
+     * @return The new URL from path, relative to the base URL (or path, if path is absolute)
+     */
+    String getBaseRelativeUrl(String path);
+    
+    /**
      * Gets whether this rewriter require a proxy server.
      * 
      * @return true if it requires a proxy

Modified: portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/WebContentRewriter.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/WebContentRewriter.java?rev=391539&r1=391538&r2=391539&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/WebContentRewriter.java
(original)
+++ portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/WebContentRewriter.java
Tue Apr  4 23:30:20 2006
@@ -66,22 +66,15 @@
         // Any relative URL needs to be converted to a full URL
         if (url.startsWith("/") || (!url.startsWith("http:") && !url.startsWith("https:")))

         {
-            try
+            if (this.getBaseUrl() != null)
             {
-                if (this.getBaseUrl() != null)
-                {
-                    URL full = new URL(new URL(getBaseUrl()), url);
-                    modifiedURL = full.toString();
-  	            }
-	            else
-	            {
-	                modifiedURL = url; // leave as is
-	            }
-            }
-            catch (Exception e)
+                modifiedURL = getBaseRelativeUrl(url) ;
+                // System.out.println("WebContentRewriter.rewriteUrl() - translated URL relative
to base URL - result is: "+modifiedURL);
+  	        }
+            else
             {
-                modifiedURL = url;
-            }
+                modifiedURL = url; // leave as is
+	        }
         }
          
         // translate "submit" URL's as actions
@@ -107,7 +100,7 @@
         }
         
         // if ( !url.equalsIgnoreCase( modifiedURL ))
-        //      System.out.println("In tag: "+tag+", for attribute: "+attribute+", converted
url: "+url+", to: "+modifiedURL+", base URL was: "+getBaseUrl());
+        //     System.out.println("WebContentRewriter.rewriteUrl() - In tag: "+tag+", for
attribute: "+attribute+", converted url: "+url+", to: "+modifiedURL+", base URL was: "+getBaseUrl());
 
         return modifiedURL;
     }



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


Mime
View raw message