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

replacing hard coded param names with static string variables. set up save params for those params we need to save to the session.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/UserTracker.java

    r28966 r32453  
    1616public class UserTracker extends ServiceRack
    1717{
    18     static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.DocXMLUtil.class.getName());
     18    static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.UserTracker.class.getName());
    1919
    2020    /**************************************************
     
    2727    String[] services = { RECORD_USER_ACTION, GET_ACTIVITY_ON_PAGE };
    2828
     29  // the parameters these services use
     30  protected static final String USER_PARAM = "username";
     31  protected static final String COLLECTION_PARAM = "collection";
     32  protected static final String SITE_PARAM = "site";
     33  protected static final String OID_PARAM = "oid";
     34  protected static final String ACTION_PARAM = "action";
     35 
    2936    /** configure this service */
    3037    public boolean configure(Element info, Element extra_info)
     
    3542        }
    3643
    37         logger.info("Configuring DocXMLUtil...");
     44        logger.info("Configuring UserTracker...");
    3845        this.config_info = info;
    3946
     
    4653        }
    4754
     55        // should any of the params be saved to the session?
     56        // assuming not at this stage. But if they do need to be, then
     57        // sture them here in save_params.
     58        // this.save_params.add(XXX_PARAM);
    4859        return true;
    4960    }
     
    7889
    7990        HashMap<String, Serializable> params = GSXML.extractParams(paramList, true);
    80         String username = (String) params.get("username");
    81         String collection = (String) params.get("collection");
    82         String site = (String) params.get("site");
    83         String oid = (String) params.get("oid");
    84         String action = (String) params.get("action");
     91        String username = (String) params.get(USER_PARAM);
     92        String collection = (String) params.get(COLLECTION_PARAM);
     93        String site = (String) params.get(SITE_PARAM);
     94        String oid = (String) params.get(OID_PARAM);
     95        String action = (String) params.get(ACTION_PARAM);
    8596
    8697        DerbyWrapper database = new DerbyWrapper(GlobalProperties.getGSDL3Home() + File.separatorChar + "etc" + File.separatorChar + "usersDB");
     
    106117
    107118            HashMap<String, Serializable> params = GSXML.extractParams(paramList, true);
    108             String collection = (String) params.get("collection");
    109             String site = (String) params.get("site");
    110             String oid = (String) params.get("oid");
     119            String collection = (String) params.get(COLLECTION_PARAM);
     120            String site = (String) params.get(SITE_PARAM);
     121            String oid = (String) params.get(OID_PARAM);
    111122
    112123            DerbyWrapper database = new DerbyWrapper(GlobalProperties.getGSDL3Home() + File.separatorChar + "etc" + File.separatorChar + "usersDB");
Note: See TracChangeset for help on using the changeset viewer.