Examples of MediaTitle


Examples of com.google.gdata.data.media.mediarss.MediaTitle

      }

      VideoEntry newEntry = new VideoEntry();
      YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();

      mg.setTitle(new MediaTitle());
      mg.getTitle().setPlainTextContent(title);

      mg.addCategory(new MediaCategory(YouTubeNamespace.CATEGORY_SCHEME, assignment.getCategory()));

      mg.setKeywords(new MediaKeywords());
View Full Code Here

Examples of com.google.gdata.data.media.mediarss.MediaTitle

    }

    VideoEntry newEntry = new VideoEntry();
    YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();

    mg.setTitle(new MediaTitle());
    mg.getTitle().setPlainTextContent(title);

    mg.addCategory(new MediaCategory(YouTubeNamespace.CATEGORY_SCHEME, "News"));
   
    String keyword = System.getProperty("com.google.tchotchke.Keyword");
View Full Code Here

Examples of com.google.gdata.data.media.mediarss.MediaTitle

    VideoEntry newEntry = new VideoEntry();

    YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();

    mg.addCategory(new MediaCategory(YouTubeNamespace.CATEGORY_SCHEME, "Tech"));
    mg.setTitle(new MediaTitle());
    mg.getTitle().setPlainTextContent(videoTitle);
    mg.setKeywords(new MediaKeywords());
    mg.getKeywords().addKeyword("gdata-test");
    mg.setDescription(new MediaDescription());
    mg.getDescription().setPlainTextContent(videoTitle);
View Full Code Here

Examples of com.google.gdata.data.media.mediarss.MediaTitle

    String videoTitle = readLine();

    VideoEntry newEntry = new VideoEntry();
    YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();
    mg.addCategory(new MediaCategory(YouTubeNamespace.CATEGORY_SCHEME, "Tech"));
    mg.setTitle(new MediaTitle());
    mg.getTitle().setPlainTextContent(videoTitle);
    mg.setKeywords(new MediaKeywords());
    mg.getKeywords().addKeyword("gdata-test");
    mg.setDescription(new MediaDescription());
    mg.getDescription().setPlainTextContent(videoTitle);
View Full Code Here

Examples of org.apache.abdera.ext.media.MediaTitle

    content.setDuration(123);
    content.setExpression(Expression.SAMPLE);
    content.setFilesize(12345);
    content.setFramerate(123);
    content.setLanguage("en");
    MediaTitle title = content.addExtension(TITLE);
    title.setType(Type.PLAIN);
    title.setText("This is a sample");
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    entry.writeTo(out);
   
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    Parser parser = abdera.getParser();
    Document<Entry> doc = parser.parse(in);
    entry = doc.getRoot();
   
    group = entry.getExtension(GROUP);
    List<MediaContent> list = entry.getExtensions(CONTENT);
    for (MediaContent item : list) {
      assertEquals(item.getUrl().toString(), "http://example.org");
      assertEquals(item.getBitrate(), 123);
      assertEquals(item.getChannels(), 2);
      assertEquals(item.getDuration(), 123);
      assertEquals(item.getExpression(), Expression.SAMPLE);
      assertEquals(item.getFilesize(), 12345);
      assertEquals(item.getFramerate(), 123);
      assertEquals(item.getLang(), "en");
      title = item.getExtension(TITLE);
      assertNotNull(title);
      assertEquals(title.getType(), Type.PLAIN);
      assertEquals(title.getText(), "This is a sample");
    }
  }
View Full Code Here

Examples of org.apache.abdera.ext.media.MediaTitle

    @Override
    public int doEndTag() throws JspException {
        final ServletRequest request = pageContext.getRequest();

        MediaTitle title;

        if (request.getAttribute("content") != null
            && request.getAttribute("content") instanceof MediaContent) {
            title = ((MediaContent) request.getAttribute("content")).addExtension(MediaConstants.TITLE);
        } else if (request.getAttribute("group") != null
            && request.getAttribute("group") instanceof MediaGroup) {
            title = ((MediaGroup) request.getAttribute("group")).addExtension(MediaConstants.TITLE);
        } else if (request.getAttribute("entry") != null
            && request.getAttribute("entry") instanceof Entry) {
            title = ((Entry) request.getAttribute("entry")).addExtension(MediaConstants.TITLE);
        } else {
            title = ((Feed) request.getAttribute("feed")).addExtension(MediaConstants.TITLE);
        }

        // set the body content
        title.setText(getBodyContent().getString());
        // set the scheme
        if (type != null) title.setType(Type.valueOf(type));

        return super.doEndTag();
    }
View Full Code Here

Examples of org.apache.abdera.ext.media.MediaTitle

        content.setDuration(123);
        content.setExpression(Expression.SAMPLE);
        content.setFilesize(12345);
        content.setFramerate(123);
        content.setLanguage("en");
        MediaTitle title = content.addExtension(TITLE);
        title.setType(Type.PLAIN);
        title.setText("This is a sample");

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        entry.writeTo(out);

        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Parser parser = abdera.getParser();
        Document<Entry> doc = parser.parse(in);
        entry = doc.getRoot();

        group = entry.getExtension(GROUP);
        List<MediaContent> list = entry.getExtensions(CONTENT);
        for (MediaContent item : list) {
            assertEquals("http://example.org", item.getUrl().toString());
            assertEquals(123, item.getBitrate());
            assertEquals(2, item.getChannels());
            assertEquals(123, item.getDuration());
            assertEquals(Expression.SAMPLE, item.getExpression());
            assertEquals(12345, item.getFilesize());
            assertEquals(123, item.getFramerate());
            assertEquals("en", item.getLang());
            title = item.getExtension(TITLE);
            assertNotNull(title);
            assertEquals(Type.PLAIN, title.getType());
            assertEquals("This is a sample", title.getText());
        }
    }
View Full Code Here

Examples of org.apache.abdera.ext.media.MediaTitle

    content.setDuration(123);
    content.setExpression(Expression.SAMPLE);
    content.setFilesize(12345);
    content.setFramerate(123);
    content.setLanguage("en");
    MediaTitle title = content.addExtension(TITLE);
    title.setType(Type.PLAIN);
    title.setText("This is a sample");
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    entry.writeTo(out);
   
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    Parser parser = abdera.getParser();
    Document<Entry> doc = parser.parse(in);
    entry = doc.getRoot();
   
    group = entry.getExtension(GROUP);
    List<MediaContent> list = entry.getExtensions(CONTENT);
    for (MediaContent item : list) {
      assertEquals(item.getUrl().toString(), "http://example.org");
      assertEquals(item.getBitrate(), 123);
      assertEquals(item.getChannels(), 2);
      assertEquals(item.getDuration(), 123);
      assertEquals(item.getExpression(), Expression.SAMPLE);
      assertEquals(item.getFilesize(), 12345);
      assertEquals(item.getFramerate(), 123);
      assertEquals(item.getLang(), "en");
      title = item.getExtension(TITLE);
      assertNotNull(title);
      assertEquals(title.getType(), Type.PLAIN);
      assertEquals(title.getText(), "This is a sample");
    }
  }
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.