svn-gvsig-desktop / trunk / applications / appCatalogYNomenclatorClient / src / es / gva / cit / catalogClient / parsers / srw / SrwRecordsParser.java @ 3081
History | View | Annotate | Download (2.98 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib??ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package es.gva.cit.catalogClient.parsers.srw; |
42 |
|
43 |
import es.gva.cit.catalogClient.metadataXML.XMLNode; |
44 |
import es.gva.cit.catalogClient.metadataXML.XMLTree; |
45 |
import es.gva.cit.catalogClient.parsers.AbstractTags; |
46 |
import es.gva.cit.catalogClient.parsers.Resource; |
47 |
|
48 |
|
49 |
|
50 |
/**
|
51 |
* @author Jorge Piera Llodra (piera_jor@gva.es)
|
52 |
*/
|
53 |
public class SrwRecordsParser extends AbstractTags { |
54 |
public SrwRecordsParser(XMLNode node) {
|
55 |
setNode(node); |
56 |
setTitle(XMLTree.searchNodeValue(node, |
57 |
"recordData->MD_Metadata->identificationInfo->MD_DataIdentification->citation->CI_Citation->title"));
|
58 |
setAbstract_(XMLTree.searchNodeValue(node, |
59 |
"recordData->MD_Metadata->identificationInfo->MD_DataIdentification->abstract"));
|
60 |
setPurpose(XMLTree.searchNodeValue(node, |
61 |
"recordData->MD_Metadata->identificationInfo->MD_DataIdentification->purpose"));
|
62 |
setKeyWords(XMLTree.searchMultipleNodeValue(node, |
63 |
"recordData->MD_Metadata->identificationInfo->MD_DataIdentification->descriptiveKeywords->MD_Keywords->keyword"));
|
64 |
|
65 |
//this.setResources(getResources(node,""));
|
66 |
} |
67 |
|
68 |
public Resource[] getResources(XMLNode node, String label) { |
69 |
XMLNode[] nodes = XMLTree.searchMultipleNode(node, label);
|
70 |
|
71 |
if (nodes == null) { |
72 |
return null; |
73 |
} |
74 |
|
75 |
Resource[] resources = new Resource[nodes.length]; |
76 |
|
77 |
for (int i = 0; i < resources.length; i++) |
78 |
resources[i] = new Resource(XMLTree.searchNodeValue(nodes[i], ""), |
79 |
XMLTree.searchNodeValue(nodes[i], ""),
|
80 |
XMLTree.searchNodeValue(nodes[i], ""),
|
81 |
XMLTree.searchNodeValue(nodes[i], ""),
|
82 |
XMLTree.searchNodeAtribute(nodes[i], "", ""), |
83 |
XMLTree.searchNodeValue(nodes[i],""),
|
84 |
null);
|
85 |
|
86 |
return resources;
|
87 |
} |
88 |
} |