portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r770498 - in /portals/jetspeed-2/applications/j2-admin/trunk/src: main/java/org/apache/jetspeed/portlets/security/choosers/ main/java/org/apache/jetspeed/portlets/security/resources/ main/java/org/apache/jetspeed/portlets/security/sso/ main...
Date Fri, 01 May 2009 00:25:03 GMT
Author: taylor
Date: Fri May  1 00:25:02 2009
New Revision: 770498

URL: http://svn.apache.org/viewvc?rev=770498&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-621
https://issues.apache.org/jira/browse/JS2-671

SSO IFrame and Web Content portlets were broken
SSO Admin portlets were broken as well
Had to bring back the choosers since they are used by the SSO portlets. Im not going to rewrite these in Wicket at this time

With this commits, all SSO (iframe, web content, sso browser, sso details) portlets are now functional. However I am seeing problems when adding the same remote user for two different users on the same site
This seems to blow up and cause some problems Im currently looking into.

Added:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/GroupChooserPortlet.java   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/RoleChooserPortlet.java   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/UserChooserPortlet.java   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/default-rewriter-rules.xml   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/rewriter-rules-mapping.xml   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/group-chooser.vm   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/role-chooser.vm   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/user-chooser.vm   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/edit-sso-proxy.vm   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/iframe-help.html   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-demo.html   (contents, props changed)
      - copied, changed from r770333, portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/_content/sso-demo.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-edit-prefs.vm   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-webcontent-help.vm   (with props)
