Revision 7715

View differences:

trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/catalogClient/loaders/ARCIMSLayerLoader.java
62 62
 *
63 63
 * $Id$
64 64
 * $Log$
65
 * Revision 1.1  2006-09-20 11:23:50  jorpiell
65
 * Revision 1.2  2006-10-02 08:29:06  jorpiell
66
 * Modificados los cambios del Branch 10 al head
67
 *
68
 * Revision 1.1.2.1  2006/09/20 12:01:36  jorpiell
69
 * Se ha cambiado la versi?n de la jzkit, se ha incorporado la funcionalidad de cargar arcims
70
 *
71
 * Revision 1.1  2006/09/20 11:23:50  jorpiell
66 72
 * Se ha cambiado la versi?n de la librer?a jzkit de la 1 a la 2.0. Adem?s se ha modificado lo del document
67 73
 *
68 74
 *
trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/gazetteer/GazetteerModule.java
152 152
    public boolean isVisible() {
153 153
        com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager()
154 154
		.getActiveWindow();
155
		
155
		        
156 156
		if (f == null) {
157 157
			return false;
158 158
		}
159 159
		
160
		return (f instanceof View);
160
		if (f instanceof View){
161
			if (((View)f).getMapControl().getViewPort().getAdjustedExtent() != null){
162
				return true;
163
			}
164
		}
165
		
166
		return false;
161 167
    }
162 168
}
trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/gazetteer/gui/SearchDialog.java
57 57
import com.iver.cit.gvsig.fmap.ViewPortListener;
58 58
import com.iver.cit.gvsig.project.documents.view.gui.View;
59 59

  
60

  
60 61
import es.gva.cit.catalogClient.querys.Coordinates;
61 62
import es.gva.cit.catalogClient.utils.Frames;
62 63
import es.gva.cit.gazetteer.GazetteerClient;
trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/gazetteer/DeleteSearchesModule.java
7 7
import com.iver.cit.gvsig.fmap.layers.GraphicLayer;
8 8
import com.iver.cit.gvsig.project.documents.view.gui.View;
9 9

  
10

  
10 11
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
11 12
 *
12 13
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
......
51 52
 *
52 53
 * $Id$
53 54
 * $Log$
54
 * Revision 1.8  2006-09-20 11:23:50  jorpiell
55
 * Revision 1.9  2006-10-02 08:29:06  jorpiell
56
 * Modificados los cambios del Branch 10 al head
57
 *
58
 * Revision 1.7.2.1  2006/09/20 12:01:47  jorpiell
59
 * Se ha cambiado la versi?n de la jzkit, se ha incorporado la funcionalidad de cargar arcims
60
 *
61
 * Revision 1.8  2006/09/20 11:23:50  jorpiell
55 62
 * Se ha cambiado la versi?n de la librer?a jzkit de la 1 a la 2.0. Adem?s se ha modificado lo del document
56 63
 *
57 64
 * Revision 1.7  2006/08/29 07:56:34  cesar
trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/gazetteer/loaders/FeatureLoader.java
42 42

  
43 43

  
44 44
import java.awt.Color;
45
import java.awt.Toolkit;
45 46
import java.awt.geom.Point2D;
46 47
import java.awt.geom.Rectangle2D;
47 48

  
......
51 52
import org.cresques.cts.ProjectionPool;
52 53

  
53 54
import com.iver.andami.PluginServices;
55
import com.iver.cit.gvsig.fmap.MapContext;
56
import com.iver.cit.gvsig.fmap.ViewPort;
54 57
import com.iver.cit.gvsig.fmap.core.FPoint2D;
55 58
import com.iver.cit.gvsig.fmap.core.IGeometry;
56 59
import com.iver.cit.gvsig.fmap.core.ShapeFactory;
57 60
import com.iver.cit.gvsig.fmap.core.v02.FConstant;
58 61
import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
62
import com.iver.cit.gvsig.fmap.crs.CRSFactory;
59 63
import com.iver.cit.gvsig.fmap.layers.GraphicLayer;
60 64
import com.iver.cit.gvsig.fmap.rendering.FGraphicLabel;
61 65
import com.iver.cit.gvsig.project.documents.view.gui.View;
......
85 89
			(View) PluginServices.getMDIManager().getActiveWindow();
86 90
		
87 91
		
88
		IProjection projection = ProjectionPool.get(sProjection);
92
		IProjection projection = CRSFactory.getCRS(sProjection);
