Examples of Memo


Examples of gaej2011.model.Memo

import com.google.appengine.api.users.UserServiceFactory;

public class MemoService {

    public static Key put(Key minutesKey, String string) {
        Memo memo = new Memo();
        memo.setMinutes(minutesKey);
        memo.setMemo(string);
        memo.setCreatedAt(new Date());
        memo.setAuthor(UserServiceFactory.getUserService().getCurrentUser());
        Datastore.put(memo);
        Memcache.delete(minutesKey);
        Queue queue = QueueFactory.getDefaultQueue();
        queue.add(TaskOptions.Builder.withUrl("/tq/IncrementMemoCount").param(
            "minutesKey",
            Datastore.keyToString(minutesKey)));
        QueueFactory.getQueue("parse").add(
            TaskOptions.Builder.withUrl("/tq/Yahoo").param(
                "memoKey",
                Datastore.keyToString(memo.getKey())));
        return memo.getKey();
    }
View Full Code Here

Examples of gaej2011.model.Memo

        response.flushBuffer();
        return null;
    }

    static void pushMemo(Key memoKey) {
        Memo memo = Datastore.getOrNull(Memo.class, memoKey);
        if (memo == null) {
            return;
        }
        List<Key> channels =
            Datastore
                .query(MinutesChannel.class)
                .filter(
                    MinutesChannelMeta.get().minutesKey.equal(memo.getMinutes()))
                .asKeyList();
        ChannelService channelService =
            ChannelServiceFactory.getChannelService();
        String memoJson = MemoMeta.get().modelToJson(memo);
        for (Key channel : channels) {
View Full Code Here

Examples of gaej2011.model.Memo

    public void 議事録ごとに議事録に追加されたメモを古い順に一覧表示できる() throws NullPointerException,
            IllegalArgumentException, IOException, ServletException {
        Key minutesKey = MinutesService.put(" テスト用議事録1");
        Calendar calendar = Calendar.getInstance();
        for (int i = 0; i < 5; i++) { // 5 件保存しておく
            Memo memo = new Memo();
            memo.setMinutes(minutesKey);
            memo.setMemo(" メモ" + i);
            memo.setCreatedAt(calendar.getTime());
            Datastore.put(memo);
            calendar.add(Calendar.HOUR_OF_DAY, 1); // 1 時間進める
        }
        tester.request.setMethod("GET");
        tester.param("minutes", Datastore.keyToString(minutesKey));
View Full Code Here

Examples of gaej2011.model.Memo

        Key minutesKey = MinutesService.put(" テスト用議事録1");
        int before = tester.count(Memo.class);
        Key key = MemoService.put(minutesKey, " メモ1");
        int after = tester.count(Memo.class);
        assertThat("Memo が一件増える", after, is(before + 1));
        Memo memo = Datastore.get(Memo.class, key);
        assertThat(memo, is(notNullValue()));
        assertThat(" 議事録への参照が設定される", memo.getMinutes(), is(minutesKey));
        assertThat("memo が設定される", memo.getMemo(), is(" メモ1"));
        assertThat("createdAt が設定される", memo.getCreatedAt(), is(notNullValue()));
        assertThat("author が設定される", memo.getAuthor(), is(notNullValue()));
    }
View Full Code Here

Examples of gaej2011.model.Memo

    @Test
    public void 議事録ごとに議事録に追加されたメモを古い順に一覧表示できる() {
        Key minutesKey = MinutesService.put(" テスト用議事録1");
        Calendar calendar = Calendar.getInstance();
        for (int i = 0; i < 5; i++) { // 5 件保存しておく
            Memo memo = new Memo();
            memo.setMinutes(minutesKey);
            memo.setMemo(" メモ" + i);
            memo.setCreatedAt(calendar.getTime());
            Datastore.put(memo);
            calendar.add(Calendar.HOUR_OF_DAY, 1); // 1 時間進める
        }
        int count = 0;
        Date before = null;
        List<Memo> list = MemoService.list(minutesKey);
        for (Memo memo : list) {
            Date createdAt = memo.getCreatedAt();
            if (before != null) {
                assertThat(
                    " 古いものから取得できている",
                    createdAt.compareTo(before) > 0,
                    is(true));
View Full Code Here

Examples of gaej2011.model.Memo

public class YahooController extends Controller {

    @Override
    protected Navigation run() throws Exception {
        Key memoKey = asKey("memoKey");
        Memo memo = Datastore.get(MemoMeta.get(), memoKey);
        Set<String> keywords = YahooAPIService.parse(memo.getMemo());
        KeyWord keyWord = new KeyWord();
        keyWord.setKey(Datastore.createKey(memoKey, KeyWord.class, "1"));
        keyWord.setWords(keywords);
        Datastore.put(keyWord);
        return null;
View Full Code Here

Examples of org.ribax.utils.types.Memo

                            // no conversion needed
              value = colData;
             
            } else if (colType.equals("memo")) { //$NON-NLS-1$
                            // create a new Memo object
              value = new Memo(colData);
            } else if (colType.equals("image")) { //$NON-NLS-1$
                           
                            // create a new ImageIcon using the cell data value as the
                            // URL of the image
              ImageIcon icon = null;
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.