portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r482818 - in /portals/jetspeed-2/trunk: components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ components/registry/src/java/org/apache/jetspeed/om/impl/ src/webapp/WEB-INF/assembly/ src/webapp/WEB-INF/pages/Administrative/
Date Tue, 05 Dec 2006 22:54:15 GMT
Author: taylor
Date: Tue Dec  5 14:54:14 2006
New Revision: 482818

URL: http://svn.apache.org/viewvc?view=rev&rev=482818
Log:
https://issues.apache.org/jira/browse/JS2-306
New implementation of Site Manager portlet

Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/LanguageSetImpl.java
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/site.psml

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java?view=diff&rev=482818&r1=482817&r2=482818
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java
Tue Dec  5 14:54:14 2006
@@ -16,18 +16,16 @@
 package org.apache.jetspeed.om.page.psml;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.om.common.SecurityConstraints;
-import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.PageSecurity;
 import org.apache.jetspeed.om.page.SecurityConstraintImpl;
 import org.apache.jetspeed.om.page.SecurityConstraintsDef;
-import org.apache.jetspeed.page.PageNotFoundException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 /**
  * <p>
@@ -88,6 +86,10 @@
      */
     public List getSecurityConstraints()
     {
+        if (this.constraints == null)
+        {
+            this.constraints = Collections.synchronizedList(new ArrayList());
+        }                
         return constraints;
     }
     
@@ -100,7 +102,7 @@
      * @param constraints
      */
     public void setSecurityConstraints(List constraints)
-    {
+    {        
         this.constraints = constraints;
     }
 
@@ -114,6 +116,10 @@
      */
     public List getSecurityConstraintsRefs()
     {
+        if (this.constraintsRefs == null)
+        {
+            this.constraintsRefs = Collections.synchronizedList(new ArrayList());
+        }        
         return constraintsRefs;
     }
     
@@ -241,7 +247,7 @@
         }
 
         // construct new ordered security constraints list
-        allConstraints = new ArrayList(8);
+        allConstraints = Collections.synchronizedList(new ArrayList(8));
 
         // add any defined security constraints
         if (constraints != null)
@@ -302,7 +308,7 @@
                 {
                     if (constraints == null)
                     {
-                        constraints = new ArrayList(constraintsRefs.size());
+                        constraints = Collections.synchronizedList(new ArrayList(constraintsRefs.size()));
                     }
                     constraints.addAll(securityConstraintsDef.getSecurityConstraints());
                 }

Modified: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/LanguageSetImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/LanguageSetImpl.java?view=diff&rev=482818&r1=482817&r2=482818
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/LanguageSetImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/LanguageSetImpl.java
Tue Dec  5 14:54:14 2006
@@ -18,6 +18,7 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Locale;
@@ -57,8 +58,8 @@
     }
 
     public LanguageSetImpl()
