Package org.sylfra.idea.plugins.revu.model

Examples of org.sylfra.idea.plugins.revu.model.User$RoleComparator


    return User.class.equals(type);
  }

  public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context)
  {
    User user = (User) source;

    writer.addAttribute("displayName", user.getDisplayName());
    writer.addAttribute("login", user.getLogin());
    if (user.getPassword() != null)
    {
      writer.addAttribute("password", user.getPassword());
    }

    SortedSet<User.Role> roles = new TreeSet<User.Role>(user.getRoles());
    writer.addAttribute("roles", ConverterUtils.toString(roles, ",", true));
  }
View Full Code Here


    String displayName = reader.getAttribute("displayName");
    String login = reader.getAttribute("login");
    String password = reader.getAttribute("password");
    String roles = reader.getAttribute("roles");

    User user = new User();

    // User
    user.setDisplayName(displayName);
    user.setLogin(login);
    user.setPassword(password);

    // Roles
    if (roles.length() == 0)
    {
      // Set at least author role for each user
      roles = User.Role.AUTHOR.toString();
    }
   
    String[] roleNames = roles.split(",");
    Set<User.Role> roleSet = new HashSet<User.Role>();
    for (String roleName : roleNames)
    {
      try
      {
        roleSet.add(User.Role.valueOf(roleName.toUpperCase()));
      }
      catch (IllegalArgumentException e)
      {
        logger.warn("No user role for this value: <" + roleName + "> !");
      }
    }
    user.setRoles(roleSet);

    return user;
  }
View Full Code Here

          }

          @NotNull
          protected User createDefaultData()
          {
            return new User();
          }
        };
      }
    };
  }
View Full Code Here

        message = RevuBundle.message("reviewForm.cantModifyEmbeddedReview.text");
      }
      else
      {
        String currentLogin = RevuUtils.getCurrentUserLogin();
        User user = (currentLogin == null) ? null : data.getDataReferential().getUser(currentLogin, true);
        User.Role role = (user == null) ? null : user.getHigherRole();

        message = RevuBundle.message(
          role == null
            ? "reviewForm.userRole.none.text"
            : "reviewForm.userRole." + role.toString().toLowerCase() + ".text",
View Full Code Here

    return User.class.equals(type);
  }

  public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context)
  {
    User user = (User) source;

    writer.addAttribute("displayName", user.getDisplayName());
    writer.addAttribute("login", user.getLogin());
    if (user.getPassword() != null)
    {
      writer.addAttribute("password", user.getPassword());
    }

    SortedSet<User.Role> roles = new TreeSet<User.Role>(user.getRoles());
    writer.addAttribute("roles", ConverterUtils.toString(roles, ",", true));
  }
View Full Code Here

    String displayName = reader.getAttribute("displayName");
    String login = reader.getAttribute("login");
    String password = reader.getAttribute("password");
    String roles = reader.getAttribute("roles");

    User user = new User();

    // User
    user.setDisplayName(displayName);
    user.setLogin(login);
    user.setPassword(password);

    // Roles
    if (roles.length() == 0)
    {
      // Set at least author role for each user
      roles = User.Role.AUTHOR.toString();
    }
   
    String[] roleNames = roles.split(",");
    Set<User.Role> roleSet = new HashSet<User.Role>();
    for (String roleName : roleNames)
    {
      try
      {
        roleSet.add(User.Role.valueOf(roleName.toUpperCase()));
      }
      catch (IllegalArgumentException e)
      {
        logger.warn("No user role for this value: <" + roleName + "> !");
      }
    }
    user.setRoles(roleSet);

    return user;
  }
View Full Code Here

TOP

Related Classes of org.sylfra.idea.plugins.revu.model.User$RoleComparator

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.