Esempio n. 1
0
 public void sendEmailUsingJava(String to, String content, String subjectContext) {
   // int smtpPort = 465;
   // int smtpPort = 587;
   // String smtpHost = "smtp.gmail.com";
   // int smtpPort = 25;
   // String smtpHost = "exsmtp.wvu.edu";
   String subject = constants.getString(subjectContext);
   int smtpPort = Integer.parseInt(constants.getString("smtpPort"));
   String smtpHost = constants.getString("smtpHost");
   String urPassword = constants.getString("password");
   String from = constants.getString("emailaddress");
   // String content = contentText;
   // Create a mail session
   java.util.Properties props = new java.util.Properties();
   props = System.getProperties();
   props.put("mail.smtp.host", smtpHost);
   // props.put("mail.smtp.starttls.enable", "true");
   props.put("mail.smtps.auth", "true");
   SmtpAuthenticator authentication = new SmtpAuthenticator();
   // Session session = Session.getInstance(props, null);
   Session session = Session.getInstance(props, authentication);
   session.setDebug(true);
   // Construct the message
   try {
     MimeMessage msg = new MimeMessage(session);
     msg.setFrom(new InternetAddress(from));
     msg.setRecipient(RecipientType.TO, new InternetAddress(to));
     msg.setSubject(subject);
     msg.setText(content);
     msg.setSentDate(new Date());
     Transport tr = null;
     tr = session.getTransport("smtp");
     tr.connect(smtpHost, smtpPort, from, urPassword);
     tr.sendMessage(msg, msg.getAllRecipients());
   } catch (AddressException e) {
     System.out.println(e.getClass().getName() + ": " + e.getMessage());
     Log.info(e.getClass().getName() + ": " + e.getMessage());
     StackTraceElement[] trace = e.getStackTrace();
     for (int i = 0; i < trace.length; i++) {
       System.out.println("\t" + trace[i].toString());
       Log.info("\n\t" + trace[i].toString());
     }
     e.printStackTrace();
   } catch (MessagingException e) {
     System.out.println(e.getClass().getName() + ": " + e.getMessage());
     Log.info(e.getClass().getName() + ": " + e.getMessage());
     StackTraceElement[] trace = e.getStackTrace();
     for (int i = 0; i < trace.length; i++) {
       System.out.println("\t" + trace[i].toString());
       Log.info("\n\t" + trace[i].toString());
     }
     e.printStackTrace();
   }
 }
Esempio n. 2
0
  @UiHandler("okBtn")
  public void okBtnClicked(ClickEvent event) {

    Log.info("Event :" + event.getAssociatedType());
    // event.getAssociatedType()
    EntityProxy object = listBox.getValue();
    Log.info("okBtnClicked  :" + object);

    if (object instanceof StandardizedRoleProxy) {
      Log.info("StandardizedRoleProxy");
      delegate.saveStandardizedRole(this);
    }
  }
  private void init() {
    request = requests.anamnesisCheckRequest();

    if (anamnesisCheck == null) {
      AnamnesisCheckProxy anamnesisCheck = request.create(AnamnesisCheckProxy.class);
      this.anamnesisCheck = anamnesisCheck;
      view.setEditTitle(false);
    } else {
      // cannot be set via editor...
      view.setEditTitle(true);
    }

    //		GWT.log("$$$$$$$$$$$$$$$$ anamnesisCheck be
    // title="+anamnesisCheck.getAnamnesisCheckTitle().getText());
    //		GWT.log("$$$$$$$$$$$$$$$$ anamnesisCheck be sort oder="+anamnesisCheck.getSort_order());
    anamnesisCheckBefore = anamnesisCheck;

    Log.info("edit");

    Log.info("persist");

    request.persist().using(anamnesisCheck);
    editorDriver.edit(anamnesisCheck, request);

    Log.info("flush");
    //		editorDriver.flush();
    Log.debug("Create für: " + anamnesisCheck.getId());

    // manually update value fields... (no editor support)

    view.update(anamnesisCheck);

    initInsideTitle();
    if (place.getOperation() == Operation.EDIT) {
      getQuestionsByselected(anamnesisCheck.getAnamnesisCheckTitle());
    } else if (place.getOperation() == Operation.CREATE) {
      requests
          .anamnesisCheckTitleRequest()
          .findAnamnesisCheckTitle(Long.valueOf(place.getTitleId()))
          .fire(
              new Receiver<AnamnesisCheckTitleProxy>() {

                @Override
                public void onSuccess(AnamnesisCheckTitleProxy response) {
                  getQuestionsByselected(response);
                }
              });
    }
  }
  public SPDetailsReviewAnamnesisTableSubView addAnamnesisCheckTitle(
      AnamnesisCheckTitleProxy title) {
    Log.info("initializing anamnesis check title table and putting it on tab");
    String titleText = "";

    if (title.getText() != null) {
      titleText = title.getText();
    }

    SPDetailsReviewAnamnesisTableSubView tableSubView =
        new SPDetailsReviewAnamnesisTableSubViewImpl();

    anamnesisTabs.add((Widget) tableSubView, titleText);

    // anamnesisTabs.getTabWidget(0).getParent().addStyleName("chnagedTabStyle");

    /*if (anamnesisTabs.getWidgetCount() == 1) {
    	anamnesisTabs.addSelectionHandler(new SelectionHandler<Integer>() {
    		@Override
    		public void onSelection(SelectionEvent<Integer> event) {
    			//delegate.performAnamnesisSearch();
    			//delegate.storeDisplaySettings();
    		}
    	});
    }*/
    return tableSubView;
  }
