incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1405035 - in /sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container: ./ internal/ spi/
Date Fri, 02 Nov 2012 16:25:25 GMT
Author: cziegeler
Date: Fri Nov  2 16:25:24 2012
New Revision: 1405035

URL: http://svn.apache.org/viewvc?rev=1405035&view=rev
Log:
Make portlet title rendering pluggable

Added:
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletTitleRenderer.java
  (with props)
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletPreferencesService.java
  (with props)
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletTitleRenderer.java
  (with props)
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletTitleRendererContext.java
  (with props)
Modified:
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletContainer.java
    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/DefaultPortletContainer.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletContainerImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRenderResponseContextImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PreferencesKeyGenerator.java

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletContainer.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletContainer.java?rev=1405035&r1=1405034&r2=1405035&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletContainer.java
(original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletContainer.java
Fri Nov  2 16:25:24 2012
@@ -18,6 +18,7 @@ package org.apache.sling.portal.containe
 
 import org.apache.pluto.container.PortletContainer;
 import org.apache.sling.portal.container.spi.PortalEventCoordinatorService;
+import org.apache.sling.portal.container.spi.PortletTitleRenderer;
 
 /**
  * This is an extension of the portlet container
@@ -45,4 +46,9 @@ public interface SlingPortletContainer e
      * Get the event coordinator.
      */
     PortalEventCoordinatorService getPortalEventCoordinatorService();
+
+    /**
+     * Get the portlet title renderer
+     */
+    PortletTitleRenderer getPortletTitleRenderer();
 }

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=1405035&r1=1405034&r2=1405035&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
Fri Nov  2 16:25:24 2012
@@ -44,6 +44,7 @@ import org.apache.sling.portal.container
 import org.apache.sling.portal.container.spi.PortalCCPPProfileService;
 import org.apache.sling.portal.container.spi.PortalEventCoordinatorService;
 import org.apache.sling.portal.container.spi.PortalUserInfoService;
+import org.apache.sling.portal.container.spi.PortletTitleRenderer;
 import org.osgi.framework.BundleContext;
 import org.osgi.util.tracker.ServiceTracker;
 
@@ -75,10 +76,12 @@ public class ContainerServicesImpl imple
     private final UserInfoService defaultUserInfoService;
     private final PortalEventCoordinatorService defaultEventCoordinator;
     private final DefaultPortletPreferencesService portletPreferencesService;
+    private final PortletTitleRenderer portletTitleRenderer;
     private final ServiceTracker ccppProfileServiceTracker;
     private final ServiceTracker userInfoServiceTracker;
     private final ServiceTracker eventCoordinatorServiceTracker;
     private final ServiceTracker portletPreferencesServiceTracker;
+    private final ServiceTracker portletTitleRendererTracker;
 
     /**
      * Default Constructor.
@@ -114,8 +117,13 @@ public class ContainerServicesImpl imple
             this.eventCoordinatorServiceTracker.open();
 
             this.portletPreferencesService = new DefaultPortletPreferencesService(repository,
bundleContext);
-            this.portletPreferencesServiceTracker = new ServiceTracker(bundleContext, PortletPreferencesService.class.getName(),
null);
+            this.portletPreferencesServiceTracker = new ServiceTracker(bundleContext, org.apache.sling.portal.container.spi.PortletPreferencesService.class.getName(),
null);
             this.portletPreferencesServiceTracker.open();
+
+            this.portletTitleRenderer = new DefaultPortletTitleRenderer();
+            this.portletTitleRendererTracker = new ServiceTracker(bundleContext, PortletTitleRenderer.class.getName(),
null);
+            this.portletTitleRendererTracker.open();
+
             noErrors = true;
         } finally {
             if ( !noErrors ) {
@@ -146,6 +154,9 @@ public class ContainerServicesImpl imple
         if ( this.portletPreferencesServiceTracker != null ) {
             this.portletPreferencesServiceTracker.close();
         }
+        if ( this.portletTitleRendererTracker != null ) {
+            this.portletTitleRendererTracker.close();
+        }
     }
 
     /**
@@ -259,4 +270,12 @@ public class ContainerServicesImpl imple
         }
         return service;
     }
+
+    public PortletTitleRenderer getPortletTitleRenderer() {
+        PortletTitleRenderer service = (PortletTitleRenderer) this.portletTitleRendererTracker.getService();
+        if ( service == null ) {
+            service = this.portletTitleRenderer;
+        }
+        return service;
+    }
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletContainer.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletContainer.java?rev=1405035&r1=1405034&r2=1405035&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletContainer.java
(original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletContainer.java
Fri Nov  2 16:25:24 2012
@@ -42,6 +42,7 @@ import org.apache.sling.portal.container
 import org.apache.sling.portal.container.cache.Cache;
 import org.apache.sling.portal.container.internal.services.DefaultContainerInfo;
 import org.apache.sling.portal.container.spi.PortalEventCoordinatorService;
+import org.apache.sling.portal.container.spi.PortletTitleRenderer;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
@@ -307,6 +308,9 @@ public class DefaultPortletContainer imp
         return this.portletContainer.getPortletRegistryService();
     }
 
+    /**
+     * @see org.apache.sling.portal.container.SlingPortletContainer#getPortalEventCoordinatorService()
+     */
     public PortalEventCoordinatorService getPortalEventCoordinatorService() {
         try {
             checkInit();
@@ -316,4 +320,17 @@ public class DefaultPortletContainer imp
         }
         return this.portletContainer.getPortalEventCoordinatorService();
     }
