Author: taylor
Date: Thu Jan 25 12:45:04 2007
New Revision: 499960

URL: http://svn.apache.org/viewvc?view=rev&rev=499960
Log:
https://issues.apache.org/jira/browse/JS2-645
(checkin point one: development continuing)

Added:
    
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/SecurityConstraintRefRule.java
Modified:
    
portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBean.java
    
portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/beans/PortletApplicationBean.java
    portals/jetspeed-2/trunk/components/portal/maven.xml
    
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/JetspeedServiceRule.java
    
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/PortletRule.java
    
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/util/descriptor/ExtendedPortletMetadata.java
    
portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/tools/pamanager/TestJetspeedPortletDescriptor.java
    
portals/jetspeed-2/trunk/components/portal/test/testdata/deploy/jetspeed-portlet.xml
    portals/jetspeed-2/trunk/components/portal/test/testdata/deploy/portlet.xml
    
portals/jetspeed-2/trunk/components/registry/src/java/JETSPEED-INF/ojb/registry_repository.xml
    
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java
    
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
    
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
    
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/util/ojb/LocaleFieldConversion.java
    portals/jetspeed-2/trunk/etc/schema/registry-schema.xml
    portals/jetspeed-2/trunk/etc/sql/derby/schema/registry-schema.sql
    
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/MutablePortletApplication.java
    
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/PortletApplication.java
    
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/PortletDefinitionComposite.java

Modified: 
portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBean.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBean.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBean.java
 (original)
+++ 
portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBean.java
 Thu Jan 25 12:45:04 2007
@@ -192,4 +192,8 @@
     {
         return pa.getCustomWindowState(state);
     }
+    public String getJetspeedSecurityConstraint()
+    {
+        return pa.getJetspeedSecurityConstraint();
+    }    
 }

Modified: 
portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/beans/PortletApplicationBean.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/beans/PortletApplicationBean.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/beans/PortletApplicationBean.java
 (original)
+++ 
portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/beans/PortletApplicationBean.java
 Thu Jan 25 12:45:04 2007
@@ -192,4 +192,10 @@
     {
         return pa.getCustomWindowState(state);
     }
+    
+    public String getJetspeedSecurityConstraint()
+    {
+        return pa.getJetspeedSecurityConstraint();
+    }
+    
 }

Modified: portals/jetspeed-2/trunk/components/portal/maven.xml
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/maven.xml?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/maven.xml (original)
+++ portals/jetspeed-2/trunk/components/portal/maven.xml Thu Jan 25 12:45:04 
2007
@@ -17,6 +17,6 @@
 <project default="java:jar" xmlns:j="jelly:core" xmlns:define="jelly:define" 
xmlns:maven="jelly:maven">
 
     <!-- Target of maven test:single test -->
-    <property name='testcase' 
value='org.apache.jetspeed.aggregator.TestAggregator' />
+    <property name='testcase' 
value='org.apache.jetspeed.tools.pamanager.TestJetspeedPortletDescriptor' />
 
 </project>

Modified: 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/JetspeedServiceRule.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/JetspeedServiceRule.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/JetspeedServiceRule.java
 (original)
+++ 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/JetspeedServiceRule.java
 Thu Jan 25 12:45:04 2007
@@ -32,20 +32,11 @@
     public JetspeedServiceRule(MutablePortletApplication app)
     {
         this.app = app;
-
     }
 
     public void end(String namespace, String name) throws Exception
     {
-        Object o = digester.peek(0);
-        System.out.println("namespace = " + namespace);
-        System.out.println("name = " + name);
-        System.out.println("object = " + o);
-        
         JetspeedServiceReference service = (JetspeedServiceReference) 
digester.peek(0);
-        System.out.println("service = " + service);
-        
         app.addJetspeedService(service);
     }
-
 }

Modified: 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/PortletRule.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/PortletRule.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/PortletRule.java
 (original)
+++ 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/PortletRule.java
 Thu Jan 25 12:45:04 2007
@@ -42,5 +42,5 @@
     {
         PortletDefinitionComposite def = (PortletDefinitionComposite) 
app.getPortletDefinitionByName(text);
         digester.push(def);
-    }
+    }                                                        
 }

