Ignore:
Timestamp:
2021-08-17T14:42:15+12:00 (3 years ago)
Author:
anupama
Message:
  1. In trying to hunt down where UserTermInfo's toString() and UserQueryResult's toString() get called and what value for groups they need to be displaying (expandedGroups or compactedGroups which is closest to user-entered data), found that UserQueryResult.users was public, despite there being a method getUserTerms() that returns this. So made it a private member and updated code to call the method at all times. In the end I didn't locate anywhere in the code that the aforementioned toString() methods got called, DerbyWrapper.java's db2txt() methods print out the fields direct from the DB in their own formatting, and is called by userDB2txt.java. At the moment, the code is set to print out the expandedGroups for the groups value of any UserTermInfo. 2. Fixed a bug due to oversight in UserTermInfo.java's compactGroups(String groups) and expandedGroups(String groups) to handle when groups is null. Returning empty string then, also used to initialise the compactedGroups and expandedGroups member vars.
Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/UserQueryResult.java

    r35298 r35303  
    2525{
    2626    /** the list of UserInfo */
    27     public Vector<UserTermInfo> users = null;
     27    private Vector<UserTermInfo> users = null;
    2828
    2929    UserQueryResult()
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/UserTermInfo.java

    r35299 r35303  
    113113     */
    114114    public static String compactGroups(String groups) {
    115     if(groups.indexOf('.') == -1) {
     115    if(groups == null) {
     116        return "";
     117    }
     118    else if(groups.indexOf('.') == -1) {
    116119        return groups;
    117120    }
     
    198201     */
    199202    public static String expandGroups(String groups) {
    200     if(groups.indexOf('.') == -1) {
     203    if(groups == null) {
     204        return "";
     205    } else if(groups.indexOf('.') == -1) {
    201206        return groups;
    202207    }
Note: See TracChangeset for help on using the changeset viewer.