Package org.camunda.bpm.engine.identity

Examples of org.camunda.bpm.engine.identity.Picture


    if (pictureInfo != null) {
      String pictureByteArrayId = pictureInfo.getValue();
      if (pictureByteArrayId != null) {
        ByteArrayEntity byteArray = commandContext.getDbEntityManager()
          .selectById(ByteArrayEntity.class, pictureByteArrayId);
        return new Picture(byteArray.getBytes(), byteArray.getName());
      }
    }

    return null;
  }
View Full Code Here


    // First, create a new user
    User user = identityService.newUser("johndoe");
    identityService.saveUser(user);
    String userId = user.getId();

    Picture picture = new Picture("niceface".getBytes(), "image/string");
    identityService.setUserPicture(userId, picture);

    picture = identityService.getUserPicture(userId);

    // Fetch and update the user
    user = identityService.createUserQuery().userId("johndoe").singleResult();
    assertTrue("byte arrays differ", Arrays.equals("niceface".getBytes(), picture.getBytes()));
    assertEquals("image/string", picture.getMimeType());

    identityService.deleteUserPicture("johndoe");
    // this is ignored
    identityService.deleteUserPicture("someone-else-we-dont-know");

    // picture does not exist
    picture = identityService.getUserPicture("johndoe");
    assertNull(picture);

    // add new picture
    picture = new Picture("niceface".getBytes(), "image/string");
    identityService.setUserPicture(userId, picture);

    // makes the picture go away
    identityService.deleteUser(user.getId());
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.identity.Picture

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.