Changeset 29979

Show
Ignore:
Timestamp:
12.06.2015 09:39:20 (4 years ago)
Author:
litvinovg
Message:

RSS Feed Links url use baseUrl from request. Fixed broken links when we use AJP proxy.

Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/RSSAction.java

    r28964 r29979  
    1010// other java stuff 
    1111import java.util.*; 
    12  
    1312import java.io.Serializable; 
    14  
    1513import java.io.PrintWriter; 
    1614import java.io.Serializable; 
     
    2725    public Node process(Node message_node) 
    2826    { 
     27         
    2928        Element message = GSXML.nodeToElement(message_node); 
    3029        Document doc = message.getOwnerDocument(); 
     
    4140        String collection = (String) params.get(GSParams.COLLECTION); 
    4241        String to = GSPath.prependLink(service_name, collection); // collection/RSSFeed 
     42        // Get baseUrl for links in RSS Feed 
     43        String baseUrl = request.getAttribute("baseURL"); 
     44         
    4345         
    4446        // the first part of the response is the service description  
     
    4850        Element mr_request_message = doc.createElement(GSXML.MESSAGE_ELEM); 
    4951        Element rss_request = GSXML.createBasicRequest(doc, GSXML.REQUEST_TYPE_PROCESS, to, userContext); 
     52        //Pass baseURL to processRSSFeed 
     53        rss_request.setAttribute("baseURL", baseUrl); 
    5054        mr_request_message.appendChild(rss_request); 
    51  
     55         
    5256        Element rss_response = (Element) this.mr.process(mr_request_message); 
    5357        rss_response = (Element) GSXML.getChildByTagName(rss_response, GSXML.RESPONSE_ELEM); // just the response tag 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/RSSRetrieve.java

    r28966 r29979  
    2626import java.util.Date; 
    2727import java.text.SimpleDateFormat; 
     28 
    2829import org.apache.log4j.*; 
    2930 
     
    9091    //logger.error("**** collection metadata:"); 
    9192    //GSXML.elementToLogAsString(collMeta, true); 
    92  
     93     
    9394    // work out some commonly used variables such as lang and url_prefix 
    9495    String lang = request.getAttribute("lang"); 
     
    9697        lang = "en"; 
    9798    } 
    98  
     99    //Get baseUrl from request  
     100    String baseURL = request.getAttribute("baseURL"); 
     101     
    99102    // url_prefix is of the form http://domain/greenstone3/library/collection/_colname_/ 
    100     String url_prefix = GlobalProperties.getFullGSDL3WebAddress()+"/"+this.library_name+"/collection/"+this.cluster_name; 
    101  
     103    //String url_prefix = GlobalProperties.getFullGSDL3WebAddress()+"/"+this.library_name+"/collection/"+this.cluster_name; 
     104    String url_prefix = baseURL+"library"+"/"+this.library_name+"/collection/"+this.cluster_name; 
    102105 
    103106    // generate the header and footer