Changeset 33719
- Timestamp:
- 2019-11-25T10:46:36+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java
r33713 r33719 35 35 36 36 import javax.servlet.ServletConfig; 37 import javax.servlet.ServletContext; 37 38 import javax.servlet.ServletException; 38 39 import javax.servlet.http.Cookie; … … 425 426 if (processRedirectRequest(request, response, queryMap)) { 426 427 // this method will do the redirect if needed and return true if it has 427 // if el=direct/framed&rl=0&href=http://newurl.com 428 // done so. 429 // e.g. el=direct/framed&rl=0&href=http://newurl.com 428 430 return; 429 431 } … … 859 861 String rl = null; 860 862 String el = null; 863 String collection = null; 861 864 862 865 while (queryIter.hasNext()) 863 866 { 864 867 String q = queryIter.next(); 865 if (q.equals(GSParams.EXTERNAL_LINK_TYPE)) 868 if (q.equals(GSParams.COLLECTION)) 869 { 870 collection = queryMap.get(q)[0]; 871 } 872 else if (q.equals(GSParams.EXTERNAL_LINK_TYPE)) 866 873 { 867 874 el = queryMap.get(q)[0]; … … 885 892 //"rl=1" this is an internal link 886 893 if ((href != null) && (rl.equals("0"))) 887 894 {// This is an external link, 888 895 889 896 if (el.equals("framed")) 890 { 891 //TODO **** how best to change to a=p&sa=html&c=collection&url=href 892 // response.setContentType("text/xml"); 893 //response.sendRedirect("http://localhost:8383/greenstone3/gs3library?a=p&sa=html&c=external&url="+href); 894 } 897 { 898 // framed means we are linking to an external page inside our greenstone page 899 HttpSession session = request.getSession(); 900 ServletContext context = session.getServletContext(); 901 String new_url = context.getContextPath()+"/"+ library_name+"?a=p&sa=html&url="+href; 902 if (collection != null && !collection.equals("")) { 903 new_url += "&c="+collection; 904 } 905 response.sendRedirect(new_url); 906 } 895 907 else 896 908 { 897 909 // el = '' or direct 898 910 //the web page is re-directed to the external URL (&el=&rl=0&href="http://...") 899 //response.setContentType("text/xml"); 900 //response.sendRedirect(href); 901 } 911 response.sendRedirect(href); 912 } 902 913 return true; 903 914 }
Note:
See TracChangeset
for help on using the changeset viewer.