Commit dcf31f94 authored by duminil's avatar duminil
Browse files

Removing hard coded usernames.

parent 405be881
......@@ -32,11 +32,12 @@ public class ExportJobFromJavaFXRegionChooser implements JobStatusListener
public void processJob(Geometry poly, String productName, JSObject novaFactoryOpenLayer) throws InterruptedException {
this.novaFactoryOpenLayer = novaFactoryOpenLayer;
ExportJobDescription description = ExportJobDescription.getDefaultDescriptor();
description.setInitiator("2758");
description.setAccount("Bruse");
description.setInitiator(String.valueOf((int) (Math.random() * 9999)));
String userName = System.getProperty("user.name");
description.setAccount(userName);
// description.setProduct("WU3");
description.setProduct(productName);
description.setJobnumber("Bruse_0815");
description.setJobnumber(userName);
//FIXME: Zipped GMLs coming from nF don't have any defined srsName
......@@ -88,7 +89,7 @@ public void jobStatusChanged(JobStatusEvent event) {
try {
File file = job.getResult();
novaFactoryOpenLayer.call("updateStatus", "DOWNLOADED AS ZIP");
novaFactoryOpenLayer.call("selectSaveFile", file.toString());
// novaFactoryOpenLayer.call("selectSaveFile", file.toString());
// System.out.println("CityGML at " + file.getAbsolutePath());
//TODO: Call downloadFinished if FAILED
novaFactoryOpenLayer.call("downloadFinished");
......
......@@ -12,7 +12,6 @@
import java.util.Objects;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
......@@ -22,23 +21,23 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.osgeo.proj4j.BasicCoordinateTransform;
import org.osgeo.proj4j.CRSFactory;
import org.osgeo.proj4j.CoordinateReferenceSystem;
import org.osgeo.proj4j.ProjCoordinate;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import eu.simstadt.nf4j.InvalidJobDescriptorException;
/**
* Builds nF import and export jobs using nF's XML job format. Please read the nF manual if you want more
* details about the numerous job attributes listed below.
* Builds nF import and export jobs using nF's XML job format. Please read the nF manual if you want more details about
* the numerous job attributes listed below.
*
* @author Marcel Bruse
*/
public class JobFileBuilderImpl implements JobFileBuilder<ImportJobDescription, ExportJobDescription> {
public class JobFileBuilderImpl implements JobFileBuilder<ImportJobDescription, ExportJobDescription>
{
/** Supported version of the novaFACTORY. */
public static final String NOVA_FACTORY_VERSION = "6.3.1.1";
......@@ -73,8 +72,8 @@ public String supportsImportJobVersion() {
/**
* This is an intermediate prototype.
*
* @param jobDescriptor A job descriptor which describes the export job with all its attributes according to
* a valid nF export job DTD.
* @param jobDescriptor A job descriptor which describes the export job with all its attributes according to a valid
* nF export job DTD.
* @return Returns a string representation of the nF export job.
* @throws FailedJobTransmissionException
*/
......@@ -103,7 +102,7 @@ public File buildExportJobFile(ExportJobDescription jobDescriptor) throws Invali
job.appendChild(jobnumber);
Element account = doc.createElement("account");
account.appendChild(doc.createTextNode("Habib"));
account.appendChild(doc.createTextNode(System.getProperty("user.name")));
job.appendChild(account);
Element product = doc.createElement("product");
......@@ -289,8 +288,8 @@ public static ProjCoordinate transformCoordinate(ProjCoordinate wgs84Position,
}
/**
* Appends the region polygon to the XML export job document. In order to do this, the given WGS 84 region
* polygon will be transformed into a DHDN Gauss-Kruger zone 3 polygon.
* Appends the region polygon to the XML export job document. In order to do this, the given WGS 84 region polygon
* will be transformed into a DHDN Gauss-Kruger zone 3 polygon.
*
* @param doc The XML export job document.
* @param regionPolygon The polygon of the region which has been selected to be exported.
......@@ -315,8 +314,8 @@ private static Element createRegionPolygonElement(Document doc, List<Coord> regi
/**
* Builds a zipped import job file. This file can be sent to a nF server instance by the caller afterwards.
*
* @param jobDescriptor A job descriptor which describes the import job with all its attributes according to
* a valid nF import job DTD.
* @param jobDescriptor A job descriptor which describes the import job with all its attributes according to a valid
* nF import job DTD.
* @return Returns a XML import job document.
*/
@Override
......
......@@ -30,10 +30,11 @@ public class SuccessfulExportJob implements JobStatusListener
@Test
public void processJob() throws InterruptedException {
ExportJobDescription description = ExportJobDescription.getDefaultDescriptor();
description.setInitiator("2758");
description.setAccount("Bruse");
description.setInitiator(String.valueOf((int) (Math.random() * 9999)));
String userName = System.getProperty("user.name");
description.setAccount(userName);
description.setProduct("WU3");
description.setJobnumber("Bruse_0815");
description.setJobnumber(userName);
//FIXME: Zipped GMLs coming from nF don't have any defined srsName
//FIXME: Save files somewhere else
......@@ -140,7 +141,7 @@ public void jobStatusChanged(JobStatusEvent event) {
try {
File file = job.getResult();
assertTrue(file.canRead());
// System.out.println("CityGML at " + file.getAbsolutePath());
// System.out.println("CityGML at " + file.getAbsolutePath());
} catch (FailedTransmissionException ex) {
ex.printStackTrace();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment