private void savePersonalAttendant(User user) {
    getMailboxPreferences().updateUser(user);
    MailboxManager mailMgr = getMailboxManager();
    mailMgr.storePersonalAttendant(getPersonalAttendant());

    user.getSettings().getSetting(OPERATOR_SETTING).setValue(getPersonalAttendant().getOperator());
    getCoreContext().saveUser(user);
  }
  public void save() {
    if (!TapestryUtils.isValid(this)) {
      return;
    }

    User user = getUserForEditing();
    UserForm.updatePin(this, user, getCoreContext().getAuthorizationRealm());
    getCoreContext().saveUser(user);

    savePersonalAttendant(user);
    MailboxManager mailMgr = getMailboxManager();
    if (mailMgr.isEnabled()) {
      mailMgr.writePreferencesFile(user);
    }
  }
Example #3
0
  protected void execute(List<BackupBean> backups, boolean verify) {
    BackupBean config = null;
    BackupBean voicemail = null;
    BackupBean cdr = null;
    for (BackupBean bean : backups) {
      if (bean.getType().equals(BackupBean.Type.CONFIGURATION)) {
        config = bean;
      } else if (bean.getType().equals(BackupBean.Type.VOICEMAIL)) {
        voicemail = bean;
      } else if (bean.getType().equals(BackupBean.Type.CDR)) {
        cdr = bean;
      }
    }

    if (voicemail != null) {
      if (verify) {
        // verify locally if valid archive
        runRestoreScript(voicemail, verify, true);
      } else {
        m_mailboxManager.performRestore(voicemail, config != null);
      }
    }

    if (cdr != null) {
      runRestoreScript(cdr, verify, false);
    }

    if (config != null) {
      runRestoreScript(config, verify, false);
    }
  }
  @Override
  public void pageBeginRender(PageEvent event) {
    super.pageBeginRender(event);

    if (getAvailableTabNames() == null) {
      initAvailableTabs();
    }

    User user = getUserForEditing();
    if (user == null) {
      user = getUser();
      setUserForEditing(user);
    }

    UserForm.initializePin(getComponent("pin"), this, user);

    MailboxManager mailMgr = getMailboxManager();
    if (getMailboxPreferences() == null && mailMgr.isEnabled()) {
      setMailboxPreferences(new MailboxPreferences(user));
    }

    if (getImNotificationSettings() == null) {
      setImNotificationSettings(getUser().getSettings().getSetting("im_notification"));
    }

    PersonalAttendant personalAttendant = getPersonalAttendant();
    if (personalAttendant == null) {
      PersonalAttendant pa = mailMgr.loadPersonalAttendantForUser(user);
      setPersonalAttendant(pa);
    }

    if (getTab().equals(TAB_CONFERENCES)) {
      Block b =
          (Block)
              getComponent("userConferencesPanel")
                  .getComponent("conferencesPanel")
                  .getComponent("conferenceActions");
      setActionBlockForConferencesTab(b);
    }
  }
Example #5
0
 public String getRestoreLogContent() {
   StringBuilder builder = new StringBuilder();
   try {
     File log = new File(getLogDirectory(), RESTORE_LOG);
     builder.append(IOUtils.toString(new FileReader(log)));
     builder.append(m_mailboxManager.getMailboxRestoreLog());
     return builder.toString();
   } catch (FileNotFoundException ex) {
     throw new UserException("&log.found.ex");
   } catch (IOException ex) {
     throw new UserException("&log.read.ex");
   }
 }