Package org.apache.openmeetings.data.user.dao

Examples of org.apache.openmeetings.data.user.dao.UsersDao


    add(users.setOutputMarkupId(true));
    add(new AjaxButton("add", Model.of(WebSession.getString(175L))) {
      private static final long serialVersionUID = 5553555064487161840L;

      protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) {
        UsersDao userDao = Application.getBean(UsersDao.class);
        for (User u : usersToAdd) {
          List<Organisation_Users> orgUsers = u.getOrganisation_users();
          boolean found = false;
          for (Organisation_Users ou : orgUsers) {
            if (ou.getOrganisation().getOrganisation_id().equals(organisation.getOrganisation_id())) {
              found = true;
              break;
            }
          }
          if (!found) {
            Organisation_Users orgUser = new Organisation_Users(organisation);
            orgUser.setDeleted(false);
            orgUsers.add(orgUser);
            userDao.update(u, WebSession.getUserId());
          }
        }
        target.appendJavaScript("$('#addUsers').dialog('close');");
        groupForm.updateView(target);
      }
View Full Code Here


      protected void onEvent(AjaxRequestTarget target) {
        target.add(listContainer);
      }
    });

    UsersDao usersDaoImpl = Application.getBean(UsersDao.class);
    form = new UserForm("form", listContainer,
        usersDaoImpl.getNewUserInstance(usersDaoImpl.get(WebSession
            .getUserId())));
    form.showNewRecord();
    add(form);
  }
View Full Code Here

    target.appendJavaScript("omUserPanelInit();");
  }

  @Override
  protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
    UsersDao usersDaoImpl = Application.getBean(UsersDao.class);
    setModelObject(usersDaoImpl.getNewUserInstance(usersDaoImpl
        .get(WebSession.getUserId())));
    target.add(this);
    target.appendJavaScript("omUserPanelInit();");
  }
View Full Code Here

    target.appendJavaScript("omUserPanelInit();");
  }

  @Override
  protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
    UsersDao usersDaoImpl = Application.getBean(UsersDao.class);
    usersDaoImpl.delete(this.getModelObject(),
        WebSession.getUserId());
    this.setModelObject(usersDaoImpl.getNewUserInstance(usersDaoImpl
        .get(WebSession.getUserId())));
    target.add(listContainer);
    target.add(this);
    target.appendJavaScript("omUserPanelInit();");
  }
View Full Code Here

            //Profiles
            File profiles = OmFileHelper.getUploadProfilesDir();
            long invalid = 0;
            long deleted = 0;
            ClassPathXmlApplicationContext ctx = getApplicationContext(ctxName);
            UsersDao udao = ctx.getBean(UsersDao.class);
            for (File profile : profiles.listFiles()) {
              long pSize = OmFileHelper.getSize(profile);
              long userId = getUserIdByProfile(profile.getName());
              User u = udao.get(userId);
              if (profile.isFile() || userId < 0 || u == null) {
                if (cleanup) {
                  FileHelper.removeRec(profile);
                } else {
                  invalid += pSize;
                }
              } else if (u.getDeleted()) {
                if (cleanup) {
                  FileHelper.removeRec(profile);
                } else {
                  deleted += pSize;
                }
              }
            }
            long missing = 0;
            for (User u : udao.getAllUsersDeleted()) {
              if (!u.getDeleted() && !new File(OmFileHelper.getUploadProfilesUserDir(u.getUser_id()), u.getPictureuri()).exists()) {
                missing++;
              }
            }
            long size = OmFileHelper.getSize(profiles);
View Full Code Here

            //Profiles
            File profiles = OmFileHelper.getUploadProfilesDir();
            long invalid = 0;
            long deleted = 0;
            ClassPathXmlApplicationContext ctx = getApplicationContext(ctxName);
            UsersDao udao = ctx.getBean(UsersDao.class);
            for (File profile : profiles.listFiles()) {
              long pSize = OmFileHelper.getSize(profile);
              long userId = getUserIdByProfile(profile.getName());
              User u = udao.get(userId);
              if (profile.isFile() || userId < 0 || u == null) {
                if (cleanup) {
                  FileHelper.removeRec(profile);
                } else {
                  invalid += pSize;
                }
              } else if (u.getDeleted()) {
                if (cleanup) {
                  FileHelper.removeRec(profile);
                } else {
                  deleted += pSize;
                }
              }
            }
            long missing = 0;
            for (User u : udao.getAllUsersDeleted()) {
              if (!u.getDeleted() && u.getPictureuri() != null && !new File(OmFileHelper.getUploadProfilesUserDir(u.getUser_id()), u.getPictureuri()).exists()) {
                missing++;
              }
            }
            long size = OmFileHelper.getSize(profiles);
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.data.user.dao.UsersDao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.