Package org.nextime.ion.framework.business

Examples of org.nextime.ion.framework.business.Group


      user.setMetaData("email", sform.getEmail());
      user.setPassword(sform.getPassword());
      user.resetGroups();
      if (sform.getGroups() != null) {
        for (int i = 0; i < sform.getGroups().length; i++) {
          Group group = Group.getInstance(sform.getGroups()[i]);
          user.addGroup(group);
        }
      }
      Mapping.commit();
View Full Code Here


      // creation de l'objet
      GroupForm f = (GroupForm) form;
      Mapping.begin();
      id = f.getId();
      Group u = Group.create(f.getId());
      String[] g = f.getUsers();
      if (g != null) {
        for (int i = 0; i < g.length; i++) {
          u.addUser(User.getInstance(g[i]));
        }
      }
      Mapping.commit();     

    } catch (Exception e) {
View Full Code Here

      if (request.getParameter("editSubmit") == null) {
        Mapping.begin();

        // initialisation du formulaire       
        Group u = Group.getInstance(id);
        GroupForm f = (GroupForm) form;
        f.setId(u.getId());
        f.setUsers(u.getUsersIds());
        request.setAttribute("metaData", ((GroupImpl) u).getMetaData());

        Mapping.commit();
        return new ActionForward( mapping.getInput() );
      }

      // effectu les modifications
      Mapping.begin();
      GroupForm f = (GroupForm) form;
      Group u = Group.getInstance(id);
      String[] g = f.getUsers();
      u.resetUsers();
      if (g != null) {
        for (int i = 0; i < g.length; i++) {
          u.addUser(User.getInstance(g[i]));
        }
      }

      // *********************************************************
      // les metaData sont g�r�es separement car je n'ai
      // aucune id�e du nombre et du nom des champs qu'il va
      // y avoir.
      // cette partie est un peu bancale mais en g�n�ral dans un
      // veritable backoffice le nombre de champs composant le
      // formulaire est connu et on peut les g�rer comme ce que j'ai
      // fait plus haut ( login, password ... )
      // CETTE PARTIE N'EST DONC PAS A REPRENDRE.

      // sauve les metaData
      Enumeration ps = request.getParameterNames();
      while (ps.hasMoreElements()) {
        String name = ps.nextElement() + "";
        if (name.startsWith("META_")) {
          name = name.substring(5);
          u.setMetaData(name, request.getParameter("META_" + name));
        }
      }
      // efface la metaData si il y a besoin
      String mtd = request.getParameter("metaToDelete");
      if ((mtd + "").trim().equals(""))
        mtd = null;
      if (mtd != null) {
        u.removeMetaData(mtd);
        request.setAttribute("metaData", ((GroupImpl) u).getMetaData());
      }
      // ajoute la metaData si il y a besoin
      String mtd2 = request.getParameter("newMETA");
      if ((mtd2 + "").trim().equals(""))
        mtd2 = null;
      if (mtd2 != null) {
        u.setMetaData(mtd2, "");
        request.setAttribute("metaData", ((GroupImpl) u).getMetaData());
      }
      Mapping.commit();

      // si on a simplement effac� ou ajout� une metadonn�e, on retourne au fromulaire
View Full Code Here

      user.setMetaData("name", sform.getName());
      user.setMetaData("email", sform.getEmail());
      user.setPassword(sform.getPassword());
      user.resetGroups();
      for( int i=0; i<sform.getGroups().length; i++ ) {
        Group group = Group.getInstance(sform.getGroups()[i]);
        user.addGroup(group);
      }
      Mapping.commit();
     
    } catch (Exception e) {
View Full Code Here

  /**
   * @see org.nextime.ion.backoffice.security.SecurityManager#canAdminResources(User)
   */
  public boolean canAdminResources(User user) {
    try {
      Group admins = Group.getInstance("admins");
      if( user.listGroups().contains(admins) ) return true;
    } catch( Exception e ) {
      e.printStackTrace();
    }
    return false;
View Full Code Here

  /**
   * @see org.nextime.ion.backoffice.security.SecurityManager#canAdminSecurity(User)
   */
  public boolean canAdminSecurity(User user) {
    try {
      Group admins = Group.getInstance("admins");
      if( user.listGroups().contains(admins) ) return true;
    } catch( Exception e ) {
      e.printStackTrace();
    }
    return false;
View Full Code Here

  /**
   * @see org.nextime.ion.backoffice.security.SecurityManager#canCreateSection(Section, User)
   */
  public boolean canCreateSection(Section section, User user) {
    try {
      Group admins = Group.getInstance("admins");
      if( user.listGroups().contains(admins) ) return true;
    } catch( Exception e ) {
      e.printStackTrace();
    }
    return false;
View Full Code Here

  /**
   * @see org.nextime.ion.backoffice.security.SecurityManager#canDeleteSection(Section, User)
   */
  public boolean canDeleteSection(Section section, User user) {
    try {
      Group admins = Group.getInstance("admins");
      if( user.listGroups().contains(admins) ) return true;
    } catch( Exception e ) {
      e.printStackTrace();
    }
    return false;
View Full Code Here

  /**
   * @see org.nextime.ion.backoffice.security.SecurityManager#canEditSection(Section, User)
   */
  public boolean canEditSection(Section section, User user) {
    try {
      Group admins = Group.getInstance("admins");
      if( user.listGroups().contains(admins) ) return true;
    } catch( Exception e ) {
      e.printStackTrace();
    }
    return false;
View Full Code Here

TOP

Related Classes of org.nextime.ion.framework.business.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.