Examples of User


Examples of org.onebusaway.users.model.User

    int maxVersion = 0;
    if (args != null) {
      for (Object arg : args) {
        if (arg instanceof User) {
          User user = (User) arg;
          int version = getPropertiesVersion(user);
          maxVersion = Math.max(maxVersion, version);
        } else if (arg instanceof UserIndex) {
          UserIndex userIndex = (UserIndex) arg;
          int version = getPropertiesVersion(userIndex.getUser());
View Full Code Here

Examples of org.openblend.fejstbuk.domain.User

            Set<Like> likes = post.getLikes();
            if (likes != null) {
                likes.remove(like);
            }
        }
        User user = like.getUser();
        if (user != null) {
            Set<Like> likes = user.getLikes();
            if (likes != null) {
                likes.remove(like);
            }
        }
    }
View Full Code Here

Examples of org.openbravo.model.ad.access.User

        role.setName(getNewName() + "_" + role.getName());
      } else {
        role.setName(replace(role.getName(), originalName));
      }
    } else if (bob instanceof User) {
      final User user = (User) bob;
      if (user.getUsername() == null) {
        return;
      }
      if (user.getUsername().indexOf(originalName) == -1) {
        user.setUsername(getNewName() + "_" + user.getUsername());
      } else {
        user.setUsername(replace(user.getUsername(), originalName));
      }
    } else if (bob instanceof Organization) {
      final Organization org = (Organization) bob;
      if (org.getName().indexOf(originalName) == -1) {
        org.setName(getNewName() + "_" + org.getName());
View Full Code Here

Examples of org.openengsb.domain.userprojects.model.User

        deleteUsersFromPersistence(users);
    }

    @Override
    public void deleteUserByName(String userName) {
        deleteUser(new User(userName));
    }
View Full Code Here

Examples of org.openfaces.testapp.datatable.User

        permissions.add(documentCreation);
        permissions.add(documentModification);
        permissions.add(documentDeletion);
        permissions.add(networkAccess);

        users.add(new User("1", "Guest #" + String.valueOf(rand.nextInt(37000)), UserCategory.OTHER, Arrays.asList(new Object[]{documentBrowsing})));
        users.add(new User("2", "Manager #" + String.valueOf(rand.nextInt(37000)), UserCategory.GURU, Arrays.asList(new Object[]{userManagement})));
        users.add(new User("3", "Administrator #" + String.valueOf(rand.nextInt(37000)), UserCategory.SPECIALIST, Arrays.asList(new Object[]{userManagement, documentCreation})));
        users.add(new User("4", "Semen Semenych #" + String.valueOf(rand.nextInt(37000)), UserCategory.ENTHUSIAST, Arrays.asList(new Object[]{documentDeletion})));
        users.add(new User("5", "Ivan Ivanych #" + String.valueOf(rand.nextInt(37000)), UserCategory.GURU, Arrays.asList(new Object[]{documentCreation, documentModification, documentDeletion, networkAccess})));
        smallUserList = new ArrayList<User>(users);
        for (int i = 0; i < 10; i++) {
            if (i == 7)
                usersForFiltering = new ArrayList<User>(users);
            users.add(new User("RegularUser " + i, "Regular User " + "#" + String.valueOf(rand.nextInt(37000)), UserCategory.SPECIALIST, Arrays.asList(new Object[]{documentBrowsing})));
        }

        for (int i = 0; i < 3; i++) {
            usersForFiltering.add(new User("UnknownUser" + i, "Unknown User " + (i + 1), null, Arrays.asList(new Object[]{})));
        }
    }
View Full Code Here

