Package evolaris.framework.um.datamodel

Examples of evolaris.framework.um.datamodel.User


    Group group = groupManager.getGroup("Evolaris");
    UserSet set = userSetManager.getUserSet("Java-Entwickler", group);
   
    for (int i=1; i<=TESTUSERCOUNT; i++) {
      System.out.println(i);
      User u = new User();
      u.setUsername("doe"+i);
      u.setLastName("Doe");
      u.setFirstName(firstNames[i % 2]);
      u.setMsisdn(1234567L);
      u.setGroup(group);
      userManager.createUser(u, "xxx");
      userSetManager.add(set, u);
      session.connection().commit();
    }
  }
View Full Code Here


    setMessage(entry.getTextContent());
    setSenderId(entry.getSender() == null? -1 : entry.getSender().getId());
    // destination selection
    Long destinationMsisdn = entry.getDestinationMsisdn();
    UserSet destinationUserSet = entry.getDestinationUserSet();
    User destinationUser = entry.getDestinationUser();
    // set destination fields and radio buttons according to not-null fields
    if (destinationUser != null){
      destinationUserSet = null;
      destinationMsisdn = null;
      setDestinationSelection(2);
    } else if (destinationUserSet != null){
      destinationUser = null;
      destinationMsisdn = null;
      setDestinationSelection(1);
    } else if (destinationMsisdn != null){
      destinationUserSet = null;
      destinationUser = null;
      setDestinationSelection(3);
    } else { // default: nothing selected
      destinationUserSet = null;
      destinationUser = null;
      setDestinationSelection(-1);
    }
    setCountryCode(UserManager.countryCode(destinationMsisdn));
    setMobileNumber(UserManager.mobileNumber(destinationMsisdn));
    setUserId(destinationUser == null ? null : destinationUser.getId());
    setUserName(destinationUser == null ? null : destinationUser.getUsername());
    setUserSetId(destinationUserSet == null ? null : destinationUserSet.getId());
    setUserSetName(destinationUserSet == null ? null : destinationUserSet.getName());
    setGroupId(entry.getGroup().getId());

  }
View Full Code Here

    setSendingMsisdn(entry.getSender() == null? "-1" : entry.getSender().getMsisdn()+"");
   
    // destination selection
    Long destinationMsisdn = entry.getDestinationMsisdn();
    UserSet destinationUserSet = entry.getDestinationUserSet();
    User destinationUser = entry.getDestinationUser();
   
    // set destination fields and radio buttons according to not-null fields
    if(entry.getDestinationContact() == 1){
      setDestinationSelection(2);
      setCountryCode("43");
    } else if(entry.getDestinationUserSet() != null || entry.getCurrentUserSetAsDestination() == 1){
      setDestinationSelection(3);
      setUserSetId(entry.getDestinationUserSet() != null ? entry.getDestinationUserSet().getId() : -2);
      setCountryCode("43");
    } else if(entry.getDestinationUser() != null){
      setDestinationSelection(4);
      setUserId(entry.getDestinationUser().getId());
      setCountryCode("43");
    } else if (entry.getDestinationMsisdn() != null){
      setDestinationSelection(5);
      setUserSetId(-1L);
      setCountryCode(UserManager.countryCode(entry.getDestinationMsisdn()));
      setMobileNumber(UserManager.mobileNumber(entry.getDestinationMsisdn()));
    } else { // the sender of the request is also the receiver
      setCountryCode("43");
      setDestinationSelection(1);
    }
   
    setCountryCode(UserManager.countryCode(destinationMsisdn));
    setMobileNumber(UserManager.mobileNumber(destinationMsisdn));
    setUserId(destinationUser == null ? null : destinationUser.getId());
    setUserName(destinationUser == null ? null : destinationUser.getUsername());
    setUserSetId(destinationUserSet == null ? null : destinationUserSet.getId());

    setDelayInSeconds(entry.getDelayInSeconds());
  }