Removed:
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/_content/sso-demo.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/edit-prefs.vm
Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/resources/SSOResources.properties
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/resources/SSOResources_en.properties
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/sso/SSOBrowser.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/sso/SSODetails.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOIFramePortlet.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOPortletUtil.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOWebContentPortlet.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/velocity/velocity-macros.vm

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/GroupChooserPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/GroupChooserPortlet.java?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/GroupChooserPortlet.java (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/GroupChooserPortlet.java Fri May  1 00:25:02 2009
@@ -0,0 +1,81 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.portlets.security.choosers;
+
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.security.GroupManager;
+import org.apache.portals.applications.gems.browser.BrowserIterator;
+import org.apache.portals.applications.gems.browser.BrowserPortlet;
+import org.apache.portals.applications.gems.browser.DatabaseBrowserIterator;
+
+/**
+ * GroupChooserPortlet
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class GroupChooserPortlet extends BrowserPortlet
+{
+    private GroupManager groupManager;
+    
+    public void init(PortletConfig config)
+    throws PortletException 
+    {
+        super.init(config);
+        groupManager = (GroupManager) 
+            getPortletContext().getAttribute(CommonPortletServices.CPS_GROUP_MANAGER_COMPONENT);
+        if (null == groupManager)
+        {
+            throw new PortletException("Failed to find the User Manager on portlet initialization");
+        }
+    }
+           
+    public void getRows(RenderRequest request, String sql, int windowSize)
+    throws Exception
+    {
+        List resultSetTitleList = new ArrayList();
+        List resultSetTypeList = new ArrayList();
+        try
+        {
+            resultSetTypeList.add(String.valueOf(Types.VARCHAR));
+            resultSetTitleList.add("Group");            
+            
+            List<String> list = groupManager.getGroupNames("");
+            
+            BrowserIterator iterator = new DatabaseBrowserIterator(
+                    list, resultSetTitleList, resultSetTypeList,
+                    windowSize);
+            setBrowserIterator(request, iterator);
+            iterator.sort("Group");
+        }
+        catch (Exception e)
+        {
+            //log.error("Exception in CMSBrowserAction.getRows: ", e);
+            e.printStackTrace();
+            throw e;
+        }        
+    }
+       
+}

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/GroupChooserPortlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/GroupChooserPortlet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/RoleChooserPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/RoleChooserPortlet.java?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/RoleChooserPortlet.java (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/RoleChooserPortlet.java Fri May  1 00:25:02 2009
@@ -0,0 +1,81 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.portlets.security.choosers;
+
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.security.RoleManager;
+import org.apache.portals.applications.gems.browser.BrowserIterator;
+import org.apache.portals.applications.gems.browser.BrowserPortlet;
+import org.apache.portals.applications.gems.browser.DatabaseBrowserIterator;
+
+/**
+ * RoleChooserPortlet
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class RoleChooserPortlet extends BrowserPortlet
+{
+    private RoleManager roleManager;
+    
+    public void init(PortletConfig config)
+    throws PortletException 
+    {
+        super.init(config);
+        roleManager = (RoleManager) 
+            getPortletContext().getAttribute(CommonPortletServices.CPS_GROUP_MANAGER_COMPONENT);
+        if (null == roleManager)
+        {
+            throw new PortletException("Failed to find the User Manager on portlet initialization");
+        }
+    }
+           
+    public void getRows(RenderRequest request, String sql, int windowSize)
+    throws Exception
+    {
+        List resultSetTitleList = new ArrayList();
+        List resultSetTypeList = new ArrayList();
+        try
+        {
+            resultSetTypeList.add(String.valueOf(Types.VARCHAR));
+            resultSetTitleList.add("Role");
+
+            List<String> list = roleManager.getRoleNames("");
+            
+            BrowserIterator iterator = new DatabaseBrowserIterator(
+                    list, resultSetTitleList, resultSetTypeList,
+                    windowSize);
+            setBrowserIterator(request, iterator);
+            iterator.sort("Role");
+        }
+        catch (Exception e)
+        {
+            //log.error("Exception in CMSBrowserAction.getRows: ", e);
+            e.printStackTrace();
+            throw e;
+        }        
+    }
+       
+}

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/RoleChooserPortlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/RoleChooserPortlet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/UserChooserPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/UserChooserPortlet.java?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/UserChooserPortlet.java (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/UserChooserPortlet.java Fri May  1 00:25:02 2009
@@ -0,0 +1,77 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.portlets.security.choosers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.portlets.security.SecurityUtil;
+import org.apache.jetspeed.security.UserManager;
+import org.apache.portals.applications.gems.browser.BrowserIterator;
+import org.apache.portals.applications.gems.browser.DatabaseBrowserIterator;
+
+/**
+ * SSOBrowser
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class UserChooserPortlet extends SecurityUtil
+{
+    private UserManager userManager;
+    
+    public void init(PortletConfig config)
+    throws PortletException 
+    {
+        super.init(config);
+        userManager = (UserManager) 
+            getPortletContext().getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT);
+        if (null == userManager)
+        {
+            throw new PortletException("Failed to find the User Manager on portlet initialization");
+        }
+    }
+           
+    public void getRows(RenderRequest request, String sql, int windowSize)
+    throws Exception
+    {
+        List resultSetTitleList = new ArrayList();
+        List resultSetTypeList = new ArrayList();
+        try
+        {
+            List list = userManager.getUserNames("");
+            
+            BrowserIterator iterator = new DatabaseBrowserIterator(
+                    list, resultSetTitleList, resultSetTypeList,
+                    windowSize);
+            setBrowserIterator(request, iterator);
+            iterator.sort("User");
+        }
+        catch (Exception e)
+        {
+            //log.error("Exception in CMSBrowserAction.getRows: ", e);
+            e.printStackTrace();
+            throw e;
+        }        
+    }
+       
+}

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/UserChooserPortlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/choosers/UserChooserPortlet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/resources/SSOResources.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/resources/SSOResources.properties?rev=770498&r1=770497&r2=770498&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/resources/SSOResources.properties (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/resources/SSOResources.properties Fri May  1 00:25:02 2009
@@ -33,6 +33,6 @@
 confirmtodeletesite=Confirm to Delete Site:
 confirmdelete=Confirm Delete
 realm=Site Realm:
-form_authentication_info=Form fields used for From based Authentication. If the fields are empty Challenge/Response Authentication will be used.
+form_authentication_info=Form fields used for Form based Authentication. If the fields are empty Challenge/Response Authentication will be used.
 form_field_id=Field name for User ID:
 form_field_PWD=Field name For Password value:

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/resources/SSOResources_en.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/resources/SSOResources_en.properties?rev=770498&r1=770497&r2=770498&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/resources/SSOResources_en.properties (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/resources/SSOResources_en.properties Fri May  1 00:25:02 2009
@@ -33,6 +33,6 @@
 confirmtodeletesite=Confirm to Delete Site:
 confirmdelete=Confirm Delete
 realm=Site Realm:
-form_authentication_info=Form fields used for From based Authentication. If the fields are empty Challenge/Response Authentication will be used.
+form_authentication_info=Form fields used for Form based Authentication. If the fields are empty Challenge/Response Authentication will be used.
 form_field_id=Field name for User ID:
 form_field_PWD=Field name For Password value:

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/sso/SSOBrowser.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/sso/SSOBrowser.java?rev=770498&r1=770497&r2=770498&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/sso/SSOBrowser.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/sso/SSOBrowser.java Fri May  1 00:25:02 2009
@@ -40,7 +40,7 @@
 import org.apache.portals.applications.gems.browser.BrowserIterator;
 import org.apache.portals.applications.gems.browser.BrowserPortlet;
 import org.apache.portals.applications.gems.browser.DatabaseBrowserIterator;
-import org.apache.portals.gems.util.StatusMessage;
+import org.apache.portals.applications.gems.browser.StatusMessage;
 import org.apache.portals.messaging.PortletMessaging;
 import org.apache.velocity.context.Context;
 
@@ -225,7 +225,8 @@
                             site = sso.getSiteByName(siteName);
                         } 
                         boolean isNewSite = false;
-                        if (site == null){
+                        if (site == null)
+                        {
                         	isNewSite = true;
                         	site = sso.newSite(siteName, siteUrl);
                         }
@@ -238,9 +239,11 @@
                     	site.setFormAuthentication(StringUtils.isNotEmpty(siteFormID) && StringUtils.isNotEmpty(siteFormPWD));
                     	site.setChallengeResponseAuthentication(!site.isFormAuthentication());
                     	
-                    	if (isNewSite){
+                    	if (isNewSite)
+                    	{
                     		sso.addSite(site);
-                    	} else {
+                    	} else 
+                    	{
                     		sso.updateSite(site);
                     	}
                     	this.clearBrowserIterator(request);

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/sso/SSODetails.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/sso/SSODetails.java?rev=770498&r1=770497&r2=770498&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/sso/SSODetails.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/sso/SSODetails.java Fri May  1 00:25:02 2009
@@ -47,7 +47,7 @@
 import org.apache.portals.applications.gems.browser.BrowserIterator;
 import org.apache.portals.applications.gems.browser.BrowserPortlet;
 import org.apache.portals.applications.gems.browser.DatabaseBrowserIterator;
-import org.apache.portals.gems.util.StatusMessage;
+import org.apache.portals.applications.gems.browser.StatusMessage;
 import org.apache.portals.messaging.PortletMessaging;
 import org.apache.velocity.context.Context;
 
@@ -140,6 +140,20 @@
         if (selectedSite != null)
         {        
             context.put("currentSite", selectedSite);
+            String title = this.getTitle(request);
+            if (title != null)
+            {
+                int pos = title.indexOf("-");
+                if (pos > 1)
+                {
+                    title = title.substring(0, pos) + "- " + selectedSite;
+                }
+                else
+                    title = title + " - "  + selectedSite;
+            }
+            else
+                title = selectedSite;
+            response.setTitle(title);
         }        
         
         // get relative link, TOremoveCredentialsForSiteDO: encapsulate Jetspeed links access into component
@@ -252,7 +266,8 @@
                         
                         if (site != null && localPrincipal != null )
                         {
-                        	if (sso.getRemoteUsers(site, localPrincipal).size() > 0){
+                        	if (sso.getRemoteUsers(site, localPrincipal).size() > 0)
+                        	{
                                 try
                                 {
                                     // TODO: fixme, bug in Pluto on portlet session

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOIFramePortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOIFramePortlet.java?rev=770498&r1=770497&r2=770498&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOIFramePortlet.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOIFramePortlet.java Fri May  1 00:25:02 2009
@@ -49,19 +49,17 @@
     public static final String SSO_TYPE_URL_BASE64 = "url.base64";
     public static final String SSO_TYPE_HTTP = "http";
     public static final String SSO_TYPE_CERTIFICATE = "certificate";
-    
     public static final String SSO_TYPE_URL_USERNAME = "sso.url.Principal";
     public static final String SSO_TYPE_URL_PASSWORD = "sso.url.Credential";
-    
     public static final String SSO_REQUEST_ATTRIBUTE_USERNAME = "sso.ra.username";
     public static final String SSO_REQUEST_ATTRIBUTE_PASSWORD = "sso.ra.password";
 
     /*
-     * The constants must be used in your HTML form for the SSO principal and credential
+     * The constants must be used in your HTML form for the SSO principal and
+     * credential
      */
     public static final String SSO_FORM_PRINCIPAL = "ssoPrincipal";
     public static final String SSO_FORM_CREDENTIAL = "ssoCredential";
-    
     private PortletContext context;
     private SSOManager sso;
 
@@ -69,28 +67,27 @@
     {
         super.init(config);
         context = getPortletContext();
-        sso = (SSOManager)context.getAttribute("cps:SSO");
-        if (null == sso)
-        {
-           throw new PortletException("Failed to find SSO Provider on portlet initialization");
-        }        
+        sso = (SSOManager) context.getAttribute("cps:SSO");
+        if (null == sso) { throw new PortletException("Failed to find SSO Provider on portlet initialization"); }
     }
 
-    public void doEdit(RenderRequest request, RenderResponse response)
-    throws PortletException, IOException
+    public void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException
     {
         String siteUrl = request.getPreferences().getValue("SRC", "");
-        
         SSOSite site = sso.getSiteByUrl(siteUrl);
-        if (site != null){
+        if (site != null)
+        {
             try
             {
-                SSOUser remoteUser = SSOPortletUtil.getRemoteUser(sso,request,site);
-                if (remoteUser != null){
+                SSOUser remoteUser = SSOPortletUtil.getRemoteUser(sso, request, site);
+                if (remoteUser != null)
+                {
                     PasswordCredential pwc = sso.getCredentials(remoteUser);
                     getContext(request).put(SSO_FORM_PRINCIPAL, pwc.getUserName());
                     getContext(request).put(SSO_FORM_CREDENTIAL, pwc.getPassword());
-                } else {
+                }
+                else
+                {
                     getContext(request).put(SSO_FORM_PRINCIPAL, "");
                     getContext(request).put(SSO_FORM_CREDENTIAL, "");
                 }
@@ -108,19 +105,17 @@
                 {
                     throw new PortletException(e);
                 }
-            }       
+            }
         }
-         
-        
         super.doEdit(request, response);
     }
-        
-    public void doView(RenderRequest request, RenderResponse response)
-    throws PortletException, IOException
+
+    public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
     {
         String siteUrl = request.getPreferences().getValue("SRC", null);
         SSOSite site = null;
-        if (siteUrl != null){
+        if (siteUrl != null)
+        {
             site = sso.getSiteByUrl(siteUrl);
         }
         if (site == null)
@@ -132,15 +127,18 @@
             super.doView(request, response);
             return;
         }
-        
+
         try
         {
-            SSOUser remoteUser = SSOPortletUtil.getRemoteUser(sso,request,site);
-            if (remoteUser != null){
+            SSOUser remoteUser = SSOPortletUtil.getRemoteUser(sso, request, site);
+            if (remoteUser != null)
+            {
                 PasswordCredential pwc = sso.getCredentials(remoteUser);
                 request.setAttribute(SSO_REQUEST_ATTRIBUTE_USERNAME, pwc.getUserName());
                 request.setAttribute(SSO_REQUEST_ATTRIBUTE_PASSWORD, pwc.getPassword());
-            } else {
+            }
+            else
+            {
                 request.setAttribute(PARAM_VIEW_PAGE, this.getPortletConfig().getInitParameter(PARAM_EDIT_PAGE));
                 setupPreferencesEdit(request, response);
             }
@@ -152,49 +150,52 @@
                 // no credentials configured in SSO store
                 // switch to SSO Configure View
                 request.setAttribute(PARAM_VIEW_PAGE, this.getPortletConfig().getInitParameter(PARAM_EDIT_PAGE));
-                setupPreferencesEdit(request, response);                
+                setupPreferencesEdit(request, response);
             }
             else
             {
                 throw new PortletException(e);
             }
-        }        
-        
+        }
+
         super.doView(request, response);
     }
-    
-    public void processAction(ActionRequest request, ActionResponse actionResponse)
-    throws PortletException, IOException
+
+    public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException
     {
         // save the prefs
         super.processAction(request, actionResponse);
-        
+
         // get the POST params -- requires HTML post params named
-        // ssoUserName 
+        // ssoUserName
         String ssoPrincipal = request.getParameter(SSO_FORM_PRINCIPAL);
-        String ssoCredential = request.getParameter(SSO_FORM_CREDENTIAL);        
+        String ssoCredential = request.getParameter(SSO_FORM_CREDENTIAL);
         if (ssoPrincipal == null || ssoCredential == null)
         {
             actionResponse.setPortletMode(PortletMode.EDIT); // stay on edit
         }
-        
         String siteUrl = request.getPreferences().getValue("SRC", "");
         SSOSite site = sso.getSiteByUrl(siteUrl);
-        if (site != null){
-            try
+        try
+        {
+            if (site == null)
             {
-                SSOPortletUtil.updateUser(sso,request,site,ssoPrincipal, ssoCredential);
+                site = sso.newSite(siteUrl, siteUrl);
+                sso.addSite(site);
+                SSOPortletUtil.updateUser(sso, request, site, ssoPrincipal, ssoCredential);
             }
-            catch (SSOException e)
+            else
             {
-                throw new PortletException(e);
+                SSOPortletUtil.updateUser(sso, request, site, ssoPrincipal, ssoCredential);
             }
         }
-        
+        catch (SSOException e)
+        {
+            throw new PortletException(e);
+        }
+
     }
-    
-   
-    
+
     public String getURLSource(RenderRequest request, RenderResponse response, PortletPreferences prefs)
     {
         String baseSource = super.getURLSource(request, response, prefs);
@@ -207,32 +208,34 @@
             if (baseSource.indexOf("?") == -1)
             {
                 source.append("?");
-            }            
+            }
             else
             {
                 source.append("&");
             }
             source.append(userNameParam);
             source.append("=");
-            
-            String userName = (String)request.getAttribute(SSO_REQUEST_ATTRIBUTE_USERNAME);
-            if (userName == null) userName = "";
-            String password = (String)request.getAttribute(SSO_REQUEST_ATTRIBUTE_PASSWORD);
-            if (password == null) password = "";
+
+            String userName = (String) request.getAttribute(SSO_REQUEST_ATTRIBUTE_USERNAME);
+            if (userName == null)
+                userName = "";
+            String password = (String) request.getAttribute(SSO_REQUEST_ATTRIBUTE_PASSWORD);
+            if (password == null)
+                password = "";
 
             if (type.equals(SSO_TYPE_URL_BASE64))
             {
-                Base64 encoder = new Base64() ;
+                Base64 encoder = new Base64();
                 userName = new String(encoder.encode(userName.getBytes()));
                 password = new String(encoder.encode(password.getBytes()));
-            }            
-            
+            }
+
             source.append(userName);
             source.append("&");
             source.append(passwordParam);
             source.append("=");
             source.append(password);
-            
+
             return response.encodeURL(source.toString());
         }
         else
