use of mom.trd.opentheso.bdd.helper.ExternalImagesHelper in project opentheso by miledrousset.
the class ExternalResources method addExternalImage.
public void addExternalImage(String idTheso, String idConcept, int idUser) {
String copyRight = "";
if (inputUri == null || inputUri.isEmpty()) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error5")));
return;
}
ExternalImagesHelper imagesHelper = new ExternalImagesHelper();
if (inputLable == null || inputLable.isEmpty()) {
inputLable = idConcept;
}
if (!imagesHelper.addExternalImage(connect.getPoolConnexion(), idConcept, idTheso, inputLable, copyRight, inputUri, idUser)) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("Error-BDD")));
return;
}
loadImages(idTheso, idConcept);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "", langueBean.getMsg("externalResources.addedImage")));
}
use of mom.trd.opentheso.bdd.helper.ExternalImagesHelper in project opentheso by miledrousset.
the class ExternalResources method deleteExternalImage.
public void deleteExternalImage(String idTheso, String idConcept, String imageUri) {
ExternalImagesHelper imagesHelper = new ExternalImagesHelper();
if (!imagesHelper.deleteExternalImage(connect.getPoolConnexion(), idConcept, idTheso, imageUri)) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("Error-BDD")));
return;
}
loadImages(idTheso, idConcept);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "", langueBean.getMsg("externalResources.deleteImage")));
}
use of mom.trd.opentheso.bdd.helper.ExternalImagesHelper in project opentheso by miledrousset.
the class SelectedThesaurus method regenIdConcept.
/**
* Cette fonction remplace tout les id des concepts du théso
*/
private void regenIdConcept(Connection conn, String idTheso, ArrayList<String> idGroup) throws Exception {
/*récup les concepts*/
ConceptHelper conceptHelper = new ConceptHelper();
ArrayList<String> idConcepts = conceptHelper.getAllIdConceptOfThesaurus(conn, idTheso);
if (idConcepts == null || idConcepts.isEmpty()) {
throw new Exception("No concept in this thesaurus");
}
/*génération des nouveaux id*/
ArrayList<String> reservedId = idConcepts;
reservedId.addAll(idGroup);
ArrayList<String> newIdConcepts = createNewId(reservedId, idConcepts.size());
/*maj des tables*/
NoteHelper noteHelper = new NoteHelper();
GpsHelper gpsHelper = new GpsHelper();
ImagesHelper imagesHelper = new ImagesHelper();
ExternalImagesHelper externalImagesHelper = new ExternalImagesHelper();
AlignmentHelper alignmentHelper = new AlignmentHelper();
for (int i = 0; i < idConcepts.size(); i++) {
String id = idConcepts.get(i);
String newId = newIdConcepts.get(i);
// table concept
conceptHelper.setIdConcept(conn, idTheso, id, newId);
// table concept_group_concept
conceptHelper.setIdConceptGroupConcept(conn, idTheso, id, newId);
// table concept_historique
conceptHelper.setIdConceptHistorique(conn, idTheso, id, newId);
// table concept_orphan
conceptHelper.setIdConceptOrphan(conn, idTheso, id, newId);
// table gps
gpsHelper.setIdConceptGPS(conn, idTheso, id, newId);
// table hierarchical_relationship
conceptHelper.setIdConceptHieraRelation(conn, idTheso, id, newId);
// table hierarchical_relationship_historique
conceptHelper.setIdConceptHieraRelationHisto(conn, idTheso, id, newId);
// table note
noteHelper.setIdConceptNote(conn, idTheso, id, newId);
// table note_historique
noteHelper.setIdConceptNoteHisto(conn, idTheso, id, newId);
// table images
imagesHelper.setIdConceptImage(conn, idTheso, id, newId);
// table external images
externalImagesHelper.setIdConceptExternalImage(conn, idTheso, id, newId);
// table concept_fusion
conceptHelper.setIdConceptFusion(conn, idTheso, id, newId);
// table preferred_term
conceptHelper.setIdConceptPreferedTerm(conn, idTheso, id, newId);
// table alignement
alignmentHelper.setIdConceptAlignement(conn, idTheso, id, newId);
}
}
use of mom.trd.opentheso.bdd.helper.ExternalImagesHelper in project opentheso by miledrousset.
the class ExternalResources method loadImages.
public void loadImages(String idTheso, String idConcept) {
images.clear();
ExternalImagesHelper imagesHelper = new ExternalImagesHelper();
nodeImages = imagesHelper.getExternalImages(connect.getPoolConnexion(), idConcept, idTheso);
if (nodeImages == null)
return;
for (NodeImage nodeImage : nodeImages) {
images.add(nodeImage.getUri());
}
}
use of mom.trd.opentheso.bdd.helper.ExternalImagesHelper in project opentheso by miledrousset.
the class Alignment method getExternalImagesOfConcept.
/**
* permet de récuprer les images du concepts (URI des images)
* pour pouvoir structurer l'objet pour comparer les images locales et distantes
* @param idConcept
* @param idTheso
*/
private void getExternalImagesOfConcept(String idTheso, String idConcept) {
ExternalImagesHelper imagesHelper = new ExternalImagesHelper();
nodeImages = imagesHelper.getExternalImages(connect.getPoolConnexion(), idConcept, idTheso);
}
Aggregations