Commit 90f3a3b1 by Tuomas Riihimäki

Mergechanges

2 parents c555a872 80dd17e4
...@@ -95,14 +95,12 @@ public class PlaceMapBean implements PlaceMapBeanLocal { ...@@ -95,14 +95,12 @@ public class PlaceMapBean implements PlaceMapBeanLocal {
} }
public String getSelectPlaceMapUrl(EventMap activeMap, List<Place> selectedPlace, User user) {
public String getSelectPlaceMapUrl(EventMap activeMap, Place selectedPlace, User user) {
String parameters = "?"; String parameters = "?";
if (selectedPlace != null) { if (selectedPlace != null) {
parameters += "placeid=" + selectedPlace.getId().getId(); // parameters += "placeid=" + selectedPlace.getId().getId();
} else { } else {
parameters += "mapid=" + activeMap.getId().getId(); parameters += "mapid=" + activeMap.getId().getId();
} }
......
...@@ -15,7 +15,7 @@ import java.util.List; ...@@ -15,7 +15,7 @@ import java.util.List;
public interface PlaceMapBeanLocal { public interface PlaceMapBeanLocal {
void printPlaceMapToStream(OutputStream outputStream, String filetype, Event event, Integer mapId, Integer userId, List<Integer> placeIds) throws IOException; void printPlaceMapToStream(OutputStream outputStream, String filetype, Event event, Integer mapId, Integer userId, List<Integer> placeIds) throws IOException;
public String getSelectPlaceMapUrl(EventMap activeMap, Place selectedPlace, User user); public String getSelectPlaceMapUrl(EventMap activeMap, List<Place> selectedPlaces, User user);
// public EventMap findMap(int i); // public EventMap findMap(int i);
......
...@@ -10,6 +10,7 @@ import fi.insomnia.bortal.model.User; ...@@ -10,6 +10,7 @@ import fi.insomnia.bortal.model.User;
@Local @Local
public interface TestDataBeanLocal { public interface TestDataBeanLocal {
EventMap generateTestMap(Event event); EventMap generateTestMap(Event event);
void generateTestPlaces(EventMap map); void generateTestPlaces(EventMap map);
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<project name="LanBortalWeb" default="default" basedir="."> <project name="LanBortalWeb" default="default" basedir=".">
<description>Builds, tests, and runs the project LanBortalWeb.</description> <description>Builds, tests, and runs the project LanBortalWeb.</description>
<import file="nbproject/build-impl.xml"/> <import file="nbproject/build-impl.xml"/>
<!--
<import file="nbproject/profiler-build-impl.xml"/> <!--
There exist several targets which are by default empty and which can be There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed used for execution of your tasks. These targets are usually executed
......
...@@ -6,3 +6,6 @@ build.xml.stylesheet.CRC32=c0ebde35@1.21.1.1 ...@@ -6,3 +6,6 @@ build.xml.stylesheet.CRC32=c0ebde35@1.21.1.1
nbproject/build-impl.xml.data.CRC32=a85e9fc5 nbproject/build-impl.xml.data.CRC32=a85e9fc5
nbproject/build-impl.xml.script.CRC32=27e0b6a5 nbproject/build-impl.xml.script.CRC32=27e0b6a5
nbproject/build-impl.xml.stylesheet.CRC32=b139b33b@1.21.1.1 nbproject/build-impl.xml.stylesheet.CRC32=b139b33b@1.21.1.1
nbproject/profiler-build-impl.xml.data.CRC32=a85e9fc5
nbproject/profiler-build-impl.xml.script.CRC32=a84d8f2e
nbproject/profiler-build-impl.xml.stylesheet.CRC32=0bb5b37b@1.9.1
...@@ -9,6 +9,8 @@ import fi.insomnia.bortal.handler.SessionHandler; ...@@ -9,6 +9,8 @@ import fi.insomnia.bortal.handler.SessionHandler;
import fi.insomnia.bortal.model.EventMap; import fi.insomnia.bortal.model.EventMap;
import fi.insomnia.bortal.model.Place; import fi.insomnia.bortal.model.Place;
import fi.insomnia.bortal.model.User; import fi.insomnia.bortal.model.User;
import java.util.ArrayList;
import java.util.List;
import java.util.Map; import java.util.Map;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedBean;
...@@ -33,7 +35,8 @@ public class MapView { ...@@ -33,7 +35,8 @@ public class MapView {
@ManagedProperty("#{sessionHandler}") @ManagedProperty("#{sessionHandler}")
private SessionHandler sessionHandler; private SessionHandler sessionHandler;
private EventMap activeMap = null; private EventMap activeMap = null;
private Place selectedPlace = null; private List<Place> selectedPlaces = new ArrayList<Place>();
//private Place selectedPlace = null;
/** Creates a new instance of MapView */ /** Creates a new instance of MapView */
public MapView() { public MapView() {
...@@ -47,8 +50,13 @@ public class MapView { ...@@ -47,8 +50,13 @@ public class MapView {
int y = new Integer((String) requestParams.get(clientId + ".y")).intValue(); int y = new Integer((String) requestParams.get(clientId + ".y")).intValue();
Place place = getActiveMap().findPlace(x, y); Place place = getActiveMap().findPlace(x, y);
selectedPlace = place;
//throw new UnsupportedOperationException("We got place, but are doing nothing with it"); if (selectedPlaces.contains(place)) {
selectedPlaces.remove(place);
} else {
selectedPlaces.add(place);
}
} }
public String getSelectPlaceMapUrl() { public String getSelectPlaceMapUrl() {
...@@ -59,7 +67,7 @@ public class MapView { ...@@ -59,7 +67,7 @@ public class MapView {
return ""; return "";
} }
return placeMapBean.getSelectPlaceMapUrl(getActiveMap(), selectedPlace, user); return placeMapBean.getSelectPlaceMapUrl(getActiveMap(), selectedPlaces, user);
} }
/** /**
...@@ -85,20 +93,6 @@ public class MapView { ...@@ -85,20 +93,6 @@ public class MapView {
} }
/** /**
* @return the selectedPlace
*/
public Place getSelectedPlace() {
return selectedPlace;
}
/**
* @param selectedPlace the selectedPlace to set
*/
public void setSelectedPlace(Place selectedPlace) {
this.selectedPlace = selectedPlace;
}
/**
* @return the sessionHandler * @return the sessionHandler
*/ */
public SessionHandler getSessionHandler() { public SessionHandler getSessionHandler() {
......
...@@ -37,7 +37,7 @@ public class TestDataView { ...@@ -37,7 +37,7 @@ public class TestDataView {
EventMap map = testdatabean.generateTestMap(event); EventMap map = testdatabean.generateTestMap(event);
testdatabean.generateTestPlaces(map); testdatabean.generateTestPlaces(map);
testdatabean.generateTestCompos(event); // testdatabean.generateTestCompos(event);
} }
/** Creates a new instance of TestDataView */ /** Creates a new instance of TestDataView */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!