Commit d98296bd by Juho Juopperi

Merge branch 'master' of dev.intra.insomnia.fi:/data/bortal

2 parents 7a1fc681 0e9583c7
...@@ -21,7 +21,6 @@ import javax.persistence.Table; ...@@ -21,7 +21,6 @@ import javax.persistence.Table;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import javax.persistence.Version; import javax.persistence.Version;
import org.eclipse.persistence.annotations.PrimaryKey;
/** /**
* *
...@@ -212,4 +211,5 @@ public class Product implements EventChildInterface { ...@@ -212,4 +211,5 @@ public class Product implements EventChildInterface {
public List<FoodWaveTemplate> getFoodWaveTemplates() { public List<FoodWaveTemplate> getFoodWaveTemplates() {
return foodWaveTemplates; return foodWaveTemplates;
} }
} }
...@@ -5,17 +5,15 @@ ...@@ -5,17 +5,15 @@
package fi.insomnia.bortal.view; package fi.insomnia.bortal.view;
import fi.insomnia.bortal.beans.ProductBeanLocal; import fi.insomnia.bortal.beans.ProductBeanLocal;
import fi.insomnia.bortal.beans.RoleBeanLocal;
import fi.insomnia.bortal.beans.SecurityBeanLocal; import fi.insomnia.bortal.beans.SecurityBeanLocal;
import fi.insomnia.bortal.exceptions.PermissionDeniedException; import fi.insomnia.bortal.model.EventMap;
import fi.insomnia.bortal.handler.SessionHandler;
import fi.insomnia.bortal.model.Product; import fi.insomnia.bortal.model.Product;
import fi.insomnia.bortal.model.Role; import java.util.Map;
import java.util.List;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped; import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.model.DataModel; import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel; import javax.faces.model.ListDataModel;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -32,14 +30,54 @@ public class ProductView { ...@@ -32,14 +30,54 @@ public class ProductView {
@EJB @EJB
private ProductBeanLocal productBean; private ProductBeanLocal productBean;
private static final Logger logger = LoggerFactory.getLogger(ProductView.class); private static final Logger logger = LoggerFactory.getLogger(ProductView.class);
@EJB @EJB
private SecurityBeanLocal securitybean; private SecurityBeanLocal securitybean;
private EventMap activeMap = null;
public DataModel<Product> getUserShoppableProducts() { public DataModel<Product> getUserShoppableProducts() {
ListDataModel<Product> items = new ListDataModel<Product>(productBean.listUserShoppableProducts()); ListDataModel<Product> items = new ListDataModel<Product>(productBean.listUserShoppableProducts());
logger.info("Fetching products. Found {}", items.getRowCount()); logger.info("Fetching products. Found {}", items.getRowCount());
return items; return items;
} }
/**
* @return the activeMap
*/
public EventMap getActiveMap() {
return activeMap;
}
/**
* @param activeMap the activeMap to set
*/
public void setActiveMap(EventMap activeMap) {
this.activeMap = activeMap;
}
/*
public String placeMapActionListener(ActionEvent e) {
if(activeMap == null)
throw new UnsupportedOperationException("TODO error message");
FacesContext context = FacesContext.getCurrentInstance();
String clientId = e.getComponent().getClientId(context);
Map requestParams = context.getExternalContext().getRequestParameterMap();
int x = new Integer((String) requestParams.get(clientId + ".x")).intValue();
int y = new Integer((String) requestParams.get(clientId + ".y")).intValue();
System.out.println("x: " + x + ", y:" + y);
throw new UnsupportedOperationException();
}*/
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!