Statistics
| Revision:

gvsig-catalog / trunk / appCatalog / src-test / org / gvsig / catalog / catalog / drivers / ExampleNewDriver.java @ 6

History | View | Annotate | Download (3.19 KB)

1
package org.gvsig.catalog.catalog.drivers;
2

    
3
import java.net.URI;
4

    
5
import org.gvsig.catalog.CatalogLocator;
6
import org.gvsig.catalog.CatalogManager;
7
import org.gvsig.catalog.drivers.AbstractCatalogServiceDriver;
8
import org.gvsig.catalog.drivers.CatalogCapabilities;
9
import org.gvsig.catalog.drivers.DiscoveryServiceCapabilities;
10
import org.gvsig.catalog.drivers.GetRecordsReply;
11
import org.gvsig.catalog.querys.CatalogQuery;
12
import org.gvsig.catalog.schemas.Record;
13
import org.gvsig.catalog.ui.search.SearchAditionalPropertiesPanel;
14

    
15

    
16
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
17
 *
18
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
19
 *
20
 * This program is free software; you can redistribute it and/or
21
 * modify it under the terms of the GNU General Public License
22
 * as published by the Free Software Foundation; either version 2
23
 * of the License, or (at your option) any later version.
24
 *
25
 * This program is distributed in the hope that it will be useful,
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
 * GNU General Public License for more details.
29
 *
30
 * You should have received a copy of the GNU General Public License
31
 * along with this program; if not, write to the Free Software
32
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
33
 *
34
 * For more information, contact:
35
 *
36
 *  Generalitat Valenciana
37
 *   Conselleria d'Infraestructures i Transport
38
 *   Av. Blasco Ib??ez, 50
39
 *   46010 VALENCIA
40
 *   SPAIN
41
 *
42
 *      +34 963862235
43
 *   gvsig@gva.es
44
 *      www.gvsig.gva.es
45
 *
46
 *    or
47
 *
48
 *   IVER T.I. S.A
49
 *   Salamanca 50
50
 *   46005 Valencia
51
 *   Spain
52
 *
53
 *   +34 963163400
54
 *   dac@iver.es
55
 */
56
/* CVS MESSAGES:
57
 *
58
 * $Id: ExampleNewDriver.java 537 2007-07-26 11:21:10Z jpiera $
59
 * $Log$
60
 * Revision 1.1.2.1  2007/07/13 12:00:35  jorpiell
61
 * Add the posibility to add a new panel
62
 *
63
 *
64
 */
65
/**
66
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
67
 */
68
public class ExampleNewDriver extends AbstractCatalogServiceDriver {
69
        private static final CatalogManager catalogManager = CatalogLocator.getCatalogManager();
70
        
71
        /*
72
         * (non-Javadoc)
73
         * @see es.gva.cit.catalogClient.drivers.IDiscoveryServiceDriver#getCapabilities(java.net.URI)
74
         */
75
        public DiscoveryServiceCapabilities getCapabilities(URI uri) {
76
                return new CatalogCapabilities();
77
        }
78

    
79
        /*
80
         * (non-Javadoc)
81
         * @see es.gva.cit.catalog.drivers.ICatalogServiceDriver#getRecords(java.net.URI, es.gva.cit.catalog.querys.CatalogQuery, int)
82
         */
83
        public GetRecordsReply getRecords(URI uri, CatalogQuery query,
84
                        int firstRecord) {
85
                GetRecordsReply reply = new GetRecordsReply(1);
86
                Record record = catalogManager.createRecord(uri, null);
87
                record.setTitle("Record example");
88
                record.setAbstract_("Just for testing");
89
                reply.addRecord(record);
90
                return reply;
91
        }
92

    
93
        /*
94
         * (non-Javadoc)
95
         * @see es.gva.cit.catalog.drivers.IDiscoveryServiceDriver#getServiceName()
96
         */
97
        public String getServiceName() {
98
                return "My catalog service";
99
        }
100

    
101
        /*
102
         * (non-Javadoc)
103
         * @see es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver#getAditionalSearchPanel()
104
         */
105
        public SearchAditionalPropertiesPanel getAditionalSearchPanel(){
106
                return new ExampleNewPanel();
107
        }
108

    
109

    
110

    
111

    
112
}