Package org.infoset.xml.util

Examples of org.infoset.xml.util.DocumentDestination


      }
      XMLRepresentationParser parser = new XMLRepresentationParser();
      Document doc = null;
     
      try {
         DocumentDestination dest = new DocumentDestination();
        
         Name [] roots = { AdminXML.NM_PUSH , AdminXML.NM_PULL };
         parser.parse(entity,AdminApplication.createAdminDocumentDestination(dest,roots));
         doc = dest.getDocument();
         Element top = doc.getDocumentElement();
         SyncProcess proc = new SyncProcess(db,top);
         if (proc.exists()) {
            getResponse().setStatus(Status.CLIENT_ERROR_CONFLICT);
            return new StringRepresentation("Process with name "+proc.getName()+" already exists.");
View Full Code Here


         return new StringRepresentation("Non-XML media type for entity body: "+entity.getMediaType().getName());
      }
      Document doc = null;
     
      try {
         DocumentDestination dest = new DocumentDestination();
         parser.parse(entity,dest);
         doc = dest.getDocument();
      } catch (Exception ex) {
         getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
         return new StringRepresentation("XML parse error: "+ex.getMessage());
      }
     
View Full Code Here

      final String name = getRequest().getAttributes().get("name").toString();
      XMLRepresentationParser parser = new XMLRepresentationParser();
      Document doc = null;
     
      try {
         DocumentDestination dest = new DocumentDestination();
         Name [] names = { AdminXML.NM_PULL, AdminXML.NM_PUSH };
         parser.parse(entity,AdminApplication.createAdminDocumentDestination(dest,names));
         doc = dest.getDocument();
         SyncProcess proc = new SyncProcess(db,doc.getDocumentElement());
         String lname = proc.getName();
         if (!lname.equals(name)) {
            getResponse().setStatus(Status.CLIENT_ERROR_EXPECTATION_FAILED);
            return new StringRepresentation("Cannot change the name of the target.");
View Full Code Here

         return new StringRepresentation("Non-XML media type for entity body: "+entity.getMediaType().getName());
      }
      Document doc = null;
     
      try {
         DocumentDestination dest = new DocumentDestination();
         parser.parse(entity,dest);
         doc = dest.getDocument();
         Element top = doc.getDocumentElement();
         String sid = top.getAttributeValue("id");
         UUID id = sid==null ? UUID.randomUUID() : UUID.fromString(sid);
         String name = top.getAttributeValue("name");
         if (name==null) {
View Full Code Here

      final String name = getRequest().getAttributes().get("name").toString();
      XMLRepresentationParser parser = new XMLRepresentationParser();
      Document doc = null;
     
      try {
         DocumentDestination dest = new DocumentDestination();
         parser.parse(entity,AdminApplication.createAdminDocumentDestination(dest,AdminXML.NM_APP));
         doc = dest.getDocument();
         RemoteApp app = new RemoteApp(db,doc.getDocumentElement());
         String lname = app.getName();
         if (!lname.equals(name)) {
            getResponse().setStatus(Status.CLIENT_ERROR_EXPECTATION_FAILED);
            return new StringRepresentation("Cannot change the name of the remote app.");
View Full Code Here

      }
      Document doc = null;
     
      try {
        
         DocumentDestination dest = new DocumentDestination();
         parser.parse(entity,dest);
         doc = dest.getDocument();
      } catch (Exception ex) {
         getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
         return new StringRepresentation("XML parse error: "+ex.getMessage());
      }
     
View Full Code Here

   }
  
   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);
View Full Code Here

      throws XMLException
   {
      if (item.getType()==Item.ItemType.ElementItem) {
         level++;
         if (level==1) {
            dest = new DocumentDestination();
         }
      }
      if (dest!=null) {
         dest.send(item);
      }
View Full Code Here

         return new StringRepresentation("Non-XML media type for entity body: "+entity.getMediaType().getName());
      }
      Document doc = null;
     
      try {
         DocumentDestination dest = new DocumentDestination();
         parser.parse(entity,dest);
         doc = dest.getDocument();
         Element top = doc.getDocumentElement();
         String sid = top.getAttributeValue("id");
         UUID id = sid==null ? UUID.randomUUID() : UUID.fromString(sid);
         String name = top.getAttributeValue("name");
         if (name==null) {
View Full Code Here

      Map<String,DBInfo> dbList = (Map<String,DBInfo>)getContext().getAttributes().get(DatabaseListResource.DB_LIST);
      Map<String,DBInfo> autodbList = (Map<String,DBInfo>)getContext().getAttributes().get(DatabaseListResource.AUTO_DB_LIST);
      StorageFactory storageFactory = (StorageFactory)getContext().getAttributes().get(DatabaseListResource.STORAGE_FACTORY);
      XMLRepresentationParser parser = new XMLRepresentationParser();
      try {
         DocumentDestination dest = new DocumentDestination();
        
         parser.parse(entity,AdminApplication.createAdminDocumentDestination(dest,AdminXML.NM_BACKUP));
         Document doc = dest.getDocument();
        
         Element top = doc.getDocumentElement();
         String location = top.getAttributeValue("location");
         if (location==null) {
            getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
View Full Code Here

TOP

Related Classes of org.infoset.xml.util.DocumentDestination

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.