Package com.google.gdata.data

Examples of com.google.gdata.data.ExtensionProfile


                    // 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

  /** Pretty-print a feed. */
  private static void pp(GoogleService service, BaseFeed feed, Writer w)
      throws IOException {
    XmlWriter xw = new XmlWriter(w, XML_PP, null);
    ExtensionProfile extProfile = service.getExtensionProfile();
    feed.generateAtom(xw, extProfile);
    xw.flush();
    w.write("\n");
    w.flush();
  }
View Full Code Here

  /** Pretty-print an entry. */
  private static void pp(GoogleService service, BaseEntry entry, Writer w)
      throws IOException {
    XmlWriter xw = new XmlWriter(w, XML_PP, null);
    ExtensionProfile extProfile = service.getExtensionProfile();
    entry.generateAtom(xw, extProfile);
    xw.flush();
    w.write("\n");
    w.flush();
  }
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

                    // 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

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.