Added: 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/SecurityConstraintRefRule.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/SecurityConstraintRefRule.java?view=auto&rev=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/SecurityConstraintRefRule.java
 (added)
+++ 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/rules/SecurityConstraintRefRule.java
 Thu Jan 25 12:45:04 2007
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.tools.pamanager.rules;
+
+import org.apache.commons.digester.Rule;
+import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
+import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
+
+/**
+ * This class helps load the portlet's metadata onto the digester stack
+ * 
+ * @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class SecurityConstraintRefRule extends Rule
+{
+    private MutablePortletApplication app = null;
+
+    public SecurityConstraintRefRule(MutablePortletApplication app)
+    {
+        this.app = app;
+    }
+    
+    public void body(String namespace, String name, String text) throws 
Exception
+    {
+        Object obj = digester.peek();
+        if (obj instanceof MutablePortletApplication)
+        {
+           ((MutablePortletApplication) 
obj).setJetspeedSecurityConstraint(text);
+        }
+        else if (obj instanceof PortletDefinitionComposite)
+        {
+            ((PortletDefinitionComposite) 
obj).setJetspeedSecurityConstraint(text);
+        }
+    }
+    
+}
\ No newline at end of file

Modified: 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/util/descriptor/ExtendedPortletMetadata.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/util/descriptor/ExtendedPortletMetadata.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/util/descriptor/ExtendedPortletMetadata.java
 (original)
+++ 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/util/descriptor/ExtendedPortletMetadata.java
 Thu Jan 25 12:45:04 2007
@@ -30,10 +30,10 @@
 import org.apache.jetspeed.om.portlet.impl.CustomPortletModeImpl;
 import org.apache.jetspeed.om.portlet.impl.CustomWindowStateImpl;
 import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
-
 import org.apache.jetspeed.tools.pamanager.rules.JetspeedServicesRuleSet;
 import org.apache.jetspeed.tools.pamanager.rules.MetadataRuleSet;
 import org.apache.jetspeed.tools.pamanager.rules.PortletRule;
+import org.apache.jetspeed.tools.pamanager.rules.SecurityConstraintRefRule;
 import org.apache.jetspeed.tools.pamanager.rules.UserAttributeRefRuleSet;
 import org.xml.sax.Attributes;
 
@@ -100,10 +100,13 @@
 
             digester.addRuleSet(new MetadataRuleSet("portlet-app/"));
             digester.addRuleSet(new JetspeedServicesRuleSet(portletApp));
+            digester.addRule("portlet-app/security-constraint-ref", new 
SecurityConstraintRefRule(portletApp));                        
             
             digester.addRule("portlet-app/portlet/portlet-name", new 
PortletRule(portletApp));
             digester.addRuleSet(new MetadataRuleSet("portlet-app/portlet/"));
-
+            
+            digester.addRule("portlet-app/portlet/security-constraint-ref", 
new SecurityConstraintRefRule(portletApp));        
+            
             digester.addRuleSet(new UserAttributeRefRuleSet(portletApp));
             
             ArrayList mappedPortletModes = new ArrayList();
@@ -113,7 +116,7 @@
             
digester.addBeanPropertySetter("portlet-app/custom-portlet-mode/name", 
"customName");
             
digester.addBeanPropertySetter("portlet-app/custom-portlet-mode/mapped-name", 
"mappedName");
             digester.addSetNext("portlet-app/custom-portlet-mode", "add");
-
+            
             ArrayList mappedWindowStates = new ArrayList();
             digester.addRule("portlet-app/custom-window-state",new 
CollectionRule(mappedWindowStates));
             
digester.addObjectCreate("portlet-app/custom-window-state",CustomWindowStateImpl.class);

Modified: 
portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/tools/pamanager/TestJetspeedPortletDescriptor.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/tools/pamanager/TestJetspeedPortletDescriptor.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/tools/pamanager/TestJetspeedPortletDescriptor.java
 (original)
+++ 
portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/tools/pamanager/TestJetspeedPortletDescriptor.java
 Thu Jan 25 12:45:04 2007
@@ -19,15 +19,16 @@
 import java.util.Collection;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
 import org.apache.jetspeed.om.common.JetspeedServiceReference;
 import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
 import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
-import org.apache.jetspeed.prefs.util.test.AbstractPrefsSupportedTestCase;
 import org.apache.jetspeed.util.descriptor.ExtendedPortletMetadata;
 import org.apache.jetspeed.util.descriptor.PortletApplicationDescriptor;
+import org.apache.pluto.om.portlet.PortletDefinition;
 
 
 /**
@@ -38,12 +39,13 @@
  * @version $Id$
  */
 public class TestJetspeedPortletDescriptor
