cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r429018 - in /cocoon/trunk/blocks/cocoon-portal: cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/ cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/ cocoon-portal-sample/src/main/resources/COB-...
Date Sat, 05 Aug 2006 17:57:15 GMT
Author: cziegeler
Date: Sat Aug  5 10:57:14 2006
New Revision: 429018

URL: http://svn.apache.org/viewvc?rev=429018&view=rev
Log:
Fix initialization problem and add missing component

Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/coplettype/portal.xml

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java?rev=429018&r1=429017&r2=429018&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
Sat Aug  5 10:57:14 2006
@@ -111,8 +111,6 @@
 
     protected final Map layouts = new HashMap();
 
-    protected Configuration[] layoutsConf;
-
     protected static long idCounter = System.currentTimeMillis();
 
     /** 
@@ -153,7 +151,6 @@
         } else {
             throw new ConfigurationException("Default renderer '" + defaultRenderer + "'
is not configured for layout '" + type + "'");
         }
-
         this.layouts.put(desc.getType(), desc);
     }
 
@@ -162,24 +159,12 @@
      */
     public void configure(Configuration configuration) 
     throws ConfigurationException {
-        this.layoutsConf = configuration.getChild("layouts").getChildren("layout");
-    }
-
-    protected void init() {
-        // FIXME when we switch to another container we can remove
-        //        the lazy evaluation
-        if ( this.layoutsConf != null ) {
-            synchronized (this) {
-                if ( this.layoutsConf != null ) {
-                    for(int i=0; i < layoutsConf.length; i++ ) {
-                        try {
-                            this.configureLayout( layoutsConf[i] );
-                        } catch (ConfigurationException ce) {
-                            throw new PortalRuntimeException("Unable to configure layout.",
ce);
-                        }
-                    }
-                    this.layoutsConf = null;
-                }
+        final Configuration[] layoutsConf = configuration.getChild("layouts").getChildren("layout");
+        for(int i=0; i < layoutsConf.length; i++ ) {
+            try {
+                this.configureLayout( layoutsConf[i] );
+            } catch (ConfigurationException ce) {
+                throw new PortalRuntimeException("Unable to configure layout.", ce);
             }
         }
     }
@@ -197,8 +182,6 @@
      */
     public Layout newInstance(String layoutType, String id) 
     throws LayoutException {
-        this.init();
-
         LayoutDescription layoutDescription = (LayoutDescription)this.layouts.get( layoutType
);
 
         if ( layoutDescription == null ) {
@@ -240,7 +223,6 @@
      */
     public void remove(Layout layout) {
         if ( layout != null ) {
-            this.init();
             if ( layout instanceof CompositeLayout ) {
                 final CompositeLayout cl = (CompositeLayout)layout;
                 while ( cl.getItems().size() > 0 ) {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java?rev=429018&r1=429017&r2=429018&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
Sat Aug  5 10:57:14 2006
@@ -50,6 +50,7 @@
 import org.apache.cocoon.portal.impl.AbstractComponent;
 import org.apache.cocoon.portal.pluto.deployment.Deployer;
 import org.apache.cocoon.portal.pluto.deployment.WebApplicationRewriter;
+import org.apache.commons.lang.StringUtils;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.excalibur.xml.EntityResolver;
@@ -511,7 +512,8 @@
                 // TODO - parse coplet.xml if available
                 final CopletType cbd = pcm.getProfileManager().getCopletType(this.copletBaseDataName);
                 // TODO - check portletId for invalid characters!
-                final CopletDefinition cd = pcm.getCopletFactory().newInstance(cbd, portlet.getId().toString());
+                final String defId = StringUtils.replaceChars(portlet.getId().toString(),
'.', '_');
+                final CopletDefinition cd = pcm.getCopletFactory().newInstance(cbd, defId);
                 cd.setAttribute("portlet", portlet.getId().toString());
                 cd.setAttribute("buffer", Boolean.TRUE);
                 if ( this.getLogger().isInfoEnabled() ) {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/coplettype/portal.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/coplettype/portal.xml?rev=429018&r1=429017&r2=429018&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/coplettype/portal.xml
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/coplettype/portal.xml
Sat Aug  5 10:57:14 2006
@@ -14,14 +14,19 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<!-- SVN $Id$ -->
+<!-- @version $Id$ -->
 <coplets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
    <coplet-type id="URICoplet">
       <coplet-adapter>uri</coplet-adapter>
    </coplet-type>
 
    <coplet-type id="Portlet">
       <coplet-adapter>portlet</coplet-adapter>
+      <configuration>
+      	<name>buffer</name>
+      	<value xsi:type="java:java.lang.Boolean">true</value>
+      </configuration>
       <configuration>
         <name>full-screen</name>
         <value xsi:type="java:java.lang.Boolean">false</value>



Mime
View raw message