Beispiel #1
0
 public static void updateFeedNames() {
   List<User> validatedUsers = getAllValidatedUsers();
   validatedUsers.add(0, User.getUser("demo"));
   validatedUsers.add(0, User.getUser("subbu"));
   for (User u : validatedUsers) {
     System.out.println("Got uid: " + u.getUid());
     for (Source s : u.getSources()) {
       Feed f = s.getFeed();
       try {
         SQL_StmtExecutor.update(
             "UPDATE feeds SET feed_name = ? WHERE id = ? AND feed_name=''",
             new SQL_ValType[] {SQL_ValType.STRING, SQL_ValType.LONG},
             new Object[] {s.getName(), f.getKey()});
       } catch (Exception e) {
         _log.error("Error setting feed name", e);
       }
     }
   }
 }
Beispiel #2
0
 public static void migrateUser(String uid) {
   System.out.println("--- Migrating user .. " + uid);
   try {
     User u = User.getUser(uid);
     u.validateAllIssues(true);
     for (Source s : u.getSources()) {
       Feed f = s.getFeed();
       try {
         SQL_StmtExecutor.update(
             "UPDATE feeds SET feed_name = ? WHERE id = ? AND feed_name=''",
             new SQL_ValType[] {SQL_ValType.STRING, SQL_ValType.LONG},
             new Object[] {s.getName(), f.getKey()});
       } catch (Exception e) {
         _log.error("Error setting feed name", e);
       }
     }
   } catch (Exception e) {
     _log.error("ERROR VALIDATING user: " + uid, e);
   }
 }