Package org.apache.abdera.model

Examples of org.apache.abdera.model.Entry.addCategory()


        // process category
        // TODO category object
        Object categoryProperty = ScriptableObject.getProperty(nativeEntry, "category");
        if (categoryProperty instanceof String) {
            entry.addCategory((String) (categoryProperty));
        }
        Object categoriesProperty = ScriptableObject.getProperty(nativeEntry, "categories");
        if (categoriesProperty instanceof String) {
            String categoriesString = (String) (categoriesProperty);
            String[] categories = categoriesString.split(",");
View Full Code Here


        Object categoriesProperty = ScriptableObject.getProperty(nativeEntry, "categories");
        if (categoriesProperty instanceof String) {
            String categoriesString = (String) (categoriesProperty);
            String[] categories = categoriesString.split(",");
            for (int i = 0; i < categories.length; i++) {
                entry.addCategory(categories[i]);
            }
        }

        // process content
        Object content = ScriptableObject.getProperty(nativeEntry, "content");
View Full Code Here

            else if (argName.equals("category"))
            {
                Object category = arg.evaluate(message);
                if (category instanceof Category)
                {
                    entry.addCategory((Category) category);
                }
                else
                {
                    entry.addCategory(category.toString());
                }
View Full Code Here

                {
                    entry.addCategory((Category) category);
                }
                else
                {
                    entry.addCategory(category.toString());
                }
            }
            else if (argName.equals("contributor"))
            {
                Object author = arg.evaluate(message);
View Full Code Here

    Entry entry = abdera.newEntry();
    entry.newId();
    entry.setTitle("test");
    entry.setContentAsHtml("<b>foo</b>");
    entry.addAuthor("James");
    entry.addCategory("term");
   
    Writer w = abdera.getWriterFactory().getWriter("json");
    entry.writeTo(w, System.out);
   
    /**
 
View Full Code Here

        Entry entry = abdera.newEntry();
        entry.newId();
        entry.setTitle("test");
        entry.setContentAsHtml("<b>foo</b>");
        entry.addAuthor("James");
        entry.addCategory("term");
        entry.writeTo("json", System.out);

        /**
         * Produces: { "id":"urn:uuid:97893C35372BE77BD51200273434152", "title":"test", "content":{
         * "attributes":{"type":"html"}, "children":[{ "name":"b", "attributes":{}, "children":["foo"]}]},
View Full Code Here

            else if (argName.equals("category"))
            {
                Object category = arg.evaluate(message);
                if (category instanceof Category)
                {
                    entry.addCategory((Category) category);
                }
                else
                {
                    entry.addCategory(category.toString());
                }
View Full Code Here

                {
                    entry.addCategory((Category) category);
                }
                else
                {
                    entry.addCategory(category.toString());
                }
            }
            else if (argName.equals("contributor"))
            {
                Object author = arg.evaluate(message);
View Full Code Here

            if (options.mentions != null) {
                HashSet<String> set = new HashSet<String>();
                for (String s : options.mentions) {
                    if (!set.contains(s)) {
                        set.add(s); // prevent duplicates
                        entry.addCategory(Common.MENTION_URN, s, "Mention");
                        stampElement = entry.addExtension(new QName(
                                Common.NS_URI, Common.STAMP));
                        stampElement.setText(Crypto.computeStamp(
                                Common.STAMP_BITS,
                                entry.getUpdated().getTime(), s));
View Full Code Here

            if (options.tags != null) {
                HashSet<String> set = new HashSet<String>();
                for (String s : options.tags) {
                    if (!set.contains(s)) {
                        set.add(s); // prevent duplicates
                        entry.addCategory(Common.TAG_URN, s, "Tag");
                        stampElement = entry.addExtension(new QName(
                                Common.NS_URI, Common.STAMP));
                        stampElement.setText(Crypto.computeStamp(
                                Common.STAMP_BITS,
                                entry.getUpdated().getTime(), s));
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.