Ejemplo n.º 1
0
 private void init() {
   Server server = serverController.getSelectedServer();
   partnershipList = null;
   if (server != null) {
     jDBCDataSource.setParameters(
         server.getDbAddress(),
         server.getDbPort(),
         server.getDbName(),
         server.getDbUser(),
         server.getDbPassword());
     partnershipManager.setjDBCDataSource(jDBCDataSource);
     partnershipList = partnershipManager.getAllPartnerships();
     //            selectedPartnership = null;
   }
 }
Ejemplo n.º 2
0
 public void addPartnership() {
   Server server = serverController.getSelectedServer();
   if (server != null) {
     partnershipManager.addPartnership(newPartnership);
   }
   // TODO cos na widok jesli blad
 }
Ejemplo n.º 3
0
 public void deletePartnership() {
   if (selectedPartnership != null) {
     if (partnershipManager.deletePartnership(selectedPartnership)) {
       init();
     } else {
       Messages.addError("partnershipDelete", bundle.getString("partnership.dialog.delete.error"));
       Faces.getContext().validationFailed();
     }
   } else {
     Messages.addError("partnershipDelete", bundle.getString("partnership.dialog.delete.error"));
     Faces.getContext().validationFailed();
   }
 }
Ejemplo n.º 4
0
 public void deleteAllPartnerships() {
   boolean error = false;
   init();
   for (PartnershipDVO partnershipDVO : partnershipList) {
     if (false == partnershipManager.deletePartnership(partnershipDVO)) {
       error = true;
     }
   }
   init();
   if (error) {
     Faces.getContext().validationFailed();
   }
 }
Ejemplo n.º 5
0
 public void editPartnership() {
   if (selectedPartnership != null) {
     if (partnershipManager.updatePartnership(selectedPartnership) == true) {
       init();
     } else {
       Messages.addError("partnershipUpdate", bundle.getString("partnership.dialog.update.error"));
       Faces.getContext().validationFailed();
     }
   } else {
     Messages.addError(
         "partnershipUpdate", bundle.getString("partnership.dialog.update.error.notselected"));
     Faces.getContext().validationFailed();
   }
 }
Ejemplo n.º 6
0
 public void createNewPartnership() {
   newPartnership = partnershipManager.createPartnershipDVO();
 }