View Full Code Here

    long[] sourceUserIds = f.getSourceUserIds();
    if (sourceUserIds != null){  // at least one mapping
      long[] selectedUserIds = f.getSelectedUserIds();
      for (int i = 0; i < sourceUserIds.length; i++){
        long sourceUserId = sourceUserIds[i];
        User sourceUser = userManager.getUserDetails(sourceUserId);
        if (sourceUser == null){
          throw new InputException(getResources(req).getMessage(locale, "smssvc.SourceUserNotAvailableAnymore"),"user #" + sourceUserId + " not found",null,null);
        }
        checkAccessRights(req,sourceUser.getGroup());
        long selectedUserId = selectedUserIds[i];
        if (selectedUserId <= 0){
          throw new InputException(getResources(req).getMessage(locale, "smssvc.UserMappingSelectionMissing"),"sourceUserId = " + sourceUserId,null,null);
        }
        User selectedUser = userManager.getUserDetails(selectedUserId);
        if (selectedUser == null){
          throw new InputException(getResources(req).getMessage(locale, "smssvc.SelectedUserNotAvaliableAnymore"),"user #" + selectedUserId + " not found",null,null);
        }
        checkAccessRights(req,selectedUser.getGroup());
        mappingSet.add(new Entry(sourceUser), new Entry(selectedUser));
      }
    }
   
    // user sets
View Full Code Here

   * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {

    UserManagerBase userManager = new UserManager(locale,session);
    User user = userManager.getUserDetails(req.getUserPrincipal().getName().toLowerCase());
    SendTaskListForm sendTaskListForm = (SendTaskListForm) form;

    SendTaskManager sendTaskMgr = new SendTaskManager(locale, session);

    Group groupToDisplay = getCurrentGroup(req);
    if (Boolean.TRUE.equals(sendTaskListForm.getAllGroups()) && UserManager.isUserInRole(webUser, UserManagerBase.ADMINISTRATOR)) {
      groupToDisplay = null;
    }   
    User userToDisplay = null;

    if (!UserManager.isUserInRole(user, UserManagerBase.GROUP_ADMINISTRATOR) && (!UserManager.isUserInRole(user, UserManagerBase.ADMINISTRATOR))) {
      userToDisplay = user;
      Hibernate.initialize(userToDisplay); // used to fetch
    }
View Full Code Here

             
              UserManager um=new UserManager(Locale.getDefault(),session);
              GroupManager gm=new GroupManager(Locale.getDefault(),session);
             
             
              User user=um.registerUserByMsisdn(senderMSIDSN, "", gm.getGroup("mGBL"));
             
              //TODO check security - what about new players!?!?!
       
              GameScoreHiber gs=new GameScoreHiber();
              gs.setGame(g);
              gs.setCompleteScore(gameScore);
              gs.setPlayer(user.getId());
              gs.setAchievedAt(new GregorianCalendar());
       
              GameScoreDao.persistGameScore(gs,session);

              //update max and avg socres for the game!
View Full Code Here

      Group group = null;
      String groupId = request.getParameter("group");
      if (groupId == null) {
        String webUsername = request.getUserPrincipal().getName().toLowerCase();
        UserManagerBase userManager = new UserManager(Locale.GERMAN, session)
        User webUser = userManager.getUserDetails(webUsername);
        group = webUser.getGroup();
      } else {
        GroupManager groupManager = new GroupManager(Locale.GERMAN, session);
        group = groupManager.getGroup(Long.parseLong(groupId));
      }
      outputGroupLogo(response, group);
View Full Code Here

   * It execute the command and then return the results to the client in XML format.
   *
   */
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    blogCode = (String)request.getSession().getAttribute("blogCode");
    User user = (User)request.getSession().getAttribute("webUser");
    if (blogCode == null) {
      return;
    }
    session = HibernateSessions.startTransaction(this.getClass());
    try {
View Full Code Here

   *
   */ 
  @SuppressWarnings("unchecked")
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    blogCode = (String)request.getSession().getAttribute("blogCode");
    User user = (User)request.getSession().getAttribute("webUser");
    if (blogCode == null) {
      return;
    }   
    session = HibernateSessions.startTransaction(this.getClass());
    try {
View Full Code Here

   * @param group the group
   * @param setName the user set name
   * */
  public void assignUserToSet(long msisdn, String operator, String mobilePhoneProducer, Group group, String setName){
   
    User registeredUser = userMgr.getUserDetails(msisdn,group);
    UserSet userSet = getUserSet(setName,group);
   
    if(registeredUser == null){ // user does not exist in group
      User newUser = new User();
      newUser.setMsisdn(msisdn);
      newUser.setOperator(operator);
      newUser.setGroup(group);
      newUser.setMobilePhoneProducer(mobilePhoneProducer);
      newUser.getUserSets().add(userSet);
      userMgr.createUser(newUser,null);  
     
      Set<User> users = userSet.getUsers();
      users.add(newUser);
      userSet.setUsers(users);
View Full Code Here

TOP

Related Classes of evolaris.framework.um.datamodel.User

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.