Revision 8604

View differences:

branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/querys/Query.java
49 49
 * @author Jorge Piera Llodra (piera_jor@gva.es)
50 50
 */
51 51
public class Query {
52
	public static int SEARCH_SERVICE = 0;
53
	public static int SEARCH_DATA = 1;
52 54

  
55
	private int searchType = SEARCH_DATA;
53 56
/**
54 57
 * 
55 58
 * 
......
528 531
        }       
529 532
           
530 533
        return null;        
531
    } 
534
    }
535

  
536
public int getSearchType() {
537
	return searchType;
538
}
539

  
540
public void setSearchType(int searchType) {
541
	this.searchType = searchType;
542
} 
532 543
 }
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/csw/parsers/CswCapabilitiesParser.java
238 238
 */
239 239
    private void discoverServerProfile(XMLNode node) {        
240 240
        if ((url.getHost().equals("delta.icc.es")) || 
241
                (url.getHost().equals("indicio.demo.galdosinc.com"))){   
241
                (url.getHost().equals("indicio.demo.galdosinc.com")) ||
242
                (url.getHost().equals("laits.gmu.edu"))){   
242 243
            driver.setServerProfile(Schemas.EBRIM);
243 244
        }else{
244 245
            driver.setServerProfile(Schemas.ISO19115);
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/csw/filters/CSWFilter.java
42 42
package es.gva.cit.catalogClient.csw.filters;
43 43
import org.gvsig.i18n.Messages;
44 44

  
45
import es.gva.cit.catalogClient.csw.drivers.CSWMessages;
45 46
import es.gva.cit.catalogClient.filters.AbstractFilter;
46 47
import es.gva.cit.catalogClient.filters.AdditionalClauses;
47 48
import es.gva.cit.catalogClient.languages.FilterEncoding;
......
88 89
      FilterEncoding filter = new FilterEncoding("ogc:", "*", "?", "\\",
89 90
                "xmlns:ogc=\"http://www.opengis.net/ogc\"");
90 91
        
91
        addAdditionalClauses(filter);
92
        
92
        addAdditionalClauses(filter);  
93
        		
93 94
        if (query.getTitle() != null) {
94
            filter.addClauses(equiv.getTitle(), equiv.getTitleValue(query.getTitle(),query.getTitleFilter()), query.getTitleFilter(),
95
                "PropertyIsLike", "L", "And");
95
            if (CSWMessages.getUrl().getHost().equals("laits.gmu.edu")){
96
            	if (query.getSearchType() == Query.SEARCH_DATA){
97
            		StringBuffer buffer = new StringBuffer();
98
            		buffer.append("<ogc:Filter xmlns:ogc=\"http://www.opengis.net/ogc\">");
99
            		buffer.append("<ogc:PropertyIsLike wildCard=\"*\" singleChar=\"?\" escapeChar=\"\\\">");
100
            		buffer.append("<ogc:PropertyName>/DataGranule/name</ogc:PropertyName>");
101
            		buffer.append("<ogc:Literal>*" + query.getTitle() + "*</ogc:Literal>");
102
            		buffer.append("</ogc:PropertyIsLike>");
103
            		buffer.append("</ogc:Filter>");
104
            		return buffer.toString();
105
            	}else{
106
            		StringBuffer buffer = new StringBuffer();
107
            		buffer.append("<ogc:Filter xmlns:ogc=\"http://www.opengis.net/ogc\">");
108
            		buffer.append("<ogc:And>");
109
            		buffer.append("<ogc:PropertyIsEqualTo>");
110
            		buffer.append("<ogc:PropertyName>/Service/@id</ogc:PropertyName>");
111
            		buffer.append("<ogc:PropertyName>/Classification/@classifiedObject</ogc:PropertyName>");
112
            		buffer.append("</ogc:PropertyIsEqualTo>");
113
            		buffer.append("<ogc:PropertyIsEqualTo>");
114
            		buffer.append("<ogc:PropertyName>/Classification/@classificationNode</ogc:PropertyName>");
115
            		buffer.append("<ogc:PropertyName>/ClassificationNode/@id</ogc:PropertyName>");
116
            		buffer.append("</ogc:PropertyIsEqualTo>");
117
            		buffer.append("<ogc:PropertyIsEqualTo>");
118
            		buffer.append("<ogc:PropertyName>/ClassificationNode/@code</ogc:PropertyName>");
119
            		buffer.append("<ogc:Literal>" + query.getTitle() + "</ogc:Literal>");
120
            		buffer.append("</ogc:PropertyIsEqualTo>");
121
            		buffer.append("</ogc:And>");
122
            		buffer.append("</ogc:Filter>");
123
            		return buffer.toString();
124
            	}
125
            }else{
126
            	filter.addClauses(equiv.getTitle(), equiv.getTitleValue(query.getTitle(),query.getTitleFilter()), query.getTitleFilter(),
127
                        "PropertyIsLike", "L", "And");
128
            }
96 129
        }     
97 130
        
98 131
        if (query.isMinimized()){
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/csw/drivers/CSWCatalogServiceDriver.java
234 234
           
235 235
            if (getOperations().getGetRecords()[i].equals("POST")){
236 236
            	System.out.println("**************POST*************");
237
                System.out.println(messages.getHTTPPOSTRecords(getQuery(), firstRecord));            	
237
            	CSWMessages.setUrl(url);
238
            	System.out.println(messages.getHTTPPOSTRecords(getQuery(), firstRecord));            	
238 239
            	nodes = new HTTPPostProtocol().doQuery(url,
239 240
                        messages.getHTTPPOSTRecords(getQuery(), firstRecord), firstRecord);
240 241
                
......
286 287
      
287 288
        XMLNode[] auxNodes = cutMetadata(node);
288 289
        if (getServerProfile().equals(Schemas.EBRIM)) {
289
            auxNodes = getEbRIMNodes(auxNodes, url);
290
            if (!url.getHost().equals("laits.gmu.edu")){
291
            	auxNodes = getEbRIMNodes(auxNodes, url);
292
            }
290 293
        }
291 294
        //Solves some problems with the maxNumberOfRecords attribute
292
        numberOfRecords = auxNodes.length;
295
        //numberOfRecords = auxNodes.length;
293 296
        answerNodes.add(XMLTreeNumberOfRecordsAnswer.getNode(numberOfRecords,
294 297
                firstRecord, firstRecord + numberOfRecords));
295 298
        
......
328 331
    private NameValuePair[] getEbRIMRequestParameters(String id) {        
329 332
        NameValuePair nvp1 = new NameValuePair("request", "getExtrinsicContent");
330 333
        NameValuePair nvp2 = new NameValuePair("id", id);
331
        return new NameValuePair[] { nvp1, nvp2 };
334
        return new NameValuePair[] { nvp1, nvp2};
332 335
    } 
333 336

  
334 337
/**
......
393 396
            auxNodes = XMLTree.searchMultipleNode(node,
394 397
                    "csw:SearchResults->iso19115:MD_Metadata");
395 398
        }
396
  
399
        if (auxNodes.length == 0) {
400
            auxNodes = XMLTree.searchMultipleNode(node,
401
                    "csw:SearchResults->laitscsw:DataGranule");
402
        }          
403
        if (auxNodes.length == 0) {
404
            auxNodes = XMLTree.searchMultipleNode(node,
405
                    "csw:SearchResults->rim:Service");
406
        }  
397 407
        return auxNodes;
398 408
    } 
399 409
/*
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/csw/drivers/CSWMessages.java
40 40
*   dac@iver.es
41 41
*/
42 42
package es.gva.cit.catalogClient.csw.drivers;
43
import java.net.URL;
44

  
43 45
import es.gva.cit.catalogClient.csw.filters.CSWFilter;
44 46
import es.gva.cit.catalogClient.drivers.IProtocolMessages;
45 47
import es.gva.cit.catalogClient.protocols.SOAPProtocol;
......
55 57
 * @author Jorge Piera Llodra (piera_jor@gva.es)
56 58
 */
57 59
public class CSWMessages implements IProtocolMessages {
58
/**
60
	private static URL url = null;
61
	/**
59 62
 * 
60 63
 * 
61 64
 */
......
204 207
 * @param firstRecord 
205 208
 */
206 209
    public String getHTTPPOSTRecords(Query query, int firstRecord) {        
207
                      
208
        StringBuffer answer = new StringBuffer();
209
        	answer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
210
            "<GetRecords " + "service=\"" + driver.getService() + "\" " +
211
            "version=\"" + driver.getVersion() + "\" " + "xmlns=\"http://www.opengis.net/cat/csw\" " +
212
            "xmlns:ogc=\"http://www.opengis.net/ogc\" " +
213
            "xmlns:gml=\"http://www.opengis.net/gml\" " + "startPosition='" +
214
            firstRecord  + "' " + "maxRecords='10' ");
215
            if (driver.getOutputFormat() != null){
216
            	answer.append("outputFormat=\"" + driver.getOutputFormat() + "\" ");
210
    	StringBuffer answer = new StringBuffer();
211
    	answer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); 
212
    	if (url.getHost().equals("laits.gmu.edu")){
213
    		answer.append("<csw:GetRecords");
214
        }else{
215
        	answer.append("<GetRecords");
216
        }    	
217
    	answer.append(" " + "service=\"" + driver.getService() + "\" " +
218
    			"version=\"" + driver.getVersion() + "\" " + "xmlns=\"http://www.opengis.net/cat/csw\" " +
219
    			"xmlns:csw=\"http://www.opengis.net/cat/csw\" " + 
220
    			"xmlns:ogc=\"http://www.opengis.net/ogc\" " +
221
    			"xmlns:gml=\"http://www.opengis.net/gml\" " + "startPosition='" +
222
    			firstRecord  + "' " + "maxRecords='10' ");
223
    	if (driver.getOutputFormat() != null){
224
    		answer.append("outputFormat=\"" + driver.getOutputFormat() + "\" ");
225
    	}
226
    	if (getOutputSchema(driver.getOutputSchema()) != null){
227
    		answer.append("outputSchema=\"" + getOutputSchema(driver.getOutputSchema()) + "\" ");
228
    	}else{
229
    		answer.append("outputSchema=\"csw:IsoRecord\" ");
230
    	}
231
    	answer.append("resultType=\"" +
232
    			getResultType(driver.getResultType()) + "\">" +
233
    	"<Query ");
234
    	if (driver.getTypeNames() != null){
235
    		answer.append("typeNames=\"" +
236
    				Strings.getBlankSeparated(driver.getTypeNames()) + "\"");
217 237
            }
218
            if (getOutputSchema(driver.getOutputSchema()) != null){
219
            	answer.append("outputSchema=\"" + getOutputSchema(driver.getOutputSchema()) + "\" ");
220
            }else{
221
            	answer.append("outputSchema=\"csw:IsoRecord\" ");
222
            }
223
            answer.append("resultType=\"" +
224
            getResultType(driver.getResultType()) + "\">" +
225
            "<Query ");
226
            if (driver.getTypeNames() != null){
227
            	answer.append("typeNames=\"" +
228
            			Strings.getBlankSeparated(driver.getTypeNames()) + "\"");
229
            }
230
            answer.append(">" +
231
            getElementSetNameLabel() + 
232
            getMaxSetName(driver.getElementSetName()) + "</ElementSetName>");
238
            answer.append(">" + getElementSetNameLabel(query.getSearchType()));
239
            
233 240
            if ((driver.getService().equals("CSW"))){
234 241
            	answer.append("<Constraint version='1.0.20'>");
235 242
            }else{
......
237 244
            }
238 245
            answer.append(new CSWFilter().getQuery(query,driver.getServerProfile()) +
239 246
            "</Constraint>" +
240
            "</Query>" +
241
            "</GetRecords>");
247
            "</Query>");
248
         	if (url.getHost().equals("laits.gmu.edu")){
249
        		answer.append("</csw:GetRecords>");
250
            }else{
251
            	answer.append("</GetRecords>");
252
            }   
242 253
            return answer.toString();
243 254
    } 
244 255

  
245 256
/**
246 257
 * The IDEC server has some different labels
258
 * @param searchType 
247 259
 * 
248 260
 * 
249 261
 * @return 
250 262
 */
251
    private String getElementSetNameLabel() {        
263
    private String getElementSetNameLabel(int searchType) {        
264
        if (url.getHost().equals("laits.gmu.edu")){
265
        	StringBuffer buffer = new StringBuffer();
266
        	buffer.append("<ElementName>");
267
        	if (searchType == Query.SEARCH_DATA){
268
        		buffer.append("/DataGranule");
269
        	}else{
270
        		buffer.append("/Service");
271
        	}
272
        	buffer.append("</ElementName>");
273
        	return buffer.toString();
274
        }
275
    	StringBuffer buffer = new StringBuffer();
252 276
        if (driver.getServerProfile().equals(Schemas.EBRIM)){              
253
        	return "<ElementSetName typeNames='Dataset'>";
277
        	buffer.append("<ElementSetName typeNames='Dataset'>");
254 278
        }else{
255
            return "<ElementSetName>";
279
        	buffer.append("<ElementSetName>");
256 280
        }
257
        
281
        buffer.append(getMaxSetName(driver.getElementSetName()) + "</ElementSetName>");
282
        return buffer.toString();
258 283
    } 
259 284

  
260 285
/**
......
359 384
 * @param firstRecord 
360 385
 */
361 386
    public String getSOAPRecords(Query query, int firstRecord) {        
362
        return SOAPProtocol.setSOAPMessage(getHTTPPOSTRecords(query,
387
    	CSWMessages.setUrl(url);
388
    	return SOAPProtocol.setSOAPMessage(getHTTPPOSTRecords(query,
363 389
                firstRecord),null);
364
    } 
390
    }
391
public static void setUrl(URL url) {
392
	CSWMessages.url = url;
393
}
394
public static URL getUrl() {
395
	return url;
396
} 
365 397
 }
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/ui/search/SearchUpperPanel.java
40 40
*   dac@iver.es
41 41
*/
42 42
package es.gva.cit.catalogClient.ui.search;
43
import es.gva.cit.catalogClient.querys.Query;
43 44
import es.gva.cit.catalogClient.schemas.Schemas;
45

  
46
import com.iver.utiles.swing.JComboBox;
44 47
import com.iver.utiles.swing.jcomboServer.ServerData;
45 48
import java.awt.FlowLayout;
46 49
import java.awt.GridLayout;
......
53 56
import javax.swing.JTextField;
54 57

  
55 58
import org.gvsig.i18n.Messages;
59
import java.awt.Dimension;
56 60

  
57 61
/**
58 62
 * 
......
65 69
 * 
66 70
 * 
67 71
 */
68
    private JTextField tituloText = null;
72
    private JComboBox serviceText = null;
69 73
/**
70 74
 * 
71 75
 * 
......
110 114
 * 
111 115
 * 
112 116
 */
113
    private JPanel jPanel1 = null;
114
/**
115
 * 
116
 * 
117
 */
118 117
    private JButton sizeButton = null;
119 118
/**
120 119
 * 
121 120
 * 
122 121
 */
123 122
    private JPanel jPanel4 = null;
124

  
123
private JPanel jPanel = null;
124
private JLabel jLabel = null;
125
private JPanel jPanel2 = null;
126
private JTextField tituloText = null;
127
private JPanel jPanel3 = null;
125 128
/**
126 129
 * This method initializes
127 130
 * 
......
143 146
    private void initialize() {        
144 147
        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
145 148
        setLocation(0, 0);
146
        setSize(675, 50);
147
        setPreferredSize(new java.awt.Dimension(510,50));
149
        setSize(675, 100);
150
        setPreferredSize(new java.awt.Dimension(510,75));
148 151
        add(getUpperPanel(), null);
149 152
    } 
150 153

  
......
154 157
 * 
155 158
 * @return javax.swing.JTextField
156 159
 */
157
    private JTextField getTituloText() {        
158
        if (tituloText == null) {
159
            tituloText = new JTextField();
160
            tituloText.setPreferredSize(new java.awt.Dimension(250,20));
161
        }
162
        return tituloText;
160
    private JComboBox getServiceText() {        
161
        if (serviceText == null) {
162
            serviceText = new JComboBox();
163
            serviceText.setPreferredSize(new java.awt.Dimension(250,20));
164
            serviceText.addItem(Messages.getText("Data"));
165
            serviceText.addItem(Messages.getText("Services"));
166
         }
167
        return serviceText;
163 168
    } 
164 169

  
165 170
/**
......
174 179
            tituloLabel = new JLabel();
175 180
            panelLabTitulo = new JPanel();
176 181
            panelLabTitulo.setLayout(gridLayout10);
177
            tituloLabel.setText(Messages.getText("title"));
182
            tituloLabel.setText(Messages.getText("Service"));
178 183
            gridLayout10.setRows(1);
179 184
            panelLabTitulo.add(tituloLabel, null);
180 185
        }
......
204 209
 * 
205 210
 * @return javax.swing.JPanel
206 211
 */
207
    private JPanel getPanelTextTitulo() {        
212
    private JPanel getPanelTextService() {        
208 213
        if (panelTextTitulo == null) {
209 214
            panelTextTitulo = new JPanel();
210
            panelTextTitulo.add(getTituloText(), null);
215
            panelTextTitulo.add(getServiceText(), null);
211 216
        }
212 217
        return panelTextTitulo;
213 218
    } 
......
222 227
 * @return 
223 228
 */
224 229
    public String getTitle() {        
225
        if (getTituloText().getText().equals("")) {
230
        if (getTitleText().getText().equals("")) {
226 231
            return null;
227 232
        }
228
        return getTituloText().getText();
233
        return getTitleText().getText();
229 234
    } 
235
    
236
    public int getService(){
237
    	String service = (String)serviceText.getSelectedItem();
238
    	if (service.equals(Messages.getText("Services"))){
239
    		return Query.SEARCH_SERVICE;
240
    	}else{
241
    		return Query.SEARCH_DATA;
242
    	}   		
243
    		
244
    	
245
    }
230 246
/* (non-Javadoc)
231 247
     * @see es.gva.cit.catalogClient.ui.ISearchPanel#getRestrictAreaClicked()
232 248
     */
......
252 268
 * @param title 
253 269
 */
254 270
    public void setTitle(String title) {        
255
        getTituloText().setText(title);
256
        
271
        getTitleText().setText(title);        
257 272
    } 
258 273

  
259 274
/**
......
280 295
		if (upperPanel == null) {
281 296
			upperPanel = new JPanel();
282 297
			upperPanel.setLayout(new FlowLayout());
283
			upperPanel.setPreferredSize(new java.awt.Dimension(510,50));
298
			upperPanel.setPreferredSize(new java.awt.Dimension(510,100));
284 299
			upperPanel.add(getUpperLeftPanel(), null);
285 300
			upperPanel.add(getUpperRightPanel(), null);
286 301
		}
......
297 312
		if (upperLeftPanel == null) {
298 313
			upperLeftPanel = new JPanel();
299 314
			upperLeftPanel.setLayout(new BoxLayout(upperLeftPanel, BoxLayout.Y_AXIS));
300
			upperLeftPanel.setPreferredSize(new java.awt.Dimension(250,45));
315
			upperLeftPanel.setPreferredSize(new java.awt.Dimension(250,95));
301 316
			upperLeftPanel.add(getPanelLabTitulo(), null);
317
			upperLeftPanel.add(getPanelTextService(), null);
318
			upperLeftPanel.add(getJPanel(), null);
302 319
			upperLeftPanel.add(getPanelTextTitulo(), null);
303 320
		}
304 321
		return upperLeftPanel;
......
314 331
		if (upperRightPanel == null) {
315 332
			upperRightPanel = new JPanel();
316 333
			upperRightPanel.setLayout(new BoxLayout(upperRightPanel, BoxLayout.Y_AXIS));
317
			upperRightPanel.setPreferredSize(new java.awt.Dimension(250,45));
318
			upperRightPanel.add(getJPanel1(), null);
334
			upperRightPanel.setPreferredSize(new java.awt.Dimension(250,85));
335
			upperRightPanel.add(getJPanel3(), null);
319 336
			upperRightPanel.add(getPanelCheckBox(), null);
320 337
		}
321 338
		return upperRightPanel;
322 339
    } 
323 340

  
324 341
/**
325
 * This method initializes jPanel1
326
 * 
327
 * 
328
 * @return javax.swing.JPanel
329
 */
330
    private JPanel getJPanel1() {        
331
		if (jPanel1 == null) {
332
			jPanel1 = new JPanel();
333
			jPanel1.setPreferredSize(new java.awt.Dimension(37,15));
334
		}
335
		return jPanel1;
336
    } 
337

  
338
/**
339 342
 * This method initializes jButton
340 343
 * 
341 344
 * 
......
398 401
                profile.equals(Schemas.DUBLINCORE)){
399 402
            getCoordinatesCheckBox().setEnabled(false);
400 403
        }
401
    } 
404
    }
405

  
406
/**
407
 * This method initializes jPanel	
408
 * 	
409
 * @return javax.swing.JPanel	
410
 */
411
private JPanel getJPanel() {
412
	if (jPanel == null) {
413
		jLabel = new JLabel();
414
		jLabel.setText(Messages.getText("title"));
415
		GridLayout gridLayout = new GridLayout();
416
		gridLayout.setRows(1);
417
		jPanel = new JPanel();
418
		jPanel.setLayout(gridLayout);
419
		jPanel.add(jLabel, null);
420
	}
421
	return jPanel;
422
}
423

  
424
/**
425
 * This method initializes jPanel2	
426
 * 	
427
 * @return javax.swing.JPanel	
428
 */
429
private JPanel getPanelTextTitulo() {
430
	if (jPanel2 == null) {
431
		jPanel2 = new JPanel();
432
		jPanel2.add(getTitleText(), null);
433
	}
434
	return jPanel2;
435
}
436

  
437
/**
438
 * This method initializes jTextField	
439
 * 	
440
 * @return javax.swing.JTextField	
441
 */
442
private JTextField getTitleText() {
443
	if (tituloText == null) {
444
		tituloText = new JTextField();
445
		tituloText.setPreferredSize(new Dimension(250, 20));
446
	}
447
	return tituloText;
448
}
449

  
450
/**
451
 * This method initializes jPanel3	
452
 * 	
453
 * @return javax.swing.JPanel	
454
 */
455
private JPanel getJPanel3() {
456
	if (jPanel3 == null) {
457
		jPanel3 = new JPanel();
458
		jPanel3.setPreferredSize(new java.awt.Dimension(37,200));
459
	}
460
	return jPanel3;
461
} 
402 462
 }
403 463
//  @jve:decl-index=0:visual-constraint="10,10"
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/ui/search/SearchDialog.java
76 76
 * @param title DOCUMENT ME!
77 77
 */
78 78
    private void initialize(CatalogClient client, boolean isMinimized, String title,Object serverConnectFrame) {        
79
        setBounds(0, 0, 525, 115);
79
        setBounds(0, 0, 525, 160);
80 80
        this.setTitle("B?squeda de Cat?logo");
81 81
        setResizable(false);
82 82
        setName("search");
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/ui/search/SearchDialogPanel.java
191 191
		ppalPanel = null;
192 192
		ppalPanel = new JPanel();
193 193
		ppalPanel.setLayout(new BoxLayout(ppalPanel, BoxLayout.Y_AXIS));
194
		ppalPanel.setPreferredSize(new Dimension(514,91));
194
		ppalPanel.setPreferredSize(new Dimension(514,150));
195 195
		ppalPanel.add(getUpperPanel());
196 196
		ppalPanel.add(getLowerPanel());        
197 197
		ppalPanel.add(getButtonsPanel());
......
387 387
	 */
388 388
	protected void sizeButtonActionPerformed() {        
389 389
		if (isMinimized){
390
			parent.resize(525,450);
391
			ppalPanel.setPreferredSize(new Dimension(514,423));
390
			parent.resize(525,540);
391
			ppalPanel.setPreferredSize(new Dimension(514,550));
392 392
			getLowerPanel().setVisible(true);
393 393
			parent.setVisible(true);
394 394
			getUpperPanel().setUpIcon();
395 395
		}else{
396
			parent.setSize(525,113);
397
			ppalPanel.setPreferredSize(new Dimension(514,91));
396
			parent.setSize(525,160);
397
			ppalPanel.setPreferredSize(new Dimension(514,150));
398 398
			getLowerPanel().setVisible(false);
399 399
			ppalPanel.setVisible(true);
400 400
			getUpperPanel().setDownIcon();
......
451 451
	 */
452 452
	private Query doQuery() {        
453 453
		Query query = client.createNewQuery();
454
		query.setSearchType(upperPanel.getService());
454 455
		query.setTitle(upperPanel.getTitle());
455 456
		query.setTitleFilter(lowerPanel.getTitleOption());
456 457
		query.setAbstract(lowerPanel.getAbstract());
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/ui/chooseResource/ChooseResourcePanel.java
117 117
 * @param protocol 
118 118
 */
119 119
    private String getNameButton(String protocol) {        
120
	    if (protocol.toUpperCase().indexOf(Resource.WCS) >= 0)
120
	    if (protocol == null){
121
	    	return Messages.getText("unknown");
122
	    }
123
    	if (protocol.toUpperCase().indexOf(Resource.WCS) >= 0)
121 124
			return  Messages.getText("wcsColumn");
122 125
		
123 126
		if (protocol.toUpperCase().indexOf(Resource.WMS) >= 0)
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/schemas/parsers/LaitsGmuParser.java
1
package es.gva.cit.catalogClient.schemas.parsers;
2

  
3
import java.net.URL;
4

  
5
import es.gva.cit.catalogClient.metadataXML.XMLNode;
6
import es.gva.cit.catalogClient.metadataXML.XMLTree;
7
import es.gva.cit.catalogClient.querys.Coordinates;
8
import es.gva.cit.catalogClient.schemas.discoverer.Record;
9
import es.gva.cit.catalogClient.schemas.discoverer.Resource;
10

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

  
65
	/**
66
	 * Constructor
67
	 * 
68
	 * 
69
	 * @param node Node with the answer
70
	 * @param serverURL Server URL. Necessary to load the image (just Geonetwork)
71
	 */
72
	    public  LaitsGmuParser(XMLNode node, URL serverURL) {        
73
	        setNode(node);
74
	        setTitle(XMLTree.searchNodeValue(node,"granuleShortName"));
75
	        setAbstract_(XMLTree.searchNodeValue(node, "description"));
76
	        setPurpose(null);
77
	        setKeyWords(null);
78
	        setResources(getResources("OnlineAccessURLs->OnlineAccessURL"));
79
	        setFileID(null);
80
	        setServerURL(serverURL);
81
	        //Caution: getImageUrl uses serverURL and FileID!!!
82
	        setImage(null);
83
	        
84
	    } 
85

  
86
	/**
87
	 * 
88
	 * 
89
	 * 
90
	 * @return 
91
	 * @param label 
92
	 */
93
	    private Resource[] getResources(String label) {        
94
	        XMLNode[] nodes = XMLTree.searchMultipleNode(getNode(), label);
95
	        Coordinates coordinates = null;
96
	        String srs = null;
97
	        
98
	        if (nodes == null) {
99
	            return null;
100
	        }
101
	        Resource[] resources = new Resource[nodes.length];
102
	        if (nodes.length > 0){
103
	        	srs = XMLTree.searchNodeValue(getNode(),"ogc:BBOX->referenceSystemNameCode");
104
	        	coordinates = new Coordinates(XMLTree.searchNodeValue(getNode(),"ogc:BBOX->westBoundingCoordinate"),
105
	        			XMLTree.searchNodeValue(getNode(),"ogc:BBOX->northBoundingCoordinate"),
106
						XMLTree.searchNodeValue(getNode(),"ogc:BBOX->eastBoundingCoordinate"),
107
						XMLTree.searchNodeValue(getNode(),"ogc:BBOX->southBoundingCoordinate"));
108
	        }
109
	        	
110
	        	
111
	        for (int i = 0; i < resources.length; i++){
112
	            	resources[i] = new Resource(XMLTree.searchNodeValue(nodes[i],
113
	                        "URL"),
114
	                    Resource.DOWNLOAD,
115
	                    XMLTree.searchNodeValue(nodes[i], "orName"),
116
	                    XMLTree.searchNodeValue(nodes[i], "URLDescription"),
117
	                    XMLTree.searchNodeAtribute(nodes[i], "orFunct->OnFunctCd",
118
	                        "value"),
119
						srs,	
120
	            		coordinates);
121
	            	if (resources[i].getLinkage() == null){
122
	            		resources[i].setLinkage("");
123
	            	}
124
	            	
125
	        }
126
	        
127
	        
128
	        return resources;
129
	    }     
130
	  
131
	    
132
	 }
0 133

  
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/schemas/parsers/LaitsGmuServicesParser.java
1
package es.gva.cit.catalogClient.schemas.parsers;
2

  
3
import java.net.URL;
4

  
5
import es.gva.cit.catalogClient.metadataXML.XMLNode;
6
import es.gva.cit.catalogClient.metadataXML.XMLTree;
7
import es.gva.cit.catalogClient.querys.Coordinates;
8
import es.gva.cit.catalogClient.schemas.discoverer.Record;
9
import es.gva.cit.catalogClient.schemas.discoverer.Resource;
10

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

  
65
	/**
66
	 * Constructor
67
	 * 
68
	 * 
69
	 * @param node Node with the answer
70
	 * @param serverURL Server URL. Necessary to load the image (just Geonetwork)
71
	 */
72
	    public  LaitsGmuServicesParser(XMLNode node, URL serverURL) {        
73
	        setNode(node);
74
	        setTitle(XMLTree.searchNodeValue(node,"name"));
75
	        setAbstract_(XMLTree.searchNodeValue(node, "description"));	          
76
	        setPurpose(null);
77
	        setKeyWords(null);
78
	        setResources(getResources(node));
79
	        setFileID(null);
80
	        setServerURL(serverURL);
81
	        //Caution: getImageUrl uses serverURL and FileID!!!
82
	        setImage(null);
83
	        
84
	    } 
85

  
86
	/**
87
	 * 
88
	 * 
89
	 * 
90
	 * @return 
91
	 * @param label 
92
	 */
93
	    private Resource[] getResources(XMLNode node) {        
94
	    	 XMLNode[] slots = XMLTree.searchMultipleNode(node, "rim:Slot");
95
	    	 if (slots != null){
96
	    		 Resource[] resources = new Resource[slots.length];
97
	    		 for (int i=0 ; i<slots.length ; i++){
98
	    			 XMLNode slot = slots[i];
99
	    			 String resource = null;
100
	    			 String serviceType = null;
101
	    			 String attType = slot.getAttribute("name");
102
	    			 if (attType.equals("connectPointLinkage")){
103
	    				 resource = XMLTree.searchNodeValue(slot,"rim:ValueList->rim:Value");
104
	    				 setAbstract_(getAbstract_() + "<p>" + resource);
105
	    			 }else if(attType.equals("serviceType")){
106
	    				 serviceType = XMLTree.searchNodeValue(slot,"rim:ValueList->rim:Value");
107
	    			 }
108
	    			 resources[i] = new Resource(resource,getProtocol(serviceType),null,null,null,null,null);
109
	    		 }
110
	    		 return new Resource[0];
111
	    	 }else{
112
	    		 return new Resource[0];
113
	    	 }
114
	      
115
//	        for (int i = 0; i < resources.length; i++){
116
//	            	resources[i] = new Resource(XMLTree.searchNodeValue(nodes[i],
117
//	                        "URL"),
118
//	                    Resource.DOWNLOAD,
119
//	                    XMLTree.searchNodeValue(nodes[i], "orName"),
120
//	                    XMLTree.searchNodeValue(nodes[i], "URLDescription"),
121
//	                    XMLTree.searchNodeAtribute(nodes[i], "orFunct->OnFunctCd",
122
//	                        "value"),
123
//						srs,	
124
//	            		coordinates);
125
//	            	if (resources[i].getLinkage() == null){
126
//	            		resources[i].setLinkage("");
127
//	            	}
128
//	            	
129
//	        }
130
//	        
131
//	        
132
//	        return resources;	    
133
	    }
134

  
135
	private String getProtocol(String serviceType) {
136
		if (serviceType == null){
137
			return Resource.UNKNOWN;
138
		}
139
		if (serviceType.compareTo("WMS")==0){
140
			return Resource.WMS;
141
		}else if (serviceType.compareTo("WCS")==0){
142
			return Resource.WCS;
143
		}else if (serviceType.compareTo("WFS")==0){
144
			return Resource.WFS;
145
		}else if (serviceType.compareTo("WMS")==0){
146
			return Resource.WMS;
147
		}else if (serviceType.compareTo("WMS")==0){
148
			return Resource.WMS;
149
		}else if (serviceType.compareTo("WMS")==0){
150
			return Resource.WMS;
151
		}
152
		return Resource.UNKNOWN;
153
	} 
154
}
155

  
0 156

  
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/schemas/discoverer/DiscovererFormat.java
48 48
import es.gva.cit.catalogClient.schemas.parsers.IdecISO19115Parser;
49 49
import es.gva.cit.catalogClient.schemas.parsers.IdeeISO19115Parser;
50 50
import es.gva.cit.catalogClient.schemas.parsers.Iso19139Parser;
51
import es.gva.cit.catalogClient.schemas.parsers.LaitsGmuParser;
52
import es.gva.cit.catalogClient.schemas.parsers.LaitsGmuServicesParser;
51 53

  
52 54
import com.iver.utiles.swing.jcomboServer.ServerData;
53 55
import java.net.URL;
......
101 103
                (node.getName().equals("csw:Record"))){
102 104
            return new DublinCoreParser(node);
103 105
        }
106
    	
107
    	if (node.getName().equals("laitscsw:DataGranule")){
108
            return new LaitsGmuParser(node,url);
109
        }
110
    	
111
    	if (node.getName().equals("rim:Service")){
112
            return new LaitsGmuServicesParser(node,url);
113
        }
104 114
        
105 115
        if (node.getName().equals("iso19115:MD_Metadata")){
106 116
            return new DeegreeISO19115Parser(node);
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/wfsg/drivers/WFSGMessages.java
44 44
import es.gva.cit.gazetteer.querys.Query;
45 45
import es.gva.cit.gazetteer.wfsg.filters.WFSGFilter;
46 46
import java.net.URL;
47
import java.util.TreeMap;
48

  
47 49
import org.apache.commons.httpclient.NameValuePair;
48 50

  
49 51
/**
......
88 90
 * @param upper 
89 91
 */
90 92
    public NameValuePair[] getHTTPGETCapabilities(boolean upper) {        
91
        NameValuePair nvp1;
93
        NameValuePair nvp1;       
92 94
        
95
		String queryString = url.getFile().substring(url.getFile().indexOf('?')+1);
96
		
97
		String[] params = queryString.split("&");
98
		NameValuePair[] nvp = new NameValuePair[params.length + 2];
99
		for (int i = 0; i < params.length; i++) {
100
			if (params[i]!= null){
101
				String[] nameValue = params[i].split("=");
102
				if (nameValue.length == 1){
103
					nvp[i] = new NameValuePair(nameValue[0],"");
104
				}else if(nameValue.length == 2){
105
					nvp[i] = new NameValuePair(nameValue[0],nameValue[1]);					
106
				}
107
			}
108
		}
109
				
93 110
        if (upper){
94
            nvp1 = new NameValuePair("request", "GetCapabilities");
111
        	nvp[nvp.length-2] = new NameValuePair("request", "GetCapabilities");
95 112
        }else{
96
            nvp1 = new NameValuePair("request", "getCapabilities");
113
        	nvp[nvp.length-2] = new NameValuePair("request", "getCapabilities");
97 114
        }
115
        nvp[nvp.length-1] = new NameValuePair("service", "WFS");
98 116
        
99
          return new NameValuePair[] { nvp1 };
117
        return nvp;
100 118
    } 
101 119
/* (non-Javadoc)
102 120
     * @see es.gva.cit.gazetteer.drivers.messages.IProtocolMessages#getHTTPGETDescribeFeature()
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/wfsg/parsers/WfsgDescribeFeatureTypeParser.java
78 78
        ThesaurusNameField[] fields = new ThesaurusNameField[nFields.length];
79 79
        
80 80
        for (int i=0; i<nFields.length ; i++){
81
            fields[i] = new ThesaurusNameField(XMLTree.searchAtribute(nFields[i],"name"),
82
                    Integer.valueOf(XMLTree.searchAtribute(nFields[i],"minOccurs")).intValue(),
83
                    Boolean.valueOf(XMLTree.searchAtribute(nFields[i],"nillable")).booleanValue(),
81
        	int minOccurs = 0;
82
        	boolean nillable =true;
83
        	try{
84
            	minOccurs = Integer.valueOf(XMLTree.searchAtribute(nFields[i],"minOccurs")).intValue();
85
            	nillable =  Boolean.valueOf(XMLTree.searchAtribute(nFields[i],"nillable")).booleanValue();
86
            }catch(Exception e){
87
            	
88
            }
89
        	fields[i] = new ThesaurusNameField(XMLTree.searchAtribute(nFields[i],"name"),
90
                    minOccurs,
91
                    nillable,
84 92
                    XMLTree.searchAtribute(nFields[i],"type"));
85 93
        }   
86 94
        
branches/v10/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/wfsg/parsers/WfsgFeatureParser.java
73 73
        XMLNode[] nodeFeatures = XMLTree.searchMultipleNode(node,"gml:featureMember");
74 74
        
75 75
       String prefix = thesaurus.getName().split(":")[0];
76
          String geomField = getGeomField(prefix,thesaurus);
77
            
76
       String geomField = getGeomField(prefix,thesaurus);
77
           	           
78 78
        if ((node.getName().equals("ResultCollection")) ||
79
        	(node.getName().equals("feature_collection"))){
79
        	(node.getName().equals("feature_collection"))){        	
80 80
            return parseWFS(nodeFeatures,thesaurus,"geographicIdentifier",geomField);
81 81
        }else{
82 82
            return parseWFS(nodeFeatures,thesaurus,prefix + ":" + attribute,geomField);
......
95 95
 */
96 96
    public Feature[] parseWFS(XMLNode[] nodeFeatures, ThesaurusName thesaurusName, String attribute, String geomField) {        
97 97
        Feature[] features = new Feature[nodeFeatures.length];
98
                
98
               
99 99
        for (int i=0 ; i<nodeFeatures.length ; i++){
100
            String id = XMLTree.searchNodeAtribute(nodeFeatures[i],thesaurusName.getName(),"fid");
101
            
102
            XMLNode nodeName = XMLTree.searchNode(nodeFeatures[i],thesaurusName.getName() + "->" + attribute);
100
            String sThesaurusName = thesaurusName.getName();
101
        	String id = XMLTree.searchNodeAtribute(nodeFeatures[i],sThesaurusName,"fid");
102
        	Point2D point = null;    
103
        	
104
            XMLNode nodeName = XMLTree.searchNode(nodeFeatures[i],sThesaurusName + "->" + attribute);
105
            if (nodeName == null){
106
            	sThesaurusName = "ms:" + sThesaurusName;
107
            	nodeName = XMLTree.searchNode(nodeFeatures[i],sThesaurusName + "->" + "ms:toponimo");
108
            	geomField = sThesaurusName + "->ms:msGeometry->gml:Point->gml:coordinates";
109
            	point = getCoordinates(XMLTree.searchNodeValue(nodeFeatures[i],
110
                         geomField));  
111
            }else{
112
            	 point = getCoordinates(XMLTree.searchNodeValue(nodeFeatures[i],
113
                         geomField));
114
            }
103 115
            String name = "";
104 116
            
105 117
            if (nodeName != null){
......
109 121
                    name = nodeName.getCdata();                   
110 122
                }
111 123
            }           
112
            String description = name;
113
            Point2D point = getCoordinates(XMLTree.searchNodeValue(nodeFeatures[i],
114
                    geomField));
124
            String description = name;           
115 125
              
116 126
            features[i] = new Feature(id,name,description,point);
117 127
        }
......
156 166
                geomType = "Point";
157 167
                return prefix +
158 168
                "->gml:Point->gml:coordinates";
159
            }           
169
            }  
170
            
171
            if (thesaurus.getFields()[i].getType().equals("gml:GeometryPropertyType")){
172
                prefix = thesaurus.getName() + "->" + prefix + ":" + thesaurus.getFields()[i].getName();
173
                geomType = "Point";
174
                return prefix +
175
                "->gml:Point->gml:coordinates";
176
            }  
160 177
        }        
161 178
      return "";
162 179
    } 
branches/v10/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/catalogClient/gui/ConnectDialog.java
94 94
        closeJDialog();
95 95

  
96 96
        JDialog panel = new JDialog((Frame) PluginServices.getMainFrame(), false);
97
        Frames.searchDialogPosition(panel, 525, 118);
97
        Frames.searchDialogPosition(panel, 525, 160);
98 98
        panel.setTitle(Messages.getText("catalog_search") + " [" +
99 99
            getCurrentServer() + "]");
100 100
        panel.setResizable(false);
branches/v10/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/catalogClient/gui/SearchDialog.java
132 132
	  */	 
133 133
	 public void sizeButtonActionPerformed(){
134 134
	        if (isMinimized){
135
	            frame.setSize(525,457);
136
	            ppalPanel.setPreferredSize(new Dimension(514,423));
137
	            getLowerPanel().setPreferredSize(new Dimension(514,440));
135
	            frame.setSize(525,503);
136
	            ppalPanel.setPreferredSize(new Dimension(514,470));
137
	            getLowerPanel().setPreferredSize(new Dimension(514,470));
138 138
	            getLowerPanel().setVisible(true);
139 139
	            frame.setVisible(true);
140 140
	            getUpperPanel().setUpIcon();
141 141
	        }else{
142
	            frame.setSize(525,118);
143
	            ppalPanel.setPreferredSize(new Dimension(514,91));
142
	            frame.setSize(525,160);
143
	            ppalPanel.setPreferredSize(new Dimension(514,150));
144 144
	            getLowerPanel().setPreferredSize(new Dimension(514,0));
145 145
	            getLowerPanel().setVisible(false);
146 146
	            frame.setVisible(true);

Also available in: Unified diff