Ejemplo n.º 1
0
 @Command
 public void downloadSelectedSurveyFile() {
   byte[] content = surveyManager.loadSurveyFileContent(selectedSurveyFile);
   String fileName = selectedSurveyFile.getFilename();
   String contentType = URLConnection.guessContentTypeFromName(fileName);
   Filedownload.save(content, contentType, fileName);
 }
Ejemplo n.º 2
0
 private void includeIdml(ZipOutputStream zipOutputStream) {
   String entryFileName = "idml.xml";
   ZipEntry entry = new ZipEntry(entryFileName);
   try {
     zipOutputStream.putNextEntry(entry);
     surveyManager.marshalSurvey(survey, zipOutputStream);
     //			String surveyMarshalled = surveyManager.marshalSurvey(survey);
     //			PrintWriter printWriter = new PrintWriter(zipOutputStream);
     //			printWriter.write(surveyMarshalled);
     zipOutputStream.closeEntry();
     zipOutputStream.flush();
   } catch (IOException e) {
     String message = "Error while including idml into zip file: " + e.getMessage();
     if (LOG.isErrorEnabled()) {
       LOG.error(message, e);
     }
     throw new RuntimeException(message, e);
   }
 }
Ejemplo n.º 3
0
 public List<SurveyFile> getSurveyFiles() {
   return survey == null ? null : surveyManager.loadSurveyFileSummaries(survey);
 }