Examples of newContent()


Examples of org.apache.abdera.factory.Factory.newContent()

    generator.setText(Version.APP_NAME);
    assertNotNull(generator);
    assertEquals(generator.getText(), Version.APP_NAME);
    assertEquals(generator.getVersion(), Version.VERSION);
    assertEquals(generator.getUri().toString(), Version.URI);
    content = factory.newContent(Content.Type.HTML);
    content.setValue("a");
    assertNotNull(content);
    assertEquals(content.getValue(), "a");
    assertEquals(content.getContentType(), Content.Type.HTML);
    Text text = factory.newRights(Text.Type.HTML);
View Full Code Here

Examples of org.apache.abdera.factory.Factory.newContent()

    iri.setValue("http://example.org/foo");
    assertEquals(iri.getValue().toString(), "http://example.org/foo");
    iri = factory.newLogo();
    iri.setValue("http://example.org/foo");
    assertEquals(iri.getValue().toString(), "http://example.org/foo");
    content = factory.newContent(new MimeType("text/foo"));
    content.setSrc("foo");
    assertNotNull(content);
    assertEquals(content.getMimeType().toString(), "text/foo");
    assertEquals(content.getSrc().toString(), "foo");
    content = factory.newContent(new MimeType("text/foo"));
View Full Code Here

Examples of org.apache.abdera.factory.Factory.newContent()

    content = factory.newContent(new MimeType("text/foo"));
    content.setSrc("foo");
    assertNotNull(content);
    assertEquals(content.getMimeType().toString(), "text/foo");
    assertEquals(content.getSrc().toString(), "foo");
    content = factory.newContent(new MimeType("text/foo"));
    content.setDataHandler(new DataHandler(new ByteArrayDataSource("foo".getBytes())));
    assertEquals(content.getValue(), "Zm9v");
    assertEquals(content.getContentType(), Content.Type.MEDIA);
    el = factory.newName();
    assertNotNull(el);
View Full Code Here

Examples of org.apache.abdera.factory.Factory.newContent()

    assertEquals(text.getTextType(), Text.Type.TEXT);
    text = factory.newTitle();
    text.setValue("a");
    assertEquals(text.getValue(), "a");
    assertEquals(text.getTextType(), Text.Type.TEXT);
    content = factory.newContent(Content.Type.TEXT);
    content.setValue("a");
    assertEquals(content.getValue(), "a");
    assertEquals(content.getContentType(), Content.Type.TEXT);
    now = new Date();
    dateTime = factory.newUpdated();
View Full Code Here

Examples of org.apache.abdera.factory.Factory.newContent()

    iri.setValue("http://example.org/foo");
    assertEquals(iri.getValue().toString(), "http://example.org/foo");
    Workspace workspace = factory.newWorkspace();
    assertNotNull(workspace);
    div = factory.newDiv();
    content = factory.newContent(Content.Type.XHTML);
    content.setValueElement(div);
    assertNotNull(content);
    assertEquals(content.getContentType(), Content.Type.XHTML);
    assertNotNull(content.getValueElement());
    assertEquals(content.getValueElement(), div);
View Full Code Here

Examples of org.apache.abdera.factory.Factory.newContent()

    content.setValueElement(div);
    assertNotNull(content);
    assertEquals(content.getContentType(), Content.Type.XHTML);
    assertNotNull(content.getValueElement());
    assertEquals(content.getValueElement(), div);
    content = factory.newContent(new MimeType("application/xml"));
    content.setValueElement(div);
    assertNotNull(content);
    assertEquals(content.getContentType(), Content.Type.XML);
    assertNotNull(content.getValueElement());
    assertEquals(content.getValueElement(), div);
View Full Code Here

Examples of org.apache.abdera.factory.Factory.newContent()

        childExtension.addSimpleExtension(VALUE, p.getUUID());

        childExtension = extension.addExtension(STATE);
        childExtension.addSimpleExtension(VALUE, p.getState() == null ? "" : p.getState().getName());

        org.apache.abdera.model.Content content = factory.newContent();
        content.setSrc(base.clone().path("binary").build().toString());
        content.setMimeType("application/octet-stream");
        content.setContentType(Type.MEDIA);
        e.setContentElement(content);
View Full Code Here

Examples of org.apache.abdera.factory.Factory.newContent()

        childExtension = extension.addExtension(CATEGORIES);
        for (CategoryItem c : categories) {
            childExtension.addSimpleExtension(VALUE, c.getName());
        }

        org.apache.abdera.model.Content content = factory.newContent();
        content.setSrc(base.clone().path("binary").build().toString());
        content.setMimeType("application/octet-stream");
        content.setContentType(Type.MEDIA);
        e.setContentElement(content);
View Full Code Here

Examples of org.apache.abdera.factory.Factory.newContent()

        JAXBContext jc = jaxbProvider.getJAXBContext(cls, cls);
       
        StringWriter writer = new StringWriter();
        jc.createMarshaller().marshal(o, writer);
       
        Content ct = factory.newContent(Content.Type.XML);
        ct.setValue(writer.toString());
        e.setContentElement(ct);
    }
   
   
View Full Code Here

Examples of org.apache.abdera.factory.Factory.newContent()

        childExtension = extension.addExtension(CATEGORIES);
        for (CategoryItem c : categories) {
            childExtension.addSimpleExtension(VALUE, c.getName());
        }

        org.apache.abdera.model.Content content = factory.newContent();
        content.setSrc(UriBuilder.fromUri(baseURL).path("binary").build().toString());
        content.setMimeType("application/octet-stream");
        content.setContentType(Type.MEDIA);
        e.setContentElement(content);
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.