Package org.jayasoft.woj.common.model

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


            User[] uSend = new User[foundUsers.length];
            for (int i = 0; i < foundUsers.length; i++) {
                 uSend[i] = new User();
                 BeanHelper.copy(foundUsers[i], uSend[i], User.class);
                 if (foundUsers[i].getGroup() != null) {
                     Group g = new Group();
                     BeanHelper.copy(foundUsers[i].getGroup(), g, Group.class);
                     uSend[i].setGroup(g);
                 }
            }
            a.setStatus(Answer.STATUS_OK);
View Full Code Here


            String sinceStr = request.getParameter(Params.SYNC.PARAMS.SINCE);
            Long since = Long.valueOf((sinceStr==null)?"-1":sinceStr);
            Group[] groupsFound = Portal.getInstance().getSecurityService().findUpdatedGroups(since);
            Group[] gSend = new Group[groupsFound.length];
            for (int i = 0; i < groupsFound.length; i++) {
                gSend[i] = new Group();
                BeanHelper.copy(groupsFound[i], gSend[i], Group.class);
           }
           a.setStatus(Answer.STATUS_OK);
           a.setObject(gSend);
        } catch (Exception e) {
View Full Code Here

    /* (non-Javadoc)
     * @see org.jayasoft.woj.portal.data.dao.hibernate.DefaultHibernateWOJDao#newHandledObject()
     */
    public WOJObject newHandledObject() {
        return new Group();
    }
View Full Code Here

        getHelper().doRemove(o);
    }

    public void fetch(WOJObject o) throws DaoException {
        if (o instanceof Group) {
            final Group g = (Group)o;
            HibernateTemplate t = new HibernateTemplate(getSessionFactory());
            t.execute(
                    new HibernateCallback() {
                        public Object doInHibernate(Session s) throws HibernateException, SQLException {
                            s.lock(g, LockMode.NONE);
                            g.getParent();
                            return null;
                        }
                    }
            );
        }
View Full Code Here

                            return "user.group.administrate";
                        }

                       
                        User userLogged = (User)request.getSession().getAttribute(Params.LOGIN.SESSION.USER);
                        Group grp;
                        if (grpId != null) {
                          try {
                            grp = (Group) DaoFactory.getGroupDao().find(grpId);
                          } catch (DaoException e) {
                            LOGGER.debug("Cannot find group for id:" + grpId);
                            throw new ServiceException("Cannot find group for id:" + grpId, e);
                          }
                        } else {
                          grp = (Group) DaoFactory.getGroupDao().newHandledObject();
                        }
                         
                        grp.setName(name);
                        grp.setDescription(desc);
                        if (grpId == null) {
                      grp.addAdministrator(userLogged);
                            ServiceFactory.getGroupService().insert(grp);
                        } else {
                            ServiceFactory.getGroupService().update(grp);
                        }
                       
View Full Code Here

        );
    }
   
    protected String prepareShowAcceptedUserInvitation(HttpServletRequest request, Long usrId, Long grpId) {
        UserImpl u = null;
        Group g = null;
        try {
            u = (UserImpl)DaoFactory.getUserDao().find(usrId);
            g = (Group)DaoFactory.getGroupDao().find(grpId);
        } catch (Exception e) {
            addWOJMessages(request, RessourceBundleApplicationMessage.error("woj.page.admin.user.group.accept.invite.error.invalid.parameters", null));
View Full Code Here

        );
    }
   
    protected String prepareShowAcceptUserInvitation(HttpServletRequest request, Long usrId, Long grpId) {
        UserImpl u = null;
        Group g = null;
        try {
            u = (UserImpl)DaoFactory.getUserDao().find(usrId);
            g = (Group)DaoFactory.getGroupDao().find(grpId);
        } catch (Exception e) {
            addWOJMessages(request, RessourceBundleApplicationMessage.error("woj.page.admin.user.group.accept.invite.error.invalid.parameters", null));
View Full Code Here

    private String administrateGroup(ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServiceException {
      String grpId = null;
      try {
        User userLogged = (User)request.getSession().getAttribute(Params.LOGIN.SESSION.USER);
        grpId = (String)request.getParameter(Params.USER_GROUP.EDIT.PARAMS.GROUP_ID);
        Group editedGroup = null;
        if (grpId!=null) {
          editedGroup = (Group) DaoFactory.getGroupDao().find(new Long(Long.parseLong(grpId)));
          if (editedGroup == null) {
            // No group found
                    LOGGER.debug("failed to retrieve user to modify in group form");
View Full Code Here

        User[] uSend = new User[foundUsers.length];
        for (int i = 0; i < foundUsers.length; i++) {
             uSend[i] = new User();
             BeanHelper.copy(foundUsers[i], uSend[i], User.class);
             if (foundUsers[i].getGroup() != null) {
                 Group g = new Group();
                 BeanHelper.copy(foundUsers[i].getGroup(), g, Group.class);
                 uSend[i].setGroup(g);
             }
        }
       
View Full Code Here

   
    public Group[] getGroups(Long since) {
        Group[] groupsFound = Portal.getInstance().getSecurityService().findUpdatedGroups(since);
        Group[] gSend = new Group[groupsFound.length];
        for (int i = 0; i < groupsFound.length; i++) {
            gSend[i] = new Group();
            BeanHelper.copy(groupsFound[i], gSend[i], Group.class);
        }
       
        return gSend;
    }
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.