-    {
-        this(new ArrayList());
+    {        
+        this(Collections.synchronizedList(new ArrayList()));
     }
 
     /**
@@ -75,13 +76,15 @@
     public Iterator getLocales()
     {
         HashSet localSet = new HashSet();
-        Iterator itr = innerCollection.iterator();
-        while (itr.hasNext())
+        synchronized (innerCollection)
         {
-            Language lang = (Language) itr.next();
-            localSet.add(lang.getLocale());
+            Iterator itr = innerCollection.iterator();
+            while (itr.hasNext())
+            {
+                Language lang = (Language) itr.next();
+                localSet.add(lang.getLocale());
+            }
         }
-
         return localSet.iterator();
     }
 
@@ -91,26 +94,28 @@
     public Language get( Locale locale )
     {
         LanguageImpl fallback = null;
-        Iterator searchItr = innerCollection.iterator();
-        while (searchItr.hasNext())
+        synchronized(innerCollection)
         {
-            LanguageImpl lang = (LanguageImpl)searchItr.next();
-
-            if (lang.getLocale().equals(locale))
+            Iterator searchItr = innerCollection.iterator();
+            while (searchItr.hasNext())
             {
-                if (resources != null && lang.getParentResourceBundle() == null)
+                LanguageImpl lang = (LanguageImpl)searchItr.next();
+    
+                if (lang.getLocale().equals(locale))
                 {
-                    lang.setResourceBundle(loadResourceBundle(lang.getLocale()));
+                    if (resources != null && lang.getParentResourceBundle() == null)
+                    {
+                        lang.setResourceBundle(loadResourceBundle(lang.getLocale()));
+                    }
+                    return lang;
                 }
-                return lang;
-            }
-            else if (lang.getLocale().getLanguage().equals(locale.getLanguage()))
-            {
-                fallback = lang;
+                else if (lang.getLocale().getLanguage().equals(locale.getLanguage()))
+                {
+                    fallback = lang;
+                }
+    
             }
-
         }
-        
         if ( fallback == null )
         {
             if ( getDefaultLocale().equals(locale) )
@@ -165,14 +170,17 @@
                 ((MutableLanguage) o).setLocale(getDefaultLocale());
             }
 
-            Iterator ite = innerCollection.iterator();
-            while (ite.hasNext())
+            synchronized (innerCollection)
             {
-                Language lang = (Language) ite.next();
-                if (lang.equals(language))
+                Iterator ite = innerCollection.iterator();
+                while (ite.hasNext())
                 {
-                    innerCollection.remove(lang);
-                    return innerCollection.add(o);
+                    Language lang = (Language) ite.next();
+                    if (lang.equals(language))
+                    {
+                        innerCollection.remove(lang);
+                        return innerCollection.add(o);
+                    }
                 }
             }
             return innerCollection.add(o);

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml?view=diff&rev=482818&r1=482817&r2=482818
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml Tue Dec  5 14:54:14
2006
@@ -288,7 +288,23 @@
         <ref bean="PortletActionSecurityBehavior"/>        
     </constructor-arg>    		        
 </bean>
-    
+
+<bean id="AjaxGetFolderList"
+    class="org.apache.jetspeed.layout.impl.GetFolderListAction">
+    <constructor-arg index="0">
+        <value>org/apache/jetspeed/layout/ajax-xml/getfolderlist.vm</value>
+    </constructor-arg>
+    <constructor-arg index="1">
+        <value>org/apache/jetspeed/layout/ajax-xml/error.vm</value>
+    </constructor-arg>
+    <constructor-arg index='2'>
+        <ref bean="org.apache.jetspeed.page.PageManager"/>        
+    </constructor-arg>
+    <constructor-arg index='3'>
+        <ref bean="PortletActionSecurityBehavior"/>        
+    </constructor-arg>    		        
+</bean>
+        
 <bean id="AjaxGetThemes"
     class="org.apache.jetspeed.layout.impl.GetThemesAction">
     <constructor-arg index="0">
@@ -416,7 +432,46 @@
         <ref bean="org.apache.jetspeed.page.PageManager"/>        
     </constructor-arg>    
 </bean>
-        
+
+<bean id="AjaxUpdateFolder"
+    class="org.apache.jetspeed.layout.impl.UpdateFolderAction">
+    <constructor-arg index="0">
+        <value>org/apache/jetspeed/layout/ajax-xml/constraints.vm</value>
+    </constructor-arg>
+    <constructor-arg index="1">
+        <value>org/apache/jetspeed/layout/ajax-xml/error.vm</value>
+    </constructor-arg>
+    <constructor-arg index='2'>    
+        <ref bean="org.apache.jetspeed.page.PageManager"/>        
+    </constructor-arg>    
+</bean>
+
+<bean id="AjaxUpdatePage"
+    class="org.apache.jetspeed.layout.impl.UpdatePageAction">
+    <constructor-arg index="0">
+        <value>org/apache/jetspeed/layout/ajax-xml/constraints.vm</value>
+    </constructor-arg>
+    <constructor-arg index="1">
+        <value>org/apache/jetspeed/layout/ajax-xml/error.vm</value>
+    </constructor-arg>
+    <constructor-arg index='2'>    
+        <ref bean="org.apache.jetspeed.page.PageManager"/>        
+    </constructor-arg>    
+</bean>
+                
+<bean id="AjaxUpdateLink"
+    class="org.apache.jetspeed.layout.impl.UpdateLinkAction">
+    <constructor-arg index="0">
+        <value>org/apache/jetspeed/layout/ajax-xml/constraints.vm</value>
+    </constructor-arg>
+    <constructor-arg index="1">
+        <value>org/apache/jetspeed/layout/ajax-xml/error.vm</value>
+    </constructor-arg>
+    <constructor-arg index='2'>    
+        <ref bean="org.apache.jetspeed.page.PageManager"/>        
+    </constructor-arg>    
+</bean>
+    
 <bean id="AjaxActionMap" class="java.util.HashMap">
     <constructor-arg index="0">
         <map>
@@ -459,6 +514,9 @@
             <entry key="getlink">
                 <ref bean="AjaxGetLink"/>
             </entry>			                        
+            <entry key="getfolderlist">
+                <ref bean="AjaxGetFolderList"/>
+            </entry>			                        
             <entry key="getthemes">
                 <ref bean="AjaxGetThemes"/>
             </entry>
@@ -479,7 +537,16 @@
             </entry>			                        
             <entry key="constraints">
                 <ref bean="AjaxSecurityConstraints"/>
-            </entry>			                                    
+            </entry>			          
+            <entry key="updatefolder">
+                <ref bean="AjaxUpdateFolder"/>                
+            </entry>                          
+            <entry key="updatepage">
+                <ref bean="AjaxUpdatePage"/>                
+            </entry>              
+            <entry key="updatelink">
+                <ref bean="AjaxUpdateLink"/>                
+            </entry>                                                              
         </map>
     </constructor-arg>    
 </bean>    

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/site.psml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/site.psml?view=diff&rev=482818&r1=482817&r2=482818
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/site.psml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/site.psml Tue Dec  5
14:54:14 2006
@@ -25,14 +25,8 @@
   <metadata name="title" xml:lang="zh-TW">Portal頁面管理</metadata>
       
 
-  <fragment id="js-site" type="layout" name="jetspeed-layouts::VelocityTwoColumns2575">
-    <fragment id="pdb-1" type="portlet" name="j2-admin::PortalSiteBrowser" >
-      <property layout="TwoColumns" name="row" value="0" />
-      <property layout="TwoColumns" name="column" value="0" />
-    </fragment>
-    <fragment id="psd-1" type="portlet" name="j2-admin::PortalSiteDetail" >
-      <property layout="TwoColumns" name="row" value="0" />
-      <property layout="TwoColumns" name="column" value="1" />
+  <fragment id="js-site2" type="layout" name="jetspeed-layouts::VelocityOneColumn">
+    <fragment id="psm-10" type="portlet" name="j2-admin::PortalSiteManager" >
     </fragment>
   </fragment>
 </page>



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