Changeset 6090 for trunk

Show
Ignore:
Timestamp:
12/06/11 12:19:39 (6 months ago)
Author:
mtld
Message:

reset non-matching page alternative keys

Location:
trunk/pustefix-core/src/main/java
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/pustefix-core/src/main/java/de/schlund/pfixcore/workflow/SiteMap.java

    r6050 r6090  
    329329     
    330330    public Set<String> getPageAlternativeKeys(String pageName) { 
    331         Page page = pageNameToPage.get(pageName); 
    332         if(page != null && page.pageAltKeyToName.size() > 0) { 
    333             return page.pageAltKeyToName.keySet(); 
     331        if(pageName != null) { 
     332            Page page = pageNameToPage.get(pageName); 
     333            if(page != null && page.pageAltKeyToName.size() > 0) { 
     334                return page.pageAltKeyToName.keySet(); 
     335            } 
    334336        } 
    335337        return null; 
  • trunk/pustefix-core/src/main/java/de/schlund/pfixcore/workflow/context/RequestContextImpl.java

    r6050 r6090  
    534534            } 
    535535            if(pageAlternativeKey != null) { 
    536                 spdoc.setPageAlternative(pageAlternativeKey); 
     536                spdoc.setPageAlternative(getPageAlternative()); 
    537537            } 
    538538             
  • trunk/pustefix-core/src/main/java/org/pustefixframework/http/PustefixContextXMLRequestHandler.java

    r5881 r6090  
    231231             
    232232            if(spdoc != null && !spdoc.isRedirect()) { 
     233                if(spdoc.getPageAlternative() != null) { 
     234                    Set<String> pageAltKeys = siteMap.getPageAlternativeKeys(spdoc.getPagename()); 
     235                    if(pageAltKeys == null || !pageAltKeys.contains(spdoc.getPageAlternative())) { 
     236                        spdoc.setPageAlternative(null); 
     237                    } 
     238                } 
    233239                String expectedPageName = null; 
    234240                String langPrefix = null;