Esempio n. 5
0
  @SuppressWarnings("deprecation")
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {

    Log.info("ClinicDetailsActivity.start()");
    ClinicDetailsView ClinicDetailsView = new ClinicDetailsViewImpl();
    ClinicDetailsView.setPresenter(this);

    this.widget = panel;
    this.view = ClinicDetailsView;
    widget.setWidget(ClinicDetailsView.asWidget());

    view.setDelegate(this);
    loadDisplaySettings();

    requests
        .find(place.getProxyId())
        .fire(
            new Receiver<Object>() {

              public void onFailure(ServerFailure error) {
                Log.error(error.getMessage());
              }

              @Override
              public void onSuccess(Object response) {

                if (response instanceof ClinicProxy) {
                  Log.info(((ClinicProxy) response).getName());
                  init((ClinicProxy) response);
                }
              }
            });
  }
Esempio n. 6
0
 public static logbook.server.domain.Student findStudentFromSession() {
   HttpSession session = RequestFactoryServlet.getThreadLocalRequest().getSession();
   String shibId = (String) session.getAttribute(UNIQUE_ID);
   Log.info("shib id: " + shibId);
   Student student = Student.findStudentUsingShibId(shibId);
   return student;
 }
  @Override
  public void onTransUnitSave(TransUnitSaveEvent event) {
    TransUnitId idToSave = event.getTransUnitId();
    Log.info("TU save event: new[" + event.getTargets() + "] + old: [" + event.getOldContents());
    if (stateHasNotChanged(event)) {
      Log.info("NO OP! state has not changed for " + idToSave);
      return;
    }

    queue.push(event);
    if (queue.isSaving(idToSave)) {
      Log.info(idToSave + " has saving event. Put in queue and return.");
      return;
    }

    performSave(idToSave);
  }
    @Override
    public void onSuccess(List<AnamnesisCheckProxy> response) {
      Log.debug("setQuestionTableData() - sueccess and response size = " + response.size());
      Log.debug("dataProvider.getList().size() = " + dataProvider.getList().size());

      dataProvider.getList().clear();
      dataProvider.getList().addAll(response);
      // AnamnesisCheckActivity.this.view.getTable().setPageSize(dataProvider.getList().size());
      AnamnesisCheckActivity.this.view.setTableSize(dataProvider.getList().size());
      Log.info("page size--" + AnamnesisCheckActivity.this.view.getTable().getPageSize());
      AnamnesisCheckActivity.this.view.getTable().redraw();
      dataProvider.refresh();
      AnamnesisCheckActivity.this.view.getTable().redraw();
      // innerSystemStartView.getTable().cellTable.setPageSize(25);
      // anamnesisCheckTable.cellTable.setPageSize(25);
      Log.info("data provider--" + dataProvider.getList().size());
    }
