Revision 3081 trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/drivers/CSWCatalogServiceDriver.java

View differences:

CSWCatalogServiceDriver.java
43 43
import es.gva.cit.catalogClient.metadataXML.XMLNode;
44 44
import es.gva.cit.catalogClient.metadataXML.XMLTree;
45 45
import es.gva.cit.catalogClient.metadataXML.XMLTreeNumberOfRecordsAnswer;
46
import es.gva.cit.catalogClient.parsers.csw.ProtocolsOperations;
47
import es.gva.cit.catalogClient.parsers.csw.cswCapabilitiesParser;
46
import es.gva.cit.catalogClient.parsers.csw.CswSupportedProtocolOperations;
47
import es.gva.cit.catalogClient.parsers.csw.CswCapabilitiesParser;
48 48
import es.gva.cit.catalogClient.protocols.HTTPGetProtocol;
49 49
import es.gva.cit.catalogClient.protocols.HTTPPostProtocol;
50 50
import es.gva.cit.catalogClient.protocols.SOAPProtocol;
......
73 73
    private String[] NAMESPACE = null;
74 74
    private String ServerProfile = "ebRIM"; //or ISO
75 75
    private String version = "2.0.0";
76
    private ProtocolsOperations operations = null;
76
    private CswSupportedProtocolOperations operations = null;
77 77

  
78 78
    /*
79 79
     * (non-Javadoc)
......
378 378
     * @return
379 379
     * Name-value pair with a XML request
380 380
     */
381
    public NameValuePair[] getPOSTMessageCapabilities() {
382
        String message = "<csw:GetCapabilities service=\"CSW\" version=\"2.0.0\" " +
381
    public String getPOSTMessageCapabilities() {
382
       return "<csw:GetCapabilities service=\"CSW\" version=\"2.0.0\" " +
383 383
            "xmlns:csw=\"http://www.opengis.net/cat/csw\" " +
384 384
            "xmlns:ogc=\"http://www.opengis.net/ogc\">" +
385 385
            "<AcceptVersions xmlns=\"http://www.opengis.net/ows\">" +
......
387 387
            "<AcceptFormats xmlns=\"http://www.opengis.net/ows\">" +
388 388
            "<OutputFormat>text/xml</OutputFormat>" + "</AcceptFormats>" +
389 389
            "</csw:GetCapabilities>";
390

  
391
        System.out.println(message);
392

  
393
        NameValuePair nvp1 = new NameValuePair("body", message);
394

  
395
        return new NameValuePair[] { nvp1 };
396 390
    }
397 391
    
398 392
    /**
......
401 395
     * @return
402 396
     * Name-value pair with a XML request
403 397
     */
404
    public NameValuePair[] getPOSTDescribeRecords() {
405
        String message = "<csw:DescribeRecord " +
398
    public String getPOSTDescribeRecords() {
399
        return "<csw:DescribeRecord " +
406 400
            "xmlns:csw=\"http://www.opengis.net/cat/csw\" " +
407 401
            "xmlns:ogc=\"http://www.opengis.net/ogc\" " + "service=\"CSW\" " +
408 402
            "version=" + version + " " + "outputFormat=\"test/xml\" " +
409 403
            "schemaLanguage=\"XMLSCHEMA\">" +
410 404
            "<csw:TypeName>csw:record</csw:TypeName>" +
411 405
            "</csw:DescribeRecord>";
412

  
413
        System.out.println(message);
414

  
415
        NameValuePair nvp1 = new NameValuePair("body", message);
416

  
417
        return new NameValuePair[] { nvp1 };
406
       
418 407
    }
419 408

  
420 409
    /**
......
423 412
     * @return
424 413
     * Name-value pair with a XML request
425 414
     */
426
    public NameValuePair[] getPOSTMessageRecords(Query query, int firstRecord) {
415
    public String getPOSTMessageRecords(Query query, int firstRecord) {
427 416
        CSWQuery cswq = new CSWQuery(query);
428 417

  
429
        String message = "<?xml version='1.0' encoding='UTF-8'?>" +
418
        return "<?xml version='1.0' encoding='UTF-8'?>" +
430 419
            "<GetRecords " + "service='CSW' " +
431 420
            "version='2.0.0' " + "xmlns='http://www.opengis.net/cat/csw' " +
432 421
            "xmlns:ogc='http://www.opengis.net/ogc' " +
......
450 439
        cswq.getQuery(this.getServerProfile()) + "</csw:Constraint>" +
451 440
        "</csw:Query>" + "</csw:GetRecords>";
452 441
        */
453
        System.out.println(message);
454

  
455
        NameValuePair nvp1 = new NameValuePair("body", message);
456

  
457
        return new NameValuePair[] { nvp1 };
442
        
458 443
    }
459 444
    
460 445
    /**
......
464 449
     * String with the SOAP message
465 450
     */
466 451
    public String getSOAPMessageCapabilities() {
467
        return SOAPProtocol.setSOAPMessage(getPOSTMessageCapabilities()[0].getValue(),null);
452
        return SOAPProtocol.setSOAPMessage(getPOSTMessageCapabilities(),null);
468 453
    }
469 454

  
470 455
    /**
......
474 459
     * String with the SOAP message
475 460
     */
476 461
    public String getSOAPMessageDescribeRecords() {
477
        return SOAPProtocol.setSOAPMessage(getPOSTDescribeRecords()[0].getValue(),null);
462
        return SOAPProtocol.setSOAPMessage(getPOSTDescribeRecords(),null);
478 463
    }
479 464
    
480 465
    /**
......
485 470
     */
486 471
    public String getSOAPMessageRecords(Query query, int firstRecord) {
487 472
        return SOAPProtocol.setSOAPMessage(getPOSTMessageRecords(query,
488
                firstRecord)[0].getValue(),null);
473
                firstRecord),null);
489 474
    }
490 475

  
491 476
    /*
......
494 479
     * @see catalogClient.ICatalogServerDriver#setParameters(java.util.Properties)
495 480
     */
496 481
    public boolean setParameters(XMLNode[] nodes) {
497
        return new cswCapabilitiesParser(this).parse(nodes[0]);
482
        return new CswCapabilitiesParser(this).parse(nodes[0]);
498 483
    }
499 484
    
500 485
    /**
......
681 666
	/**
682 667
	 * @return Returns the operations.
683 668
	 */
684
	public ProtocolsOperations getOperations() {
669
	public CswSupportedProtocolOperations getOperations() {
685 670
		return operations;
686 671
	}
687 672
	/**
688 673
	 * @param operations The operations to set.
689 674
	 */
690
	public void setOperations(ProtocolsOperations operations) {
675
	public void setOperations(CswSupportedProtocolOperations operations) {
691 676
		this.operations = operations;
692 677
	}
693 678
}

Also available in: Unified diff