Package com.bradmcevoy.http.XmlWriter

Examples of com.bradmcevoy.http.XmlWriter.Element


        XmlWriter writer = new XmlWriter(generatedXml);
        writer.writeXMLHeader();
        writer.open(WebDavProtocol.NS_DAV.getPrefix(), "schedule-response " + helper.generateNamespaceDeclarations());
        writer.newLine();
        for (SchedulingResponseItem resp : respItems) {
            Element elResp = writer.begin("C", "response");
            Element elRecip = elResp.begin("C", "recipient");
            elRecip.begin("D", "href").writeText(resp.getRecipient(), false).close();
            elRecip.close();
            StatusResponse stat = resp.getStatus();
            elRecip.begin(CALDAV_PREFIX, "request-status").writeText(stat.code + ";" + stat.description, false).close();
            if (resp.getiCalText() != null) {
                elRecip.begin(CALDAV_PREFIX, "calendar-data").writeText(resp.getiCalText(), false).close();
            }
            elResp.close();
        }

        writer.close(WebDavProtocol.NS_DAV.getPrefix(), "multistatus");
View Full Code Here


        return LockToken.class.isAssignableFrom( c );
    }

    public void writeValue( XmlWriter writer, String nsUri, String prefix, String localName, Object val, String href, Map<String, String> nsPrefixes ) {
        LockToken token = (LockToken) val;
        Element lockDiscovery = writer.begin( "D:lockdiscovery" ).open();   
        if( token != null ) {
      Element activeLock = writer.begin( "D:activelock" ).open();
            LockInfo info = token.info;
            lockWriterHelper.appendType( writer, info.type );
            lockWriterHelper.appendScope( writer, info.scope );
            lockWriterHelper.appendDepth( writer, info.depth );
            lockWriterHelper.appendOwner( writer, info.lockedByUser );
            lockWriterHelper.appendTimeout( writer, token.timeout.getSeconds() );
            lockWriterHelper.appendTokenId( writer, token.tokenId );
            lockWriterHelper.appendRoot( writer, href );
      activeLock.close();
        }   
        lockDiscovery.close();
    }
View Full Code Here

    }

    public void writeValue( XmlWriter writer, String nsUri, String prefix, String localName, Object val, String href, Map<String, String> nsPrefixes ) {
        List<QName> list = (List<QName>) val;
        if( list != null && list.size() > 0 ) {
            Element rt = writer.begin( prefix, localName );
            for( QName name : list ) {
                String childNsUri = name.getNamespaceURI();
                String childPrefix = nsPrefixes.get( childNsUri );
                // don't write a new line - see http://www.ettrema.com:8080/browse/MIL-83
                rt.begin( childPrefix, name.getLocalPart() ).noContent(false);
            }
            rt.close();
        } else {
            writer.writeProperty( prefix, localName );
        }
    }
View Full Code Here

    public void writeValue( XmlWriter writer, String nsUri, String prefix, String localName, Object val, String href, Map<String, String> nsPrefixes ) {
       
     
        SupportedReportSetList list = (SupportedReportSetList) val;
        Element reportSet = writer.begin( "supported-report-set" ).open();
        if( list != null ) {
            for( String s : list) {
                Element supportedReport = writer.begin( "supported-report" ).open();
                Element report = writer.begin( "report" ).open();
                writer.writeProperty( s );
                report.close();
                supportedReport.close();
            }
        }
        reportSet.close();
    }
View Full Code Here

    public void writeValue( XmlWriter writer, String nsUri, String prefix, String localName, Object val, String href, Map<String, String> nsPrefixes ) {
      writer.open(prefix, localName);
      HrefList list = (HrefList) val;
      if( list != null ) {
          for( String s : list) {
              Element hrefEl = writer.begin( "D:href" ).open();
              hrefEl.writeText( s );
              hrefEl.close();
          }
      }
      writer.close(prefix, localName);
    }
View Full Code Here

    public boolean supports( String nsUri, String localName, Class c ) {
        return SupportedLocks.class.isAssignableFrom( c );
    }

    public void writeValue( XmlWriter writer, String nsUri, String prefix, String localName, Object val, String href, Map<String, String> nsPrefixes ) {
    Element supportedLocks = writer.begin("D:supportedlock").open();
        Element lockentry = writer.begin( "D:lockentry" ).open();
        writer.begin( "D:lockscope" ).open(false).writeText( "<D:exclusive/>" ).close();
        writer.begin( "D:locktype" ).open(false).writeText( "<D:write/>" ).close();
        lockentry.close();
    supportedLocks.close();
    }
View Full Code Here

    public void writeValue( XmlWriter writer, String nsUri, String prefix, String localName, Object val, String href, Map<String, String> nsPrefixes ) {
      writer.open(prefix, localName);
      WrappedHref wrappedHref = (WrappedHref) val;
      if( wrappedHref != null && wrappedHref.getValue() != null ) {
            //TODO: Replace explicit namespace declaration with reference to constant
            Element hrefEl = writer.begin(WebDavProtocol.NS_DAV.getPrefix(),"href" ).open();
            hrefEl.writeText( wrappedHref.getValue() );
            hrefEl.close();
      }
      writer.close(prefix, localName);
    }
View Full Code Here

TOP

Related Classes of com.bradmcevoy.http.XmlWriter.Element

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.