Statistics
| Revision:

gvsig-catalog / org.gvsig.catalog / branches / org.gvsig.catalog-CSW2.0.2 / org.gvsig.catalog / org.gvsig.catalog.lib / src / main / java / org / gvsig / catalog / schemas / LaitsGmuISO19115Record.java @ 55

History | View | Annotate | Download (4.2 KB)

1
package org.gvsig.catalog.schemas;
2

    
3
import java.net.URI;
4

    
5
import org.gvsig.catalog.metadataxml.XMLNode;
6
import org.gvsig.catalog.metadataxml.XMLTree;
7
import org.gvsig.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: LaitsGmuRecord.java 561 2007-07-27 06:49:30Z jpiera $
52
 * $Log$
53
 * Revision 1.1.2.1  2007/07/23 07:14:24  jorpiell
54
 * Catalog refactoring
55
 *
56
 * Revision 1.1.2.2.4.2  2007/07/11 13:01:51  jorpiell
57
 * Catalog UI updated
58
 *
59
 * Revision 1.1.2.2.4.1  2007/07/10 11:18:04  jorpiell
60
 * Added the registers
61
 *
62
 * Revision 1.1.2.2  2006/11/15 00:08:08  jjdelcerro
63
 * *** empty log message ***
64
 *
65
 * Revision 1.2  2006/11/13 10:01:01  jorpiell
66
 * Nuevos parsers para el servidor de GMU
67
 *
68
 * Revision 1.1.2.1  2006/11/08 12:57:12  jorpiell
69
 * Se han hecho numerosos cambios para que pueda funcionar el nomenclator de Simon y el cat?logo de GMU
70
 *
71
 *
72
 */
73
/**
74
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
75
 */
76
public class LaitsGmuISO19115Record extends Record {        
77

    
78
        public  LaitsGmuISO19115Record() {        
79

    
80
        }
81

    
82
        /**
83
         * Constructor
84
         * 
85
         * 
86
         * @param node Node with the answer
87
         * @param serverURL Server URL. Necessary to load the image (just Geonetwork)
88
         */
89
        public  LaitsGmuISO19115Record(URI uri, XMLNode node) {        
90
                super(uri,node);
91
                setTitle(XMLTree.searchNodeValue(node,"granuleShortName"));
92
                setAbstract_(XMLTree.searchNodeValue(node, "description"));
93
                setPurpose(null);
94
                setKeyWords(null);
95
                setResources(getResources("OnlineAccessURLs->OnlineAccessURL"));
96
                setFileID(null);               
97
                //Caution: getImageUrl uses serverURL and FileID!!!
98
                setImage(null);
99

    
100
        } 
101

    
102
        /**
103
         * 
104
         * 
105
         * 
106
         * @return 
107
         * @param label 
108
         */
109
        private Resource[] getResources(String label) {        
110
                XMLNode[] nodes = XMLTree.searchMultipleNode(getNode(), label);
111
                Coordinates coordinates = null;
112
                String srs = null;
113

    
114
                if (nodes == null) {
115
                        return null;
116
                }
117
                Resource[] resources = new Resource[nodes.length];
118
                if (nodes.length > 0){
119
                        srs = XMLTree.searchNodeValue(getNode(),"ogc:BBOX->referenceSystemNameCode");
120
                        coordinates = new Coordinates(XMLTree.searchNodeValue(getNode(),"ogc:BBOX->westBoundingCoordinate"),
121
                                        XMLTree.searchNodeValue(getNode(),"ogc:BBOX->northBoundingCoordinate"),
122
                                        XMLTree.searchNodeValue(getNode(),"ogc:BBOX->eastBoundingCoordinate"),
123
                                        XMLTree.searchNodeValue(getNode(),"ogc:BBOX->southBoundingCoordinate"));
124
                }
125

    
126

    
127
                for (int i = 0; i < resources.length; i++){
128
                        resources[i] = new Resource(XMLTree.searchNodeValue(nodes[i],
129
                                        "URL"),
130
                                        Resource.DOWNLOAD,
131
                                        XMLTree.searchNodeValue(nodes[i], "orName"),
132
                                        XMLTree.searchNodeValue(nodes[i], "URLDescription"),
133
                                        XMLTree.searchNodeAtribute(nodes[i], "orFunct->OnFunctCd",
134
                                        "value"),
135
                                        srs,        
136
                                        coordinates);
137
                        if (resources[i].getLinkage() == null){
138
                                resources[i].setLinkage("");
139
                        }
140

    
141
                }
142
                return resources;
143
        }
144

    
145
        /*
146
         * (non-Javadoc)
147
         * @see es.gva.cit.catalogClient.schemas.discoverer.Record#accept(java.net.URI, es.gva.cit.catalogClient.metadataxml.XMLNode)
148
         */
149
        public boolean accept(URI uri, XMLNode node) {
150
                return false;
151
        }     
152

    
153

    
154
}