Changeset 32892

Show
Ignore:
Timestamp:
11.03.2019 20:08:39 (12 days ago)
Author:
ak19
Message:

Part 1 of 2 commits to do with getting errorCallBack working on documentEditing for determining when changes have been saved or not to decided whether editableInitStates can finally be overwritten with current (saved) values.

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

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/build/GS2PerlConstructor.java

    r32855 r32892  
    406406 
    407407    // If you want to run a Perl command without doing GS2PerlConstructor's custom logging in the build log 
    408     // The use the runSimplePerlCommand() versions, which use the default behaviour of running a SafeProcess 
     408    // Then use the runSimplePerlCommand() versions, which use the default behaviour of running a SafeProcess 
    409409    protected boolean runSimplePerlCommand(String[] command) {   
    410410    return runSimplePerlCommand(command, null, null); 
     
    532532         
    533533        if (perlProcess.getExitValue() == 0) { //status = OK; 
    534          
     534        //logger.info("@@@@@@@@ runPerlCommand success - exitvalue = " + perlProcess.getExitValue()); 
    535535        sendProcessStatus(new ConstructionEvent(this, GSStatus.CONTINUING, "Success")); 
    536536        success = true; 
    537537 
    538538        } else { //status = ERROR; 
     539        logger.debug("@@@@@@@@ runPerlCommand failed, exitvalue = " + perlProcess.getExitValue()); 
    539540        sendProcessStatus(new ConstructionEvent(this, GSStatus.ERROR, "Failure")); 
    540541        success = false; 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java

    r32870 r32892  
    8181  protected boolean noRecordsMatch = false; 
    8282       
    83   /** A set of all known 'sets' TODO: set_oaiset as name */ 
     83  /** A set of all known 'sets'. */ 
    8484  protected HashSet<String> set_oaiset = null; 
    8585 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java

    r32453 r32892  
    401401        String statusString = GSXML.getNodeText(statusElem); 
    402402        statusString += " and monitored until done.";  
     403        // check for errors 
     404        int status_code = Integer.parseInt(statusElem.getAttribute(GSXML.STATUS_ERROR_CODE_ATT)); 
     405        if (GSStatus.isError(status_code)) { 
     406            logger.info("Got error status code: " + status_code); 
     407            statusString += "But got error status code: " + status_code; 
     408        } else { // check for Construction event errors 
     409            String id = statusElem.getAttribute("pid"); 
     410            GS2PerlListener currentListener = this.listeners.get(id); 
     411            status_code = currentListener.getStatus(); 
     412            if (GSStatus.isError(status_code)) 
     413            { 
     414                logger.info("xxxx Got construction event error. Error status code: " + status_code); 
     415                statusString += "But got construction event error, status code: " + status_code; 
     416                // add the rest of the messages to the statusElem node 
     417                statusString += "\n" + currentListener.getUpdate();  
     418                statusElem.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(currentListener.getStatus())); 
     419            }            
     420        }        
     421        // can finally set statusString 
    403422        GSXML.setNodeText(statusElem, statusString); 
    404423         
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSStatus.java

    r16869 r32892  
    2424    public static final int SUCCESS = 1; // request succeeded 
    2525    public static final int ACCEPTED = 2; // request accepted but not completed 
    26     public static final int ERROR = 3; // error and process stopped 
     26    public static final int ERROR = 3; // error and process stopped. BEWARE: If you change the value of ERROR, concurrently update the value checked for in documentedit_scripts_util.js::hadErrorResponseOnSave() 
    2727 
    2828    // responses for status requests