Changeset 35303


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
Files:
3 edited

Legend:

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

    r35299 r35303  
    10791079        if (userQueryResult != null)
    10801080        {
    1081             Vector userInfo = userQueryResult.users;
     1081            Vector userInfo = userQueryResult.getUserTerms();
    10821082
    10831083            boolean adminFound = false;
     
    12061206            UserQueryResult result = derbyWrapper.findUser(username);
    12071207            derbyWrapper.closeDatabase();
    1208             Vector userInfo = result.users;
     1208            Vector userInfo = result.getUserTerms();
    12091209
    12101210            for (int i = 0; i < result.getSize(); i++)
     
    12541254        Element user_list_node = doc.createElement(GSXML.USER_NODE_ELEM + GSXML.LIST_MODIFIER);
    12551255
    1256         Vector userInfo = userQueryResult.users;
     1256        Vector userInfo = userQueryResult.getUserTerms();
    12571257
    12581258        for (int i = 0; i < userQueryResult.getSize(); i++)
  • 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.