Esempio n. 9
0
  private void loadDisplaySettings() {
    int detailsTab = 0;
    if (userSettings.hasSettings()) {
      Log.info("Loading Display");
      detailsTab = userSettings.getIntValue("detailsTab");
    }

    view.setSelectedDetailsTab(detailsTab);
  }
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {

    Log.info("AnamnesisCheckEditActivity.start()");
    AnamnesisCheckEditView anamnesisCheckEditView = new AnamnesisCheckEditViewImpl();

    this.widget = panel;
    this.view = anamnesisCheckEditView;

    editorDriver = view.createEditorDriver();

    view.setDelegate(this);

    if (this.place.getOperation() == Operation.EDIT) {
      Log.info("edit");
      requests
          .find(place.getProxyId())
          .with("anamnesisForm", "anamnesisCheckTitle")
          .fire(
              new Receiver<Object>() {
                public void onFailure(ServerFailure error) {
                  Log.error(error.getMessage());
                }

                @Override
                public void onSuccess(Object response) {
                  if (response instanceof AnamnesisCheckProxy) {
                    Log.info(((AnamnesisCheckProxy) response).getId().toString());
                    // init((AnamnesisCheckProxy) response);
                    anamnesisCheck = (AnamnesisCheckProxy) response;
                    init();
                  }
                }
              });
    } else {

      Log.info("new AnamnesisCheck");
      // anamnesisCheckPlace.setProxyId(anamnesisCheck.stableId());
      init();
    }
    // view.initialiseDriver(requests);
    widget.setWidget(anamnesisCheckEditView.asWidget());
    // setTable(view.getTable());
  }
  @Override
  public void execute() {
    Log.info("ENTER DummyActivateWorkspaceCommand.execute()");
    WorkspaceContext context =
        new WorkspaceContext(action.getWorkspaceId(), "Dummy Workspace", "Mock Sweedish");
    WorkspaceRestrictions workspaceRestrictions =
        new WorkspaceRestrictions(true, true, true, true, true);
    UserWorkspaceContext userWorkspaceContext =
        new UserWorkspaceContext(context, workspaceRestrictions);
    userWorkspaceContext.setSelectedDoc(
        new DocumentInfo(
            new DocumentId(new Long(1), "Dummy path/Dummy doc"),
            "Dummy doc",
            "Dummy path",
            LocaleId.EN_US,
            null,
            new AuditInfo(new Date(), "Translator"),
            new HashMap<String, String>(),
            new AuditInfo(new Date(), "last translator")));

    Identity identity =
        new Identity(
            new EditorClientId("123456", 1),
            new Person(
                new PersonId("bob"),
                "Bob The Builder",
                "http://www.gravatar.com/avatar/[email protected]?d=mm&s=16"));

    ValidationFactory validationFactory = new ValidationFactory(null);
    Map<ValidationId, ValidationAction> validationMap = validationFactory.getAllValidationActions();
    Map<ValidationId, ValidationInfo> validationInfoList =
        new HashMap<ValidationId, ValidationInfo>();

    for (ValidationAction action : validationMap.values()) {
      validationInfoList.put(action.getId(), action.getValidationInfo());
    }

    callback.onSuccess(
        new ActivateWorkspaceResult(
            userWorkspaceContext, identity, new UserConfigHolder().getState(), validationInfoList));
    Log.info("EXIT DummyActivateWorkspaceCommand.execute()");
  }
Esempio n. 12
0
 public static Short checkShort(Short shortValue) {
   Short newShort = 0;
   try {
     if (shortValue == null) {
       return newShort;
     }
   } catch (NumberFormatException e) {
     Log.info("Number Formater Exception at checkInteger");
     e.printStackTrace();
   }
   return shortValue;
 }
 public void onSuccess(HashMap<Integer, String> project) {
   if (project != null) {
     Set<Entry<Integer, String>> entrySet = project.entrySet();
     for (Entry<Integer, String> entry : entrySet) {
       currentUser.setPreferredProjectId(entry.getKey());
       currentUser.setPreferredProject(entry.getValue());
       Log.info("Upload Job: " + entry.getKey() + " " + entry.getValue());
     }
     userCtx.setCurrentUser(currentUser);
   }
   createComponent();
 }
