[Gvsig_desarrolladores] Persistencia entre proyectos

Fernando González Cortés fernando.gonzalez en iver.es
Mie Mayo 25 11:04:39 CEST 2005


Pues se ve bien. Si tu capa hereda de FLyrDefault o implementa FLayer se 
invocarán esos métodos al guardar y cargar el proyecto.

un saludo
Fernando

Jaume Dominguez wrote:

>Hola, estoy intentando averiguar qué es exactamente lo que se debe de
>hacer para guardar las propiedades de una capa cuando guardamos el
>proyecto, para posteriormente recuperarla sin tener que pasarse por el
>wizard y añadirla.
>
>Estos son los métodos que IMAGINO que tengo que incluir en la clase
>FLyrWCS. No se si estoy olvidando algo, que no he entendido el funcionamiento.
>
>	/**
>	 * Devuelve el XMLEntity con la información necesaria para reproducir la
>	 * capa.
>	 * 
>	 * @return XMLEntity.
>	 * @throws XMLException
>	 */
>	public XMLEntity getXMLEntity() throws XMLException {
>		XMLEntity xml = super.getXMLEntity();
>
>		xml.putProperty("wcs.fullExtent", StringUtilities.rect2String(fullExtent));
>		xml.putProperty("wcs.host", host.toExternalForm());
>		xml.putProperty("wcs.layerQuery", coverageQuery);
>		xml.putProperty("wcs.format", format);
>		xml.putProperty("wcs.srs", SRS);
>		xml.putProperty("wcs.time", time);
>		xml.putProperty("wcs.parameter", parameter);
>		xml.putProperty("wcs.label", label);
>		xml.putProperty("wcs.name", name);
>
>		return xml;
>	}
>
>	/**
>	 * A partir del XMLEntity reproduce la capa.
>	 * 
> 	 * @param xml XMLEntity
>	 *
>	 * @throws XMLException
>	 * @throws DriverException
>	 * @throws DriverIOException
>	 */
>	public void setXMLEntity(XMLEntity xml) throws XMLException {
>		super.setXMLEntity(xml);
>		fullExtent = StringUtilities.string2Rect(xml
>				.getStringProperty("wcs.fullExtent"));
>
>		try {
>			host = new URL(xml.getStringProperty("wcs.host"));
>		} catch (MalformedURLException e) {
>			throw new XMLException(e);
>		}
>
>		coverageQuery = xml.getStringProperty("wcs.layerQuery");
>		format = xml.getStringProperty("wcs.format");
>		SRS = xml.getStringProperty("wcs.srs");
>		time = xml.getStringProperty("wcs.time");
>		parameter = xml.getStringProperty("wcs.parameter");
>		label = xml.getStringProperty("wcs.label");
>		name = xml.getStringProperty("wcs.name");
>	}
>
>¿Como se ve la cosa?
>
>
>_______________________________________________
>gvSIG_desarrolladores mailing list
>gvSIG_desarrolladores en runas.cap.gva.es
>http://runas.cap.gva.es/mailman/listinfo/gvsig_desarrolladores
>
>
>  
>




Más información sobre la lista de distribución gvSIG_desarrolladores