Commit e1d9738e by Tuomas Riihimäki

Merge branch 'insomnia_2014' into 'master'

Insomnia 2014

Insomnian muutokset tuotantoon

See merge request !124
2 parents ca930820 85063dd5
Showing with 1534 additions and 277 deletions
...@@ -27,6 +27,7 @@ import java.util.List; ...@@ -27,6 +27,7 @@ import java.util.List;
import javax.ejb.Local; import javax.ejb.Local;
import fi.codecrew.moya.bortal.views.BillSummary; import fi.codecrew.moya.bortal.views.BillSummary;
import fi.codecrew.moya.exceptions.BillException;
import fi.codecrew.moya.model.Bill; import fi.codecrew.moya.model.Bill;
import fi.codecrew.moya.model.EventUser; import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.FoodWave; import fi.codecrew.moya.model.FoodWave;
...@@ -47,7 +48,7 @@ public interface BillBeanLocal { ...@@ -47,7 +48,7 @@ public interface BillBeanLocal {
Collection<BillSummary> getBillLineSummary(); Collection<BillSummary> getBillLineSummary();
Bill markPaid(Bill bill, Calendar when); Bill markPaid(Bill bill, Calendar when, boolean useCredits) throws BillException;
void getPdfBillStream(Bill bill, OutputStream ostream); void getPdfBillStream(Bill bill, OutputStream ostream);
......
...@@ -23,5 +23,6 @@ import javax.ejb.Local; ...@@ -23,5 +23,6 @@ import javax.ejb.Local;
@Local @Local
public interface BootstrapBeanLocal { public interface BootstrapBeanLocal {
void saneDefaults(); // no empty databases
// void saneDefaults();
} }
...@@ -24,5 +24,6 @@ public enum SecurityLogType { ...@@ -24,5 +24,6 @@ public enum SecurityLogType {
genericMessage, genericMessage,
accountEvent, accountEvent,
verkkomaksu, verkkomaksu,
bill,
} }
/*
* Copyright Codecrew Ry
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.beans;
import java.util.Map;
import javax.ejb.Local;
@Local
public interface StatisticsBeanLocal {
public Long getGroupMembershipsEnteredEvent();
public Long getCardDeliveredCount();
public Long getGroupMembershipsTotalCount();
public Map<Long, Long> getHourlyIncomingStatistics(long startingFromMillis, int hourCount);
}
/*
* Copyright Codecrew Ry
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.exceptions;
public class BillException extends Exception {
public BillException(String x) {
super(x);
}
/**
*
*/
private static final long serialVersionUID = 4744284457862674051L;
}
/*
* Copyright Codecrew Ry
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.exceptions;
public class BillExceptionAlreadyPaid extends BillException {
public BillExceptionAlreadyPaid(String ex) {
super(ex);
}
/**
*
*/
private static final long serialVersionUID = 4744284457862674051L;
}
/*
* Copyright Codecrew Ry
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.exceptions;
public class BillExceptionNotEnoughtCredits extends BillException {
public BillExceptionNotEnoughtCredits(String x) {
super(x);
}
/**
*
*/
private static final long serialVersionUID = 4744284457862674051L;
}
...@@ -74,7 +74,7 @@ public class CheckoutBank { ...@@ -74,7 +74,7 @@ public class CheckoutBank {
logger.info("Added param for {} name {} value {}", new Object[] { key, paramName, paramValue }); logger.info("Added param for {} name {} value {}", new Object[] { key, paramName, paramValue });
} }
} }
System.out.println(); // System.out.println();
} }
......
...@@ -20,7 +20,6 @@ package fi.codecrew.moya.beans; ...@@ -20,7 +20,6 @@ package fi.codecrew.moya.beans;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.MessageFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collection; import java.util.Collection;
...@@ -33,6 +32,8 @@ import javax.ejb.EJBAccessException; ...@@ -33,6 +32,8 @@ import javax.ejb.EJBAccessException;
import javax.ejb.EJBException; import javax.ejb.EJBException;
import javax.ejb.LocalBean; import javax.ejb.LocalBean;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -40,7 +41,11 @@ import org.slf4j.LoggerFactory; ...@@ -40,7 +41,11 @@ import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beanutil.PdfPrinter; import fi.codecrew.moya.beanutil.PdfPrinter;
import fi.codecrew.moya.bortal.views.BillSummary; import fi.codecrew.moya.bortal.views.BillSummary;
import fi.codecrew.moya.enums.apps.BillPermission; import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.enums.apps.ShopPermission;
import fi.codecrew.moya.enums.apps.SpecialPermission; import fi.codecrew.moya.enums.apps.SpecialPermission;
import fi.codecrew.moya.exceptions.BillException;
import fi.codecrew.moya.exceptions.BillExceptionAlreadyPaid;
import fi.codecrew.moya.exceptions.BillExceptionNotEnoughtCredits;
import fi.codecrew.moya.facade.BillFacade; import fi.codecrew.moya.facade.BillFacade;
import fi.codecrew.moya.facade.BillLineFacade; import fi.codecrew.moya.facade.BillLineFacade;
import fi.codecrew.moya.facade.EventUserFacade; import fi.codecrew.moya.facade.EventUserFacade;
...@@ -51,10 +56,8 @@ import fi.codecrew.moya.model.Discount; ...@@ -51,10 +56,8 @@ import fi.codecrew.moya.model.Discount;
import fi.codecrew.moya.model.EventUser; import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.FoodWave; import fi.codecrew.moya.model.FoodWave;
import fi.codecrew.moya.model.LanEvent; import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.LanEventPropertyKey;
import fi.codecrew.moya.model.Product; import fi.codecrew.moya.model.Product;
import fi.codecrew.moya.model.ProductFlag; import fi.codecrew.moya.model.ProductFlag;
import fi.codecrew.moya.util.MailMessage;
/** /**
* Session Bean implementation class BillBean * Session Bean implementation class BillBean
...@@ -94,11 +97,14 @@ public class BillBean implements BillBeanLocal { ...@@ -94,11 +97,14 @@ public class BillBean implements BillBeanLocal {
@EJB @EJB
private DiscountBean discountBean; private DiscountBean discountBean;
@EJB
private LoggingBeanLocal logbean;
/** /**
* Default constructor. * Default constructor.
*/ */
public BillBean() { public BillBean() {
// TODO Auto-generated constructor stub
} }
@Override @Override
...@@ -223,37 +229,76 @@ public class BillBean implements BillBeanLocal { ...@@ -223,37 +229,76 @@ public class BillBean implements BillBeanLocal {
return ret; return ret;
} }
@Override
@RolesAllowed({ BillPermission.S_WRITE_ALL,
SpecialPermission.S_VERKKOMAKSU_CHECK }) /**
public Bill markPaid(Bill bill, Calendar when) { * We will mark bill paid in different transaction. That's because we don't wont it to fail if something other fails.
*
* @param bill
* @param when
* @param useCredits
* @return
* @throws BillException
*/
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
private Bill markPaidSafeTransaction(Bill bill, Calendar when, boolean useCredits) throws BillException {
bill = billFacade.reload(bill);
if (bill.getAccountEvent() != null || bill.getPaidDate() != null) { if (bill.getAccountEvent() != null || bill.getPaidDate() != null) {
throw new EJBException("Bill already marked paid!"); logbean.logMessage(SecurityLogType.bill, permbean.getCurrentUser(), "Trying to doublemark bill paid", bill.getId());
throw new BillExceptionAlreadyPaid("Trying to mark bill paid, already paid, BillID: "+bill.getId());
} }
if (bill.isFoowavePaymentOver())
{
throw new EJBException("Trying to mark paid a closed or left foodwave");
}
bill = billFacade.reload(bill);
Product creditproduct = productBean.findCreditProduct(); Product creditproduct = productBean.findCreditProduct();
EventUser user = bill.getUser(); EventUser user = bill.getUser();
if(useCredits) {
// check if there is enought credits
if(bill.getUser().getAccountBalance().compareTo(bill.getTotalPrice()) < 1) {
logbean.logMessage(SecurityLogType.bill, permbean.getCurrentUser(), "Trying to pay bill with accountevents, and there is no saldo, billid: ", bill.getId());
throw new BillExceptionNotEnoughtCredits("There is not enought credits to pay. , BillID: "+bill.getId());
}
} else {
AccountEvent ac = productBean.createAccountEvent(creditproduct, bill.totalPrice(), user); AccountEvent ac = productBean.createAccountEvent(creditproduct, bill.totalPrice(), user);
logger.info("Created creditentry. {}, userproducts {}", ac, user.getAccountEvents().size()); logger.info("Created creditentry. {}, userproducts {}", ac, user.getAccountEvents().size());
// Used in foodwave. Should be null!
// ac.setDelivered(when);
ac.setEventTime(when); ac.setEventTime(when);
ac.setBill(bill); ac.setBill(bill);
ac.setSeller(permbean.getCurrentUser()); ac.setSeller(permbean.getCurrentUser());
bill.setAccountEvent(ac); bill.setAccountEvent(ac);
}
bill.setPaidDate(when.getTime()); bill.setPaidDate(when.getTime());
return bill;
}
@Override
@RolesAllowed({ BillPermission.S_WRITE_ALL,
SpecialPermission.S_VERKKOMAKSU_CHECK })
public Bill markPaid(Bill bill, Calendar when, boolean useCredits) throws BillException {
bill = markPaidSafeTransaction(bill, when,useCredits);
EventUser user = bill.getUser();
if (bill.isFoowavePaymentOver() && !permbean.hasPermission(ShopPermission.MANAGE_FOODWAVES))
{
logbean.logMessage(SecurityLogType.bill, permbean.getCurrentUser(), "FoodwaveClosed and marking bill for it paid");
throw new EJBException("Trying to mark paid a closed or left foodwave");
}
// bill = billFacade.merge(bill); // bill = billFacade.merge(bill);
for (BillLine bl : bill.getBillLines()) { for (BillLine bl : bill.getBillLines()) {
...@@ -269,8 +314,11 @@ public class BillBean implements BillBeanLocal { ...@@ -269,8 +314,11 @@ public class BillBean implements BillBeanLocal {
ac2.setSeller(permbean.getCurrentUser()); ac2.setSeller(permbean.getCurrentUser());
} }
} }
billFacade.flush();
/*
MailMessage msg = new MailMessage(); MailMessage msg = new MailMessage();
String subject = MessageFormat.format(eventbean.getPropertyString(LanEventPropertyKey.BILL_PAID_MAIL_SUBJECT), user.getEvent().getName()); String subject = MessageFormat.format(eventbean.getPropertyString(LanEventPropertyKey.BILL_PAID_MAIL_SUBJECT), user.getEvent().getName());
...@@ -280,7 +328,10 @@ public class BillBean implements BillBeanLocal { ...@@ -280,7 +328,10 @@ public class BillBean implements BillBeanLocal {
msg.setMessage(content); msg.setMessage(content);
msg.setTo(bill.getUser().getUser()); msg.setTo(bill.getUser().getUser());
utilbean.sendMail(msg); utilbean.sendMail(msg);
*/
eventUserFacade.flush(); eventUserFacade.flush();
logbean.logMessage(SecurityLogType.bill, permbean.getCurrentUser(), "Marking bill paid, for user: ", bill.getUser().getId(),"BillId: ",bill.getId());
eventUserFacade.evict(bill.getUser()); eventUserFacade.evict(bill.getUser());
return bill; return bill;
......
...@@ -238,9 +238,14 @@ public class BootstrapBean implements BootstrapBeanLocal { ...@@ -238,9 +238,14 @@ public class BootstrapBean implements BootstrapBeanLocal {
// tai saadaan poikkeuksia nyrkillä kurkusta . // tai saadaan poikkeuksia nyrkillä kurkusta .
dbUpdates.add(new String[] { dbUpdates.add(new String[] {
"DELETE FROM product_productflags where productflags = 'PREPAID_INSTANT_CREATE'" "DELETE FROM product_productflags where productflags = 'PREPAID_INSTANT_CREATE'"
});
dbUpdates.add(new String[] {
"ALTER TABLE food_wave_templates ADD COLUMN wait_payments_minutes integer DEFAULT null;",
}); });
} // start_time timestamp without time zone, } // start_time timestamp without time zone,
@EJB @EJB
...@@ -293,16 +298,16 @@ public class BootstrapBean implements BootstrapBeanLocal { ...@@ -293,16 +298,16 @@ public class BootstrapBean implements BootstrapBeanLocal {
dbModelFacade.create(dBm); dbModelFacade.create(dBm);
} }
} }
// We will never run this again with empty database
public void saneDefaults() { // public void saneDefaults() {
User adminUser = userFacade.findByLogin("admin"); // User adminUser = userFacade.findByLogin("admin");
if (adminUser == null) { // if (adminUser == null) {
adminUser = new User(); // adminUser = new User();
adminUser.setLogin("admin"); // adminUser.setLogin("admin");
// adminUser.setSuperadmin(true); // // adminUser.setSuperadmin(true);
adminUser.resetPassword("admin"); // adminUser.resetPassword("admin");
userFacade.create(adminUser); // userFacade.create(adminUser);
} // }
} // }
} }
...@@ -399,7 +399,7 @@ public class CardTemplateBean implements CardTemplateBeanLocal { ...@@ -399,7 +399,7 @@ public class CardTemplateBean implements CardTemplateBeanLocal {
card.setCardState(CardState.DELIVERED); card.setCardState(CardState.DELIVERED);
} else { } else {
logger.info("Not marking card to delivered: " + card.getCardState() + " : " + card.getId()); logger.info("Not marking card to delivered: " + card.getCardState() + " : " + card.getId());
} }
if (markUserPlacesDelivered) { if (markUserPlacesDelivered) {
for (GroupMembership membership : gmFacade.findMemberships(user)) { for (GroupMembership membership : gmFacade.findMemberships(user)) {
......
...@@ -84,19 +84,23 @@ public class JaasBean implements MoyaRealmBeanRemote { ...@@ -84,19 +84,23 @@ public class JaasBean implements MoyaRealmBeanRemote {
private EventBean eventorgbean; private EventBean eventorgbean;
public EventUser tryLogin(String username, String password) { public EventUser tryLogin(String username, String password) {
// username = username.trim().toLowerCase();
EventUser eventUser = eventUserFacade.findByLogin(username.trim().toLowerCase()); EventUser eventUser = eventUserFacade.findByLogin(username);
logger.info("Found eventuser '{}' with username '{}'", eventUser, username);
User user = null; User user = null;
// Might not have EventUser // Might not have EventUser
if (eventUser == null) { if (eventUser == null) {
user = userfacade.findByLogin(username.trim()); user = userfacade.findByLogin(username);
} else { } else {
user = eventUser.getUser(); user = eventUser.getUser();
} }
logger.info("User '{}' with '{}' ", user, username);
// If there is no eventuser found, try to create one.
if (user != null) { if (user != null) {
logger.info("TryLogin user not null: {}", user);
if (user.isAnonymous()) { if (user.isAnonymous()) {
logger.info("logging in as anonymous!!!"); logger.info("logging in as anonymous!!!");
} else if (!user.checkPassword(password)) { } else if (!user.checkPassword(password)) {
...@@ -255,7 +259,7 @@ public class JaasBean implements MoyaRealmBeanRemote { ...@@ -255,7 +259,7 @@ public class JaasBean implements MoyaRealmBeanRemote {
public String authenticateApp(String pathInfo, String appId, String userId, String appStamp, String mac) { public String authenticateApp(String pathInfo, String appId, String userId, String appStamp, String mac) {
logger.info("Authenticat app with pathinfo {}, appid {}, userid {}, appstamp {}, mac {}", logger.info("Authenticat app with pathinfo {}, appid {}, userid {}, appstamp {}, mac {}",
new Object[]{pathInfo, appId, userId, appStamp, mac} new Object[] { pathInfo, appId, userId, appStamp, mac }
); );
if (mac == null) { if (mac == null) {
logger.warn("Rest auth failed: Mac is null"); logger.warn("Rest auth failed: Mac is null");
......
...@@ -303,6 +303,10 @@ public class MenuBean implements MenuBeanLocal { ...@@ -303,6 +303,10 @@ public class MenuBean implements MenuBeanLocal {
adminevent.addPage(menuitemfacade.findOrCreate("/eventorg/editEvent"), EventPermission.MANAGE_PROPERTIES); adminevent.addPage(menuitemfacade.findOrCreate("/eventorg/editEvent"), EventPermission.MANAGE_PROPERTIES);
adminevent.addPage(menuitemfacade.findOrCreate("/eventorg/edit"), EventPermission.MANAGE_PROPERTIES).setVisible(false); adminevent.addPage(menuitemfacade.findOrCreate("/eventorg/edit"), EventPermission.MANAGE_PROPERTIES).setVisible(false);
adminevent.addPage(menuitemfacade.findOrCreate("/reports/basicStatistics"), EventPermission.VIEW_STATISTICS);
MenuNavigation tournamentsadm = adminmenu.addPage(null, null); MenuNavigation tournamentsadm = adminmenu.addPage(null, null);
tournamentsadm.setKey("tournaments.menutitle"); tournamentsadm.setKey("tournaments.menutitle");
tournamentsadm.addPage(menuitemfacade.findOrCreate("/tournaments/admin/index"), TournamentPermission.MANAGE_ALL); tournamentsadm.addPage(menuitemfacade.findOrCreate("/tournaments/admin/index"), TournamentPermission.MANAGE_ALL);
...@@ -332,6 +336,8 @@ public class MenuBean implements MenuBeanLocal { ...@@ -332,6 +336,8 @@ public class MenuBean implements MenuBeanLocal {
infonavi.addPage(menuitemfacade.findOrCreate("/info/index"), TerminalPermission.INFO); infonavi.addPage(menuitemfacade.findOrCreate("/info/index"), TerminalPermission.INFO);
infonavi.addPage(menuitemfacade.findOrCreate("/info/incoming"), TerminalPermission.INFO); infonavi.addPage(menuitemfacade.findOrCreate("/info/incoming"), TerminalPermission.INFO);
infonavi.addPage(menuitemfacade.findOrCreate("/info/shop"), TerminalPermission.INFO); infonavi.addPage(menuitemfacade.findOrCreate("/info/shop"), TerminalPermission.INFO);
infonavi.addPage(menuitemfacade.findOrCreate("/info/foodwave/foodwaveshop"), TerminalPermission.INFO);
infonavi.addPage(menuitemfacade.findOrCreate("/info/foodwave/foodwaveProducts"), TerminalPermission.INFO).setVisible(false);
navifacade.create(adminmenu); navifacade.create(adminmenu);
......
/*
* Copyright Codecrew Ry
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.beans;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.security.DeclareRoles;
import javax.annotation.security.RolesAllowed;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.enums.apps.EventPermission;
import fi.codecrew.moya.facade.GroupMembershipFacade;
import fi.codecrew.moya.facade.PrintedCardFacade;
import fi.codecrew.moya.model.GroupMembership;
/**
* Session Bean implementation class FoodWaveBean
*/
@Stateless
@DeclareRoles({ EventPermission.S_VIEW_STATISTICS })
public class StatisticsBean implements StatisticsBeanLocal {
private static final Logger logger = LoggerFactory.getLogger(StatisticsBean.class);
@EJB
GroupMembershipFacade groupMembershipFacade;
@EJB
PrintedCardFacade printedCardFacade;
@Override
@RolesAllowed(EventPermission.S_VIEW_STATISTICS)
public Long getGroupMembershipsEnteredEvent() {
return groupMembershipFacade.findGroupMembershipsEnteredCount();
}
@Override
@RolesAllowed(EventPermission.S_VIEW_STATISTICS)
public Long getCardDeliveredCount() {
return printedCardFacade.findDeliveredCardCount();
}
@Override
@RolesAllowed(EventPermission.S_VIEW_STATISTICS)
public Long getGroupMembershipsTotalCount() {
return groupMembershipFacade.findGroupMembershipsCount();
}
@Override
public Map<Long, Long> getHourlyIncomingStatistics(long startingFromMillis, int hourCount) {
List<GroupMembership> groupMemberships = groupMembershipFacade.findAllEnteredBetween(startingFromMillis, (startingFromMillis + ((long) hourCount)*60l*60l*1000l));
HashMap<Long, Long> retMap = new HashMap<Long, Long>();
long currentTimestamp = startingFromMillis;
long hour = (60l*60l*1000l);
long hourEntered = 0;
for(GroupMembership gm : groupMemberships) {
// find the hour this one belongs to (sometime we need to skip empty hours)
while(gm.getEnteredEvent().getTimeInMillis() > currentTimestamp+hour) {
retMap.put(currentTimestamp, hourEntered);
hourEntered = 0;
currentTimestamp += hour;
}
hourEntered++;
}
return retMap;
}
}
...@@ -27,6 +27,7 @@ import javax.ejb.Stateless; ...@@ -27,6 +27,7 @@ import javax.ejb.Stateless;
import fi.codecrew.moya.beans.BillBeanLocal; import fi.codecrew.moya.beans.BillBeanLocal;
import fi.codecrew.moya.enums.apps.SpecialPermission; import fi.codecrew.moya.enums.apps.SpecialPermission;
import fi.codecrew.moya.exceptions.BillException;
import fi.codecrew.moya.model.Bill; import fi.codecrew.moya.model.Bill;
@Stateless @Stateless
...@@ -38,7 +39,12 @@ public class VerkkomaksuRunner { ...@@ -38,7 +39,12 @@ public class VerkkomaksuRunner {
private BillBeanLocal billbean; private BillBeanLocal billbean;
public void markPaid(Bill bill, Calendar when) { public void markPaid(Bill bill, Calendar when) {
billbean.markPaid(bill, when); try {
billbean.markPaid(bill, when, false);
} catch (BillException x) {
throw new RuntimeException(x);
}
} }
} }
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
*/ */
package fi.codecrew.moya.facade; package fi.codecrew.moya.facade;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List; import java.util.List;
import javax.ejb.EJB; import javax.ejb.EJB;
...@@ -168,4 +170,71 @@ public class GroupMembershipFacade extends IntegerPkGenericFacade<GroupMembershi ...@@ -168,4 +170,71 @@ public class GroupMembershipFacade extends IntegerPkGenericFacade<GroupMembershi
} }
public Long findGroupMembershipsCount() {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<GroupMembership> root = cq.from(GroupMembership.class);
Path<PlaceGroup> pg = root.get(GroupMembership_.placeGroup);
cq.select(cb.count(root));
cq.where(cb.equal(pg.get(PlaceGroup_.event), eventbean.getCurrentEvent()));
return super.getSingleNullableResult(getEm().createQuery(cq));
}
public Long findGroupMembershipsEnteredCount() {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<GroupMembership> root = cq.from(GroupMembership.class);
Path<PlaceGroup> pg = root.get(GroupMembership_.placeGroup);
cq.select(cb.count(root));
cq.where(cb.not(cb.isNull(root.get(GroupMembership_.enteredEvent))),
cb.equal(pg.get(PlaceGroup_.event), eventbean.getCurrentEvent())
);
return super.getSingleNullableResult(getEm().createQuery(cq));
}
public List<GroupMembership> findAllEnteredBetween(long startTimestamp, long endTimestamp) {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<GroupMembership> cq = cb.createQuery(GroupMembership.class);
Root<GroupMembership> root = cq.from(GroupMembership.class);
Path<PlaceGroup> pg = root.get(GroupMembership_.placeGroup);
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
c1.setTimeInMillis(startTimestamp);
c2.setTimeInMillis(endTimestamp);
cq.where(cb.between(root.get(GroupMembership_.enteredEvent), c1, c2),
cb.equal(pg.get(PlaceGroup_.event), eventbean.getCurrentEvent()));
return getEm().createQuery(cq).getResultList();
}
} }
...@@ -38,6 +38,8 @@ import fi.codecrew.moya.model.CardCode; ...@@ -38,6 +38,8 @@ import fi.codecrew.moya.model.CardCode;
import fi.codecrew.moya.model.CardCode_; import fi.codecrew.moya.model.CardCode_;
import fi.codecrew.moya.model.CardTemplate_; import fi.codecrew.moya.model.CardTemplate_;
import fi.codecrew.moya.model.EventUser; import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.GroupMembership;
import fi.codecrew.moya.model.GroupMembership_;
import fi.codecrew.moya.model.LanEvent; import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.PrintedCard; import fi.codecrew.moya.model.PrintedCard;
import fi.codecrew.moya.model.PrintedCard_; import fi.codecrew.moya.model.PrintedCard_;
...@@ -137,4 +139,26 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> { ...@@ -137,4 +139,26 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> {
return new ArrayList<PrintedCard>(pch.values()); return new ArrayList<PrintedCard>(pch.values());
} }
public Long findDeliveredCardCount() {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<PrintedCard> root = cq.from(PrintedCard.class);
cq.select(cb.count(root));
cq.where(cb.equal(root.get(PrintedCard_.cardState), CardState.DELIVERED),
cb.equal(root.get(PrintedCard_.event), eventbean.getCurrentEvent()));
return super.getSingleNullableResult(getEm().createQuery(cq));
}
} }
...@@ -89,11 +89,11 @@ public class UserFacade extends IntegerPkGenericFacade<User> { ...@@ -89,11 +89,11 @@ public class UserFacade extends IntegerPkGenericFacade<User> {
* *
* @param login * @param login
*/ */
public User findByLogin(String login) { public User findByLogin(final String login) {
CriteriaBuilder cb = getEm().getCriteriaBuilder(); CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<User> cq = cb.createQuery(User.class); CriteriaQuery<User> cq = cb.createQuery(User.class);
Root<User> root = cq.from(User.class); Root<User> root = cq.from(User.class);
cq.where(cb.equal(root.get(User_.login), login.toLowerCase().trim())); cq.where(cb.equal(root.get(User_.login), login));
return getSingleNullableResult(getEm().createQuery(cq)); return getSingleNullableResult(getEm().createQuery(cq));
} }
......
...@@ -36,6 +36,7 @@ import javax.persistence.OrderBy; ...@@ -36,6 +36,7 @@ import javax.persistence.OrderBy;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -130,7 +131,7 @@ public class Bill extends GenericEntity { ...@@ -130,7 +131,7 @@ public class Bill extends GenericEntity {
@OrderBy("id") @OrderBy("id")
// @PrivateOwned // @PrivateOwned
@OneToMany(mappedBy = "bill", cascade = CascadeType.ALL) @OneToMany(mappedBy = "bill", cascade = CascadeType.ALL)
private List<BillLine> billLines; private List<BillLine> billLines = new ArrayList<BillLine>();
public boolean isPaid() public boolean isPaid()
{ {
...@@ -226,12 +227,12 @@ public class Bill extends GenericEntity { ...@@ -226,12 +227,12 @@ public class Bill extends GenericEntity {
public Bill(LanEvent event, EventUser user, long expireTimeHours) { public Bill(LanEvent event, EventUser user, long expireTimeHours) {
this(event, user, Calendar.getInstance()); this(event, user, Calendar.getInstance());
this.expires.setTimeInMillis((System.currentTimeMillis() + (expireTimeHours*60*60 * 1000 ))); this.expires.setTimeInMillis((System.currentTimeMillis() + (expireTimeHours * 60 * 60 * 1000)));
} }
public Bill(LanEvent event, long expireTimeHours) { public Bill(LanEvent event, long expireTimeHours) {
this(event, Calendar.getInstance()); this(event, Calendar.getInstance());
this.expires.setTimeInMillis((System.currentTimeMillis() + (expireTimeHours*60*60 * 1000 ))); this.expires.setTimeInMillis((System.currentTimeMillis() + (expireTimeHours * 60 * 60 * 1000)));
} }
public Bill() { public Bill() {
...@@ -390,7 +391,7 @@ public class Bill extends GenericEntity { ...@@ -390,7 +391,7 @@ public class Bill extends GenericEntity {
} }
public void setPaidDate(Date paidDate) { public void setPaidDate(Date paidDate) {
if(paidDate != null) if (paidDate != null)
expires = null; expires = null;
this.paidDate = paidDate; this.paidDate = paidDate;
...@@ -428,17 +429,28 @@ public class Bill extends GenericEntity { ...@@ -428,17 +429,28 @@ public class Bill extends GenericEntity {
this.sentDate = sentDate; this.sentDate = sentDate;
} }
public boolean isFoodwaveBill() {
for (BillLine bl : billLines)
{
if (bl.getFoodwave() != null) {
return true;
}
}
return false;
}
public boolean isFoowavePaymentOver() { public boolean isFoowavePaymentOver() {
boolean ret = false;
for (BillLine bl : billLines) for (BillLine bl : billLines)
{ {
if (bl.getFoodwave() != null && (bl.getFoodwave().getClosed() || bl.getFoodwave().getTime().before(new Date()))) if (bl.getFoodwave() != null) {
if (bl.getFoodwave().isPaymentOver())
{ {
ret = true; return true;
break;
} }
} }
return ret; }
return false;
} }
public Calendar getExpires() { public Calendar getExpires() {
...@@ -450,23 +462,50 @@ public class Bill extends GenericEntity { ...@@ -450,23 +462,50 @@ public class Bill extends GenericEntity {
} }
public boolean isExpired() { public boolean isExpired() {
if(expires == null) if (expires == null)
return false; return false;
return Calendar.getInstance().after(expires); return Calendar.getInstance().after(expires);
} }
public void markExpired() { public void markExpired() {
if(isExpired() || isPaid()) if (isExpired() || isPaid())
return; return;
expires = Calendar.getInstance(); expires = Calendar.getInstance();
} }
}
@Transient
public BigDecimal getTotalQuantity() {
BigDecimal total = BigDecimal.ZERO;
for(BillLine l : getBillLines()) {
if(l == null || l.getQuantity() == null)
continue;
total = total.add(l.getQuantity());
}
return total;
}
@Transient
public String getProductSummary() {
String summary = "";
for(BillLine l : getBillLines()) {
if(l == null || l.getQuantity() == null)
continue;
if(!summary.isEmpty()) {
summary += ", ";
}
summary += l.getName();
}
return summary;
}
}
......
...@@ -36,6 +36,7 @@ import javax.persistence.OneToMany; ...@@ -36,6 +36,7 @@ import javax.persistence.OneToMany;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
/** /**
* *
...@@ -140,11 +141,11 @@ public class FoodWave extends GenericEntity { ...@@ -140,11 +141,11 @@ public class FoodWave extends GenericEntity {
} }
public boolean isFull() { public boolean isFull() {
if(getMaximumFoods() <= 0) { if (getMaximumFoods() <= 0) {
return false; return false;
} }
if(getReservedCount() >= getMaximumFoods()) { if (getReservedCount() >= getMaximumFoods()) {
return true; return true;
} }
...@@ -197,8 +198,7 @@ public class FoodWave extends GenericEntity { ...@@ -197,8 +198,7 @@ public class FoodWave extends GenericEntity {
public Integer getMaximumFoods() { public Integer getMaximumFoods() {
if (maximumFoods == null) {
if(maximumFoods == null) {
return 0; return 0;
} }
...@@ -225,19 +225,18 @@ public class FoodWave extends GenericEntity { ...@@ -225,19 +225,18 @@ public class FoodWave extends GenericEntity {
public Integer getUnpaidCount() { public Integer getUnpaidCount() {
Integer ret = 0; Integer ret = 0;
for (BillLine line : getBillLines()) { for (BillLine line : getBillLines()) {
if (!line.getBill().isPaid()) { if (!line.getBill().isPaid() && !line.getBill().isExpired()) {
ret += line.getQuantity().intValue(); ret += line.getQuantity().intValue();
} }
} }
return ret; return ret;
} }
public Integer getOrderedCount() { public Integer getOrderedCount() {
Integer ret = 0; Integer ret = 0;
if (getAccountEvents() != null) { if (getAccountEvents() != null) {
for(AccountEvent ae : getAccountEvents()) { for (AccountEvent ae : getAccountEvents()) {
ret += ae.getQuantity().intValue(); ret += ae.getQuantity().intValue();
} }
} }
...@@ -245,19 +244,46 @@ public class FoodWave extends GenericEntity { ...@@ -245,19 +244,46 @@ public class FoodWave extends GenericEntity {
return ret; return ret;
} }
public boolean isDelivered() { public Integer getDeliveredCount() {
Integer delCount = new Integer(0);
if (getAccountEvents() != null && getReservedCount() != 0) { if (getAccountEvents() != null && getReservedCount() != 0) {
for(AccountEvent ae : getAccountEvents()) { for (AccountEvent ae : getAccountEvents()) {
if (ae.isEventDelivered()) { if (ae.isEventDelivered()) {
return true; delCount++;
} }
} }
}
return delCount;
}
public boolean isDelivered() {
if (getAccountEvents() != null && getReservedCount() != 0) {
for (AccountEvent ae : getAccountEvents()) {
if (!ae.isEventDelivered()) {
return false; return false;
} }
}
}
return true; return true;
} }
}
@Transient
public Date getLastPaymentTime() {
return new Date(getTime().getTime() + (getTemplate().getWaitPaymentsMinutes().longValue() * 60l * 1000l));
}
public boolean isPaymentOver() {
// add this magical "wait payments this amount of minutes" to foodwave
Date endDate = new Date(getTime().getTime() + (getTemplate().getWaitPaymentsMinutes().longValue() * 60l * 1000l));
if (isClosed() || endDate.before(new Date())) {
return true;
}
return false;
}
}
...@@ -67,6 +67,9 @@ public class FoodWaveTemplate extends GenericEntity { ...@@ -67,6 +67,9 @@ public class FoodWaveTemplate extends GenericEntity {
@Column(name = "max_foods") @Column(name = "max_foods")
private Integer maximumFoods; private Integer maximumFoods;
@Column(name = "wait_payments_minutes")
private Integer waitPaymentsMinutes = 0;
public FoodWaveTemplate() { public FoodWaveTemplate() {
} }
...@@ -135,4 +138,16 @@ public class FoodWaveTemplate extends GenericEntity { ...@@ -135,4 +138,16 @@ public class FoodWaveTemplate extends GenericEntity {
return returnList; return returnList;
} }
public Integer getWaitPaymentsMinutes() {
if(waitPaymentsMinutes == null)
waitPaymentsMinutes = 0;
return waitPaymentsMinutes;
}
public void setWaitPaymentsMinutes(Integer waitPaymentsMinutes) {
this.waitPaymentsMinutes = waitPaymentsMinutes;
}
} }
...@@ -70,5 +70,9 @@ ...@@ -70,5 +70,9 @@
<id>apache.snapshots</id> <id>apache.snapshots</id>
<url>http://repository.apache.org/snapshots/</url> <url>http://repository.apache.org/snapshots/</url>
</repository> </repository>
<repository>
<id>clojars.org</id>
<url>http://clojars.org/repo</url>
</repository>
</repositories> </repositories>
</project> </project>
...@@ -101,6 +101,21 @@ ...@@ -101,6 +101,21 @@
<type>jar</type> <type>jar</type>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>net.matlux</groupId>
<artifactId>jvm-breakglass</artifactId>
<version>0.0.7</version>
</dependency>
</dependencies> </dependencies>
<parent> <parent>
......
...@@ -24,13 +24,15 @@ public enum EventPermission implements IAppPermission { ...@@ -24,13 +24,15 @@ public enum EventPermission implements IAppPermission {
MANAGE_PROPERTIES, MANAGE_PROPERTIES,
MANAGE_PRIVATE_PROPERTIES, MANAGE_PRIVATE_PROPERTIES,
MANAGE_EVENT MANAGE_EVENT,
VIEW_STATISTICS
; ;
public static final String S_MANAGE_PROPERTIES = "EVENT/MANAGE_PROPERTIES"; public static final String S_MANAGE_PROPERTIES = "EVENT/MANAGE_PROPERTIES";
public static final String S_MANAGE_PRIVATE_PROPERTIES = "EVENT/MANAGE_PRIVATE_PROPERTIES"; public static final String S_MANAGE_PRIVATE_PROPERTIES = "EVENT/MANAGE_PRIVATE_PROPERTIES";
public static final String S_MANAGE_EVENT = "EVENT/MANAGE_EVENT"; public static final String S_MANAGE_EVENT = "EVENT/MANAGE_EVENT";
public static final String S_VIEW_STATISTICS = "EVENT/VIEW_STATISTICS";
private final String fullName; private final String fullName;
private final String key; private final String key;
......
...@@ -24,6 +24,16 @@ ...@@ -24,6 +24,16 @@
<param-value>Development</param-value> <param-value>Development</param-value>
</context-param> </context-param>
<!-- Add req.remoteHost, req.xForwardedFor, req.requestURI, req.requestURL,
req.queryString and req.userAgent to logger MDC -->
<filter>
<filter-name>MDCInsertingServletFilter</filter-name>
<filter-class>ch.qos.logback.classic.helpers.MDCInsertingServletFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>MDCInsertingServletFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter> <filter>
<display-name>PrimefacesFileupload</display-name> <display-name>PrimefacesFileupload</display-name>
...@@ -44,19 +54,27 @@ ...@@ -44,19 +54,27 @@
<filter-name>HostnameFilter</filter-name> <filter-name>HostnameFilter</filter-name>
<servlet-name>*</servlet-name> <servlet-name>*</servlet-name>
</filter-mapping> </filter-mapping>
<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>
<load-on-startup>1</load-on-startup> <load-on-startup>1</load-on-startup>
</servlet> </servlet>
<servlet-mapping> <servlet-mapping>
<servlet-name>Faces Servlet</servlet-name> <servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern> <url-pattern>*.jsf</url-pattern>
</servlet-mapping> </servlet-mapping>
<!-- <servlet> <servlet-name>ViewStatusMessages</servlet-name> <servlet-class>ch.qos.logback.classic.ViewStatusMessagesServlet
</servlet-class> </servlet> <servlet-mapping> <servlet-name>ViewStatusMessages</servlet-name>
<url-pattern>/logback</url-pattern> </servlet-mapping> -->
<servlet>
<servlet-name>repl-servlet</servlet-name>
<servlet-class>fi.codecrew.moya.management.ReplServlet</servlet-class>
<load-on-startup>5</load-on-startup>
</servlet>
<session-config> <session-config>
<session-timeout>120</session-timeout> <session-timeout>120</session-timeout>
</session-config> </session-config>
...@@ -97,4 +115,5 @@ ...@@ -97,4 +115,5 @@
<persistence-unit-ref> <persistence-unit-ref>
<persistence-unit-ref-name>BortalEMF</persistence-unit-ref-name> <persistence-unit-ref-name>BortalEMF</persistence-unit-ref-name>
</persistence-unit-ref> </persistence-unit-ref>
</web-app> </web-app>
\ No newline at end of file
...@@ -62,6 +62,10 @@ ...@@ -62,6 +62,10 @@
</ui:fragment> </ui:fragment>
<p:outputPanel rendered="#{billEditView.bill.foodwaveBill}">
<span class="notify"><h:outputText value="#{i18n['foodshop.canBuyToCounter']}" /></span>
</p:outputPanel>
<br />
<p:outputPanel rendered="#{!billEditView.bill.paid and !billEditView.bill.expired}"> <p:outputPanel rendered="#{!billEditView.bill.paid and !billEditView.bill.expired}">
<h:form> <h:form>
<p:commandButton id="cancelbtn" actionListener="#{billEditView.expireBill()}" onerror="location.reload(true);" value="#{i18n['bill.cancel']}" update=":billPanel"> <p:commandButton id="cancelbtn" actionListener="#{billEditView.expireBill()}" onerror="location.reload(true);" value="#{i18n['bill.cancel']}" update=":billPanel">
...@@ -70,6 +74,13 @@ ...@@ -70,6 +74,13 @@
</h:form> </h:form>
</p:outputPanel> </p:outputPanel>
<p:outputPanel rendered="#{billEditView.bill.user.accountBalance ge billEditView.bill.totalPrice}">
<h:form>
<p:commandButton id="buyCreditsButton" actionListener="#{billEditView.buyWithCredits()}" onerror="location.reload(true);" value="#{i18n['bill.markPaid.credits']}" update=":billPanel">
<p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-alert" />
</p:commandButton>
</h:form>
</p:outputPanel>
</p:outputPanel> </p:outputPanel>
</ui:define> </ui:define>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<h:body> <h:body>
<!-- <c:if test="#{sessionHandler.isInDevelopmentMode() eq false}"> --> <!-- <c:if test="#{sessionHandler.isInDevelopmentMode() eq false}"> -->
<h1>#{i18n['error.error']}</h1> <h1>#{i18n['error.error']}</h1>
<h2>#{errorPageView.message}</h2>
<p>${i18n['error.contact']} <p>${i18n['error.contact']}
<br/><h:outputText escape="false" style="color: red;" value="#{errorPageView.time}" /><br/><br/> <br/><h:outputText escape="false" style="color: red;" value="#{errorPageView.time}" /><br/><br/>
<!-- Trail:<br/><h:outputText escape="false" style="color: red;" value="#{errorPageView.trail}" /> --> <!-- Trail:<br/><h:outputText escape="false" style="color: red;" value="#{errorPageView.trail}" /> -->
......
<!DOCTYPE html <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <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" xmlns:p="http://primefaces.org/ui">
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"
xmlns:p="http://primefaces.org/ui">
<h:body> <h:body>
<ui:composition <ui:composition template="#{sessionHandler.template}">
template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
<f:viewParam name="id" value="#{foodWaveView.templateId}" /> <f:viewParam name="id" value="#{foodWaveView.templateId}" />
<f:event type="preRenderView" <f:event type="preRenderView" listener="#{foodWaveView.initEditTemplate()}" />
listener="#{foodWaveView.initEditTemplate()}" />
</f:metadata> </f:metadata>
<ui:define name="title"> <ui:define name="title">
...@@ -27,58 +18,46 @@ ...@@ -27,58 +18,46 @@
<p:panel header="#{i18n['foodwavetemplate.edit']}"> <p:panel header="#{i18n['foodwavetemplate.edit']}">
<h:form> <h:form>
<h:panelGrid columns="3"> <h:panelGrid columns="3">
<h:outputLabel for="name" <h:outputLabel for="name" value="#{i18n['foodwave.template.name']}" />
value="#{i18n['foodwave.template.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:outputLabel for="desc" <h:outputLabel for="desc" value="#{i18n['foodwave.template.description']}" />
value="#{i18n['foodwave.template.description']}" /> <h:inputText id="desc" value="#{foodWaveView.template.description}" />
<h:inputText id="desc"
value="#{foodWaveView.template.description}" />
<h:message for="desc" /> <h:message for="desc" />
<h:outputLabel for="overtime" value="#{i18n['foodwave.template.waitPaymentsMinutes']}" />
<p:spinner id="overtime" value="#{foodWaveView.template.waitPaymentsMinutes}" suffix=" #{i18n['suffix.minutes']}" min="0" />
<h:message for="overtime" />
<h:outputText value=" " /> <h:outputText value=" " />
<h:commandButton action="#{foodWaveView.saveTemplate()}" <h:commandButton action="#{foodWaveView.saveTemplate()}" value="#{i18n['foodwavetemplate.save']}" />
value="#{i18n['foodwavetemplate.save']}" />
</h:panelGrid> </h:panelGrid>
</h:form> </h:form>
<h:form> <h:form>
<h:selectOneMenu value="#{foodWaveView.currentProduct}" <h:selectOneMenu value="#{foodWaveView.currentProduct}" converter="#{productConverter}">
converter="#{productConverter}"> <f:selectItems value="#{foodWaveView.products}" var="product" itemLabel="#{product.name}"></f:selectItems>
<f:selectItems value="#{foodWaveView.products}" var="product"
itemLabel="#{product.name}"></f:selectItems>
</h:selectOneMenu> </h:selectOneMenu>
<p:commandButton value="#{i18n['foodwavetemplate.addproduct']}" <p:commandButton value="#{i18n['foodwavetemplate.addproduct']}" actionListener="#{foodWaveView.addProductToTemplate}" ajax="false" />
actionListener="#{foodWaveView.addProductToTemplate}"
ajax="false" />
</h:form> </h:form>
<h:form> <h:form>
<h:panelGrid columns="4"> <h:panelGrid columns="4">
<h:outputText value="#{i18n['foodwavetemplate.productname']}" /> <h:outputText value="#{i18n['foodwavetemplate.productname']}" />
<h:outputText <h:outputText value="#{i18n['foodwavetemplate.productdescription']}" />
value="#{i18n['foodwavetemplate.productdescription']}" />
<h:outputText value="#{i18n['foodwavetemplate.price']}" /> <h:outputText value="#{i18n['foodwavetemplate.price']}" />
<h:outputText value="&nbsp;" /> <h:outputText value="&nbsp;" />
<h:inputText id="productname" <h:inputText id="productname" value="#{foodWaveView.currentProduct.name}" />
value="#{foodWaveView.currentProduct.name}" /> <h:inputText id="productdescription" value="#{foodWaveView.currentProduct.description}" />
<h:inputText id="productdescription" <h:inputText id="price" value="#{foodWaveView.currentProduct.price}" />
value="#{foodWaveView.currentProduct.description}" />
<h:inputText id="price"
value="#{foodWaveView.currentProduct.price}" />
<p:commandButton value="#{i18n['foodwavetemplate.addproduct']}" <p:commandButton value="#{i18n['foodwavetemplate.addproduct']}" actionListener="#{foodWaveView.addProductToTemplate}" ajax="false" />
actionListener="#{foodWaveView.addProductToTemplate}"
ajax="false" />
</h:panelGrid> </h:panelGrid>
</h:form> </h:form>
<h:form> <h:form>
<p:dataTable name="productTable" id="productTable" <p:dataTable name="productTable" id="productTable" value="#{foodWaveView.template.products}" var="product" editable="true">
value="#{foodWaveView.template.products}" var="product"
editable="true">
<p:ajax event="rowEdit" listener="#{foodWaveView.onEdit}" /> <p:ajax event="rowEdit" listener="#{foodWaveView.onEdit}" />
...@@ -89,20 +68,17 @@ ...@@ -89,20 +68,17 @@
<h:outputText value="#{product.name}" /> <h:outputText value="#{product.name}" />
</f:facet> </f:facet>
<f:facet name="input"> <f:facet name="input">
<p:inputText value="#{product.name}" style="width:100%" <p:inputText value="#{product.name}" style="width:100%" required="true" requiredMessage="Name required" />
required="true" requiredMessage="Name required" />
</f:facet> </f:facet>
</p:cellEditor> </p:cellEditor>
</p:column> </p:column>
<p:column <p:column headerText="#{i18n['foodwavetemplate.productdescription']}">
headerText="#{i18n['foodwavetemplate.productdescription']}">
<p:cellEditor> <p:cellEditor>
<f:facet name="output"> <f:facet name="output">
<h:outputText value="#{product.description}" /> <h:outputText value="#{product.description}" />
</f:facet> </f:facet>
<f:facet name="input"> <f:facet name="input">
<p:inputText value="#{product.description}" style="width:100%" <p:inputText value="#{product.description}" style="width:100%" required="true" requiredMessage="Description required" />
required="true" requiredMessage="Description required" />
</f:facet> </f:facet>
</p:cellEditor> </p:cellEditor>
</p:column> </p:column>
...@@ -112,52 +88,38 @@ ...@@ -112,52 +88,38 @@
<h:outputText value="#{product.price}" /> <h:outputText value="#{product.price}" />
</f:facet> </f:facet>
<f:facet name="input"> <f:facet name="input">
<p:inputText value="#{product.price}" style="width:100%" <p:inputText value="#{product.price}" style="width:100%" required="true" requiredMessage="Price required" />
required="true" requiredMessage="Price required" />
</f:facet> </f:facet>
</p:cellEditor> </p:cellEditor>
</p:column> </p:column>
<p:column headerText="#{i18n['foodwavetemplate.editRow']}" <p:column style="width:20px">
style="width:20px">
<p:rowEditor /> <p:rowEditor />
</p:column> </p:column>
<p:column headerText="#{i18n['foodwavetemplate.actions']}" <p:column style="width:70px">
style="width:20px;"> <p:commandButton value="#{i18n['foodwavetemplate.removeFromList']}" action="#{foodWaveView.removeProductFromList(product)}" update="productTable" />
<p:commandButton
value="#{i18n['foodwavetemplate.removeFromList']}"
action="#{foodWaveView.removeProductFromList(product)}"
update="productTable" />
</p:column> </p:column>
</p:dataTable> </p:dataTable>
<h:commandButton action="#{foodWaveView.saveTemplate()}" <h:commandButton action="#{foodWaveView.saveTemplate()}" value="#{i18n['foodwavetemplate.savetemplate']}" />
value="#{i18n['foodwavetemplate.savetemplate']}" />
<!-- --> <!-- -->
</h:form> </h:form>
</p:panel> </p:panel>
<h:form> <h:form>
<p:panel header="#{i18n['foodwavetemplate.createwave']}"> <p:panel header="#{i18n['foodwavetemplate.createwave']}">
<h:panelGrid columns="3"> <h:panelGrid columns="3">
<h:outputLabel for="waveName" <h:outputLabel for="waveName" value="#{i18n['foodwavetemplate.waveName']}" />
value="#{i18n['foodwavetemplate.waveName']}" /> <h:inputText id="waveName" value="#{foodWaveView.selectedFoodWave.name}" />
<h:inputText id="waveName"
value="#{foodWaveView.selectedFoodWave.name}" />
<h:message for="waveName" /> <h:message for="waveName" />
<h:outputLabel for="waveMaxFoods" <h:outputLabel for="waveMaxFoods" value="#{i18n['foodwavetemplate.maxfoods']}" />
value="#{i18n['foodwavetemplate.maxfoods']}" /> <h:inputText id="waveMaxFoods" value="#{foodWaveView.selectedFoodWave.maximumFoods}" />
<h:inputText id="waveMaxFoods"
value="#{foodWaveView.selectedFoodWave.maximumFoods}" />
<h:message for="waveMaxFoods" /> <h:message for="waveMaxFoods" />
<h:outputLabel for="startTime" <h:outputLabel for="startTime" value="#{i18n['foodwavetemplate.startTime']}" />
value="#{i18n['foodwavetemplate.startTime']}" /> <p:calendar id="startTime" value="#{foodWaveView.startDate}" pattern="dd.MM.yyyy HH:mm" />
<p:calendar id="startTime" value="#{foodWaveView.startDate}"
pattern="dd.MM.yyyy HH:mm" />
<h:message for="startTime" /> <h:message for="startTime" />
</h:panelGrid> </h:panelGrid>
<h:commandButton action="#{foodWaveView.createFoodwave()}" <h:commandButton action="#{foodWaveView.createFoodwave()}" value="#{i18n['foodwavetemplate.createFoodwave']}" />
value="#{i18n['foodwavetemplate.createFoodwave']}" />
</p:panel> </p:panel>
</h:form> </h:form>
</ui:define> </ui:define>
......
...@@ -64,6 +64,13 @@ ...@@ -64,6 +64,13 @@
</f:facet> </f:facet>
<h:outputText value="#{foodwave.unpaidCount}" /> <h:outputText value="#{foodwave.unpaidCount}" />
</p:column> </p:column>
<p:column styleClass="text-center">
<f:facet name="header">
<h:outputText value="${i18n['foodWave.deliveredCount']}" />
</f:facet>
<h:outputText value="#{foodwave.deliveredCount}" />
</p:column>
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['foodWave.totalReserved']}" /> <h:outputText value="${i18n['foodWave.totalReserved']}" />
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<h1>#{foodWaveView.selectedFoodWave.name}</h1> <h1>#{foodWaveView.selectedFoodWave.name}</h1>
</ui:define> </ui:define>
<ui:define name="content"> <ui:define name="content">
<h:form> <h:form id="accountEventList">
<p:dataTable styleClass="bordertable" value="#{foodWaveView.accountEventLines}" var="acc_line" sortBy="#{acc_line.user.nick}"> <p:dataTable styleClass="bordertable" value="#{foodWaveView.accountEventLines}" var="acc_line" sortBy="#{acc_line.user.nick}" rowStyleClass="#{acc_line.eventDelivered?'success':null}">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['foodWave.accountevents']}" /> <h:outputLabel value="#{i18n['foodWave.accountevents']}" />
</f:facet> </f:facet>
...@@ -37,15 +37,14 @@ ...@@ -37,15 +37,14 @@
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['acc_line.product']}" /> <h:outputLabel value="#{i18n['acc_line.product']}" />
</f:facet> </f:facet>
<h:outputText value="#{acc_line.product.name}" /> <h:outputText id="foodname" value="#{acc_line.product.name}" />
<p:tooltip rendered="#{acc_line.product.description != null}" for="foodname" value="#{acc_line.product.description}" showEffect="fade" hideEffect="fade" />
</p:column> </p:column>
<p:column sortBy="#{acc_line.user.wholeName}"> <p:column sortBy="#{acc_line.user.wholeName}">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['acc_line.eventuser']}" /> <h:outputLabel value="#{i18n['acc_line.eventuser']}" />
</f:facet> </f:facet>
<h:link outcome="/useradmin/edit" value="#{acc_line.user.wholeName}"> <h:outputText outcome="/useradmin/edit" value="#{acc_line.user.wholeName}" />
<f:param name="userid" value="#{acc_line.user.id}" />
</h:link>
</p:column> </p:column>
<p:column sortBy="#{acc_line.user.nick}"> <p:column sortBy="#{acc_line.user.nick}">
<f:facet name="header"> <f:facet name="header">
...@@ -60,7 +59,7 @@ ...@@ -60,7 +59,7 @@
<h:outputLabel value="#{i18n['accountEvent.delivered']}" /> <h:outputLabel value="#{i18n['accountEvent.delivered']}" />
</f:facet> </f:facet>
<h:outputText rendered="#{acc_line.eventDelivered}" value="#{i18n['accountEvent.delivered']}" /> <h:outputText rendered="#{acc_line.eventDelivered}" value="#{i18n['accountEvent.delivered']}" />
<h:commandButton rendered="#{not acc_line.eventDelivered}" value="#{i18n['accountEvent.deliver']}" action="#{foodWaveView.deliverAccountEvent}" /> <p:commandButton rendered="#{not acc_line.eventDelivered}" value="#{i18n['accountEvent.deliver']}" actionListener="#{foodWaveView.deliverAccountEvent}" update=":billList :accountEventList" />
</p:column> </p:column>
</p:dataTable> </p:dataTable>
...@@ -68,99 +67,126 @@ ...@@ -68,99 +67,126 @@
<br></br> <br></br>
<br></br> <br></br>
<h:form> <h:form id="billList">
<p:dataTable styleClass="bordertable" value="#{foodWaveView.billLines}" var="bill_line" sortBy="#{bill_line.bill.user.nick}">
<h:outputText rendered="#{foodWaveView.selectedFoodWave.paymentOver}" value="#{i18n['foodwave.closed']}" styleClass="notify" />
<p:dataTable styleClass="bordertable" value="#{foodWaveView.bills}" var="bill" sortBy="#{bill.user.nick}" rowStyleClass="#{bill.expired ? 'expired' : null}">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['foodWave.billLines']}" /> <h:outputLabel value="#{i18n['foodWave.billLines']}" />
</f:facet> </f:facet>
<p:column sortBy="#{bill_line.bill.sentDate.getTime()}"> <p:column sortBy="#{bill.sentDate.getTime()}">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['billLine.time']}" /> <h:outputLabel value="#{i18n['billLine.time']}" />
</f:facet> </f:facet>
<h:outputText value="#{bill_line.bill.sentDate.getTime()}"> <h:outputText value="#{bill.sentDate.getTime()}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</p:column> </p:column>
<p:column sortBy="#{bill_line.quantity}"> <p:column sortBy="#{bill.totalQuantity}">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['billLine.quantity']}" /> <h:outputLabel value="#{i18n['billLine.quantity']}" />
</f:facet> </f:facet>
<h:outputText style="text-align: center;" value="#{bill_line.quantity}"> <h:outputText style="text-align: center;" value="#{bill.totalQuantity}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" /> <f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText> </h:outputText>
</p:column> </p:column>
<p:column sortBy="#{bill_line.name}"> <p:column sortBy="#{billLine.eventuser}">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['billLine.product']}" /> <h:outputLabel value="#{i18n['bill.products']}" />
</f:facet> </f:facet>
<h:outputText value="#{bill_line.name}" /> <h:outputText value="#{bill.productSummary}" />
</p:column> </p:column>
<p:column sortBy="#{bill_line.bill.user.wholeName}"> <p:column sortBy="#{bill.user.wholeName}">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['billLine.eventuser']}" /> <h:outputLabel value="#{i18n['billLine.eventuser']}" />
</f:facet> </f:facet>
<h:link outcome="/useradmin/edit" value="#{bill_line.bill.user.wholeName}"> <h:outputText outcome="/useradmin/edit" value="#{bill.user.wholeName}" />
<f:param name="userid" value="#{bill_line.bill.user.user.id}" />
</h:link>
</p:column> </p:column>
<p:column sortBy="#{bill_line.bill.user.nick}"> <p:column sortBy="#{bill.user.user.id}">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['billLine.nick']}" /> <h:outputLabel value="#{i18n['billLine.nick']}" />
</f:facet> </f:facet>
<h:link outcome="/useradmin/edit" value="#{bill_line.bill.user.nick}"> <h:link outcome="/useradmin/edit" value="#{bill.user.nick}">
<f:param name="userid" value="#{bill_line.bill.user.user.id}" /> <f:param name="userid" value="#{bill.user.user.id}" />
</h:link> </h:link>
</p:column> </p:column>
<p:column sortBy="#{bill_line.linePrice}"> <p:column sortBy="#{bill.totalPrice}">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['billLine.price']}" /> <h:outputLabel value="#{i18n['bill.totalprice']}" />
</f:facet> </f:facet>
<h:outputText style="text-align: center;" value="#{bill_line.linePrice}"> <h:outputText style="text-align: center;" value="#{bill.totalPrice}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" /> <f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText> </h:outputText>
</p:column> </p:column>
<p:column>
<p:outputPanel rendered="#{bill.user.accountBalance ge bill.totalPrice}">
<p:commandButton rendered="#{not bill.expired and not foodWaveView.selectedFoodWave.paymentOver}" id="buyCreditsButton" onerror="location.reload(true);" value="#{i18n['bill.markPaid.credits']}" actionListener="#{foodWaveView.markBillPaidWithCredits}" update=":billList :accountEventList" />
<p:commandButton rendered="#{bill.expired or foodWaveView.selectedFoodWave.paymentOver}" value="#{i18n['bill.markPaid.credits']}" actionListener="#{foodWaveView.markBillPaidWithCredits}" update=":billList :accountEventList">
<p:confirm header="Confirmation" message="#{i18n['confirmation.message']}" icon="ui-icon-alert" />
</p:commandButton>
</p:outputPanel>
<p:commandButton rendered="#{not bill.expired and not foodWaveView.selectedFoodWave.paymentOver}" value="#{i18n['bill.markPaid.cash']}" actionListener="#{foodWaveView.markBillPaid}" update=":billList :accountEventList" />
<p:commandButton rendered="#{bill.expired or foodWaveView.selectedFoodWave.paymentOver}" value="#{i18n['bill.markPaid.cash']}" actionListener="#{foodWaveView.markBillPaid}" update=":billList :accountEventList">
<p:confirm header="Confirmation" message="#{i18n['confirmation.message']}" icon="ui-icon-alert" />
</p:commandButton>
<p:column sortBy="#{bill_line.bill.totalPrice}">
<f:facet name="header">
<h:outputLabel value="#{i18n['bill.totalprice']}" />
</f:facet>
<h:outputText style="text-align: center;" value="#{bill_line.bill.totalPrice}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText>
</p:column> </p:column>
<p:column> <p:column>
<h:commandButton value="#{i18n['bill.markPaid']}" action="#{foodWaveView.markBillPaid}" /> <p:commandButton rendered="#{not bill.expired}" id="removeBill" value="#{i18n['foodwave.cancelOrder']}" actionListener="#{foodWaveView.markBillExpired}" update=":billList :accountEventList">
<p:confirm header="Confirmation" message="#{i18n['confirmation.message']}" icon="ui-icon-alert" />
</p:commandButton>
</p:column> </p:column>
<!--
<p:column>
<h:commandButton value="#{i18n['bill.remove']}" action="foodWaveView.markBillRemoved" />
</p:column> -->
</p:dataTable> </p:dataTable>
</h:form>
</h:form>
<br />
<br />
<br />
<h2>#{i18n['foodwave.summaryView']}</h2> <h2>#{i18n['foodwave.summaryView']}</h2>
<div> <p:panelGrid columns="2">
<h:outputLabel value="#{i18n['foodwave.price']}: " /> <h:outputLabel value="#{i18n['foodwave.price']}: " />
<h:outputText value="#{foodWaveView.foodwavePrice}" > <h:outputText value="#{foodWaveView.foodwavePrice}" style="font-weight: bold">
<f:convertNumber minFractionDigits="0"/> <f:convertNumber minFractionDigits="0" />
</h:outputText> </h:outputText>
</div>
<div>
<h:outputLabel value="#{i18n['foodwave.foodwaveBuyInPrice']}: " /> <h:outputLabel value="#{i18n['foodwave.foodwaveBuyInPrice']}: " />
<h:outputText value="#{foodWaveView.foodwaveBuyInPrice}" > <h:outputText value="#{foodWaveView.foodwaveBuyInPrice}" style="font-weight: bold">
<f:convertNumber minFractionDigits="0"/> <f:convertNumber minFractionDigits="0" />
</h:outputText> </h:outputText>
</div>
<h:outputLabel value="#{i18n['foodwave.ordersBefore']}: " />
<h:outputText value="#{foodWaveView.selectedFoodWave.time}" style="font-weight: bold">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
<h:outputLabel value="#{i18n['foodwave.foodwaveLastBillPayTime']}: " />
<h:outputText value="#{foodWaveView.selectedFoodWave.lastPaymentTime}" style="font-weight: bold">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
</p:panelGrid>
<p:dataTable var="summ" value="#{foodWaveView.productSummaries}"> <p:dataTable var="summ" value="#{foodWaveView.productSummaries}">
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['product.name']}" /> <h:outputLabel value="#{i18n['product.name']}" />
</f:facet> </f:facet>
<h:outputText value="#{summ.product.name}" /> <h:outputText id="productName" value="#{summ.product.name}" />
<p:tooltip rendered="#{summ.product.description != null}" for="productName" value="#{summ.product.description}" showEffect="fade" hideEffect="fade" />
</p:column> </p:column>
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
<ui:define name="content"> <ui:define name="content">
<!-- products:shop commitaction="#{foodWaveFoodView.commitShoppingCart()}" items="#{foodWaveFoodView.shoppingcart}" commitValue="#{i18n['productshop.commit']}" /--> <!-- products:shop commitaction="#{foodWaveFoodView.commitShoppingCart()}" items="#{foodWaveFoodView.shoppingcart}" commitValue="#{i18n['productshop.commit']}" /-->
<foodwave:listFoods selectaction="#{foodWaveFoodView.buyFromCounter()}" <foodwave:listFoods selectaction="#{foodWaveFoodView.buyFromInternet()}" items="#{foodWaveFoodView.shoppingcart}" commitValue="foodshop.buyProceedToPay"/>
items="#{foodWaveFoodView.shoppingcart}" commitValue="foodshop.buyFromCounter"/>
</ui:define> </ui:define>
......
<!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:reader="http://java.sun.com/jsf/composite/cditools/reader" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui">
>
<h:body>
<ui:composition template="/resources/templates/#{sessionHandler.infoscreen}/template.xhtml">
<f:metadata>
<f:viewParam name="foodwaveid" value="#{foodWaveFoodView.foodwaveid}" />
<f:viewParam name="userid" value="#{flowFoodwaveView.userId}" />
<f:event type="preRenderView" listener="#{flowFoodwaveView.initFoodsView}" />
</f:metadata>
<ui:define name="content">
<reader:backendReader selectvalue="#{i18n['barcodeReader.readBarcode']}" selectaction="#{flowFoodwaveView.polledRead}" />
<h:form>
<p:autoComplete id="acsb" value="#{infoView.multiSearchUser}" completeMethod="#{infoView.matchMulti}" converter="#{eventUserConverter}" var="usrx" itemLabel="#{usrx.shortUserDescriptor}" itemValue="#{usrx}">
<p:ajax event="itemSelect" listener="#{flowFoodwaveView.changeUser}" />
</p:autoComplete>
</h:form>
<br /><br />
<h1>Shop to user: #{userView.selectedUser.user.nick}</h1>
<br /><br />
<foodwave:listFoods selectaction="#{foodWaveFoodView.buyAndPay}" selectCreditsAction="#{foodWaveFoodView.buyAndPayWithCredits}" items="#{foodWaveFoodView.shoppingcart}" commitValue="foodshop.buyAndPay" commitCreditsValue="foodshop.buyAndPayWithCredits"/>
</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"
xmlns:reader="http://java.sun.com/jsf/composite/cditools/reader"
xmlns:p="http://primefaces.org/ui">
<h:body>
<ui:composition
template="/resources/templates/#{sessionHandler.infoscreen}/template.xhtml">
<f:metadata>
<f:viewParam name="userid" value="#{flowFoodwaveView.userId}" />
<f:viewParam name="templateid" value="#{foodWaveView.templateId}" />
<f:event type="preRenderView" listener="#{flowFoodwaveView.initView}" />
</f:metadata>
<ui:define name="content">
<reader:backendReader selectvalue="#{i18n['barcodeReader.readBarcode']}" selectaction="#{flowFoodwaveView.polledRead}" />
<h:form>
<p:autoComplete id="acsb" value="#{infoView.multiSearchUser}" completeMethod="#{infoView.matchMulti}" converter="#{eventUserConverter}" var="usrx" itemLabel="#{usrx.shortUserDescriptor}" itemValue="#{usrx}">
<p:ajax event="itemSelect" listener="#{flowFoodwaveView.changeUser}" />
</p:autoComplete>
</h:form>
<br /><br />
<h1>Shop to user: #{userView.selectedUser.user.nick}</h1>
<br /><br />
<foodwave:list outcome="/info/foodwave/foodwaveProducts"/>
</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:c="http://java.sun.com/jsp/jstl/core" xmlns:products="http://java.sun.com/jsf/composite/tools/products"
xmlns:foodwave="http://java.sun.com/jsf/composite/tools"
xmlns:p="http://primefaces.org/ui"
>
<h:body>
<ui:composition template="#{sessionHandler.template}">
<ui:define name="content">
Sisällä: <p:outputLabel value="#{basicStatisticsView.groupMembershipsEnteredCount} / #{basicStatisticsView.groupMembershipsTotalCount}" /><br />
Korttei: <p:outputLabel value="#{basicStatisticsView.cardDeliveredCount}" />
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<h:outputText value="${i18n['bill.sentDate']}" /> <h:outputText value="${i18n['bill.sentDate']}" />
</f:facet> </f:facet>
<h:outputText value="#{bill.sentDateTime}"> <h:outputText value="#{bill.sentDateTime}">
<f:convertDateTime pattern="#{sessionHandler.dateFormat}" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</p:column> </p:column>
<p:column> <p:column>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<h:link rendered="#{not foodwave.isFull()}" outcome="#{cc.attrs.outcome}" value="#{foodwave.name}"> <h:link rendered="#{not foodwave.isFull()}" outcome="#{cc.attrs.outcome}" value="#{foodwave.name}">
<f:param name="foodwaveid" value="#{foodwave.id}" /> <f:param name="foodwaveid" value="#{foodwave.id}" />
<f:param name="userid" value="#{userView.getCurrentUser().user.id}" /> <f:param name="userid" value="#{userView.selectedUser.user.id}" />
</h:link> </h:link>
<h:outputText rendered="#{foodwave.isFull()}" value="#{foodwave.name}" /> <h:outputText rendered="#{foodwave.isFull()}" value="#{foodwave.name}" />
......
...@@ -15,13 +15,14 @@ ...@@ -15,13 +15,14 @@
<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:attribute name="selectCreditsAction" method-signature="java.lang.String action()" />
</composite:interface> </composite:interface>
<composite:implementation> <composite:implementation>
<h:outputScript library="primefaces" name="jquery/jquery.js" /> <h:outputScript library="primefaces" name="jquery/jquery.js" />
<h:form> <h:form styleClass="foodformselector">
<p:dataTable columnClasses="nowrap,numalign,numalign,nowrap,numalign" <p:dataTable columnClasses="nowrap,numalign,numalign,nowrap,numalign"
styleClass="bordertable" value="#{cc.attrs.items}" var="cart"> styleClass="bordertable" value="#{cc.attrs.items}" var="cart">
<!-- p:column> <!-- p:column>
...@@ -54,6 +55,17 @@ ...@@ -54,6 +55,17 @@
</p:column> </p:column>
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['product.description']}" />
</f:facet>
<h:outputText id="description" value="#{cart.product.description}" />
<p:tooltip rendered="#{cart.product.name != null}" for="description" value="#{cart.product.name}" showEffect="fade" hideEffect="fade" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['product.price']}" /> <h:outputText value="${i18n['product.price']}" />
</f:facet> </f:facet>
<h:outputText id="price" value="#{cart.product.price.abs()}"> <h:outputText id="price" value="#{cart.product.price.abs()}">
...@@ -73,28 +85,30 @@ ...@@ -73,28 +85,30 @@
<h:outputText id="count" value="${i18n['product.cart.count']}" /> <h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet> </f:facet>
<h:commandButton action="#{foodWaveFoodView.addMinusOne}" <p:commandButton actionListener="#{foodWaveFoodView.addMinusOne}" update="@(.foodformselector)"
value="#{i18n['productshop.minusOne']}"> value="#{i18n['productshop.minusOne']}" />
<f:ajax render="@form" />
</h:commandButton>
<h:inputText size="4" id="cartcount" value="#{cart.count}"> <h:inputText size="4" id="cartcount" value="#{cart.count}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="0" /> <f:convertNumber maxFractionDigits="2" minFractionDigits="0" />
</h:inputText> </h:inputText>
<h:commandButton action="#{foodWaveFoodView.addOne}" <p:commandButton actionListener="#{foodWaveFoodView.addOne}" update="@(.foodformselector)"
value="#{i18n['productshop.plusOne']}"> value="#{i18n['productshop.plusOne']}" />
<f:ajax render="@form" />
</h:commandButton>
</p:column> </p:column>
</p:dataTable> </p:dataTable>
<div> <div>
<h:outputLabel for="total" value="#{i18n['foodshop.total']}: "/> <h:outputLabel for="total" value="#{i18n['foodshop.total']}: "/>
<h:outputText id="total" value="#{foodWaveFoodView.totalPrice}" > <h:outputText id="total" value="#{foodWaveFoodView.totalPrice}" style="font-weight: bold;" >
<f:convertNumber minFractionDigits="0" maxFractionDigits="2" /> <f:convertNumber minFractionDigits="0" maxFractionDigits="2" />
</h:outputText> </h:outputText>
</div> </div>
<h:commandButton action="#{cc.attrs.selectaction}" value="#{i18n[cc.attrs.commitValue]}" /> <br />
<h:commandButton action="#{foodWaveFoodView.buyFromInternet}" value="#{i18n['foodshop.buyFromInternet']}" />
<p:commandButton action="#{cc.attrs.selectaction}" value="#{i18n[cc.attrs.commitValue]}" ajax="false" />
<br />
<p:commandButton rendered="#{foodWaveFoodView.totalPrice le userView.selectedUser.accountBalance and not empty cc.attrs.selectCreditsAction}" action="#{cc.attrs.selectCreditsAction}" value="#{i18n[cc.attrs.commitCreditsValue]}" ajax="false" />
<!-- <h:commandButton action="#{foodWaveFoodView.buyFromInternet}" value="#{i18n['foodshop.buyFromInternet']}" /> -->
</h:form> </h:form>
......
...@@ -27,8 +27,8 @@ xmlns:reader="http://java.sun.com/jsf/composite/cditools/reader" ...@@ -27,8 +27,8 @@ xmlns:reader="http://java.sun.com/jsf/composite/cditools/reader"
<h:panelGroup id="reader_autopoll"> <h:panelGroup id="reader_autopoll">
<p:poll rendered="#{readerView.pollingMode}" interval="2" listener="#{cc.attrs.selectaction}" onerror="location.reload();" /> <p:poll rendered="#{readerView.pollingMode}" interval="2" listener="#{cc.attrs.selectaction}" onerror="location.reload();" />
</h:panelGroup> </h:panelGroup>
readerid:
#{readerNameContainer.readerId}
<p:dataTable rendered="#{empty readerNameContainer.readerId}" border="1" id="reader" value="#{readerListDataView.readers}" var="rr"> <p:dataTable rendered="#{empty readerNameContainer.readerId}" border="1" id="reader" value="#{readerListDataView.readers}" var="rr">
<p:column> <p:column>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<p:panelGrid columns="1" cellpadding="1"> <p:panelGrid columns="1" cellpadding="1">
<ui:fragment rendered="#{not empty userView.selectedUser.id}"> <ui:fragment rendered="#{not empty userView.selectedUser.id}">
<p:dialog id="chartPanel" for="webcamButton" modal="true" dynamic="true" widgetVar="webcamDialog"> <p:dialog id="chartPanel" for="webcamButton" dynamic="true" widgetVar="webcamDialog">
<p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" /> <p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" />
<p:commandButton type="button" value="Capture" onclick="PF('pc').capture()" onerror="location.reload(true);" /> <p:commandButton type="button" value="Capture" onclick="PF('pc').capture()" onerror="location.reload(true);" />
</p:dialog> </p:dialog>
......
...@@ -64,6 +64,8 @@ body { ...@@ -64,6 +64,8 @@ body {
list-style: none; list-style: none;
} }
#top-menu li a { #top-menu li a {
display: block; display: block;
line-height: 1.7em; line-height: 1.7em;
...@@ -270,18 +272,14 @@ label { ...@@ -270,18 +272,14 @@ label {
.bgColor1 { .bgColor1 {
background-color: #68A3C2; background-color: #68A3C2;
} }
/*
#header { #header {
clear: both; clear: both;
float: left; float: left;
width: 100%; width: 100%;
border-bottom: 4px solid #333; border-bottom: 4px solid #333;
} }*/
#header a {
color: white;
text-decoration: none;
}
#header_left { #header_left {
float: left; float: left;
......
...@@ -174,7 +174,7 @@ a.shopItem:active { ...@@ -174,7 +174,7 @@ a.shopItem:active {
color: #666600; color: #666600;
} }
.expired { .expired, .closed {
color: #c0c0c0; color: #c0c0c0;
} }
...@@ -186,6 +186,10 @@ a.shopItem:active { ...@@ -186,6 +186,10 @@ a.shopItem:active {
color: red; color: red;
} }
.notify {
color: red;
}
.success { .success {
color: #006600; color: #006600;
} }
...@@ -223,4 +227,7 @@ a.shopItem:active { ...@@ -223,4 +227,7 @@ a.shopItem:active {
padding-left: 40px !important; padding-left: 40px !important;
} }
.hidden {
display: none !important;
visibility: hidden;
}
...@@ -278,10 +278,7 @@ label { ...@@ -278,10 +278,7 @@ label {
border-bottom: 4px solid #333; border-bottom: 4px solid #333;
} }
#header a {
color: white;
text-decoration: none;
}
#header_left { #header_left {
float: left; float: left;
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
<ui:define name="content"> <ui:define name="content">
<!-- products:shop commitaction="#{foodWaveFoodView.commitShoppingCart()}" items="#{foodWaveFoodView.shoppingcart}" commitValue="#{i18n['productshop.commit']}" /--> <!-- products:shop commitaction="#{foodWaveFoodView.commitShoppingCart()}" items="#{foodWaveFoodView.shoppingcart}" commitValue="#{i18n['productshop.commit']}" /-->
<foodwave:listFoods selectaction="#{foodWaveFoodView.buyAndPay}"
items="#{foodWaveFoodView.shoppingcart}" commitValue="foodshop.buyAndPay"/> <foodwave:listFoods selectaction="#{foodWaveFoodView.buyAndPay}" selectCreditsAction="#{foodWaveFoodView.buyAndPayWithCredits}" items="#{foodWaveFoodView.shoppingcart}" commitValue="foodshop.buyAndPay" commitCreditsValue="foodshop.buyAndPayWithCredits"/>
</ui:define> </ui:define>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<configuration> <configuration>
<warSourceDirectory>WebContent</warSourceDirectory> <warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<packagingIncludes>WEB-INF/lib/javamelody-core*,WEB-INF/lib/primefaces*,**/*.xml,**/*.xhtml,**/*.properties,**/*.class,**/*.png,**/*.css,**/*.js,resources/*</packagingIncludes> <packagingIncludes>WEB-INF/lib/javamelody-core*,WEB-INF/lib/primefaces*,WEB-INF/lib/*-1.0.8.jar,**/*.xml,**/*.xhtml,**/*.properties,**/*.class,**/*.png,**/*.css,**/*.js,resources/*</packagingIncludes>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
...@@ -32,9 +32,19 @@ ...@@ -32,9 +32,19 @@
<dependency> <dependency>
<groupId>org.primefaces</groupId> <groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId> <artifactId>primefaces</artifactId>
<version>5.0</version> <version>5.1</version>
</dependency>
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.8</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>net.matlux</groupId>
<artifactId>jvm-breakglass</artifactId>
<version>0.0.7</version>
</dependency> </dependency>
</dependencies> </dependencies>
<parent> <parent>
<groupId>fi.codecrew.moya</groupId> <groupId>fi.codecrew.moya</groupId>
......
package fi.codecrew.moya;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class LoggingContextFilter implements Filter {
public LoggingContextFilter() {
// TODO Auto-generated constructor stub
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
// TODO Auto-generated method stub
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
// TODO Auto-generated method stub
}
@Override
public void destroy() {
// TODO Auto-generated method stub
}
}
package fi.codecrew.moya;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Allows defining a filter in web.xml so, that deployment doesn't blow up if
* the class is not found. E.g. Logback specific filters when logback is a
* provided dependency.
*
* @author jkj
*
*/
public class RobustFilterProxy implements Filter {
Logger log = LoggerFactory.getLogger(RobustFilterProxy.class);
private Filter wrapped = null;
public RobustFilterProxy() {
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
try {
String filterClassName = filterConfig.getInitParameter("wrapped-class");
if (filterClassName == null) {
throw new ServletException("wrapped-class init-param required");
}
log.info("Wrapped class: " + filterClassName);
Class<?> wrappedFilterClass = this.getClass().getClassLoader().loadClass(filterClassName);
// Class<?> wrapperFilterClass = Class.forName(filterClassName);
log.debug("Wrapped filter class: " + wrappedFilterClass);
wrapped = (Filter) wrappedFilterClass.newInstance();
log.debug("Wrapped filter instance: " + wrapped);
wrapped.init(filterConfig);
} catch (ClassNotFoundException e) {
log.warn("Wrapped filter class not found", e);
} catch (InstantiationException e) {
log.warn("Could not instantiate wrapper filter class", e);
} catch (IllegalAccessException e) {
log.warn("Could not wrap filter", e);
}
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
if (wrapped != null) {
// Use the wrapped filter if available.
wrapped.doFilter(request, response, chain);
} else {
// Otherwise just work as a no-op filter calling the next filter in
// chain.
chain.doFilter(request, response);
}
}
@Override
public void destroy() {
if (wrapped != null) {
wrapped.destroy();
}
wrapped = null;
}
}
package fi.codecrew.moya.management;
import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.UnavailableException;
import javax.servlet.annotation.WebServlet;
import net.matlux.NreplServer;
// XXX: The annotation did not cause the servlet to start. Thus the servlet is also defined in web.xml.
@WebServlet(loadOnStartup = 5, name = "repl-servlet")
public class ReplServlet implements Servlet {
private static final int NREPL_DEFAULT_PORT = 1112;
private NreplServer nreplServer;
private ServletConfig servletConfig;
@Override
public void init(ServletConfig config) throws ServletException {
servletConfig = config;
int port = NREPL_DEFAULT_PORT;
String portStr = config.getInitParameter("port");
if (portStr != null) {
port = Integer.parseInt(portStr);
}
nreplServer = new NreplServer(port);
}
@Override
public ServletConfig getServletConfig() {
return servletConfig;
}
@Override
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
throw new UnavailableException("This servlet doesn't really serve.");
}
@Override
public String getServletInfo() {
return "REPL Servlet for introspecting the JVM";
}
public NreplServer getNreplServer() {
return nreplServer;
}
@Override
public void destroy() {
if (nreplServer != null) {
nreplServer.stop();
}
}
}
...@@ -31,8 +31,12 @@ bill.billNumber = Number ...@@ -31,8 +31,12 @@ bill.billNumber = Number
bill.cancel = Cancel bill bill.cancel = Cancel bill
bill.expires = Expires bill.expires = Expires
bill.isExpired = Bill is expired bill.isExpired = Bill is expired
bill.markPaid.cash = Maksa k\u00E4teisell\u00E4
bill.markPaid.cashOrCredit = K\u00E4teisell\u00E4 vai krediiteill\u00E4?
bill.markPaid.credits = Maksa krediiteill\u00E4
bill.markPaid.show = Show Mark paid -buttons bill.markPaid.show = Show Mark paid -buttons
bill.notes.title = Lis\u00E4tietoja bill.notes.title = Lis\u00E4tietoja
bill.products = Tuotteet
bill.save = Save bill.save = Save
bill.showPayButtons = Show pay buttons bill.showPayButtons = Show pay buttons
...@@ -118,6 +122,8 @@ cardTemplate.emptyCardTemplate = ---- ...@@ -118,6 +122,8 @@ cardTemplate.emptyCardTemplate = ----
code.inputfield = Sy\u00F6t\u00E4 viivakoodi code.inputfield = Sy\u00F6t\u00E4 viivakoodi
confirmation.message = Oletko varma?
create = Luo create = Luo
delete = Poista delete = Poista
...@@ -159,8 +165,19 @@ eventorg.create = Create ...@@ -159,8 +165,19 @@ eventorg.create = Create
eventorg.title = Tapahtuman tiedot eventorg.title = Tapahtuman tiedot
foodWave.closeNow = Close now foodWave.closeNow = Close now
foodWave.deliveredCount = Luovutetut
foodWave.openNow = Open now foodWave.openNow = Open now
foodshop.buyAndPayWithCredits = Varaa ja maksa krediiteill\u00E4
foodshop.buyProceedToPay = Varaa ja siirry maksamaan
foodshop.canBuyToCounter = Voit maksaa t\u00E4m\u00E4n ruokatilauksen my\u00F6s infotiskille. Mik\u00E4li haluat tehd\u00E4 n\u00E4in, voit sulkea t\u00E4m\u00E4n ikkunan ja tulla infotiskille maksamaan tilauksen.
foodwave.cancelOrder = Peruuta
foodwave.closed = Ruokatilaus on suljettu
foodwave.foodwaveLastBillPayTime = Maksut viimeist\u00E4\u00E4n
foodwave.ordersBefore = Tilaukset ennen
foodwave.template.waitPaymentsMinutes = Verkkomaksujen odotusaika
game.active = Aktiivinen game.active = Aktiivinen
game.codecount = Avattuja game.codecount = Avattuja
game.codes.available = Lisenssikoodit game.codes.available = Lisenssikoodit
...@@ -313,6 +330,7 @@ poll.edit = edit ...@@ -313,6 +330,7 @@ poll.edit = edit
print = Print print = Print
product.description = Kuvaus
product.providedRole = Product defines role product.providedRole = Product defines role
product.returnProductEdit = Return to product: product.returnProductEdit = Return to product:
product.saved = Product saved product.saved = Product saved
...@@ -347,18 +365,22 @@ submenu.NotImplementedYet = Not implemented ...@@ -347,18 +365,22 @@ submenu.NotImplementedYet = Not implemented
submenu.admin.adduser = K\u00E4ytt\u00E4j\u00E4nlis\u00E4ys submenu.admin.adduser = K\u00E4ytt\u00E4j\u00E4nlis\u00E4ys
submenu.admin.adduser.index = K\u00E4ytt\u00E4j\u00E4nlis\u00E4ys submenu.admin.adduser.index = K\u00E4ytt\u00E4j\u00E4nlis\u00E4ys
submenu.frontpage = Frontpage submenu.frontpage = Frontpage
submenu.info.foodwave.foodwaveshop = Ruokakauppa
submenu.info.incoming = Sis\u00E4\u00E4ntulo submenu.info.incoming = Sis\u00E4\u00E4ntulo
submenu.info.index = Infon\u00E4kym\u00E4 submenu.info.index = Infon\u00E4kym\u00E4
submenu.info.shop = Kauppa submenu.info.shop = Kauppa
submenu.lectureadmin.lectureParticipants = Tarkastele osallistujia submenu.lectureadmin.lectureParticipants = Tarkastele osallistujia
submenu.lectureadmin.manageLectureGroups = Hallinnoi submenu.lectureadmin.manageLectureGroups = Hallinnoi
submenu.lectures.viewLectures = Ilmoittaudu submenu.lectures.viewLectures = Ilmoittaudu
submenu.reports.basicStatistics = Tilastoja
subnavi.cards = \u0009\u0009 subnavi.cards = \u0009\u0009
subnavi.info = Info subnavi.info = Info
success = Onnistui success = Onnistui
suffix.minutes = min
topnavi.adminlectures = Kurssit ja luennot topnavi.adminlectures = Kurssit ja luennot
topnavi.license = Lisenssikoodit topnavi.license = Lisenssikoodit
topnavi.userlectures = Kurssit ja luennot topnavi.userlectures = Kurssit ja luennot
......
...@@ -77,6 +77,9 @@ bill.expires = Expires ...@@ -77,6 +77,9 @@ bill.expires = Expires
bill.isExpired = Bill is expired bill.isExpired = Bill is expired
bill.isPaid = Paid bill.isPaid = Paid
bill.markPaid = Mark paid bill.markPaid = Mark paid
bill.markPaid.cash = Buy with cash
bill.markPaid.cashOrCredit = Cash or credit?
bill.markPaid.credits = Buy with credits
bill.markPaid.show = Show Mark paid -buttons bill.markPaid.show = Show Mark paid -buttons
bill.markedPaid = Bill marked paid bill.markedPaid = Bill marked paid
bill.notes = Notes bill.notes = Notes
...@@ -88,6 +91,7 @@ bill.payer = Payer ...@@ -88,6 +91,7 @@ bill.payer = Payer
bill.paymentTime = Payment time bill.paymentTime = Payment time
bill.paymentTime.now = Now bill.paymentTime.now = Now
bill.printBill = Print bill bill.printBill = Print bill
bill.products = Products
bill.receiverAddress = Receiver address bill.receiverAddress = Receiver address
bill.referenceNumberBase = Reference number base bill.referenceNumberBase = Reference number base
bill.referencenumber = Reference nr. bill.referencenumber = Reference nr.
...@@ -304,6 +308,8 @@ compofile.shaChecksum = SHA checksum ...@@ -304,6 +308,8 @@ compofile.shaChecksum = SHA checksum
compofile.upload = Upload file compofile.upload = Upload file
compofile.uploadTime = Upload time compofile.uploadTime = Upload time
confirmation.message = Are you sure?
content.showContentEditLinks = Show content edit links content.showContentEditLinks = Show content edit links
create = Create create = Create
...@@ -405,8 +411,9 @@ food = Food ...@@ -405,8 +411,9 @@ food = Food
foodWave.accountevents = Accountevents foodWave.accountevents = Accountevents
foodWave.activeFoodWaves = Active Foodwaves foodWave.activeFoodWaves = Active Foodwaves
foodWave.billLines = Pending Online Payments foodWave.billLines = Pending Payments
foodWave.closeNow = Close now foodWave.closeNow = Close now
foodWave.deliveredCount = Delivered
foodWave.deliveredFoodWaves = Delivered Foodwaves foodWave.deliveredFoodWaves = Delivered Foodwaves
foodWave.description = Foodwave description foodWave.description = Foodwave description
foodWave.list = Active Foodwaves foodWave.list = Active Foodwaves
...@@ -425,14 +432,21 @@ foodWave.unconfirmedOrders = Unconfirmed ...@@ -425,14 +432,21 @@ foodWave.unconfirmedOrders = Unconfirmed
foodadmin.editTemplate = Edit foodadmin.editTemplate = Edit
foodshop.buyAndPay = Buy and Pay foodshop.buyAndPay = Buy and Pay
foodshop.buyAndPayWithCredits = Reserve and buy with credits
foodshop.buyFromCounter = Pay at info foodshop.buyFromCounter = Pay at info
foodshop.buyFromInternet = Pay at Internet foodshop.buyFromInternet = Pay at Internet
foodshop.buyProceedToPay = Reserve and continue to buy
foodshop.canBuyToCounter = You can buy this bill on infodesk. If you want to buy this order at the infodesk, you can close this window and come to infodesk to buy this order.
foodshop.total = Total foodshop.total = Total
foodwave.buyInPrice = Buy In Price foodwave.buyInPrice = Buy In Price
foodwave.cancelOrder = Cancel
foodwave.closed = Foodwave is closed
foodwave.foodwaveBuyInPrice = Total buy in price foodwave.foodwaveBuyInPrice = Total buy in price
foodwave.foodwaveLastBillPayTime = Last payments time
foodwave.markPaid = Foodwave marked paid foodwave.markPaid = Foodwave marked paid
foodwave.orders = Foodwave Orders foodwave.orders = Foodwave Orders
foodwave.ordersBefore = Orders before
foodwave.price = Foodwave price foodwave.price = Foodwave price
foodwave.summaryView = Foodwave Summary foodwave.summaryView = Foodwave Summary
foodwave.template.basicinfo = Template Information foodwave.template.basicinfo = Template Information
...@@ -441,6 +455,7 @@ foodwave.template.edit.title = Foodwave Template Editor ...@@ -441,6 +455,7 @@ foodwave.template.edit.title = Foodwave Template Editor
foodwave.template.list.title = Foodwave Templates foodwave.template.list.title = Foodwave Templates
foodwave.template.name = Name foodwave.template.name = Name
foodwave.template.selectproducts = Products foodwave.template.selectproducts = Products
foodwave.template.waitPaymentsMinutes = Webpayments waittime
foodwave.totalCount = Amount foodwave.totalCount = Amount
foodwave.totalPrice = Customer Price foodwave.totalPrice = Customer Price
...@@ -936,6 +951,7 @@ product.color = Color in UI ...@@ -936,6 +951,7 @@ product.color = Color in UI
product.create = Create product product.create = Create product
product.createDiscount = Add volumediscount product.createDiscount = Add volumediscount
product.createLimit = Create product limitation product.createLimit = Create product limitation
product.description = Description
product.edit = edit product.edit = edit
product.inventoryQuantity = Inventory count product.inventoryQuantity = Inventory count
product.name = Name of product product.name = Name of product
...@@ -1170,6 +1186,7 @@ submenu.foodmanager.listFoodwaves = List active foodwaves ...@@ -1170,6 +1186,7 @@ submenu.foodmanager.listFoodwaves = List active foodwaves
submenu.foodwave.list = Foodwaves submenu.foodwave.list = Foodwaves
submenu.foodwave.listTemplates = Food provides submenu.foodwave.listTemplates = Food provides
submenu.index = Frontpage submenu.index = Frontpage
submenu.info.foodwave.foodwaveshop = Foodshop
submenu.info.incoming = Incomingview submenu.info.incoming = Incomingview
submenu.info.index = Infoview submenu.info.index = Infoview
submenu.info.shop = Shop submenu.info.shop = Shop
...@@ -1194,6 +1211,7 @@ submenu.place.placemap = Placemap ...@@ -1194,6 +1211,7 @@ submenu.place.placemap = Placemap
submenu.poll.index = Polls submenu.poll.index = Polls
submenu.product.create = Create product submenu.product.create = Create product
submenu.product.list = List products submenu.product.list = List products
submenu.reports.basicStatistics = Statistics
submenu.role.create = Create role submenu.role.create = Create role
submenu.role.list = Show Roles submenu.role.list = Show Roles
submenu.shop.createBill = Purchase submenu.shop.createBill = Purchase
...@@ -1242,6 +1260,8 @@ subnavi.roles = Roles ...@@ -1242,6 +1260,8 @@ subnavi.roles = Roles
success = Success success = Success
suffix.minutes = min
supernavi.admin = Adminview supernavi.admin = Adminview
supernavi.user = Userview supernavi.user = Userview
......
...@@ -77,6 +77,9 @@ bill.expires = Vanhentuu ...@@ -77,6 +77,9 @@ bill.expires = Vanhentuu
bill.isExpired = Lasku on vanhentunut bill.isExpired = Lasku on vanhentunut
bill.isPaid = Maksettu bill.isPaid = Maksettu
bill.markPaid = Maksettu bill.markPaid = Maksettu
bill.markPaid.cash = Maksa k\u00E4teisell\u00E4
bill.markPaid.cashOrCredit = K\u00E4teisell\u00E4 vai krediiteill\u00E4?
bill.markPaid.credits = Maksa krediiteill\u00E4
bill.markPaid.show = N\u00E4yt\u00E4 Maksettu -napit bill.markPaid.show = N\u00E4yt\u00E4 Maksettu -napit
bill.markedPaid = Lasku merkitty maksetuksi. bill.markedPaid = Lasku merkitty maksetuksi.
bill.notes = Huomioita bill.notes = Huomioita
...@@ -88,6 +91,7 @@ bill.payer = Maksaja ...@@ -88,6 +91,7 @@ bill.payer = Maksaja
bill.paymentTime = Maksuehdot bill.paymentTime = Maksuehdot
bill.paymentTime.now = Heti bill.paymentTime.now = Heti
bill.printBill = Tulosta lasku bill.printBill = Tulosta lasku
bill.products = Tuotteet
bill.receiverAddress = Kauppiaan osoite bill.receiverAddress = Kauppiaan osoite
bill.referenceNumberBase = Viitenumeropohja bill.referenceNumberBase = Viitenumeropohja
bill.referencenumber = Viitenumero bill.referencenumber = Viitenumero
...@@ -305,6 +309,8 @@ compofile.shaChecksum = SHA tarkistesumma ...@@ -305,6 +309,8 @@ compofile.shaChecksum = SHA tarkistesumma
compofile.upload = L\u00E4het\u00E4 tiedosto compofile.upload = L\u00E4het\u00E4 tiedosto
compofile.uploadTime = Tallennusaika compofile.uploadTime = Tallennusaika
confirmation.message = Oletko varma?
content.showContentEditLinks = N\u00E4yt\u00E4 sis\u00E4ll\u00F6nmuokkauslinkit content.showContentEditLinks = N\u00E4yt\u00E4 sis\u00E4ll\u00F6nmuokkauslinkit
create = Luo create = Luo
...@@ -406,8 +412,9 @@ food = Ruoka ...@@ -406,8 +412,9 @@ food = Ruoka
foodWave.accountevents = Maksetut tilaukset foodWave.accountevents = Maksetut tilaukset
foodWave.activeFoodWaves = Aktiiviset Ruokatilaukset foodWave.activeFoodWaves = Aktiiviset Ruokatilaukset
foodWave.billLines = Maksamattomat Verkkomaksut foodWave.billLines = Maksamattomat maksut
foodWave.closeNow = Sulje nyt foodWave.closeNow = Sulje nyt
foodWave.deliveredCount = Toimitetut
foodWave.deliveredFoodWaves = Toimitetut Ruokatilaukset foodWave.deliveredFoodWaves = Toimitetut Ruokatilaukset
foodWave.description = Ruokatilauksen kuvaus foodWave.description = Ruokatilauksen kuvaus
foodWave.list = Ruokatilaukset foodWave.list = Ruokatilaukset
...@@ -426,14 +433,21 @@ foodWave.unconfirmedOrders = Vahvistamattomia ...@@ -426,14 +433,21 @@ foodWave.unconfirmedOrders = Vahvistamattomia
foodadmin.editTemplate = Muokkaa foodadmin.editTemplate = Muokkaa
foodshop.buyAndPay = Varaa ja maksa foodshop.buyAndPay = Varaa ja maksa
foodshop.buyAndPayWithCredits = Varaa ja maksa krediiteill\u00E4
foodshop.buyFromCounter = Maksa infossa foodshop.buyFromCounter = Maksa infossa
foodshop.buyFromInternet = Maksa Internetiss\u00E4 foodshop.buyFromInternet = Maksa Internetiss\u00E4
foodshop.buyProceedToPay = Varaa ja siirry maksamaan
foodshop.canBuyToCounter = Voit maksaa t\u00E4m\u00E4n ruokatilauksen my\u00F6s infotiskille. Mik\u00E4li haluat tehd\u00E4 n\u00E4in, voit sulkea t\u00E4m\u00E4n ikkunan ja tulla infotiskille maksamaan tilauksen.
foodshop.total = Yhteens\u00E4 foodshop.total = Yhteens\u00E4
foodwave.buyInPrice = Sis\u00E4\u00E4nostohinta foodwave.buyInPrice = Sis\u00E4\u00E4nostohinta
foodwave.cancelOrder = Peruuta
foodwave.closed = Ruokatilaus on suljettu
foodwave.foodwaveBuyInPrice = Sis\u00E4\u00E4nostohinta foodwave.foodwaveBuyInPrice = Sis\u00E4\u00E4nostohinta
foodwave.foodwaveLastBillPayTime = Maksut viimeist\u00E4\u00E4n
foodwave.markPaid = Merkitty maksetuksi foodwave.markPaid = Merkitty maksetuksi
foodwave.orders = Maksetut Tilaukset foodwave.orders = Maksetut Tilaukset
foodwave.ordersBefore = Tilaukset ennen
foodwave.price = Tilausten kokonaishinta foodwave.price = Tilausten kokonaishinta
foodwave.summaryView = Ruokatilauksen Yhteenveto foodwave.summaryView = Ruokatilauksen Yhteenveto
foodwave.template.basicinfo = Template Infot foodwave.template.basicinfo = Template Infot
...@@ -442,6 +456,7 @@ foodwave.template.edit.title = Foodwave Template Editori ...@@ -442,6 +456,7 @@ foodwave.template.edit.title = Foodwave Template Editori
foodwave.template.list.title = Ruokatilaus Templatet foodwave.template.list.title = Ruokatilaus Templatet
foodwave.template.name = Nimi foodwave.template.name = Nimi
foodwave.template.selectproducts = Tuotteet foodwave.template.selectproducts = Tuotteet
foodwave.template.waitPaymentsMinutes = Verkkomaksujen odotusaika
foodwave.totalCount = M\u00E4\u00E4r\u00E4 foodwave.totalCount = M\u00E4\u00E4r\u00E4
foodwave.totalPrice = Asiakkaan Hinta foodwave.totalPrice = Asiakkaan Hinta
...@@ -919,6 +934,7 @@ product.color = V\u00E4ri k\u00E4ytt\u00F6liittym\u00E4ss\u00E4 ...@@ -919,6 +934,7 @@ product.color = V\u00E4ri k\u00E4ytt\u00F6liittym\u00E4ss\u00E4
product.create = Luo tuote product.create = Luo tuote
product.createDiscount = Lis\u00E4\u00E4 m\u00E4\u00E4r\u00E4alennus product.createDiscount = Lis\u00E4\u00E4 m\u00E4\u00E4r\u00E4alennus
product.createLimit = Luo tuoterajoite product.createLimit = Luo tuoterajoite
product.description = Kuvaus
product.edit = Muokkaa product.edit = Muokkaa
product.inventoryQuantity = Varastotilanne product.inventoryQuantity = Varastotilanne
product.name = Tuotteen nimi product.name = Tuotteen nimi
...@@ -1150,6 +1166,7 @@ submenu.foodmanager.listFoodwaves = Aktiiviset ruokatilaukset ...@@ -1150,6 +1166,7 @@ submenu.foodmanager.listFoodwaves = Aktiiviset ruokatilaukset
submenu.foodwave.list = Ruokatilaukset submenu.foodwave.list = Ruokatilaukset
submenu.frontpage = Etusivu submenu.frontpage = Etusivu
submenu.index = Etusivu submenu.index = Etusivu
submenu.info.foodwave.foodwaveshop = Ruokakauppa
submenu.info.incoming = Sis\u00E4\u00E4ntulo submenu.info.incoming = Sis\u00E4\u00E4ntulo
submenu.info.index = Infon\u00E4kym\u00E4 submenu.info.index = Infon\u00E4kym\u00E4
submenu.info.shop = Kauppa submenu.info.shop = Kauppa
...@@ -1174,6 +1191,7 @@ submenu.place.placemap = Paikkakartta ...@@ -1174,6 +1191,7 @@ submenu.place.placemap = Paikkakartta
submenu.poll.index = Kyselyt submenu.poll.index = Kyselyt
submenu.product.create = Uusi tuote submenu.product.create = Uusi tuote
submenu.product.list = Listaa tuotteet submenu.product.list = Listaa tuotteet
submenu.reports.basicStatistics = Tilastoja
submenu.role.create = Luo rooli submenu.role.create = Luo rooli
submenu.role.list = N\u00E4yt\u00E4 roolit submenu.role.list = N\u00E4yt\u00E4 roolit
submenu.shop.createBill = Osta tuotteita submenu.shop.createBill = Osta tuotteita
...@@ -1225,6 +1243,8 @@ subnavi.roles = Roolit ...@@ -1225,6 +1243,8 @@ subnavi.roles = Roolit
success = Onnistui success = Onnistui
suffix.minutes = min
supernavi.admin = Yll\u00E4piton\u00E4kym\u00E4 supernavi.admin = Yll\u00E4piton\u00E4kym\u00E4
supernavi.user = K\u00E4ytt\u00E4j\u00E4n\u00E4kym\u00E4 supernavi.user = K\u00E4ytt\u00E4j\u00E4n\u00E4kym\u00E4
......
...@@ -68,6 +68,13 @@ public class ErrorPageView implements Serializable { ...@@ -68,6 +68,13 @@ public class ErrorPageView implements Serializable {
} }
public String getMessage() {
FacesContext context = FacesContext.getCurrentInstance();
Map requestMap = context.getExternalContext().getRequestMap();
Throwable ex = (Throwable) requestMap.get("javax.servlet.error.exception");
return ex.getMessage();
}
public String getStackTraceHash() { public String getStackTraceHash() {
FacesContext context = FacesContext.getCurrentInstance(); FacesContext context = FacesContext.getCurrentInstance();
......
...@@ -44,12 +44,12 @@ public class ReaderListDataView extends GenericCDIView { ...@@ -44,12 +44,12 @@ public class ReaderListDataView extends GenericCDIView {
private static final long serialVersionUID = -601822388844764143L; private static final long serialVersionUID = -601822388844764143L;
@EJB @EJB
private transient ReaderBeanLocal readerbean; private ReaderBeanLocal readerbean;
@Inject @Inject
private transient ReaderNameContainer readerNameContainer; private ReaderNameContainer readerNameContainer;
private transient ListDataModel<Reader> readers; private ListDataModel<Reader> readers;
@SuppressWarnings("unused") @SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(ReaderListDataView.class); private static final Logger logger = LoggerFactory.getLogger(ReaderListDataView.class);
......
...@@ -25,6 +25,9 @@ import java.util.List; ...@@ -25,6 +25,9 @@ import java.util.List;
import javax.enterprise.context.SessionScoped; import javax.enterprise.context.SessionScoped;
import javax.inject.Named; import javax.inject.Named;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Named @Named
@SessionScoped @SessionScoped
public class ReaderNameContainer implements Serializable { public class ReaderNameContainer implements Serializable {
...@@ -34,32 +37,37 @@ public class ReaderNameContainer implements Serializable { ...@@ -34,32 +37,37 @@ public class ReaderNameContainer implements Serializable {
//private Integer readerId; //private Integer readerId;
// handling first user when using via getReaderId and setReaderId; // handling first user when using via getReaderId and setReaderId;
private List<Integer> readers; private final List<Integer> readers = new ArrayList<Integer>();;
private boolean autopoll = false; private boolean autopoll = false;
private static final Logger logger = LoggerFactory.getLogger(ReaderNameContainer.class);
/** /**
* use this function when using readers in "only one reader" -mode * use this function when using readers in "only one reader" -mode
* *
* @return first selected reader, or null if no reader selected * @return first selected reader, or null if no reader selected
*/ */
public Integer getReaderId() { public Integer getReaderId() {
if(getReaders().size() == 0) if (getReaders().size() == 0)
return null; return null;
return readers.get(0); return readers.get(0);
} }
/** /**
* Use this function when using readers in "only one reader" -mode * Use this function when using readers in "only one reader" -mode
* @param readerId to set, or null to clear all readers *
* @param readerId
* to set, or null to clear all readers
*/ */
public void setReaderId(Integer readerId) { public void setReaderId(Integer readerId) {
if(readerId == null) if (readerId == null) {
clearReaders(); clearReaders();
return;
}
if(getReaders().size() == 0) { if (getReaders().isEmpty()) {
getReaders().add(readerId); getReaders().add(readerId);
} else { } else {
getReaders().set(0, readerId); getReaders().set(0, readerId);
...@@ -67,14 +75,12 @@ public class ReaderNameContainer implements Serializable { ...@@ -67,14 +75,12 @@ public class ReaderNameContainer implements Serializable {
} }
public void addReader(Integer readerId) { public void addReader(Integer readerId) {
if(!getReaders().contains(readerId)) { if (readerId != null && !getReaders().contains(readerId)) {
getReaders().add(readerId); getReaders().add(readerId);
} }
} }
public List<Integer> getReaders() { public List<Integer> getReaders() {
if(readers == null)
readers = new ArrayList<Integer>();
return readers; return readers;
} }
...@@ -88,7 +94,7 @@ public class ReaderNameContainer implements Serializable { ...@@ -88,7 +94,7 @@ public class ReaderNameContainer implements Serializable {
} }
public void clearReaders() { public void clearReaders() {
readers = null; readers.clear();
} }
} }
...@@ -59,7 +59,7 @@ public class ReaderView extends GenericCDIView { ...@@ -59,7 +59,7 @@ public class ReaderView extends GenericCDIView {
private ReaderEvent lastReadEvent = null; private ReaderEvent lastReadEvent = null;
private transient ListDataModel<UserCardWrapper> userlist; private ListDataModel<UserCardWrapper> userlist;
private ListDataModel<ReaderEvent> readerEventList; private ListDataModel<ReaderEvent> readerEventList;
private Reader editReader = null; private Reader editReader = null;
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
package fi.codecrew.moya.web.cdiview.shop; package fi.codecrew.moya.web.cdiview.shop;
import java.util.Calendar;
import java.util.List; import java.util.List;
import javax.ejb.EJB; import javax.ejb.EJB;
...@@ -30,6 +31,7 @@ import org.slf4j.LoggerFactory; ...@@ -30,6 +31,7 @@ import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.BillBeanLocal; import fi.codecrew.moya.beans.BillBeanLocal;
import fi.codecrew.moya.beans.CheckoutFiBeanLocal; import fi.codecrew.moya.beans.CheckoutFiBeanLocal;
import fi.codecrew.moya.beans.VerkkomaksutFiBeanLocal; import fi.codecrew.moya.beans.VerkkomaksutFiBeanLocal;
import fi.codecrew.moya.exceptions.BillException;
import fi.codecrew.moya.model.Bill; import fi.codecrew.moya.model.Bill;
import fi.codecrew.moya.util.CheckoutBank; import fi.codecrew.moya.util.CheckoutBank;
import fi.codecrew.moya.util.VerkkomaksutReturnEntry; import fi.codecrew.moya.util.VerkkomaksutReturnEntry;
...@@ -139,4 +141,14 @@ public class BillEditView extends GenericCDIView { ...@@ -139,4 +141,14 @@ public class BillEditView extends GenericCDIView {
bill = billbean.expireBill(bill); bill = billbean.expireBill(bill);
} }
public void buyWithCredits() {
try {
bill = billbean.markPaid(bill, Calendar.getInstance(), true);
} catch (BillException e) {
throw new RuntimeException(e);
// TODO: error handling
}
}
} }
...@@ -26,10 +26,12 @@ import javax.enterprise.context.ConversationScoped; ...@@ -26,10 +26,12 @@ import javax.enterprise.context.ConversationScoped;
import javax.faces.model.ListDataModel; import javax.faces.model.ListDataModel;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import javax.management.RuntimeErrorException;
import fi.codecrew.moya.beans.BillBeanLocal; import fi.codecrew.moya.beans.BillBeanLocal;
import fi.codecrew.moya.bortal.views.BillSummary; import fi.codecrew.moya.bortal.views.BillSummary;
import fi.codecrew.moya.enums.apps.BillPermission; import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.exceptions.BillException;
import fi.codecrew.moya.model.Bill; import fi.codecrew.moya.model.Bill;
import fi.codecrew.moya.model.EventUser; import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.web.annotations.SelectedUser; import fi.codecrew.moya.web.annotations.SelectedUser;
...@@ -95,7 +97,11 @@ public class BillListView extends GenericCDIView { ...@@ -95,7 +97,11 @@ public class BillListView extends GenericCDIView {
public String markPaid() { public String markPaid() {
if (permbean.hasPermission(BillPermission.WRITE_ALL)) { if (permbean.hasPermission(BillPermission.WRITE_ALL)) {
billbean.markPaid(bills.getRowData(), Calendar.getInstance()); try {
billbean.markPaid(bills.getRowData(), Calendar.getInstance(), false);
} catch (BillException x) {
throw new RuntimeException(x);
}
this.addFaceMessage("bill.markedPaid"); this.addFaceMessage("bill.markedPaid");
} else { } else {
......
...@@ -36,6 +36,7 @@ import fi.codecrew.moya.beans.EventBeanLocal; ...@@ -36,6 +36,7 @@ import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.FoodWaveBeanLocal; import fi.codecrew.moya.beans.FoodWaveBeanLocal;
import fi.codecrew.moya.beans.ProductBeanLocal; import fi.codecrew.moya.beans.ProductBeanLocal;
import fi.codecrew.moya.enums.apps.ShopPermission; import fi.codecrew.moya.enums.apps.ShopPermission;
import fi.codecrew.moya.exceptions.BillException;
import fi.codecrew.moya.model.Bill; import fi.codecrew.moya.model.Bill;
import fi.codecrew.moya.model.FoodWave; import fi.codecrew.moya.model.FoodWave;
import fi.codecrew.moya.model.LanEventPropertyKey; import fi.codecrew.moya.model.LanEventPropertyKey;
...@@ -170,10 +171,30 @@ public class FoodWaveFoodView extends GenericCDIView { ...@@ -170,10 +171,30 @@ public class FoodWaveFoodView extends GenericCDIView {
return bill; return bill;
} }
public String buyAndPayWithCredits() {
Bill b = createBillFromShoppingcart();
try {
billBean.markPaid(b, Calendar.getInstance(), true);
} catch (BillException e) {
throw new RuntimeException(e);
}
super.addFaceMessage("foodwave.markPaid");
return "/useradmin/edit";
}
public String buyAndPay() public String buyAndPay()
{ {
Bill b = createBillFromShoppingcart(); Bill b = createBillFromShoppingcart();
billBean.markPaid(b, Calendar.getInstance());
try {
billBean.markPaid(b, Calendar.getInstance(), false);
} catch (BillException e) {
throw new RuntimeException(e);
}
super.addFaceMessage("foodwave.markPaid"); super.addFaceMessage("foodwave.markPaid");
return "/useradmin/edit"; return "/useradmin/edit";
} }
......
...@@ -23,6 +23,7 @@ import java.util.ArrayList; ...@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.TreeSet; import java.util.TreeSet;
...@@ -41,6 +42,7 @@ import fi.codecrew.moya.beans.FoodWaveBeanLocal; ...@@ -41,6 +42,7 @@ import fi.codecrew.moya.beans.FoodWaveBeanLocal;
import fi.codecrew.moya.beans.ProductBeanLocal; import fi.codecrew.moya.beans.ProductBeanLocal;
import fi.codecrew.moya.enums.apps.BillPermission; import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.enums.apps.ShopPermission; import fi.codecrew.moya.enums.apps.ShopPermission;
import fi.codecrew.moya.exceptions.BillException;
import fi.codecrew.moya.model.AccountEvent; import fi.codecrew.moya.model.AccountEvent;
import fi.codecrew.moya.model.Bill; import fi.codecrew.moya.model.Bill;
import fi.codecrew.moya.model.BillLine; import fi.codecrew.moya.model.BillLine;
...@@ -76,12 +78,13 @@ public class FoodWaveView extends GenericCDIView { ...@@ -76,12 +78,13 @@ public class FoodWaveView extends GenericCDIView {
private Date startDate; private Date startDate;
private Product currentProduct; private Product currentProduct;
private ListDataModel<BillLine> billLines; //private ListDataModel<BillLine> billLines;
// private List<BillLine> unpaidBills; // private List<BillLine> unpaidBills;
private Integer foodWaveId; private Integer foodWaveId;
private ListDataModel<AccountEvent> accountEventLines; private ListDataModel<AccountEvent> accountEventLines;
private ListDataModel<FoodWave> foodWaves; private ListDataModel<FoodWave> foodWaves;
private ListDataModel<Bill> bills;
private static final Logger logger = LoggerFactory.getLogger(FoodWaveView.class); private static final Logger logger = LoggerFactory.getLogger(FoodWaveView.class);
public List<Product> getProducts() { public List<Product> getProducts() {
...@@ -107,12 +110,11 @@ public class FoodWaveView extends GenericCDIView { ...@@ -107,12 +110,11 @@ public class FoodWaveView extends GenericCDIView {
if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES)) if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES))
{ {
if (foodWaves == null) { if (foodWaves == null) {
super.beginConversation(); super.beginConversation();
foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
} }
} }
foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
} }
public String createFoodwave() { public String createFoodwave() {
...@@ -175,7 +177,7 @@ public class FoodWaveView extends GenericCDIView { ...@@ -175,7 +177,7 @@ public class FoodWaveView extends GenericCDIView {
public List<FoodwaveProductSummary> getProductSummaries() { public List<FoodwaveProductSummary> getProductSummaries() {
System.out.println("..asdfasdf");
HashMap<Product, FoodwaveProductSummary> pmap = new HashMap<Product, FoodwaveProductSummary>(); HashMap<Product, FoodwaveProductSummary> pmap = new HashMap<Product, FoodwaveProductSummary>();
for (AccountEvent ae : getSelectedFoodWave().getAccountEvents()) { for (AccountEvent ae : getSelectedFoodWave().getAccountEvents()) {
...@@ -222,6 +224,10 @@ public class FoodWaveView extends GenericCDIView { ...@@ -222,6 +224,10 @@ public class FoodWaveView extends GenericCDIView {
return ret.negate(); return ret.negate();
} }
public BigDecimal getFoodwaveBuyInPrice() public BigDecimal getFoodwaveBuyInPrice()
{ {
BigDecimal ret = BigDecimal.ZERO; BigDecimal ret = BigDecimal.ZERO;
...@@ -245,13 +251,56 @@ public class FoodWaveView extends GenericCDIView { ...@@ -245,13 +251,56 @@ public class FoodWaveView extends GenericCDIView {
// ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves()); // ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
// } // }
public String markBillExpired() {
if (permbean.hasPermission(BillPermission.WRITE_ALL) && bills != null && bills.isRowAvailable()) {
Bill b = bills.getRowData();
b = billbean.expireBill(b);
foodWaveId = selectedFoodWave.getId();
selectedFoodWave = null;
bills = null;
initFoodWaveOrderList();
}
return null;
}
public String markBillPaid() { public String markBillPaid() {
if (permbean.hasPermission(BillPermission.WRITE_ALL) && getBillLines().isRowAvailable()) { if (permbean.hasPermission(BillPermission.WRITE_ALL) && bills != null && bills.isRowAvailable()) {
Bill b = getBillLines().getRowData().getBill(); Bill b = bills.getRowData();
b = billbean.markPaid(b, Calendar.getInstance());
try {
b = billbean.markPaid(b, Calendar.getInstance(), false);
} catch (BillException e) {
throw new RuntimeException(e);
}
foodWaveId = selectedFoodWave.getId(); foodWaveId = selectedFoodWave.getId();
selectedFoodWave = null; selectedFoodWave = null;
bills = null;
initFoodWaveOrderList();
}
return null;
}
public String markBillPaidWithCredits() {
if (permbean.hasPermission(BillPermission.WRITE_ALL) && bills != null && bills.isRowAvailable()) {
Bill b = bills.getRowData();
try {
b = billbean.markPaid(b, Calendar.getInstance(), true);
} catch (BillException e) {
throw new RuntimeException(e);
}
foodWaveId = selectedFoodWave.getId();
selectedFoodWave = null;
bills = null;
initFoodWaveOrderList(); initFoodWaveOrderList();
} }
...@@ -259,8 +308,8 @@ public class FoodWaveView extends GenericCDIView { ...@@ -259,8 +308,8 @@ public class FoodWaveView extends GenericCDIView {
} }
public String deliverAccountEvent() { public String deliverAccountEvent() {
if (getAccountEventLines().isRowAvailable()) { if (accountEventLines != null && accountEventLines.isRowAvailable()) {
AccountEvent e = getAccountEventLines().getRowData(); AccountEvent e = accountEventLines.getRowData();
e = productbeanlocal.markDelivered(e, Calendar.getInstance()); e = productbeanlocal.markDelivered(e, Calendar.getInstance());
foodWaveId = selectedFoodWave.getId(); foodWaveId = selectedFoodWave.getId();
selectedFoodWave = null; selectedFoodWave = null;
...@@ -271,26 +320,27 @@ public class FoodWaveView extends GenericCDIView { ...@@ -271,26 +320,27 @@ public class FoodWaveView extends GenericCDIView {
} }
public void initFoodWaveOrderList() { public void initFoodWaveOrderList() {
if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES) && selectedFoodWave == null) {
if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES) && selectedFoodWave == null) {
selectedFoodWave = foodWaveBean.findFoodwave(foodWaveId); selectedFoodWave = foodWaveBean.findFoodwave(foodWaveId);
logger.debug("Got foodwave {} with id {}", selectedFoodWave, foodWaveId); logger.debug("Got foodwave {} with id {}", selectedFoodWave, foodWaveId);
this.setAccountEventLines(new ListDataModel<AccountEvent>(selectedFoodWave.getAccountEvents())); super.beginConversation();
}
List<BillLine> tmpLines = new ArrayList<BillLine>(); HashSet<Bill> billList = new HashSet<Bill>();
for (BillLine line : selectedFoodWave.getBillLines()) { for (BillLine line : getSelectedFoodWave().getBillLines()) {
if (!line.getBill().isPaid()) { if (!line.getBill().isPaid()) {
tmpLines.add(line); billList.add(line.getBill());
} }
} }
setBillLines(new ListDataModel<BillLine>(tmpLines)); bills = new ListDataModel<Bill>(new ArrayList<Bill>(billList));
setAccountEventLines(new ListDataModel<AccountEvent>(selectedFoodWave.getAccountEvents()));
super.beginConversation();
} accountEventLines = new ListDataModel<AccountEvent>(getSelectedFoodWave().getAccountEvents());
} }
...@@ -315,7 +365,6 @@ public class FoodWaveView extends GenericCDIView { ...@@ -315,7 +365,6 @@ public class FoodWaveView extends GenericCDIView {
} }
public FoodWave getSelectedFoodWave() { public FoodWave getSelectedFoodWave() {
// System.out.println("APOFKASFASFASFASFASFASFASFASFASFKJIOJIO");
return selectedFoodWave; return selectedFoodWave;
} }
...@@ -351,13 +400,10 @@ public class FoodWaveView extends GenericCDIView { ...@@ -351,13 +400,10 @@ public class FoodWaveView extends GenericCDIView {
this.foodWaveId = foodWaveId; this.foodWaveId = foodWaveId;
} }
public ListDataModel<BillLine> getBillLines() { public ListDataModel<Bill> getBills() {
return billLines; return bills;
} }
public void setBillLines(ListDataModel<BillLine> billLines) {
this.billLines = billLines;
}
public void setFoodWaves(ListDataModel<FoodWave> foodWaves) { public void setFoodWaves(ListDataModel<FoodWave> foodWaves) {
this.foodWaves = foodWaves; this.foodWaves = foodWaves;
...@@ -371,9 +417,6 @@ public class FoodWaveView extends GenericCDIView { ...@@ -371,9 +417,6 @@ public class FoodWaveView extends GenericCDIView {
return accountEventLines; return accountEventLines;
} }
public void setAccountEventLines(ListDataModel<AccountEvent> accountEventLines) {
this.accountEventLines = accountEventLines;
}
/* /*
* public List<BillLine> getUnpaidBills() { return unpaidBills; } * public List<BillLine> getUnpaidBills() { return unpaidBills; }
......
...@@ -115,7 +115,7 @@ public class InviteAcceptView extends GenericCDIView { ...@@ -115,7 +115,7 @@ public class InviteAcceptView extends GenericCDIView {
if (existingUsername == null) { if (existingUsername == null) {
try { try {
req.login(usr, pwd); req.login(usr.trim().toLowerCase(), pwd);
} catch (ServletException e) { } catch (ServletException e) {
logger.warn("Login failed for invite user " + usr, e); logger.warn("Login failed for invite user " + usr, e);
} }
......
...@@ -131,7 +131,7 @@ public class AuthView extends GenericCDIView { ...@@ -131,7 +131,7 @@ public class AuthView extends GenericCDIView {
private void doLogin(String onError) { private void doLogin(String onError) {
bootStrapBean.saneDefaults(); // bootStrapBean.saneDefaults();
if (login == null || password == null || login.isEmpty() || password.isEmpty()) { if (login == null || password == null || login.isEmpty() || password.isEmpty()) {
return; return;
...@@ -150,7 +150,7 @@ public class AuthView extends GenericCDIView { ...@@ -150,7 +150,7 @@ public class AuthView extends GenericCDIView {
} }
try { try {
request.login(login.toLowerCase(), password); request.login(login.trim().toLowerCase(), password);
} catch (Throwable e) { } catch (Throwable e) {
logger.info("Error while trying to login {}", e.getMessage()); logger.info("Error while trying to login {}", e.getMessage());
...@@ -163,7 +163,9 @@ public class AuthView extends GenericCDIView { ...@@ -163,7 +163,9 @@ public class AuthView extends GenericCDIView {
} else { } else {
navihandler.forward(onError); navihandler.forward(onError);
try { try {
request.login(User.ANONYMOUS_LOGINNAME, null); request.logout();
request.getSession().invalidate();
navihandler.forward("/frontpage?faces-redirect=true");
} catch (ServletException e) { } catch (ServletException e) {
logger.warn("Error while trying to relogin as anonymous", e); logger.warn("Error while trying to relogin as anonymous", e);
} }
......
...@@ -198,6 +198,9 @@ public class UserView extends GenericCDIView { ...@@ -198,6 +198,9 @@ public class UserView extends GenericCDIView {
return user; return user;
} }
public String saveRoles() public String saveRoles()
{ {
rolebean.saveRoles(user, usersRoles); rolebean.saveRoles(user, usersRoles);
...@@ -418,7 +421,8 @@ public class UserView extends GenericCDIView { ...@@ -418,7 +421,8 @@ public class UserView extends GenericCDIView {
// still there, we can get real card and update it's barcodes // still there, we can get real card and update it's barcodes
card = cardBean.checkPrintedCard(user); card = cardBean.checkPrintedCard(user);
readerbean.assocCodeToCard(event, card); event = readerbean.assocCodeToCard(event, card);
user = event.getUser();
return null; return null;
} }
......
/*
* Copyright Codecrew Ry
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.flow;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.primefaces.event.SelectEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.ReaderEvent;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import fi.codecrew.moya.web.cdiview.reader.ReaderView;
import fi.codecrew.moya.web.cdiview.shop.FoodWaveFoodView;
import fi.codecrew.moya.web.cdiview.shop.FoodWaveView;
import fi.codecrew.moya.web.cdiview.shop.ProductShopView;
import fi.codecrew.moya.web.cdiview.user.UserView;
@Named
@ConversationScoped
public class FlowFoodwaveView extends GenericCDIView {
private static final long serialVersionUID = 802344850073689859L;
private static final Logger logger = LoggerFactory.getLogger(IncomingView.class);
// shop userid, we need this so we can tell when to show anonymous and when real user.
private Integer userId;
@EJB
PermissionBeanLocal permBean;
@Inject
private FoodWaveView foodwaveView;
@Inject
private FoodWaveFoodView foodWaveFoodView;
@Inject
private UserView userView;
@Inject
private InfoView infoView;
@Inject
private ReaderView readerView;
@Inject
private FlowUserContainer flowUserContainer;
public void initView() {
if(userId == null || userId == 0) {
userView.setUserid(null);
} else {
userView.setUserid(userId);
}
foodwaveView.initListFoodwaves();
}
public void initFoodsView() {
if(userId == null || userId == 0) {
userView.setUserid(null);
} else {
userView.setUserid(userId);
}
foodWaveFoodView.initFoodWaveFoods();
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public void changeUser(SelectEvent event) {
if (infoView.getMultiSearchUser() != null) {
flowUserContainer.setUserId(infoView.getMultiSearchUser().getUser().getId());
// TODO: kauneista nää
super.navihandler.redirectNavigation("/MoyaWeb/info/foodwave/foodwaveshop.jsf?userid=" + infoView.getMultiSearchUser().getUser().getId());
}
}
public void polledRead() {
ReaderEvent event = readerView.getReaderEvent();
if(event == null) {
return;
}
EventUser user = event.getUser();
if (user != null) {
if (!user.equals(userView.getUser())) {
logger.info("found user {}, redirecting", user.getNick());
userView.setUser(user);
flowUserContainer.setUserId(user.getUser().getId());
super.navihandler.redirectNavigation("/MoyaWeb/info/foodwave/foodwaveshop.jsf?userid=" + user.getUser().getId());
}
}
}
}
...@@ -272,15 +272,18 @@ public class IncomingView extends GenericCDIView { ...@@ -272,15 +272,18 @@ public class IncomingView extends GenericCDIView {
* @return Card filing info String or empty string. * @return Card filing info String or empty string.
*/ */
public String getCardFiling() { public String getCardFiling() {
String ret = "";
try { try {
PrintedCard card = cardBean.checkPrintedCard(userview.getSelectedUser()); PrintedCard card = cardBean.checkPrintedCard(userview.getSelectedUser());
if (card != null) {
JsonObject cardMeta = card.getMeta(); JsonObject cardMeta = card.getMeta();
JsonObject cardFilingObject = cardMeta.getJsonObject("card-filing"); JsonObject cardFilingObject = cardMeta.getJsonObject("card-filing");
return cardFilingObject.getString("cardplace"); ret = cardFilingObject.getString("cardplace");
}
} catch (Exception e) { } catch (Exception e) {
logger.warn("Could not get card filing info", e); logger.warn("Could not get card filing info", e);
} }
return ""; return ret;
} }
public String printCard() { public String printCard() {
......
/*
* Copyright Codecrew Ry
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.reports;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.enterprise.context.RequestScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.model.ListDataModel;
import javax.inject.Named;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.LectureBeanLocal;
import fi.codecrew.moya.beans.StatisticsBeanLocal;
import fi.codecrew.moya.enums.apps.LecturePermission;
import fi.codecrew.moya.model.Lecture;
import fi.codecrew.moya.model.LectureGroup;
import fi.codecrew.moya.utilities.I18n;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@RequestScoped
public class BasicStatisticsView extends GenericCDIView {
private static final long serialVersionUID = 1L;
@EJB
private StatisticsBeanLocal statisticsBean;
public Long getGroupMembershipsEnteredCount() {
return statisticsBean.getGroupMembershipsEnteredEvent();
}
public Long getCardDeliveredCount() {
return statisticsBean.getCardDeliveredCount();
}
public Long getGroupMembershipsTotalCount() {
return statisticsBean.getGroupMembershipsTotalCount();
}
}
domain.xml settings:
<jvm-options>-Dlog4j.configuration=file:///${com.sun.aas.instanceRoot}/config/bridged_logging.properties</jvm-options>
<jvm-options>-Dlogback.configurationFile=file:///${com.sun.aas.instanceRoot}/config/logback.xml</jvm-options>
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true" scan="true" scanPeriod="10 seconds">
<jmxConfigurator />
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</layout>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${com.sun.aas.instanceRoot}/logs/server.log</file>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} %X{req.remoteHost} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</layout>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>server.%i{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>32MB</MaxFileSize>
</triggeringPolicy>
</appender>
<logger name="fi.codecrew" level="DEBUG" />
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
</configuration>
handlers = org.slf4j.bridge.SLF4JBridgeHandler
com.sun.enterprise.server.logging.GFFileHandler.flushFrequency=1
com.sun.enterprise.server.logging.GFFileHandler.file=${com.sun.aas.instanceRoot}/logs/jul.log
com.sun.enterprise.server.logging.GFFileHandler.rotationTimelimitInMinutes=0
com.sun.enterprise.server.logging.GFFileHandler.logtoConsole=false
com.sun.enterprise.server.logging.GFFileHandler.rotationLimitInBytes=2000000
com.sun.enterprise.server.logging.GFFileHandler.alarms=false
com.sun.enterprise.server.logging.GFFileHandler.formatter=com.sun.enterprise.server.logging.UniformLogFormatter
com.sun.enterprise.server.logging.GFFileHandler.retainErrorsStasticsForHours=0
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!