Esempio n. 14
0
 public static Integer checkInteger(Integer integer) {
   Integer newInteger = new Integer(0);
   try {
     if (integer == null) {
       return newInteger;
     }
   } catch (NumberFormatException e) {
     Log.info("Number Formater Exception at checkInteger");
     e.printStackTrace();
   }
   return integer;
 }
Esempio n. 15
0
 public static Long checkLongr(Long longValue) {
   Long newLong = new Long(0);
   try {
     if (longValue == null) {
       return newLong;
     }
   } catch (NumberFormatException e) {
     Log.info("Number Formater Exception at checkInteger");
     e.printStackTrace();
   }
   return longValue;
 }
Esempio n. 16
0
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {
    Log.info("SystemStartActivity.start()");
    SummoningsView systemStartView = new SummoningsViewImpl();
    systemStartView.setPresenter(this);
    this.widget = panel;
    this.view = systemStartView;
    widget.setWidget(systemStartView.asWidget());

    init();

    view.setDelegate(this);
  }
  public void getUpdatedNetInterface(GwtNetInterfaceConfig updatedNetIf) {
    if (m_formPanel != null) {
      String modeValue = m_modeCombo.getValue().getValue();
      for (GwtNetRouterMode mode : GwtNetRouterMode.values()) {
        Log.info("Possible Mode: " + mode.name() + " with util: " + MessageUtils.get(mode.name()));
        if (MessageUtils.get(mode.name()).equals(modeValue)) {
          updatedNetIf.setRouterMode(mode.name());
        }
      }
      Log.info("Mode Value: " + modeValue);

      updatedNetIf.setRouterDhcpBeginAddress(m_dhcpBeginAddressField.getValue());
      updatedNetIf.setRouterDhcpEndAddress(m_dhcpEndAddressField.getValue());
      updatedNetIf.setRouterDhcpSubnetMask(m_dhcpSubnetMaskField.getValue());
      if (m_dhcpLeaseDefaultField.getValue() != null) {
        updatedNetIf.setRouterDhcpDefaultLease(m_dhcpLeaseDefaultField.getValue().intValue());
      }
      if (m_dhcpLeaseMaxField.getValue() != null) {
        updatedNetIf.setRouterDhcpMaxLease(m_dhcpLeaseMaxField.getValue().intValue());
      }
      updatedNetIf.setRouterDnsPass(m_passDnsRadioTrue.getValue());
    }
  }
  @Override // hard login
  public void login(String username) throws CometSessionException {
    HttpSession httpSession = getSessionOrCreate();
    CometSession cometSession = getCometSessionOrCreate(httpSession);

    httpSession.setAttribute("username", username);

    if (users.putIfAbsent(username, cometSession) != null) {
      // some one else has already logged in with this user name
      httpSession.invalidate();
      throw new CometSessionException(username, "User: "******" already logged in");
    }

    Log.info(username + " is logged in");
  }
 private boolean stateHasNotChanged(TransUnitSaveEvent event) {
   TransUnit transUnit = navigationService.getByIdOrNull(event.getTransUnitId());
   if (transUnit == null) {
     return false;
   }
   Log.info(
       "id:"
           + transUnit.getId()
           + " old contents: "
           + transUnit.getTargets()
           + " state: "
           + transUnit.getStatus());
   return Objects.equal(transUnit.getStatus(), event.getAdjustedStatus())
       && Objects.equal(transUnit.getTargets(), event.getTargets());
 }
  private void performSave(TransUnitId idToSave) {
    TransUnitSaveEvent forSaving = queue.getNextPendingForSaving(idToSave);
    if (forSaving == null) {
      Log.info("no pending save for " + idToSave);
      return;
    }

    targetContentsPresenter.setEditingState(idToSave, TargetContentsDisplay.EditingState.SAVING);

    UpdateTransUnit updateTransUnit =
        new UpdateTransUnit(
            new TransUnitUpdateRequest(
                idToSave,
                forSaving.getTargets(),
                forSaving.getAdjustedStatus(),
                forSaving.getVerNum(),
                sourceType),
            TransUnitUpdated.UpdateType.WebEditorSave);
    Log.info("about to save translation: " + updateTransUnit);
    dispatcher.execute(
        updateTransUnit,
        new UpdateTransUnitCallback(
            forSaving, documentListPresenter.getCurrentDocument(), idToSave));
  }
