Changeset 14398

Show
Ignore:
Timestamp:
03.09.2007 13:10:27 (12 years ago)
Author:
xiao
Message:

modify to accommodate the new subaction - FlaxPageGeneration?, deliverying the flax web pages.

Files:
1 modified

Legend:

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

    r13974 r14398  
    11package org.greenstone.gsdl3.action; 
    22 
    3 import org.greenstone.gsdl3.core.ModuleInterface; 
    43import org.greenstone.gsdl3.util.*; 
     4import org.flax.util.*; 
    55// XML classes 
    66import org.w3c.dom.Node;  
    7 import org.w3c.dom.NodeList;  
    8 import org.w3c.dom.Document;  
    97import org.w3c.dom.Element;  
    108 
    119import java.util.HashMap; 
    12 import java.util.Map; 
    13 import java.util.Iterator; 
    14 import java.io.File; 
    15  
    1610 
    1711public class GeneralAction extends Action { 
     
    2721    // assume only one request 
    2822    Element request = (Element)GSXML.getChildByTagName(message, GSXML.REQUEST_ELEM); 
    29  
     23    logger.info(" request="+this.converter.getString(request)); 
     24    //A shortcut action serving the flax web page requests 
     25    if(request.getAttribute(GSXML.SUBACTION_ATT).equals(FlaxUtil.FLAX_PAGE_GENERATION) 
     26            && request.getAttribute(FlaxUtil.TO).equals(FlaxUtil.FLAX_PAGE_GENERATION)) { 
     27        // 
     28        Element mr_info_response = (Element) this.mr.process(message); 
     29        Node flaxPageNode = (mr_info_response.getElementsByTagName(FlaxUtil.FLAX_PAGE)).item(0); 
     30        //logger.info(" raw page="+this.converter.getString(flaxPageNode)); 
     31        if(flaxPageNode != null){ 
     32            page_response.appendChild((Element)this.doc.importNode(flaxPageNode, true)); 
     33        } 
     34        return result;       
     35    } 
     36     
    3037    // get the param list 
    3138    Element cgi_param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);