+
+    /**
+     * @see org.apache.sling.portal.container.SlingPortletContainer#getPortletTitleRenderer()
+     */
+    public PortletTitleRenderer getPortletTitleRenderer() {
+        try {
+            checkInit();
+        } catch (final PortletContainerException e) {
+            logger.error("Unable to start portlet container", e);
+            return null;
+        }
+        return this.portletContainer.getPortletTitleRenderer();
+    }
 }

Added: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletTitleRenderer.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletTitleRenderer.java?rev=1405035&view=auto
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletTitleRenderer.java
(added)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletTitleRenderer.java
Fri Nov  2 16:25:24 2012
@@ -0,0 +1,75 @@
+/*
+ * 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.io.PrintWriter;
+
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+
+import org.apache.sling.portal.container.spi.PortletTitleRenderer;
+import org.apache.sling.portal.container.spi.PortletTitleRendererContext;
+
+public class DefaultPortletTitleRenderer implements PortletTitleRenderer {
+
+    private void writeModeLink(final PrintWriter pw, final PortletTitleRendererContext context,
final PortletMode mode) {
+        pw.write("<div class='portlet-icon' style='float:left; padding: 2px;'>");
+        if ( context.getSupportedModes().contains(mode) && !mode.equals(context.getPortletWindow().getPortletMode()))
{
+            pw.write("<a href='");
+            final String url = context.createPortletURL(mode, null);
+            pw.write(url);
+            pw.write("'>");
+            pw.write(mode.toString());
+            pw.write("</a>");
+        }
+        pw.write("</div>");
+    }
+
+    private void writeStateLink(final PrintWriter pw, final PortletTitleRendererContext context,
final WindowState state) {
+        pw.write("<div class='portlet-icon' style='float:left; padding: 2px;'>");
+        pw.write("<a href='");
+        final String url = context.createPortletURL(null, state);
+        pw.write(url);
+        pw.write("'>");
+        pw.write(state.toString());
+        pw.write("</a>");
+        pw.write("</div>");
+    }
+
+    /**
+     * @see org.apache.sling.portal.container.spi.PortletTitleRenderer#render(java.io.PrintWriter,
org.apache.sling.portal.container.spi.PortletTitleRendererContext)
+     */
+    public void render(final PrintWriter pw, final PortletTitleRendererContext context) {
+        pw.write("<div class='portlet-header'><div class='portlet-title' style='float:left'>");
+        pw.write(context.getTitle());
+        pw.write("</div>");
+        pw.write("<div class='portlet-icons' style='float:right'>");
+
+        this.writeModeLink(pw, context, PortletMode.VIEW);
+        this.writeModeLink(pw, context, PortletMode.HELP);
+        this.writeModeLink(pw, context, PortletMode.EDIT);
+        if ( context.getPortletWindow().getWindowState().equals(WindowState.NORMAL) ) {
+            this.writeStateLink(pw, context, WindowState.MINIMIZED);
+            this.writeStateLink(pw, context, WindowState.MAXIMIZED);
+        } else if ( context.getPortletWindow().getWindowState().equals(WindowState.MINIMIZED))
{
+            this.writeStateLink(pw, context, WindowState.NORMAL);
+        } else {
+            this.writeStateLink(pw, context, WindowState.NORMAL);
+        }
+        pw.write("</div></div>");
+    }
+}

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

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

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

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletContainerImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletContainerImpl.java?rev=1405035&r1=1405034&r2=1405035&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletContainerImpl.java
(original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletContainerImpl.java
Fri Nov  2 16:25:24 2012
@@ -39,6 +39,7 @@ import org.apache.sling.portal.container
 import org.apache.sling.portal.container.cache.CacheValue;
 import org.apache.sling.portal.container.internal.impl.PortletContentImpl;
 import org.apache.sling.portal.container.spi.PortalEventCoordinatorService;
+import org.apache.sling.portal.container.spi.PortletTitleRenderer;
 
 /**
  *  This is the portlet container implementation based on the Pluto default
@@ -71,6 +72,7 @@ public class PortletContainerImpl
     /**
      * @see org.apache.pluto.container.impl.PortletContainerImpl#destroy()
      */
+    @Override
     public void destroy() {
         PortletApplicationRegistry.getContainerPortletRegistry().removeListener(this.registry);
         super.destroy();
@@ -80,6 +82,7 @@ public class PortletContainerImpl
     /**
      * @see org.apache.pluto.container.impl.PortletContainerImpl#init()
      */
+    @Override
     public void init() throws PortletContainerException {
         super.init();
         PortletApplicationRegistry.getContainerPortletRegistry().addListener(this.registry);
@@ -106,6 +109,14 @@ public class PortletContainerImpl
         return ((ContainerServicesImpl)this.getContainerServices()).getPortalEventCoordinatorService();
     }
 
+    /**
+     * @see org.apache.sling.portal.container.SlingPortletContainer#getPortletTitleRenderer()
+     */
+    public PortletTitleRenderer getPortletTitleRenderer() {
+        return ((ContainerServicesImpl)this.getContainerServices()).getPortletTitleRenderer();
+    }
+
+    @Override
     public void doRender(final PortletWindow portletWindow,
     		final HttpServletRequest request,
     		final HttpServletResponse response)
@@ -137,6 +148,7 @@ public class PortletContainerImpl
 
 
     //TODO change me
+    @Override
     public void doLoad(final PortletWindow portletWindow,
     		final HttpServletRequest request,
     		final HttpServletResponse response)

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRenderResponseContextImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRenderResponseContextImpl.java?rev=1405035&r1=1405034&r2=1405035&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRenderResponseContextImpl.java
(original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRenderResponseContextImpl.java
Fri Nov  2 16:25:24 2012
@@ -38,6 +38,8 @@ import org.apache.sling.portal.container
 import org.apache.sling.portal.container.SlingPortletContainer;
 import org.apache.sling.portal.container.SlingPortletWindow;
 import org.apache.sling.portal.container.internal.request.PortalURL;
+import org.apache.sling.portal.container.spi.PortletTitleRenderer;
+import org.apache.sling.portal.container.spi.PortletTitleRendererContext;
 
 /**
  * Implementation of the portlet render response context.
@@ -49,6 +51,7 @@ public class PortletRenderResponseContex
     implements PortletRenderResponseContext {
 
     private static final String REG_ATTR_WRITTEN = PortletRenderResponseContextImpl.class.getName()
+ "/written/";
+
     /** The title set by the portlet. */
     private String title;
 
@@ -57,8 +60,8 @@ public class PortletRenderResponseContex
 
     private final boolean writeTitle;
 
-    private  PortletContent portletContent; 
-    
+    private  PortletContent portletContent;
+
     public PortletRenderResponseContextImpl(final SlingPortletContainer container,
                     final HttpServletRequest containerRequest,
                     final HttpServletResponse containerResponse,
@@ -115,34 +118,6 @@ public class PortletRenderResponseContex
         this.title = title;
     }
 
-    protected void writeModeLink(final PrintWriter pw, final Collection<PortletMode>
modes, final PortletMode mode) {
-        final String windowId = this.getPortletWindow().getId().getStringId();
-        pw.write("<div class='portlet-icon' style='float:left; padding: 2px;'>");
-        if ( modes.contains(mode) && !mode.equals(this.getPortletWindow().getPortletMode()))
{
-            pw.write("<a href='");
-            final PortalURL url = this.getPortalURL().clone();
-            url.setPortletMode(windowId, mode);
-            pw.write(url.toURL(false));
-            pw.write("'>");
-            pw.write(mode.toString());
-            pw.write("</a>");
-        }
-        pw.write("</div>");
-    }
-
-    protected void writeStateLink(final PrintWriter pw, final WindowState state) {
-        final String windowId = this.getPortletWindow().getId().getStringId();
-        pw.write("<div class='portlet-icon' style='float:left; padding: 2px;'>");
-        pw.write("<a href='");
-        final PortalURL url = this.getPortalURL().clone();
-        url.setWindowState(windowId, state);
-        pw.write(url.toURL(false));
-        pw.write("'>");
-        pw.write(state.toString());
-        pw.write("</a>");
-        pw.write("</div>");
-    }
-
     protected void drawWindowTitle(final PrintWriter pw) {
         if ( !writeTitle ) {
             return;
@@ -151,10 +126,7 @@ public class PortletRenderResponseContex
             return;
         }
         this.getContainerRequest().setAttribute(REG_ATTR_WRITTEN + this.getPortletWindow().getId().getStringId(),
Boolean.TRUE);
-        pw.write("<div class='portlet-header'><div class='portlet-title' style='float:left'>");
-        pw.write(this.title);
-        pw.write("</div>");
-        pw.write("<div class='portlet-icons' style='float:right'>");
+
         Collection<PortletMode> modes = this.portletModes;
         if ( modes == null ) {
             modes = new ArrayList<PortletMode>();
@@ -173,18 +145,34 @@ public class PortletRenderResponseContex
                 }
             }
         }
-        this.writeModeLink(pw, modes, PortletMode.VIEW);
-        this.writeModeLink(pw, modes, PortletMode.HELP);
-        this.writeModeLink(pw, modes, PortletMode.EDIT);
-        if ( this.getPortletWindow().getWindowState().equals(WindowState.NORMAL) ) {
-            this.writeStateLink(pw, WindowState.MINIMIZED);
-            this.writeStateLink(pw, WindowState.MAXIMIZED);
-        } else if ( this.getPortletWindow().getWindowState().equals(WindowState.MINIMIZED))
{
-            this.writeStateLink(pw, WindowState.NORMAL);
-        } else {
-            this.writeStateLink(pw, WindowState.NORMAL);
-        }
-        pw.write("</div></div>");
+        final Collection<PortletMode> supportedModes = modes;
+
+        final PortletTitleRenderer renderer = ((SlingPortletContainer)this.getContainer()).getPortletTitleRenderer();
+        renderer.render(pw, new PortletTitleRendererContext() {
+
+            public String getTitle() {
+                return title;
+            }
+
+            public Collection<PortletMode> getSupportedModes() {
+                return supportedModes;
+            }
+
+            public SlingPortletWindow getPortletWindow() {
+                return this.getPortletWindow();
+            }
+
+            public String createPortletURL(final PortletMode newMode, final WindowState newState)
{
+                final PortalURL url = getPortalURL().clone();
+                if ( newMode != null ) {
+                    url.setPortletMode(getPortletWindow().getId().getStringId(), newMode);
+                }
+                if ( newState != null ) {
+                    url.setWindowState(getPortletWindow().getId().getStringId(), newState);
+                }
+                return url.toURL(false);
+            }
+        });
     }
 
     @Override
@@ -201,5 +189,4 @@ public class PortletRenderResponseContex
     	this.drawWindowTitle(new PrintWriter(new OutputStreamWriter(os, getServletResponse().getCharacterEncoding())));
     	return os;
     }