-    extends AbstractPrefsSupportedTestCase {
+    extends TestCase { 
+    //extends AbstractPrefsSupportedTestCase {
     
-    private static final String PORTLET_01 = "HelloWorld Portlet";
-    private static final String PORTLET_02 = "Display the Portlet Request 
Information";
-    private static final String PORTLET_03 = "Pick a number game";
-    private static final String PORTLET_04 = "Attribute Scope Demo";
+    private static final String PORTLET_01 = "HelloPortlet";
+    private static final String PORTLET_02 = "DisplayRequestPortlet";
+    private static final String PORTLET_03 = "PickANumberPortlet";
+    private static final String PORTLET_04 = "AttributeScopePortlet";
     
     /**
      * Start the tests.
@@ -96,6 +98,7 @@
         Collection def4Field1 = def4.getMetadata().getFields("field1");
         Collection def4Fiels2 = def4.getMetadata().getFields("field2");
         
+        String securityRef = app.getJetspeedSecurityConstraint();
         assertEquals(titles.size(), 3);
         assertEquals(def1Titles.size(), 4);
         assertEquals(def2Subjects.size(), 5);
@@ -103,13 +106,20 @@
         assertEquals(def4Field1.size(), 3);
         assertEquals(def4Fiels2.size(), 2);
         
+        // Security Constraints tests
+        assertEquals(securityRef, "admin-only");
+        assertEquals(def1.getJetspeedSecurityConstraint(), "users-1");
+        assertEquals(def2.getJetspeedSecurityConstraint(), "users-2");
+        assertEquals(def3.getJetspeedSecurityConstraint(), "users-4");
+        assertNull(def4.getJetspeedSecurityConstraint());
+        
         Collection servicesCollection = app.getJetspeedServices();
         assertNotNull("Metadata services is null", servicesCollection);
         assertEquals("Expected 2 service definitions", 
servicesCollection.size(), 2);
         Object[] services = servicesCollection.toArray();
         JetspeedServiceReference service = 
(JetspeedServiceReference)services[0];
         System.out.println("**** service = " + service.getName());
-        
+                
         assertEquals( ((JetspeedServiceReference)services[0]).getName(), 
"PortletRegistryComponent");
         assertEquals( ((JetspeedServiceReference)services[1]).getName(), 
"PortletEntityAccessComponent");
     }

Modified: 
portals/jetspeed-2/trunk/components/portal/test/testdata/deploy/jetspeed-portlet.xml
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/test/testdata/deploy/jetspeed-portlet.xml?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/portal/test/testdata/deploy/jetspeed-portlet.xml
 (original)
+++ 
portals/jetspeed-2/trunk/components/portal/test/testdata/deploy/jetspeed-portlet.xml
 Thu Jan 25 12:45:04 2007
@@ -19,6 +19,8 @@
     xmlns:js="http://portals.apache.org/jetspeed"; 
     xmlns:dc="http://www.purl.org/dc";>
     
+    <js:security-constraint-ref>admin-only</js:security-constraint-ref>    
+    
     <dc:title>Title 1</dc:title>
     <dc:title xml:lang="en">Eng Title</dc:title>
     <dc:title xml:lang="fr">Fr Title</dc:title>
@@ -35,10 +37,11 @@
     <dc:right>Default Right</dc:right>
     <dc:source>Default Source</dc:source>
     <dc:type>Default Type</dc:type>
-    <js:metadata name="my_metadata" xml:lang="en">English 
My_Metadata</js:metadata>
-        
+    <js:metadata name="my_metadata" xml:lang="en">English 
My_Metadata</js:metadata>    
+    
     <portlet>
-        <portlet-name>HelloWorld Portlet</portlet-name>
+        <portlet-name>HelloPortlet</portlet-name>
+        <js:security-constraint-ref>users-1</js:security-constraint-ref>       
                         
         <dc:title>HelloWorldTitle</dc:title>
         <dc:title xml:lang="en">HP Eng Title</dc:title>
         <dc:title xml:lang="fr">HP Fr Title</dc:title>
@@ -46,7 +49,8 @@
     </portlet>
     
     <portlet>
-        <portlet-name>Display the Portlet Request Information</portlet-name>
+        <portlet-name>DisplayRequestPortlet</portlet-name>
+        <js:security-constraint-ref>users-2</js:security-constraint-ref>       
             
         <dc:subject xml:lang="es">HP Spanish Subject</dc:subject>
         <dc:subject xml:lang="es">HP Spanish Subject</dc:subject>
         <dc:subject xml:lang="es">HP Spanish Subject</dc:subject>
@@ -56,6 +60,7 @@
     
     <portlet>
         <portlet-name>PortletThatDoesNotExist</portlet-name>
+        <js:security-constraint-ref>users-3</js:security-constraint-ref>       
             
         <js:metadata name="field1" xml:lang="en">Value 1</js:metadata>
         <js:metadata name="field1" xml:lang="en">Value 2</js:metadata>
         <js:metadata name="field1" xml:lang="en">Value 3</js:metadata>
@@ -64,7 +69,8 @@
     </portlet>
     
     <portlet>
-        <portlet-name>Pick a number game</portlet-name>
+        <portlet-name>PickANumberPortlet</portlet-name>
+        <js:security-constraint-ref>users-4</js:security-constraint-ref>       
             
         <dc:creator>Scott</dc:creator>
         <dc:creator>DST</dc:creator>
         <dc:creator>DLS</dc:creator>
@@ -72,7 +78,7 @@
     </portlet>
     
     <portlet>
-        <portlet-name>Attribute Scope Demo</portlet-name>
+        <portlet-name>AttributeScopePortlet</portlet-name>
         <js:metadata name="field1" xml:lang="en">Value 1</js:metadata>
         <js:metadata name="field1" xml:lang="en">Value 2</js:metadata>
         <js:metadata name="field1" xml:lang="en">Value 3</js:metadata>

Modified: 
portals/jetspeed-2/trunk/components/portal/test/testdata/deploy/portlet.xml
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/test/testdata/deploy/portlet.xml?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/test/testdata/deploy/portlet.xml 
(original)
+++ portals/jetspeed-2/trunk/components/portal/test/testdata/deploy/portlet.xml 
Thu Jan 25 12:45:04 2007
@@ -14,18 +14,21 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
-<portlet-app id="TestRegistry" version="1.0">
+<portlet-app id="TestRegistry" 
+    xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"; 
version="1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd 
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";>        
  <portlet id="HelloPortlet">
+    <description xml:lang="en">This is a description of the HelloWorld 
portlet</description>      
+    <portlet-name>HelloPortlet</portlet-name>
+    <display-name xml:lang="en">HelloWorld Portlet Wrapper</display-name>      
 
+    
<portlet-class>org.apache.jetspeed.portlet.helloworld.HelloWorld</portlet-class>
       
     <init-param>
                        <description xml:lang="en">test init param</description>
                        <description xml:lang="es">prueba parámetros 
iniciales</description>
                        <name>hello</name>
                        <value>Hello Portlet</value>
-     </init-param>  
-    <portlet-name>HelloWorld Portlet</portlet-name>
-    
<portlet-class>org.apache.jetspeed.portlet.helloworld.HelloWorld</portlet-class>
-    <display-name xml:lang="en">HelloWorld Portlet Wrapper</display-name>  
-    <description xml:lang="en">This is a description of the HelloWorld 
portlet</description>
+     </init-param>       
     <expiration-cache>-1</expiration-cache>
     <supports id="Minimal support">
       <mime-type>text/html</mime-type>
@@ -38,6 +41,7 @@
       <short-title>This is the short title</short-title>
       <keywords>Test,David</keywords>
     </portlet-info>
+     
     <portlet-preferences>
       <preference> 
         <name>time-server</name>
@@ -59,7 +63,7 @@
   </portlet>
  
   <portlet id="DisplayRequestPortlet">
-    <portlet-name>Display the Portlet Request Information</portlet-name>
+    <portlet-name>DisplayRequestPortlet</portlet-name>
     
<portlet-class>org.apache.jetspeed.demo.simple.DisplayRequestServlet</portlet-class>
     <expiration-cache>-1</expiration-cache>
     <supports>
@@ -73,7 +77,7 @@
   </portlet>
   
   <portlet id="PickANumberPortlet">
-    <portlet-name>Pick a number game</portlet-name>
+    <portlet-name>PickANumberPortlet</portlet-name>
     
<portlet-class>org.apache.jetspeed.demo.simple.PickANumberServlet</portlet-class>
     <expiration-cache>-1</expiration-cache>
     <supports>
@@ -87,7 +91,7 @@
   </portlet>
   
   <portlet id="AttributeScopePortlet">
-    <portlet-name>Attribute Scope Demo</portlet-name>
+    <portlet-name>AttributeScopePortlet</portlet-name>
     
<portlet-class>org.apache.jetspeed.demo.simple.AttributeScopeServlet</portlet-class>
     <expiration-cache>-1</expiration-cache>
     <supports>

Modified: 
portals/jetspeed-2/trunk/components/registry/src/java/JETSPEED-INF/ojb/registry_repository.xml
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/JETSPEED-INF/ojb/registry_repository.xml?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/registry/src/java/JETSPEED-INF/ojb/registry_repository.xml
 (original)
+++ 
portals/jetspeed-2/trunk/components/registry/src/java/JETSPEED-INF/ojb/registry_repository.xml
 Thu Jan 25 12:45:04 2007
@@ -161,6 +161,12 @@
          column="APP_TYPE"
          jdbc-type="INTEGER"
       />
+      <field-descriptor
+         name="jetspeedSecurityConstraint"
+         column="SECURITY_REF"
+         jdbc-type="VARCHAR"
+      />
+      
       <collection-descriptor
          name="metadataFields"
          
element-class-ref="org.apache.jetspeed.om.portlet.impl.PortletApplicationLocalizedFieldImpl"
@@ -367,6 +373,12 @@
          column="PREFERENCE_VALIDATOR"
          jdbc-type="VARCHAR"
       />
+       
+      <field-descriptor
+         name="jetspeedSecurityConstraint"
+         column="SECURITY_REF"
+         jdbc-type="VARCHAR"
+      />       
 
       <collection-descriptor
          name="metadataFields"

Modified: 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java
 (original)
+++ 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java
 Thu Jan 25 12:45:04 2007
@@ -338,4 +338,15 @@
     {
         portletDefinition.store();
     }
+    
+    public String getJetspeedSecurityConstraint()
+    {
+        return portletDefinition.getJetspeedSecurityConstraint();
+    }
+
+    public void setJetspeedSecurityConstraint(String constraint)
+    {
+        portletDefinition.setJetspeedSecurityConstraint(constraint);
+    }
+    
 }

Modified: 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
 (original)
+++ 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
 Thu Jan 25 12:45:04 2007
@@ -103,6 +103,8 @@
     private List customPortletModes;
     private List customWindowStates;
     
+    private String jetspeedSecurityConstraint = null;
+    
     private transient Map supportedCustomModes;
     private transient Map supportedCustomStates;
     private transient Map mappedCustomModes;
@@ -588,4 +590,21 @@
         }
         return supportedWindowStates;
     }
+
+    /* (non-Javadoc)
+     * @see 
org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#getJetspeedSecurityConstraint()
+     */
+    public String getJetspeedSecurityConstraint()
+    {
+        return this.jetspeedSecurityConstraint;
+    }
+
+    /* (non-Javadoc)
+     * @see 
org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#setJetspeedSecurityConstraint(java.lang.String)
+     */
+    public void setJetspeedSecurityConstraint(String constraint)
+    {
+        this.jetspeedSecurityConstraint = constraint;
+    }
+    
 }

Modified: 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
 (original)
+++ 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
 Thu Jan 25 12:45:04 2007
@@ -136,6 +136,8 @@
     private Collection metadataFields = null;
     private PrefsPreferenceSetImpl preferenceSet;
 
+    private String jetspeedSecurityConstraint = null;
+    
     public PortletDefinitionImpl()
     {
         super();
@@ -951,5 +953,21 @@
             return portletFactory.getPreferencesValidator(this);
         }
         return null;
+    }
+
+    /* (non-Javadoc)
+     * @see 
org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#getJetspeedSecurityConstraint()
+     */
+    public String getJetspeedSecurityConstraint()
+    {
+        return this.jetspeedSecurityConstraint;
+    }
+
+    /* (non-Javadoc)
+     * @see 
org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite#setJetspeedSecurityConstraint(java.lang.String)
+     */
+    public void setJetspeedSecurityConstraint(String constraint)
+    {
+        this.jetspeedSecurityConstraint = constraint;
     }
 }

