@Override @Transaction public void deleteNote(TopiaContext transaction, String topiaId) throws TopiaException, LogicException { NoteDAO dao = SandraDAOHelper.getNoteDAO(transaction); Note note = dao.findByTopiaId(topiaId); if (note == null) { throw new LogicException("error.service.note.unfound"); } dao.delete(note); String name = SandraConfigHelper.getNoteDir(SandraConfig.getConfig()) + File.separator + note.getNom(); boolean deleted = new File(name).delete(); if (!deleted) { log.error("Cant delete note : " + name); } }
@Override @Transaction public void deleteNote(TopiaContext transaction, String topiaId) throws TopiaException, LogicException { NoteDAO dao = SandraDAOHelper.getNoteDAO(transaction); Note note = dao.findByTopiaId(topiaId); if (note == null) { throw new LogicException("error.service.note.unfound"); } dao.delete(note); String name = SandraConfigHelper.getNoteDir(SandraConfig.getConfig()) + File.separator + note.getNom(); boolean deleted = new File(name).delete(); if (!deleted) { log.error("Cant delete note : " + name); } }
@Override @Transaction public InputStream getFileNote(TopiaContext transaction, String topiaId) throws TopiaException, LogicException { NoteDAO dao = SandraDAOHelper.getNoteDAO(transaction); Note note = dao.findByTopiaId(topiaId); if (note == null) { throw new LogicException("error.service.note.unfound"); } String name = SandraConfigHelper.getNoteDir(SandraConfig.getConfig()) + File.separator + note.getNom(); InputStream inputStream; try { inputStream = new FileInputStream(name); } catch (FileNotFoundException ex) { throw new LogicException("error.service.file.unfound", ex); } return inputStream; }
@Override @Transaction public InputStream getFileNote(TopiaContext transaction, String topiaId) throws TopiaException, LogicException { NoteDAO dao = SandraDAOHelper.getNoteDAO(transaction); Note note = dao.findByTopiaId(topiaId); if (note == null) { throw new LogicException("error.service.note.unfound"); } String name = SandraConfigHelper.getNoteDir(SandraConfig.getConfig()) + File.separator + note.getNom(); InputStream inputStream; try { inputStream = new FileInputStream(name); } catch (FileNotFoundException ex) { throw new LogicException("error.service.file.unfound", ex); } return inputStream; }
public Note saveNote(TopiaContext transaction, Note note, InputStream inputStream) throws TopiaException, LogicException { Note note2; NoteDAO dao = SandraDAOHelper.getNoteDAO(transaction);
public Note saveNote(TopiaContext transaction, Note note, InputStream inputStream) throws TopiaException, LogicException { Note note2; NoteDAO dao = SandraDAOHelper.getNoteDAO(transaction);
@Override @Transaction public void addNote(TopiaContext transaction, String eleveurTopiaId, String noteTopiaId) throws TopiaException, LogicException { EleveurDAO eleveurDAO = SandraDAOHelper.getEleveurDAO(transaction); Eleveur eleveur = eleveurDAO.findByTopiaId(eleveurTopiaId); if (eleveur == null) { throw new LogicException("error.service.eleveur.unfound"); } NoteDAO noteDAO = SandraDAOHelper.getNoteDAO(transaction); Note note = noteDAO.findByTopiaId(noteTopiaId); if (note == null) { throw new LogicException("error.service.note.unfound"); } eleveur.addNotes(note); eleveurDAO.update(eleveur); }
@Override @Transaction public void addNote(TopiaContext transaction, String eleveurTopiaId, String noteTopiaId) throws TopiaException, LogicException { EleveurDAO eleveurDAO = SandraDAOHelper.getEleveurDAO(transaction); Eleveur eleveur = eleveurDAO.findByTopiaId(eleveurTopiaId); if (eleveur == null) { throw new LogicException("error.service.eleveur.unfound"); } NoteDAO noteDAO = SandraDAOHelper.getNoteDAO(transaction); Note note = noteDAO.findByTopiaId(noteTopiaId); if (note == null) { throw new LogicException("error.service.note.unfound"); } eleveur.addNotes(note); eleveurDAO.update(eleveur); }
NoteDAO noteDAO = SandraDAOHelper.getNoteDAO(transaction); ActionSecuriteDAO actionSecuriteDAO = SandraDAOHelper.getActionSecuriteDAO(transaction); if (merge) {
NoteDAO noteDAO = SandraDAOHelper.getNoteDAO(transaction); ActionSecuriteDAO actionSecuriteDAO = SandraDAOHelper.getActionSecuriteDAO(transaction); if (merge) {