Esempio n. 21
0
 private void log(Message message) {
   String formattedMessage =
       "At [" + message.getFired() + "] MessageCenter received: " + message.getConciseMessage();
   if (message.severity == Message.Severity.Info) {
     Log.info(formattedMessage);
   } else if (message.severity == Message.Severity.Warning) {
     Log.warn(formattedMessage);
   } else if (message.severity == Message.Severity.Error) {
     Log.error(formattedMessage);
   } else if (message.severity == Message.Severity.Fatal) {
     Log.fatal(formattedMessage);
   } else {
     Log.debug(formattedMessage);
   }
 }
Esempio n. 22
0
  /** The activity has started */
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {
    Log.info("SystemStartActivity.start()");
    AnamnesisCheckView systemStartView = new AnamnesisCheckViewImpl();
    innerSystemStartView = systemStartView;
    //        AnamnesisCheckView systemStartView = getAnamnesisCheckView();
    systemStartView.setPresenter(this);
    this.widget = panel;
    this.view = systemStartView;

    MenuClickEvent.register(requests.getEventBus(), (AnamnesisCheckViewImpl) view);

    widget.setWidget(systemStartView.asWidget());
    init();

    activityManger.setDisplay(view.getDetailsPanel());
    placeChangeHandlerRegistration =
        eventBus.addHandler(
            PlaceChangeEvent.TYPE,
            new PlaceChangeEvent.Handler() {

              @Override
              public void onPlaceChange(PlaceChangeEvent event) {
                if (event.getNewPlace() instanceof AnamnesisCheckDetailsPlace) {
                  requests.getEventBus().fireEvent(new ApplicationLoadingScreenEvent(true));
                  view.setDetailPanel(true);
                  requests.getEventBus().fireEvent(new ApplicationLoadingScreenEvent(false));
                  AnamnesisCheckDetailsPlace place =
                      (AnamnesisCheckDetailsPlace) event.getNewPlace();
                  if (place.getOperation() == Operation.NEW) {
                    requests.getEventBus().fireEvent(new ApplicationLoadingScreenEvent(false));
                    getSearchStringByEntityProxyId(
                        (EntityProxyId<AnamnesisCheckProxy>) place.getProxyId());
                  }
                } else if (event.getNewPlace() instanceof AnamnesisCheckPlace) {
                  view.setDetailPanel(false);
                  AnamnesisCheckPlace place = (AnamnesisCheckPlace) event.getNewPlace();
                  if (place.getToken().contains("!DELETED")) {
                    //                        initSearch();
                  }
                }
              }
            });
  }
Esempio n. 23
0
  /** {@inheritDoc} */
  @Override
  public void onValueChange(final ValueChangeEvent<String> event) {
    try {

      final PageRequest pageRequest = PageRequest.fromString(event.getValue(), pages);

      // A popup page cannot be accessed directly by URL modification (such as <a> elements).
      if (isPopupView(pageRequest.getPage())) {
        if (Log.isInfoEnabled()) {
          Log.info("Popup page '" + pageRequest + "' cannot be accessed directly by URL.");
        }
        eventBus.navigate(null);
      } else {
        eventBus.fireEvent(new PageRequestEvent(pageRequest, true));
      }

    } catch (final PageParsingException e) {
      eventBus.navigate(null);
    }
  }
  @Override
  public void logout(String username) throws CometSessionException {
    HttpSession httpSession = getSession();
    if (httpSession == null) {
      throw new CometSessionException(
          username, "User: "******" is not logged in: no http session");
    }

    CometSession cometSession = getCometSession(httpSession);
    if (cometSession == null) {
      throw new CometSessionException(
          username, "User: "******" is not logged in: no comet session");
    }

    if (!username.equals(httpSession.getAttribute("username"))) {
      throw new CometSessionException(
          username, "User: "******" is not logged in on this session");
    }

    users.remove(username, cometSession);
    httpSession.invalidate();

    Log.info(username + " is logged out");
  }