Modified: 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/util/ojb/LocaleFieldConversion.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/util/ojb/LocaleFieldConversion.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/util/ojb/LocaleFieldConversion.java
 (original)
+++ 
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/util/ojb/LocaleFieldConversion.java
 Thu Jan 25 12:45:04 2007
@@ -80,25 +80,23 @@
     {
         if (arg0 instanceof String)
         {
-
             String localeString = (String) arg0;
             StringTokenizer tokenizer = new StringTokenizer(localeString, 
DELIM);
-
-            
+            if(tokenizer.hasMoreTokens() == false)            
+            {
+                return JetspeedLocale.getDefaultLocale();    
+            }
             String language = tokenizer.nextToken().trim();
             String country = null;
             String variant = null;
             if(tokenizer.hasMoreTokens())
             {
                 country = tokenizer.nextToken().trim();
-            }
-            
+            }           
             if(tokenizer.hasMoreTokens())
             {
                 variant = tokenizer.nextToken().trim();
             }
-            
-
             if (country != null && language != null && variant != null)
             {
                 return new Locale (language, country, variant);

Modified: portals/jetspeed-2/trunk/etc/schema/registry-schema.xml
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/etc/schema/registry-schema.xml?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- portals/jetspeed-2/trunk/etc/schema/registry-schema.xml (original)
+++ portals/jetspeed-2/trunk/etc/schema/registry-schema.xml Thu Jan 25 12:45:04 
2007
@@ -30,6 +30,7 @@
         <column name="EXPIRATION_CACHE" size="30" type="VARCHAR"/>
         <column name="RESOURCE_BUNDLE" size="255" type="VARCHAR"/>
         <column name="PREFERENCE_VALIDATOR" size="255" type="VARCHAR"/>
+        <column name="SECURITY_REF" size="40" type="VARCHAR"/>        
         <!-- This breaks some tests since portlet identifier is not required
         <unique name="UK_PORTLET_IDENT">
             <unique-column name="PORTLET_IDENTIFIER"/>
@@ -49,6 +50,7 @@
                <column name="CHECKSUM" size="80" type="VARCHAR"/>
         <column name="DESCRIPTION" size="80" type="VARCHAR"/>
         <column name="WEB_APP_ID" required="true" type="INTEGER"/>
+        <column name="SECURITY_REF" size="40" type="VARCHAR"/>
         <unique name="UK_APPLICATION">
             <unique-column name="APP_NAME"/>
         </unique>

Modified: portals/jetspeed-2/trunk/etc/sql/derby/schema/registry-schema.sql
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/etc/sql/derby/schema/registry-schema.sql?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- portals/jetspeed-2/trunk/etc/sql/derby/schema/registry-schema.sql (original)
+++ portals/jetspeed-2/trunk/etc/sql/derby/schema/registry-schema.sql Thu Jan 
25 12:45:04 2007
@@ -12,6 +12,7 @@
     EXPIRATION_CACHE VARCHAR(30),
     RESOURCE_BUNDLE VARCHAR(255),
     PREFERENCE_VALIDATOR VARCHAR(255),
+    SECURITY_REF VARCHAR(40),    
     PRIMARY KEY(ID));
 
 -----------------------------------------------------------------------------
@@ -28,6 +29,7 @@
     CHECKSUM VARCHAR(80),
     DESCRIPTION VARCHAR(80),
     WEB_APP_ID INTEGER NOT NULL,
+    SECURITY_REF VARCHAR(40),        
     PRIMARY KEY(APPLICATION_ID),
     UNIQUE (APP_NAME));
 

