Package org.infoset.xml

Examples of org.infoset.xml.ItemConstructor.createDocument()


      throws XMLException
   {
      String baseURIValue = baseURI.toString();
      URI baseDir = URI.create(baseURIValue.substring(0,baseURIValue.lastIndexOf('/')+1));
      ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
      dest.send(constructor.createDocument(baseURI));
      dest.send(constructor.createElement(SERVER));
      dest.send(constructor.createCharacters("\n"));
     
      Element keystoreE = constructor.createElement(KEYSTORE);
      keystoreE.setAttributeValue("href",baseDir.relativize(keyStorePath.toURI()).toString());
View Full Code Here


   public static void generate(Storage storage,Feed feed,Reference metaRef,Reference feedRef,String resourceBase,ItemDestination dest)
      throws XMLException
   {
      XMLRepresentationParser xmlParser = new XMLRepresentationParser();
      ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
      dest.send(constructor.createDocument());
      dest.send(constructor.createElement(AtomResource.FEED_NAME));
      link(constructor,dest,"self",metaRef.toString());
      link(constructor,dest,"related",feedRef.toString());
      try {
         org.atomojo.app.client.Feed feedRep = new org.atomojo.app.client.Feed(xmlParser.load(storage.getFeedHead(feed.getPath(), feed.getUUID())));
View Full Code Here

            try {
               Iterator<SyncProcess> procs = db.getSyncProcesses();
               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_SYNC_PROCESSES));
               while (procs.hasNext()) {
                  SyncProcess proc = procs.next();
                  proc.marshall();
                  DocumentSource.generate(proc.getElement(),false,dest);
View Full Code Here

      AuthService auth = (AuthService)getRequest().getAttributes().get(App.AUTH_SERVICE_ATTR);
      AuthCredentials cred = new AuthCredentials(getRequest().getChallengeResponse());
      final Iterator<User> users = auth.getUsers(cred);

      ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
      dest.send(constructor.createDocument());
      dest.send(constructor.createElement(NM_USERS));
      dest.send(constructor.createCharacters("\n"));
      while (users.hasNext()) {
         User user = users.next();
         UserResource.toXML(user,new RemoveDocumentFilter(dest));
View Full Code Here

  
   private void generate(ItemDestination dest)
      throws XMLException
   {
      ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
      dest.send(constructor.createDocument());
      dest.send(constructor.createElement(AdminXML.NM_USERS));
      dest.send(constructor.createCharacters("\n"));
      for (String group : groups.values()) {
         Element groupE = constructor.createElement(AdminXML.NM_GROUP);
         groupE.setAttributeValue("name",group);
View Full Code Here

   public void generate(ItemDestination dest)
      throws XMLException
   {
      Date now = new Date();
      ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
      dest.send(constructor.createDocument());
      dest.send(constructor.createElement(AtomResource.FEED_NAME));
      link(constructor,dest,"self",getRequest().getResourceRef().toString());
      text(constructor,dest,AtomResource.TITLE_NAME,"Terms");
      text(constructor,dest,AtomResource.ID_NAME,getRequest().getResourceRef().toString());
      text(constructor,dest,AtomResource.UPDATED_NAME,AtomResource.toXSDDate(now));
View Full Code Here

               try {
                  context.execute(new QueryContext.ResultListener() {
                     DocumentLoader loader = new SAXDocumentLoader();
                     public void onStart() throws QueryException {
                        try {
                           dest.send(constructor.createDocument());
                           dest.send(constructor.createElement(AtomResource.FEED_NAME));
                           dest.send(constructor.createCharacters("\n"));
                           link(constructor,dest,"self",getRequest().getResourceRef().toString());
                           dest.send(constructor.createCharacters("\n"));
                           text(constructor,dest,AtomResource.TITLE_NAME,"Term Query");
View Full Code Here

   {
      if (loadEntries) {
         Iterator<Element> entries = doc.getDocumentElement().getElementsByName(XML.ENTRY_NAME);
         ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
         while (entries.hasNext()) {
            Document entryDoc = constructor.createDocument(doc.getBaseURI());
            entryDoc.add((Child)entries.next().copyOfItem(true));
            add(new Entry(entryDoc));
         }
      }
   }
View Full Code Here

            break;
         }
      }
     
      ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
      dest.send(constructor.createDocument());
      dest.send(constructor.createElement(AtomResource.FEED_NAME));
      dest.send(constructor.createCharacters("\n"));
      link(constructor,dest,"self",getRequest().getResourceRef().toString());
      dest.send(constructor.createCharacters("\n"));
      text(constructor,dest,AtomResource.TITLE_NAME,"Term Query");
View Full Code Here

   {
      OutputStreamWriter w = new OutputStreamWriter(os,getCharacterSet().toString());
      try {
         WriterItemDestination dest = new WriterItemDestination(w,getCharacterSet().toString());
         ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
         dest.send(constructor.createDocument());
         dest.send(constructor.createElement(root));
         while (iter.hasNext()) {
            DBObject obj = iter.next();
            if (obj instanceof XMLObject) {
               ((XMLObject)obj).generate(constructor,dest,contents);
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.