Ignore:
Timestamp:
04/19/12 14:44:19 (12 years ago)
Author:
twagoo
Message:

Added canDelete property to Comment
ComponentRegistryDbImpl? sets property for all returned comments based on current principal
Comment retrieval methods of ComponentRegistry interface now require principal as parameter

Tests modified and extended

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/model/Comment.java

    r1697 r1892  
    1212/**
    1313 *
    14  * @author jean-charles FerriÚres <jean-charles.ferrieres@mpi.nl>
     14 * @author Jean-Charles FerriÚres <jean-charles.ferrieres@mpi.nl>
     15 * @author Twan Goosen <twan.goosen@mpi.nl>
    1516 */
    1617@XmlRootElement(name = "comment")
     
    2425    private String id;
    2526    private String userName;
     27    private boolean canDelete;
    2628    @XmlTransient // this prevents userId from being serialized to XML and thus exposed (which is useless and undesirable)
    2729    private String userId;
     
    7678
    7779    /**
    78      * 
     80     *
    7981     * @return userName, that is the user's 'real' name, not login name
    8082     */
     
    8890    public void setUserName(String userName) {
    8991        this.userName = userName;
     92    }
     93
     94    /**
     95     * @return whether comment can be deleted
     96     */
     97    public boolean isCanDelete() {
     98        return canDelete;
     99    }
     100
     101    /**
     102     * @param canDelete whether comment can be deleted
     103     */
     104    public void setCanDelete(boolean canDelete) {
     105        this.canDelete = canDelete;
    90106    }
    91107
     
    103119    /*
    104120     * Helper method to set the Date in the same format
    105      * @param time, long that contains the time to be set 
     121     * @param time, long that contains the time to be set
    106122     */
    107123    public static String createNewDate(long time) {
Note: See TracChangeset for help on using the changeset viewer.