Commit ebc6c46a by Antti Tönkyrä

Merge branch 'master' of codecrew.fi:bortal

2 parents 217c0a71 256a4359
Showing with 1157 additions and 115 deletions
...@@ -5,3 +5,5 @@ ...@@ -5,3 +5,5 @@
/code/LanBortalDatabase/src/fi/insomnia/bortal/model/*_.java /code/LanBortalDatabase/src/fi/insomnia/bortal/model/*_.java
/code/LanBortalDatabase/src/fi/insomnia/bortal/model/*/*_.java /code/LanBortalDatabase/src/fi/insomnia/bortal/model/*/*_.java
*~ *~
.metadata
code/LanBortal/.settings/org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs
...@@ -7,7 +7,9 @@ import javax.annotation.security.RolesAllowed; ...@@ -7,7 +7,9 @@ import javax.annotation.security.RolesAllowed;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import fi.insomnia.bortal.enums.apps.ShopPermission; import fi.insomnia.bortal.enums.apps.ShopPermission;
import fi.insomnia.bortal.facade.FoodWaveFacade;
import fi.insomnia.bortal.facade.FoodWaveTemplateFacade; import fi.insomnia.bortal.facade.FoodWaveTemplateFacade;
import fi.insomnia.bortal.model.FoodWave; import fi.insomnia.bortal.model.FoodWave;
import fi.insomnia.bortal.model.FoodWaveTemplate; import fi.insomnia.bortal.model.FoodWaveTemplate;
...@@ -22,6 +24,9 @@ public class FoodWaveBean implements FoodWaveBeanLocal { ...@@ -22,6 +24,9 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
@EJB @EJB
private FoodWaveTemplateFacade fwtFacade; private FoodWaveTemplateFacade fwtFacade;
@EJB
private FoodWaveFacade foodWaveFacade;
@Override @Override
@RolesAllowed(ShopPermission.S_MANAGE_PRODUCTS) @RolesAllowed(ShopPermission.S_MANAGE_PRODUCTS)
public List<FoodWaveTemplate> getTemplates() { public List<FoodWaveTemplate> getTemplates() {
...@@ -31,20 +36,44 @@ public class FoodWaveBean implements FoodWaveBeanLocal { ...@@ -31,20 +36,44 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
@Override @Override
@RolesAllowed(ShopPermission.S_MANAGE_PRODUCTS) @RolesAllowed(ShopPermission.S_MANAGE_PRODUCTS)
public FoodWaveTemplate saveOrCreateTemplate(FoodWaveTemplate template) { public FoodWaveTemplate saveOrCreateTemplate(FoodWaveTemplate template) {
// TODO Auto-generated method stub if (template.getId() == null)
return null; {
fwtFacade.create(template);
} else {
template = fwtFacade.merge(template);
}
return template;
} }
@Override @Override
public List<FoodWave> findShoppableFoodwaves() { public List<FoodWave> findShoppableFoodwaves() {
// TODO Auto-generated method stub throw new NotImplementedException();
return null;
} }
@Override @Override
@RolesAllowed("SHOP/READ")
public List<FoodWave> getOpenFoodWaves() {
return foodWaveFacade.getOpenFoodWaves();
}
public FoodWave findFoodwave(Integer foodwaveId) { public FoodWave findFoodwave(Integer foodwaveId) {
// TODO Auto-generated method stub return foodWaveFacade.find(foodwaveId);
return null; }
@Override
public FoodWaveTemplate saveTemplate(FoodWaveTemplate waveTemplate) {
throw new UnsupportedOperationException("would you mind to implement this method?");
}
@Override
public FoodWave merge(FoodWave foodWave) {
return foodWaveFacade.merge(foodWave);
}
@Override
public FoodWaveTemplate findTemplate(Integer templateId) {
return fwtFacade.find(templateId);
} }
} }
...@@ -109,6 +109,10 @@ public class MenuBean implements MenuBeanLocal { ...@@ -109,6 +109,10 @@ public class MenuBean implements MenuBeanLocal {
shopTopmenu.addPage(menuitemfacade.findOrCreate("/checkout/delayed"), null).setVisible(false); shopTopmenu.addPage(menuitemfacade.findOrCreate("/checkout/delayed"), null).setVisible(false);
shopTopmenu.addPage(menuitemfacade.findOrCreate("/checkout/reject"), null).setVisible(false); shopTopmenu.addPage(menuitemfacade.findOrCreate("/checkout/reject"), null).setVisible(false);
shopTopmenu.addPage(menuitemfacade.findOrCreate("/checkout/return"), null).setVisible(false); shopTopmenu.addPage(menuitemfacade.findOrCreate("/checkout/return"), null).setVisible(false);
MenuNavigation foodwaveTopmenu = usernavi.addPage(null, null);
foodwaveTopmenu.setKey("topnavi.foodwave");
foodwaveTopmenu.addPage(menuitemfacade.findOrCreate("/foodwave/list"), BillPermission.VIEW_OWN);
MenuNavigation pollTopmenu = usernavi.addPage(null, null); MenuNavigation pollTopmenu = usernavi.addPage(null, null);
pollTopmenu.setKey("topnavi.poll"); pollTopmenu.setKey("topnavi.poll");
......
package fi.insomnia.bortal.facade; package fi.insomnia.bortal.facade;
import java.util.Calendar;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.LocalBean; import javax.ejb.LocalBean;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import fi.insomnia.bortal.beans.EventBeanLocal;
import fi.insomnia.bortal.model.FoodWave; import fi.insomnia.bortal.model.FoodWave;
import fi.insomnia.bortal.model.FoodWaveTemplate_;
import fi.insomnia.bortal.model.FoodWave_;
import fi.insomnia.bortal.model.OrgRole_;
@Stateless @Stateless
@LocalBean @LocalBean
public class FoodWaveFacade extends IntegerPkGenericFacade<FoodWave> { public class FoodWaveFacade extends IntegerPkGenericFacade<FoodWave> {
@EJB
EventBeanLocal eventBean;
public FoodWaveFacade() { public FoodWaveFacade() {
super(FoodWave.class); super(FoodWave.class);
} }
public List<FoodWave> getOpenFoodWaves() {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<FoodWave> cq = cb.createQuery(FoodWave.class);
Root<FoodWave> root = cq.from(FoodWave.class);
cq.where(cb.greaterThan(root.get(FoodWave_.time), Calendar.getInstance()),
cb.isFalse(root.get(FoodWave_.closed)),
cb.equal(root.get(FoodWave_.template).get(FoodWaveTemplate_.event), eventBean.getCurrentEvent())
);
return getEm().createQuery(cq).getResultList();
}
} }
...@@ -25,12 +25,25 @@ public class FoodWaveTemplateFacade extends IntegerPkGenericFacade<FoodWaveTempl ...@@ -25,12 +25,25 @@ public class FoodWaveTemplateFacade extends IntegerPkGenericFacade<FoodWaveTempl
super(FoodWaveTemplate.class); super(FoodWaveTemplate.class);
} }
public List<FoodWaveTemplate> findAllTemplates() { public List<FoodWaveTemplate> findAllTemplates() {
CriteriaBuilder cb = getEm().getCriteriaBuilder(); CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<FoodWaveTemplate> cq = cb.createQuery(FoodWaveTemplate.class); CriteriaQuery<FoodWaveTemplate> cq = cb.createQuery(FoodWaveTemplate.class);
Root<FoodWaveTemplate> root = cq.from(FoodWaveTemplate.class); Root<FoodWaveTemplate> root = cq.from(FoodWaveTemplate.class);
cb.equal(root.get(FoodWaveTemplate_.event), eventbean.getCurrentEvent()); cq.where(cb.equal(root.get(FoodWaveTemplate_.event), eventbean.getCurrentEvent()));
return getEm().createQuery(cq).getResultList(); return getEm().createQuery(cq).getResultList();
} }
@Override
public FoodWaveTemplate find(Integer id)
{
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<FoodWaveTemplate> cq = cb.createQuery(FoodWaveTemplate.class);
Root<FoodWaveTemplate> root = cq.from(FoodWaveTemplate.class);
cq.where(cb.equal(root.get(FoodWaveTemplate_.event), eventbean.getCurrentEvent()),
cb.equal(root.get(FoodWaveTemplate_.id), id)
);
return super.getSingleNullableResult(getEm().createQuery(cq));
}
} }
...@@ -16,6 +16,13 @@ public interface FoodWaveBeanLocal { ...@@ -16,6 +16,13 @@ public interface FoodWaveBeanLocal {
List<FoodWave> findShoppableFoodwaves(); List<FoodWave> findShoppableFoodwaves();
FoodWave findFoodwave(Integer foodwaveId); FoodWaveTemplate saveTemplate(FoodWaveTemplate waveTemplate);
List<FoodWave> getOpenFoodWaves();
FoodWaveTemplate findTemplate(Integer templateId);
public FoodWave findFoodwave(Integer foodwaveId);
public FoodWave merge(FoodWave foodWave);
} }
...@@ -60,6 +60,9 @@ public class AccountEvent extends GenericEntity { ...@@ -60,6 +60,9 @@ public class AccountEvent extends GenericEntity {
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Calendar delivered; private Calendar delivered;
@Column(name = "delivered_count", nullable = false, precision = 24, scale = 4)
private BigDecimal deliveredCount;
/** /**
* If this AccountEvent is a product in foodwace, this field is a reference * If this AccountEvent is a product in foodwace, this field is a reference
* to that foodwave. * to that foodwave.
...@@ -219,4 +222,12 @@ public class AccountEvent extends GenericEntity { ...@@ -219,4 +222,12 @@ public class AccountEvent extends GenericEntity {
this.description = description; this.description = description;
} }
public BigDecimal getDeliveredCount() {
return deliveredCount;
}
public void setDeliveredCount(BigDecimal deliveredCount) {
this.deliveredCount = deliveredCount;
}
} }
...@@ -336,6 +336,10 @@ public class Bill extends GenericEntity { ...@@ -336,6 +336,10 @@ public class Bill extends GenericEntity {
} }
public void addProduct(Product product, BigDecimal count) { public void addProduct(Product product, BigDecimal count) {
this.addProduct(product, count, null);
}
public void addProduct(Product product, BigDecimal count, FoodWave foodwave) {
// If bill number > 0 bill has been sent and extra privileges are needed // If bill number > 0 bill has been sent and extra privileges are needed
// to modify. // to modify.
// if (!iscurrent || billnr != null) { // if (!iscurrent || billnr != null) {
...@@ -346,7 +350,7 @@ public class Bill extends GenericEntity { ...@@ -346,7 +350,7 @@ public class Bill extends GenericEntity {
if (this.billLines == null) { if (this.billLines == null) {
billLines = new ArrayList<BillLine>(); billLines = new ArrayList<BillLine>();
} }
this.getBillLines().add(new BillLine(this, product, count)); this.getBillLines().add(new BillLine(this, product, count, foodwave));
for (Discount disc : product.getActiveDiscounts(count, sentDate)) { for (Discount disc : product.getActiveDiscounts(count, sentDate)) {
......
...@@ -13,7 +13,6 @@ import javax.persistence.Entity; ...@@ -13,7 +13,6 @@ import javax.persistence.Entity;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.OrderBy;
import javax.persistence.Table; import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking; import org.eclipse.persistence.annotations.OptimisticLocking;
...@@ -70,9 +69,12 @@ public class BillLine extends GenericEntity { ...@@ -70,9 +69,12 @@ public class BillLine extends GenericEntity {
@JoinColumn(name = "lineProduct_id", referencedColumnName = "id", nullable = true, updatable = false) @JoinColumn(name = "lineProduct_id", referencedColumnName = "id", nullable = true, updatable = false)
@OneToOne @OneToOne
@OrderBy("id")
private Product lineProduct; private Product lineProduct;
@OneToOne
@JoinColumn(name = "foodwave_id", referencedColumnName = "id", nullable = true, updatable = false)
private FoodWave foodwave;
/** /**
* Calculate the total price for the items on this line * Calculate the total price for the items on this line
* *
...@@ -100,7 +102,12 @@ public class BillLine extends GenericEntity { ...@@ -100,7 +102,12 @@ public class BillLine extends GenericEntity {
super(); super();
} }
public BillLine(Bill bill2, Product product, BigDecimal count) { public BillLine(Bill bill2, Product product, BigDecimal count) {
this(bill2, product, count, null);
}
public BillLine(Bill bill2, Product product, BigDecimal count, FoodWave foodwave) {
super(); super();
this.bill = bill2; this.bill = bill2;
this.lineProduct = product; this.lineProduct = product;
...@@ -109,8 +116,20 @@ public class BillLine extends GenericEntity { ...@@ -109,8 +116,20 @@ public class BillLine extends GenericEntity {
this.setQuantity(count); this.setQuantity(count);
this.setUnitPrice(product.getPrice().abs()); this.setUnitPrice(product.getPrice().abs());
this.setVat(product.getVat()); this.setVat(product.getVat());
this.setFoodwave(foodwave);
} }
/**
* Discounttia luotaessa lasketaan productin hinnasta jokin kiva miinuspuolinen rivi discountin mukaan?
*
* Kommentteja plz!
*
* @param bill2
* @param product
* @param disc
* @param count
*/
public BillLine(Bill bill2, Product product, Discount disc, BigDecimal count) { public BillLine(Bill bill2, Product product, Discount disc, BigDecimal count) {
super(); super();
this.bill = bill2; this.bill = bill2;
...@@ -179,4 +198,12 @@ public class BillLine extends GenericEntity { ...@@ -179,4 +198,12 @@ public class BillLine extends GenericEntity {
return lineProduct; return lineProduct;
} }
public FoodWave getFoodwave() {
return foodwave;
}
public void setFoodwave(FoodWave foodwave) {
this.foodwave = foodwave;
}
} }
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
<welcome-file>index.jsp</welcome-file> <welcome-file>index.jsp</welcome-file>
<welcome-file>index.wtf</welcome-file> <welcome-file>index.wtf</welcome-file>
</welcome-file-list> </welcome-file-list>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsf</location>
</error-page>
<servlet> <servlet>
<servlet-name>Faces Servlet</servlet-name> <servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<title></title>
</h:head>
<h:body>
<br/>
<center>
<img src="#{request.contextPath}/resources/media/error.jpg" />
<h1>LOL, ERROR!</h1>
<br/>
<c:if test="#{sessionHandler.isInDevelopmentMode() eq false}">
<h:outputText escape="false" style="color: red;" value="ERR##{errorPageView.time}" />
</c:if>
<br/><br/>
</center>
<c:when test="#{sessionHandler.isInDevelopmentMode()}">
<h:outputText escape="false" value="#{errorPageView.stackTrace}" />
</c:when>
</h:body>
</html>
\ No newline at end of file
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:products="http://java.sun.com/jsf/composite/cditools/products" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:event type="preRenderView" listener="#{foodWaveView.initCreateTemplate()}" />
</f:metadata>
<ui:define name="title">
<h1>#{i18n['foodwave.template.edit.title']}</h1>
</ui:define>
<ui:define name="content">
<h:form>
<h:panelGrid columns="3">
<h:outputLabel for="name" value="#{i18n['foodwavetemplate.name']}" />
<h:inputText id="name" value="#{foodWaveView.template.name}" />
<h:message for="name" />
</h:panelGrid>
<h:commandButton action="#{foodWaveView.saveTemplate()}" value="#{i18n['foowavetemplate.create']}" />
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{foodWaveView.initEditTemplate()}" /> <f:event type="preRenderView" listener="#{foodWaveView.initEditTemplate()}" />
<f:viewParam name="id" value="#{userView.templateId}" />
</f:metadata> </f:metadata>
<ui:define name="title"> <ui:define name="title">
...@@ -19,15 +21,18 @@ ...@@ -19,15 +21,18 @@
<h:outputLabel for="name" value="#{i18n['foodwavetemplate.name']}" /> <h:outputLabel for="name" value="#{i18n['foodwavetemplate.name']}" />
<h:inputText id="name" value="#{foodWaveView.template.name}" /> <h:inputText id="name" value="#{foodWaveView.template.name}" />
<h:message for="name" /> <h:message for="name" />
</h:panelGrid> </h:panelGrid>
<h:inputTextarea value="#{foodWaveView.template.description}" /> <div>
<h:commanButton action="#{foodWaveView.saveTemplate()}" value="#{i18n['foowavetemplate.save']}" /> <h:inputTextarea value="#{foodWaveView.template.description}" />
</div>
<h:commandButton action="#{foodWaveView.saveTemplate()}" value="#{i18n['foowavetemplate.save']}" />
<h:commandButton action="#{foodWaveView.createFoodwave()}" value="#{i18n['foodwavetemplate.createFoodwave']}" /> <h:commandButton action="#{foodWaveView.createFoodwave()}" value="#{i18n['foodwavetemplate.createFoodwave']}" />
</h:form>
<ui:fragment >
</h:form>
<ui:fragment>
</ui:fragment> </ui:fragment>
</ui:define> </ui:define>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{foodWaveView.initTemplateList()}" /> <f:event type="preRenderView" listener="#{foodWaveView.initTemplateList()}" />
<f:viewParam name="id" value="#{foodWaveView.templateId}" />
</f:metadata> </f:metadata>
<ui:define name="title"> <ui:define name="title">
......
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:foodwave="http://java.sun.com/jsf/composite/cditools/foodwave"
xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body>
<ui:composition
template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:viewParam name="userid" value="#{userView.userid}" />
<f:event type="preRenderView"
listener="#{foodWaveView.initTemplateList}" />
</f:metadata>
<ui:define name="title">
<h1>#{i18n['user.shop.title']}</h1>
<users:usertabs tabId="foodwave" />
</ui:define>
<ui:define name="content">
Kiitoksia tilauksesta, muista käydä maksamassa tilaukset tiskillä.
Maksamattomia tilauksia ei pistetä etiäpäin.
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:foodwave="http://java.sun.com/jsf/composite/cditools/foodwave"
xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body>
<ui:composition
template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:viewParam name="userid" value="#{userView.userid}" />
<f:event type="preRenderView"
listener="#{foodWaveView.initTemplateList}" />
</f:metadata>
<ui:define name="title">
<h1>#{i18n['user.shop.title']}</h1>
<users:usertabs tabId="foodwave" />
</ui:define>
<ui:define name="content">
<h:dataTable columnClasses="nowrap,numalign,numalign,nowrap,numalign"
styleClass="bordertable" value="#{foodWaveView.foodWaves}"
var="foodwave">
<h:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['foodWave.name']}" />
</f:facet>
<h:link outcome="/foodwave/listProducts" value="#{foodwave.name}">
<f:param name="foodwaveid" value="#{foodwave.id}" />
</h:link>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['foodWave.template.name']}" />
</f:facet>
<h:link outcome="/foodwave/listProducts"
value="#{foodwave.template.name}">
<f:param name="foodwaveid" value="#{foodwave.id}" />
</h:link>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['foodWave.description']}" />
</f:facet>
<h:outputText id="description"
value="#{foodwave.template.description}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['foodWave.time']}" />
</f:facet>
<h:link outcome="/foodwave/listProducts"
value="#{foodwave.time.time}">
<f:param name="foodwaveid" value="#{foodwave.id}" />
</h:link>
</h:column>
</h:dataTable>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:foodwave="http://java.sun.com/jsf/composite/cditools/foodwave"
xmlns:products="http://java.sun.com/jsf/composite/cditools/products"
xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body>
<ui:composition
template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:viewParam name="userid" value="#{userView.userid}" />
<f:viewParam name="foodwaveid" value="#{foodWaveFoodView.foodwaveid}" />
<f:event type="preRenderView" listener="#{foodWaveFoodView.initFoodWaveFoods}" />
</f:metadata>
<ui:define name="title">
<h1>#{i18n['user.foodwave.products.title']}</h1>
<users:usertabs tabId="foodwave" />
</ui:define>
<ui:define name="content">
<!-- products:shop commitaction="#{foodWaveFoodView.commitShoppingCart()}" items="#{foodWaveFoodView.shoppingcart}" commitValue="#{i18n['productshop.commit']}" /-->
<foodwave:listFoods selectaction="#{foodWaveFoodView.commitShoppingCart()}"
items="#{foodWaveFoodView.shoppingcart}" commitValue="#{i18n['productshop.commit']}"/>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:foodwave="http://java.sun.com/jsf/composite/cditools/foodwave" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:viewParam name="userid" value="#{userView.userid}" />
<f:event type="preRenderView" listener="#{foodWaveView.initTemplateList}" />
</f:metadata>
<ui:define name="title">
<h1>#{i18n['user.shop.title']}</h1>
<users:usertabs tabId="foodwave" />
</ui:define>
<ui:define name="content">
<foodwave:listTemplates selectaction="#{foodWaveView.selectTemplate}" items="#{foodWaveView.templates}"
commitValue="#{i18n['food']}"
/>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8' ?> <?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"> xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface> <composite:interface>
<composite:attribute name="items" required="true" /> <composite:attribute name="items" required="true" />
<!-- <composite:attribute name="selectValue" required="true" /> --> <!-- <composite:attribute name="selectValue" required="true" /> -->
<composite:attribute name="selectaction" method-signature="java.lang.String action()" required="true" /> <composite:attribute name="selectaction"
method-signature="java.lang.String action()" required="true" />
</composite:interface> </composite:interface>
<composite:implementation> <composite:implementation>
<!-- <h:outputScript target="head" library="script" name="jquery.min.js" /> --> <!-- <h:outputScript target="head" library="script" name="jquery.min.js" /> -->
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> --> <!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<h:outputScript library="primefaces" name="jquery/jquery.js" /> <h:outputScript library="primefaces" name="jquery/jquery.js" />
<div style="margin-top: 5px;">
<h:commandButton action="#{cc.attrs.selectaction}" id="selectbutton-top" value="#{cc.attrs.selectValue}" />
</div>
<h:dataTable columnClasses="nowrap,numalign,numalign,nowrap,numalign" styleClass="bordertable" id="billcart" value="#{cc.attrs.items}" var="foodwave">
<h:column>
<f:facet name="header">
<h:outputText id="name" value="${i18n['foodWave.name']}" />
</f:facet>
<h:outputText value="#{foodwave.template.name}" />
</h:column>
<h:column >
<f:facet name="header">
<h:outputText value="${i18n['foodWave.description']}" />
</f:facet>
<h:outputText id="description" value="#{foodwave.template.description}" />
</h:column>
<h:commandButton action="#{cc.attrs.selectaction}" id="selectbutton-botton" value="#{cc.attrs.selectValue}" />
</h:dataTable>
<h:form>
<h:dataTable columnClasses="nowrap,numalign,numalign,nowrap,numalign"
styleClass="bordertable" value="#{cc.attrs.items}" var="foodwave">
<h:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['foodWave.name']}" />
</f:facet>
<h:commandLink action="#{cc.attrs.selectaction}" value="#{foodwave.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['foodWave.template.name']}" />
</f:facet>
<h:commandLink action="#{cc.attrs.selectaction}" id="template_name" value="#{foodwave.template.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['foodWave.description']}" />
</f:facet>
<h:outputText id="description"
value="#{foodwave.template.description}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['foodWave.time']}" />
</f:facet>
<h:commandLink action="#{cc.attrs.selectaction}" id="time" value="#{foodwave.time.time}" />
</h:column>
<h:commandButton action="#{cc.attrs.selectaction}"
id="selectbutton-botton" value="Valitte" />
</h:dataTable>
</h:form>
</composite:implementation> </composite:implementation>
</html> </html>
......
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
<composite:attribute name="items" required="true" />
<!-- <composite:attribute name="selectValue" required="true" /> -->
<composite:attribute name="selectaction"
method-signature="java.lang.String action()" required="true" />
</composite:interface>
<composite:implementation>
<!-- <h:outputScript target="head" library="script" name="jquery.min.js" /> -->
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<h:outputScript library="primefaces" name="jquery/jquery.js" />
<h:form>
<h:dataTable columnClasses="nowrap,numalign,numalign,nowrap,numalign"
styleClass="bordertable" value="#{cc.attrs.items}" var="cart">
<!-- h:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['product.name']}" />
</f:facet>
<h:commandLink action="#{cc.attrs.selectaction}" value="#{cart.product.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['product.price']}" />
</f:facet>
<h:commandLink action="#{cc.attrs.selectaction}" id="template_name" value="#{cart.product.price}" />
</h:column>
<h:commandButton action="#{cc.attrs.selectaction}"
id="selectbutton-botton" value="Valitte" /-->
<h:column>
<f:facet name="header">
<h:outputText id="name" value="${i18n['product.name']}" />
</f:facet>
<h:outputText value="#{cart.product.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['product.price']}" />
</f:facet>
<h:outputText id="price" value="#{cart.product.price.abs()}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['product.totalPrice']}" />
</f:facet>
<h:outputText id="total" value="#{cart.price}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet>
<h:commandButton action="#{foodWaveFoodView.addMinusOne}"
value="#{i18n['productshop.minusOne']}">
<f:ajax render="@form" />
</h:commandButton>
<h:inputText size="4" id="cartcount" value="#{cart.count}">
<f:convertNumber maxIntegerDigits="2" minFractionDigits="0" />
</h:inputText>
<h:commandButton action="#{foodWaveFoodView.addOne}"
value="#{i18n['productshop.plusOne']}">
<f:ajax render="@form" />
</h:commandButton>
</h:column>
</h:dataTable>
<h:commandButton action="#{foodWaveFoodView.buyFromCounter}" value="#{i18n['foodshop.buyFromCounter']}" >
</h:commandButton>
<h:commandButton action="#{foodWaveFoodView.buyFromInternet}" value="#{i18n['foodshop.buyFromInternet']}" >
</h:commandButton>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
<composite:attribute name="items" required="true" />
<composite:attribute name="selectaction"
method-signature="java.lang.String action()" required="true" />
</composite:interface>
<composite:implementation>
<!-- <h:outputScript target="head" library="script" name="jquery.min.js" /> -->
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<h:outputScript library="primefaces" name="jquery/jquery.js" />
<h:form>
<h:dataTable columnClasses="nowrap,numalign,numalign,nowrap,numalign"
styleClass="bordertable" id="billcart" value="#{cc.attrs.items}"
var="template">
<h:column>
<f:facet name="header">
<h:outputText id="name" value="${i18n['foodWave.name']}" />
</f:facet>
<h:commandLink action="#{cc.attrs.selectaction}"
value="#{template.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['foodWave.description']}" />
</f:facet>
<h:outputText id="description" value="#{template.description}" />
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
...@@ -16,49 +16,45 @@ ...@@ -16,49 +16,45 @@
<ui:define name="content"> <ui:define name="content">
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" /> <h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
<h1>#{i18n['userlist.header']}</h1> <h1>#{i18n['userlist.header']}</h1>
<h:form> <h:form>
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<h:panelGroup> <h:panelGroup>
<a onclick="$('#advancedSearch').show(); $(this).hide();" ><h:outputText value="#{i18n['userlist.showAdvancedSearch']}" /></a> <a onclick="$('#advancedSearch').show(); $(this).hide();"><h:outputText value="#{i18n['userlist.showAdvancedSearch']}" /></a>
<span id="advancedSearch" style="display:none;"> <span id="advancedSearch" style="display: none;"> <h:selectBooleanCheckbox id="placeassoc" value="#{userSearchView.searchQuery.placeAssoc}" /> <h:outputLabel for="placeassoc"
value="#{i18n['userlist.placeassoc']}" /> <br /> <h:outputLabel for="saldofilter" value="#{i18n['userlist.saldofilter']}" /> <h:selectOneMenu
value="#{userSearchView.searchQuery.accountSaldoCompare}">
<h:selectBooleanCheckbox id="placeassoc" value="#{userSearchView.searchQuery.placeAssoc}" /> <f:selectItems value="#{userSearchView.searchQuery.accountCompareValues}" />
<h:outputLabel for="placeassoc" value="#{i18n['userlist.placeassoc']}" /> </h:selectOneMenu> <h:inputText value="#{userSearchView.searchQuery.accountSaldo}">
<f:convertNumber minFractionDigits="0" maxFractionDigits="2" />
</h:inputText> <br /> <h:outputLabel for="rolefilter" value="#{i18n['userlist.rolefilter']}" /> <h:selectManyCheckbox layout="pageDirection" styleClass="nowrap" id="rolefilter"
value="#{userSearchView.searchQuery.filterRoles}" converter="#{roleConverter}">
<f:selectItems value="#{roleDataView.roles}" var="r" itemLabel="#{r.name}" />
</h:selectManyCheckbox>
</span>
<br /> <br />
<h:outputLabel for="saldofilter" value="#{i18n['userlist.saldofilter']}" />
<h:selectOneMenu value="#{userSearchView.searchQuery.accountSaldoCompare}"> <h:selectBooleanCheckbox id="onlythisevent" value="#{userSearchView.searchQuery.onlyThisEvent}" />
<f:selectItems value="#{userSearchView.searchQuery.accountCompareValues}" /> <h:outputLabel for="onlythisevent" value="#{i18n['userlist.onlythisevent']}" />
</h:selectOneMenu>
<h:inputText value="#{userSearchView.searchQuery.accountSaldo}">
<f:convertNumber minFractionDigits="0" maxFractionDigits="2" />
</h:inputText>
<br /> <br />
<h:outputLabel for="rolefilter" value="#{i18n['userlist.rolefilter']}" /> <h:inputText value="#{userSearchView.search}" />
<h:selectManyCheckbox layout="pageDirection" styleClass="nowrap" id="rolefilter" value="#{userSearchView.searchQuery.filterRoles}" converter="#{roleConverter}"> <h:commandButton value="#{i18n['userlist.search']}" action="#{userSearchView.newSearch()}" />
<f:selectItems value="#{roleDataView.roles}" var="r" itemLabel="#{r.name}" /> </h:panelGroup>
</h:selectManyCheckbox> <h:panelGroup>
<a style="display: #{((userCartView.isEmpty())?'block':'none')};" onclick="$('#usercart').show(); $(this).hide();"><h:outputText value="#{i18n['userlist.showAdvancedSearch']}" /></a>
<div id="usercart" style="display: #{((userCartView.isEmpty())?'none':'block')};">
</span> <h:outputText value="#{i18n['usercart.cartsize']}" />
<br /> <h:outputText value=" #{userCartView.userCartSize}" />
<br />
<h:selectBooleanCheckbox id="onlythisevent" value="#{userSearchView.searchQuery.onlyThisEvent}" /> <h:commandButton actionListener="#{userSearchView.addToCart}" value="#{i18n['usercart.addSearcherUsers']}" />
<h:outputLabel for="onlythisevent" value="#{i18n['userlist.onlythisevent']}" /> <h:commandButton action="#{userCartView.traverse}" value="#{i18n['usercart.traverse']}" />
<br /> </div>
<h:inputText value="#{userSearchView.search}" /> </h:panelGroup>
<h:commandButton value="#{i18n['userlist.search']}" action="#{userSearchView.newSearch()}" /> </h:panelGrid>
</h:panelGroup>
<h:panelGroup>
<h:outputText value="i18n['usercart.cartsize']" /> <h:outputText value="#{userCartView.userCartSize}" />
<br/>
<h:commandButton actionListener="#{userSearchView.addToCart}" value="#{i18n['usercart.addSearcherUsers']}" />
<h:commandButton action="#{userCartView.traverse}" value="#{i18n['usercart.traverse']}"/>
</h:panelGroup>
</h:panelGrid>
</h:form> </h:form>
<p> <p>
......
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net) #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Bill number #Bill number
# Validationmessages # Validationmessages
bill.billMarkedPaidMail.message = Your deposit number {0} has been marked as paid. actionlog.create.header = Create new actionmessage
bill.billMarkedPaidMail.subject = [Streamparty] Your credits have been updated actionlog.create.message = Message
actionlog.create.role = Target role
global.infomail = info@streamparty.org actionlog.create.submitbutton = Send
global.webpage = http://www.streamparty.org actionlog.create.taskradio = Task
actionlog.crew = Crew
actionlog.message = Event
actionlog.messagelist.description = You can follow and create new action messages in this view
actionlog.messagelist.header = Messagelist
actionlog.state = State
actionlog.task = Task
actionlog.tasklist.header = Tasklist
actionlog.time = Time
actionlog.user = User
bill.billMarkedPaidMail.message = Your deposit number {0} has been marked as paid.
bill.billMarkedPaidMail.subject = [Streamparty] Your credits have been updated
eventorg.create = Create
global.cancel = Cancel
global.copyright = Codecrew Ry
global.infomail = info@streamparty.org
global.notAuthorizedExecute = You are not authorized to execute that!!
global.notauthorized = You don't have enough rights to enter this site.
global.save = Save
global.webpage = http://www.streamparty.org
httpsession.creationTime = Created
login.login = Login
login.logout = Logout
login.logoutmessage = You have logged out of the system
login.password = Password
login.submit = Login
login.username = Username
loginerror.header = Login failed
loginerror.message = Username of password incorrect.
loginerror.resetpassword = Reset password
passwordChanged.body = You can now login with the new password.
passwordChanged.header = Password changed successfully.
passwordReset.errorChanging = Unexpected error whilst password reset. Contact your administrator.
passwordReset.hashNotFound = Password change token has expired. Please send the query again.
permissiondenied.alreadyLoggedIn = You don't have enough rights
permissiondenied.header = Access denied
permissiondenied.notLoggedIn = You don't have enough rights to enter this site.
resetMail.body = You can change a forgotten password by inserting your username to the field below. A link where you can change the password will be sent to the email address associated to that.
resetMail.header = Reset lost password
resetMail.send = Send email
resetMail.username = Username
resetmailSent.body = Email has been sent containing a link where you can change the password.
resetmailSent.header = Email sent
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net) #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Bill number #Bill number
# Validationmessages # Validationmessages
bill.billMarkedPaidMail.message = Laskusi numero {0} on merkitty maksetuksi. Voit nyt siirty\u00E4 lippukauppaan varamaamaan haluamasi paikat. \nTervetuloa tapahtumaan!\n\nTerveisin,\nInsomnia lippupalvelu\nwww.insomnia.fi actionlog.create.header = Luo uusi ActionMessage
bill.billMarkedPaidMail.subject = [INSOMNIA] Lasku merkitty maksetuksi actionlog.create.message = Viesti
actionlog.create.role = Kohderooli
eventorg.edit = Muokkaa actionlog.create.submitbutton = L\u00E4het\u00E4
actionlog.create.taskradio = Teht\u00E4v\u00E4
global.infomail = info@insomnia.fi actionlog.crew = Crew
global.webpage = http://www.insomnia.fi actionlog.message = Tapahtuma
actionlog.messagelist.description = Voit seurata sek\u00E4 luoda uusia ActionMessageja t\u00E4ss\u00E4 n\u00E4kym\u00E4ss\u00E4.
actionlog.messagelist.header = Viestilista
actionlog.state = Tila
actionlog.task = Teht\u00E4v\u00E4
actionlog.tasklist.header = Teht\u00E4v\u00E4lista
actionlog.time = Aika
actionlog.user = Tekij\u00E4
bill.billMarkedPaidMail.message = Laskusi numero {0} on merkitty maksetuksi. Voit nyt siirty\u00E4 lippukauppaan varamaamaan haluamasi paikat. \nTervetuloa tapahtumaan!\n\nTerveisin,\nInsomnia lippupalvelu\nwww.insomnia.fi
bill.billMarkedPaidMail.subject = [INSOMNIA] Lasku merkitty maksetuksi
eventorg.create = Luo
eventorg.edit = Muokkaa
global.cancel = Peruuta
global.copyright = Codecrew Ry
global.infomail = info@insomnia.fi
global.notAuthorizedExecute = Sinulla ei ole riitt\u00E4v\u00E4sti oikeuksia suorittaa t\u00E4t\u00E4 toimenpidett\u00E4!
global.notauthorized = Sinulla ei ole riitt\u00E4vi\u00E4 oikeuksia t\u00E4lle sivulle.
global.save = Tallenna
global.webpage = http://www.insomnia.fi
httpsession.creationTime = Luotu
login.login = Kirjaudu sis\u00E4\u00E4n
login.logout = Kirjaudu ulos
login.logoutmessage = Olet kirjautunut ulos j\u00E4rjestelm\u00E4st\u00E4.
login.password = Salasana
login.submit = Kirjaudu sis\u00E4\u00E4n
login.username = K\u00E4ytt\u00E4j\u00E4tunnus
loginerror.header = Kirjautuminen ep\u00E4onnistui
loginerror.message = K\u00E4ytt\u00E4j\u00E4tunnus tai salasana ei ollut oikein.
loginerror.resetpassword = Salasana unohtunut?
passwordChanged.body = Voit nyt kirjautua k\u00E4ytt\u00E4j\u00E4tunnuksella ja uudella salasanalla sis\u00E4\u00E4n j\u00E4rjestelm\u00E4\u00E4n.
passwordChanged.header = Salasana vaihdettu onnistuneesti
passwordReset.errorChanging = Odotamaton virhe. Ota yhteytt\u00E4 yll\u00E4pitoon.
passwordReset.hashNotFound = Salasanan vaihto on vanhentunut. Jos haluat vaihtaa salasanan l\u00E4het\u00E4 vaihtopyynt\u00F6 uudelleen.
permissiondenied.alreadyLoggedIn = Sinulla ei ole riitt\u00E4v\u00E4sti oikeuksia!
permissiondenied.header = P\u00E4\u00E4sy kielletty
permissiondenied.notLoggedIn = Sinulla ei ole riitt\u00E4v\u00E4sti oikeuksia t\u00E4lle sivulle.
resetMail.body = Voit vaihtaa unohtuneen salasanan sy\u00F6tt\u00E4m\u00E4ll\u00E4 k\u00E4ytt\u00E4j\u00E4tunnuksesi allaolevaan kentt\u00E4\u00E4n. Tunnukseen liitettyyn s\u00E4hk\u00F6postiosoitteeseen l\u00E4hetet\u00E4\u00E4n kertak\u00E4ytt\u00F6inen osoite jossa voit vaihtaa sy\u00F6tt\u00E4m\u00E4si k\u00E4ytt\u00E4j\u00E4tunnuksen salasanan.
resetMail.header = Salasana unohtunut?
resetMail.send = L\u00E4het\u00E4 s\u00E4hk\u00F6posti
resetmailSent.body = Antamasi k\u00E4ytt\u00E4j\u00E4tunnuksen s\u00E4hk\u00F6postiosoitteeseen on l\u00E4hetetty osoite jossa voit vaihtaa tunnuksen salasanan.
resetmailSent.header = S\u00E4hk\u00F6posti l\u00E4hetetty
package fi.insomnia.bortal.web;
import javax.enterprise.context.RequestScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
import fi.insomnia.bortal.beans.CardPrintBeanLocal;
import fi.insomnia.bortal.model.EventUser;
import fi.insomnia.bortal.web.cdiview.user.UserCartView;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@Named
@RequestScoped
public class ErrorPageView {
String trace;
public String getStackTrace() {
FacesContext context = FacesContext.getCurrentInstance();
Map requestMap = context.getExternalContext().getRequestMap();
Throwable ex =
(Throwable) requestMap.get("javax.servlet.error.exception");
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
trace = sw.toString();
return trace;
}
public Long getTime(){
return Calendar.getInstance().getTimeInMillis();
}
}
\ No newline at end of file
package fi.insomnia.bortal.web.cdiview.shop;
import java.math.BigDecimal;
import java.util.Iterator;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.faces.model.ListDataModel;
import javax.inject.Inject;
import javax.inject.Named;
import fi.insomnia.bortal.beans.AccountEventBeanLocal;
import fi.insomnia.bortal.beans.BillBeanLocal;
import fi.insomnia.bortal.beans.EventBeanLocal;
import fi.insomnia.bortal.beans.FoodWaveBeanLocal;
import fi.insomnia.bortal.beans.ProductBeanLocal;
import fi.insomnia.bortal.enums.apps.ShopPermission;
import fi.insomnia.bortal.model.Bill;
import fi.insomnia.bortal.model.EventUser;
import fi.insomnia.bortal.model.FoodWave;
import fi.insomnia.bortal.model.Product;
import fi.insomnia.bortal.web.annotations.SelectedUser;
import fi.insomnia.bortal.web.cdiview.GenericCDIView;
import fi.insomnia.bortal.web.helpers.ProductShopItem;
@Named
@ConversationScoped
public class FoodWaveFoodView extends GenericCDIView {
/**
*
*/
private static final long serialVersionUID = 5723448087928988814L;
@EJB
private FoodWaveBeanLocal foodWaveBean;
@EJB
EventBeanLocal eventBean;
@EJB
private AccountEventBeanLocal accountEventBean;
@EJB
private BillBeanLocal billBean;
private FoodWave foodWave = null;
@EJB
private transient ProductBeanLocal productBean;
@Inject
@SelectedUser
private EventUser user;
@Inject
private BillEditView billEditView;
private Integer foodwaveid = 0;
private ListDataModel<Product> products;
private transient ListDataModel<ProductShopItem> shoppingcart;
public void initFoodWaveFoods() {
if( requirePermissions(ShopPermission.LIST_USERPRODUCTS) &&
getFoodwaveid() > 0 && getShoppingcart() == null) {
setFoodWave(foodWaveBean.findFoodwave(getFoodwaveid()));
setShoppingcart(new ListDataModel<ProductShopItem>(
ProductShopItem.productGTList( getFoodWave().getTemplate().getProducts() )));
System.out.println("beginconversation");
this.beginConversation();
//products = new ListDataModel<Product>(getFoodWave().getTemplate().getProducts());
}
}
public ListDataModel<Product> getProducts() {
return products;
}
public void setProducts(ListDataModel<Product> products) {
this.products = products;
}
public Integer getFoodwaveid() {
return foodwaveid;
}
public void setFoodwaveid(Integer foodwaveid) {
this.foodwaveid = foodwaveid;
}
public FoodWave getFoodWave() {
return foodWave;
}
public void setFoodWave(FoodWave foodWave) {
this.foodWave = foodWave;
}
public String add(Integer count) {
ProductShopItem item = getShoppingcart().getRowData();
item.setCount(item.getCount().add(BigDecimal.valueOf(count)));
System.out.println("foobar"+item.getCount());
return null;
}
public String addOne()
{
return add(1);
}
public String addMinusOne()
{
return add(-1);
}
public BigDecimal getTotalPrice() {
BigDecimal ret = BigDecimal.ZERO;
for (ProductShopItem cart : getShoppingcart()) {
ret = ret.add(cart.getPrice());
}
return ret;
}
/**
* Just create bills, they are nice
* <insert picture of bill gates here>
* @return
*/
public Bill createBillFromShoppingcart() {
Bill bill = new Bill(eventBean.getCurrentEvent(), user);
bill.setOurReference(eventBean.getCurrentEvent().getName());
for (ProductShopItem shopitem : shoppingcart) {
if (shopitem.getCount().compareTo(BigDecimal.ZERO) > 0) {
bill.addProduct(shopitem.getProduct(), shopitem.getCount(), getFoodWave());
}
}
billBean.createBill(bill);
return bill;
}
public String buyFromCounter() {
createBillFromShoppingcart();
return "/foodwave/ThanksForOrderingFromCounter";
}
public String buyFromInternet() {
Bill bill = createBillFromShoppingcart();
if(bill != null) {
getBillEditView().setBillid(bill.getId());
return "/bill/showBill?faces-redirect=true&IncludeViewParams=true";
}
return null;
}
public void setUser(EventUser user) {
this.user = user;
}
public EventUser getUser() {
return user;
}
public void setShoppingcart(ListDataModel<ProductShopItem> shoppingcart) {
this.shoppingcart = shoppingcart;
}
public ListDataModel<ProductShopItem> getShoppingcart() {
return shoppingcart;
}
private boolean productsInCart() {
Iterator<ProductShopItem> nullcheckIter = getShoppingcart().iterator();
while (nullcheckIter.hasNext()) {
if (nullcheckIter.next().getCount().compareTo(BigDecimal.ZERO) > 0) {
return true;
}
}
return false;
}
public BillEditView getBillEditView() {
return billEditView;
}
public void setBillEditView(BillEditView billEditView) {
this.billEditView = billEditView;
}
}
...@@ -3,10 +3,13 @@ package fi.insomnia.bortal.web.cdiview.shop; ...@@ -3,10 +3,13 @@ package fi.insomnia.bortal.web.cdiview.shop;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped; import javax.enterprise.context.ConversationScoped;
import javax.faces.model.ListDataModel; import javax.faces.model.ListDataModel;
import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import fi.insomnia.bortal.beans.EventBeanLocal;
import fi.insomnia.bortal.beans.FoodWaveBeanLocal; import fi.insomnia.bortal.beans.FoodWaveBeanLocal;
import fi.insomnia.bortal.enums.apps.ShopPermission; import fi.insomnia.bortal.enums.apps.ShopPermission;
import fi.insomnia.bortal.model.FoodWave;
import fi.insomnia.bortal.model.FoodWaveTemplate; import fi.insomnia.bortal.model.FoodWaveTemplate;
import fi.insomnia.bortal.web.cdiview.GenericCDIView; import fi.insomnia.bortal.web.cdiview.GenericCDIView;
...@@ -16,24 +19,36 @@ public class FoodWaveView extends GenericCDIView { ...@@ -16,24 +19,36 @@ public class FoodWaveView extends GenericCDIView {
private static final long serialVersionUID = 7281708393927365603L; private static final long serialVersionUID = 7281708393927365603L;
@EJB @EJB
private FoodWaveBeanLocal foodwaveBean; private FoodWaveBeanLocal foodWaveBean;
@Inject
private FoodWaveFoodView foodWaveFoodView;
private ListDataModel<FoodWaveTemplate> templates; private ListDataModel<FoodWaveTemplate> templates;
private FoodWaveTemplate template; private FoodWaveTemplate template;
private Integer templateId;
@EJB
private EventBeanLocal eventbean;
public void initTemplateList() private ListDataModel<FoodWave> foodWaves;
{
if (super.requirePermissions(ShopPermission.MANAGE_PRODUCTS)) private FoodWave selectedFoodWave = null;
{
setTemplates(new ListDataModel<FoodWaveTemplate>(foodwaveBean.getTemplates())); public void initTemplateList() {
if (super.requirePermissions(ShopPermission.LIST_USERPRODUCTS)) {
setTemplates(new ListDataModel<FoodWaveTemplate>(
foodWaveBean.getTemplates()));
super.beginConversation(); super.beginConversation();
} }
} }
public void initEditTemplate() public void initEditTemplate() {
{
if (super.requirePermissions(ShopPermission.MANAGE_PRODUCTS) && template == null) if (super.requirePermissions(ShopPermission.MANAGE_PRODUCTS) && template == null)
{ {
template = foodWaveBean.findTemplate(templateId);
super.beginConversation(); super.beginConversation();
} }
...@@ -43,21 +58,27 @@ public class FoodWaveView extends GenericCDIView { ...@@ -43,21 +58,27 @@ public class FoodWaveView extends GenericCDIView {
{ {
if (super.requirePermissions(ShopPermission.MANAGE_PRODUCTS) && template == null) if (super.requirePermissions(ShopPermission.MANAGE_PRODUCTS) && template == null)
{ {
setTemplate(new FoodWaveTemplate()); template = new FoodWaveTemplate();
template.setEvent(eventbean.getCurrentEvent());
super.beginConversation(); super.beginConversation();
} }
} }
public String editTemplate() public void initUserFoodWaveList() {
{ this.foodWaves = new ListDataModel<FoodWave>(
foodWaveBean.getOpenFoodWaves());
}
public String editTemplate() {
setTemplate(getTemplates().getRowData()); setTemplate(getTemplates().getRowData());
return "/foodadmin/editTemplate"; return "/foodadmin/editTemplate";
} }
public String saveTemplate() public String saveTemplate()
{ {
setTemplate(foodwaveBean.saveOrCreateTemplate(getTemplate())); setTemplate(foodWaveBean.saveOrCreateTemplate(getTemplate()));
return null;
return "/foodadmin/editTemplate";
} }
public FoodWaveTemplate getTemplate() { public FoodWaveTemplate getTemplate() {
...@@ -76,4 +97,42 @@ public class FoodWaveView extends GenericCDIView { ...@@ -76,4 +97,42 @@ public class FoodWaveView extends GenericCDIView {
this.templates = templates; this.templates = templates;
} }
public ListDataModel<FoodWave> getFoodWaves() {
return foodWaves;
}
public String selectFoodWave() {
if (foodWaves.isRowAvailable()) {
// setSelectedFoodWave(foodWaves.getRowData());
}
return "/foodwave/listProducts";
}
public String selectTemplate() {
if (templates.isRowAvailable()) {
foodWaves = new ListDataModel<FoodWave>(templates.getRowData()
.getFoodwaves());
}
return "/foodwave/list";
}
public FoodWave getSelectedFoodWave() {
return selectedFoodWave;
}
public void setSelectedFoodWave(FoodWave selectedFoodWave) {
this.selectedFoodWave = selectedFoodWave;
}
private FoodWaveFoodView getFoodWaveFoodView() {
return foodWaveFoodView;
}
private void setFoodWaveFoodView(FoodWaveFoodView foodWaveFoodView) {
this.foodWaveFoodView = foodWaveFoodView;
}
} }
package fi.insomnia.bortal.web.cdiview.shop;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.faces.model.ListDataModel;
import javax.inject.Inject;
import javax.inject.Named;
import fi.insomnia.bortal.beans.FoodWaveBeanLocal;
import fi.insomnia.bortal.model.EventUser;
import fi.insomnia.bortal.model.FoodWave;
import fi.insomnia.bortal.web.annotations.SelectedUser;
import fi.insomnia.bortal.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class FoodWaveView extends GenericCDIView {
/**
*
*/
private static final long serialVersionUID = -4668803787903428164L;
@Inject
@SelectedUser
private transient EventUser eventUser;
@EJB
private transient FoodWaveBeanLocal foodWaveBean;
private ListDataModel<FoodWave> foodWaves;
public EventUser getEventUser() {
return eventUser;
}
public void setEventUser(EventUser eventUser) {
this.eventUser = eventUser;
}
public ListDataModel<FoodWave> getFoodWaves() {
if(this.foodWaves == null) {
this.foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getOpenFoodWaves());
}
return foodWaves;
}
public String selectFoodWave() {
}
}
...@@ -209,7 +209,7 @@ public class ProductShopView extends GenericCDIView { ...@@ -209,7 +209,7 @@ public class ProductShopView extends GenericCDIView {
Product credProd = productBean.findCreditProduct(); Product credProd = productBean.findCreditProduct();
retuser = productBean.createAccountEvent(credProd, cash, user).getUser(); retuser = productBean.createAccountEvent(credProd, cash, user).getUser();
} }
if (user != null) { if (retuser != null) {
user = retuser; user = retuser;
} }
shoppingcart = null; shoppingcart = null;
......
...@@ -28,6 +28,7 @@ public class UserCartView extends GenericCDIView { ...@@ -28,6 +28,7 @@ public class UserCartView extends GenericCDIView {
public void initView() public void initView()
{ {
} }
private static final Logger logger = LoggerFactory.getLogger(UserCartView.class); private static final Logger logger = LoggerFactory.getLogger(UserCartView.class);
......
#!/bin/bash
epoc=$(date +%s)
# katotaan kaikki käännetyt
egrep -v "(\s*#|^\s*$)" ./LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties | awk '{print $1}' > /tmp/${epoc}lokalisoidut
# Haetaan kaikki rivit missä on jotain käännettävää
find . -name \*.xhtml | xargs grep "i18n" > /tmp/${epoc}lista
# grepataan kaikki lokalisoimattomat
for i in $(cat /tmp/${epoc}lokalisoidut); do sed -i "/${i}/d" /tmp/${epoc}lista ; done
cat /tmp/${epoc}lista
#siivotaan
rm /tmp/${epoc}lista /tmp/${epoc}lokalisoidut
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!