/**
  * add organizer to properties
  *
  * @param appointment
  * @param properties
  */
 private void addOrganizer(
     Appointment appointment, PropertyList properties, boolean doExportAsMeeting) {
   // means we do not export attendees so we do not have a meeting
   if (!doExportAsMeeting) return;
   final User owner = appointment.getReservation().getOwner();
   try {
     Organizer organizer = null;
     if (owner.getEmail() != null && owner.getEmail().trim().length() > 0) {
       try {
         final URI uri = new URI("MAILTO:" + owner.getEmail().trim());
         organizer = new Organizer(uri);
       } catch (URISyntaxException e) {
       }
     }
     if (organizer == null) {
       organizer = new Organizer("MAILTO:" + URLEncoder.encode(owner.getUsername(), "UTF-8"));
     }
     if (!"".equals(owner.getName())) organizer.getParameters().add(new Cn(owner.getName()));
     properties.add(organizer);
   } catch (URISyntaxException e) {
     throw new IllegalArgumentException(e);
   } catch (UnsupportedEncodingException e) {
     throw new IllegalArgumentException(e);
   }
 }
Пример #2
0
  private void create() throws RaplaException {
    superPanel.removeAll();
    TableLayout tableLayout =
        new TableLayout(
            new double[][] {
              {
                TableLayout.PREFERRED,
                5,
                TableLayout.PREFERRED,
                5,
                TableLayout.PREFERRED,
                5,
                TableLayout.PREFERRED
              },
              {
                TableLayout.PREFERRED,
                5,
                TableLayout.PREFERRED,
                5,
                TableLayout.PREFERRED,
                5,
                TableLayout.PREFERRED,
                5,
                TableLayout.PREFERRED,
                5,
                TableLayout.PREFERRED,
                5,
                TableLayout.PREFERRED
              }
            });
    languageChooser = new LanguageChooser(getLogger(), getI18n(), getRaplaLocale());
    RaplaButton changeNameButton = new RaplaButton();
    RaplaButton changeEmailButton = new RaplaButton();
    RaplaButton changePasswordButton = new RaplaButton();

    superPanel.setLayout(tableLayout);
    superPanel.add(new JLabel(getString("language") + ": "), "0,0");
    superPanel.add(languageChooser.getComponent(), "2,0");
    superPanel.add(new JLabel(getString("username") + ": "), "0,2");
    superPanel.add(usernameLabel, "2,2");
    superPanel.add(new JLabel(), "4,2");
    superPanel.add(new JLabel(getString("name") + ": "), "0,4");
    superPanel.add(nameLabel, "2,4");
    superPanel.add(changeNameButton, "4,4");
    superPanel.add(new JLabel(getString("email") + ": "), "0,6");
    superPanel.add(emailLabel, "2,6");
    superPanel.add(changeEmailButton, "4,6");
    changeNameButton.setText(getString("change"));
    changeNameButton.addActionListener(new MyActionListener());
    nameLabel.setText(this.getClientFacade().getUser().getName());
    emailLabel.setText(this.getClientFacade().getUser().getEmail());
    changeEmailButton.setText(getString("change"));
    changeEmailButton.addActionListener(new MyActionListener2());
    superPanel.add(new JLabel(getString("password") + ":"), "0,8");
    superPanel.add(new JLabel("****"), "2,8");
    superPanel.add(changePasswordButton, "4,8");
    PasswordChangeAction passwordChangeAction =
        new PasswordChangeAction(getContext(), createPopupContext(getComponent(), null));
    User user = getUser();
    passwordChangeAction.changeObject(user);
    changePasswordButton.setAction(new ActionWrapper(passwordChangeAction));
    changePasswordButton.setText(getString("change"));
    usernameLabel.setText(user.getUsername());
  }