89 93
		if (projection == null){
90 94
			projection = activeView.getMapControl().getViewPort().getProjection();
91 95
		}
......
124 128
		View activeView = 
125 129
			(View) PluginServices.getMDIManager().getActiveWindow();
126 130

  
127
		IDatum datum = activeView.getProjection().getDatum();
128
		
131
		IProjection projection = activeView.getProjection();
132
		ViewPort viewPort = activeView.getMapControl().getViewPort();
129 133
		Point2D point = getReprojectedPoint(feature.getCoordinates());
130
		Rectangle2D extent;
131
				
132
		if (datum.toString().indexOf("European_Datum_1950") > 0){
133
			extent = new Rectangle2D.Double(point.getX() - 5000,
134
					point.getY() - 5000,
135
					10000,
136
					10000);
137
		}else{//WGS_1984
138
			extent = new Rectangle2D.Double(point.getX() - 0.05,
139
					point.getY() - 0.05,
140
					0.1,
141
					0.1);
142
		}  		
143 134
		
144
		activeView.getMapControl().getViewPort().setExtent(extent);
135
		Rectangle2D zoomExtent = null;
136
		if (viewPort.getAdjustedExtent() == null){
137
			
138
		}else{
139
			Toolkit kit = Toolkit.getDefaultToolkit();
140
			double dpi = kit.getScreenResolution();
141
			Rectangle2D extent = projection.getExtent(viewPort.getAdjustedExtent(),
142
					25000,
143
					viewPort.getImageWidth(),
144
					viewPort.getImageHeight(),
145
					MapContext.CHANGE[viewPort.getMapUnits()],
146
					dpi);			
147
			zoomExtent = new Rectangle2D.Double(point.getX() - extent.getWidth()/2,
148
					point.getY() - extent.getHeight()/2,
149
					extent.getWidth(),
150
					extent.getHeight());
151
			activeView.getMapControl().getViewPort().setExtent(zoomExtent);
152
		}
153
		
154
		
145 155
	} 
146 156

  
147 157
	/**
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/z3950/drivers/Z3950Messages.java
44 44
*
45 45
* $Id$
46 46
* $Log$
47
* Revision 1.5  2006-09-20 11:22:43  jorpiell
47
* Revision 1.6  2006-10-02 08:29:07  jorpiell
48
* Modificados los cambios del Branch 10 al head
49
*
50
* Revision 1.4.10.1  2006/09/20 12:01:18  jorpiell
51
* Se ha cambiado la versi?n de la jzkit, se ha incorporado la funcionalidad de cargar arcims
52
*
53
* Revision 1.5  2006/09/20 11:22:43  jorpiell
48 54
* Se ha cambiado la versi?n de la librer?a jzkit de la 1 a la 2.0
49 55
*
50 56
* Revision 1.4  2006/01/12 13:52:24  jorpiell
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/csw/drivers/CSWCatalogServiceDriver.java
284 284
    private Collection createAnswerTree(int numberOfRecords, int firstRecord, XMLNode node, URL url) {        
285 285
        Collection answerNodes = new java.util.ArrayList();
286 286
      
287
        answerNodes.add(XMLTreeNumberOfRecordsAnswer.getNode(numberOfRecords,
288
                firstRecord, firstRecord + numberOfRecords));
289 287
        XMLNode[] auxNodes = cutMetadata(node);
290 288
        if (getServerProfile().equals(Schemas.EBRIM)) {
291 289
            auxNodes = getEbRIMNodes(auxNodes, url);
292 290
        }
291
        //Solves some problems with the maxNumberOfRecords attribute
292
        numberOfRecords = auxNodes.length;
293
        answerNodes.add(XMLTreeNumberOfRecordsAnswer.getNode(numberOfRecords,
294
                firstRecord, firstRecord + numberOfRecords));
295
        
293 296
        for (int i = 1;
294 297
                (i <= numberOfRecords) && (i <= 10) &&
295 298
                (i <= (numberOfRecords - firstRecord + 1)); i++)
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/ui/showResults/ShowResultsPanel.java
455 455
 * @return 
456 456
 */
