• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Picture类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.activiti.engine.identity.Picture的典型用法代码示例。如果您正苦于以下问题:Java Picture类的具体用法?Java Picture怎么用?Java Picture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Picture类属于org.activiti.engine.identity包,在下文中一共展示了Picture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initChangePictureButton

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
protected Upload initChangePictureButton() {
  final Upload changePictureUpload = new Upload();
  changePictureUpload.setImmediate(true);
  changePictureUpload.setButtonCaption(i18nManager.getMessage(Messages.PROFILE_CHANGE_PICTURE));
  
  final InMemoryUploadReceiver receiver = initPictureReceiver(changePictureUpload);
  changePictureUpload.addListener(new FinishedListener() {
    private static final long serialVersionUID = 1L;
    public void uploadFinished(FinishedEvent event) {
      if (!receiver.isInterruped()) {
        picture = new Picture(receiver.getBytes(), receiver.getMimeType());
        identityService.setUserPicture(userId, picture);
        
        // reset picture
        imageLayout.removeAllComponents();
        initPicture();
      } else {
        receiver.reset();
      }
    }
  });
  
  return changePictureUpload;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:25,代码来源:ProfilePanel.java


示例2: initPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
protected void initPicture(IdentityService identityService, boolean renderPicture, final String userName) {
  if(renderPicture) {
    Picture picture = identityService.getUserPicture(userName);
    if(picture != null) {
      Resource imageResource = new StreamResource(new InputStreamStreamSource(picture.getInputStream()), 
        userName + picture.getMimeType(), ExplorerApp.get());
      
      Embedded image = new Embedded(null, imageResource);
      image.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
      image.setType(Embedded.TYPE_IMAGE);
      image.setHeight(30, Embedded.UNITS_PIXELS);
      image.setWidth(30, Embedded.UNITS_PIXELS);
      image.addListener(new MouseEvents.ClickListener() {
        private static final long serialVersionUID = 7341560240277898495L;
        public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
          viewManager.showProfilePopup(userName);
        }
      });
      
      addComponent(image);
      setComponentAlignment(image, Alignment.MIDDLE_LEFT);
    } else {
     // TODO: what when no image is available?
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:UserProfileLink.java


示例3: setPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
public void setPicture(Picture picture) {
  if (pictureByteArrayId!=null) {
    Context
      .getCommandContext()
      .getDbSqlSession()
      .delete(ByteArrayEntity.class, pictureByteArrayId);
  }
  if (picture!=null) {
    pictureByteArray = new ByteArrayEntity(picture.getMimeType(), picture.getBytes());
    Context
      .getCommandContext()
      .getDbSqlSession()
      .insert(pictureByteArray);
    pictureByteArrayId = pictureByteArray.getId();
  } else {
    pictureByteArrayId = null;
    pictureByteArray = null;
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:20,代码来源:UserEntity.java


示例4: testUserPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
public void testUserPicture() {
  // 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.deleteUser(user.getId());
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:IdentityServiceTest.java


示例5: getPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
@Get
public InputRepresentation getPicture() {
  if(authenticate() == false) return null;
  
  String userId = (String) getRequest().getAttributes().get("userId");
  if(userId == null) {
    throw new ActivitiException("No userId provided");
  }
  Picture picture = ActivitiUtil.getIdentityService().getUserPicture(userId);
  
  String contentType = picture.getMimeType();
  MediaType mediatType = MediaType.IMAGE_PNG;
  if(contentType != null) {
    if(contentType.contains(";")) {
      contentType = contentType.substring(0, contentType.indexOf(";"));
    }
    mediatType = MediaType.valueOf(contentType);
  }
  InputRepresentation output = new InputRepresentation(picture.getInputStream(), mediatType);
  getResponse().getCacheDirectives().add(CacheDirective.maxAge(28800));
  
  return output;
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:24,代码来源:UserPictureResource.java


示例6: test

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
@Test
public void test() {
    String user = identityService.getUserInfo("", "");
    List<String> userKeys = identityService.getUserInfoKeys("");
    Picture picture = identityService.getUserPicture("");

    identityService.setAuthenticatedUserId("");
    identityService.setUserInfo("", "", "");
    identityService.setUserPicture("", new Picture(new byte[]{}, ""));


    User u = identityService.newUser("");
    Group g = identityService.newGroup("");


    List<User> userList = identityService.createUserQuery()
            .list();
    logger.info("###================================================ userList, {}", userList);
    userList = identityService.createNativeUserQuery()
            .list();
    logger.info("###================================================ userList, {}", userList);


    List<Group> groupList = identityService.createGroupQuery()
            .list();
    logger.info("###================================================ groupList, {}", groupList);
    groupList = identityService.createNativeGroupQuery()
            .list();
    logger.info("###================================================ groupList, {}", groupList);


    identityService.createMembership("", "");
    identityService.checkPassword("", "");
}
 
开发者ID:Lzw2016,项目名称:study,代码行数:35,代码来源:IdentityServiceTest.java


示例7: createUser

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
protected void createUser(String userId, String firstName, String lastName, String password, 
        String email, String imageResource, List<String> groups, List<String> userInfo) {
  
  if (identityService.createUserQuery().userId(userId).count() == 0) {
    
    // Following data can already be set by demo setup script
    
    User user = identityService.newUser(userId);
    user.setFirstName(firstName);
    user.setLastName(lastName);
    user.setPassword(password);
    user.setEmail(email);
    identityService.saveUser(user);
    
    if (groups != null) {
      for (String group : groups) {
        identityService.createMembership(userId, group);
      }
    }
  }
  
  // Following data is not set by demo setup script
    
  // image
  if (imageResource != null) {
    byte[] pictureBytes = IoUtil.readInputStream(this.getClass().getClassLoader().getResourceAsStream(imageResource), null);
    Picture picture = new Picture(pictureBytes, "image/jpeg");
    identityService.setUserPicture(userId, picture);
  }
    
  // user info
  if (userInfo != null) {
    for(int i=0; i<userInfo.size(); i+=2) {
      identityService.setUserInfo(userId, userInfo.get(i), userInfo.get(i+1));
    }
  }
  
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:39,代码来源:DemoDataGenerator.java


示例8: getPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
public Picture getPicture() {
  if (pictureByteArrayId==null) {
    return null;
  }
  ByteArrayEntity pictureByteArray = getPictureByteArray();
  return new Picture(pictureByteArray.getBytes(), pictureByteArray.getName());
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:UserEntity.java


示例9: execute

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
public Picture execute(CommandContext commandContext) {
  if(userId == null) {
    throw new ActivitiException("userId is null");
  }
  UserEntity user = (UserEntity) commandContext
    .getUserManager()
    .findUserById(userId);
  if(user == null) {
    throw new ActivitiException("user "+userId+" doesn't exist");
  }
  return user.getPicture();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:13,代码来源:GetUserPictureCmd.java


示例10: createUser

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
protected void createUser(String userId, String firstName, String lastName, String password,
                          String email, String imageResource, List<String> groups, List<String> userInfo) {

    if (identityService.createUserQuery().userId(userId).count() == 0) {

        // Following data can already be set by demo setup script

        User user = identityService.newUser(userId);
        user.setFirstName(firstName);
        user.setLastName(lastName);
        user.setPassword(password);
        user.setEmail(email);
        identityService.saveUser(user);

        if (groups != null) {
            for (String group : groups) {
                identityService.createMembership(userId, group);
            }
        }
    }

    // Following data is not set by demo setup script

    // image
    if (imageResource != null) {
        byte[] pictureBytes = IoUtil.readInputStream(this.getClass().getClassLoader().getResourceAsStream(imageResource), null);
        Picture picture = new Picture(pictureBytes, "image/jpeg");
        identityService.setUserPicture(userId, picture);
    }

    // user info
    if (userInfo != null) {
        for (int i = 0; i < userInfo.size(); i += 2) {
            identityService.setUserInfo(userId, userInfo.get(i), userInfo.get(i + 1));
        }
    }

}
 
开发者ID:v5developer,项目名称:maven-framework-project,代码行数:39,代码来源:DemoDataGenerator.java


示例11: execute

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
public Picture execute(CommandContext commandContext) {
  if(userId == null) {
    throw new ActivitiIllegalArgumentException("userId is null");
  }
  UserEntity user = (UserEntity) commandContext
    .getUserIdentityManager()
    .findUserById(userId);
  if(user == null) {
    throw new ActivitiObjectNotFoundException("user "+userId+" doesn't exist", User.class);
  }
  return user.getPicture();
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:13,代码来源:GetUserPictureCmd.java


示例12: getUserPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
@Override
public Picture getUserPicture(String userId) {
	throw new RuntimeException("This method is not supported.");
}
 
开发者ID:KayuraTeam,项目名称:kayura-activiti,代码行数:5,代码来源:UserEntityManagerImpl.java


示例13: setUserPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
@Override
public void setUserPicture(String userId, Picture picture) {
	throw new RuntimeException("This method is not supported.");
}
 
开发者ID:KayuraTeam,项目名称:kayura-activiti,代码行数:5,代码来源:UserEntityManagerImpl.java


示例14: setUserPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
public void setUserPicture(String userId, Picture picture) {
  commandExecutor.execute(new SetUserPictureCmd(userId, picture));
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:IdentityServiceImpl.java


示例15: getUserPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
public Picture getUserPicture(String userId) {
  return commandExecutor.execute(new GetUserPictureCmd(userId));
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:IdentityServiceImpl.java


示例16: SetUserPictureCmd

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
public SetUserPictureCmd(String userId, Picture picture) {
  this.userId = userId;
  this.picture = picture;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:5,代码来源:SetUserPictureCmd.java


示例17: setUserPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
public void setUserPicture(String userId, Picture picture) {
	identityService.setUserPicture(userId, picture);
}
 
开发者ID:v5developer,项目名称:maven-framework-project,代码行数:4,代码来源:AccountServiceImpl.java


示例18: getUserPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
public Picture getUserPicture(String userId) {
	return identityService.getUserPicture(userId);
}
 
开发者ID:v5developer,项目名称:maven-framework-project,代码行数:4,代码来源:AccountServiceImpl.java


示例19: getPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
@Override
public Picture getPicture() {
	return userEntity.getPicture();
}
 
开发者ID:lovromazgon,项目名称:activiti-hashed-passwords,代码行数:5,代码来源:HashedUser.java


示例20: setPicture

import org.activiti.engine.identity.Picture; //导入依赖的package包/类
@Override
public void setPicture(Picture picture) {
	userEntity.setPicture(picture);
}
 
开发者ID:lovromazgon,项目名称:activiti-hashed-passwords,代码行数:5,代码来源:HashedUser.java



注:本文中的org.activiti.engine.identity.Picture类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CaptureManager类代码示例发布时间:2022-05-23
下一篇:
Java Fault类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap