@Logged
 public List<Status> getTranslationEntityStati(String modelIdentifier, String lang) {
   Set<Status> set = new LinkedHashSet<Status>();
   set.addAll(documentDAO.getDocumentStati(modelIdentifier, lang));
   set.addAll(imageDAO.getImageStati(modelIdentifier, lang));
   set.addAll(translateableTextDAO.getTextElementStati(modelIdentifier, lang));
   return new ArrayList<Status>(set);
 }
 public void markModelElementAsInArbeit(ModelElement modelElement, List<String> langsToGenerate) {
   for (TranslateableText translateableText : modelElement.getTexts()) {
     if (langsToGenerate.contains("fr")) {
       translateableText.setStatusFr(IN_ARBEIT);
     }
     if (langsToGenerate.contains("it")) {
       translateableText.setStatusIt(IN_ARBEIT);
     }
     if (langsToGenerate.contains("en")) {
       translateableText.setStatusEn(IN_ARBEIT);
     }
     translateableTextDAO.merge(translateableText);
   }
 }
  public ModelElement getModelElement(String modelIdentifier, String rootElementIdentifier) {
    List<TranslateableText> modelElementTexts = new ArrayList<TranslateableText>();
    List<TranslateableText> texts = translateableTextDAO.getTexts(modelIdentifier);
    for (TranslateableText text : texts) {
      if (text.getRootElementIdentifier().equals(rootElementIdentifier)) {
        modelElementTexts.add(text);
      }
    }

    TranslateableText firstText = modelElementTexts.get(0);
    return new ModelElement(
        firstText.getFileType(),
        firstText.getFileName(),
        status(statusFr(modelElementTexts)),
        status(statusIt(modelElementTexts)),
        status(statusEn(modelElementTexts)),
        modelElementTexts);
  }
 private List<ModelElement> getModelElements(String modelIdentifier) {
   List<ModelElement> result = new ArrayList<ModelElement>();
   List<TranslateableText> texts = translateableTextDAO.getTexts(modelIdentifier);
   for (Entry<String, List<TranslateableText>> byFileType : divideByFileType(texts).entrySet()) {
     String typ = byFileType.getKey();
     for (Entry<String, List<TranslateableText>> byFileName :
         divideByFilename(byFileType.getValue()).entrySet()) {
       result.add(
           new ModelElement(
               typ,
               byFileName.getKey(),
               status(statusFr(byFileName.getValue())),
               status(statusIt(byFileName.getValue())),
               status(statusEn(byFileName.getValue())),
               byFileName.getValue()));
     }
   }
   return result;
 }
 public List<TranslateableText> getTexts(String modelIdentifier) {
   return translateableTextDAO.getTexts(modelIdentifier);
 }
 public TranslateableText getTranslateableText(
     String modelIdentifier, String elementIdentifier, String textIdentifier) {
   return translateableTextDAO.getSpecificText(modelIdentifier, elementIdentifier, textIdentifier);
 }