Package org.apache.abdera

Examples of org.apache.abdera.Abdera.newEntry()


        assertEquals(BidiHelper.getBidiText(Direction.RTL, "Testing"), BidiHelper.getBidiElementText(feed
            .getTitleElement()));
        assertEquals(BidiHelper.getBidiText(Direction.LTR, "Testing"), BidiHelper.getBidiElementText(feed
            .getSubtitleElement()));

        Entry entry = abdera.newEntry();
        entry.setLanguage("az-arab");
        assertEquals(Direction.RTL, BidiHelper.guessDirectionFromLanguage(entry));

        entry.setLanguage("az-latn");
        assertEquals(Direction.UNSPECIFIED, BidiHelper.guessDirectionFromLanguage(entry));
View Full Code Here


    public static void main(String... args) throws Exception {

        String text = "\u05e4\u05e2\u05d9\u05dc\u05d5\u05ea \u05d4\u05d1\u05d9\u05e0\u05d0\u05d5\u05dd, W3C";

        Abdera abdera = new Abdera();
        Entry entry = abdera.newEntry();
        BidiHelper.setDirection(Direction.RTL, entry);

        entry.setTitle(text);

        // non bidi, incorrectly displayed
View Full Code Here

        // with bidi, correctly displayed
        System.out.println(BidiHelper.getBidiText(BidiHelper.getDirection(entry), entry.getTitle()));

        // there are also direction guessing algorithms available
        entry = abdera.newEntry();
        entry.setTitle(text);
        entry.setLanguage("ar");

        System.out.println(BidiHelper.guessDirectionFromJavaBidi(entry.getTitleElement()));
        System.out.println(BidiHelper.guessDirectionFromTextProperties(entry.getTitleElement()));
View Full Code Here

public class Geo {

    public static void main(String... args) throws Exception {

        Abdera abdera = new Abdera();
        Entry entry = abdera.newEntry();
        entry.setTitle("Middle of the Ocean");

        Point point = new Point(new Coordinate(37.0625, -95.677068));
        GeoHelper.addPosition(entry, point);
View Full Code Here

public class Json {

    public static void main(String... args) throws Exception {

        Abdera abdera = new Abdera();
        Entry entry = abdera.newEntry();
        entry.newId();
        entry.setTitle("test");
        entry.setContentAsHtml("<b>foo</b>");
        entry.addAuthor("James");
        entry.addCategory("term");
View Full Code Here

public class Thread {

    public static void main(String... args) throws Exception {

        Abdera abdera = new Abdera();
        Entry e1 = abdera.newEntry();
        Entry e2 = abdera.newEntry();

        e1.newId();
        e2.newId();
View Full Code Here

    public static void main(String... args) throws Exception {

        Abdera abdera = new Abdera();
        Entry e1 = abdera.newEntry();
        Entry e2 = abdera.newEntry();

        e1.newId();
        e2.newId();

        // Entry e2 is a reply to Entry e1
View Full Code Here

    }

    @Test
    public void testSimpleExtension() throws Exception {
        Abdera abdera = new Abdera();
        Entry entry = abdera.newEntry();
        entry.setDraft(true); // this will create an app:control element
        assertNull(entry.getControl().getSimpleExtension(new QName("urn:foo", "foo")));
    }

    @Test
View Full Code Here

    }

    @Test
    public void testLang() throws Exception {
        Abdera abdera = new Abdera();
        Entry entry = abdera.newEntry();
        entry.setLanguage("en-US");
        assertEquals("en-US", entry.getLanguage());
        Lang lang = entry.getLanguageTag();
        assertNotNull(lang);
        assertEquals("en", lang.getLanguage().getName());
View Full Code Here

    @Test
    public void testSetContent() throws Exception {

        Abdera abdera = new Abdera();

        Entry entry = abdera.newEntry();
        Document<Element> foodoc = abdera.getParser().parse(new ByteArrayInputStream("<a><b><c/></b></a>".getBytes()));
        Element foo = foodoc.getRoot();
        entry.setContent(foo, "application/foo+xml");
        assertEquals(foo, entry.getContentElement().getValueElement());
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.