@@ -240,5 +243,5 @@
             return baseSource;
         }
     }
-    
+
 }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOPortletUtil.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOPortletUtil.java?rev=770498&r1=770497&r2=770498&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOPortletUtil.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOPortletUtil.java Fri May  1 00:25:02 2009
@@ -18,6 +18,7 @@
 
 import java.security.AccessControlContext;
 import java.security.AccessController;
+import java.security.Principal;
 import java.util.Collection;
 
 import javax.portlet.PortletRequest;
@@ -25,6 +26,7 @@
 import javax.security.auth.Subject;
 
 import org.apache.jetspeed.security.JSSubject;
+import org.apache.jetspeed.security.JetspeedPrincipal;
 import org.apache.jetspeed.security.PasswordCredential;
 import org.apache.jetspeed.sso.SSOException;
 import org.apache.jetspeed.sso.SSOManager;
@@ -45,50 +47,80 @@
         return JSSubject.getSubject(context);         
     }
     
-    public static SSOUser getRemoteUser(SSOManager sso, PortletRequest request, SSOSite site) throws SSOException {
+    public static SSOUser getRemoteUser(SSOManager sso, PortletRequest request, SSOSite site) throws SSOException
+    {
         Subject subject = getSubject();
-        if (subject != null){
+        if (subject != null)
+        {
             Collection<SSOUser> remoteUsers = sso.getRemoteUsers(site, subject);
-            // keep backwards compatibility : enforce a relationship (ssouser : user) of 1-to-n. 
-            // TODO: support multiple SSO users and select 1 that is used for browsing.
-            if (remoteUsers.size() == 1){
-                return remoteUsers.iterator().next();
+            // keep backwards compatibility : enforce a relationship (ssouser :
+            // user) of 1-to-n.
+            // TODO: support multiple SSO users and select 1 that is used for
+            // browsing.
+            if (remoteUsers.size() == 1) 
+            { 
+                return remoteUsers.iterator().next(); 
             }
         }
         return null;
     }
     
-    public static void updateUser(SSOManager sso, PortletRequest request, SSOSite site, String newPrincipal, String newPassword) throws SSOException {
-        SSOUser remoteUser = getRemoteUser(sso,request,site);
-        if (remoteUser != null){
-            if (!remoteUser.getName().equals(newPrincipal)){
+    public static void updateUser(SSOManager sso, PortletRequest request, SSOSite site, String newPrincipal, String newPassword) throws SSOException
+    {
+        SSOUser remoteUser = getRemoteUser(sso, request, site);
+        if (remoteUser != null)
+        {
+            if (!remoteUser.getName().equals(newPrincipal))
+            {
                 // rename SSO user and update
                 remoteUser.setName(newPrincipal);
                 sso.updateUser(remoteUser);
             }
             sso.setPassword(remoteUser, newPassword);
-       }
+        }
+        else
+        {
+            Subject subject = getSubject();
+            Principal ownerPrincipal = null;
+            for (Principal p : subject.getPrincipals())
+            {
+                if (p instanceof JetspeedPrincipal)
+                {            
+                    ownerPrincipal = p;
+                    break;
+                }
+            }
+            sso.addUser(site, (JetspeedPrincipal)ownerPrincipal, newPrincipal, newPassword);            
+        }
+        
     }
     
-    public static PasswordCredential getCredentialsForSite(SSOManager sso, String siteName, RenderRequest request){
+    public static PasswordCredential getCredentialsForSite(SSOManager sso, String siteName, RenderRequest request)
+    {
         PasswordCredential pwc = null;
-        SSOSite site = sso.getSiteByName(siteName);        
-        if (site != null){
-            return getCredentialsForSite(sso, site, request);
+        SSOSite site = sso.getSiteByName(siteName);
+        if (site != null) 
+        { 
+            return getCredentialsForSite(sso, site, request); 
         }
         return pwc;
     }
-    
-    public static PasswordCredential getCredentialsForSite(SSOManager sso, SSOSite site, RenderRequest request){
+
+    public static PasswordCredential getCredentialsForSite(SSOManager sso, SSOSite site, RenderRequest request)
+    {
         PasswordCredential pwc = null;
-        try{
-            SSOUser remoteUser = getRemoteUser(sso,request,site);
-            if (remoteUser != null){
-                pwc=sso.getCredentials(remoteUser);    
+        try
+        {
+            SSOUser remoteUser = getRemoteUser(sso, request, site);
+            if (remoteUser != null)
+            {
+                pwc = sso.getCredentials(remoteUser);
             }
-            
-        } catch (SSOException sx){
-            
+
+        }
+        catch (SSOException sx)
+        {
+
         }
         return pwc;
     }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOWebContentPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOWebContentPortlet.java?rev=770498&r1=770497&r2=770498&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOWebContentPortlet.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/sso/SSOWebContentPortlet.java Fri May  1 00:25:02 2009
@@ -42,11 +42,7 @@
 import org.apache.commons.httpclient.auth.AuthState;
 import org.apache.commons.httpclient.auth.BasicScheme;
 import org.apache.commons.httpclient.methods.PostMethod;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.jetspeed.CommonPortletServices;
-import org.apache.portals.applications.webcontent.portlet.WebContentPortlet;
-import org.apache.portals.applications.webcontent.rewriter.WebContentRewriter;
 import org.apache.jetspeed.security.JSSubject;
 import org.apache.jetspeed.security.JetspeedPrincipal;
 import org.apache.jetspeed.security.PasswordCredential;
@@ -55,8 +51,11 @@
 import org.apache.jetspeed.sso.SSOException;
 import org.apache.jetspeed.sso.SSOManager;
 import org.apache.jetspeed.sso.SSOSite;
-import org.apache.jetspeed.sso.SSOUser;
+import org.apache.portals.applications.webcontent.portlet.WebContentPortlet;
+import org.apache.portals.applications.webcontent.rewriter.WebContentRewriter;
 import org.apache.portals.messaging.PortletMessaging;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -67,8 +66,6 @@
  */
 public class SSOWebContentPortlet extends WebContentPortlet
 {
-    // Constants
-    
     // sso.type
     public static final String SSO_TYPE = "sso.type";
     
@@ -178,42 +175,26 @@
         {
             // processPreferencesAction(request, actionResponse);
             // get the POST params -- requires HTML post params named above 
-            String siteName = actionRequest.getPreferences().getValue("SRC", "");
+            String siteUrl = actionRequest.getPreferences().getValue("SRC", "");
             String localUser = actionRequest.getUserPrincipal().getName();
+            SSOSite site = sso.getSiteByUrl(siteUrl);
             try
-            {
-                SSOSite site = sso.getSiteByName(siteName);
-                if (site != null){
-                    
-                    JetspeedPrincipal localPrincipal = getLocalPrincipal(localUser);
-                    
-                    // find the remote user related directly to the User principal of this user, the user's "private" SSO credentials.
-                    SSOUser currentSSOUser = SSOPortletUtil.getRemoteUser(sso, actionRequest, site);
-                    PasswordCredential pwc = sso.getCredentials(currentSSOUser);
-                	
-                	
-                    if (pwc != null)                    {
-                        
-                        if (!pwc.getUserName().equals(ssoPrincipalName))
-                        {
-                            sso.removeUser(currentSSOUser);                            
-                            sso.addUser(site,localPrincipal,ssoPrincipalName,ssoPrincipalPassword);
-                        }
-                        else
-                        {
-                            sso.setPassword(currentSSOUser,ssoPrincipalPassword);
-                        }
-                    }
-                    else
-                    {
-                    	sso.addUser(site,localPrincipal,ssoPrincipalName,ssoPrincipalPassword);
-                    }
+            {        
+                if (site == null)
+                {
+                    site = sso.newSite(siteUrl, siteUrl);
+                    sso.addSite(site);
+                    SSOPortletUtil.updateUser(sso, actionRequest, site, ssoPrincipalName, ssoPrincipalPassword);                                                
+                }
+                else
+                {
+                    SSOPortletUtil.updateUser(sso, actionRequest, site, ssoPrincipalName, ssoPrincipalPassword);                                
                 }
             }
             catch (SSOException e)
             {
                 throw new PortletException(e);
-            }
+            }                
         }
     }
     
@@ -234,18 +215,18 @@
         else 
         {
         	PasswordCredential pwc = SSOPortletUtil.getCredentialsForSite(sso,siteName,request);
-        	if (pwc != null){
+        	if (pwc != null)
+        	{
                 request.setAttribute(SSO_REQUEST_ATTRIBUTE_USERNAME, pwc.getUserName());
                 request.setAttribute(SSO_REQUEST_ATTRIBUTE_PASSWORD, pwc.getPassword());
-        	} else {
+        	} else 
+        	{
                 // no credentials configured in SSO store
                 // switch to SSO Configure View
                 request.setAttribute(PARAM_VIEW_PAGE, this.getPortletConfig().getInitParameter(PARAM_EDIT_PAGE));
                 setupPreferencesEdit(request, response);    
         	}
         }
-         
-        
         super.doView(request, response);
     }
     
@@ -255,10 +236,13 @@
     {
         String site = request.getPreferences().getValue("SRC", "");
     	PasswordCredential pwc = SSOPortletUtil.getCredentialsForSite(sso,site,request);
-    	if (pwc != null){
+    	if (pwc != null)
+    	{
             getContext(request).put(SSO_EDIT_FIELD_PRINCIPAL, pwc.getUserName());
             getContext(request).put(SSO_EDIT_FIELD_CREDENTIAL, pwc.getPassword());
-        } else {
+        } 
+    	else 
+    	{
             // no credentials configured in SSO store
             // switch to SSO Configure View
             getContext(request).put(SSO_EDIT_FIELD_PRINCIPAL, "");

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/default-rewriter-rules.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/default-rewriter-rules.xml?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/default-rewriter-rules.xml (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/default-rewriter-rules.xml Fri May  1 00:25:02 2009
@@ -0,0 +1,78 @@
+<?xml version='1.0' ?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You 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.
+-->
+<ruleset id='test-set-102' remove-comments='false'>
+
+<!-- standard rewriter link rules -->
+<rule id='base' use-base='true' ignore-prefixes='javascript:,mailto:,#'/>
+
+<!-- remove tags -->
+<tag id='html' remove='true'/>
+<tag id='frameset' remove='true'/>
+<tag id='frame' remove='true'/>
+<tag id='noframes' remove='true'/>
+<tag id='body' remove='true'/>
+
+<!-- strip tags -->
+<tag id='head' remove='true'/>
+
+<!-- rewritten tags -->
+<tag id='a'>
+    <attribute id='href' rule='base'/>
+</tag>
+<tag id='link'>
+    <attribute id='href' rule='base'/>
+</tag>
+<tag id='img'>
+    <attribute id='src' rule='base'/>
+</tag>
+<tag id='input'>
+    <attribute id='src' rule='base'/>
+</tag>
+<tag id='option'>
+    <attribute id='value' rule='base'/>
+</tag>
+<tag id='applet'>
+    <attribute id='codebase' rule='base'/>
+</tag>
+<tag id='frame'>
+    <attribute id='src' rule='base'/>
+</tag>
+<tag id='script'>
+    <attribute id='src' rule='base'/>
+</tag>
+<tag id='form'>
+    <attribute id='action' rule='base'/>
+</tag>
+<tag id='area'>
+    <attribute id='href' rule='base'/>
+</tag>
+<tag id='body'>
+    <attribute id='background' rule='base'/>
+</tag>
+<tag id='td'>
+    <attribute id='background' rule='base'/>
+</tag>
+<tag id='td'>
+    <attribute id='onclick' rule='base'/>
+</tag>
+
+    <!-- sample rules -->
+<rule id='portal-popup' popup='true' use-base='true' suffix='/portal' ignore-prefixes='javascript:,mailto:'/>
+<rule id='test' use-base='false' suffix='/whatever&amp;xxx=1' popup='1'/>
+
+</ruleset>

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/default-rewriter-rules.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/default-rewriter-rules.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/rewriter-rules-mapping.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/rewriter-rules-mapping.xml?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/rewriter-rules-mapping.xml (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/rewriter-rules-mapping.xml Fri May  1 00:25:02 2009
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You 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.
+-->
+<mapping>
+  <class name="org.apache.portals.applications.webcontent.rewriter.rules.impl.RulesetImpl">
+    <map-to xml="ruleset"/>
+
+    <field name="id" type="java.lang.String">
+      <bind-xml name="id" node="attribute"/>
+    </field>
+
+    <field name="removeComments" type="boolean">
+      <bind-xml name="remove-comments" node="attribute"/>
+    </field>
+                                   
+    <field name="tags"
+           type="org.apache.portals.applications.webcontent.rewriter.rules.impl.TagImpl"
+           collection="collection">
+      <bind-xml name="tag"/>
+    </field>
+
+    <field name="rules"
+           type="org.apache.portals.applications.webcontent.rewriter.rules.impl.RuleImpl"
+           collection="collection">
+      <bind-xml name="rule"/>
+    </field>
+
+  </class>
+
+  <class name="org.apache.portals.applications.webcontent.rewriter.rules.impl.TagImpl">
+    <map-to xml="tag"/>
+                                   
+    <field name="id" type="java.lang.String">
+      <bind-xml name="id" node="attribute"/>
+    </field>
+
+    <field name="strip" type="boolean">
+      <bind-xml name="strip" node="attribute"/>
+    </field>
+
+    <field name="remove" type="boolean">
+      <bind-xml name="remove" node="attribute"/>
+    </field>
+
+    <field name="attributes"
+           type="org.apache.portals.applications.webcontent.rewriter.rules.impl.AttributeImpl"
+           collection="collection">
+      <bind-xml name="attribute"/>
+    </field>
+
+  </class>
+
+  <class name="org.apache.portals.applications.webcontent.rewriter.rules.impl.RuleImpl">
+    <map-to xml="rule"/>
+                                   
+    <field name="id" type="java.lang.String">
+      <bind-xml name="id" node="attribute"/>
+    </field>
+
+    <field name="suffix" type="java.lang.String">
+      <bind-xml name="suffix" node="attribute"/>
+    </field>
+
+    <field name="ignorePrefixes" type="java.lang.String">
+      <bind-xml name="ignore-prefixes" node="attribute"/>
+    </field>
+
+    <field name="useBase" type="boolean">
+      <bind-xml name="use-base" node="attribute"/>
+    </field>
+
+    <field name="popup" type="boolean">
+      <bind-xml name="popup" node="attribute"/>
+    </field>
+
+  </class>
+
+  <class name="org.apache.portals.applications.webcontent.rewriter.rules.impl.AttributeImpl">
+    <map-to xml="attribute"/>
+                                   
+    <field name="id" type="java.lang.String">
+      <bind-xml name="id" node="attribute"/>
+    </field>
+
+    <field name="ruleId" type="java.lang.String">
+      <bind-xml name="rule" node="attribute"/>
+    </field>
+
+  </class>
+
+</mapping>
\ No newline at end of file

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/rewriter-rules-mapping.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/conf/rewriter-rules-mapping.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml?rev=770498&r1=770497&r2=770498&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml Fri May  1 00:25:02 2009
@@ -1463,14 +1463,14 @@
         <description>Places an HTML IFrame inside a portlet for easily hosting other web application within a portlet. Sizes of both normal and maximized modes are configurable in edit mode. Additional Single-Signon Support to automatically log on this portlet to other web sites.</description>        
         <portlet-name>SSOIFramePortlet</portlet-name>
         <display-name>SSO IFrame Portlet</display-name>
-        <portlet-class>org.apache.jetspeed.portlet.SSOIFramePortlet</portlet-class>        
+        <portlet-class>org.apache.jetspeed.portlets.sso.SSOIFramePortlet</portlet-class>        
         <init-param>
             <name>EditPage</name>
-            <value>/WEB-INF/view/sso-edit-prefs.vm</value>
+            <value>/WEB-INF/security/sso/sso-edit-prefs.vm</value>
         </init-param>
         <init-param>
             <name>HelpPage</name>
-            <value>/WEB-INF/view/iframe-help.html</value>
+            <value>/WEB-INF/security/sso/iframe-help.html</value>
         </init-param>
         <init-param>
             <name>portlet-icon</name>
@@ -1529,14 +1529,14 @@
         <description>Includes the content of another website inside the portal without using frames. All links are rewritten back to the portal to attempt to proxy all content through the portal. Additional Single-Signon Support to automatically log on this portlet to other web sites and manage sessions.</description>                
         <portlet-name>SSOWebContentPortlet</portlet-name>
         <display-name>SSO WebContent Portlet</display-name>
-        <portlet-class>org.apache.jetspeed.portlet.SSOWebContentPortlet</portlet-class>        
+        <portlet-class>org.apache.jetspeed.portlets.sso.SSOWebContentPortlet</portlet-class>        
         <init-param>
             <name>EditPage</name>
-            <value>/WEB-INF/view/sso-edit-prefs.vm</value>
+            <value>/WEB-INF/security/sso/sso-edit-prefs.vm</value>
         </init-param>
         <init-param>
             <name>HelpPage</name>
-            <value>/WEB-INF/view/sso-webcontent-help.vm</value>
+            <value>/WEB-INF/security/sso/sso-webcontent-help.vm</value>
         </init-param>
         <init-param>
             <name>portlet-icon</name>
@@ -1606,7 +1606,7 @@
         <portlet-preferences>
             <preference>
                 <name>file</name>
-                <value>sso-demo.html</value>
+                <value>/WEB-INF/security/sso/sso-demo.html</value>
             </preference>
         </portlet-preferences>
     </portlet>
@@ -1615,10 +1615,10 @@
       <description>SSO Proxy Portlet</description>
       <portlet-name>SSOProxyPortletPortlet</portlet-name>
       <display-name>SSOProxyPortlet</display-name>
-      <portlet-class>org.apache.jetspeed.portlet.sso.SSOProxyPortlet</portlet-class>      
+      <portlet-class>org.apache.jetspeed.portlets.sso.SSOProxyPortlet</portlet-class>      
       <init-param>
         <name>EditPage</name>
-        <value>/WEB-INF/view/edit-sso-proxy.vm</value>
+        <value>/WEB-INF/security/sso/edit-sso-proxy.vm</value>
       </init-param>
       
       <expiration-cache>-1</expiration-cache>
@@ -1790,6 +1790,133 @@
      <portlet-preferences>
      </portlet-preferences>
   </portlet>
+
+<portlet id="UserChooser">        
+    <description>A Popup portlet for selecting a single user from a list of users. Usually not placed on a page directly, but accessed by Jetspeed over the portlet pipeline in a popup window.</description>
+    <description xml:lang="ja">ユーザー一覧からユーザーを選択するポップアップポートレットです。通常、直接ページ上には置かれません。ポップアップウィンドウ内でポートレットのパイプライン外でポータルからアクセスされます。</description>
+    <description xml:lang="zh">选择用户的Portlet</description>
+    <description xml:lang="zh-TW">選擇用戶的Portlet</description>        
+    <portlet-name>UserChooser</portlet-name>
+    <display-name>User Chooser (popup)</display-name>
+    <display-name xml:lang="ja">ユーザー選択(ポップアップ)</display-name>
+    <display-name xml:lang="zh">用户</display-name>
+    <display-name xml:lang="zh-TW">用戶</display-name>
+    <portlet-class>org.apache.jetspeed.portlets.security.choosers.UserChooserPortlet</portlet-class>
+    <init-param>
+        <description>This parameter sets the template used in view mode.</description>
+        <name>ViewPage</name>
+        <value>/WEB-INF/security/choosers/user-chooser.vm</value>
+    </init-param>
+    <init-param>
+        <name>portlet-icon</name>
+        <value>system-users.png</value>
+    </init-param>                                                                                   
+    <expiration-cache>0</expiration-cache>
+    <supports>
+        <mime-type>text/html</mime-type>
+        <portlet-mode>EDIT</portlet-mode>
+        <portlet-mode>VIEW</portlet-mode>
+        <portlet-mode>HELP</portlet-mode>
+    </supports>
+    <supported-locale>en</supported-locale>
+    <resource-bundle>org.apache.jetspeed.portlets.security.resources.SecurityResources</resource-bundle>
+    <portlet-info>
+        <title>User Select</title>
+        <short-title>Users</short-title>
+        <keywords>users,selector,chooser,popup</keywords>
+    </portlet-info>        
+    <portlet-preferences>
+        <preference>
+            <name>WindowSize</name>
+            <value>1000</value>
+        </preference>
+    </portlet-preferences>
+</portlet>
+      
+<portlet id="GroupChooser">
+    <description>A Popup portlet for selecting a single group from a list of groups. Usually not placed on a page directly, but accessed by Jetspeed over the portlet pipeline in a popup window.</description>        
+    <description xml:lang="ja">グループ一覧からグループを選択するポップアップポートレットです。通常、ページ上には置かれません。ポップアップウィンドウ内でポートレットのパイプライン外でポータルからアクセスされます。</description>
+    <description xml:lang="zh">选择组的Portlet</description>
+    <description xml:lang="zh-TW">選擇組的Portlet</description>        
+    <portlet-name>GroupChooser</portlet-name>
+    <display-name>Group Chooser (popup)</display-name>
+    <display-name xml:lang="ja">グループ選択(ポップアップ)</display-name>
+    <display-name xml:lang="zh">组</display-name>
+    <display-name xml:lang="zh-TW">組</display-name>
+    <portlet-class>org.apache.jetspeed.portlets.security.choosers.GroupChooserPortlet</portlet-class>
+    <init-param>
+        <description>This parameter sets the template used in view mode.</description>
+        <name>ViewPage</name>
+        <value>/WEB-INF/security/choosers/group-chooser.vm</value>
+    </init-param>
+    <init-param>
+        <name>portlet-icon</name>
+        <value>network-workgroup.png</value>
+    </init-param>                                                    
+    <expiration-cache>0</expiration-cache>
+    <supports>
+        <mime-type>text/html</mime-type>
+        <portlet-mode>EDIT</portlet-mode>
+        <portlet-mode>VIEW</portlet-mode>
+        <portlet-mode>HELP</portlet-mode>
+    </supports>
+    <supported-locale>en</supported-locale>
+    <resource-bundle>org.apache.jetspeed.portlets.security.resources.SecurityResources</resource-bundle>
+    <portlet-info>
+        <title>Group Select</title>
+        <short-title>Groups</short-title>
+        <keywords>groups,selector,chooser,popup</keywords>
+    </portlet-info>        
+    <portlet-preferences>
+        <preference>
+            <name>WindowSize</name>
+            <value>1000</value>
+        </preference>
+    </portlet-preferences>
+</portlet>
+
+<portlet id="RoleChooser">
+    <description>A Popup portlet for selecting a single role from a list of roles. Usually not placed on a page directly, but accessed by Jetspeed over the portlet pipeline in a popup window.</description>
+    <description xml:lang="ja">ロール一覧からロールを選択するポップアップポートレットです。通常、ページ上には置かれません。ポップアップウィンドウ内でポートレットのパイプライン外でポータルからアクセスされます。</description>
+    <description xml:lang="zh">选择角色的Portlet</description>
+    <description xml:lang="zh-TW">選擇角色的Portlet</description>        
+    <portlet-name>RoleChooser</portlet-name>
+    <display-name>Role Chooser (popup)</display-name>
+    <display-name xml:lang="ja">ロール選択(ポップアップ)</display-name>
+    <display-name xml:lang="zh">角色</display-name>
+    <display-name xml:lang="zh-TW">角色</display-name>
+    <portlet-class>org.apache.jetspeed.portlets.security.choosers.RoleChooserPortlet</portlet-class>
+    <init-param>
+        <description>This parameter sets the template used in view mode.</description>
+        <name>ViewPage</name>
+        <value>/WEB-INF/security/choosers/role-chooser.vm</value>
+    </init-param>
+    <init-param>
+        <name>portlet-icon</name>
+        <value>preferences-desktop-theme.png</value>
+    </init-param>                                                                    
+    <expiration-cache>0</expiration-cache>
+    <supports>
+        <mime-type>text/html</mime-type>
+        <portlet-mode>EDIT</portlet-mode>
+        <portlet-mode>VIEW</portlet-mode>
+        <portlet-mode>HELP</portlet-mode>
+    </supports>
+    <supported-locale>en</supported-locale>
+    <resource-bundle>org.apache.jetspeed.portlets.security.resources.SecurityResources</resource-bundle>
+    <portlet-info>
+        <title>Role Select</title>
+        <short-title>Roles</short-title>
+        <keywords>roles,selector,chooser,popup</keywords>
+    </portlet-info>        
+    <portlet-preferences>
+        <preference>
+            <name>WindowSize</name>
+            <value>1000</value>
+        </preference>
+    </portlet-preferences>
+</portlet>
+
       
     <custom-portlet-mode>
         <description>a Custom Edit_defaults Mode</description>            

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/group-chooser.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/group-chooser.vm?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/group-chooser.vm (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/group-chooser.vm Fri May  1 00:25:02 2009
@@ -0,0 +1,70 @@
+#*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You 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.
+*#
+
+#**
+
+@author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+@version $Id$
+
+*#
+
+<script language="JavaScript" type="text/javascript">
+    <!--
+    function select(value)
+    {
+        var openerForm = opener.document.forms['securityform'];
+        var openerEl = openerForm.elements['portal.principal'];
+        var openerType = openerForm.elements['principal.type'];        
+        openerEl.value = value;
+        openerType.value = 'group';
+        window.close();
+    }
+	function rowHover(row)
+	{
+	    row.oldClassName = row.className;
+	    row.className = 'jetdbLight';
+	    row.onmouseout = function()
+	    {
+	        this.className = this.oldClassName;
+	    }
+	}    
+    //-->
+</script>
+
+
+#set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
+
+<table cellpadding=0 cellspacing=1 border=0 width='100%' >
+  <tr>
+    #foreach ($column in $title)
+	  #set ($columnLink = $renderResponse.createRenderURL())
+	  $columnLink.setParameter("js_dbcolumn",$column)
+##      <td align='center' class="jetdbHeadNoLink" width="40%" nowrap onClick="window.location.href='$columnLink'">
+      <td align='center' class="jetdbHeadNoLink" width="40%" nowrap>
+        $column
+      </td>
+    #end
+  </tr>
+  #foreach ( $group in $table )
+  <tr>
+      #set ($rowstyle = "jetdbOdd")
+      <td class="$rowstyle" nowrap width="25%" onclick="select('$group');" onmouseover="rowHover(this)">
+        <div align="center">$group</div>
+      </td>
+   </tr>
+  #end
+</table>

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/group-chooser.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/group-chooser.vm
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/role-chooser.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/role-chooser.vm?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/role-chooser.vm (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/role-chooser.vm Fri May  1 00:25:02 2009
@@ -0,0 +1,70 @@
+#*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You 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.
+*#
+
+#**
+
+@author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+@version $Id$
+
+*#
+
+<script language="JavaScript" type="text/javascript">
+    <!--
+    function select(value)
+    {
+        var openerForm = opener.document.forms['securityform'];
+        var openerEl = openerForm.elements['portal.principal'];
+        var openerType = openerForm.elements['principal.type'];        
+        openerEl.value = value;
+        openerType.value = 'role';
+        window.close();
+    }
+	function rowHover(row)
+	{
+	    row.oldClassName = row.className;
+	    row.className = 'jetdbLight';
+	    row.onmouseout = function()
+	    {
+	        this.className = this.oldClassName;
+	    }
+	}    
+    //-->
+</script>
+
+
+#set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
+
+<table cellpadding=0 cellspacing=1 border=0 width='100%' >
+  <tr>
+    #foreach ($column in $title)
+	  #set ($columnLink = $renderResponse.createRenderURL())
+	  $columnLink.setParameter("js_dbcolumn",$column)
+##      <td align='center' class="jetdbHeadNoLink" width="40%" nowrap onClick="window.location.href='$columnLink'">
+      <td align='center' class="jetdbHeadNoLink" width="40%" nowrap>
+        $column
+      </td>
+    #end
+  </tr>
+  #foreach ( $role in $table )
+  <tr>
+      #set ($rowstyle = "jetdbOdd")
+      <td class="$rowstyle" nowrap width="25%" onclick="select('$role');" onmouseover="rowHover(this)">
+        <div align="center">$role</div>
+      </td>
+   </tr>
+  #end
+</table>

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/role-chooser.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/role-chooser.vm
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/user-chooser.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/user-chooser.vm?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/user-chooser.vm (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/user-chooser.vm Fri May  1 00:25:02 2009
@@ -0,0 +1,70 @@
+#*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You 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.
+*#
+
+#**
+
+@author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+@version $Id$
+
+*#
+
+<script language="JavaScript" type="text/javascript">
+    <!--
+    function select(value)
+    {
+        var openerForm = opener.document.forms['securityform'];
+        var openerEl = openerForm.elements['portal.principal'];
+        var openerType = openerForm.elements['principal.type'];        
+        openerEl.value = value;
+        openerType.value = 'user';
+        window.close();
+    }
+	function rowHover(row)
+	{
+	    row.oldClassName = row.className;
+	    row.className = 'jetdbLight';
+	    row.onmouseout = function()
+	    {
+	        this.className = this.oldClassName;
+	    }
+	}    
+    //-->
+</script>
+
+
+#set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
+
+<table cellpadding=0 cellspacing=1 border=0 width='100%' >
+  <tr>
+    #foreach ($column in $title)
+	  #set ($columnLink = $renderResponse.createRenderURL())
+	  $columnLink.setParameter("js_dbcolumn",$column)
+##      <td align='center' class="jetdbHeadNoLink" width="40%" nowrap onClick="window.location.href='$columnLink'">
+      <td align='center' class="jetdbHeadNoLink" width="40%" nowrap>
+        $column
+      </td>
+    #end
+  </tr>
+  #foreach ( $user in $table )
+  <tr>
+      #set ($rowstyle = "jetdbOdd")
+      <td class="$rowstyle" nowrap width="25%" onclick="select('$user');" onmouseover="rowHover(this)">
+        <div align="center">$user</div>
+      </td>
+   </tr>
+  #end
+</table>

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/user-chooser.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/choosers/user-chooser.vm
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/edit-sso-proxy.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/edit-sso-proxy.vm?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/edit-sso-proxy.vm (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/edit-sso-proxy.vm Fri May  1 00:25:02 2009
@@ -0,0 +1,31 @@
+#*
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+*#
+<h2 class="portlet-section-header">Edit Preferences</h2>
+
+<form action="$renderResponse.createActionURL()" method="post">
+<table>
+#foreach ($pref in $prefs)
+#prefField($pref.Key $pref.Value "40")
+#end
+<hr/>
+#form4ColumnCell("Destination URL" $DestinationURL 30 "DestinationURL")
+#form4ColumnCell("SSO Site (empty for all)" $SSOSite 30 "SSOSite")
+</table>
+<input type="submit" name="Save" value="Save" />
+</form>
+
+

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/edit-sso-proxy.vm
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/iframe-help.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/iframe-help.html?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/iframe-help.html (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/iframe-help.html Fri May  1 00:25:02 2009
@@ -0,0 +1,48 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+<h1>SSO IFrame Help</h1>
+<p>
+The following preferences can be used with the SSO IFrame Portlet in addition to the standard IFrame preferences 
+</p>
+<p>
+<table border="1" cellspacing="1" cellpadding="3">
+<tr>
+<th class="portlet-section-body">Preference</th>	
+<th class="portlet-section-body">Usage</th>
+</tr>
+<tr>
+<td class='portlet-section-body'>sso.type</td>	
+<td class='portlet-section-body'>The type of Single signon authentication. Valid values: form | basic | basic.preemptive | url | url.base64</td>
+</tr>
+<tr>
+<td class='portlet-section-body'>sso.url.Credential</td>	
+<td class='portlet-section-body'>The name of the credential input field or parameter</td>
+</tr>
+<tr>
+<td class='portlet-section-body'>sso.url.Principal</td>	
+<td class='portlet-section-body'>The name of the user name input field or parameter</td>
+</tr>
+<tr>
+<td class='portlet-section-body'>SSO Principal</td>	
+<td class='portlet-section-body'>The actual user name</td>
+</tr>
+<tr>
+<td class='portlet-section-body'>SSO Credential</td>	
+<td class='portlet-section-body'>The actual crendential value</td>
+</tr>
+</table>	
+</p>

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/iframe-help.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/iframe-help.html
------------------------------------------------------------------------------
    svn:keywords = Id

Copied: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-demo.html (from r770333, portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/_content/sso-demo.html)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-demo.html?p2=portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-demo.html&p1=portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/_content/sso-demo.html&r1=770333&r2=770498&rev=770498&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/_content/sso-demo.html (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-demo.html Fri May  1 00:25:02 2009
@@ -14,7 +14,6 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<h3>SSO Demo Helper</h3>
 <p>Here are the credentials you need to enter for the two demos on this page:</p>
 <table border="1" cellspacing="1" cellpadding="3">
 <tr>

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-demo.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-demo.html
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-demo.html
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-demo.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-edit-prefs.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-edit-prefs.vm?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-edit-prefs.vm (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-edit-prefs.vm Fri May  1 00:25:02 2009
@@ -0,0 +1,32 @@
+
+#*
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+*#
+<h2 class="portlet-section-header">Edit Preferences</h2>
+
+<form action="$renderResponse.createActionURL()" method="post">
+<table>
+#foreach ($pref in $prefs)
+#prefField($pref.Key $pref.Value "40")
+#end
+<hr/>
+#form4ColumnCell("SSO Principal" $ssoPrincipal 30 "ssoPrincipal")
+#form4PasswordCell("SSO Credential" $ssoCredential 30 "ssoCredential")
+</table>
+<input type="submit" name="Save" value="Save" />
+</form>
+
+

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-edit-prefs.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-edit-prefs.vm
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-webcontent-help.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-webcontent-help.vm?rev=770498&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-webcontent-help.vm (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-webcontent-help.vm Fri May  1 00:25:02 2009
@@ -0,0 +1,42 @@
+#*
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+*#
+<h1>Help</h1>
+<p>
+<h3>Basic authentication</h3> is the default and can be supported effectively without even setting <b>sso.type</b>
+Just by providing credentials for the domain. The credentials will not be sent preemptively, 
+but if a 401 request is returned for Basic authentication, it will be handled properly.   
+Tis is equivalent to setting sso.type=basic (or sso.type=html (old - now deprecated in favor of calling it <b>basic</b>).
+if you set sso.type=basic.preemptive, it will send the credentials preemptively.
+</p>
+<br/>
+<p>
+<h3>URL authentication</h3> (query args) is supported as <b>sso.type=url</b> or <b>sso.type=url.base64</b>.
+By definition, this type of authentication is <quote>preemptive</quote>, so no distinction is made 
+there.   
+</p>
+<br/>
+<p>
+<h3>Form-authentication</h3> is supported with <b>sso.type=form</b> (which is equivalent to sso.type=form.post - you can also specify sso.type=form.get, 
+if GET protocol is used on the login form). This form also requires a bunch of other data 
+( e.g. the action URL, other args, names of the fields for credentials, etc.).   
+All of this is in an example that is in the demo portlet.xml.   
+Form-based authentication is also considred "preemptive", in that it authenticates before any other 
+content is read. However, it only does it once.  If it succeeds, all should be well.
+If it fails, the user will have to login by hand (since the initial content URL will 
+cause a redirect to the login page).
+</p>
+<br/>

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-webcontent-help.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/security/sso/sso-webcontent-help.vm
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/velocity/velocity-macros.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/velocity/velocity-macros.vm?rev=770498&r1=770497&r2=770498&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/velocity/velocity-macros.vm (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/velocity/velocity-macros.vm Fri May  1 00:25:02 2009
@@ -188,3 +188,15 @@
     <td width="5%" class="portlet-form-label" align="left">&nbsp;</td>
   </tr>
 #end
+
+#macro (form4PasswordCell $label $value $size $id)
+  <tr colspan="4" align="right">
+    <td width="5%" class="portlet-form-label" align="left">&nbsp;</td>
+    <td nowrap class="portlet-section-alternate" align="left">$!label:&nbsp;</td>
+    <td class="portlet-form-input-field" align="left">
+      <input id="$!id" type="password" name="$!id" size="$!size" value="$!value">
+    </td>
+    <td width="5%" class="portlet-form-label" align="left">&nbsp;</td>
+  </tr>
+#end
+



---------------------------------------------------------------------
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