Modified: 
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/MutablePortletApplication.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/MutablePortletApplication.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/MutablePortletApplication.java
 (original)
+++ 
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/MutablePortletApplication.java
 Thu Jan 25 12:45:04 2007
@@ -159,4 +159,22 @@
      * @return
      */
     long getChecksum();
+    
+    /**
+     * <p>
+     * Set the Jetspeed Security Constraint reference for this portlet 
application.
+     * This security constraint name references a Jetspeed-specific Security 
Constraint.
+     * Security Constraints are not Java Security Permissions, but a 
+     * Jetspeed specific way of securing portlets, also known as PSML 
constraints.
+     * See the <i>page.security</i> file for examples of defining security 
constraint definitions.
+     * If the portlet application does not define a constraint, then no 
security constraints
+     * will be applied to this portlet. Security constraints for a portlet are 
normally
+     * checking during the render process of a portlet.
+     * </p>
+     * 
+     * @param constraint The name of the Security Definition defined in 
+     *                  the Jetspeed Security Constraints 
+     */
+    void setJetspeedSecurityConstraint(String constraint);
+    
 }

Modified: 
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/PortletApplication.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/PortletApplication.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/PortletApplication.java
 (original)
+++ 
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/PortletApplication.java
 Thu Jan 25 12:45:04 2007
