Esempio n. 1
0
 public ProfileExporter getProfileExporter(String exporterKey) {
   for (ProfileExporter exporter : exporters) {
     if (StringUtils.equals(exporterKey, exporter.getKey())) {
       return exporter;
     }
   }
   return null;
 }
Esempio n. 2
0
 public List<ProfileExporter> getProfileExportersForLanguage(String language) {
   List<ProfileExporter> result = new ArrayList<ProfileExporter>();
   for (ProfileExporter exporter : exporters) {
     if (exporter.getSupportedLanguages() == null
         || exporter.getSupportedLanguages().length == 0
         || ArrayUtils.contains(exporter.getSupportedLanguages(), language)) {
       result.add(exporter);
     }
   }
   return result;
 }
Esempio n. 3
0
 public String exportProfile(int profileId, String exporterKey) {
   DatabaseSession session = sessionFactory.getSession();
   RulesProfile profile = loadProfile(session, profileId);
   if (profile != null) {
     ProfileExporter exporter = getProfileExporter(exporterKey);
     Writer writer = new StringWriter();
     exporter.exportProfile(profile, writer);
     return writer.toString();
   }
   return null;
 }