Revision 14376 branches/v10/extensions/extPublish/src/org/gvsig/publish/serversModel/Server.java

View differences:

Server.java
53 53
import org.gvsig.publish.infoProject.IProjectInfo;
54 54
import org.gvsig.publish.infoProject.IViewInfo;
55 55

  
56
import com.iver.utiles.XMLEntity;
56 57

  
58

  
57 59
public abstract class Server {
58 60
	/*
59 61
	 * HashMap with its Services
......
88 90
	 * TODO: it do nothing
89 91
	 * @param project
90 92
	 */
91
	public void addInfo(IProjectInfo project){
93
	public void setProjectInfo(IProjectInfo project){
92 94
		this.projectInfo = project;
93 95
		this.serverName = project.getName();
94 96
	}
95 97
	/**
98
	 * 
99
	 * @return information about the project
100
	 */
101
	public IProjectInfo getProjectInfo(){
102
		return projectInfo;
103
	}
104
	/**
96 105
	 * Adds information about a view in all services
97 106
	 * @param view
98 107
	 */
......
203 212
	public void setServerName(String name){
204 213
		serverName = name;
205 214
	}
215
	public XMLEntity getXMLEntity() {
216
		XMLEntity xml=new XMLEntity();
217
		xml.putProperty("serverType", getType());
218
		xml.putProperty("serverName", serverName);
219
		for (int i=0;i<getServicesCount();i++){
220
			xml.addChild(getService(i).getXMLEntity());
221
		}
222
		return xml;
223
	}
224
	public void setXMLEntity(XMLEntity xml) {
225
		serverName=xml.getStringProperty("serverName");
226
		for (int i=0;i<xml.getChildrenCount();i++){
227
			XMLEntity xmlChild=xml.getChild(i);
228
			Service service=PublishRegister.register().getService(this,xmlChild.getStringProperty("serviceType"));
229
			service.setXMLEntity(xmlChild);
230
			addService(service);
231
		}
232
	}
206 233
		
207 234
}

Also available in: Unified diff