Statistics
| Revision:

root / trunk / applications / appCatalogAndGazetteerClient / src / es / gva / cit / catalog / schemas / LaitsGmuEbRIMRecord.java @ 15558

History | View | Annotate | Download (3.3 KB)

1
package es.gva.cit.catalog.schemas;
2

    
3
import java.net.URI;
4

    
5
import es.gva.cit.catalog.metadataxml.XMLNode;
6
import es.gva.cit.catalog.metadataxml.XMLTree;
7
import es.gva.cit.catalog.querys.Coordinates;
8

    
9
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
10
 *
11
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
12
 *
13
 * This program is free software; you can redistribute it and/or
14
 * modify it under the terms of the GNU General Public License
15
 * as published by the Free Software Foundation; either version 2
16
 * of the License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
26
 *
27
 * For more information, contact:
28
 *
29
 *  Generalitat Valenciana
30
 *   Conselleria d'Infraestructures i Transport
31
 *   Av. Blasco Ib??ez, 50
32
 *   46010 VALENCIA
33
 *   SPAIN
34
 *
35
 *      +34 963862235
36
 *   gvsig@gva.es
37
 *      www.gvsig.gva.es
38
 *
39
 *    or
40
 *
41
 *   IVER T.I. S.A
42
 *   Salamanca 50
43
 *   46005 Valencia
44
 *   Spain
45
 *
46
 *   +34 963163400
47
 *   dac@iver.es
48
 */
49
/* CVS MESSAGES:
50
 *
51
 * $Id$
52
 * $Log$
53
 *
54
 */
55
/**
56
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
57
 */
58
public class LaitsGmuEbRIMRecord extends Record{
59
        private static final String ROOT = "laitscsw:DataGranule";
60

    
61
        public  LaitsGmuEbRIMRecord() {        
62

    
63
        }
64

    
65
        public  LaitsGmuEbRIMRecord(URI uri, XMLNode node) {        
66
                super(uri,node);
67
                setTitle(node.searchNodeValue("name"));
68
                setAbstract_(node.searchNodeValue("description"));
69
                setPurpose(null);
70
                setKeyWords(null);
71
                setResources(getResources("OnlineAccessURLs->OnlineAccessURL"));
72
                setFileID(node.getAttribute("id"));               
73
                setImageURL(node.searchNodeValue("previewURL"));
74
        }         
75
        
76
        private Resource[] getResources(String label) {        
77
                XMLNode[] nodes = XMLTree.searchMultipleNode(getNode(), label);
78
                
79
                if (nodes == null) {
80
                        return null;
81
                }
82
                
83
                Coordinates coordinates = null;
84
                String srs = XMLTree.searchNodeValue(getNode(),"ogc:BBOX->referenceSystemNameCode");
85
                coordinates = new Coordinates(XMLTree.searchNodeValue(getNode(),"ogc:BBOX->westBoundingCoordinate"),
86
                                XMLTree.searchNodeValue(getNode(),"ogc:BBOX->northBoundingCoordinate"),
87
                                XMLTree.searchNodeValue(getNode(),"ogc:BBOX->eastBoundingCoordinate"),
88
                                XMLTree.searchNodeValue(getNode(),"ogc:BBOX->southBoundingCoordinate"));
89
                        
90
                Resource[] resources = new Resource[nodes.length];
91
                
92
                for (int i = 0; i < resources.length; i++){
93
                        resources[i] = new Resource(nodes[i].searchNodeValue("URL"),
94
                                        Resource.DOWNLOAD,
95
                                        null,
96
                                        null,
97
                                        null,
98
                                        srs,
99
                                        coordinates);
100
                        if (resources[i].getLinkage() == null){
101
                                resources[i].setLinkage("");
102
                        }
103

    
104
                }
105
                return resources;
106
        }
107

    
108

    
109
        /*
110
         * (non-Javadoc)
111
         * @see es.gva.cit.catalogClient.schemas.discoverer.Record#accept(java.net.URI, es.gva.cit.catalogClient.metadataxml.XMLNode)
112
         */
113
        public boolean accept(URI uri, XMLNode node) {
114
                System.out.println(node.getName());
115
                if (node.getName().equals(ROOT)){
116
                        return true;
117
                }
118
                return false;
119
        } 
120
}