Skip to content
Snippets Groups Projects
Commit 8743bece authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Adapting KML service

parent 135a72c3
No related branches found
No related tags found
No related merge requests found
...@@ -337,8 +337,9 @@ public class ForecastBean { ...@@ -337,8 +337,9 @@ public class ForecastBean {
return resource; return resource;
} }
public Kml getForecastsAggregateKml(Date theDate) public Kml getForecastsAggregateKml(Date theDate, String serverName)
{ {
String iconPath = "http://" + serverName + "/public/images/";
// Initialization // Initialization
final Kml kml = KmlFactory.createKml(); final Kml kml = KmlFactory.createKml();
final Document document = kml.createAndSetDocument() final Document document = kml.createAndSetDocument()
...@@ -349,28 +350,28 @@ public class ForecastBean { ...@@ -349,28 +350,28 @@ public class ForecastBean {
.createAndSetIconStyle() .createAndSetIconStyle()
.withScale(0.55) .withScale(0.55)
.createAndSetIcon() .createAndSetIcon()
.withHref("http://www.vips-landbruk.no/graphics/dot_grey.png"); .withHref(iconPath + "dot_grey.png");
document.createAndAddStyle() document.createAndAddStyle()
.withId("warning_type_1") .withId("warning_type_1")
.createAndSetIconStyle() .createAndSetIconStyle()
.withScale(0.55) .withScale(0.55)
.createAndSetIcon() .createAndSetIcon()
.withHref("http://www.vips-landbruk.no/graphics/dot_blue.png"); .withHref(iconPath + "dot_blue.png");
document.createAndAddStyle() document.createAndAddStyle()
.withId("warning_type_2") .withId("warning_type_2")
.createAndSetIconStyle() .createAndSetIconStyle()
.withScale(0.55) .withScale(0.55)
.createAndSetIcon() .createAndSetIcon()
.withHref("http://www.vips-landbruk.no/graphics/dot_green.png"); .withHref(iconPath + "dot_green.png");
document.createAndAddStyle() document.createAndAddStyle()
.withId("warning_type_3") .withId("warning_type_3")
.createAndSetIconStyle() .createAndSetIconStyle()
.withScale(0.55) .withScale(0.55)
.createAndSetIcon() .createAndSetIcon()
.withHref("http://www.vips-landbruk.no/graphics/dot_yellow.png"); .withHref(iconPath + "dot_yellow.png");
document.createAndAddStyle() document.createAndAddStyle()
.withId("warning_type_4") .withId("warning_type_4")
......
...@@ -46,6 +46,7 @@ import no.bioforsk.vips.logic.entity.MessageTag; ...@@ -46,6 +46,7 @@ import no.bioforsk.vips.logic.entity.MessageTag;
import no.bioforsk.vips.logic.entity.Organism; import no.bioforsk.vips.logic.entity.Organism;
import no.bioforsk.vips.logic.util.SessionControllerGetter; import no.bioforsk.vips.logic.util.SessionControllerGetter;
import no.bioforsk.vips.logic.util.SystemTime; import no.bioforsk.vips.logic.util.SystemTime;
import no.bioforsk.vips.util.ServletUtil;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget; import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
import org.jboss.resteasy.spi.HttpRequest; import org.jboss.resteasy.spi.HttpRequest;
...@@ -156,7 +157,7 @@ public class LogicService { ...@@ -156,7 +157,7 @@ public class LogicService {
@Produces("application/vnd.google-earth.kml+xml;charset=utf-8") @Produces("application/vnd.google-earth.kml+xml;charset=utf-8")
public Response getForecastResultsAggregate() public Response getForecastResultsAggregate()
{ {
Kml retVal = SessionControllerGetter.getForecastBean().getForecastsAggregateKml(SystemTime.getSystemTime()); Kml retVal = SessionControllerGetter.getForecastBean().getForecastsAggregateKml(SystemTime.getSystemTime(), ServletUtil.getServerName(httpServletRequest));
return Response.ok().entity(retVal).build(); return Response.ok().entity(retVal).build();
} }
......
...@@ -43,7 +43,8 @@ public class Globals { ...@@ -43,7 +43,8 @@ public class Globals {
"/user", "/user",
"/test/testlogin.jsp", "/test/testlogin.jsp",
"/test/testloginsuccess.jsp", "/test/testloginsuccess.jsp",
"/test/mock.kml" "/test/mock.kml",
"/public"
}; };
// Point of interest type IDs // Point of interest type IDs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment