Examples of OtherContent


Examples of com.google.gdata.data.OtherContent

      map.put(SpiConstants.PROPNAME_CONTENT,
          makeProperty(mediaContent.getMediaSource()));
     
    } else if (content instanceof OtherContent) {
     
      OtherContent otherContent = (OtherContent) content;
      map.put(SpiConstants.PROPNAME_MIMETYPE,
          makeProperty(otherContent.getMimeType().getMediaType() ));
      map.put(SpiConstants.PROPNAME_CONTENT,
          makeProperty(otherContent.getBytes() ));
     
    } else {
      if (LOGGER.isLoggable(Level.SEVERE))
        LOGGER.severe("Unhandled content: " + content);
      throw new RepositoryException();
View Full Code Here

Examples of com.google.gdata.data.OtherContent

    photo.setTitle(new PlainTextConstruct(title));
    String description = getString("Description");
    photo.setDescription(new PlainTextConstruct(description));
    photo.setTimestamp(new Date());

    OtherContent content = new OtherContent();


    File file = null;
    while (file == null || !file.canRead()) {
      file = new File(getString("Photo location"));
    }
    content.setBytes(getBytes(file));
    content.setMimeType(new ContentType("image/jpeg"));
    photo.setContent(content);

    insert(albumEntry, photo);
  }
View Full Code Here

Examples of com.google.gdata.data.OtherContent

        map.put(SpiConstants.PROPNAME_CONTENT,
            makeProperty(mediaContent.getMediaSource()));
       
      } else if (content instanceof OtherContent) {
       
        OtherContent otherContent = (OtherContent) content;
        map.put(SpiConstants.PROPNAME_MIMETYPE,
            makeProperty(otherContent.getMimeType().getMediaType() ));
        map.put(SpiConstants.PROPNAME_CONTENT,
            makeProperty(otherContent.getBytes() ));
       
      } else {
        if (LOGGER.isLoggable(Level.SEVERE))
          LOGGER.severe("Unhandled content: " + content);
        throw new RepositoryException();
View Full Code Here

Examples of com.google.gdata.data.OtherContent

    sampleVehicleMap.put("propertyValue", PROPERTY_VALUES);

    // Create populated gdata entry.
    XmlBlob xmlBlob = new XmlBlob();
    xmlBlob.setBlob(ENTRY_XML);
    OtherContent xmlContent = new OtherContent();
    xmlContent.setXml(xmlBlob);
    xmlContent.setXml(xmlBlob);
    xmlContent.setMimeType(ContentUtil.APPLICATION_XML);
    vehicleEntry = new FeedServerEntry();
    vehicleEntry.setXmlBlob(xmlBlob);
    vehicleEntry.setContent(xmlContent);
  }
View Full Code Here

Examples of com.google.gdata.data.OtherContent

    // the object is really an "object[]" but for single elements its a
    // "String".
    // This loop prepares this very hacky map representation from the passed in
    // more sane
    // typed implementation.
    OtherContent content = contentUtil.createXmlContent(xmlUtil.convertPropertiesToXml(entryMap));
    FeedServerEntry entry = new FeedServerEntry(content);
    return entry;
  }
View Full Code Here

Examples of com.google.gdata.data.OtherContent

  private Map<String, Object> getMapFromEntry(FeedServerEntry entry)
      throws FeedServerClientException {
    // Get XML and convert to primitive Object map.
    Content content = entry.getContent();
    if (content instanceof OtherContent) {
      OtherContent otherContent = (OtherContent) content;
      log.info("Entry info " + otherContent.getXml().getBlob());
      XmlUtil xmlUtil = new XmlUtil();
      try {
        String xmlText = otherContent.getXml().getBlob();
        // TODO : This is a temporary work-around till a solution for escaping the
        // '>' by the GData client library is worked
        xmlText = xmlText.replaceAll("]]>", "]]&gt;");
        Map<String, Object> entity = xmlUtil.convertXmlToProperties(xmlText);
        if (entity == null) {
View Full Code Here

Examples of com.google.gdata.data.OtherContent

   *
   * @param entity a bean representing the content.
   */
  public void setContentFromEntity(Object entity) {
    try {
      OtherContent content = contentUtil.createXmlContent(entity);
      this.setXmlBlob(content.getXml());
      this.setContent(content);
    } catch (IllegalArgumentException e) {
      throw new RuntimeException("Invalid entity bean " + entity.getClass().getName(), e);
    } catch (IntrospectionException e) {
      throw new RuntimeException("Invalid entity bean " + entity.getClass().getName(), e);
View Full Code Here

Examples of com.google.gdata.data.OtherContent

   * payload
   * @param xmlSource XML source of the payload
   * @return A GData {@code OtherContent} representation of the payload
   */
  public OtherContent createXmlContent(String xmlSource) {
    OtherContent xmlContent = new OtherContent();
    XmlBlob xmlBlob = new XmlBlob();
    xmlBlob.setBlob(xmlSource);
    xmlContent.setXml(xmlBlob);
    xmlContent.setMimeType(APPLICATION_XML);
    return xmlContent;
  }
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.