You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by dd...@apache.org on 2004/07/30 21:38:30 UTC

cvs commit: jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl ResourceRefSet.java WebApplicationDefinitionImpl.java

ddewolf     2004/07/30 12:38:30

  Modified:    portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl
                        WebApplicationDefinitionImpl.java
  Added:       portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl
                        ResourceRefSet.java
  Log:
  Fixing Issue: PLUTO-48.  Allowing multiple resource-ref entries in portlet app web.xml.  THANKS Th. Walter <waltert.At.t-systems.d0t.com>
  
  Revision  Changes    Path
  1.8       +4 -4      jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java
  
  Index: WebApplicationDefinitionImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WebApplicationDefinitionImpl.java	30 Jul 2004 12:39:15 -0000	1.7
  +++ WebApplicationDefinitionImpl.java	30 Jul 2004 19:38:29 -0000	1.8
  @@ -78,7 +78,7 @@
       // modified by YCLI: START :: to handle multiple taglib tags and resource-ref tag
       // private TagDefinition castorTagDefinition = new TagDefinition();
       private TagDefinitionSet taglibs = new TagDefinitionSet();
  -    private ResourceRef castorResourceRef = new ResourceRef();
  +    private ResourceRefSet castorResourceRef = new ResourceRefSet();
       // modified by YCLI: END
   
       // WebApplicationDefinition implementation.
  @@ -324,12 +324,12 @@
           this.taglibs = taglibs;
       }
   
  -    public ResourceRef getResourceRef() {
  +    public ResourceRefSet getCastorResourceRefSet() {
           return castorResourceRef;
       }
   
  -    public void setResourceRef(ResourceRef resourceRef) {
  -        castorResourceRef = resourceRef;
  +    public void setCastorResourceRefSet(ResourceRefSet resourceRefs) {
  +        castorResourceRef = resourceRefs;
       }
       // modified by YCLI: END
   
  
  
  
  1.1                  jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ResourceRefSet.java
  
  Index: ResourceRefSet.java
  ===================================================================
  /*
  * Copyright 2003,2004 The Apache Software Foundation.
  *
  * Licensed 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.pluto.portalImpl.om.servlet.impl;
  
  import java.util.Iterator;
  
  import org.apache.pluto.portalImpl.om.common.AbstractSupportSet;
  import org.apache.pluto.portalImpl.om.common.Support;
  
  /**
   * Resource Reference Set as defined by the web.xml as
   * &lt;resourse-ref&gt;.
   *
   * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
   */
  public class ResourceRefSet
      extends AbstractSupportSet
      implements java.io.Serializable, Support {
  
      /**
       *  Retrieve the Resource Reference
       */
      public ResourceRef get(String name)
      {
          Iterator it = this.iterator();
          while(it.hasNext()) {
              ResourceRef ref = (ResourceRef)it.next();
              if(ref.getName().equals(name)) {
                  return ref;
              }
          }
          return null;
      }
  
      public ResourceRef add(ResourceRef ref)
      {
          return this.add(ref);
      }
  
      public ResourceRef remove(ResourceRef ref)
      {
          Iterator it = this.iterator();
          while(it.hasNext()) {
              ResourceRef internal = (ResourceRef)it.next();
              if(internal.equals(ref)) {
                  it.remove();
                  return internal;
              }
          }
          return null;
      }
  
  
  }