-
 }

Added: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletPreferencesService.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletPreferencesService.java?rev=1405035&view=auto
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletPreferencesService.java
(added)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletPreferencesService.java
Fri Nov  2 16:25:24 2012
@@ -0,0 +1,25 @@
+/*
+ * 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.spi;
+
+/**
+ * Optional service for preference handling
+ */
+public interface PortletPreferencesService extends org.apache.pluto.container.PortletPreferencesService
{
+
+    // marker service
+}

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

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

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

Added: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletTitleRenderer.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletTitleRenderer.java?rev=1405035&view=auto
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletTitleRenderer.java
(added)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletTitleRenderer.java
Fri Nov  2 16:25:24 2012
@@ -0,0 +1,27 @@
+/*
+ * 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.spi;
+
+import java.io.PrintWriter;
+
+/**
+ * Optional service for rendering the title bar.
+ */
+public interface PortletTitleRenderer {
+
+    void render(PrintWriter pw, PortletTitleRendererContext context);
+}

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

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

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

Added: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletTitleRendererContext.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletTitleRendererContext.java?rev=1405035&view=auto
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletTitleRendererContext.java
(added)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortletTitleRendererContext.java
Fri Nov  2 16:25:24 2012
@@ -0,0 +1,35 @@
+/*
+ * 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.spi;
+
+import java.util.Collection;
+
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+
+import org.apache.sling.portal.container.SlingPortletWindow;
+
+public interface PortletTitleRendererContext {
+
+    SlingPortletWindow getPortletWindow();
+
+    String getTitle();
+
+    Collection<PortletMode> getSupportedModes();
+
+    String createPortletURL(PortletMode newMode, WindowState newState);
+}

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

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

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

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PreferencesKeyGenerator.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PreferencesKeyGenerator.java?rev=1405035&r1=1405034&r2=1405035&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PreferencesKeyGenerator.java
(original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PreferencesKeyGenerator.java
Fri Nov  2 16:25:24 2012
@@ -27,8 +27,9 @@ public interface PreferencesKeyGenerator
 
     /**
      * Return a key for the preferences.
-     * This key can be hierarchical and therefore contain slashes, but it
-     * must not start with a slash.
+     * This key can be hierarchical and therefore contain slashes. If it's absolute
+     * this key is used as is, if it's relative the preferences service will add a default
+     * prefix.
      * @return A preferences key or null if preferences reading/storing
      *         is not supported for this window/user
      */



Mime
View raw message