Package org.jayasoft.woj.common.model

Examples of org.jayasoft.woj.common.model.Group


        TransactionTemplate tt = dao.getTransactionTemplate();
        tt.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                for (int i = 0; i < grps.length; i++) {
                    Group group = dao.getGroup(""+grps[i].getId());
                    Long grpId = new Long(grps[i].getId());
                    if (group != null) {
                        dao.delete(group);
                        rdao.deleteForAccessor(grpId);
                        WOJServer.getInstance().getContentService().removeArea(grpId);
View Full Code Here


       
        TransactionTemplate tt = dao.getTransactionTemplate();
        tt.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                for (int i = 0; i < grps.length; i++) {
                    Group group = grps[i];
                    long grpId = group.getId();
                    //in enterprise edition we create grp instead of getting them from portal
                    if(grpId == 0 && WOJServer.getInstance().isEnterpriseEdition()) {
                      grpId = JDBCIDGenerator.getNextId(JDBCUserDao.PRINCIPAL, dao.getJdbcTemplate()).longValue();
                      group.setId(grpId);
                    }
          PrincipalRight grpRight = new PrincipalRight(grpId, Visibility.PRIVATE)
                    dao.insert(group);
                    rdao.insert(grpRight);
                }
View Full Code Here

    }

    public void updateGroup(Group[] grps) {
        GroupDao dao= WOJServer.getInstance().getDataService().getGroupDao();
        for (int i = 0; i < grps.length; i++) {
            Group group = grps[i];
            dao.update(group);
        }
        LOGGER.info(grps.length + "groups successfully updates.");
    }
View Full Code Here

  }
 
  public static Collection getGroupInfo(Collection groups) {
    Collection result = new ArrayList();
    for (Iterator iter = groups.iterator(); iter.hasNext();) {
      Group group = (Group) iter.next();
      result.add(new GroupInfo(group));
    }
    return result;
  }
View Full Code Here

            sentObject = new User();
            BeanHelper.copy(o, sentObject, User.class);
            ((User)sentObject).setGroup((Group) getDTO(((User)o).getGroup()));
        } else
            if (o instanceof Group) {
              sentObject = new Group();
              BeanHelper.copy(o, sentObject, Group.class);
              ((Group)sentObject).setParent((Group) getDTO(((Group)o).getParent()));
            }
        if (o instanceof PrincipalRight) {
          sentObject = new PrincipalRight();
View Full Code Here

        try {
            ClufImpl cluf = ServiceFactory.getLicenseService().getActiveCluf();
            License l = licenseDao.createTrial();
           
            Group group = (Group) groupDao.find(groupId);
//            l.setHostId(hostId); No Host
            UserImpl user = (UserImpl)userDao.findUser(userLogged.getLogin());
            userDao.fetch(user);
            if ((user.getLastAcceptedCluf() == null) ||
                cluf.getVersion().equals(user.getLastAcceptedCluf().getVersion())) {
View Full Code Here

    }

  public boolean remove(User userLogged, Long grpId) throws ServiceException {
    GroupDao grpDao = DaoFactory.getGroupDao();
    LicenseDao licDao = DaoFactory.getLicenseDao();
    Group grp;
    try {
      List lics = licDao.findLicenseInGroup(grpId.longValue());
      for (Iterator iter = lics.iterator(); iter.hasNext();) {
        License lic = (License) iter.next();
        lic.setGroup(null);
View Full Code Here

    public void inviteUser(User userLogged, Long groupId, String userMail) throws ServiceException {
        if (userMail==null || !EmailHelper.doEmailSeemsValid(userMail)) {
            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.page.admin.user.group.error.invite.no.mail", new Object[] {userMail}));
        }
        UserImpl u = (UserImpl)DaoFactory.getUserDao().findUserByEmail(userMail);
        Group g;
        try {
            g = (Group)DaoFactory.getGroupDao().find(groupId);
        } catch (DaoException e) {
            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.page.admin.user.group.error.group.not.found", new Object[] {groupId}));
        }
View Full Code Here

    }
   
    public void addUserLicenseToGroup(Long userID, Long grpID) throws ServiceException {
        try {
            UserImpl user = (UserImpl)DaoFactory.getUserDao().find(userID);
            Group group = (Group)DaoFactory.getGroupDao().find(grpID);
           
            License l = user.getLicenseUsed();
            if (!ServiceFactory.getLicenseService().isGroupable(l)) {
                throw new ServiceException(RessourceBundleApplicationMessage.error("woj.page.admin.user.group.accept.invite.accepted.error.bad.license", null));
            }
View Full Code Here

            // if the previous license belonged to a group
            // and if the new license is groupable
            try {
                if (prev != null && prev.getGroup() != null && licenseUsed != null && licenseUsed.getGroup() == null
                        && prev.getBuyer().getId() == licenseUsed.getBuyer().getId() && ServiceFactory.getLicenseService().isGroupable(licenseUsed)) {
                    Group prevGroup = prev.getGroup();
                    ServiceFactory.getGroupService().removeLicense(new Long(prevGroup.getId()), new Long(prev.getId()));
                    ServiceFactory.getGroupService().addLicense(prevGroup, licenseUsed);
                }
            } catch (Exception e) {
                LOGGER.warn("impossible to change group for license switching: old license was: "+prev+" new license: "+licenseUsed+" for "+this, e);
            }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.common.model.Group

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.