Package com.google.gdata.data

Examples of com.google.gdata.data.ExtensionProfile


        || clazz == Feed.class;
  }
 
  private static ExtensionProfile getExtProfile(BaseEntry<?> entry,
      boolean isAdapting) {
    ExtensionProfile extProfile = null;
    extProfile = new ExtensionProfile();
    ((BaseEntry<?>) entry).declareExtensions(extProfile);
    if (isAdapting) {
      extProfile.setAutoExtending(true);
    }
    return extProfile;
  }
View Full Code Here


    return extProfile;
  }
 
  private static ExtensionProfile getExtProfile(BaseFeed<?, ?> feed,
      boolean isAdapting) {
    ExtensionProfile extProfile = null;
    extProfile = new ExtensionProfile();
    feed.declareExtensions(extProfile);
    if (isAdapting) {
      extProfile.setAutoExtending(true);
    }
    return extProfile;
  }
View Full Code Here

  protected GsaEntry getEntryFromFile(String inputFileName) throws ParseException,
      IOException, ServiceException {
    GsaEntry entry = null;

    ParseSource source = new ParseSource(new FileInputStream(inputFileName));
    entry = GsaEntry.readEntry(source, GsaEntry.class, new ExtensionProfile());

    return entry;
  }
View Full Code Here

    if (entry == null) {
      return null;
    }
    StringWriter stringWriter = new StringWriter();
    XmlWriter xmlWriter = new XmlWriter(stringWriter);
    entry.generate(xmlWriter, new ExtensionProfile());
   
    return stringWriter.toString();
  }
View Full Code Here

    if (feed == null) {
      return null;
    }
    StringWriter stringWriter = new StringWriter();
    XmlWriter xmlWriter = new XmlWriter(stringWriter);
    feed.generate(xmlWriter, new ExtensionProfile());
   
    return stringWriter.toString();
  }
View Full Code Here

                // Generate the corresponding Atom representation of the feed
                StringWriter stringWriter = new StringWriter();
                com.google.gdata.util.common.xml.XmlWriter w =
                    new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
                feed.generateAtom(w, new ExtensionProfile());
                w.flush();

                // Write the Atom representation(XML) into Http response content
                OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
                PrintWriter out = new PrintWriter(response.getOutputStream());
                out.println(stringWriter.toString());
                out.close();

                //System.out.println("Feed content in plain text:" + stringWriter.toString());
            } else {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }

        } else if (path.startsWith("/")) {

            // get HTTP request asking for an entry

            // Return a specific entry in the collection
            com.google.gdata.data.Entry feedEntry = null;

            // Invoke the get operation on the service implementation
            Message requestMessage = messageFactory.createMessage();
            String id = path.substring(1);
            requestMessage.setBody(new Object[] {id});
            Message responseMessage = getInvoker.invoke(requestMessage);
            if (responseMessage.isFault()) {
                throw new ServletException((Throwable)responseMessage.getBody());
            }

            if (supportsFeedEntries) {
                // The service implementation returns a feed entry
                feedEntry = (com.google.gdata.data.Entry)responseMessage.getBody();

                //System.out.println("entry title: " + feedEntry.getTitle().getPlainText());

            } else {
                // The service implementation only returns a data item, create
                // an entry
                // from it
                Entry<Object, Object> entry = new Entry<Object, Object>(id, responseMessage.getBody());
                // FIXME The line below needs to be fixed
                // feedEntry = feedEntry(entry, itemClassType, itemXMLType,
                // mediator, abderaFactory);
            }

            // Write the Gdata entry
            if (feedEntry != null) {

                // Write a GData entry using Atom representation
                response.setContentType("application/atom+xml; charset=utf-8");

                // Generate the corresponding Atom representation of the feed
                StringWriter stringWriter = new StringWriter();
                com.google.gdata.util.common.xml.XmlWriter w =
                    new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
                feedEntry.generateAtom(w, new ExtensionProfile());
                w.flush();

                // Write the Atom representation(XML) into Http response content
                OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
                PrintWriter out = new PrintWriter(response.getOutputStream());
View Full Code Here

                    // Generate the corresponding Atom representation of the
                    // feed
                    StringWriter stringWriter = new StringWriter();
                    com.google.gdata.util.common.xml.XmlWriter w =
                        new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
                    createdFeedEntry.generateAtom(w, new ExtensionProfile());
                    w.flush();

                    // Write the Atom representation(XML) into Http response
                    // content
                    OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
View Full Code Here

                    // Generate the corresponding Atom representation of the feed
                    StringWriter stringWriter = new StringWriter();
                    com.google.gdata.util.common.xml.XmlWriter w =
                        new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
                    feedEntry.generateAtom(w, new ExtensionProfile());
                    w.flush();

                    // Write the Atom representation(XML) into Http response content
                    OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
                    PrintWriter out = new PrintWriter(response.getOutputStream());
View Full Code Here

                // Generate the corresponding Atom representation of the feed
                StringWriter stringWriter = new StringWriter();
                com.google.gdata.util.common.xml.XmlWriter w =
                    new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
                feed.generateAtom(w, new ExtensionProfile());
                w.flush();

                // Write the Atom representation(XML) into Http response content
                OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
                PrintWriter out = new PrintWriter(response.getOutputStream());
                out.println(stringWriter.toString());
                out.close();

                System.out.println("Feed content in plain text:" + stringWriter.toString());
            } else {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }

        } else if (path.startsWith("/")) {

            // get HTTP request asking for an entry

            // Return a specific entry in the collection
            com.google.gdata.data.Entry feedEntry = null;

            // Invoke the get operation on the service implementation
            Message requestMessage = messageFactory.createMessage();
            String id = path.substring(1);
            requestMessage.setBody(new Object[] {id});
            Message responseMessage = getInvoker.invoke(requestMessage);
            if (responseMessage.isFault()) {
                throw new ServletException((Throwable)responseMessage.getBody());
            }

            if (supportsFeedEntries) {
                // The service implementation returns a feed entry
                feedEntry = (com.google.gdata.data.Entry)responseMessage.getBody();

                System.out.println("entry title: " + feedEntry.getTitle().getPlainText());

            } else {
                // The service implementation only returns a data item, create
                // an entry
                // from it
                Entry<Object, Object> entry = new Entry<Object, Object>(id, responseMessage.getBody());
                // FIXME The line below needs to be fixed
                // feedEntry = feedEntry(entry, itemClassType, itemXMLType,
                // mediator, abderaFactory);
            }

            // Write the Gdata entry
            if (feedEntry != null) {

                // Write a GData entry using Atom representation
                response.setContentType("application/atom+xml; charset=utf-8");

                // Generate the corresponding Atom representation of the feed
                StringWriter stringWriter = new StringWriter();
                com.google.gdata.util.common.xml.XmlWriter w =
                    new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
                feedEntry.generateAtom(w, new ExtensionProfile());
                w.flush();

                // Write the Atom representation(XML) into Http response content
                OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
                PrintWriter out = new PrintWriter(response.getOutputStream());
View Full Code Here

                    // Generate the corresponding Atom representation of the
                    // feed
                    StringWriter stringWriter = new StringWriter();
                    com.google.gdata.util.common.xml.XmlWriter w =
                        new com.google.gdata.util.common.xml.XmlWriter(stringWriter);
                    createdFeedEntry.generateAtom(w, new ExtensionProfile());
                    w.flush();

                    // Write the Atom representation(XML) into Http response
                    // content
                    OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
View Full Code Here

TOP

Related Classes of com.google.gdata.data.ExtensionProfile

Copyright © 2018 www.massapicom. 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.