Package com.infoclinika.mssharing.model.internal.entity

Examples of com.infoclinika.mssharing.model.internal.entity.NewsItem


    }

    @Override
    public void updateNews(long actor, long newsId, NewsInfo newsInfo) {
        if(!ruleValidator.canManageNews(actor)) throw new AccessDenied("Only admin can update news");
        final NewsItem newsItem = checkPresence(newsRepository.findOne(newsId));
        newsItem.setAuthor(newsInfo.creatorEmail);
        newsItem.setIntroduction(newsInfo.introduction);
        newsItem.setText(newsInfo.text);
        newsItem.setTitle(newsInfo.title);
        newsItem.setLastModification(new Date());

        newsRepository.save(newsItem);
    }
View Full Code Here


    @Override
    public void createNews(long actor, NewsInfo newsInfo) {
        if(!ruleValidator.canManageNews(actor)) throw new AccessDenied("Only admin can create news");

        final Date date = newsInfo.dateCreated != null ? newsInfo.dateCreated: new Date();
        NewsItem newsItem = new NewsItem(newsInfo.title, newsInfo.introduction, newsInfo.text, newsInfo.creatorEmail, date);
        newsItem.setLastModification(date);

        newsRepository.save(newsItem);
    }
View Full Code Here

TOP

Related Classes of com.infoclinika.mssharing.model.internal.entity.NewsItem

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.