Examples of org.openmhealth.reference.domain.User

            "', pair is unknown.");
    }
    Schema schema = schemas.iterator().next();
   
    // Get the user that owns this token.
    User requestingUser = authToken.getUser();
   
    // Parse the data.
    JsonNode dataNode;
    try {
      dataNode =
        JSON_FACTORY
          .createJsonParser(data).readValueAs(JsonNode.class);
    }
    catch(JsonParseException e) {
      throw new OmhException("The data was not well-formed JSON.", e);
    }
    catch(JsonProcessingException e) {
      throw new OmhException("The data was not well-formed JSON.", e);
    }
    catch(IOException e) {
      throw new OmhException("The data could not be read.", e);
    }
   
    // Make sure it is a JSON array.
    if(! (dataNode instanceof ArrayNode)) {
      throw new OmhException("The data was not a JSON array.");
    }
    ArrayNode dataArray = (ArrayNode) dataNode;
   
    // Get the number of data points.
    int numDataPoints = dataArray.size();
   
    // Create the result list of data points.
    List<Data> dataPoints = new ArrayList<Data>(numDataPoints);
   
    // Create a new ObjectMapper that will be used to convert the meta-data
    // node into a MetaData object.
    ObjectMapper mapper = new ObjectMapper();
   
    // For each element in the array, be sure it is a JSON object that
    // represents a valid data point for this schema.
    for(int i = 0; i < numDataPoints; i++) {
      // Get the current data point.
      JsonNode dataPoint = dataArray.get(i);
     
      // Validate that it is a JSON object.
      if(! (dataPoint instanceof ObjectNode)) {
        throw
          new OmhException(
            "A data point was not a JSON object: " + i);
      }
      ObjectNode dataObject = (ObjectNode) dataPoint;
     
      // Attempt to get the meta-data;
      MetaData metaData = null;
      JsonNode metaDataNode = dataObject.get(Data.JSON_KEY_METADATA);
      if(metaDataNode != null) {
        metaData = mapper.convertValue(metaDataNode, MetaData.class);
      }
     
      // Attempt to get the schema data.
      JsonNode schemaData = dataObject.get(Data.JSON_KEY_DATA);
     
      // If the data is missing, fail the request.
      if(schemaData == null) {
        throw
          new OmhException(
            "A data point's '" +
              Data.JSON_KEY_DATA +
              "' field is missing.");
      }
     
      // Create and add the point to the set of data.
      dataPoints
        .add(
          schema
            .validateData(
              requestingUser.getUsername(),
              metaData,
              schemaData));
    }
   
    // Store the data.
View Full Code Here

Examples of org.openmrs.User

        role.setName("Clinician");
        role.setDateCreated(new Date());
        role.setDescription("boo");
        role.setCreator(Context.getAuthenticatedUser());
        Context.getUserService().saveRole(role);
        User user = Context.getUserService().getUser(userId);
        user.addRole(role);
        user.getPersonName().setFamilyName(null);
        user.getPersonName().setGivenName(null);
        user.getPersonName().setMiddleName("middleName");
        Context.getUserService().saveUser(user, null);
        Assert.assertEquals(1, service.getUsersAsPersonStubs("Clinician").size());
       
        //lets look at the PersonStub for the Clinician:
        PersonStub ps = service.getUsersAsPersonStubs("Clinician").get(0);
View Full Code Here

Examples of org.opennebula.client.user.User

        int userID = Integer.parseInt( rc.getMessage() );
        System.out.println("The allocation request returned this ID: " + userID);

        // We can create a representation for the new user, using the returned
        // user-ID
        User javaUser = new User(userID, oneClient);

        // And request its information
        rc = javaUser.info();

        // Alternatively we could have requested the user's info with the
        // static info method:
        // rc = User.info(oneClient, userID);
        // and processed the xml returned in the message of the OneResponse.

        if (rc.isError())
        {
            System.out.println(rc.getErrorMessage());
            return;
        }

        // This is how the info returned looks like...
        System.out.println("Info for " + javaUser.xpath("name") + "...");
        System.out.println(rc.getMessage());

        // Wait a second... what was that xpath method for?
        // Now that we have the user's info loaded, we can use xpath expressions
        // without parsing and initializing any xml, as simple as
        // String name = javaUser.xpath("name");

        // The user pool information is now outdated, so we need to call the
        // info method again
        userpool.info();
        printUserPool(userpool);

        // Let's delete this new user, using its ID
        System.out.println("Deleting " + javaUser.getName() + "...");
        rc = javaUser.delete();

        if (rc.isError())
        {
            System.out.println(rc.getErrorMessage());
            return;
View Full Code Here

Examples of org.openqreg.bean.User

      return Response.status(Response.Status.FORBIDDEN).entity(rw)
          .build();
    }
   
   
    User user = Dispatcher.getInstance().getUser(la.getUserId());
    AjaxWidgetAnswer awa = new AjaxWidgetAnswer();
    // add default answer text, listboxtexts, guisettings, containers
    try {
      addDefaultAnswer(user, awr, awa);
    } catch (SQLException e) {
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.User

                    return DateUtils.formatDateTime(p3.getTimestamp(), DateFormat.SHORT, DateFormat.SHORT);
                return null;
            case 4:
                HistoryOsmPrimitive p4 = getPrimitive(row);
                if (p4 != null) {
                    User user = p4.getUser();
                    if (user != null)
                        return user.getName();
                }
                return null;
            }
            return null;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.