portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r707545 - in /portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl: PortletConfigImpl.java PortletContextImpl.java
Date Fri, 24 Oct 2008 05:08:40 GMT
Author: taylor
Date: Thu Oct 23 22:08:40 2008
New Revision: 707545

URL: http://svn.apache.org/viewvc?rev=707545&view=rev
Log:
https://issues.apache.org/jira/browse/PLUTO-481
making context and config impls extendable

Modified:
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java?rev=707545&r1=707544&r2=707545&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java
(original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java
Thu Oct 23 22:08:40 2008
@@ -48,24 +48,24 @@
     /**
      * The servlet config for which we exist.
      */
-    private ServletConfig servletConfig;
+    protected ServletConfig servletConfig;
 
     /**
      * The Portlet Application Context within which we exist.
      */
-    private PortletContext portletContext;
+    protected PortletContext portletContext;
 
     /**
      * The portlet descriptor.
      */
-    protected PortletDefinition portletDD;
+    protected PortletDefinition portlet;
     
     /**
      * The portlet application descriptor.
      */
-    private PortletApplicationDefinition portletAppDD;
+    protected PortletApplicationDefinition portletApp;
 
-    private ResourceBundleFactory bundles;
+    protected ResourceBundleFactory bundles;
 
     public PortletConfigImpl(ServletConfig servletConfig,
                              PortletContext portletContext,
@@ -73,12 +73,12 @@
                              PortletApplicationDefinition portletAppDD) {
         this.servletConfig = servletConfig;
         this.portletContext = portletContext;
-        this.portletDD = portletDD;
-        this.portletAppDD = portletAppDD;
+        this.portlet = portletDD;
+        this.portletApp = portletAppDD;
     }
 
     public String getPortletName() {
-        return portletDD.getPortletName();
+        return portlet.getPortletName();
     }
 
     public PortletContext getPortletContext() {
@@ -90,7 +90,7 @@
             LOG.debug("Resource Bundle requested: "+locale);
         }
         if (bundles == null) {
-            bundles = new ResourceBundleFactory(portletDD);
+            bundles = new ResourceBundleFactory(portlet);
         }
         return bundles.getResourceBundle(locale);
     }
@@ -100,7 +100,7 @@
             throw new IllegalArgumentException("Parameter name == null");
         }
 
