Changeset 25355


Ignore:
Timestamp:
2012-04-12T14:13:34+12:00 (12 years ago)
Author:
sjm84
Message:

Some fixes to the file formatting

File:
1 edited

Legend:

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

    r25305 r25355  
    9797        String collection = (String) params.get(GSParams.COLLECTION);
    9898        String document_id = (String) params.get(GSParams.DOCUMENT);
    99         if (document_id != null && document_id.equals("")) {
    100           document_id = null;
     99        if (document_id != null && document_id.equals(""))
     100        {
     101            document_id = null;
    101102        }
    102103        String href = (String) params.get(GSParams.HREF);//for an external link : get the href URL if it is existing in the params list
    103         if (href != null && href.equals("")) {
    104           href = null;
     104        if (href != null && href.equals(""))
     105        {
     106            href = null;
    105107        }
    106108        String rl = (String) params.get(GSParams.RELATIVE_LINK);//for an external link : get the rl value if it is existing in the params list
     
    110112            return result;
    111113        }
    112         if (rl != null && rl.equals("0")) {
    113           // this is a true external link, we should have been directed to a different page or action
    114           logger.error("rl value was 0, shouldn't get here");
    115           return result;
     114        if (rl != null && rl.equals("0"))
     115        {
     116            // this is a true external link, we should have been directed to a different page or action
     117            logger.error("rl value was 0, shouldn't get here");
     118            return result;
    116119        }
    117120        String document_type = (String) params.get(GSParams.DOCUMENT_TYPE);
    118         if (document_type == null ||  document_type.equals(""))
     121        if (document_type == null || document_type.equals(""))
    119122        {
    120123            document_type = "simple";
     
    133136        {
    134137            // we have to modify the doc name
    135             doc_id_modifier =  "." + sibling_num + ".ss";
     138            doc_id_modifier = "." + sibling_num + ".ss";
    136139        }
    137140
     
    156159            }
    157160        }
    158        
     161
    159162        UserContext userContext = new UserContext(request);
    160163
     
    181184        if (document_id != null)
    182185        {
    183             current_doc.setAttribute(GSXML.NODE_ID_ATT, document_id+doc_id_modifier);
    184         }
    185         else 
     186            current_doc.setAttribute(GSXML.NODE_ID_ATT, document_id + doc_id_modifier);
     187        }
     188        else
    186189        {
    187190            current_doc.setAttribute(GSXML.HREF_ID_ATT, href);
     
    324327                    doc_node.setAttribute(GSXML.NODE_ID_ATT, document_id);
    325328                }
    326                 else 
     329                else
    327330                {
    328331                    doc_node.setAttribute(GSXML.HREF_ID_ATT, href);
    329                
     332
    330333                }
    331334                the_document.appendChild(doc_node);
     
    342345                doc_node.setAttribute(GSXML.NODE_ID_ATT, document_id);
    343346            }
    344             else 
     347            else
    345348            {
    346349                doc_node.setAttribute(GSXML.HREF_ID_ATT, href);
     
    412415        Element doc_node = this.doc.createElement(GSXML.DOC_NODE_ELEM);
    413416        // the node we want is the root document node
    414         if (document_id != null) 
     417        if (document_id != null)
    415418        {
    416419            doc_node.setAttribute(GSXML.NODE_ID_ATT, document_id + ".rt");
    417420        }
    418         else 
    419         {
    420           doc_node.setAttribute(GSXML.HREF_ID_ATT, href);// + ".rt");
    421           // can we assume that href is always a top level doc??
    422           //doc_node.setAttribute(GSXML.ID_MOD_ATT, ".rt");
     421        else
     422        {
     423            doc_node.setAttribute(GSXML.HREF_ID_ATT, href);// + ".rt");
     424            // can we assume that href is always a top level doc??
     425            //doc_node.setAttribute(GSXML.ID_MOD_ATT, ".rt");
    423426            //doc_node.setAttribute("externalURL", has_rl);
    424427        }
     
    507510            {
    508511                // no content to add
    509               if (dc_response_doc.getAttribute("external").equals("true")) {
    510                
    511                 //if (dc_response_doc_external != null)
    512                 //{
     512                if (dc_response_doc.getAttribute("external").equals("true"))
     513                {
     514
     515                    //if (dc_response_doc_external != null)
     516                    //{
    513517                    String href_id = dc_response_doc.getAttribute(GSXML.HREF_ID_ATT);
    514518
    515519                    the_document.setAttribute("selectedNode", href_id);
    516520                    the_document.setAttribute("external", href_id);
    517               }
    518               return result;
     521                }
     522                return result;
    519523            }
    520524            if (highlight_query_terms)
     
    716720    protected Element highlightQueryTerms(Element request, Element dc_response_doc_content)
    717721    {
    718 
    719722        // do the query again to get term info
    720723        Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
Note: See TracChangeset for help on using the changeset viewer.