/**
   * FormsManager
   *
   * @param frontlineController FrontlineSMS
   * @param pluginController FrontlineSMS
   * @param appContext FrontlineSMS
   */
  public FormsManager(FrontlineSMS frontlineController, MappingPluginController pluginController) {
    this.pluginController = pluginController;
    frontlineController.getEventBus().registerObserver(this);

    this.contactDao = pluginController.getContactDao();
    this.categoryDao = pluginController.getCategoryDao();
    this.locationDao = pluginController.getLocationDao();
    this.incidentDao = pluginController.getIncidentDao();
    this.mappingSetupDao = pluginController.getMappingSetupDao();

    FormsPluginController formsPluginController =
        getPluginController(frontlineController, FormsPluginController.class);
    this.formDao = formsPluginController.getFormDao();
    this.formResponseDao = formsPluginController.getFormResponseDao();

    this.formName = MappingMessages.getIncidentReport();
  }
 public static void exportXformToFile(File file, Form selectedForm) throws Exception {
   FileOutputStream outStream = new FileOutputStream(file);
   String fileContent = new String();
   for (FormField ff : selectedForm.getFields()) {
     if (ff.getType() == FormFieldType.DROP_DOWN_LIST) {
       System.out.println("-------in export----------- " + ff);
     }
     fileContent = fileContent + ff.getX_form();
   }
   fileContent = FormsPluginController.removeEmptyGroups(fileContent);
   outStream.write(fileContent.getBytes("UTF-8"));
   outStream.flush();
   outStream.close();
 }