Changeset 7439

Show
Ignore:
Timestamp:
03/16/09 14:09:45 (17 months ago)
Author:
wtoconnor
Message:

The CSV string created by articleGrpListToCSV was not inserting commas between article types. Now it will.

Addresses #1147

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • head/ambra/webapp/src/main/java/org/topazproject/ambra/article/service/BrowseService.java

    r7425 r7439  
    767767      browseCache.remove(ISSUE_KEY + issueDoi); 
    768768    } 
    769  
    770  
    771   } 
    772  
    773   /** 
    774    * 
     769  } 
     770 
     771  /** 
     772   * Given a list of Article Groups with correctly ordered articles 
     773   * create a CSV string of article URIs. The URIs will be in the 
     774   * order that they show up on the TOC. 
     775   * 
     776   * @param  articleGroups the list of TOCArticleGroup to process. 
     777   * @return a string of a comma separated list of article URIs 
    775778   */ 
    776779  public String articleGrpListToCSV( List<TOCArticleGroup> articleGroups) { 
    777780    String articleList = ""; 
    778     for (TOCArticleGroup ag : articleGroups) { 
    779       Iterator i = ag.articles.listIterator(); 
    780  
    781       while(i.hasNext()) { 
    782         ArticleInfo ai = (ArticleInfo)i.next(); 
    783  
     781    Iterator i = articleGroups.listIterator(); 
     782 
     783    // Group Loop 
     784    while(i.hasNext()) { 
     785      TOCArticleGroup ag = (TOCArticleGroup)i.next(); 
     786      Iterator y = ag.articles.listIterator(); 
     787 
     788      // Article Loop 
     789      while(y.hasNext()) { 
     790        ArticleInfo ai = (ArticleInfo)y.next(); 
    784791        articleList = articleList + ai.id.toString(); 
    785         if (i.hasNext()) 
     792 
     793        if (y.hasNext()) 
    786794          articleList = articleList + ","; 
    787795      } 
     796      if (i.hasNext()) 
     797        articleList = articleList + ","; 
    788798    } 
    789799    return articleList;