@@ -114,4 +114,23 @@
         
     Collection getSupportedPortletModes();
     Collection getSupportedWindowStates();
+    
+    /**
+     * <p>
+     * Get the Jetspeed Security Constraint reference for this portlet 
application.
+     * This security constraint name references a Jetspeed-specific Security 
Constraint.
+     * Security Constraints are not Java Security Permissions, but a 
+     * Jetspeed specific way of securing portlets, also known as PSML 
constraints.
+     * See the <i>page.security</i> file for examples of defining security 
constraint definitions.
+     * If a Jetspeed Security Constraint is not defined for a portlet, the 
constraint 
+     * applied will then fallback to the constraint defined for the portlet 
application.
+     * If the portlet application does not define a constraint, then no 
security constraints
+     * will be applied to this portlet. Security constraints for a portlet are 
normally
+     * checking during the render process of a portlet.
+     * </p>
+     * 
+     * @return The name of the Security Definition applied to this portlet, 
defined in 
+     *                  the Jetspeed Security Constraints 
+     */    
+    String getJetspeedSecurityConstraint();    
 }

Modified: 
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/PortletDefinitionComposite.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/PortletDefinitionComposite.java?view=diff&rev=499960&r1=499959&r2=499960
==============================================================================
--- 
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/PortletDefinitionComposite.java
 (original)
