Changeset 1353


Ignore:
Timestamp:
02/07/14 11:41:02 (10 years ago)
Author:
pharms
Message:
  • improved pseudomization to include search and file input fields
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogTextInputPseudomizer.java

    r1277 r1353  
    3939 * pseudomizes the text entered in text input events by replacing it with an MD5 hash. For this, it 
    4040 * parses a given file and dumps a replacement, in which all text input events have an MD5 hash 
    41  * as entered text. If the events already have an MD5 hash, it stays unchanged. 
     41 * as entered text. If the events already have an MD5 hash, it stays unchanged. Providing the 
     42 * parameters to the constructor, it can be decided to pseudomize text entries into file and search 
     43 * input fields, as well. 
    4244 * </p> 
    4345 *  
     
    5052    /** 
    5153     * <p> 
     54     * Indicator if search input fields must be pseudomized, as well. 
     55     * </p> 
     56     */ 
     57    private boolean pseudomizeSearchInputs = false; 
     58     
     59    /** 
     60     * <p> 
     61     * Indicator if file input fields must be pseudomized, as well. 
     62     * </p> 
     63     */ 
     64    private boolean pseudomizeFileInputs = false; 
     65     
     66    /** 
     67     * <p> 
    5268     * The output writer into which the pseudomized variant of the log file is written 
    5369     * </p> 
     
    6884     */ 
    6985    private List<EventEntry> sortedEvents = new LinkedList<EventEntry>(); 
     86 
     87    /** 
     88     * <p> 
     89     * creates the input pseudomizer with the switches, if text inputs into file and search fields 
     90     * shall be pseudomized, as well. 
     91     * </p> 
     92     * 
     93     * @param pseudomizeSearchInputs true, if inputs into search fields shall be pseudomized, as 
     94     *                               well; false else  
     95     * @param pseudomizeFileInputs   true, if inputs into file fields shall be pseudomized, as well; 
     96     *                               false else  
     97     */ 
     98    public HTMLLogTextInputPseudomizer(boolean pseudomizeSearchInputs, 
     99                                       boolean pseudomizeFileInputs) 
     100    { 
     101        this.pseudomizeSearchInputs = pseudomizeSearchInputs; 
     102        this.pseudomizeFileInputs = pseudomizeFileInputs; 
     103    } 
    70104 
    71105    /** 
     
    199233            dumpParam(param.getKey(), param.getValue()); 
    200234             
    201             if ("tagname".equals(param.getKey()) && "input_text".equals(param.getValue())) { 
    202                 textInputFieldIds.add(id); 
     235            if ("tagname".equals(param.getKey())) { 
     236                if ("input_text".equals(param.getValue()) || 
     237                    (pseudomizeSearchInputs && "input_search".equals(param.getValue())) || 
     238                    (pseudomizeFileInputs && "input_file".equals(param.getValue()))) 
     239                { 
     240                    textInputFieldIds.add(id); 
     241                } 
    203242            } 
    204243        } 
Note: See TracChangeset for help on using the changeset viewer.