Esempio n. 25
0
  public void callSendEmailScript(String to, String content, String subjectContext) {
    String subject = constants.getString(subjectContext);
    ResourceBundle scriptsPathConstants = ResourceBundle.getBundle("Scripts");
    File wd = new File(scriptsPathConstants.getString("send_email_path").trim());
    String scriptFileName = scriptsPathConstants.getString("send_project_email").trim();
    String path = wd + File.separator + scriptFileName;
    System.out.println("Script Working Directory: " + path);
    Log.info("Script Working Directory: " + path);

    try {
      // Log.info("Email argument: " + content);
      // System.out.println("Email argument: " + content);
      ProcessBuilder processBuilder = new ProcessBuilder();
      processBuilder.command(path, to, subject, content);
      Process proc = processBuilder.start();
      /* String argument = path + scriptFileName + " \"" + to + "\" \"" + subject + "\" \"" + content + "\"";
      Log.info("Email argument: " + argument);
      System.out.println("Email argument: " + argument);*/
      // proc = Runtime.getRuntime().exec(argument, null);
      // proc = Runtime.getRuntime().exec(argument);
      int exitValue = proc.waitFor();
      Log.info("After executing script: " + path + " exitValue: " + exitValue);
    } catch (InterruptedException e) {
      System.out.println(e.getClass().getName() + ": " + e.getMessage());
      Log.info(e.getClass().getName() + ": " + e.getMessage());
      StackTraceElement[] trace = e.getStackTrace();
      for (int i = 0; i < trace.length; i++) {
        System.out.println("\t" + trace[i].toString());
        Log.info("\n\t" + trace[i].toString());
      }
      e.printStackTrace();
    } catch (Exception e) {
      System.out.println(e.getClass().getName() + ": " + e.getMessage());
      Log.info(e.getClass().getName() + ": " + e.getMessage());
      StackTraceElement[] trace = e.getStackTrace();
      for (int i = 0; i < trace.length; i++) {
        System.out.println("\t" + trace[i].toString());
        Log.info("\n\t" + trace[i].toString());
      }
      e.printStackTrace();
    }
  }
  @SuppressWarnings("deprecation")
  @Override
  public void saveClicked() {

    Log.info("saveClicked");
    request = (AnamnesisCheckRequest) editorDriver.flush();
    anamnesisCheck = request.edit(anamnesisCheck);

    anamnesisCheck.setValue(view.getValue());

    Long selectedInsideTitle = -1L;
    if (view.getSelectedInsideTitle() != null
        && !view.getSelectedInsideTitle().equals("")
        && view.getSelectedInsideTitle().length() != 0) {
      selectedInsideTitle = Long.valueOf(view.getSelectedInsideTitle());
    }
    if (selectedInsideTitle != -1L) {
      requests
          .anamnesisCheckTitleRequest()
          .findAnamnesisCheckTitle(selectedInsideTitle)
          .fire(
              new Receiver<AnamnesisCheckTitleProxy>() {
                public void onFailure(ServerFailure error) {
                  Log.error(error.getMessage());
                }

                @Override
                public void onSuccess(AnamnesisCheckTitleProxy response) {

                  // GWT.log("$$$$$$$$$$$$$$$$$$$$ anamnesisCheck.getAnamnesisCheckTitle().getText()
                  // = "+anamnesisCheck.getAnamnesisCheckTitle().getText());
                  // GWT.log("$$$$$$$$$$$$$$$$$$$$ response.getText() = "+response.getText());

                  // if(anamnesisCheckTitleBefore != null &&
                  // anamnesisCheckTitleBefore.getId() ==
                  // response.getId()){
                  // isTitleChange = false ;
                  // }else{
                  // isTitleChange = true ;
                  // }
                  // GWT.log("$$$$$$$$$$$$$$$$$$$$ isTitleChange = "+isTitleChange);
                  anamnesisCheck.setAnamnesisCheckTitle(response);

                  // if(isTitleChange == true && place.getOperation()
                  // == Operation.EDIT){
                  // reSorting(anamnesisCheckTitleBefore,
                  // anamnesisCheck.getSort_order());
                  // }else{
                  // saveData();
                  // }

                  // save data
                  // Highlight onViolation
                  Log.info("Map Size: " + view.getAnamnesisCheckMap().size());
                  request.fire(
                      new OSCEReceiver<Void>(view.getAnamnesisCheckMap()) {
                        // E Highlight onViolation

                        public void onFailure(ServerFailure error) {
                          Log.error(error.getMessage());
                        }

                        // Highlight onViolation
                        /*@Override
                        public void onViolation(Set<Violation> errors) {
                        	Iterator<Violation> iter = errors
                        			.iterator();
                        	String message = "";
                        	while (iter.hasNext()) {
                        		message += iter.next().getMessage()
                        				+ "<br>";
                        	}
                        	Log.warn(" in AnamnesisCheck -" + message);

                        }*/
                        // E Highlight onViolation

                        @Override
                        public void onSuccess(Void response) {
                          Log.info("AnamnesisCheck successfully saved.");

                          save = true;

                          saveOrEditAnamnesisCheckTitleInSpportal(anamnesisCheck);
                          sortOderByPrevious();
                          // placeController.goTo(new
                          // AnamnesisCheckDetailsPlace(anamnesisCheck.stableId(),
                          // Operation.NEW));
                        }
                      });
                }
              });
    } else {
      Window.alert("Please choose a title!");
    }
  }