-        Iterator<? extends InitParam> parms = portletDD.getInitParams().iterator();
+        Iterator<? extends InitParam> parms = portlet.getInitParams().iterator();
         while(parms.hasNext()) {
             InitParam param = parms.next();
             if (param.getParamName().equals(name)) {
@@ -113,7 +113,7 @@
     public Enumeration<String> getInitParameterNames() {
         return new java.util.Enumeration<String>() {
             private Iterator<InitParam> iterator =
-                new ArrayList<InitParam>(portletDD.getInitParams()).iterator();
+                new ArrayList<InitParam>(portlet.getInitParams()).iterator();
 
             public boolean hasMoreElements() {
                 return iterator.hasNext();
@@ -134,28 +134,28 @@
     }
 
     public PortletDefinition getPortletDefinition() {
-        return portletDD;
+        return portlet;
     }
     // --------------------------------------------------------------------------------------------
 
 	public Enumeration<String> getPublicRenderParameterNames() {
-		if (portletDD.getSupportedPublicRenderParameters() != null){
-			return Collections.enumeration(portletDD.getSupportedPublicRenderParameters());
+		if (portlet.getSupportedPublicRenderParameters() != null){
+			return Collections.enumeration(portlet.getSupportedPublicRenderParameters());
 		}
 		return  Collections.enumeration(new ArrayList<String>());
 	}
 
 	public String getDefaultNamespace() {
-		if (portletAppDD.getDefaultNamespace() == null)
+		if (portletApp.getDefaultNamespace() == null)
 			return XMLConstants.NULL_NS_URI;
-		return portletAppDD.getDefaultNamespace();
+		return portletApp.getDefaultNamespace();
 	}
 
 	public Enumeration<QName> getProcessingEventQNames() {
 	    ArrayList<QName> qnameList = new ArrayList<QName>();
-        for (EventDefinitionReference ref : portletDD.getSupportedProcessingEvents())
+        for (EventDefinitionReference ref : portlet.getSupportedProcessingEvents())
         {
-            QName name = ref.getQualifiedName(portletAppDD.getDefaultNamespace());
+            QName name = ref.getQualifiedName(portletApp.getDefaultNamespace());
             if (name == null)
             {
                 continue;
@@ -170,9 +170,9 @@
 
 	public Enumeration<QName> getPublishingEventQNames() {
         ArrayList<QName> qnameList = new ArrayList<QName>();
-        for (EventDefinitionReference ref : portletDD.getSupportedPublishingEvents())
+        for (EventDefinitionReference ref : portlet.getSupportedPublishingEvents())
         {
-            QName name = ref.getQualifiedName(portletAppDD.getDefaultNamespace());
+            QName name = ref.getQualifiedName(portletApp.getDefaultNamespace());
             if (name == null)
             {
                 continue;
@@ -189,7 +189,7 @@
 		// for each String entry in SupportedLocales (portletDD)
 		// add an entry in the resut list (new Locale(string))
 		List<Locale> locals = new ArrayList<Locale>();
-		List<String> localsAsStrings = portletDD.getSupportedLocales();
+		List<String> localsAsStrings = portlet.getSupportedLocales();
 		if (localsAsStrings!=null){
 			for (String string : localsAsStrings) {
 				locals.add(new Locale(string));
@@ -200,9 +200,9 @@
 	
 	public Map<String, String[]> getApplicationRuntimeOptions() {
 		Map<String, String[]> resultMap = new HashMap<String, String[]>();
-		if (portletAppDD.getContainerRuntimeOptions() != null){
-			for (ContainerRuntimeOption option : portletAppDD.getContainerRuntimeOptions()) {
-				if (Configuration.getSupportedContainerRuntimeOptions().contains(option.getName())){
+		if (portletApp.getContainerRuntimeOptions() != null){
+			for (ContainerRuntimeOption option : portletApp.getContainerRuntimeOptions()) {
+				if (getSupportedContainerRuntimeOptions().contains(option.getName())){
 					List<String> values = option.getValues();
 					String [] tempValues = new String[values.size()];
 					for (int i=0;i<values.size();i++){
@@ -217,9 +217,9 @@
 	
 	public Map<String, String[]> getPortletRuntimeOptions() {
 		Map<String, String[]> resultMap = new HashMap<String, String[]>();
-		if (portletDD.getContainerRuntimeOptions() != null) {
-			for (ContainerRuntimeOption option : portletDD.getContainerRuntimeOptions()) {
-				if (Configuration.getSupportedContainerRuntimeOptions().contains(option.getName())){
+		if (portlet.getContainerRuntimeOptions() != null) {
+			for (ContainerRuntimeOption option : portlet.getContainerRuntimeOptions()) {
+				if (getSupportedContainerRuntimeOptions().contains(option.getName())){
 					List<String> values = option.getValues();
 					String [] tempValues = new String[values.size()];
 					for (int i=0;i<values.size();i++){
@@ -257,4 +257,10 @@
 		//return resultMap;
 		return null;
 	}
+	
+    protected List<String> getSupportedContainerRuntimeOptions()
+    {
+        return Configuration.getSupportedContainerRuntimeOptions();
+    }
+	
 }

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java?rev=707545&r1=707544&r2=707545&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java
(original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java
Thu Oct 23 22:08:40 2008
@@ -57,11 +57,11 @@
     
     
     /** Portlet */
-    private PortletDefinition portlet = null;
+    protected PortletDefinition portlet = null;
 
-    private final PortletApplicationDefinition portletApp;
-    private final ServletContext servletContext;
-    private ClassLoader contextClassLoader;
+    protected final PortletApplicationDefinition portletApp;
+    protected final ServletContext servletContext;
+    protected ClassLoader contextClassLoader;
 
     
     // Constructor -------------------------------------------------------------
@@ -272,7 +272,7 @@
 		Map<String, String[]> resultMap = new HashMap<String, String[]>();
 		if (portletApp.getContainerRuntimeOptions() != null){
 			for (ContainerRuntimeOption option : portletApp.getContainerRuntimeOptions()) {
-				if (Configuration.getSupportedContainerRuntimeOptions().contains(option.getName())){
+				if (getSupportedContainerRuntimeOptions().contains(option.getName())){
 					List<String> values = option.getValues();
 					String [] tempValues = new String[values.size()];
 					for (int i=0;i<values.size();i++){
@@ -289,7 +289,7 @@
 		Map<String, String[]> resultMap = new HashMap<String, String[]>();
 		if (portlet.getContainerRuntimeOptions() != null) {
 			for (ContainerRuntimeOption option : portlet.getContainerRuntimeOptions()) {
-				if (Configuration.getSupportedContainerRuntimeOptions().contains(option.getName())){
+				if (this.getSupportedContainerRuntimeOptions().contains(option.getName())){
 					List<String> values = option.getValues();
 					String [] tempValues = new String[values.size()];
 					for (int i=0;i<values.size();i++){
@@ -327,5 +327,10 @@
 		//return resultMap;
 		return null;
 	}
+	
+	protected List<String> getSupportedContainerRuntimeOptions()
+	{
+	    return Configuration.getSupportedContainerRuntimeOptions();
+	}
 }
 



Mime
View raw message