Package org.infoset.xml

Examples of org.infoset.xml.ItemDestination.send()


                        }
                     }

                     public void onEnd() throws QueryException {
                        try {
                           dest.send(constructor.createCharacters("\n"));
                           dest.send(constructor.createElementEnd(AtomResource.FEED_NAME));
                           dest.send(constructor.createDocumentEnd());
                        } catch (XMLException ex) {
                           throw new QueryException("Exception during feed end.",ex);
                        }
View Full Code Here


                     }

                     public void onEnd() throws QueryException {
                        try {
                           dest.send(constructor.createCharacters("\n"));
                           dest.send(constructor.createElementEnd(AtomResource.FEED_NAME));
                           dest.send(constructor.createDocumentEnd());
                        } catch (XMLException ex) {
                           throw new QueryException("Exception during feed end.",ex);
                        }
                     }
View Full Code Here

                     public void onEnd() throws QueryException {
                        try {
                           dest.send(constructor.createCharacters("\n"));
                           dest.send(constructor.createElementEnd(AtomResource.FEED_NAME));
                           dest.send(constructor.createDocumentEnd());
                        } catch (XMLException ex) {
                           throw new QueryException("Exception during feed end.",ex);
                        }
                     }
View Full Code Here

                     public void onEntry(Entry entry) throws QueryException {
                        try {
                           Feed feed = entry.getFeed();
                           String feedPath = feed.getPath();
                           String feedBaseURI = resourceBase.toString()+feedPath;
                           dest.send(constructor.createCharacters("\n"));

                           // get the entry representation
                           Representation rep = app.getStorage().getEntry(feedBaseURI,feedPath,feed.getUUID(),entry.getUUID());

                           // avoid thread creation because reading an output representation requires a thread
View Full Code Here

                     }

                     public void onFeed(Feed feed) throws QueryException {
                        try {
                           org.atomojo.app.client.Feed feedRep = new org.atomojo.app.client.Feed(xmlParser.load(app.getStorage().getFeedHead(feed.getPath(), feed.getUUID())));
                           dest.send(constructor.createCharacters("\n"));
                           dest.send(constructor.createElement(AtomResource.ENTRY_NAME));
                           text(constructor,dest,AtomResource.ID_NAME,feed.getUUID().toString());
                           text(constructor,dest,AtomResource.PUBLISHED_NAME,AtomResource.toXSDDate(feed.getCreated()));
                           text(constructor,dest,AtomResource.UPDATED_NAME,AtomResource.toXSDDate(feed.getEdited()));
                           text(constructor,dest,AtomResource.TITLE_NAME,feedRep.getTitle());
View Full Code Here

                     public void onFeed(Feed feed) throws QueryException {
                        try {
                           org.atomojo.app.client.Feed feedRep = new org.atomojo.app.client.Feed(xmlParser.load(app.getStorage().getFeedHead(feed.getPath(), feed.getUUID())));
                           dest.send(constructor.createCharacters("\n"));
                           dest.send(constructor.createElement(AtomResource.ENTRY_NAME));
                           text(constructor,dest,AtomResource.ID_NAME,feed.getUUID().toString());
                           text(constructor,dest,AtomResource.PUBLISHED_NAME,AtomResource.toXSDDate(feed.getCreated()));
                           text(constructor,dest,AtomResource.UPDATED_NAME,AtomResource.toXSDDate(feed.getEdited()));
                           text(constructor,dest,AtomResource.TITLE_NAME,feedRep.getTitle());
                           String summary = feedRep.getSummary();
View Full Code Here

                           while (terms.hasNext()) {
                              TermInstance<Feed> fterm = terms.next();
                              term(constructor,dest,fterm.getTerm().getURI(),fterm.getValue());
                           }
                           link(constructor,dest,"related",resourceBase+feed.getPath());
                           dest.send(constructor.createElementEnd(AtomResource.ENTRY_NAME));
                        } catch (Exception ex) {
                           throw new QueryException("Exception during feed entry generation.",ex);
                        }
                     }
                  } );
View Full Code Here

            try {
               Iterator<RemoteApp> apps = db.getRemoteApps();
               Writer out = new OutputStreamWriter(os,"UTF-8");
               ItemDestination dest = new WriterItemDestination(out,"UTF-8");
               ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
               dest.send(constructor.createDocument());
               dest.send(constructor.createElement(AdminXML.NM_APPS));
               while (apps.hasNext()) {
                  RemoteApp app = apps.next();
                  app.marshall();;
                  DocumentSource.generate(app.getElement(),false,dest);
View Full Code Here

               Iterator<RemoteApp> apps = db.getRemoteApps();
               Writer out = new OutputStreamWriter(os,"UTF-8");
               ItemDestination dest = new WriterItemDestination(out,"UTF-8");
               ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
               dest.send(constructor.createDocument());
               dest.send(constructor.createElement(AdminXML.NM_APPS));
               while (apps.hasNext()) {
                  RemoteApp app = apps.next();
                  app.marshall();;
                  DocumentSource.generate(app.getElement(),false,dest);
               }
View Full Code Here

               while (apps.hasNext()) {
                  RemoteApp app = apps.next();
                  app.marshall();;
                  DocumentSource.generate(app.getElement(),false,dest);
               }
               dest.send(constructor.createElementEnd(AdminXML.NM_APPS));
               dest.send(constructor.createDocumentEnd());
               out.flush();
               out.close();
            } catch (XMLException ex) {
               getContext().getLogger().log(Level.SEVERE,"Cannot get list of remotes from DB: "+ex.getMessage(),ex);
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.