+++ 
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/portlet/PortletDefinitionComposite.java
 Thu Jan 25 12:45:04 2007
@@ -205,4 +205,39 @@
     
     SecurityRoleRef addSecurityRoleRef(String roleName, String roleLink);
 
+    /**
+     * <p>
+     * Get the Jetspeed Security Constraint reference for this portlet.
+     * This security constraint name references a Jetspeed-specific Security 
Constraint.
+     * Security Constraints are not Java Security Permissions, but a 
+     * Jetspeed specific way of securing portlets, also known as PSML 
constraints.
+     * See the <i>page.security</i> file for examples of defining security 
constraint definitions.
+     * If a Jetspeed Security Constraint is not defined for a portlet, the 
constraint 
+     * applied will then fallback to the constraint defined for the portlet 
application.
+     * If the portlet application does not define a constraint, then no 
security constraints
+     * will be applied to this portlet. Security constraints for a portlet are 
normally
+     * checking during the render process of a portlet.
+     * </p>
+     * 
+     * @return The name of the Security Definition applied to this portlet, 
defined in 
+     *                  the Jetspeed Security Constraints 
+     */    
+    String getJetspeedSecurityConstraint();
+    
+    /**
+     * <p>
+     * Set the Jetspeed Security Constraint reference for this portlet.
+     * This security constraint name references a Jetspeed-specific Security 
Constraint.
+     * Security Constraints are not Java Security Permissions, but a 
+     * Jetspeed specific way of securing portlets, also known as PSML 
constraints.
+     * See the <i>page.security</i> file for examples of defining security 
constraint definitions.
+     * If the portlet application does not define a constraint, then no 
security constraints
+     * will be applied to this portlet. Security constraints for a portlet are 
normally
+     * checking during the render process of a portlet.
+     * </p>
+     * 
+     * @param constraint The name of the Security Definition defined in 
+     *                  the Jetspeed Security Constraints 
+     */
+    void setJetspeedSecurityConstraint(String constraint);
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to