incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1362819 - in /sling/whiteboard/portal/container: ./ src/main/java/org/apache/sling/portal/container/internal/ src/main/java/org/apache/sling/portal/container/spi/
Date Wed, 18 Jul 2012 09:00:34 GMT
Author: cziegeler
Date: Wed Jul 18 09:00:34 2012
New Revision: 1362819

URL: http://svn.apache.org/viewvc?rev=1362819&view=rev
Log:
Correct method name, put default impl into separate class

Added:
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortalEventCoordinatorService.java
  (with props)
Modified:
    sling/whiteboard/portal/container/pom.xml
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ContainerServicesImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventCoordinationServiceImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortalEventCoordinatorService.java

Modified: sling/whiteboard/portal/container/pom.xml
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/pom.xml?rev=1362819&r1=1362818&r2=1362819&view=diff
==============================================================================
--- sling/whiteboard/portal/container/pom.xml (original)
+++ sling/whiteboard/portal/container/pom.xml Wed Jul 18 09:00:34 2012
@@ -28,7 +28,7 @@
 
     <groupId>org.apache.sling.portal</groupId>
     <artifactId>org.apache.sling.portal.container</artifactId>
-    <version>0.5.0-SNAPSHOT</version>
+    <version>0.6.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Portal Container</name>

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ContainerServicesImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ContainerServicesImpl.java?rev=1362819&r1=1362818&r2=1362819&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ContainerServicesImpl.java
(original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ContainerServicesImpl.java
Wed Jul 18 09:00:34 2012
@@ -16,10 +16,6 @@
  */
 package org.apache.sling.portal.container.internal;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 import javax.portlet.PortalContext;
 
 import org.apache.pluto.container.CCPPProfileService;
@@ -37,12 +33,9 @@ import org.apache.pluto.container.Reques
 import org.apache.pluto.container.UserInfoService;
 import org.apache.pluto.container.impl.PortletEnvironmentServiceImpl;
 import org.apache.pluto.container.impl.RequestDispatcherServiceImpl;
-import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.portal.container.PortletRegistryService;
 import org.apache.sling.portal.container.PortletWindowManager;
-import org.apache.sling.portal.container.SlingPortletEntity;
-import org.apache.sling.portal.container.SlingPortletWindow;
 import org.apache.sling.portal.container.internal.services.DefaultNamespaceMapper;
 import org.apache.sling.portal.container.internal.services.DefaultPortletInvokerService;
 import org.apache.sling.portal.container.internal.services.DefaultPortletPreferencesService;
@@ -116,19 +109,7 @@ public class ContainerServicesImpl imple
             this.userInfoServiceTracker = new ServiceTracker(bundleContext, PortalUserInfoService.class.getName(),
null);
             this.userInfoServiceTracker.open();
 
-            this.defaultEventCoordinator = new PortalEventCoordinatorService() {
-
-                public List<SlingPortletWindow> getPortletWindow(final SlingHttpServletRequest
request) {
-                    final List<SlingPortletWindow> windows = new ArrayList<SlingPortletWindow>();
-                    final Iterator<SlingPortletEntity> i = registry.getPortletEntities();
-                    while ( i.hasNext() ) {
-                        final SlingPortletEntity entity = i.next();
-                        windows.add(windowManager.getPortletWindow(entity.getPortletEntityId(),
null, null));
-                    }
-
-                    return windows;
-                }
-            };
+            this.defaultEventCoordinator = new DefaultPortalEventCoordinatorService(registry,
windowManager);
             this.eventCoordinatorServiceTracker = new ServiceTracker(bundleContext, PortalEventCoordinatorService.class.getName(),
null);
             this.eventCoordinatorServiceTracker.open();
             noErrors = true;

Added: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortalEventCoordinatorService.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortalEventCoordinatorService.java?rev=1362819&view=auto
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortalEventCoordinatorService.java
(added)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortalEventCoordinatorService.java
Wed Jul 18 09:00:34 2012
@@ -0,0 +1,58 @@
+/*
+ * 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.sling.portal.container.internal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.portal.container.PortletRegistryService;
+import org.apache.sling.portal.container.PortletWindowManager;
+import org.apache.sling.portal.container.SlingPortletEntity;
+import org.apache.sling.portal.container.SlingPortletWindow;
+import org.apache.sling.portal.container.spi.PortalEventCoordinatorService;
+
+/**
+ * Default implementation just returning all portlet entities.
+ */
+public class DefaultPortalEventCoordinatorService implements PortalEventCoordinatorService
{
+
+    private final PortletRegistryService registry;
+
+    private final PortletWindowManager windowManager;
+
+    public DefaultPortalEventCoordinatorService(final PortletRegistryService registry,
+                    final PortletWindowManager windowManager) {
+        this.registry = registry;
+        this.windowManager = windowManager;
+    }
+
+    /**
+     * @see org.apache.sling.portal.container.spi.PortalEventCoordinatorService#getPortletWindows(org.apache.sling.api.SlingHttpServletRequest)
+     */
+    public List<SlingPortletWindow> getPortletWindows(final SlingHttpServletRequest
request) {
+        final List<SlingPortletWindow> windows = new ArrayList<SlingPortletWindow>();
+        final Iterator<SlingPortletEntity> i = registry.getPortletEntities();
+        while ( i.hasNext() ) {
+            final SlingPortletEntity entity = i.next();
+            windows.add(windowManager.getPortletWindow(entity.getPortletEntityId(), null,
null));
+        }
+
+        return windows;
+    }
+}

Propchange: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortalEventCoordinatorService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortalEventCoordinatorService.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Propchange: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortalEventCoordinatorService.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventCoordinationServiceImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventCoordinationServiceImpl.java?rev=1362819&r1=1362818&r2=1362819&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventCoordinationServiceImpl.java
(original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventCoordinationServiceImpl.java
Wed Jul 18 09:00:34 2012
@@ -76,7 +76,7 @@ public class EventCoordinationServiceImp
             windows = (List<SlingPortletWindow>)windowsObj;
         } else {
             final PortalEventCoordinatorService pecs = portletContainer.getPortalEventCoordinatorService();
-            windows = pecs.getPortletWindow(PortalUtil.getSlingHttpServletRequest(request));
+            windows = pecs.getPortletWindows(PortalUtil.getSlingHttpServletRequest(request));
             request.setAttribute(ATTR_WINDOWS, windows);
         }
 

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortalEventCoordinatorService.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortalEventCoordinatorService.java?rev=1362819&r1=1362818&r2=1362819&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortalEventCoordinatorService.java
(original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortalEventCoordinatorService.java
Wed Jul 18 09:00:34 2012
@@ -22,7 +22,7 @@ import org.apache.sling.api.SlingHttpSer
 import org.apache.sling.portal.container.SlingPortletWindow;
 
 /**
- * Required service for event delivery
+ * Optional service for event delivery.
  */
 public interface PortalEventCoordinatorService {
 
@@ -30,5 +30,5 @@ public interface PortalEventCoordinatorS
      * Return all portlet window's that might get events for the current request.
      * @return List of portlet window ids - list might be empty - but not <code>null</code>
      */
-    List<SlingPortletWindow> getPortletWindow(final SlingHttpServletRequest request);
+    List<SlingPortletWindow> getPortletWindows(final SlingHttpServletRequest request);
 }



Mime
View raw message