Package org.focusns.model.photo

Examples of org.focusns.model.photo.Album


    private StorageService storageService;

    @RequestMapping("photo-list")
    public String doList(@RequestParam Long albumId, Model model) {
        //
        Album album = albumService.getAlbum(albumId);
        model.addAttribute("album", album);
        List<Photo> photos = photoService.listPhoto(albumId);
        model.addAttribute("photos", photos);
        //
        return "modules/photo/photo-list";
View Full Code Here


    @RequiresProject
    @RequiresProjectUser
    @RequestMapping("album-edit")
    public String doEdit(@RequestParam(required = false) Long albumId, @WidgetAttribute Project project, @WidgetAttribute ProjectUser projectUser, Model model) {
        //
        Album album = new Album();
        if(albumId==null) {
            album.setProjectId(project.getId());
            album.setCreatedById(projectUser.getId());
            album.setModifiedById(projectUser.getId());
        } else {
            album = albumService.getAlbum(albumId);
        }
        model.addAttribute("album", album);
        //
View Full Code Here

    @Autowired
    private ProjectUserDao projectUserDao;

    @Override
    public Album getAlbum(long albumId) {
        Album album = albumDao.select(albumId);
        return fillAlbum(album);
    }
View Full Code Here

    @Autowired
    private AlbumService albumService;

    @Test
    public void createAlbum() {
        Album album = new Album();
        album.setLabel("label");
        album.setDescription("description");
        album.setCreatedAt(new Date());
        album.setCreatedById(1);
        album.setModifiedById(1);
        album.setProjectId(1);
        //
        albumService.createAlbum(album);
    }
View Full Code Here

        if(photo==null) {
            return photo;
        }
        //
        if(photo.getAlbum()==null && photo.getAlbumId()>0) {
            Album album = albumDao.select(photo.getAlbumId());
            photo.setAlbum(album);
        }
        if(photo.getProject()==null && photo.getProjectId()>0) {
            Project project = projectDao.select(photo.getProjectId());
            photo.setProject(project);
View Full Code Here

    @Event(on = "CREATE_PHOTO", point = Event.Point.AFTER)
    public void afterCreatePhoto(EventContext eventContext) {
        AlbumDao albumDao = eventContext.getApplicationContext().getBean(AlbumDao.class);
        //
        Photo photo = (Photo) eventContext.getArguments()[0];
        Album album = albumDao.select(photo.getAlbumId());
        album.setPhotoId(photo.getId());
        albumDao.update(album);
    }
View Full Code Here

TOP

Related Classes of org.focusns.model.photo.Album

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.