Ignore:
Timestamp:
2018-09-13T14:05:59+12:00 (6 years ago)
Author:
kjdon
Message:

params class changed, now returns false by default for shouldsave. so don't need to add any that we don't want saving in the session. turned hard coded strings into static string variables

File:
1 edited

Legend:

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

    r28964 r32448  
    2121import org.greenstone.gsdl3.util.DerbyWrapper;
    2222import org.greenstone.gsdl3.util.GSConstants;
     23import org.greenstone.gsdl3.util.GSParams;
    2324import org.greenstone.gsdl3.util.GSXML;
    2425import org.greenstone.gsdl3.util.GSXSLT;
     
    4041    private final String DE_CLEAR_DATABASE = "cleardatabase";
    4142
     43  // cgi args
     44  private final String DE_PAGE_ARG = "dePage";
     45  private final String CURRENT_PAGE_ARG = "currentPage";
     46  private final String FILE_TO_ADD_ARG = "fileToAdd";
     47 
    4248    public Node process(Node message)
    4349    {
     
    5561        HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
    5662
    57         String collection = (String) params.get("c");
     63        String collection = (String) params.get(GSParams.COLLECTION);
    5864
    5965        int pageNum = -1;
     
    6167        try
    6268        {
    63             pageNum = Integer.parseInt(((String) params.get("dePage")));
     69            pageNum = Integer.parseInt(((String) params.get(DE_PAGE_ARG)));
    6470        }
    6571        catch (Exception ex)
     
    7278        try
    7379        {
    74             prevPageNum = Integer.parseInt((String) params.get("currentPage"));
     80            prevPageNum = Integer.parseInt((String) params.get(CURRENT_PAGE_ARG));
    7581        }
    7682        catch (Exception ex)
     
    125131            {
    126132                String paramName = paramIter.next();
    127                 if (paramName.startsWith("md___"))
     133                if (paramName.startsWith(GSParams.MD_PREFIX))
    128134                {
    129135                    Object paramValue = params.get(paramName);
     
    270276        else if (subaction.toLowerCase().equals(DE_DEPOSIT_FILE))
    271277        {
    272             String fileToAdd = (String) params.get("fileToAdd");
     278            String fileToAdd = (String) params.get(FILE_TO_ADD_ARG);
    273279            File tempFile = new File(GlobalProperties.getGSDL3Home() + File.separator + "tmp" + File.separator + fileToAdd);
    274280            if (tempFile.exists())
Note: See TracChangeset for help on using the changeset viewer.