Ejemplo n.º 1
0
 public void printBody() throws Exception {
   if (!request.actionAllowed("_preference")) {
     throw new HTTPRequestException(557);
   }
   String s = request.getValue("operation");
   if (request.isPost()) {
     if (s.equals("save") || s.equals("setup")) {
       savePreferences();
       if (request.getValue("submit").startsWith("Save")) {
         if (com.dragonflow.Properties.JdbcConfig.getJdbcConfig()
             .testDBConnection(
                 request.getValue("configJdbcURL"),
                 request.getValue("configJdbcDriver"),
                 request.getValue("configJdbcUser"),
                 com.dragonflow.Properties.StringProperty.getPrivate(
                     request, "configJdbcPassword", "jdbcSuff", null, null))) {
           com.dragonflow.SiteView.SiteViewGroup.currentSiteView().StartDDC();
         } else {
           com.dragonflow.Page.jdbcConfigPrefsPage.removeDBConnection(request);
           com.dragonflow.SiteView.SiteViewGroup.currentSiteView().StopDDC();
         }
       } else if (request.getValue("submit").startsWith("Remove")) {
         com.dragonflow.Page.jdbcConfigPrefsPage.removeDBConnection(request);
         com.dragonflow.SiteView.SiteViewGroup.currentSiteView().StopDDC();
       } else if (request.getValue("submit").startsWith("Sync SiteView")) {
         com.dragonflow.Properties.JdbcConfig.getJdbcConfig().execute();
       } else {
         com.dragonflow.Properties.JdbcConfig.syncDBFromSS();
       }
       printRefreshPage("/SiteView/" + request.getAccountDirectory() + "/SiteView.html", 0);
     }
   } else {
     printForm();
   }
 }
Ejemplo n.º 2
0
 void initializeDatabase() {
   com.dragonflow.Properties.JdbcConfig.inInitStage = true;
   boolean flag = false;
   com.dragonflow.Log.LogManager.log(
       "RunMonitor", "jdbc config, initializing database from configuration files");
   try {
     com.dragonflow.Properties.JdbcConfig.getJdbcConfig();
     com.dragonflow.Properties.JdbcConfig.syncDBFromFiles();
     com.dragonflow.Properties.JdbcConfig.inInitStage = false;
     return;
   } catch (Exception exception) {
     if (!flag) {
       printErrorPage("Could not sync from db " + exception.getMessage());
     }
   }
 }
Ejemplo n.º 3
0
 public static void removeDBConnection(com.dragonflow.HTTP.HTTPRequest httprequest) {
   // jgl.HashMap hashmap = com.dragonflow.Page.CGI.loadMasterConfig(httprequest);
   // hashmap.put("_configJdbcPassword", "");
   // hashmap.put("_configJdbcURL", "");
   // hashmap.put("_configJdbcUser", "");
   // hashmap.put("_configJdbcDriver", "com.inet.tds.TdsDriver");
   Config.configPut("_configJdbcPassword", "");
   Config.configPut("_configJdbcURL", "");
   Config.configPut("_configJdbcUser", "");
   Config.configPut("_configJdbcDriver", "com.inet.tds.TdsDriver");
   // try
   // {
   //    com.dragonflow.Page.CGI.saveMasterConfig(hashmap, httprequest);
   // }
   // catch(Exception exception) { }
   com.dragonflow.Properties.JdbcConfig.getJdbcConfig().close();
 }