Examples of NewsItem


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

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

    @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

Examples of name.shamansir.mvp4glayoutdemo.shared.dao.NewsItem

    public void bindView() {
        view.getSaveButton().addClickHandler(new ClickHandler() {
           
            @Override
            public void onClick(ClickEvent event) {
                final NewsItem item = view.collect();
                service.saveNewsItem(item, new SafeCallback<Integer>(eventBus) {

                    @Override
                    public void onSuccess(Integer newId) {
                        History.newItem(url.build(P.NEWS_EDIT, String.valueOf(newId)));
View Full Code Here

Examples of name.shamansir.mvp4glayoutdemo.shared.dao.NewsItem

        text.setValue(item.text);
    }

    @Override
    public NewsItem collect() {
        final NewsItem result = new NewsItem(currentItem);
        result.title = title.getValue();
        result.text = text.getValue();
        result.author = currentAuthor != null ? currentAuthor : createDefaultAuthor();
        result.postTime = currentPostTime != null ? currentPostTime : new Date();
        return result;
View Full Code Here

Examples of name.shamansir.mvp4glayoutdemo.shared.dao.NewsItem

   
    final Map<Integer, NewsItem> news = new HashMap<Integer, NewsItem>();
   
    public NewsServiceImpl() {
        int n1id = news.size();
        NewsItem newsOne = new NewsItem(n1id);
        newsOne.author = createUser("Joe", "Simpson", 12, "wooo.png");
        newsOne.title = "Fassbinder";       
        newsOne.text = "Blah blah blah";
        newsOne.postTime = new Date();       
        news.put(n1id, newsOne);
       
        int n2id = news.size();
        NewsItem newsTwo = new NewsItem(n2id);
        newsTwo.author = createUser("Moo", "Wangwang", 27, "foo.png");
        newsTwo.title = "Second news";       
        newsTwo.text = "Hello! The news are from the second hand";
        newsTwo.postTime = new Date();
        news.put(n2id, newsTwo);
       
        int n3id = news.size();
        NewsItem newsThree = new NewsItem(n3id);
        newsThree.author = createUser("Boo", "Trolalah", 81, "foo.png");
        newsThree.title = "I don't know Internet";       
        newsThree.text = "I had a dream, when I was young, a dream of sweet illusion.";
        newsThree.postTime = new Date();
        news.put(n3id, newsThree);
View Full Code Here

Examples of name.shamansir.mvp4glayoutdemo.shared.dao.NewsItem

        int id = item.getId();
        if (id != -1) {
            news.put(id, item);
        } else {
            id = news.size();
            final NewsItem newItem = new NewsItem(id);
            newItem.author = item.author;
            newItem.title = item.title;
            newItem.text = item.text;           
            newItem.postTime = item.postTime;          
            news.put(id, newItem);
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.