457 457
    private String getHtml() {        
458
    	StringBuffer html = new StringBuffer();
459
    	html.append("<html><body>");
460
    	if ((getTags().getNode() != null) && (getTags().getNode().getName() != null)){
458
        StringBuffer html = new StringBuffer();
459
        html.append("<html><body>");
460
        if ((getTags().getNode() != null) && (getTags().getNode().getName() != null)){
461 461
    		if (getTags().getNode().getName().equals(XMLNode.ISNOTXML)){
462 462
    			html.append(getTags().getNode().getText());
463 463
    			html.append("</body></html>");
464 464
    			return html.toString();
465 465
    		}
466 466
    	}
467
    	html.append("<font COLOR=\"#0000FF\">");
468
    	if (this.getTags().getTitle() != null) {
469
    		html.append(this.getTags().getTitle());
470
    	}
471
    	html.append("<font COLOR=\"#000000\">");
472
    	if ((this.getTags().getAbstract_() != null) &&
473
    			(!(this.getTags().getAbstract_().equals("")))) {
474
    		html.append("<br>");
475
    		html.append("<br>");
476
    		html.append("<b>" + Messages.getText("abstract") + ": </b>");
477
    		html.append(this.getTags().getAbstract_());
478
    	}
479
    	if ((this.getTags().getPurpose() != null) &&
480
    			(!(this.getTags().getPurpose().equals("")))) {
481
    		html.append("<br>");
482
    		html.append("<br>");
483
    		html.append("<b>" + Messages.getText("purpose") +": </b>");
484
    		html.append(this.getTags().getPurpose());
485
    	}
486
    	if (this.getTags().getKeyWords() != null) {
487
    		if (this.getTags().getKeyWords()[0] != null) {
488
    			html.append("<br>");
489
    			html.append("<br>");
490
    			html.append("<b>" + Messages.getText("keyWords") + ":</b>");
491
    			html.append(this.getTags().getKeyWords()[0]);
492
    		}
493
    	}
494
    	if (this.getTags().getKeyWords() != null) {
495
    		for (int i = 1; i < this.getTags().getKeyWords().length; i++)
496
    			if (this.getTags().getKeyWords()[i] != null) {
497
    				html.append(", " + this.getTags().getKeyWords()[i]);
498
    			}
499
    	}
500
    	html.append("</body></html>");
501
    	return html.toString();
467
        html.append("<font COLOR=\"#0000FF\">");
468
        if (this.getTags().getTitle() != null) {
469
            html.append(this.getTags().getTitle());
470
        }
471
        html.append("<font COLOR=\"#000000\">");
472
        if ((this.getTags().getAbstract_() != null) &&
473
                (!(this.getTags().getAbstract_().equals("")))) {
474
            html.append("<br>");
475
            html.append("<br>");
476
            html.append("<b>" + Messages.getText("abstract") + ": </b>");
477
            html.append(this.getTags().getAbstract_());
478
        }
479
        if ((this.getTags().getPurpose() != null) &&
480
                (!(this.getTags().getPurpose().equals("")))) {
481
            html.append("<br>");
482
            html.append("<br>");
483
            html.append("<b>" + Messages.getText("purpose") +": </b>");
484
            html.append(this.getTags().getPurpose());
485
        }
486
        if (this.getTags().getKeyWords() != null) {
487
            if (this.getTags().getKeyWords()[0] != null) {
488
                html.append("<br>");
489
                html.append("<br>");
490
                html.append("<b>" + Messages.getText("keyWords") + ":</b>");
491
                html.append(this.getTags().getKeyWords()[0]);
492
            }
493
        }
494
        if (this.getTags().getKeyWords() != null) {
495
            for (int i = 1; i < this.getTags().getKeyWords().length; i++)
496
                if (this.getTags().getKeyWords()[i] != null) {
497
                    html.append(", " + this.getTags().getKeyWords()[i]);
498
                }
499
        }
500
        html.append("</body></html>");
501
        return html.toString();
502 502
    } 
503 503

  
504 504
/**
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/protocols/HTTPPostProtocol.java
41 41
*/
42 42
package es.gva.cit.catalogClient.protocols;
43 43
import es.gva.cit.catalogClient.metadataXML.XMLTree;
44
import es.gva.cit.catalogClient.utils.Strings;
45

  
44 46
import java.io.ByteArrayInputStream;
45 47
import java.io.IOException;
46 48
import java.io.InputStream;
......
96 98
            str = str + new String(buf, 0, len);
97 99
        }
98 100
            
