cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap SitemapLanguage.java
Date Sun, 30 Jun 2002 20:45:09 GMT
sylvain     2002/06/30 13:45:08

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        SitemapLanguage.java
  Log:
  Re-fix bug #7196
  
  Revision  Changes    Path
  1.8       +17 -19    xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
  
  Index: SitemapLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SitemapLanguage.java	6 Jun 2002 14:28:14 -0000	1.7
  +++ SitemapLanguage.java	30 Jun 2002 20:45:08 -0000	1.8
  @@ -226,10 +226,6 @@
        */
       public Collection getViewsForStatement(String role, String hint, Configuration statement)
throws Exception {
   
  -        if ( role == null || role.trim().equals("") ) {
  -            // FIXME !!
  -            return null;
  -        }
           String statementLabels = statement.getAttribute("label", null);
   
           if (this.isBuildingView) {
  @@ -251,20 +247,22 @@
           Set labels = new HashSet();
   
           // 1 - labels defined on the component
  -        SitemapComponentSelector selector = null;
  -        try {
  -            selector = (SitemapComponentSelector)this.manager.lookup(role + "Selector");
  -            String[] compLabels = selector.getLabels(hint);
  -            if (compLabels != null) {
  -                for (int i = 0; i < compLabels.length; i++) {
  -                    labels.add(compLabels[i]);
  +        if (role != null && role.length() > 0) {
  +            SitemapComponentSelector selector = null;
  +            try {
  +                selector = (SitemapComponentSelector)this.manager.lookup(role + "Selector");
  +                String[] compLabels = selector.getLabels(hint);
  +                if (compLabels != null) {
  +                    for (int i = 0; i < compLabels.length; i++) {
  +                        labels.add(compLabels[i]);
  +                    }
                   }
  +            } catch(Exception e) {
  +                // Ignore (no selector for this role)
  +                getLogger().debug("No selector for role " + role);
  +            } finally {
  +                this.manager.release( selector );
               }
  -        } catch(Exception e) {
  -            // Ignore (no selector for this role)
  -            getLogger().debug("No selector for role " + role);
  -        } finally {
  -            this.manager.release( selector );
           }
   
           // 2 - labels defined on this statement
  @@ -273,9 +271,9 @@
           }
   
           // 3 - pseudo-label depending on the role
  -        if (role.equals(Generator.ROLE)) {
  +        if (Generator.ROLE.equals(role)) {
               labels.add("!first!");
  -        } else if (role.equals(Serializer.ROLE)) {
  +        } else if (Serializer.ROLE.equals(role)) {
               labels.add("!last!");
           }
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message