Esempio n. 27
0
 @SuppressWarnings("deprecation")
 @Override
 public void editClicked() {
   Log.info("edit clicked");
   goTo(new ClinicDetailsPlace(clinicProxy.stableId(), Operation.EDIT));
 }
Esempio n. 28
0
  @SuppressWarnings("deprecation")
  private void init(ClinicProxy ClinicProxy) {

    Log.info("response size ");
    this.clinicProxy = ClinicProxy;
    Log.info("Clinic ID ::: " + clinicProxy.getId());

    requests
        .clinicRequestNonRoo()
        .findAllDoctorsId(clinicProxy.getId())
        .with("doctars", "doctors.specialisation")
        .fire(
            new OSCEReceiver<List<ClinicProxy>>() {

              @Override
              public void onSuccess(List<ClinicProxy> response) {
                Log.info("inside Success ");

                stackIndex = 0;

                if (response != null && response.size() > 0) {

                  clinicProxyList = response;

                  Iterator<ClinicProxy> clinicList = response.iterator();

                  clinicProxy = response.get(0);

                  while (clinicList.hasNext()) {

                    Log.info("into next value");
                    ClinicProxy clinicProxy = clinicList.next();

                    Log.info("Size of Doctors " + clinicProxy.getDoctors().size());

                    List<DoctorProxy> l = new ArrayList<DoctorProxy>(clinicProxy.getDoctors());

                    final ClinicSubView clinicSubView = new ClinicSubViewImpl();

                    clinicSubView.setDelegate(clinicDetailsActivity);
                    String clinicLable = "";
                    if (l.get(0) != null && l.get(0).getSpecialisation() != null) {

                      Log.info("Data is  available");

                      clinicLable = l.get(0).getSpecialisation().getName();
                    }

                    //	view.setValue(ClinicProxy);

                    // view.getSpecialTabPanel().insert(clinicSubView, stackIndex);
                    view.getSpecialTabPanel().add((Widget) clinicSubView, clinicLable, true);

                    Log.info("clinicID::::" + clinicProxy.getId());

                    requests
                        .clinicRequest()
                        .findClinic(clinicProxy.getId())
                        .with(
                            "doctors",
                            "doctors.specialisation",
                            "doctors.specialisation.oscePostBlueprint",
                            "doctors.specialisation.oscePostBlueprint.osce")
                        .fire(
                            new OSCEReceiver<ClinicProxy>() {

                              @Override
                              public void onSuccess(
                                  ch.unibas.medizin.osce.client.managed.request.ClinicProxy
                                      response) {
                                Log.info("response" + response.getDoctors().size());
                                List<DoctorProxy> doctors = new ArrayList<DoctorProxy>();
                                doctors.addAll(response.getDoctors());
                                clinicSubView.getTable().setRowData(doctors);
                                Log.info("Array count" + arrarycount);
                              }
                            });
                    stackIndex++;

                    Log.info("Stack value:::::" + stackIndex);
                  }
                }
              }
            });

    view.setValue(clinicProxy);
    view.setDelegate(this);
  }
 public void onFailure(Throwable caught) {
   Log.info("ProjectList projectListCallback error: " + caught.toString());
 }
 public void onFailure(Throwable caught) {
   Log.info("UploadJob preferredProjectCallback error: " + caught.toString());
 }