Package gaej2011.controller.tq

Source Code of gaej2011.controller.tq.YahooController

package gaej2011.controller.tq;

import gaej2011.meta.MemoMeta;
import gaej2011.model.KeyWord;
import gaej2011.model.Memo;
import gaej2011.service.YahooAPIService;

import java.util.Set;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.datastore.Datastore;

import com.google.appengine.api.datastore.Key;

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;
    }
}
TOP

Related Classes of gaej2011.controller.tq.YahooController

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.