Package org.atomojo.app

Examples of org.atomojo.app.InfosetRepresentation


   public Representation get()
   {
      try {
         DocumentDestination dest = new DocumentDestination();
         toXML(dest);
         InfosetRepresentation rep = new InfosetRepresentation(MediaType.APPLICATION_XML,dest.getDocument());
         rep.setCharacterSet(CharacterSet.UTF_8);
         return rep;
      } catch (XMLException ex) {
         getContext().getLogger().log(Level.SEVERE,"Cannot get users list due to XML exception: "+ex.getMessage(),ex);
         getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);
         return new StringRepresentation("Interal error, see logs.");
View Full Code Here


         return new StringRepresentation("Cannot get user due to database error.");
      }
      try {
         DocumentDestination dest = new DocumentDestination();
         toXML(user,dest);
         InfosetRepresentation rep = new InfosetRepresentation(MediaType.APPLICATION_XML,dest.getDocument());
         rep.setCharacterSet(CharacterSet.UTF_8);
         return rep;
      } catch (XMLException ex) {
         getContext().getLogger().log(Level.SEVERE,"Cannot build target list to due to XML exception: "+ex.getMessage(),ex);
         getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);
         return new StringRepresentation("Internal error, see logs.");
View Full Code Here

         xml.setAttributeValue("additive","true");
      }
      if (lastSync!=null) {
         xml.setAttributeValue("last-sync",AtomResource.toXSDDate(lastSync));
      }
      rep = new InfosetRepresentation(MediaType.APPLICATION_XML,xml.getDocument());
   }
View Full Code Here

      throws XMLException
   {
      xml = InfosetFactory.getDefaultInfoset().createItemConstructor().createDocument().createDocumentElement(AdminXML.NM_TARGET);
      xml.setAttributeValue("name",name);
      xml.setAttributeValue("path",path);
      rep = new InfosetRepresentation(MediaType.APPLICATION_XML,xml.getDocument());
   }
View Full Code Here

         Element authE = xml.addElement(AdminXML.NM_AUTH);
         authE.setAttributeValue("method",auth.getScheme());
         authE.setAttributeValue("name",auth.getName());
         authE.setAttributeValue("password",auth.getPassword());
      }
      rep = new InfosetRepresentation(MediaType.APPLICATION_XML,xml.getDocument());
   }
View Full Code Here

TOP

Related Classes of org.atomojo.app.InfosetRepresentation

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.