101
        str = Strings.replace(str,
102
				  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
103
		  "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
99 104
        System.out.println(str);
100 105
        output = new ByteArrayInputStream(str.getBytes());
101 106
            
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/protocols/Z3950Connection.java
44 44
 *
45 45
 * $Id$
46 46
 * $Log$
47
 * Revision 1.2  2006-09-21 12:32:03  jorpiell
48
 * Se ha modificado para que en caso de lo que se recupera sea un documento de texto (no un xml) mostrarlo en la ventana principal
47
 * Revision 1.3  2006-10-02 08:29:07  jorpiell
48
 * Modificados los cambios del Branch 10 al head
49 49
 *
50
 * Revision 1.1.2.3  2006/10/02 07:13:43  jorpiell
51
 * Comprobada una NullPointerException que generaba una excepci?n
52
 *
53
 * Revision 1.1.2.2  2006/09/25 06:48:38  jorpiell
54
 * A?adida la funcionalidad de mostrar el documento de texto cuando no es un XML
55
 *
56
 * Revision 1.1.2.1  2006/09/20 12:01:07  jorpiell
57
 * Se ha cambiado la versi?n de la jzkit, se ha incorporado la funcionalidad de cargar arcims
58
 *
50 59
 * Revision 1.1  2006/09/20 11:20:17  jorpiell
51 60
 * Se ha cambiado la versi?n de la librer?a jzkit de la 1 a la 2.0
52 61
 *
......
74 83
import org.jzkit.search.util.RecordModel.XMLRecord;
75 84
import org.jzkit.search.util.ResultSet.IRResultSet;
76 85
import org.jzkit.search.util.ResultSet.IRResultSetException;
77
import org.jzkit.search.util.ResultSet.IRResultSetInfo;
78 86
import org.jzkit.search.util.ResultSet.IRResultSetStatus;
79 87
import org.jzkit.z3950.client.SynchronousOriginBean;
80 88
import org.jzkit.z3950.gen.v3.Z39_50_APDU_1995.InitializeResponse_type;
81
import org.jzkit.z3950.gen.v3.Z39_50_APDU_1995.ResultSetId_codec;
82 89
import org.w3c.dom.Document;
83 90

  
84 91
import es.gva.cit.catalogClient.metadataXML.XMLNode;
......
130 137
	    	resp = connect(host,port,auth_type,principal,group,credentials);
131 138
	    }
132 139
	    StringBuffer string = new StringBuffer();	    
140
	    if (resp == null){
141
	    	return null;
142
	    }
133 143
	    if (resp.result.booleanValue() == true) {
134 144
	    	if (resp.referenceId != null) {
135 145
	    		string.append("Reference ID : " + new String(resp.referenceId) +
......
180 190
				  firstRecord, lastRecord);
181 191
		  
182 192
		  RecordFormatSpecification rfs = new ExplicitRecordFormatSpecification(null,null,"f");
183
		  //RecordFormatSpecification rfs = new ArchetypeRecordFormatSpecification("Default");
184 193
		  InformationFragment[] fragment = result.getFragment(firstRecord,10,rfs);
185
				  
186
 		  for (int i=0 ; i<fragment.length ; i++){
194

  
195
		  for (int i=0 ; i<fragment.length ; i++){
187 196
			  try {
188 197
				  String answer = "";
189 198
				  if (fragment[i] instanceof XMLRecord){
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/protocols/Z3950Protocol.java
53 53
 *
54 54
 * $Id$
55 55
 * $Log$
56
 * Revision 1.22  2006-09-20 11:20:17  jorpiell
56
 * Revision 1.23  2006-10-02 08:29:07  jorpiell
57
 * Modificados los cambios del Branch 10 al head
58
 *
59
 * Revision 1.21.2.1  2006/09/20 12:01:18  jorpiell
60
 * Se ha cambiado la versi?n de la jzkit, se ha incorporado la funcionalidad de cargar arcims
61
 *
62
 * Revision 1.22  2006/09/20 11:20:17  jorpiell
57 63
 * Se ha cambiado la versi?n de la librer?a jzkit de la 1 a la 2.0
58 64
 *
59 65
 *
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/protocols/Z3950ConnectionFactory.java
74 74
 *
75 75
 * $Id$
76 76
 * $Log$
77
 * Revision 1.1  2006-09-20 11:20:17  jorpiell
77
 * Revision 1.2  2006-10-02 08:29:07  jorpiell
78
 * Modificados los cambios del Branch 10 al head
79
 *
80
 * Revision 1.1.2.1  2006/09/20 12:01:07  jorpiell
81
 * Se ha cambiado la versi?n de la jzkit, se ha incorporado la funcionalidad de cargar arcims
82
 *
83
 * Revision 1.1  2006/09/20 11:20:17  jorpiell
78 84
 * Se ha cambiado la versi?n de la librer?a jzkit de la 1 a la 2.0
79 85
 *
80 86
 *

Also available in: Unified diff