Commit efe90430 by Tuomas Riihimäki

Too much stuff

  * Role descriptions to i18n from enums
  * Role editor checkboxs to a nicer form
  * suomenverkkomaksut.fi initial stuff ( untested, and some UI still missing )
  * user image cropping fixed ( temp file to disk )
  * user image flash-thingie fixed
  * removed deprecated 'oldtools' from WebContent/resources
  * Minor changes to OrgRole ( NOTICE! MAY NEED DROP + CREATE FOR THE TABLE! )
1 parent e6d67262
Showing with 1531 additions and 2123 deletions
...@@ -257,4 +257,8 @@ public class BillBean implements BillBeanLocal { ...@@ -257,4 +257,8 @@ public class BillBean implements BillBeanLocal {
} }
return billFacade.find(user); return billFacade.find(user);
} }
public void findByOrdernumber() {
}
} }
...@@ -16,7 +16,6 @@ import fi.insomnia.bortal.enums.apps.BillPermission; ...@@ -16,7 +16,6 @@ import fi.insomnia.bortal.enums.apps.BillPermission;
import fi.insomnia.bortal.enums.apps.CompoPermission; import fi.insomnia.bortal.enums.apps.CompoPermission;
import fi.insomnia.bortal.enums.apps.ContentPermission; import fi.insomnia.bortal.enums.apps.ContentPermission;
import fi.insomnia.bortal.enums.apps.IAppPermission; import fi.insomnia.bortal.enums.apps.IAppPermission;
import fi.insomnia.bortal.enums.apps.LayoutPermission;
import fi.insomnia.bortal.enums.apps.MapPermission; import fi.insomnia.bortal.enums.apps.MapPermission;
import fi.insomnia.bortal.enums.apps.PollPermission; import fi.insomnia.bortal.enums.apps.PollPermission;
import fi.insomnia.bortal.enums.apps.ShopPermission; import fi.insomnia.bortal.enums.apps.ShopPermission;
...@@ -66,6 +65,7 @@ import fi.insomnia.bortal.model.User; ...@@ -66,6 +65,7 @@ import fi.insomnia.bortal.model.User;
ContentPermission.S_MANAGE_NEWS, ContentPermission.S_MANAGE_NEWS,
ContentPermission.S_MANAGE_PAGES, ContentPermission.S_MANAGE_PAGES,
ContentPermission.S_MANAGE_ACTIONLOG, ContentPermission.S_MANAGE_ACTIONLOG,
ContentPermission.S_MANAGE_MENU,
PollPermission.S_ANSWER, PollPermission.S_ANSWER,
PollPermission.S_VIEW_RESULTS, PollPermission.S_VIEW_RESULTS,
...@@ -75,13 +75,10 @@ import fi.insomnia.bortal.model.User; ...@@ -75,13 +75,10 @@ import fi.insomnia.bortal.model.User;
SpecialPermission.S_USER, SpecialPermission.S_USER,
SpecialPermission.S_ANONYMOUS, SpecialPermission.S_ANONYMOUS,
TerminalPermission.S_TERMINAL,
TerminalPermission.S_CASHIER_TERMINAL, TerminalPermission.S_CASHIER_TERMINAL,
TerminalPermission.S_CUSTOMER_TERMINAL, TerminalPermission.S_CUSTOMER_TERMINAL,
TerminalPermission.S_SELFHELP_TERMINAL, TerminalPermission.S_SELFHELP_TERMINAL,
LayoutPermission.S_MANAGE_MENU,
CompoPermission.S_MANAGE, CompoPermission.S_MANAGE,
CompoPermission.S_VOTE, CompoPermission.S_VOTE,
CompoPermission.S_SUBMIT_ENTRY, CompoPermission.S_SUBMIT_ENTRY,
......
package fi.insomnia.bortal.beans;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import javax.annotation.security.DeclareRoles;
import javax.annotation.security.RolesAllowed;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.codec.binary.Hex;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.auth.params.AuthPNames;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.params.AuthPolicy;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import com.sun.xml.bind.StringInputStream;
import fi.insomnia.bortal.clientutils.BortalLocalContextHolder;
import fi.insomnia.bortal.enums.apps.BillPermission;
import fi.insomnia.bortal.model.Bill;
import fi.insomnia.bortal.model.LanEventProperty;
import fi.insomnia.bortal.model.LanEventPropertyKey;
import fi.insomnia.bortal.util.VerkkomaksutReturnEntry;
import fi.insomnia.bortal.verkkomaksutfi.PaymentEntry;
/**
* Session Bean implementation class VerkkomaksutFiBean
*/
@Stateless
@LocalBean
@DeclareRoles({ BillPermission.S_CREATE_VERKKOMAKSU })
public class VerkkomaksutFiBean implements VerkkomaksutFiBeanLocal {
private static final Logger logger = LoggerFactory.getLogger(VerkkomaksutFiBean.class);
private static final char CHECKSUM_SEP = '|';
@EJB
private EventBean lanbean;
@EJB
private BillBean billBean;
@Override
public boolean isSvmEnabled()
{
LanEventProperty expire = lanbean.getProperty(LanEventPropertyKey.VERKKOMAKSU_KEY_EXPIRE);
String merchantid = lanbean.getPropertyString(LanEventPropertyKey.VERKKOMAKSU_MERCHANT_ID);
String merchantPassword = lanbean.getPropertyString(LanEventPropertyKey.VERKKOMAKSU_MERCHANT_PASSWORD);
return !((expire != null && new Date().after(expire.getDateValue()))
|| merchantid == null || merchantid.isEmpty()
|| merchantPassword == null || merchantPassword.isEmpty());
}
public boolean validateReturn(String orderNumber, String timestamp, String paid, String method, String authcode)
{
String merchantPassword = lanbean.getPropertyString(LanEventPropertyKey.VERKKOMAKSU_MERCHANT_PASSWORD);
StringBuilder sumSource = new StringBuilder().append(orderNumber).append(CHECKSUM_SEP)
.append(timestamp).append(CHECKSUM_SEP)
.append(paid).append(CHECKSUM_SEP)
.append(method).append(CHECKSUM_SEP)
.append(merchantPassword);
boolean ret = false;
try {
MessageDigest algo = MessageDigest.getInstance("MD5");
final byte[] resultByte = algo.digest(sumSource.toString().getBytes());
final String calculatedHash = new String(Hex.encodeHex(resultByte));
logger.info("calculated checksum for svv message: {}, comparing to {}", calculatedHash, authcode);
if (authcode.toUpperCase().equals(calculatedHash.toUpperCase())) {
ret = true;
Bill bill = billBean.findById(Integer.parseInt(orderNumber));
billBean.markPaid(bill, Calendar.getInstance());
}
} catch (NoSuchAlgorithmException e) {
logger.warn("THIS SHOULD NEVER HAPPEN! (md5 hashfunction should always exist)", e);
}
return ret;
}
@Override
@RolesAllowed(BillPermission.S_CREATE_VERKKOMAKSU)
public VerkkomaksutReturnEntry getSvmToken(Bill bill)
{
LanEventProperty expire = lanbean.getProperty(LanEventPropertyKey.VERKKOMAKSU_KEY_EXPIRE);
String merchantid = lanbean.getPropertyString(LanEventPropertyKey.VERKKOMAKSU_MERCHANT_ID);
String merchantPassword = lanbean.getPropertyString(LanEventPropertyKey.VERKKOMAKSU_MERCHANT_PASSWORD);
if ((expire != null && new Date().after(expire.getDateValue()))
|| merchantid == null || merchantid.isEmpty()
|| merchantPassword == null || merchantPassword.isEmpty())
{
return null;
}
String returnUrl = new StringBuilder("http://").append(BortalLocalContextHolder.getHostname())
.append("/LanBortalWeb/svm/").toString();
PaymentEntry message = new PaymentEntry(returnUrl);
message.setOrderNumber(bill.getId().toString());
message.setPrice(bill.totalPrice());
// message.setDescription();
VerkkomaksutReturnEntry ret = sendMessage(message, "asd", "foo");
return ret;
}
private static String outputPayment(PaymentEntry payment) throws JAXBException {
JAXBContext context = JAXBContext.newInstance(PaymentEntry.class);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
StringWriter st = new StringWriter();
m.marshal(payment, st);
return st.toString();
}
private static final String REMOTE_URL =
"https://payment.verkkomaksut.fi/api-payment/create";
// private static final String url = "http://iudex.fi/api-payment/create";
private static VerkkomaksutReturnEntry sendMessage(PaymentEntry paymentMsg, String merchantId, String merchantPassword)
{
VerkkomaksutReturnEntry ret = null;
try {
// DefaultHttpClient httpClient = new DefaultHttpClient();
DefaultHttpClient client = new DefaultHttpClient();
client.getCredentialsProvider().setCredentials(
// new AuthScope("payment.verkkomaksut.fi", 443),
AuthScope.ANY,
new UsernamePasswordCredentials(merchantId, merchantPassword));
client.getParams().setParameter(AuthPNames.PROXY_AUTH_PREF, Arrays.asList(AuthPolicy.BASIC));
HttpPost postRequest = new HttpPost(REMOTE_URL);
postRequest.setHeader("Content-Type", "application/xml");
postRequest.setHeader("X-Verkkomaksut-Api-Version", "1");
postRequest.setEntity(new StringEntity(outputPayment(paymentMsg)));
HttpResponse response = client.execute(postRequest);
logger.info("Got statuscode from suomenverkkomaksut.fi: {} ", response.getStatusLine().getStatusCode());
ret = parseMessageReturn(response.getEntity().getContent());
client.getConnectionManager().shutdown();
} catch (Throwable t)
{
logger.warn("Got exception while creating payment to suomenverkkomaksut", t);
}
return ret;
}
public static void main(String[] foo) throws SAXException, IOException, ParserConfigurationException
{
String msg = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<payment><orderNumber>12345678</orderNumber><token>SECRET TOKEN STRING GENRATED BY API</token><url>https://payment.verkkomaksut.fi/payment/load/token/SECRET TOKEN STRING GENRATED BY API</url></payment>";
System.out.println(msg);
StringInputStream istream = new StringInputStream(msg);
VerkkomaksutReturnEntry ret = parseMessageReturn(istream);
logger.info("URL: {}", ret.getUrl());
logger.info("ordernr: {}", ret.getOrderNumber());
logger.info("token: {}", ret.getToken());
}
private static VerkkomaksutReturnEntry parseMessageReturn(InputStream inputStream) throws SAXException, IOException, ParserConfigurationException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document parsed = dBuilder.parse(inputStream);
parsed.normalize();
NodeList rootElements = parsed.getChildNodes();
VerkkomaksutReturnEntry ret = null;
if (rootElements.getLength() != 1) {
logError("Unknown number of entries for root {}", parsed, rootElements.getLength());
} else {
ret = new VerkkomaksutReturnEntry();
Node rootElem = rootElements.item(0);
NodeList rootChildren = rootElem.getChildNodes();
if (rootElem.getNodeName().equals("payment")) {
for (int i = 0; i < rootChildren.getLength(); ++i)
{
Node child = rootChildren.item(i);
String nodeName = child.getNodeName();
String nodeValue = child.getTextContent();
if (nodeName.equals("orderNumber")) {
ret.setOrderNumber(nodeValue);
} else if (nodeName.equals("token")) {
ret.setToken(nodeValue);
} else if (nodeName.equals("url")) {
ret.setUrl(nodeValue);
} else {
logger.warn("unknown payment xml param from suomenverkkomaksut: {} with value {}", nodeName, child.getNodeValue());
}
}
} else if (rootElem.getNodeName().equals("error")) {
for (int i = 0; i < rootChildren.getLength(); ++i)
{
Node child = rootChildren.item(i);
String nodeName = child.getNodeName();
String nodeValue = child.getTextContent();
if (nodeName.equals("errorCode")) {
ret.setErrorCode(nodeValue);
} else if (nodeName.equals("errorMessage")) {
ret.setErrorMessage(nodeValue);
} else {
logger.warn("unknown error xml param from suomenverkkomaksut: {} with value {}", nodeName, child.getNodeValue());
}
}
logError("Received error xml from suomenverkkomaksut", parsed);
} else {
logError("Received unknown XML from suomenverkkomaksut", parsed);
ret = null;
}
}
return ret;
}
private static void logError(String msg, Document doc, Object... params) {
logger.warn(msg, params);
}
}
...@@ -33,7 +33,7 @@ public class OrgRoleFacade extends IntegerPkGenericFacade<OrgRole> { ...@@ -33,7 +33,7 @@ public class OrgRoleFacade extends IntegerPkGenericFacade<OrgRole> {
CriteriaBuilder cb = getEm().getCriteriaBuilder(); CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<OrgRole> cq = cb.createQuery(OrgRole.class); CriteriaQuery<OrgRole> cq = cb.createQuery(OrgRole.class);
Root<OrgRole> root = cq.from(OrgRole.class); Root<OrgRole> root = cq.from(OrgRole.class);
cq.where(cb.equal(root.get(OrgRole_.eventOrganizer), eventBean cq.where(cb.equal(root.get(OrgRole_.eventOrganisation), eventBean
.getCurrentEvent().getOrganiser()), cb.isMember(user, .getCurrentEvent().getOrganiser()), cb.isMember(user,
root.get(OrgRole_.users))); root.get(OrgRole_.users)));
...@@ -42,7 +42,7 @@ public class OrgRoleFacade extends IntegerPkGenericFacade<OrgRole> { ...@@ -42,7 +42,7 @@ public class OrgRoleFacade extends IntegerPkGenericFacade<OrgRole> {
public OrgRole createRole(EventOrganiser org, String roleName) { public OrgRole createRole(EventOrganiser org, String roleName) {
OrgRole ret = new OrgRole(); OrgRole ret = new OrgRole();
ret.setEventOrganizer(org); ret.setEventOrganisation(org);
ret.setName(roleName); ret.setName(roleName);
create(ret); create(ret);
return ret; return ret;
...@@ -52,7 +52,7 @@ public class OrgRoleFacade extends IntegerPkGenericFacade<OrgRole> { ...@@ -52,7 +52,7 @@ public class OrgRoleFacade extends IntegerPkGenericFacade<OrgRole> {
CriteriaBuilder cb = getEm().getCriteriaBuilder(); CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<OrgRole> cq = cb.createQuery(OrgRole.class); CriteriaQuery<OrgRole> cq = cb.createQuery(OrgRole.class);
Root<OrgRole> root = cq.from(OrgRole.class); Root<OrgRole> root = cq.from(OrgRole.class);
cq.where(cb.equal(root.get(OrgRole_.eventOrganizer), eventBean cq.where(cb.equal(root.get(OrgRole_.eventOrganisation), eventBean
.getCurrentEvent().getOrganiser())); .getCurrentEvent().getOrganiser()));
return getEm().createQuery(cq).getResultList(); return getEm().createQuery(cq).getResultList();
...@@ -62,8 +62,8 @@ public class OrgRoleFacade extends IntegerPkGenericFacade<OrgRole> { ...@@ -62,8 +62,8 @@ public class OrgRoleFacade extends IntegerPkGenericFacade<OrgRole> {
CriteriaBuilder cb = getEm().getCriteriaBuilder(); CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<OrgRole> cq = cb.createQuery(OrgRole.class); CriteriaQuery<OrgRole> cq = cb.createQuery(OrgRole.class);
Root<OrgRole> root = cq.from(OrgRole.class); Root<OrgRole> root = cq.from(OrgRole.class);
cq.where(cb.equal(root.get(OrgRole_.eventOrganizer), organiser)); cq.where(cb.equal(root.get(OrgRole_.eventOrganisation), organiser));
return getEm().createQuery(cq).getResultList(); return getEm().createQuery(cq).getResultList();
} }
......
package fi.insomnia.bortal.verkkomaksutfi;
public class ContactAddressEntry {
private String street;
private String postalCode;
private String postalOffice;
private String country = "FI";
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public String getPostalOffice() {
return postalOffice;
}
public void setPostalOffice(String postalOffice) {
this.postalOffice = postalOffice;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
}
package fi.insomnia.bortal.verkkomaksutfi;
public class ContactEntry {
private String firstName;
private String lastName;
private String companyName;
private String email;
private String telephone;
private String mobile;
private ContactAddressEntry address;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public ContactAddressEntry getAddress() {
return address;
}
public void setAddress(ContactAddressEntry address) {
this.address = address;
}
}
package fi.insomnia.bortal.verkkomaksutfi;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@XmlAccessorType(XmlAccessType.FIELD)
public class OrderDetailsEntry {
public OrderDetailsEntry()
{
setContact(new ContactEntry());
products.add(new ProductEntry("second"));
products.add(new ProductEntry("first"));
}
private boolean includeVat = false;
private ContactEntry contact;
private ProductsListEntry products = new ProductsListEntry();
public void setIncludeVat(boolean set) {
includeVat = set;
}
public String getIncludeVat() {
return includeVat ? "1" : "0";
}
public ContactEntry getContact() {
return contact;
}
public void setContact(ContactEntry contact) {
this.contact = contact;
}
public ProductsListEntry getProducts() {
return products;
}
public void setProducts(ProductsListEntry products) {
this.products = products;
}
}
package fi.insomnia.bortal.verkkomaksutfi;
import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "payment")
@XmlAccessorType(XmlAccessType.FIELD)
public class PaymentEntry {
private enum AvailableLocales {
fi_FI, sv_SE, en_US,
}
private UrlSetEntry urlSet;
private OrderDetailsEntry orderDetails;
private String orderNumber = "";
private String currency = "EUR";
private String referennceNumber;
private String description;
private AvailableLocales locale = AvailableLocales.fi_FI;
/**
* NOTICE!
*
* Only either price or orderDetails can be set ( other must be null )
*/
private BigDecimal price;
public PaymentEntry(String url) {
setUrlSet(new UrlSetEntry(url));
// setOrderDetails(new OrderDetailsEntry());
}
public PaymentEntry()
{
}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public UrlSetEntry getUrlSet() {
return urlSet;
}
public void setUrlSet(UrlSetEntry urlSet) {
this.urlSet = urlSet;
}
public OrderDetailsEntry getOrderDetails() {
return orderDetails;
}
public void setOrderDetails(OrderDetailsEntry orderDetails) {
this.orderDetails = orderDetails;
}
public String getReferennceNumber() {
return referennceNumber;
}
public void setReferennceNumber(String referennceNumber) {
this.referennceNumber = referennceNumber;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public AvailableLocales getLocale() {
return locale;
}
public void setLocale(AvailableLocales locale) {
this.locale = locale;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
}
package fi.insomnia.bortal.verkkomaksutfi;
import java.math.BigDecimal;
public class ProductEntry {
private String title;
private String code;
private BigDecimal amount = BigDecimal.ONE;
private BigDecimal price = BigDecimal.ZERO;
private Integer vat = 23;
private BigDecimal discount = BigDecimal.ZERO;
private Integer type = 1;
public ProductEntry(String t) {
title = t;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public Integer getVat() {
return vat;
}
public void setVat(Integer vat) {
this.vat = vat;
}
public BigDecimal getDiscount() {
return discount;
}
public void setDiscount(BigDecimal discount) {
this.discount = discount;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}
package fi.insomnia.bortal.verkkomaksutfi;
import java.util.ArrayList;
import java.util.List;
public class ProductsListEntry {
private List<ProductEntry> product = new ArrayList<ProductEntry>();
public List<ProductEntry> getProduct() {
return product;
}
public void setProduct(List<ProductEntry> product) {
this.product = product;
}
public void add(ProductEntry productEntry) {
product.add(productEntry);
}
}
package fi.insomnia.bortal.verkkomaksutfi;
public class UrlSetEntry {
public UrlSetEntry()
{
}
public UrlSetEntry(String url) {
success = url + "/fail";
failure = url + "/failure";
pending = url + "/pending";
notification = url + "/notification";
}
private String success;
private String failure;
private String pending;
private String notification;
public String getSuccess() {
return success;
}
public void setSuccess(String success) {
this.success = success;
}
public String getFailure() {
return failure;
}
public void setFailure(String failure) {
this.failure = failure;
}
public String getPending() {
return pending;
}
public void setPending(String pending) {
this.pending = pending;
}
public String getNotification() {
return notification;
}
public void setNotification(String notification) {
this.notification = notification;
}
}
Manifest-Version: 1.0 Manifest-Version: 1.0
Class-Path:
package fi.insomnia.bortal.beans;
import javax.ejb.Local;
import fi.insomnia.bortal.model.Bill;
import fi.insomnia.bortal.util.VerkkomaksutReturnEntry;
@Local
public interface VerkkomaksutFiBeanLocal {
boolean isSvmEnabled();
VerkkomaksutReturnEntry getSvmToken(Bill bill);
}
package fi.insomnia.bortal.util;
public class VerkkomaksutReturnEntry {
// Error stuff
private String errorCode;
private String errorMessage;
// payment stuff
private String orderNumber;
private String token;
private String url;
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
...@@ -6,8 +6,12 @@ public enum LanEventPropertyKey { ...@@ -6,8 +6,12 @@ public enum LanEventPropertyKey {
INVITEMAIL_CONTENT(Type.TEXT, "You have been invited to Stream demoparty by {1}.\n\nYou can register to stream demparty intranet at: {0}\n\nAfter registering to the intranet you can buy a ticket to Stream demoparty reduced price and invite your friends to join the party with you. More information can be found in the intranet. Remember also to visit our website at http://www.streamparty.org and join us at #streamparty in IRCNet. If you have any questions about this mail, registering to intranet, or anything else regarding Stream demoparty, please send us email to info@streamparty.org\n\n-- \nStream organizing\ninfo@streamparty.org"), INVITEMAIL_CONTENT(Type.TEXT, "You have been invited to Stream demoparty by {1}.\n\nYou can register to stream demparty intranet at: {0}\n\nAfter registering to the intranet you can buy a ticket to Stream demoparty reduced price and invite your friends to join the party with you. More information can be found in the intranet. Remember also to visit our website at http://www.streamparty.org and join us at #streamparty in IRCNet. If you have any questions about this mail, registering to intranet, or anything else regarding Stream demoparty, please send us email to info@streamparty.org\n\n-- \nStream organizing\ninfo@streamparty.org"),
PORTAL_EMAIL_ADDRESS(Type.TEXT, "intra@streamparty.org"), PORTAL_EMAIL_ADDRESS(Type.TEXT, "intra@streamparty.org"),
PORTAL_EMAIL_NAME(Type.TEXT, "Streamparty intranet"), PORTAL_EMAIL_NAME(Type.TEXT, "Streamparty intranet"),
ADMIN_MAIL(Type.TEXT, "intra@streamparty.org"), ; ADMIN_MAIL(Type.TEXT, "intra@streamparty.org"),
VERKKOMAKSU_KEY_EXPIRE(Type.DATE, null),
VERKKOMAKSU_MERCHANT_ID(Type.TEXT, null),
VERKKOMAKSU_MERCHANT_PASSWORD(Type.TEXT, null),
;
private enum Type { private enum Type {
TEXT, DATE, DATA TEXT, DATE, DATA
}; };
......
...@@ -27,7 +27,7 @@ public class OrgRole extends GenericEntity { ...@@ -27,7 +27,7 @@ public class OrgRole extends GenericEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
protected static final String NAME_COLUMN = "role_name"; protected static final String NAME_COLUMN = "role_name";
protected static final String EVENTORG_ID_COLUMN = "organizer_id"; protected static final String EVENTORG_ID_COLUMN = "organisation_id";
@Column(name = NAME_COLUMN, nullable = false) @Column(name = NAME_COLUMN, nullable = false)
private String name; private String name;
...@@ -49,10 +49,10 @@ public class OrgRole extends GenericEntity { ...@@ -49,10 +49,10 @@ public class OrgRole extends GenericEntity {
@JoinColumn(nullable = false, name = EVENTORG_ID_COLUMN) @JoinColumn(nullable = false, name = EVENTORG_ID_COLUMN)
@ManyToOne() @ManyToOne()
private EventOrganiser eventOrganizer; private EventOrganiser eventOrganisation;
@Column(nullable = false) @Column(nullable = false, name = "manage_organisation")
private boolean manageOrganizer = false; private boolean manageOrganisation = false;
@ManyToMany(mappedBy = "orgRoles") @ManyToMany(mappedBy = "orgRoles")
private List<Role> eventRoles; private List<Role> eventRoles;
...@@ -93,14 +93,6 @@ public class OrgRole extends GenericEntity { ...@@ -93,14 +93,6 @@ public class OrgRole extends GenericEntity {
this.children = children; this.children = children;
} }
public EventOrganiser getEventOrganizer() {
return eventOrganizer;
}
public void setEventOrganizer(EventOrganiser eventOrganizer) {
this.eventOrganizer = eventOrganizer;
}
public List<Role> getEventRoles() { public List<Role> getEventRoles() {
return eventRoles; return eventRoles;
} }
...@@ -109,12 +101,20 @@ public class OrgRole extends GenericEntity { ...@@ -109,12 +101,20 @@ public class OrgRole extends GenericEntity {
this.eventRoles = eventRoles; this.eventRoles = eventRoles;
} }
public boolean isManageOrganizer() { public EventOrganiser getEventOrganisation() {
return manageOrganizer; return eventOrganisation;
}
public void setEventOrganisation(EventOrganiser eventOrganisation) {
this.eventOrganisation = eventOrganisation;
}
public boolean isManageOrganisation() {
return manageOrganisation;
} }
public void setManageOrganizer(boolean manageOrganizer) { public void setManageOrganisation(boolean manageOrganisation) {
this.manageOrganizer = manageOrganizer; this.manageOrganisation = manageOrganisation;
} }
} }
...@@ -5,14 +5,14 @@ import javax.persistence.metamodel.ListAttribute; ...@@ -5,14 +5,14 @@ import javax.persistence.metamodel.ListAttribute;
import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel; import javax.persistence.metamodel.StaticMetamodel;
@Generated(value="Dali", date="2012-05-13T20:43:13.045+0300") @Generated(value="Dali", date="2012-08-15T14:06:19.919+0300")
@StaticMetamodel(OrgRole.class) @StaticMetamodel(OrgRole.class)
public class OrgRole_ extends GenericEntity_ { public class OrgRole_ extends GenericEntity_ {
public static volatile SingularAttribute<OrgRole, String> name; public static volatile SingularAttribute<OrgRole, String> name;
public static volatile ListAttribute<OrgRole, User> users; public static volatile ListAttribute<OrgRole, User> users;
public static volatile ListAttribute<OrgRole, OrgRole> parents; public static volatile ListAttribute<OrgRole, OrgRole> parents;
public static volatile ListAttribute<OrgRole, OrgRole> children; public static volatile ListAttribute<OrgRole, OrgRole> children;
public static volatile SingularAttribute<OrgRole, EventOrganiser> eventOrganizer; public static volatile SingularAttribute<OrgRole, EventOrganiser> eventOrganisation;
public static volatile SingularAttribute<OrgRole, Boolean> manageOrganizer; public static volatile SingularAttribute<OrgRole, Boolean> manageOrganisation;
public static volatile ListAttribute<OrgRole, Role> eventRoles; public static volatile ListAttribute<OrgRole, Role> eventRoles;
} }
Manifest-Version: 1.0 Manifest-Version: 1.0
Class-Path: lib/slf4j-api-1.5.8.jar Class-Path: commons-codec-1.6.jar
lib/commons-codec-1.4.jar
...@@ -4,7 +4,6 @@ import fi.insomnia.bortal.enums.apps.BillPermission; ...@@ -4,7 +4,6 @@ import fi.insomnia.bortal.enums.apps.BillPermission;
import fi.insomnia.bortal.enums.apps.CompoPermission; import fi.insomnia.bortal.enums.apps.CompoPermission;
import fi.insomnia.bortal.enums.apps.ContentPermission; import fi.insomnia.bortal.enums.apps.ContentPermission;
import fi.insomnia.bortal.enums.apps.IAppPermission; import fi.insomnia.bortal.enums.apps.IAppPermission;
import fi.insomnia.bortal.enums.apps.LayoutPermission;
import fi.insomnia.bortal.enums.apps.MapPermission; import fi.insomnia.bortal.enums.apps.MapPermission;
import fi.insomnia.bortal.enums.apps.PollPermission; import fi.insomnia.bortal.enums.apps.PollPermission;
import fi.insomnia.bortal.enums.apps.SalespointPermission; import fi.insomnia.bortal.enums.apps.SalespointPermission;
...@@ -13,25 +12,24 @@ import fi.insomnia.bortal.enums.apps.TerminalPermission; ...@@ -13,25 +12,24 @@ import fi.insomnia.bortal.enums.apps.TerminalPermission;
import fi.insomnia.bortal.enums.apps.UserPermission; import fi.insomnia.bortal.enums.apps.UserPermission;
public enum BortalApplication { public enum BortalApplication {
USER("User management related", UserPermission.class), USER(UserPermission.class),
BILL("Creating, and managing bills", BillPermission.class), BILL(BillPermission.class),
POLL("Poll stuff", PollPermission.class), POLL(PollPermission.class),
MAP("Map management ", MapPermission.class), MAP(MapPermission.class),
SHOP("Product & shop management", ShopPermission.class), SHOP(ShopPermission.class),
CONTENT("News, pages and other dynamic content", ContentPermission.class), CONTENT(ContentPermission.class),
TERMINAL("Sales and self help terminal roles", TerminalPermission.class), TERMINAL(TerminalPermission.class),
LAYOUT("Layoutstuff", LayoutPermission.class), SALESPOINT(SalespointPermission.class),
SALESPOINT("Managing salespoints", SalespointPermission.class), COMPO(CompoPermission.class),
COMPO("Managing compos", CompoPermission.class),
; ;
private final String description; private final String key;
private final Class<? extends IAppPermission> permissions; private final Class<? extends IAppPermission> permissions;
private BortalApplication(String descr, Class<? extends IAppPermission> perms) { private BortalApplication(Class<? extends IAppPermission> perms) {
this.permissions = perms; this.permissions = perms;
description = descr; key = "bortalApplication." + name();
} }
public IAppPermission[] getPermissions() { public IAppPermission[] getPermissions() {
...@@ -40,8 +38,9 @@ public enum BortalApplication { ...@@ -40,8 +38,9 @@ public enum BortalApplication {
} }
public String getDescription() { public String getI18nKey()
return description; {
return key;
} }
} }
...@@ -3,10 +3,11 @@ package fi.insomnia.bortal.enums.apps; ...@@ -3,10 +3,11 @@ package fi.insomnia.bortal.enums.apps;
import fi.insomnia.bortal.enums.BortalApplication; import fi.insomnia.bortal.enums.BortalApplication;
public enum BillPermission implements IAppPermission { public enum BillPermission implements IAppPermission {
READ_ALL("Read all bills"), READ_ALL, // ("Read all bills"),
WRITE_ALL("Modify all bills"), WRITE_ALL, // ("Modify all bills"),
CREATE_BILL("Create bills for self"), CREATE_BILL, // ("Create bills for self"),
VIEW_OWN("View own bills"), VIEW_OWN, // ("View own bills"),
CREATE_VERKKOMAKSU,
; ;
...@@ -14,12 +15,15 @@ public enum BillPermission implements IAppPermission { ...@@ -14,12 +15,15 @@ public enum BillPermission implements IAppPermission {
public static final String S_CREATE_BILL = "BILL/CREATE_BILL"; public static final String S_CREATE_BILL = "BILL/CREATE_BILL";
public static final String S_WRITE_ALL = "BILL/WRITE_ALL"; public static final String S_WRITE_ALL = "BILL/WRITE_ALL";
public static final String S_VIEW_OWN = "BILL/VIEW_OWN"; public static final String S_VIEW_OWN = "BILL/VIEW_OWN";
public static final String S_CREATE_VERKKOMAKSU = "BILL/CREATE_VERKKOMAKSU";
private final String description;
private final String fullName; private final String fullName;
private final String key;
private BillPermission(String desc) { private static final String I18N_HEADER = "bortalApplication.bill.";
description = desc;
private BillPermission() {
key = I18N_HEADER + name();
fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString(); fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString();
} }
...@@ -30,13 +34,13 @@ public enum BillPermission implements IAppPermission { ...@@ -30,13 +34,13 @@ public enum BillPermission implements IAppPermission {
} }
@Override @Override
public String getDescription() { public String getFullName() {
return this.description; return fullName;
} }
@Override @Override
public String getFullName() { public String getI18nKey() {
return fullName; return key;
} }
} }
...@@ -3,11 +3,11 @@ package fi.insomnia.bortal.enums.apps; ...@@ -3,11 +3,11 @@ package fi.insomnia.bortal.enums.apps;
import fi.insomnia.bortal.enums.BortalApplication; import fi.insomnia.bortal.enums.BortalApplication;
public enum CompoPermission implements IAppPermission { public enum CompoPermission implements IAppPermission {
MANAGE("Manage compos"), MANAGE, // ("Manage compos"),
VOTE("Vote"), VOTE, // ("Vote"),
SUBMIT_ENTRY("Submit entry"), SUBMIT_ENTRY, // ("Submit entry"),
VIEW_COMPOS("View compos"), VIEW_COMPOS, // ("View compos"),
; ;
...@@ -16,11 +16,12 @@ public enum CompoPermission implements IAppPermission { ...@@ -16,11 +16,12 @@ public enum CompoPermission implements IAppPermission {
public static final String S_SUBMIT_ENTRY = "COMPO/SUBMIT_ENTRY"; public static final String S_SUBMIT_ENTRY = "COMPO/SUBMIT_ENTRY";
public static final String S_VIEW_COMPOS = "COMPO/VIEW_COMPOS"; public static final String S_VIEW_COMPOS = "COMPO/VIEW_COMPOS";
private final String description;
private final String fullName; private final String fullName;
private final String key;
private static final String I18N_HEADER = "bortalApplication.compo.";
private CompoPermission(String desc) { private CompoPermission() {
description = desc; key = I18N_HEADER + name();
fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString(); fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString();
} }
...@@ -31,13 +32,12 @@ public enum CompoPermission implements IAppPermission { ...@@ -31,13 +32,12 @@ public enum CompoPermission implements IAppPermission {
} }
@Override @Override
public String getDescription() {
return this.description;
}
@Override
public String getFullName() { public String getFullName() {
return fullName; return fullName;
} }
@Override
public String getI18nKey() {
return key;
}
} }
...@@ -3,20 +3,23 @@ package fi.insomnia.bortal.enums.apps; ...@@ -3,20 +3,23 @@ package fi.insomnia.bortal.enums.apps;
import fi.insomnia.bortal.enums.BortalApplication; import fi.insomnia.bortal.enums.BortalApplication;
public enum ContentPermission implements IAppPermission { public enum ContentPermission implements IAppPermission {
MANAGE_NEWS("Manage newsgroups"), MANAGE_NEWS, // ("Manage newsgroups"),
MANAGE_PAGES("Manage pages"), MANAGE_PAGES, // ("Manage pages"),
MANAGE_ACTIONLOG(""), MANAGE_ACTIONLOG, // (""),
MANAGE_MENU, // ("Manage menus")
; ;
public static final String S_MANAGE_NEWS = "CONTENT/MANAGE_NEWS"; public static final String S_MANAGE_NEWS = "CONTENT/MANAGE_NEWS";
public static final String S_MANAGE_PAGES = "CONTENT/MANAGE_PAGES"; public static final String S_MANAGE_PAGES = "CONTENT/MANAGE_PAGES";
public static final String S_MANAGE_ACTIONLOG = "CONTENT/MANAGE_ACTIONLOG"; public static final String S_MANAGE_ACTIONLOG = "CONTENT/MANAGE_ACTIONLOG";
public static final String S_MANAGE_MENU = "CONTENT/MANAGE_MENU";
private String description; private final String key;
private String fullName; private final String fullName;
private static final String I18N_HEADER = "bortalApplication.content.";
private ContentPermission(String desc) { private ContentPermission() {
this.description = desc; key = I18N_HEADER + name();
fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString(); fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString();
} }
...@@ -26,8 +29,8 @@ public enum ContentPermission implements IAppPermission { ...@@ -26,8 +29,8 @@ public enum ContentPermission implements IAppPermission {
} }
@Override @Override
public String getDescription() { public String getI18nKey() {
return this.description; return this.key;
} }
@Override @Override
......
...@@ -10,11 +10,13 @@ public interface IAppPermission extends Serializable { ...@@ -10,11 +10,13 @@ public interface IAppPermission extends Serializable {
public BortalApplication getParent(); public BortalApplication getParent();
public String getDescription();
public String getFullName(); public String getFullName();
@Override @Override
public String toString(); public String toString();
public String getI18nKey();
public String name();
} }
package fi.insomnia.bortal.enums.apps;
import fi.insomnia.bortal.enums.BortalApplication;
public enum LayoutPermission implements IAppPermission {
MANAGE_MENU("Manage menus")
;
public static final String S_MANAGE_MENU = "LAYOUT/MANAGE_MENU";
private final String description;
private final String fullName;
private LayoutPermission(String desc) {
description = desc;
fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString();
}
@Override
public BortalApplication getParent() {
return BortalApplication.LAYOUT;
}
@Override
public String getDescription() {
return this.description;
}
@Override
public String getFullName() {
return fullName;
}
}
...@@ -3,21 +3,24 @@ package fi.insomnia.bortal.enums.apps; ...@@ -3,21 +3,24 @@ package fi.insomnia.bortal.enums.apps;
import fi.insomnia.bortal.enums.BortalApplication; import fi.insomnia.bortal.enums.BortalApplication;
public enum MapPermission implements IAppPermission { public enum MapPermission implements IAppPermission {
MANAGE_OTHERS("Manage other users reservations in map"), MANAGE_OTHERS, // ("Manage other users reservations in map"),
BUY_PLACES("Reserve and buy places from map"), BUY_PLACES, // ("Reserve and buy places from map"),
VIEW("View maps"), VIEW, // ("View maps"),
MANAGE_MAPS("Create and modify maps"); MANAGE_MAPS, // ("Create and modify maps")
;
public static final String S_MANAGE_OTHERS = "MAP/MANAGE_OTHERS"; public static final String S_MANAGE_OTHERS = "MAP/MANAGE_OTHERS";
public static final String S_BUY_PLACES = "MAP/BUY_PLACES"; public static final String S_BUY_PLACES = "MAP/BUY_PLACES";
public static final String S_VIEW = "MAP/VIEW"; public static final String S_VIEW = "MAP/VIEW";
public static final String S_MANAGE_MAPS = "MAP/MANAGE_MAPS"; public static final String S_MANAGE_MAPS = "MAP/MANAGE_MAPS";
private String description; private final String fullName;
private String fullName; private final String key;
private static final String I18N_HEADER = "bortalApplication.map.";
private MapPermission(String desc) { private MapPermission() {
description = desc; key = I18N_HEADER + name();
fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString(); fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString();
} }
...@@ -28,12 +31,12 @@ public enum MapPermission implements IAppPermission { ...@@ -28,12 +31,12 @@ public enum MapPermission implements IAppPermission {
} }
@Override @Override
public String getDescription() { public String getFullName() {
return description; return fullName;
} }
@Override @Override
public String getFullName() { public String getI18nKey() {
return fullName; return key;
} }
} }
...@@ -3,9 +3,9 @@ package fi.insomnia.bortal.enums.apps; ...@@ -3,9 +3,9 @@ package fi.insomnia.bortal.enums.apps;
import fi.insomnia.bortal.enums.BortalApplication; import fi.insomnia.bortal.enums.BortalApplication;
public enum PollPermission implements IAppPermission { public enum PollPermission implements IAppPermission {
ANSWER("Can answer and view availabe polls"), ANSWER, // ("Can answer and view availabe polls"),
VIEW_RESULTS("View anonymized poll results"), VIEW_RESULTS, // ("View anonymized poll results"),
CREATE("Create and manage polls") CREATE, // ("Create and manage polls")
; ;
...@@ -13,12 +13,13 @@ public enum PollPermission implements IAppPermission { ...@@ -13,12 +13,13 @@ public enum PollPermission implements IAppPermission {
public static final String S_VIEW_RESULTS = "POLL/VIEW_RESULTS"; public static final String S_VIEW_RESULTS = "POLL/VIEW_RESULTS";
public static final String S_CREATE = "POLL/CREATE"; public static final String S_CREATE = "POLL/CREATE";
private String description; private final String fullName;
private String fullName; private final String key;
private static final String I18N_HEADER = "bortalApplication.poll.";
private PollPermission(String desc) { private PollPermission() {
this.description = desc;
fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString(); fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString();
key = I18N_HEADER + name();
} }
@Override @Override
...@@ -27,12 +28,12 @@ public enum PollPermission implements IAppPermission { ...@@ -27,12 +28,12 @@ public enum PollPermission implements IAppPermission {
} }
@Override @Override
public String getDescription() { public String getFullName() {
return this.description; return fullName;
} }
@Override @Override
public String getFullName() { public String getI18nKey() {
return fullName; return key;
} }
} }
...@@ -3,16 +3,20 @@ package fi.insomnia.bortal.enums.apps; ...@@ -3,16 +3,20 @@ package fi.insomnia.bortal.enums.apps;
import fi.insomnia.bortal.enums.BortalApplication; import fi.insomnia.bortal.enums.BortalApplication;
public enum SalespointPermission implements IAppPermission { public enum SalespointPermission implements IAppPermission {
VIEW("View salespoints"), MODIFY("Modify salespoints"); VIEW, // ("View salespoints"),
MODIFY, // ("Modify salespoints"),
;
public static final String S_VIEW = "SALESPOINT/VIEW"; public static final String S_VIEW = "SALESPOINT/VIEW";
public static final String S_MODIFY = "SALESPOINT/MODIFY"; public static final String S_MODIFY = "SALESPOINT/MODIFY";
private final String description;
private final String fullName; private final String fullName;
private final String key;
private static final String I18N_HEADER = "bortalApplication.salespoint.";
private SalespointPermission(String desc) { private SalespointPermission() {
description = desc; key = I18N_HEADER + name();
fullName = new StringBuilder().append(getParent().toString()) fullName = new StringBuilder().append(getParent().toString())
.append(DELIMITER).append(toString()).toString(); .append(DELIMITER).append(toString()).toString();
} }
...@@ -23,12 +27,12 @@ public enum SalespointPermission implements IAppPermission { ...@@ -23,12 +27,12 @@ public enum SalespointPermission implements IAppPermission {
} }
@Override @Override
public String getDescription() { public String getFullName() {
return description; return fullName;
} }
@Override @Override
public String getFullName() { public String getI18nKey() {
return fullName; return key;
} }
} }
...@@ -4,11 +4,11 @@ import fi.insomnia.bortal.enums.BortalApplication; ...@@ -4,11 +4,11 @@ import fi.insomnia.bortal.enums.BortalApplication;
public enum ShopPermission implements IAppPermission { public enum ShopPermission implements IAppPermission {
LIST_USERPRODUCTS("List products for users in shop"), LIST_USERPRODUCTS, // ("List products for users in shop"),
LIST_ALL_PRODUCTS("List all products in shop"), LIST_ALL_PRODUCTS, // ("List all products in shop"),
SHOP_TO_OTHERS("Shop to other users"), SHOP_TO_OTHERS, // ("Shop to other users"),
SHOP_PRODUCTS("Shop products to self"), SHOP_PRODUCTS, // ("Shop products to self"),
MANAGE_PRODUCTS("Create and modify products"), MANAGE_PRODUCTS, // ("Create and modify products"),
; ;
...@@ -18,11 +18,12 @@ public enum ShopPermission implements IAppPermission { ...@@ -18,11 +18,12 @@ public enum ShopPermission implements IAppPermission {
public static final String S_SHOP_PRODUCTS = "SHOP/SHOP_PRODUCTS"; public static final String S_SHOP_PRODUCTS = "SHOP/SHOP_PRODUCTS";
public static final String S_MANAGE_PRODUCTS = "SHOP/MANAGE_PRODUCTS"; public static final String S_MANAGE_PRODUCTS = "SHOP/MANAGE_PRODUCTS";
private String description; private final String fullName;
private String fullName; private final String key;
private static final String I18N_HEADER = "bortalApplication.shop.";
private ShopPermission(String desc) { private ShopPermission() {
this.description = desc; key = I18N_HEADER + name();
fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString(); fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString();
} }
...@@ -33,12 +34,12 @@ public enum ShopPermission implements IAppPermission { ...@@ -33,12 +34,12 @@ public enum ShopPermission implements IAppPermission {
} }
@Override @Override
public String getDescription() { public String getFullName() {
return this.description; return fullName;
} }
@Override @Override
public String getFullName() { public String getI18nKey() {
return fullName; return key;
} }
} }
...@@ -11,29 +11,28 @@ import fi.insomnia.bortal.enums.BortalApplication; ...@@ -11,29 +11,28 @@ import fi.insomnia.bortal.enums.BortalApplication;
*/ */
public enum TerminalPermission implements IAppPermission { public enum TerminalPermission implements IAppPermission {
CASHIER("Access cashier terminal functions"), CUSTOMER( CASHIER, // ("Access cashier terminal functions"),
"Access client terminal functions"), SELFHELP("Self help terminal"); CUSTOMER, // ("Access client terminal functions"),
SELFHELP, // ("Self help terminal")
public static final String S_TERMINAL = "TERMINAL"; ;
// public static final String S_TERMINAL = "TERMINAL";
public static final String S_CASHIER_TERMINAL = "TERMINAL/CASHIER"; public static final String S_CASHIER_TERMINAL = "TERMINAL/CASHIER";
public static final String S_CUSTOMER_TERMINAL = "TERMINAL/CUSTOMER"; public static final String S_CUSTOMER_TERMINAL = "TERMINAL/CUSTOMER";
public static final String S_SELFHELP_TERMINAL = "TERMINAL/SELFHELP"; public static final String S_SELFHELP_TERMINAL = "TERMINAL/SELFHELP";
private final String description;
private final String fullName; private final String fullName;
private final String key;
private static final String I18N_HEADER = "bortalApplication.terminal.";
private TerminalPermission(String desc) { private TerminalPermission() {
this.description = desc; key = I18N_HEADER + name();
fullName = new StringBuilder().append(getParent().toString()) fullName = new StringBuilder().append(getParent().toString())
.append(DELIMITER).append(toString()).toString(); .append(DELIMITER).append(toString()).toString();
} }
@Override @Override
public String getDescription() {
return this.description;
}
@Override
public BortalApplication getParent() { public BortalApplication getParent() {
return BortalApplication.TERMINAL; return BortalApplication.TERMINAL;
} }
...@@ -42,4 +41,9 @@ public enum TerminalPermission implements IAppPermission { ...@@ -42,4 +41,9 @@ public enum TerminalPermission implements IAppPermission {
public String getFullName() { public String getFullName() {
return fullName; return fullName;
} }
@Override
public String getI18nKey() {
return key;
}
} }
...@@ -3,21 +3,21 @@ package fi.insomnia.bortal.enums.apps; ...@@ -3,21 +3,21 @@ package fi.insomnia.bortal.enums.apps;
import fi.insomnia.bortal.enums.BortalApplication; import fi.insomnia.bortal.enums.BortalApplication;
public enum UserPermission implements IAppPermission { public enum UserPermission implements IAppPermission {
VIEW_ALL("View all users"), VIEW_ALL, // ("View all users"),
MODIFY("Modify users"), MODIFY, // ("Modify users"),
CREATE_NEW("Create new user"), CREATE_NEW, // ("Create new user"),
VIEW_SELF("Can view self"), VIEW_SELF, // ("Can view self"),
LOGIN("Can login"), LOGIN, // ("Can login"),
LOGOUT("Can logout"), LOGOUT, // ("Can logout"),
READ_ROLES("View all roles."), READ_ROLES, // ("View all roles."),
WRITE_ROLES("Modify roles"), WRITE_ROLES, // ("Modify roles"),
VIEW_ACCOUNTEVENTS("Show other users account events"), VIEW_ACCOUNTEVENTS, // ("Show other users account events"),
MODIFY_ACCOUNTEVENTS("Modify Account events"), MODIFY_ACCOUNTEVENTS, // ("Modify Account events"),
ANYUSER("All users have this anyways"), ANYUSER, // ("All users have this anyways"),
MANAGE_HTTP_SESSION("Manage http sessions"), MANAGE_HTTP_SESSION, // ("Manage http sessions"),
INVITE_USERS("Invite users"), INVITE_USERS, // ("Invite users"),
READ_ORGROLES("View organization roles"), READ_ORGROLES, // ("View organization roles"),
WRITE_ORGROLES("Modify organization roles"), WRITE_ORGROLES, // ("Modify organization roles"),
; ;
public static final String S_VIEW_ALL = "USER/VIEW_ALL"; public static final String S_VIEW_ALL = "USER/VIEW_ALL";
...@@ -36,13 +36,13 @@ public enum UserPermission implements IAppPermission { ...@@ -36,13 +36,13 @@ public enum UserPermission implements IAppPermission {
public static final String S_READ_ORGROLES = "USER/READ_ORGROLES"; public static final String S_READ_ORGROLES = "USER/READ_ORGROLES";
public static final String S_WRITE_ORGROLES = "USER/WRITE_ORGROLES"; public static final String S_WRITE_ORGROLES = "USER/WRITE_ORGROLES";
private String description; private final String fullName;
private String fullName; private final String key;
private static final String I18N_HEADER = "bortalApplication.user.";
private UserPermission(String desc) { private UserPermission() {
description = desc;
fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString(); fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString();
key = I18N_HEADER + name();
} }
@Override @Override
...@@ -51,12 +51,12 @@ public enum UserPermission implements IAppPermission { ...@@ -51,12 +51,12 @@ public enum UserPermission implements IAppPermission {
} }
@Override @Override
public String getDescription() { public String getFullName() {
return description; return fullName;
} }
@Override @Override
public String getFullName() { public String getI18nKey() {
return fullName; return key;
} }
} }
<!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" xmlns:ui="http://java.sun.com/jsf/facelets" <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:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:body> <h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
...@@ -23,38 +21,38 @@ ...@@ -23,38 +21,38 @@
<h3 class="actionlog_create_message">#{i18n['actionlog.create.message']}</h3> <h3 class="actionlog_create_message">#{i18n['actionlog.create.message']}</h3>
<h3 class="actionlog_create_istask">#{i18n['actionlog.create.taskradio']}</h3> <h3 class="actionlog_create_istask">#{i18n['actionlog.create.taskradio']}</h3>
</div> </div>
<div class="row"> <div class="row">
<div class="actionlog_create_role"> <div class="actionlog_create_role">
<h:selectOneMenu value="#{actionLogCreateView.role}" converter="#{roleConverter}"> <h:selectOneMenu value="#{actionLogCreateView.role}" converter="#{roleConverter}">
<f:selectItems var="role" itemLabel="#{role.name}" value="#{actionLogCreateView.roles}" /> <f:selectItems var="role" itemLabel="#{role.name}" value="#{actionLogCreateView.roles}" />
</h:selectOneMenu> </h:selectOneMenu>
</div> </div>
<div class="actionlog_create_message"> <div class="actionlog_create_message">
<h:inputText value="#{actionLogCreateView.message}" /> <h:inputText value="#{actionLogCreateView.message}" />
</div> </div>
<div class="actionlog_create_istask"> <div class="actionlog_create_istask">
<h:selectBooleanCheckbox value="#{actionLogCreateView.task}"/> <h:selectBooleanCheckbox value="#{actionLogCreateView.task}" />
</div> </div>
<h:commandButton class="sendbutton" action="#{actionLogCreateView.send}" value="#{i18n['actionlog.create.submitbutton']}"> <h:commandButton class="sendbutton" action="#{actionLogCreateView.send}" value="#{i18n['actionlog.create.submitbutton']}">
</h:commandButton> </h:commandButton>
</div> </div>
</h:form> </h:form>
<div class="clearfix"></div> <div class="clearfix"></div>
<h2>#{i18n['actionlog.tasklist.header']}</h2> <h2>#{i18n['actionlog.tasklist.header']}</h2>
<div id="actionlog"> <div id="actionlog">
<h:form id="refresh"> <h:form id="refresh">
<p:poll interval="1" update="actionlogtable" /> <p:poll interval="1" update="actionlogtable" />
<h:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="actionlogtable" value="#{actionLogMessageView.messages}" var="message"> <h:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="actionlogtable" value="#{actionLogMessageView.messages}" var="message">
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['actionlog.time']}" /> <h:outputText value="#{i18n['actionlog.time']}" />
</f:facet> </f:facet>
<h:outputText value="#{message.time}"> <h:outputText value="#{message.time}">
<f:convertDateTime type="both" pattern="dd.MM.yyyy HH:mm" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
<h:column> <h:column>
...@@ -70,20 +68,20 @@ ...@@ -70,20 +68,20 @@
<h:outputText value="#{message.crew.name}" /> <h:outputText value="#{message.crew.name}" />
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['actionlog.message']}" /> <h:outputText value="#{i18n['actionlog.message']}" />
</f:facet> </f:facet>
<h:outputText value="#{message.message}" /> <h:outputText value="#{message.message}" />
</h:column> </h:column>
<h:column> <h:column>
<h:link rendered="#{!empty message.state}" outcome="taskview" > <h:link rendered="#{!empty message.state}" outcome="taskview">
<f:param name="id" value="#{message.id}" /> <f:param name="id" value="#{message.id}" />
Näytä tehtävä Näytä tehtävä
</h:link> </h:link>
</h:column> </h:column>
</h:dataTable> </h:dataTable>
</h:form> </h:form>
</div> </div>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
......
<!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" xmlns:ui="http://java.sun.com/jsf/facelets" <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:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
>
<h:body> <h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata> <f:metadata>
<f:viewParam name="id" value="#{taskModificationView.id}"></f:viewParam> <f:viewParam name="id" value="#{taskModificationView.id}"></f:viewParam>
<f:event type="preRenderView" listener="#{taskModificationView.initView}" /> <f:event type="preRenderView" listener="#{taskModificationView.initView}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
<h:outputStylesheet library="style" name="insomnia2/css/actionlog.css"></h:outputStylesheet> <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css"></h:outputStylesheet>
<h1>Task id: #{taskModificationView.message.id}<!-- #{i18n['actionlog.messagelist.header']} --></h1> <h1>
Task id: #{taskModificationView.message.id}
<!-- #{i18n['actionlog.messagelist.header']} -->
</h1>
<!-- <p>Mo #{i18n['actionlog.messagelist.description']} </p> --> <!-- <p>Mo #{i18n['actionlog.messagelist.description']} </p> -->
<div> <div>
<table> <table>
<tr> <tr>
<td><h:outputText class="taskHeader" value="#{i18n['actionlog.time']}: " /></td> <td><h:outputText class="taskHeader" value="#{i18n['actionlog.time']}: " /></td>
<td><h:outputText value="#{taskModificationView.message.time}" > <td><h:outputText value="#{taskModificationView.message.time}">
<f:convertDateTime type="both" pattern="dd.MM.yyyy HH:mm" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText></td> </h:outputText></td>
</tr> </tr>
<tr> <tr>
<td><h:outputText class="taskHeader" value="#{i18n['actionlog.user']}: " /></td> <td><h:outputText class="taskHeader" value="#{i18n['actionlog.user']}: " /></td>
<td><h:outputText value="#{taskModificationView.message.user.nick}" /></td> <td><h:outputText value="#{taskModificationView.message.user.nick}" /></td>
</tr> </tr>
<tr> <tr>
<td><h:outputText class="taskHeader" value="#{i18n['actionlog.crew']}: " /></td> <td><h:outputText class="taskHeader" value="#{i18n['actionlog.crew']}: " /></td>
<td><h:outputText value="#{taskModificationView.message.crew.name}" /></td> <td><h:outputText value="#{taskModificationView.message.crew.name}" /></td>
</tr> </tr>
<tr> <tr>
<td><h:outputText class="taskHeader" value="#{i18n['actionlog.state']}: " /></td> <td><h:outputText class="taskHeader" value="#{i18n['actionlog.state']}: " /></td>
<td><h:outputText value="#{i18n[taskModificationView.message.state.key]}" /></td> <td><h:outputText value="#{i18n[taskModificationView.message.state.key]}" /></td>
</tr> </tr>
<tr> <tr>
<td><h:outputText class="taskHeader" value="#{i18n['actionlog.message']}: " /></td> <td><h:outputText class="taskHeader" value="#{i18n['actionlog.message']}: " /></td>
<td><h:outputText value="#{taskModificationView.message.message}" /></td> <td><h:outputText value="#{taskModificationView.message.message}" /></td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<hr style="width:90%;" /> <hr style="width: 90%;" />
<div> <div>
<h:form> <h:form>
<p:poll interval="1" update="messageresponsetable" /> <p:poll interval="1" update="messageresponsetable" />
<h:dataTable id="messageresponsetable" value="#{taskModificationView.responses}" var="response"> <h:dataTable id="messageresponsetable" value="#{taskModificationView.responses}" var="response">
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="Aika" /> <h:outputText value="Aika" />
</f:facet> </f:facet>
<h:outputText value="#{response.time}"> <h:outputText value="#{response.time}">
<f:convertDateTime type="both" pattern="dd.MM.yyyy HH:mm" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="Submitter" /> <h:outputText value="Submitter" />
</f:facet> </f:facet>
<h:outputText value="#{response.user.nick}" /> <h:outputText value="#{response.user.nick}" />
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="Message" /> <h:outputText value="Message" />
</f:facet> </f:facet>
<h:outputText value="#{response.message}" /> <h:outputText value="#{response.message}" />
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="tilanvaihdos" /> <h:outputText value="tilanvaihdos" />
</f:facet> </f:facet>
<h:outputText value="#{i18n[response.stateChange.key]}" /> <h:outputText value="#{i18n[response.stateChange.key]}" />
</h:column> </h:column>
</h:dataTable> </h:dataTable>
</h:form> </h:form>
</div> </div>
<div> <div>
<h:form> <h:form>
<h3>Lisää viesti</h3> <h3>Lisää viesti</h3>
<h:outputText value="Viestisi: " /> <h:outputText value="Viestisi: " />
<h:inputText value="#{taskModificationView.responseMessage}" size="100" /> <h:inputText value="#{taskModificationView.responseMessage}" size="100" />
<h:outputText value="Tila: " /> <h:outputText value="Tila: " />
<h:selectOneMenu id="stateMenu" title="asdas" value="#{taskModificationView.responseStateChange}"> <h:selectOneMenu id="stateMenu" title="asdas" value="#{taskModificationView.responseStateChange}">
<f:selectItem itemLabel="Ei muutosta" itemValue="#{null}" /> <f:selectItem itemLabel="Ei muutosta" itemValue="#{null}" />
<f:selectItem itemLabel="Uusi" itemValue="NEW" /> <f:selectItem itemLabel="Uusi" itemValue="NEW" />
<f:selectItem itemLabel="Työn alla" itemValue="PENDING" /> <f:selectItem itemLabel="Työn alla" itemValue="PENDING" />
<f:selectItem itemLabel="Tehty" itemValue="DONE" /> <f:selectItem itemLabel="Tehty" itemValue="DONE" />
</h:selectOneMenu> </h:selectOneMenu>
<h:commandButton class="sendbutton2" value="#{i18n['actionlog.create.submitbutton']}" action="#{taskModificationView.createResponse}" /> <h:commandButton class="sendbutton2" value="#{i18n['actionlog.create.submitbutton']}" action="#{taskModificationView.createResponse()}" />
</h:form> </h:form>
</div> </div>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
......
<!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" xmlns:ui="http://java.sun.com/jsf/facelets" <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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:users="http://java.sun.com/jsf/composite/tools/user" xmlns:c="http://java.sun.com/jsp/jstl/core">
xmlns:users="http://java.sun.com/jsf/composite/tools/user" xmlns:c="http://java.sun.com/jsp/jstl/core"
>
<h:body> <h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata> <f:metadata>
...@@ -17,49 +15,49 @@ ...@@ -17,49 +15,49 @@
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<h:outputLabel for="paidDate" value="#{i18n['bill.paidDate']}:" /> <h:outputLabel for="paidDate" value="#{i18n['bill.paidDate']}:" />
<h:inputText id="paidDate" value="#{billEditView.bill.paidDate}"> <h:inputText id="paidDate" value="#{billEditView.bill.paidDate}">
<f:convertDateTime /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:inputText> </h:inputText>
<h:outputLabel value="#{i18n['bill.billNumber']}:" /> <h:outputLabel for="billnr" value="#{i18n['bill.billNumber']}:" />
<h:inputText value="#{billEditView.bill.billNumber}" /> <h:inputText id="billnr" value="#{billEditView.bill.billNumber}" />
<h:outputLabel value="#{i18n['bill.addr1']}:" /> <h:outputLabel for="addr1" value="#{i18n['bill.addr1']}:" />
<h:inputText value="#{billEditView.bill.addr1}" /> <h:inputText id="addr1" value="#{billEditView.bill.addr1}" />
<h:outputLabel value="#{i18n['bill.addr2']}:" /> <h:outputLabel for="addr2" value="#{i18n['bill.addr2']}:" />
<h:inputText value="#{billEditView.bill.addr2}" /> <h:inputText id="addr2" value="#{billEditView.bill.addr2}" />
<h:outputLabel value="#{i18n['bill.addr3']}:" /> <h:outputLabel for="addr3" value="#{i18n['bill.addr3']}:" />
<h:inputText value="#{billEditView.bill.addr3}" /> <h:inputText id="addr3" value="#{billEditView.bill.addr3}" />
<h:outputLabel value="#{i18n['bill.addr4']}:" /> <h:outputLabel for="addr4" value="#{i18n['bill.addr4']}:" />
<h:inputText value="#{billEditView.bill.addr4}" /> <h:inputText id="addr4" value="#{billEditView.bill.addr4}" />
<h:outputLabel value="#{i18n['bill.addr5']}:" /> <h:outputLabel for="addr5" value="#{i18n['bill.addr5']}:" />
<h:inputText value="#{billEditView.bill.addr5}" /> <h:inputText id="addr5" value="#{billEditView.bill.addr5}" />
<h:outputLabel for="sentDate" value="#{i18n['bill.sentDate']}:" /> <h:outputLabel for="sentDate" value="#{i18n['bill.sentDate']}:" />
<h:inputText id="sentDate" value="#{billEditView.bill.sentDateTime}"> <h:inputText id="sentDate" value="#{billEditView.bill.sentDateTime}">
<f:convertDateTime /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:inputText> </h:inputText>
<h:outputLabel for="paymenttime" value="#{i18n['bill.paymentTime']}:" /> <h:outputLabel for="paymenttime" value="#{i18n['bill.paymentTime']}:" />
<h:inputText id="paymenttime" value="#{billEditView.bill.paymentTime}" /> <h:inputText id="paymenttime" value="#{billEditView.bill.paymentTime}" />
<h:outputLabel value="#{i18n['bill.noticetime']}:" /> <h:outputLabel for="noticetime" value="#{i18n['bill.noticetime']}:" />
<h:inputText value="#{billEditView.bill.noticetime}" /> <h:inputText id="noticetime" value="#{billEditView.bill.noticetime}" />
<h:outputLabel value="#{i18n['bill.theirReference']}:" /> <h:outputLabel for="theirRef" value="#{i18n['bill.theirReference']}:" />
<h:inputText value="#{billEditView.bill.theirReference}" /> <h:inputText id="theirRef" value="#{billEditView.bill.theirReference}" />
<h:outputLabel value="#{i18n['bill.ourReference']}:" /> <h:outputLabel for="ourRef" value="#{i18n['bill.ourReference']}:" />
<h:inputText value="#{billEditView.bill.ourReference}" /> <h:inputText id="ourRef" value="#{billEditView.bill.ourReference}" />
<h:outputLabel value="#{i18n['bill.deliveryTerms']}:" /> <h:outputLabel for="delivTerm" value="#{i18n['bill.deliveryTerms']}:" />
<h:inputText value="#{billEditView.bill.deliveryTerms}" /> <h:inputText id="delivTerm" value="#{billEditView.bill.deliveryTerms}" />
<h:outputLabel value="#{i18n['bill.notes']}:" /> <h:outputLabel for="notes" value="#{i18n['bill.notes']}:" />
<h:inputTextarea cols="50" rows="5" value="#{billEditView.bill.notes}" /> <h:inputTextarea id="notes" cols="50" rows="5" value="#{billEditView.bill.notes}" />
<h:commandButton id="commitbtn" action="#{billEditView.save()}" value="#{i18n['bill.save']}" /> <h:commandButton id="commitbtn" action="#{billEditView.save()}" value="#{i18n['bill.save']}" />
</h:panelGrid> </h:panelGrid>
......
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
<h:outputLabel value="#{i18n['event.startTime']}:" /> <h:outputLabel value="#{i18n['event.startTime']}:" />
<h:inputText value="#{eventorgView.event.startTime}"> <h:inputText value="#{eventorgView.event.startTime}">
<f:convertDateTime /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:inputText> </h:inputText>
<h:outputLabel value="#{i18n['event.endTime']}:" /> <h:outputLabel value="#{i18n['event.endTime']}:" />
<h:inputText value="#{eventorgView.event.endTime}"> <h:inputText value="#{eventorgView.event.endTime}">
<f:convertDateTime /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:inputText> </h:inputText>
<h:outputLabel value="#{i18n['event.defaultRole']}:" /> <h:outputLabel value="#{i18n['event.defaultRole']}:" />
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
/> />
</title> </title>
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia1/style.css" /> <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia1/style.css" />
<ui:insert name="headerdata" />
</h:head> </h:head>
<h:body> <h:body>
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
<meta http-equiv="Content-Language" content="fi" /> <meta http-equiv="Content-Language" content="fi" />
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia2/css/tyyli.css" /> <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia2/css/tyyli.css" />
<ui:insert name="headerdata" />
</h:head> </h:head>
<h:body> <h:body>
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:tools="http://java.sun.com/jsf/composite/cditools"
xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core">
xmlns:c="http://java.sun.com/jsp/jstl/core"
>
<f:view locale="#{sessionHandler.locale}"> <f:view locale="#{sessionHandler.locale}">
...@@ -17,10 +15,8 @@ ...@@ -17,10 +15,8 @@
<meta http-equiv="PRAGMA" content="NO-CACHE" /> <meta http-equiv="PRAGMA" content="NO-CACHE" />
<meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><h:outputText value="#{i18n['global.eventname']}" /> - <h:outputText <title><h:outputText value="#{i18n['global.eventname']}" /> - <h:outputText value="#{i18n[util.concat(thispage,'.header') ] }" /></title>
value="#{i18n[util.concat(thispage,'.header') ] }" <ui:insert name="headerdata" />
/>
</title>
</h:head> </h:head>
<h:body> <h:body>
<div id="topheader"> <div id="topheader">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<h:outputLabel value="#{i18n['place.releasetime']}:" /> <h:outputLabel value="#{i18n['place.releasetime']}:" />
<h:outputText value="#{placeView.place.releaseTime.time}"> <h:outputText value="#{placeView.place.releaseTime.time}">
<f:convertDateTime pattern="yyyy.MM.dd HH:mm" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
<h:outputLabel value="#{i18n['place.code']}:" /> <h:outputLabel value="#{i18n['place.code']}:" />
...@@ -114,12 +114,12 @@ ...@@ -114,12 +114,12 @@
<h:outputLabel value="#{i18n['placegroup.created']}:" /> <h:outputLabel value="#{i18n['placegroup.created']}:" />
<h:inputText value="#{placeView.place.group.created.time}"> <h:inputText value="#{placeView.place.group.created.time}">
<f:convertDateTime pattern="yyyy.MM.dd HH:mm" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:inputText> </h:inputText>
<h:outputLabel value="#{i18n['placegroup.edited']}:" /> <h:outputLabel value="#{i18n['placegroup.edited']}:" />
<h:inputText value="#{placeView.place.group.edited.time}"> <h:inputText value="#{placeView.place.group.edited.time}">
<f:convertDateTime pattern="yyyy.MM.dd HH:mm" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:inputText> </h:inputText>
<h:outputLabel value="#{i18n['placegroup.details']}:" /> <h:outputLabel value="#{i18n['placegroup.details']}:" />
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
<h:outputLabel value="#{i18n['placegroup.created']}:" /> <h:outputLabel value="#{i18n['placegroup.created']}:" />
<h:inputText value="#{placegroupView.group.created.time}"> <h:inputText value="#{placegroupView.group.created.time}">
<f:convertDateTime pattern="yyyy.MM.dd HH:mm" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:inputText> </h:inputText>
<h:outputLabel value="#{i18n['placegroup.edited']}:" /> <h:outputLabel value="#{i18n['placegroup.edited']}:" />
<h:inputText value="#{placegroupView.group.edited.time}"> <h:inputText value="#{placegroupView.group.edited.time}">
<f:convertDateTime pattern="yyyy.MM.dd HH:mm" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:inputText> </h:inputText>
<h:outputLabel value="#{i18n['placegroup.details']}:" /> <h:outputLabel value="#{i18n['placegroup.details']}:" />
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<h:outputLabel value="#{i18n['place.releasetime']}:" /> <h:outputLabel value="#{i18n['place.releasetime']}:" />
<h:outputText value="#{placegroupView.place.releaseTime.time}"> <h:outputText value="#{placegroupView.place.releaseTime.time}">
<f:convertDateTime pattern="yyyy.MM.dd HH:mm" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
<h:outputLabel value="#{i18n['place.code']}:" /> <h:outputLabel value="#{i18n['place.code']}:" />
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<h:outputText value="#{i18n['placemanagement.placeNameLike']}" /><h:inputText value="#{place}" /> <h:outputText value="#{i18n['placemanagement.placeNameLike']}" /><h:inputText value="#{place}" />
<h:outputLabel for="paidDate" value="#{i18n['bill.paidDate']}:" /> <h:outputLabel for="paidDate" value="#{i18n['bill.paidDate']}:" />
<h:inputText id="paidDate" value="#{billManageView.bill.paidDate}"> <h:inputText id="paidDate" value="#{billManageView.bill.paidDate}">
<f:convertDateTime /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:inputText> </h:inputText>
<h:outputLabel value="#{i18n['bill.billNumber']}:" /> <h:outputLabel value="#{i18n['bill.billNumber']}:" />
</h:panelGrid> </h:panelGrid>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<h:outputText value="#{i18n['accountEvent.eventTime']}" /> <h:outputText value="#{i18n['accountEvent.eventTime']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.eventTime.time}"> <h:outputText value="#{ac.eventTime.time}">
<f:convertDateTime type="both" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
<h:column> <h:column>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<h:outputText value="#{i18n['accountEvent.delivered']}" /> <h:outputText value="#{i18n['accountEvent.delivered']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.delivered.time}"> <h:outputText value="#{ac.delivered.time}">
<f:convertDateTime type="both" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,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 dateStyle="short" /> <f:convertDateTime pattern="#{sessionHandler.dateFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
<h:column> <h:column>
......
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
<composite:attribute name="bill" required="true" />
</composite:interface>
<composite:implementation>
<h:panelGrid columns="2">
<h:outputLabel for="billnr" value="#{i18n['bill.billNumber']}:" />
<h:outputText id="billnr" value="#{cc.attrs.bill.billNumber}" />
<h:outputLabel for="addr1" value="#{i18n['bill.addr1']}:" />
<h:outputText id="addr1" value="#{cc.attrs.bill.addr1}" />
<h:outputLabel for="addr2" value="#{i18n['bill.addr2']}:" />
<h:outputText id="addr2" value="#{cc.attrs.bill.addr2}" />
<h:outputLabel for="addr3" value="#{i18n['bill.addr3']}:" />
<h:outputText id="addr3" value="#{cc.attrs.bill.addr3}" />
<h:outputLabel for="addr4" value="#{i18n['bill.addr4']}:" />
<h:outputText id="addr4" value="#{cc.attrs.bill.addr4}" />
<h:outputLabel for="addr5" value="#{i18n['bill.addr5']}:" />
<h:outputText id="addr5" value="#{cc.attrs.bill.addr5}" />
<h:outputLabel for="sentDate" value="#{i18n['bill.sentDate']}:" />
<h:outputText id="sentDate" value="#{cc.attrs.bill.sentDateTime}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
<h:outputLabel for="paymenttime" value="#{i18n['bill.paymentTime']}:" />
<h:outputText id="paymenttime" value="#{cc.attrs.bill.paymentTime}" />
<h:outputLabel for="noticetime" value="#{i18n['bill.noticetime']}:" />
<h:outputText id="noticetime" value="#{cc.attrs.bill.noticetime}" />
<h:outputLabel for="theirRef" value="#{i18n['bill.theirReference']}:" />
<h:outputText id="theirRef" value="#{cc.attrs.bill.theirReference}" />
<h:outputLabel for="ourRef" value="#{i18n['bill.ourReference']}:" />
<h:outputText id="ourRef" value="#{cc.attrs.bill.ourReference}" />
<h:outputLabel for="delivTerm" value="#{i18n['bill.deliveryTerms']}:" />
<h:outputText id="delivTerm" value="#{cc.attrs.bill.deliveryTerms}" />
<h:outputLabel for="notes" value="#{i18n['bill.notes']}:" />
<h:outputText id="notes" value="#{cc.attrs.bill.notes}" />
</h:panelGrid>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?> <?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:role="http://java.sun.com/jsf/composite/tools/role">
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:role="http://java.sun.com/jsf/composite/tools/role"
>
<composite:interface> <composite:interface>
...@@ -20,9 +17,7 @@ ...@@ -20,9 +17,7 @@
<h:outputText value="#{i18n['nasty.user']}" /> <h:outputText value="#{i18n['nasty.user']}" />
</f:facet> </f:facet>
<ui:include src="form.xhtml" /> <ui:include src="form.xhtml" />
<h:commandButton rendered="#{roleView.canWriteRoles()}" id="saverole" value="#{i18n['save']}" <h:commandButton rendered="#{roleView.canWriteRoles()}" id="saverole" value="#{i18n['save']}" action="#{roleView.save}" />
action="#{roleView.save}"
/>
</h:form> </h:form>
</p> </p>
...@@ -39,20 +34,23 @@ ...@@ -39,20 +34,23 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['applicationPermission.description']}" /> <h:outputText value="#{i18n['applicationPermission.description']}" />
</f:facet> </f:facet>
<h:outputText value="#{bapp.description}" /> <h:outputText value="#{i18n[bapp.key]}" />
</h:column> </h:column>
<h:column> <h:column>
<ui:repeat id="permDescs" var="perm" value="#{bapp.permissions}"> <h:selectManyCheckbox layout="pageDirection" value="#{bapp.selected}">
<div>#{perm.name} / #{perm.description}</div> <f:selectItems value="#{bapp.permissions}" var="per" itemLabel="#{i18n[per.i18nKey]}" />
</ui:repeat> </h:selectManyCheckbox>
</h:column> <!-- <ui:repeat id="permDescs" var="perm" value="#{bapp.permissions}"> -->
<h:column> <!-- <div>#{perm.name} / #{perm.description}</div> -->
<ui:repeat id="permissions" var="perm" value="#{bapp.permissions}"> <!-- </ui:repeat> -->
<div>
<h:selectBooleanCheckbox value="#{perm.canHas}" />
</div>
</ui:repeat>
</h:column> </h:column>
<!-- <h:column> -->
<!-- <ui:repeat id="permissions" var="perm" value="#{bapp.permissions}"> -->
<!-- <div> -->
<!-- <h:selectBooleanCheckbox value="#{perm.canHas}" /> -->
<!-- </div> -->
<!-- </ui:repeat> -->
<!-- </h:column> -->
</h:dataTable> </h:dataTable>
<h:commandButton id="save" value="#{i18n['role.savePermissions']}" action="#{roleView.savePermissions}" /> <h:commandButton id="save" value="#{i18n['role.savePermissions']}" action="#{roleView.savePermissions}" />
......
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
<composite:attribute name="accountview" required="true" />
</composite:interface>
<composite:implementation>
<h:form id="accountEventForm">
<h:dataTable border="1" id="ac" value="#{cc.attrs.accountview.accountEvents}"
var="ac">
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.productname']}" />
</f:facet>
<h:outputText value="#{ac.product.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.quantity']}" />
</f:facet>
<h:outputText value="#{ac.quantity}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.unitPrice']}" />
</f:facet>
<h:outputText value="#{ac.unitPrice}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.total']}" />
</f:facet>
<h:outputText value="#{ac.total}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.eventTime']}" />
</f:facet>
<h:outputText value="#{ac.eventTime.time}">
<f:convertDateTime type="both" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.delivered']}" />
</f:facet>
<h:outputText value="#{ac.delivered.time}">
<f:convertDateTime type="both" />
</h:outputText>
</h:column>
<h:column>
<h:commandButton action="#{cc.attrs.accountview.editAccount()}"
value="#{i18n['accountEvent.edit']}" />
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
>
<composite:interface>
<composite:attribute name="bills" required="true" />
</composite:interface>
<composite:implementation>
<h:outputText rendered="#{cc.attrs.bills.rowCount le 0}" value="#{i18n['bills.noBills']}" />
<h:form rendered="#{cc.attrs.billview.bills.rowCount gt 0}">
<h:dataTable styleClass="bordertable" id="billList" value="#{cc.attrs.billview.bills}" var="bill">
<h:column rendered="#{sessionHandler.hasPermission('BILL/WRITE')}">
<f:facet name="header">
<h:outputText value="${i18n['bill.payer']}" />
</f:facet>
<h:outputText value="#{bill.addr1}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.sentDate']}" />
</f:facet>
<h:outputText value="#{bill.sentDate.time}">
<f:convertDateTime dateStyle="short" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.billNumber']}" />
</f:facet>
<h:outputText value="#{bill.billNumber}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.referencenumber']}" />
</f:facet>
<h:outputText value="#{bill.referenceNumberBase}">
<f:converter binding="#{referenceNumberConverter}" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.totalPrice']}" />
</f:facet>
<h:outputText value="#{bill.totalPrice()}">
<f:convertNumber currencyCode="EUR" maxFractionDigits="2" minFractionDigits="2" type="currency" />
</h:outputText>
</h:column>
<h:column>
<a href="#{request.contextPath}/PrintBill?billid=#{bill.id.id}" target="_blank">#{i18n['bill.printBill']}</a>
</h:column>
<h:column rendered="#{sessionHandler.hasPermission('BILL/WRITE')}">
<h:link outcome="/bill/edit" value="#{i18n['bill.edit']}" >
<f:param name="billid" value="#{bill.id.id}" />
</h:link>
</h:column>
<h:column rendered="#{sessionHandler.hasPermission('BILL/WRITE')}">
<h:commandButton rendered="#{bill.paidDate == null}" action="#{cc.attrs.billview.markPaid()}"
value="#{i18n['bill.markPaid']}"
/>
<h:outputText rendered="#{bill.paidDate != null}" value="#{i18n['bill.isPaid']}" />
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
<composite:attribute name="billview" required="true" />
</composite:interface>
<composite:implementation>
<h:form id="modifyFwTemplate">
<h:inputHidden rendered="#{!empty foodwaveView.waveTemplate.id.id}" value="foodwaveView.waveTemplate.id.id}" />
<h:panelGrid columns="2">
<h:outputLabel value="#{i18n['foodwavetemplate']}:" />
<h:inputText value="#{foodwaveView.waveTemplate.name}" />
</h:panelGrid>
<h:selectManyCheckbox converter="#{productConverter}" layout="pageDirection" id="products"
value="#{foodwaveView.waveTemplate.products}">
<f:selectItems var="proditem" itemLabel="#{proditem.name}" value="#{productView.productlist}" />
</h:selectManyCheckbox>
<h:commandButton rendered="#{empty foodwaveView.waveTemplate.id.id}" action="#{foodwaveView.createTemplate()}"
value="Create" />
<h:commandButton rendered="#{!empty foodwaveView.waveTemplate.id.id}" action="#{foodwaveView.saveTemplate()}"
value="Save" />
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:layout="http://java.sun.com/jsf/composite/tools/layout">
<composite:interface>
<composite:attribute name="selected" required="true" />
</composite:interface>
<composite:implementation>
<layout:level1link value="topmenu.frontpage" outcome="frontpage" selected="#{cc.attrs.selected == 'frontpage'}" />
<layout:level1link value="topmenu.usersPreferences" outcome="userprefs" selected="#{cc.attrs.selected == 'userprefs'} " />
<layout:level1link value="topmenu.shoppings" outcome="shopfrontpage" selected="#{cc.attrs.selected == 'shopfrontpage'}" />
<layout:level1link value="topmenu.adminfront" outcome="adminfront" selected="#{cc.attrs.selected == 'adminfront'}" />
</composite:implementation>
</html>
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
>
<composite:interface>
<composite:attribute name="isOneliner" required="false" />
</composite:interface>
<composite:implementation>
<h:form id="login">
<c:choose>
<c:when test="#{not empty cc.attrs.isOneliner}">
<h:inputText id="linelogin" value="#{authView.login}" />
<h:inputSecret id="linepwd" value="#{authView.password}" />
<h:commandButton id="onelinesubmit" action="#{authView.executeLogin()}" value="#{i18n['login.submit']}" />
</c:when>
<c:otherwise>
<h:panelGrid columns="2">
<h:outputLabel for="gridLogin" value="#{i18n['login.username']}" />
<h:inputText id="gridLogin" value="#{authView.login}" />
<h:outputLabel for="gridPwd" value="#{i18n['login.password']}" />
<h:inputSecret id="gridPwd" value="#{authView.password}" />
</h:panelGrid>
<h:commandButton id="gridsubmit" action="#{authView.executeLogin()}" value="#{i18n['login.submit']}" />
</c:otherwise>
</c:choose>
</h:form>
</composite:implementation>
</html>
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form>
<h:commandLink immediate="true" action="#{sessionHandler.logout}" value="#{i18n['login.logout']}" />
</h:form>
</composite:implementation>
</html>
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:role="http://java.sun.com/jsf/composite/tools/role">
<composite:interface>
</composite:interface>
<composite:implementation>
<tools:fatalPermission target="MAP" permission="WRITE" />
<h:form>
<h:panelGrid columns="2">
<h:outputText value="#{i18n['map.name']}" />
<h:inputText value="#{mapManageView.mapname}" />
<h:commandButton id="createrole" value="#{i18n['map.create']}"
action="#{mapManageView.createMap}" />
</h:panelGrid>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:role="http://java.sun.com/jsf/composite/tools/role">
<composite:interface>
<composite:attribute name="commitvalue" required="true" />
<composite:attribute name="commitaction" required="true" method-signature="java.lang.String action()" />
</composite:interface>
<composite:implementation>
<h:form id="productform">
<h:inputHidden value="#{mapManageView.map.id.id}" />
<h:panelGrid columns="2">
<h:outputLabel value="#{i18n['eventmap.name']}:" />
<h:inputText value="#{mapManageView.map.name}" />
<h:outputLabel value="#{i18n['eventmap.notes']}:" />
<h:inputTextarea cols="40" rows="5" value="#{mapManageView.map.notes}" />
<h:outputLabel value="#{i18n['eventmap.active']}:" />
<h:selectBooleanCheckbox value="#{mapManageView.map.active}" />
<h:commandButton id="commitbtn" action="#{cc.attrs.commitaction}" value="#{cc.attrs.commitvalue}" />
</h:panelGrid>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:role="http://java.sun.com/jsf/composite/tools/role">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form id="productform">
<h:panelGrid columns="2">
<h:outputLabel value="#{i18n['map.tablesHorizontal']}:" />
<h:selectBooleanCheckbox value="#{mapManageView.tablesHorizontal}" />
<h:outputLabel value="#{i18n['map.oneRowTable']}:" />
<h:selectBooleanCheckbox value="#{mapManageView.oneRowTable}" />
<h:outputLabel value="#{i18n['map.width']}:" />
<h:inputText value="#{mapManageView.width}" />
<h:outputLabel value="#{i18n['map.height']}:" />
<h:inputText value="#{mapManageView.height}" />
<h:outputLabel value="#{i18n['map.startX']}:" />
<h:inputText value="#{mapManageView.startX}" />
<h:outputLabel value="#{i18n['map.startY']}:" />
<h:inputText value="#{mapManageView.startY}" />
<h:outputLabel value="#{i18n['map.placesInRow']}:" />
<h:inputText value="#{mapManageView.placesInRow}" />
<h:outputLabel value="#{i18n['map.tableCount']}:" />
<h:inputText value="#{mapManageView.tableCount}" />
<h:outputLabel value="#{i18n['map.tableXdiff']}:" />
<h:inputText value="#{mapManageView.tableXdiff}" />
<h:outputLabel value="#{i18n['map.tableYdiff']}:" />
<h:inputText value="#{mapManageView.tableYdiff}" />
<h:outputLabel value="#{i18n['map.namebase']}:" />
<h:inputText value="#{mapManageView.namebase}" />
<h:outputLabel value="#{i18n['map.product']}:" />
<h:selectOneMenu converter="#{productConverter}"
value="#{mapManageView.mapproduct}">
<f:selectItems var="prod" itemLabel="#{prod.name}"
value="#{productView.productlist}" />
</h:selectOneMenu>
<h:commandButton id="commitbtn" action="#{mapManageView.generatePlaces()}"
value="#{i18n['map.generate']}" />
</h:panelGrid>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form>
<h:dataTable border="1" id="productListTable" value="#{mapManageView.maps}"
var="map">
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['map.id']}" />
</f:facet>
<h:outputText value="#{map.id.id}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['map.name']}" />
</f:facet>
<h:outputText value="#{map.name}" />
</h:column>
<h:column>
<h:commandButton id="saverole" action="#{mapManageView.editMap()}"
value="#{i18n['map.edit']}" />
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form>
<h:dataTable border="1" id="Placelist" value="#{mapManageView.map.places}"
var="place">
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['place.id']}" />
</f:facet>
<h:outputText value="#{place.id.id}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['place.name']}" />
</f:facet>
<h:outputText value="#{place.name}" />
</h:column>
<h:column>
<h:commandButton id="saverole" action="#{mapManageView.editplace()}"
value="#{i18n['place.edit']}" />
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:role="http://java.sun.com/jsf/composite/tools/role"
>
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form id="placeselectform">
<h:commandButton rendered="#{mapView.canUserBuy()}" value="#{i18n['mapView.buyPlaces']}"
action="#{mapView.buySelectedPlaces()}"
/>
<h:commandButton styleClass="imgcenter" id="commandbutton" image="/PlaceMap?mapid=#{mapView.activeMap.id.id}"
actionListener="#{placeView.placeSelectActionListener}"
/>
<h:panelGrid styleClass="placeSelectInfotable" columns="3">
<h:panelGrid columns="2">
<div
style="border-color: black; border-style: solid; border-width: 1px; background-color: grey; width: 10px; height: 10px;"
>&nbsp;</div>
<h:outputText value="#{i18n['placeSelect.legend.grey']}" />
<div
style="border-color: black; border-style: solid; border-width: 1px; background-color: white; width: 10px; height: 10px;"
>&nbsp;</div>
<h:outputText value="#{i18n['placeSelect.legend.white']}" />
<div
style="border-color: black; border-style: solid; border-width: 1px; background-color: red; width: 10px; height: 10px;"
>&nbsp;</div>
<h:outputText value="#{i18n['placeSelect.legend.red']}" />
<div
style="border-color: black; border-style: solid; border-width: 1px; background-color: green; width: 10px; height: 10px;"
>&nbsp;</div>
<h:outputText value="#{i18n['placeSelect.legend.green']}" />
<div
style="border-color: black; border-style: solid; border-width: 1px; background-color: blue; width: 10px; height: 10px;"
>&nbsp;</div>
<h:outputText value="#{i18n['placeSelect.legend.blue']}" />
</h:panelGrid>
<h:panelGroup>
<h:panelGrid columnClasses=",rightalign" columns="2">
<h:outputLabel value="#{i18n['placeSelect.totalPlaces']}:" />
<h:outputText value="#{mapView.activeMap.places.size()}" />
<h:outputLabel value="#{i18n['placeSelect.placesleft']}:" />
<h:outputText value="#{mapView.placeLeftToSelect()}" />
<h:outputLabel rendered="#{mapView.canUserBuy()}" value="#{i18n['user.accountBalance']}:" />
<h:outputText rendered="#{mapView.canUserBuy()}" value="#{mapView.user.accountBalance}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
<h:outputLabel rendered="#{mapView.canUserBuy()}" value="#{i18n['placeSelect.reservationPrice']}:" />
<h:outputText rendered="#{mapView.canUserBuy()}" value="#{mapView.reservationPrice}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
</h:panelGrid>
</h:panelGroup>
<h:panelGrid columnClasses=",rightalign" columns="2" rendered="#{not empty placeView.place }">
<h:outputLabel value="#{i18n['placeSelect.placeName']}:" />
<h:outputText value="#{placeView.place.name}" />
<h:outputLabel value="#{i18n['placeSelect.placeProductName']}:" />
<h:outputText value="#{placeView.place.product.name}" />
<h:outputLabel value="#{i18n['placeSelect.placePrice']}:" />
<h:outputText class="" value="#{placeView.place.product.price}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
<h:commandButton rendered="#{sessionHandler.canWrite('MAP')}" value="#{i18n['place.edit']}" action="/place/edit" />
</h:panelGrid>
</h:panelGrid>
</h:form>
<div>
<h:outputText escape="false" value="#{mapView.activeMap.notes}" />
</div>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:role="http://java.sun.com/jsf/composite/tools/role">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form>
<p><input type="hidden" name="id" value="#{mapManageView.map.id.id}" /></p>
<h:panelGrid columns="2">
<h:outputLabel value="#{i18n['setBuyable.like']}" />
<h:inputText value="#{mapManageView.buyableLike}" />
<h:commandButton id="lockbtn" action="#{mapManageView.lockBuyable}" value="#{i18n['setBuyable.lock']}" />
<h:commandButton id="releasebtn" action="#{mapManageView.releaseBuyable}" value="#{i18n['setBuyable.release']}" />
</h:panelGrid>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:role="http://java.sun.com/jsf/composite/tools/role"
>
<composite:interface>
</composite:interface>
<composite:implementation>
<form id="bgsubmit"
onsubmit="window.open('', 'imagesubmitpopup', 'height=200,width=400'); this.target='imagesubmitpopup'; return true; "
action="#{request.contextPath}/UploadServlet?type=mapimage" enctype="multipart/form-data" method="post"
>
<p>
<input type="hidden" name="id" value="#{mapManageView.map.id.id}" /> Lähetä kartan taustakuva
</p>
<h:panelGrid columns="2">
<h:outputLabel value="#{i18n['imagefile.file']}" />
<input type="file" name="file" />
<!-- <h:outputLabel value="#{i18n['imagefile.description']}"/><input type="text" name="description" /> -->
<h:panelGroup>
<input type="submit" name="submit" value="#{i18n['user.imagesubmit']}" />
</h:panelGroup>
</h:panelGrid>
</form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form>
<h:panelGrid columns="2">
<h:outputLabel value="#{i18n['product.name']}:" /><h:inputText value="#{productView.productname}" />
<h:outputLabel value="#{i18n['product.price']}:" /><h:inputText value="#{productView.productprice}" />
<h:commandButton action="#{productView.createProduct()}" value="#{i18n['product.create']}" />
</h:panelGrid>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
>
<composite:interface>
<composite:attribute name="commitvalue" required="true" />
<composite:attribute name="commitaction" required="true" method-signature="java.lang.String action()" />
</composite:interface>
<composite:implementation>
<h:form id="productform">
<h:inputHidden value="#{productView.product.id.id}" />
<h:panelGrid columns="2">
<h:outputLabel value="#{i18n['product.name']}:" />
<h:inputText value="#{productView.product.name}" />
<h:outputLabel value="#{i18n['product.price']}:" />
<h:inputText value="#{productView.product.price}" />
<h:outputLabel value="#{i18n['product.unitName']}:" />
<h:inputText value="#{productView.product.unitName}" />
<h:outputLabel value="#{i18n['product.vat']}:" />
<h:inputText value="#{productView.product.vat}" />
<h:outputLabel value="#{i18n['product.sort']}:" />
<h:inputText value="#{productView.product.sort}" />
<h:outputLabel value="#{i18n['product.barcode']}:" />
<h:inputText value="#{productView.product.barcode}" />
<h:outputLabel value="#{i18n['product.prepaid']}" />
<h:selectBooleanCheckbox value="#{productView.product.prepaid}" />
<h:outputLabel value="#{i18n['product.prepaidInstant']}" />
<h:selectBooleanCheckbox value="#{productView.product.prepaidInstant}" />
<h:outputLabel value="#{i18n['product.prepaidInstant']}" />
<h:selectBooleanCheckbox value="#{productView.product.prepaidInstant}" />
<h:outputLabel value="#{i18n['product.providedRole']}" />
<h:selectOneMenu layout="pageDirection" value="#{productView.product.role}" converter="#{roleConverter}" id="roles">
<f:selectItems var="role" itemLabel="#{role.name}" value="#{roleDataView.roles}" />
</h:selectOneMenu>
<h:commandButton id="commitbtn" action="#{cc.attrs.commitaction}" value="#{cc.attrs.commitvalue}" />
</h:panelGrid>
</h:form>
<tools:canWrite target="PRODUCT">
<h2>#{productview.discounts}</h2>
<h:form id="creatediscount">
<h:panelGrid columns="2">
<h:outputLabel value="#{i18n['discount.shortdesc']}" />
<h:inputText value="#{productView.discountdesc}" />
<h:commandButton value="#{i18n['discount.create']}" action="#{productView.createDiscount()}" />
</h:panelGrid>
</h:form>
<h:form id="discounts">
<h:dataTable border="1" id="discount" value="#{productView.productDiscounts}" var="discount">
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['discount.percentage']}" />
</f:facet>
<h:outputText value="#{discount.percentage}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['discount.code']}" />
</f:facet>
<h:outputText value="#{discount.code}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['discount.details']}" />
</f:facet>
<h:outputText value="#{discount.details}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['discount.shortdesc']}" />
</f:facet>
<h:outputText value="#{discount.shortdesc}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['discount.amountMin']}" />
</f:facet>
<h:outputText value="#{discount.amountMin}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['discount.amountMax']}" />
</f:facet>
<h:outputText value="#{discount.amountMax}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['discount.maxNum']}" />
</f:facet>
<h:outputText value="#{discount.maxNum}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['discount.perUser']}" />
</f:facet>
<h:outputText value="#{discount.perUser}" />
</h:column>
<h:column>
<h:commandButton action="#{productView.editDiscount()}" value="#{i18n['discount.edit']}" />
</h:column>
</h:dataTable>
</h:form>
</tools:canWrite>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form>
<h:dataTable border="1" id="product" value="#{productListView.products}" var="product">
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['product.name']}" />
</f:facet>
<h:outputText value="#{product.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['product.price']}" />
</f:facet>
<h:outputText value="#{product.price}" />
</h:column>
<h:column>
<h:commandButton action="#{productView.edit()}" value="#{i18n['product.edit']}" />
</h:column>
<h:column>
<f:facet name="header">
#{i18n['product.cashed']}
</f:facet>
<h:outputText value="#{product.soldCash}">
<f:convertNumber minFractionDigits="0" maxFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
#{i18n['product.billed']}
</f:facet>
<h:outputText value="#{product.soldBill}">
<f:convertNumber minFractionDigits="0" maxFractionDigits="2" />
</h:outputText>
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
<composite:attribute name="items" required="true" />
<composite:attribute name="commitValue" required="true" />
<composite:attribute name="commitaction" method-signature="java.lang.String action()" required="true" />
</composite:interface>
<composite:implementation>
<h:outputScript target="head" library="script" name="jquery.min.js" />
<h:outputScript target="head" library="script" name="shopscript.js" />
<h:dataTable styleClass="bordertable" id="billcart" value="#{cc.attrs.items}" var="cart">
<h:column>
<f:facet name="header">
<h:outputText id="name" value="${i18n['product.name']}" />
</f:facet>
<h:outputText value="#{cart.product.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['product.price']}" />
</f:facet>
<h:outputText id="price" value="#{cart.product.price}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet>
<a href="#" onclick="return changeCartCount($(this).next().next(), -1)">-1</a>
<a href="#" onclick="return changeCartCount($(this).next(), -10)">-10</a>
<h:inputText size="4" id="cartcount" value="#{cart.count}" />
<a href="#" onclick="return changeCartCount($(this).prev(), +1)">+1</a>
<a href="#" onclick="return changeCartCount($(this).prev().prev(), +10)">+10</a>
<h:inputHidden value="#{cart.id}" />
</h:column>
</h:dataTable>
<h:commandButton action="#{cc.attrs.commitaction}" id="commitbutton" value="#{cc.attrs.commitValue}" />
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:role="http://java.sun.com/jsf/composite/tools/role">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form>
<ui:include src="form.xhtml" />
<h:commandButton id="createrole" value="#{i18n['role.create']}" action="#{roleView.create()}" />
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:role="http://java.sun.com/jsf/composite/cditools/role"
>
<composite:interface>
</composite:interface>
<composite:implementation>
<p>
<h:form id="roleform">
<h:inputHidden id="id" value="roleView.role.id" />
<f:facet name="errorMessage">
<h:outputText value="#{i18n['nasty.user']}" />
</f:facet>
<ui:include src="form.xhtml" />
<h:commandButton rendered="#{roleView.canWriteRoles()}" id="saverole" value="#{i18n['save']}"
action="#{roleView.save}"
/>
</h:form>
</p>
<p>
<h:form>
<h:dataTable border="1" id="bortalApps" value="#{roleView.rolePermissions}" var="bapp">
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['applicationPermission.name']}" />
</f:facet>
<h:outputText value="#{bapp.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['applicationPermission.description']}" />
</f:facet>
<h:outputText value="#{bapp.description}" />
</h:column>
<h:column>
<ui:repeat id="permDescs" var="perm" value="#{bapp.permissions}">
<div>#{perm.name} / #{perm.description}</div>
</ui:repeat>
</h:column>
<h:column>
<ui:repeat id="permissions" var="perm" value="#{bapp.permissions}">
<div>
<h:selectBooleanCheckbox value="#{perm.canHas}" />
</div>
</ui:repeat>
</h:column>
</h:dataTable>
<h:commandButton id="save" value="#{i18n['role.savePermissions']}" action="#{roleView.savePermissions}" />
</h:form>
</p>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools">
<ui:composition>
<h:panelGrid columns="2">
<h:outputText value="#{i18n['role.name']}" />
<h:inputText value="#{roleView.role.name}" />
<h:outputText value="#{i18n['role.parents']}" />
<h:selectManyCheckbox converter="#{roleConverter}" layout="pageDirection" id="roleparents"
value="#{roleView.role.parents}">
<f:selectItems var="par" itemLabel="#{par.name}" value="#{roleView.possibleParents}" />
</h:selectManyCheckbox>
<h:outputLabel value="#{i18n['role.cardtemplate']}" />
<h:selectOneMenu converter="#{cardTemplateConverter}" value="#{roleView.role.cardTemplate}">
<f:selectItems var="role" itemLabel="#{role.name}" value="#{cardView.templatesWithNull}" />
</h:selectOneMenu>
</h:panelGrid>
</ui:composition>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
>
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form id="rolelist">
<h:dataTable border="1" id="user" value="#{roleDataView.roles}" var="role">
<h:column>
<f:facet name="header">
<h:outputText value="#" />
</f:facet>
<h:outputText value="#{role.id}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['role.name']}" />
</f:facet>
<h:outputText value="#{role.name}" />
</h:column>
<h:column>
<h:link outcome="/role/edit" value="#{i18n['role.edit']}">
<f:param name="roleid" value="#{role.id}" />
</h:link>
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form>
<h:dataTable border="1" id="productListTable"
value="#{productView.userShoppableProducts}" var="product">
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['product.name']}" />
</f:facet>
<h:outputText value="#{product.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['product.price']}" />
</f:facet>
<h:outputText value="#{product.price}" />
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
>
<composite:interface>
</composite:interface>
<composite:implementation>
<h1>#{readerView.readername}</h1>
<h:form>
<h:dataTable border="1" id="event" value="#{readerView.readerEvents}" var="event">
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['reader.tag']}" />
</f:facet>
<h:outputText id="tag" value="#{event.tag}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['reader.user']}" />
</f:facet>
<h:outputText rendered="#{!empty event.event}"
value="#{event.event.printedCard.user.wholeName} (#{event.event.printedCard.user.nick})"
/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['reader.tag']}" />
</f:facet>
<h:dataTable value="#{event.actions}" var="action">
<h:column>
<h:outputText value="#{action}" />
</h:column>
</h:dataTable>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['readerevent.seenSince']}" />
</f:facet>
<h:outputText value="#{event.seenSince}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['gamepoints']}" />
</f:facet>
<h:outputText value="#{event.event.gamePoint}" />
</h:column>
<h:column>
<h:link outcome="/rfid/assocToUser" value="#{i18n['readerevent.associateToUser']}">
<f:param value="#{event.tag}" var="tag" />
</h:link>
<h:commandButton rendered="#{empty event.event}" action="#{readerView.selectEvent()}"
value="#{i18n['readerevent.associateToUser']}"
/>
<h:commandButton rendered="#{!empty event.event}" action="#{readerView.selectEvent()}"
value="#{i18n['readerevent.shopToUser']}"
/>
</h:column>
<h:column>
<h:commandButton rendered="#{!empty event.event}" action="#{readerView.editUser()}" value="#{i18n['user.edit']}" />
</h:column>
<h:column rendered="#{sessionHandler.hasPermission('GAME','WRITE')}">
<h:commandButton action="#{readerView.editGameEvent()}" value="Game" />
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
>
<composite:interface>
</composite:interface>
<composite:implementation>
<h:dataTable border="1" id="reader" value="#{rfidContainer.readers}" var="rr">
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['reader.name']}" />
</f:facet>
<h:outputText value="#{rr}" />
</h:column>
<h:column>
<h:link outcome="/shop/showReaderEvents" value="#{i18n['reader.select']}">
<f:param value="#{rr}" name="reader"/>
</h:link>
</h:column>
</h:dataTable>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
>
<composite:interface>
<composite:attribute name="creating" required="false" default="false" />
<composite:attribute name="commitvalue" required="true" />
<composite:attribute name="commitaction" required="true" method-signature="java.lang.String action()" />
</composite:interface>
<composite:implementation>
<h:form id="userform">
<h:inputHidden rendered="#{!cc.attrs.creating}" value="#{userView.user.id}" />
<h:panelGrid columns="3">
<h:outputLabel rendered="#{!cc.attrs.creating}" value="#{i18n['user.login']}:" for="viewlogin" />
<h:outputText rendered="#{!cc.attrs.creating}" disabled="#{!cc.attrs.creating and !userView.canSave()}"
id="viewlogin" value="#{userView.user.login}"
/>
<h:message rendered="#{!cc.attrs.creating}" for="viewlogin" />
<h:outputLabel rendered="#{cc.attrs.creating}" value="#{i18n['user.login']}:" for="login" />
<h:inputText rendered="#{cc.attrs.creating}" disabled="#{!cc.attrs.creating and !userView.canSave()}" id="login"
value="#{userView.user.login}"
/>
<h:message rendered="#{cc.attrs.creating}" for="login" />
<h:outputLabel value="#{i18n['user.nick']}:" for="nick" />
<h:inputText id="nick" disabled="#{!cc.attrs.creating and !userView.canSave()}" value="#{userView.user.nick}" />
<h:message for="nick" />
<h:outputLabel value="#{i18n['user.email']}:" for="email" />
<h:inputText id="email" disabled="#{!cc.attrs.creating and !userView.canSave()}" value="#{userView.user.email}" />
<h:message for="email" />
<h:outputLabel value="#{i18n['user.firstNames']}:" for="firstnames" />
<h:inputText id="firstnames" disabled="#{!cc.attrs.creating and !userView.canSave()}"
value="#{userView.user.firstnames}"
/>
<h:message for="firstnames" />
<h:outputLabel value="#{i18n['user.lastName']}:" for="lastname" />
<h:inputText id="lastname" disabled="#{!cc.attrs.creating and !userView.canSave()}" value="#{userView.user.lastname}" />
<h:message for="lastname" />
<h:outputLabel value="#{i18n['user.address']}:" for="address" />
<h:inputText id="address" disabled="#{!cc.attrs.creating and !userView.canSave()}" value="#{userView.user.address}" />
<h:message for="address" />
<h:outputLabel value="#{i18n['user.zipCode']}:" for="zip" />
<h:inputText id="zip" disabled="#{!cc.attrs.creating and !userView.canSave()}" value="#{userView.user.zip}" />
<h:message for="zip" />
<h:outputLabel value="#{i18n['user.town']}:" for="town" />
<h:inputText id="town" disabled="#{!cc.attrs.creating and !userView.canSave()}" value="#{userView.user.town}" />
<h:message for="town" />
<h:outputLabel rendered="#{sessionHandler.superadmin}" value="#{i18n['user.superadmin']}:" for="superadmin" />
<h:selectBooleanCheckbox disabled="#{!cc.attrs.creating and !userView.canSave()}"
rendered="#{sessionHandler.superadmin}" id="superadmin" value="#{userView.user.superadmin}"
/>
<h:message rendered="#{sessionHandler.superadmin}" for="superadmin" />
<!--
<h:outputLabel value="#{i18n['user.defaultImage']}:" for="currentImage" />
<h:selectOneMenu rendered="#{sessionHandler.hasPermission('USER', 'READ')}" id="currentImage" value="#{userView.user.currentImage}" converter="#{userimageConverter}" >
<f:selectItems var="image" itemLabel="#{image.description}" value="#{userView.user.userImageList}" />
</h:selectOneMenu>
-->
<h:outputLabel value="#{i18n['user.sex']}:" for="sex" />
<h:selectOneRadio disabled="#{!cc.attrs.creating and !userView.canSave()}" id="sex" value="#{userView.user.gender}">
<f:selectItem id="undefined" itemLabel="#{i18n['user.sex.UNDEFINED']}" itemValue="UNDEFINED" />
<f:selectItem id="male" itemLabel="#{i18n['user.sex.MALE']}" itemValue="MALE" />
<f:selectItem id="female" itemLabel="#{i18n['user.sex.FEMALE']}" itemValue="FEMALE" />
</h:selectOneRadio>
<h:message for="sex" />
<h:outputLabel rendered="#{cc.attrs.creating}" value="#{i18n['user.password']}:" for="password" />
<h:inputSecret rendered="#{cc.attrs.creating}" id="password" value="#{userView.password}" />
<h:message rendered="#{cc.attrs.creating}" for="password" />
<h:outputLabel rendered="#{cc.attrs.creating}" value="#{i18n['user.passwordcheck']}:" for="passwordcheck" />
<h:inputSecret rendered="#{cc.attrs.creating}" id="passwordcheck" value="#{userView.passwordcheck}" />
<h:message rendered="#{cc.attrs.creating}" for="passwordcheck" />
<h:outputLabel rendered="#{roleView.canReadRoles()}" value="#{i18n['user.roles']}:"
for="roles"
/>
<h:selectManyCheckbox converter="#{roleConverter}"
rendered="#{roleView.canReadRoles()}"
disabled="#{!roleView.canModifyRoles()}" layout="pageDirection" id="roles"
value="#{userView.user.roles}"
>
<f:selectItems var="roleitem" itemLabel="#{roleitem.name}" value="#{userView.userRoles}" />
</h:selectManyCheckbox>
<h:message rendered="#{sessionHandler.hasPermission('ROLE_MANAGEMENT', 'READ')}" for="roles" />
<h:commandButton rendered="#{cc.attrs.creating or userView.canSave()}" id="commitbtn"
action="#{cc.attrs.commitaction}" value="#{cc.attrs.commitvalue}"
/>
</h:panelGrid>
</h:form>
</composite:implementation>
</html>
2<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/cditools"
>
<composite:interface>
</composite:interface>
<composite:implementation>
<h:dataTable border="1" id="user" value="#{userSearchView.users}" var="user">
<h:column>
<f:facet name="header">
<h:outputText value="Id" />
</f:facet>
<h:outputText value="#{user.id}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.login']}" />
</f:facet>
<h:outputText value="#{user.login}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.nick']}" />
</f:facet>
<h:outputText value="#{user.nick}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.firstNames']}" />
</f:facet>
<h:outputText value="#{user.firstnames}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.lastName']}" />
</f:facet>
<h:outputText value="#{user.lastname}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.email']}" />
</f:facet>
<h:outputText value="#{user.email}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.accountBalance']}" />
</f:facet>
<h:outputText value="#{user.accountBalance}">
<f:convertNumber />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.image']}" />
</f:facet>
<h:link action="#{userView.showImage()}"
value="#{(empty user.currentImage)?i18n['user.noImage']:i18n['user.hasImage']}"
/>
</h:column>
<h:column>
<h:link outcome="/user/edit" value="#{i18n['user.edit']}">
<f:param name="userid" value="#{user.id}" />
</h:link>
</h:column>
<h:column>
<h:link outcome="/product/shop" value="#{i18n['user.shop']}" >
<f:param name="userid" value="#{user.id}" />
</h:link>
</h:column>
</h:dataTable>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
</composite:interface>
<composite:implementation>
<tools:fatalPermission target="USER_MANAGEMENT" permission="READ" />
<h:form id="userlistform">
<h:dataTable border="1" id="user" value="#{userView.users}" var="user">
<h:column>
<f:facet name="header">
<h:outputText value="Id" />
</f:facet>
<h:outputText value="#{user.id}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.nick']}" />
</f:facet>
<h:outputText value="#{user.nick}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.firstnames']}" />
</f:facet>
<h:outputText value="#{user.firstnames}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.lastname']}" />
</f:facet>
<h:outputText value="#{user.lastname}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.email']}" />
</f:facet>
<h:outputText value="#{user.email}" />
</h:column>
<h:column>
<h:commandButton action="#{userView.edit()}" value="#{i18n['user.edit']}" />
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/cditools"
>
<composite:interface>
</composite:interface>
<composite:implementation>
<h:outputScript target="head" library="script" name="jquery.min.js" />
<h:outputScript target="head" library="jpegcam" name="webcam.js" />
<h:outputScript target="head">
webcam.set_api_url( '#{request.contextPath}/UploadServlet?type=userimage&amp;id=#{userView.user.id}' );
webcam.set_hook('onComplete', 'my_completion_handler');
webcam.set_swf_url('#{request.contextPath}/resources/jpegcam/webcam.swf');
webcam.set_shutter_sound(true,'#{request.contextPath}/resources/jpegcam/shutter.mp3');
function my_completion_handler(msg) {
// extract URL out of PHP output
if (msg.match(/(http\:\/\/\S+)/)) {
var image_url = RegExp.$1;
alert(image_url);
}
}
</h:outputScript>
<button onclick="$('#webcamcontainer').prepend(webcam.get_html(320, 240));$('#webcamcontainer').show();$(this).hide();">#{i18n['userimage.webcam']}</button>
<div id="webcamcontainer" style="display: none;">
asd
<button onclick="webcam.configure()">Configure</button>
<button onclick="webcam.snap()">Ota kuva</button>
</div>
<form
onsubmit="window.open('', 'imagesubmitpopup', 'height=240,width=320'); this.target='imagesubmitpopup'; return true; "
action="#{request.contextPath}/UploadServlet?type=userimage" enctype="multipart/form-data" method="post"
>
<p>
<input type="hidden" name="id" value="#{userView.user.id}" /> Voit lisätä kuvan kävijälippuasi varten. Näin nopeutat
asiointiasi tapahtumaan tullessasi.
</p>
<h:panelGrid columns="2">
<h:outputLabel value="#{i18n['imagefile.file']}" />
<input type="file" name="file" />
<!-- <h:outputLabel value="#{i18n['imagefile.description']}"/><input type="text" name="description" /> -->
<h:panelGroup>
<input type="submit" name="submit" value="#{i18n['user.imagesubmit']}" />
</h:panelGroup>
</h:panelGrid>
</form>
<h2>#{i18n['user.thisIsCurrentImage']}</h2>
<h:form>
<h:commandButton action="#{userView.reloadUser()}" value="Päivitä kuva" />
</h:form>
<h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" />
<h:panelGroup rendered="#{!empty userView.user.currentImage}">
<img width="300" src="#{request.contextPath}/Userimage?imageid=#{userView.user.currentImage.id}" alt="image" />
</h:panelGroup>
<tools:canWrite rendered="#{!empty userView.user.currentImage}" target="USER_MANAGEMENT">
<div>
<h:outputText value="Mime: #{userView.user.currentImage.mimeType}" />
<h:form id="imageconvert">
<h:commandButton action="#{userView.recheckImagetype()}" value="Check imagetype" />
</h:form>
</div>
</tools:canWrite>
</composite:implementation>
</html>
<!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:tools="http://java.sun.com/jsf/composite/tools"
xmlns:bill="http://java.sun.com/jsf/composite/cditools/bills" xmlns:f="http://java.sun.com/jsf/core">
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:event type="preRenderView" listener="#{productShopView.initBillView}" />
<ui:define name="title">
<h1>#{i18n['page.product.validateBillProducts.header']}</h1>
</ui:define>
<ui:define name="content">
<bill:showBill bill="#{billReviewView.bill}" />
<div id="svm-payment">Foobar</div>
<script type="text/javascript" src="//payment.verkkomaksut.fi/js/sv-widget.min.js"></script>
<script type="text/javascript">
SV.widget.initWithToken('svm-payment', '0123456789abcdefg');
</script>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
<!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" xmlns:ui="http://java.sun.com/jsf/facelets" <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:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:f="http://java.sun.com/jsf/core">
xmlns:f="http://java.sun.com/jsf/core"
>
<h:body> <h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata> <f:metadata>
...@@ -54,7 +52,7 @@ ...@@ -54,7 +52,7 @@
<h:outputText value="#{i18n['accountEvent.eventTime']}" /> <h:outputText value="#{i18n['accountEvent.eventTime']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.eventTime.time}"> <h:outputText value="#{ac.eventTime.time}">
<f:convertDateTime type="both" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
<h:column> <h:column>
...@@ -62,7 +60,7 @@ ...@@ -62,7 +60,7 @@
<h:outputText value="#{i18n['accountEvent.delivered']}" /> <h:outputText value="#{i18n['accountEvent.delivered']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.delivered.time}"> <h:outputText value="#{ac.delivered.time}">
<f:convertDateTime type="both" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
......
<!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" xmlns:ui="http://java.sun.com/jsf/facelets" <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: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:p="http://primefaces.org/ui" 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:shop="http://java.sun.com/jsf/composite/cditools/shop">
xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:shop="http://java.sun.com/jsf/composite/cditools/shop"
>
<h:body> <h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<ui:param name="thispage" value="page.user.create" /> <ui:param name="thispage" value="page.user.create" />
...@@ -17,26 +15,29 @@ ...@@ -17,26 +15,29 @@
<ui:define name="title"> <ui:define name="title">
<h1>#{i18n['sendPicture.header']}</h1> <h1>#{i18n['sendPicture.header']}</h1>
</ui:define> </ui:define>
<ui:define name="headerdata">
<script type="text/javascript">
webcam
.set_api_url('#{request.contextPath}/UploadServlet?type=userimage&amp;id=#{userView.selectedUser.id}');
webcam.set_hook('onComplete', 'my_completion_handler');
webcam
.set_swf_url('#{request.contextPath}/resources/jpegcam/webcam.swf');
webcam.set_shutter_sound(true,
'#{request.contextPath}/resources/jpegcam/shutter.mp3');
function my_completion_handler(msg) {
// alert("Completition handler executed" + msg);
window.location.href = "#{request.contextPath}/user/sendPicture.jsf?userid=#{userView.user.id}";
}
</script>
</ui:define>
<ui:define name="content"> <ui:define name="content">
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" /> <h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
<h:outputScript target="head" library="jpegcam" name="webcam.js" /> <h:outputScript target="head" library="jpegcam" name="webcam.js" />
<h:outputScript target="head">
webcam.set_api_url( '#{request.contextPath}/UploadServlet?type=userimage&amp;id=#{userView.selectedUser.id}' ); <button onclick="$('#webcamcontainer').prepend(webcam.get_html(320, 240));$('#webcamcontainer').show();$(this).hide();">#{i18n['userimage.webcam']}</button>
webcam.set_hook('onComplete', 'my_completion_handler');
webcam.set_swf_url('#{request.contextPath}/resources/jpegcam/Webcam.swf');
webcam.set_shutter_sound(true,'#{request.contextPath}/resources/jpegcam/shutter.mp3');
function my_completion_handler(msg) {
// alert("Completition handler executed" + msg);
window.location.href="#{request.contextPath}/user/sendPicture.jsf?userid=#{userView.user.id}";
}
</h:outputScript>
<button
onclick="$('#webcamcontainer').prepend(webcam.get_html(320, 240));$('#webcamcontainer').show();$(this).hide();"
>#{i18n['userimage.webcam']}</button>
<div id="webcamcontainer" style="display: none;"></div> <div id="webcamcontainer" style="display: none;"></div>
...@@ -44,10 +45,8 @@ ...@@ -44,10 +45,8 @@
<p>Voit lisätä kuvan kävijälippuasi varten. Näin nopeutat asiointiasi tapahtumaan tullessasi.</p> <p>Voit lisätä kuvan kävijälippuasi varten. Näin nopeutat asiointiasi tapahtumaan tullessasi.</p>
<p> <p>
Kuvasta on pystyttävä tunnistamaan ongelmitta kortin omistaja. Tästä johtuen kuvan tulee olla selkeä, eikä kuvassa Kuvasta on pystyttävä tunnistamaan ongelmitta kortin omistaja. Tästä johtuen kuvan tulee olla selkeä, eikä kuvassa saa olla useita henkilöitä. Ohjeita hyvän tunnistekuvan ottamiseksi löytyy <a
saa olla useita henkilöitä. Ohjeita hyvän tunnistekuvan ottamiseksi löytyy <a href="http://www.poliisi.fi/poliisi/home.nsf/files/Passikuvaohje_26-02-2008_FI/$file/Passikuvaohje_26-02-2008_FI.pdf">poliisin passikuvaohjeesta.</a>
href="http://www.poliisi.fi/poliisi/home.nsf/files/Passikuvaohje_26-02-2008_FI/$file/Passikuvaohje_26-02-2008_FI.pdf"
>poliisin passikuvaohjeesta.</a>
</p> </p>
...@@ -62,12 +61,10 @@ ...@@ -62,12 +61,10 @@
<h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" /> <h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" />
<ui:fragment rendered="#{!empty userView.user.currentImage}"> <ui:fragment rendered="#{!empty userView.user.currentImage}">
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<img width="300" src="#{request.contextPath}/Userimage?imageid=#{userView.user.currentImage.id}" alt="image" /> <img width="300" src="#{request.contextPath}/dydata/userimage/#{userView.user.currentImage.id}.jpg" alt="image" />
<ui:fragment rendered="#{userView.canManage()}"> <ui:fragment rendered="#{userView.canManage()}">
<h:form> <h:form>
<p:imageCropper value="#{userView.croppedImage}" aspectRatio="0.8" <p:imageCropper value="#{userView.croppedImage}" aspectRatio="0.8" image="/dydata/userimage/#{userView.user.currentImage.id}.jpg" />
image="http://kauppa.insomnia.fi#{request.contextPath}/Userimage?imageid=#{userView.user.currentImage.id}"
/>
<h:commandButton action="#{userView.crop}" value="#{i18n['user.cropImage']}" /> <h:commandButton action="#{userView.crop}" value="#{i18n['user.cropImage']}" />
</h:form> </h:form>
</ui:fragment> </ui:fragment>
...@@ -137,6 +134,8 @@ ...@@ -137,6 +134,8 @@
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</h:body> </h:body>
</html> </html>
\ No newline at end of file
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<h:outputText value="#{i18n['accountEvent.eventTime']}" /> <h:outputText value="#{i18n['accountEvent.eventTime']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.eventTime.time}"> <h:outputText value="#{ac.eventTime.time}">
<f:convertDateTime type="both" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
<h:column> <h:column>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<h:outputText value="#{i18n['accountEvent.delivered']}" /> <h:outputText value="#{i18n['accountEvent.delivered']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.delivered.time}"> <h:outputText value="#{ac.delivered.time}">
<f:convertDateTime type="both" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
......
<!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" xmlns:ui="http://java.sun.com/jsf/facelets" <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:users="http://java.sun.com/jsf/composite/tools/user"
xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/tools/user" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"
>
<h:body> <h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata> <f:metadata>
...@@ -27,9 +25,7 @@ ...@@ -27,9 +25,7 @@
<h:message for="power" /> <h:message for="power" />
<h:outputLabel for="roles" value="#{i18n['cardTemplate.roles']}" /> <h:outputLabel for="roles" value="#{i18n['cardTemplate.roles']}" />
<h:selectManyCheckbox layout="pageDirection" value="#{cardView.cardTemplate.roles}" converter="#{roleConverter}" <h:selectManyCheckbox layout="pageDirection" value="#{cardView.cardTemplate.roles}" converter="#{roleConverter}" id="roles">
id="roles"
>
<f:selectItems var="role" itemLabel="#{role.name}" value="#{roleDataView.roles}" /> <f:selectItems var="role" itemLabel="#{role.name}" value="#{roleDataView.roles}" />
</h:selectManyCheckbox> </h:selectManyCheckbox>
...@@ -43,7 +39,11 @@ ...@@ -43,7 +39,11 @@
<p:fileUpload value="#{cardView.templateImage}" mode="simple" /> <p:fileUpload value="#{cardView.templateImage}" mode="simple" />
<h:commandButton action="#{cardView.saveImage}" value="#{i18n['sendImage']}" /> <h:commandButton action="#{cardView.saveImage}" value="#{i18n['sendImage']}" />
</h:form> </h:form>
<img src="#{request.contextPath}/CardTemplate?imageid=#{cardView.cardTemplate.id}" /> <ui:fragment rendered="#{!empty cardView.cardTemplate}">
<h2>#{i18n['cardTemplate.imageheader']}</h2>
<img src="#{request.contextPath}/dydata/cardtemplate/#{cardView.cardTemplate.id}.img" />
</ui:fragment>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
......
<!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" xmlns:ui="http://java.sun.com/jsf/facelets" <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: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:p="http://primefaces.org/ui" 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:shop="http://java.sun.com/jsf/composite/cditools/shop">
xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:shop="http://java.sun.com/jsf/composite/cditools/shop"
>
<h:body> <h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<ui:param name="thispage" value="page.user.create" /> <ui:param name="thispage" value="page.user.create" />
...@@ -18,43 +15,36 @@ ...@@ -18,43 +15,36 @@
<h1>#{i18n['sendPicture.header']}</h1> <h1>#{i18n['sendPicture.header']}</h1>
<users:usertabs tabId="picture" /> <users:usertabs tabId="picture" />
</ui:define> </ui:define>
<ui:define name="headerdata">
<script type="text/javascript">
webcam
.set_api_url('#{request.contextPath}/UploadServlet?type=userimage&amp;id=#{userView.selectedUser.id}');
webcam.set_hook('onComplete', 'my_completion_handler');
webcam
.set_swf_url('#{request.contextPath}/resources/jpegcam/webcam.swf');
webcam.set_shutter_sound(true,
'#{request.contextPath}/resources/jpegcam/shutter.mp3');
function my_completion_handler(msg) {
// alert("Completition handler executed" + msg);
window.location.href = "#{request.contextPath}/user/sendPicture.jsf?userid=#{userView.user.id}";
}
</script>
</ui:define>
<ui:define name="content"> <ui:define name="content">
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" /> <h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
<h:outputScript target="head" library="jpegcam" name="webcam.js" /> <h:outputScript target="head" library="jpegcam" name="webcam.js" />
<h:outputScript target="head">
webcam.set_api_url( '#{request.contextPath}/UploadServlet?type=userimage&amp;id=#{userView.selectedUser.id}' );
webcam.set_hook('onComplete', 'my_completion_handler');
webcam.set_swf_url('#{request.contextPath}/resources/jpegcam/Webcam.swf');
webcam.set_shutter_sound(true,'#{request.contextPath}/resources/jpegcam/shutter.mp3');
function my_completion_handler(msg) {
// alert("Completition handler executed" + msg);
window.location.href="#{request.contextPath}/user/sendPicture.jsf?userid=#{userView.user.id}";
}
</h:outputScript>
<button
onclick="$('#webcamcontainer').prepend(webcam.get_html(320, 240));$('#webcamcontainer').show();$(this).hide();"
>#{i18n['userimage.webcam']}</button>
<div id="webcamcontainer" style="display: none;"></div>
<button onclick="$('#webcamcontainer').prepend(webcam.get_html(320, 240));$('#webcamcontainer').show();$(this).hide();">#{i18n['userimage.webcam']}</button>
<p>Voit lisätä kuvan kävijälippuasi varten. Näin nopeutat asiointiasi tapahtumaan tullessasi.</p> <div id="webcamcontainer" style="display: none;"></div>
<p>
Kuvasta on pystyttävä tunnistamaan ongelmitta kortin omistaja. Tästä johtuen kuvan tulee olla selkeä, eikä kuvassa
saa olla useita henkilöitä. Ohjeita hyvän tunnistekuvan ottamiseksi löytyy <a
href="http://www.poliisi.fi/poliisi/home.nsf/files/Passikuvaohje_26-02-2008_FI/$file/Passikuvaohje_26-02-2008_FI.pdf"
>poliisin passikuvaohjeesta.</a>
</p>
<h:form enctype="multipart/form-data"> <h:form enctype="multipart/form-data">
<p:fileUpload value="#{userView.image}" mode="simple" /> <p:fileUpload value="#{userView.image}" mode="simple" required="true" />
<h:commandButton action="#{userView.sendImage}" value="#{i18n['user.imagesubmit']}" /> <h:commandButton action="#{userView.sendImage}" value="#{i18n['user.imagesubmit']}" />
</h:form> </h:form>
...@@ -63,12 +53,10 @@ ...@@ -63,12 +53,10 @@
<h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" /> <h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" />
<ui:fragment rendered="#{!empty userView.user.currentImage}"> <ui:fragment rendered="#{!empty userView.user.currentImage}">
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<img width="300" src="#{request.contextPath}/Userimage?imageid=#{userView.user.currentImage.id}" alt="image" /> <img width="300" src="#{request.contextPath}/dydata/userimage/#{userView.user.currentImage.id}.jpg" alt="image" />
<ui:fragment rendered="#{userView.canManage()}"> <ui:fragment rendered="#{userView.canManage()}">
<h:form> <h:form>
<p:imageCropper value="#{userView.croppedImage}" aspectRatio="0.8" <p:imageCropper value="#{userView.croppedImage}" aspectRatio="0.8" image="/dydata/userimage/#{userView.user.currentImage.id}.jpg" />
image="http://kauppa.insomnia.fi#{request.contextPath}/Userimage?imageid=#{userView.user.currentImage.id}"
/>
<h:commandButton action="#{userView.crop}" value="#{i18n['user.cropImage']}" /> <h:commandButton action="#{userView.crop}" value="#{i18n['user.cropImage']}" />
</h:form> </h:form>
</ui:fragment> </ui:fragment>
...@@ -96,7 +84,7 @@ ...@@ -96,7 +84,7 @@
</h:form> </h:form>
<h3>RFID</h3> <h3>RFID</h3>
<h:form rendered="#{empty readerView.readername}"> <h:form rendered="#{empty readerNameContainer.readerId}">
<h:dataTable border="1" id="reader" value="#{readerListDataView.readers}" var="rr"> <h:dataTable border="1" id="reader" value="#{readerListDataView.readers}" var="rr">
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
...@@ -110,7 +98,7 @@ ...@@ -110,7 +98,7 @@
</h:dataTable> </h:dataTable>
</h:form> </h:form>
<shop:readerevents rendered="#{!empty readerView.readername}" /> <shop:readerevents rendered="#{!empty readerNameContainer.readerId}" />
</ui:fragment> </ui:fragment>
...@@ -138,6 +126,8 @@ ...@@ -138,6 +126,8 @@
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</h:body> </h:body>
</html> </html>
\ No newline at end of file
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<h:outputText value="#{i18n['voting.allcompos.startTime']}" /> <h:outputText value="#{i18n['voting.allcompos.startTime']}" />
</f:facet> </f:facet>
<h:outputText value="#{compo.compo.startTime.time}"> <h:outputText value="#{compo.compo.startTime.time}">
<f:convertDateTime type="both" pattern="dd.MM.yyyy HH:mm" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<h:outputText value="#{i18n['voting.allcompos.voteEnd']}" /> <h:outputText value="#{i18n['voting.allcompos.voteEnd']}" />
</f:facet> </f:facet>
<h:outputText value="#{compo.compo.voteEnd.time}"> <h:outputText value="#{compo.compo.voteEnd.time}">
<f:convertDateTime type="both" pattern="dd.MM.yyyy HH:mm" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<h:outputText value="#{i18n['voting.allcompos.submitEnd']}" /> <h:outputText value="#{i18n['voting.allcompos.submitEnd']}" />
</f:facet> </f:facet>
<h:outputText value="#{compo.compo.submitEnd.time}"> <h:outputText value="#{compo.compo.submitEnd.time}">
<f:convertDateTime type="both" pattern="dd.MM.yyyy HH:mm" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </h:column>
<h:column> <h:column>
......
bortalApplication.BILL = Creating, and managing bills
bortalApplication.COMPO = Managing compos
bortalApplication.CONTENT = Product & shop management
bortalApplication.LAYOUT = Laout management
bortalApplication.MAP = Map management
bortalApplication.POLL = Polling stuff
bortalApplication.SALESPOINT = Managing salespoint
bortalApplication.SHOP = Product % shop management
bortalApplication.TERMINAL = Sales and self help terminal roles
bortalApplication.USER = User management related
bortalApplication.bill.CREATE_BILL = Create bills for self
bortalApplication.bill.READ_ALL = "Read all bills"
bortalApplication.bill.VIEW_OWN = View own bills
bortalApplication.bill.WRITE_ALL = Modify all bills
bortalApplication.compo.MANAGE = Manage compos
bortalApplication.compo.SUBMIT_ENTRY = Submit entry
bortalApplication.compo.VIEW_COMPOS = View compos
bortalApplication.compo.VOTE = Vote
bortalApplication.content.MANAGE_ACTIONLOG = Manage actionlog
bortalApplication.content.MANAGE_MENU = Manage menus
bortalApplication.content.MANAGE_NEWS = Manage newsgroups
bortalApplication.content.MANAGE_PAGES = Manage pages
bortalApplication.map.BUY_PLACES = Reserve and buy places from map
bortalApplication.map.MANAGE_MAPS = Create and modify maps
bortalApplication.map.MANAGE_OTHERS = Manage other users reservations in map
bortalApplication.map.VIEW = View maps
bortalApplication.poll.ANSWER = Can answer and view availabe polls
bortalApplication.poll.CREATE = Create and manage polls
bortalApplication.poll.VIEW_RESULTS = View anonymized poll results
bortalApplication.salespoint.MODIFY = Modify salespoints
bortalApplication.salespoint.VIEW = View salespoints
bortalApplication.shop.LIST_ALL_PRODUCTS = List all products in shop
bortalApplication.shop.LIST_USERPRODUCTS = List products for users in shop
bortalApplication.shop.MANAGE_PRODUCTS = Create and modify products
bortalApplication.shop.SHOP_PRODUCTS = Shop products to self
bortalApplication.shop.SHOP_TO_OTHERS = Shop to other users
bortalApplication.terminal.CASHIER = Access cashier terminal functions
bortalApplication.terminal.CUSTOMER = Access client terminal functions
bortalApplication.terminal.SELFHELP = Self help terminal
bortalApplication.user.ANYUSER = All users have this anyways
bortalApplication.user.CREATE_NEW = Create new user
bortalApplication.user.INVITE_USERS = Invite users
bortalApplication.user.LOGIN = Can login
bortalApplication.user.LOGOUT = Can logout
bortalApplication.user.MANAGE_HTTP_SESSION = Manage http sessions
bortalApplication.user.MODIFY = Modify users
bortalApplication.user.MODIFY_ACCOUNTEVENTS = Modify Account events
bortalApplication.user.READ_ORGROLES = View organization roles
bortalApplication.user.READ_ROLES = View all roles.
bortalApplication.user.VIEW_ACCOUNTEVENTS = Show other users account events
bortalApplication.user.VIEW_ALL = View all users
bortalApplication.user.VIEW_SELF = Can view self
bortalApplication.user.WRITE_ORGROLES = Modify organization roles
bortalApplication.user.WRITE_ROLES = Modify roles
cardTemplate.emptyCardTemplate = ---- cardTemplate.emptyCardTemplate = ----
global.copyright = Verkkopeliyhdistys Insomnia ry global.copyright = Verkkopeliyhdistys Insomnia ry
......
...@@ -386,6 +386,8 @@ role.parents = Parents ...@@ -386,6 +386,8 @@ role.parents = Parents
role.read = (R) role.read = (R)
role.write = (W) role.write = (W)
sendPicture.header = S
shop.accountBalance = Account balance shop.accountBalance = Account balance
shop.cash = Cash deposit shop.cash = Cash deposit
shop.totalPrice = Price of products shop.totalPrice = Price of products
......
package fi.insomnia.bortal.servlet; package fi.insomnia.bortal.servlet;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
...@@ -14,10 +17,14 @@ import javax.servlet.http.HttpServletResponse; ...@@ -14,10 +17,14 @@ import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fi.insomnia.bortal.beans.CardTemplateBeanLocal;
import fi.insomnia.bortal.beans.EventBeanLocal; import fi.insomnia.bortal.beans.EventBeanLocal;
import fi.insomnia.bortal.beans.PermissionBeanLocal; import fi.insomnia.bortal.beans.PermissionBeanLocal;
import fi.insomnia.bortal.beans.UserBeanLocal;
import fi.insomnia.bortal.model.CardTemplate;
import fi.insomnia.bortal.model.LanEventProperty; import fi.insomnia.bortal.model.LanEventProperty;
import fi.insomnia.bortal.model.LanEventPropertyKey; import fi.insomnia.bortal.model.LanEventPropertyKey;
import fi.insomnia.bortal.model.UserImage;
/** /**
* Servlet implementation class UploadServlet * Servlet implementation class UploadServlet
...@@ -29,6 +36,11 @@ public class FileDownloadServlet extends GenericImageServlet { ...@@ -29,6 +36,11 @@ public class FileDownloadServlet extends GenericImageServlet {
* *
*/ */
private static final long serialVersionUID = -3359999630873773508L; private static final long serialVersionUID = -3359999630873773508L;
@EJB
private transient CardTemplateBeanLocal ctbean;
@EJB
private transient UserBeanLocal userbean;
@EJB @EJB
private transient PermissionBeanLocal permbean; private transient PermissionBeanLocal permbean;
...@@ -48,14 +60,13 @@ public class FileDownloadServlet extends GenericImageServlet { ...@@ -48,14 +60,13 @@ public class FileDownloadServlet extends GenericImageServlet {
@Override @Override
protected ImageMover getImagedata() { protected ImageMover getImagedata() {
ImageMover ret = new ImageMover(); ImageMover ret = new ImageMover();
logger.info("Matching {}", super.request);
logger.info("URL {}", super.request.getPathInfo());
Matcher matcher = URLPATTERN.matcher(super.request.getPathInfo()); Matcher matcher = URLPATTERN.matcher(super.request.getPathInfo());
List<String> urlparts = new ArrayList<String>(); List<String> urlparts = new ArrayList<String>();
while (matcher.find()) { while (matcher.find()) {
urlparts.add(matcher.group()); urlparts.add(matcher.group());
} }
logger.info("urlparts {}", urlparts);
if (urlparts.isEmpty()) { if (urlparts.isEmpty()) {
ret.setResponse(HttpServletResponse.SC_NOT_FOUND); ret.setResponse(HttpServletResponse.SC_NOT_FOUND);
...@@ -65,7 +76,49 @@ public class FileDownloadServlet extends GenericImageServlet { ...@@ -65,7 +76,49 @@ public class FileDownloadServlet extends GenericImageServlet {
ret.setData(logo.getByteValue()); ret.setData(logo.getByteValue());
ret.setImagetype(logo.getByteMime()); ret.setImagetype(logo.getByteMime());
} }
} else { } else if (urlparts.get(0).equals("cardtemplate") && urlparts.size() > 2)
{
int imageid = Integer.parseInt(urlparts.get(1));
CardTemplate templ = ctbean.find(imageid);
logger.info("Cardtemplate {}, {}", imageid, templ);
if (templ != null && templ.getImage().length > 0) {
ret.setData(templ.getImage());
ret.setImagetype("image/jpeg");
}
}
else if (urlparts.get(0).equals("userimage") && urlparts.size() > 2) {
int imageid = Integer.parseInt(urlparts.get(1));
UserImage image = userbean.findUserimageFORCE(imageid);
if (image != null)
{
ret.setData(image.getImageData());
ret.setImagetype(image.getMimeType());
// Create image on file for cropper to work...
// Check
// http://code.google.com/p/primefaces/issues/detail?id=3751
String imagefilePath = this.getServletContext().getRealPath("/dydata/" + super.request.getPathInfo());
File imagefile = new File(imagefilePath);
if (!imagefile.exists())
{
File parentPath = new File(imagefile.getParent());
if (!parentPath.isDirectory() && !parentPath.mkdirs()) {
logger.warn("Error creating directory {}", parentPath.getAbsolutePath());
}
try {
FileOutputStream writer = new FileOutputStream(imagefile);
writer.write(image.getImageData());
writer.close();
logger.info("Created image on file: {}", imagefile.getAbsolutePath());
} catch (IOException e) {
logger.warn("error creating image on file {}", e);
}
}
}
}
if (ret.getImagetype() == null) {
ret.setResponse(HttpServletResponse.SC_NOT_FOUND); ret.setResponse(HttpServletResponse.SC_NOT_FOUND);
} }
return ret; return ret;
......
...@@ -90,8 +90,12 @@ public abstract class GenericImageServlet extends HttpServlet { ...@@ -90,8 +90,12 @@ public abstract class GenericImageServlet extends HttpServlet {
this.request = request; this.request = request;
ImageMover data = getImagedata(); ImageMover data = getImagedata();
if (data == null || data.getResponse() != null) { if (data == null || data.getData() == null || data.getResponse() != null) {
response.setStatus(data.getResponse()); if (data != null && data.getData() != null) {
response.setStatus(data.getResponse());
} else {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
}
response.getWriter().append("Not Found"); response.getWriter().append("Not Found");
} else { } else {
response.setContentLength(data.getData().length); response.setContentLength(data.getData().length);
......
package fi.insomnia.bortal.servlet; package fi.insomnia.bortal.servlet;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.ejb.EJB; import javax.ejb.EJB;
...@@ -7,6 +10,9 @@ import javax.servlet.http.HttpServlet; ...@@ -7,6 +10,9 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.insomnia.bortal.beans.PermissionBeanLocal; import fi.insomnia.bortal.beans.PermissionBeanLocal;
import fi.insomnia.bortal.beans.UserBeanLocal; import fi.insomnia.bortal.beans.UserBeanLocal;
import fi.insomnia.bortal.model.UserImage; import fi.insomnia.bortal.model.UserImage;
...@@ -14,7 +20,6 @@ import fi.insomnia.bortal.model.UserImage; ...@@ -14,7 +20,6 @@ import fi.insomnia.bortal.model.UserImage;
/** /**
* Servlet implementation class UploadServlet * Servlet implementation class UploadServlet
*/ */
public class UserImageServlet extends GenericImageServlet { public class UserImageServlet extends GenericImageServlet {
/** /**
...@@ -33,30 +38,66 @@ public class UserImageServlet extends GenericImageServlet { ...@@ -33,30 +38,66 @@ public class UserImageServlet extends GenericImageServlet {
* response) * response)
*/ */
private final Pattern lhMatcher = Pattern.compile("^(10|127).[0-9.]*|(0:)*1%0"); // private final Pattern lhMatcher =
// Pattern.compile("^(10|127).[0-9.]*|(0:)*1%0");
private static final Logger logger = LoggerFactory.getLogger(UserImageServlet.class);
private static final Pattern URLPATTERN = Pattern.compile("([^./]+)");
// /dydata/(userimage|...)/stuff...
@Override @Override
protected ImageMover getImagedata() { protected ImageMover getImagedata() {
ImageMover ret = new ImageMover(); ImageMover ret = new ImageMover();
UserImage image = userbean.findUserimageFORCE(super.getIdParam("imageid")); Matcher matcher = URLPATTERN.matcher(super.request.getPathInfo());
if (image != null) { // && List<String> urlparts = new ArrayList<String>();
// if (permbean.isCurrentUser(image.getUser()) || logger.info("urlparts {}", urlparts);
// permbean.hasPermission(UserPermission.MODIFY) ||
// lhMatcher.matcher(request.getLocalAddr()).matches()) while (matcher.find()) {
// { urlparts.add(matcher.group());
ret.setData(image.getImageData()); }
ret.setImagetype(image.getMimeType());
// } if (urlparts.isEmpty()) {
// else ret.setResponse(HttpServletResponse.SC_NOT_FOUND);
// { } else if (urlparts.get(0).equals("userimage") && urlparts.size() > 2) {
// ret.setResponse(HttpServletResponse.SC_FORBIDDEN); int imageid = Integer.parseInt(urlparts.get(1));
// } UserImage image = userbean.findUserimageFORCE(imageid);
if (image != null)
} else {
{ ret.setData(image.getImageData());
ret.setImagetype(image.getMimeType());
}
}
if (ret.getImagetype() == null) {
ret.setResponse(HttpServletResponse.SC_NOT_FOUND); ret.setResponse(HttpServletResponse.SC_NOT_FOUND);
} }
return ret; return ret;
} }
// protected ImageMover getImagedata2() {
// ImageMover ret = new ImageMover();
// UserImage image =
// userbean.findUserimageFORCE(super.getIdParam("imageid"));
// if (image != null) { // &&
// // if (permbean.isCurrentUser(image.getUser()) ||
// // permbean.hasPermission(UserPermission.MODIFY) ||
// // lhMatcher.matcher(request.getLocalAddr()).matches())
// // {
// ret.setData(image.getImageData());
// ret.setImagetype(image.getMimeType());
// // }
// // else
// // {
// // ret.setResponse(HttpServletResponse.SC_FORBIDDEN);
// // }
//
// } else
// {
// ret.setResponse(HttpServletResponse.SC_NOT_FOUND);
// }
// return ret;
//
// }
} }
package fi.insomnia.bortal.web.cdiview.actionlog; package fi.insomnia.bortal.web.cdiview.actionlog;
import java.util.List;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped; import javax.enterprise.context.ConversationScoped;
import javax.inject.Named; import javax.inject.Named;
import java.util.List;
import fi.insomnia.bortal.beans.ActionLogBeanLocal; import fi.insomnia.bortal.beans.ActionLogBeanLocal;
import fi.insomnia.bortal.enums.ActionLogMessageState; import fi.insomnia.bortal.enums.ActionLogMessageState;
import fi.insomnia.bortal.enums.apps.ContentPermission; import fi.insomnia.bortal.enums.apps.ContentPermission;
...@@ -25,39 +25,40 @@ public class TaskModificationView extends GenericCDIView { ...@@ -25,39 +25,40 @@ public class TaskModificationView extends GenericCDIView {
private List<ActionLogMessageResponse> responses; private List<ActionLogMessageResponse> responses;
private String responseMessage; private String responseMessage;
private ActionLogMessageState responseStateChange; private ActionLogMessageState responseStateChange;
@EJB @EJB
private ActionLogBeanLocal logbean; private ActionLogBeanLocal logbean;
public void initView(){ public void initView() {
if(super.requirePermissions(ContentPermission.MANAGE_ACTIONLOG) && message == null) { if (super.requirePermissions(ContentPermission.MANAGE_ACTIONLOG) && message == null) {
super.beginConversation(); super.beginConversation();
message = logbean.find(id); message = logbean.find(id);
} }
} }
public void createResponse() { public String createResponse() {
if(responseStateChange == null || responseStateChange == message.getState()) if (responseStateChange == null || responseStateChange == message.getState())
logbean.addActionLogMessageResponse(message, responseMessage, null); logbean.addActionLogMessageResponse(message, responseMessage, null);
else { else {
logbean.addActionLogMessageResponse(message, responseMessage, responseStateChange); logbean.addActionLogMessageResponse(message, responseMessage, responseStateChange);
if(responseStateChange != message.getState()) { if (responseStateChange != message.getState()) {
this.message = logbean.find(id); this.message = logbean.find(id);
} }
} }
responseMessage = ""; responseMessage = "";
responseStateChange = null; responseStateChange = null;
return null;
} }
public List<ActionLogMessageResponse> getResponses() { public List<ActionLogMessageResponse> getResponses() {
responses = logbean.getActionLogMessageResponses(message); responses = logbean.getActionLogMessageResponses(message);
return responses; return responses;
} }
public ActionLogMessage getMessage(){ public ActionLogMessage getMessage() {
return message; return message;
} }
public Integer getId() { public Integer getId() {
return id; return id;
} }
......
...@@ -10,7 +10,7 @@ import javax.inject.Named; ...@@ -10,7 +10,7 @@ import javax.inject.Named;
import org.primefaces.model.DefaultTreeNode; import org.primefaces.model.DefaultTreeNode;
import fi.insomnia.bortal.beans.MenubeanLocal; import fi.insomnia.bortal.beans.MenubeanLocal;
import fi.insomnia.bortal.enums.apps.LayoutPermission; import fi.insomnia.bortal.enums.apps.ContentPermission;
import fi.insomnia.bortal.model.MenuNavigation; import fi.insomnia.bortal.model.MenuNavigation;
import fi.insomnia.bortal.web.cdiview.GenericCDIView; import fi.insomnia.bortal.web.cdiview.GenericCDIView;
...@@ -26,7 +26,7 @@ public class MenuListView extends GenericCDIView { ...@@ -26,7 +26,7 @@ public class MenuListView extends GenericCDIView {
public void initList() public void initList()
{ {
if (super.requirePermissions(LayoutPermission.MANAGE_MENU)) { if (super.requirePermissions(ContentPermission.MANAGE_MENU)) {
root = new DefaultTreeNode("Root", null); root = new DefaultTreeNode("Root", null);
parseTree(menubean.getTopmenus(), root); parseTree(menubean.getTopmenus(), root);
......
...@@ -36,9 +36,10 @@ public class BillEditView extends GenericCDIView { ...@@ -36,9 +36,10 @@ public class BillEditView extends GenericCDIView {
} }
} }
public void save() public String save()
{ {
bill = billbean.save(bill); bill = billbean.save(bill);
return null;
} }
public void setBill(Bill bill) { public void setBill(Bill bill) {
......
package fi.insomnia.bortal.web.cdiview.shop;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import fi.insomnia.bortal.beans.BillBeanLocal;
import fi.insomnia.bortal.model.Bill;
import fi.insomnia.bortal.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class BillReviewView extends GenericCDIView {
/**
*
*/
private static final long serialVersionUID = -4665348757236295800L;
private Bill bill;
@EJB
private transient BillBeanLocal billbean;
public Bill getBill() {
return bill;
}
public void setBill(Bill bill) {
this.bill = bill;
}
public String getVerkkomaksuToken()
{
}
}
...@@ -53,6 +53,9 @@ public class ProductShopView extends GenericCDIView { ...@@ -53,6 +53,9 @@ public class ProductShopView extends GenericCDIView {
@Inject @Inject
private BillListView billListView; private BillListView billListView;
@Inject
private BillReviewView billReviewView;
public void initBillView() public void initBillView()
{ {
if (requirePermissions(ShopPermission.LIST_USERPRODUCTS) && shoppingcart == null) { if (requirePermissions(ShopPermission.LIST_USERPRODUCTS) && shoppingcart == null) {
...@@ -122,8 +125,9 @@ public class ProductShopView extends GenericCDIView { ...@@ -122,8 +125,9 @@ public class ProductShopView extends GenericCDIView {
addFaceMessage("productshop.billCreated"); addFaceMessage("productshop.billCreated");
cash = BigDecimal.ZERO; cash = BigDecimal.ZERO;
shoppingcart = null; shoppingcart = null;
billReviewView.setBill(bill);
return "redirBillList"; return "showCreatedBill";
} }
......
...@@ -10,7 +10,6 @@ import fi.insomnia.bortal.beans.EventBeanLocal; ...@@ -10,7 +10,6 @@ import fi.insomnia.bortal.beans.EventBeanLocal;
import fi.insomnia.bortal.beans.OrgRoleBeanLocal; import fi.insomnia.bortal.beans.OrgRoleBeanLocal;
import fi.insomnia.bortal.enums.apps.UserPermission; import fi.insomnia.bortal.enums.apps.UserPermission;
import fi.insomnia.bortal.model.OrgRole; import fi.insomnia.bortal.model.OrgRole;
import fi.insomnia.bortal.model.Role;
import fi.insomnia.bortal.web.cdiview.GenericCDIView; import fi.insomnia.bortal.web.cdiview.GenericCDIView;
@ConversationScoped @ConversationScoped
...@@ -18,12 +17,12 @@ import fi.insomnia.bortal.web.cdiview.GenericCDIView; ...@@ -18,12 +17,12 @@ import fi.insomnia.bortal.web.cdiview.GenericCDIView;
public class OrgRoleView extends GenericCDIView { public class OrgRoleView extends GenericCDIView {
private static final long serialVersionUID = -2492481531713504212L; private static final long serialVersionUID = -2492481531713504212L;
private OrgRole orgRole; private OrgRole orgRole;
@EJB @EJB
private OrgRoleBeanLocal orgRoleBean; private OrgRoleBeanLocal orgRoleBean;
@EJB @EJB
private EventBeanLocal eventBean; private EventBeanLocal eventBean;
...@@ -34,7 +33,7 @@ public class OrgRoleView extends GenericCDIView { ...@@ -34,7 +33,7 @@ public class OrgRoleView extends GenericCDIView {
public void initForCreate() { public void initForCreate() {
if (requirePermissions(permbean.hasPermission(UserPermission.WRITE_ORGROLES))) { if (requirePermissions(permbean.hasPermission(UserPermission.WRITE_ORGROLES))) {
OrgRole role = new OrgRole(); OrgRole role = new OrgRole();
role.setEventOrganizer(eventBean.getCurrentEvent().getOrganiser()); role.setEventOrganisation(eventBean.getCurrentEvent().getOrganiser());
setOrgRole(role); setOrgRole(role);
super.beginConversation(); super.beginConversation();
} }
...@@ -47,7 +46,7 @@ public class OrgRoleView extends GenericCDIView { ...@@ -47,7 +46,7 @@ public class OrgRoleView extends GenericCDIView {
public void setOrgRole(OrgRole orgRole) { public void setOrgRole(OrgRole orgRole) {
this.orgRole = orgRole; this.orgRole = orgRole;
} }
public List<OrgRole> getPossibleParents() { public List<OrgRole> getPossibleParents() {
return orgRoleBean.getPossibleParents(getOrgRole()); return orgRoleBean.getPossibleParents(getOrgRole());
} }
......
...@@ -21,7 +21,6 @@ import fi.insomnia.bortal.enums.apps.UserPermission; ...@@ -21,7 +21,6 @@ import fi.insomnia.bortal.enums.apps.UserPermission;
import fi.insomnia.bortal.model.ApplicationPermission; import fi.insomnia.bortal.model.ApplicationPermission;
import fi.insomnia.bortal.model.Role; import fi.insomnia.bortal.model.Role;
import fi.insomnia.bortal.web.cdiview.GenericCDIView; import fi.insomnia.bortal.web.cdiview.GenericCDIView;
import fi.insomnia.bortal.web.helpers.ApplicationPermissionWrapper;
import fi.insomnia.bortal.web.helpers.BortalApplicationWrapper; import fi.insomnia.bortal.web.helpers.BortalApplicationWrapper;
@ConversationScoped @ConversationScoped
...@@ -121,9 +120,9 @@ public class RoleView extends GenericCDIView { ...@@ -121,9 +120,9 @@ public class RoleView extends GenericCDIView {
if (canWriteRoles()) { if (canWriteRoles()) {
ArrayList<IAppPermission> newPerms = new ArrayList<IAppPermission>(); ArrayList<IAppPermission> newPerms = new ArrayList<IAppPermission>();
for (BortalApplicationWrapper appWrap : rolePermissions) { for (BortalApplicationWrapper appWrap : rolePermissions) {
for (ApplicationPermissionWrapper apWrap : appWrap.getPermissions()) { for (IAppPermission apWrap : appWrap.getPermissions()) {
if (apWrap.isCanHas()) { if (appWrap.getSelected().contains(apWrap.toString())) {
newPerms.add(apWrap.getPermission()); newPerms.add(apWrap);
} }
} }
} }
......
...@@ -135,11 +135,15 @@ public class UserView extends GenericCDIView { ...@@ -135,11 +135,15 @@ public class UserView extends GenericCDIView {
} }
public String sendImage() { public String sendImage() {
if (getImage() == null)
{
super.addFaceMessage("user.imageUpload.imageNotFound");
} else {
UserImage userimage = userbean.uploadImage(user, getImage().getContentType(), getImage().getContents(), getImage().getFileName(), ""); UserImage userimage = userbean.uploadImage(user, getImage().getContentType(), getImage().getContents(), getImage().getFileName(), "");
user = userbean.getEventUser(userimage.getUser()); user = userbean.getEventUser(userimage.getUser());
super.addFaceMessage("user.imageUploaded");
super.addFaceMessage("user.imageUploaded"); }
return null; return null;
} }
......
...@@ -10,66 +10,63 @@ import javax.faces.context.FacesContext; ...@@ -10,66 +10,63 @@ import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException; import javax.faces.validator.ValidatorException;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import javax.servlet.jsp.tagext.ValidationMessage;
import org.eclipse.persistence.exceptions.ValidationException;
import org.hibernate.validator.util.LoggerFactory;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.insomnia.bortal.utilities.I18n; import fi.insomnia.bortal.utilities.I18n;
@Named @Named
@RequestScoped @RequestScoped
public class VotingDateValidator implements Serializable { public class VotingDateValidator implements Serializable {
@Inject @Inject
private VotingCreateView view; private VotingCreateView view;
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(VotingDateValidator.class); private static final Logger logger = LoggerFactory.getLogger(VotingDateValidator.class);
private Date cStart; private Date cStart;
private Date vStart; private Date vStart;
private Date sStart; private Date sStart;
public void validateCompo(FacesContext context, UIComponent ui, Object object) { public void validateCompo(FacesContext context, UIComponent ui, Object object) {
//logger.info("adsda {} self {}", cStart, this); // logger.info("adsda {} self {}", cStart, this);
Date endDate = (Date)object; Date endDate = (Date) object;
//UIComponent foo = ui.findComponent("cStart"); // UIComponent foo = ui.findComponent("cStart");
//logger.info("uielement {} ", foo); // logger.info("uielement {} ", foo);
if(endDate.before(cStart)) { if (endDate.before(cStart)) {
message(new FacesMessage(I18n.get("voting.create.dateValidatorEndDate"))); message(new FacesMessage(I18n.get("voting.create.dateValidatorEndDate")));
} }
} }
public void saveCStart(FacesContext context, UIComponent ui, Object object) { public void saveCStart(FacesContext context, UIComponent ui, Object object) {
//logger.info("Message: {} self {}", object, this); // logger.info("Message: {} self {}", object, this);
cStart = (Date)object; cStart = (Date) object;
} }
public void validateVote(FacesContext context, UIComponent ui, Object object) { public void validateVote(FacesContext context, UIComponent ui, Object object) {
Date endDate = (Date)object; Date endDate = (Date) object;
if(endDate.before(vStart)) { if (endDate.before(vStart)) {
message(new FacesMessage(I18n.get("voting.create.dateValidatorEndDate"))); message(new FacesMessage(I18n.get("voting.create.dateValidatorEndDate")));
} }
} }
public void saveVStart(FacesContext context, UIComponent ui, Object object) { public void saveVStart(FacesContext context, UIComponent ui, Object object) {
vStart = (Date)object; vStart = (Date) object;
} }
public void validateSubmit(FacesContext context, UIComponent ui, Object object) { public void validateSubmit(FacesContext context, UIComponent ui, Object object) {
Date endDate = (Date)object; Date endDate = (Date) object;
if(endDate.before(sStart)) { if (endDate.before(sStart)) {
message(new FacesMessage(I18n.get("voting.create.dateValidatorEndDate"))); message(new FacesMessage(I18n.get("voting.create.dateValidatorEndDate")));
} }
} }
public void saveSStart(FacesContext context, UIComponent ui, Object object) { public void saveSStart(FacesContext context, UIComponent ui, Object object) {
sStart = (Date)object; sStart = (Date) object;
} }
private void message(FacesMessage msg) { private void message(FacesMessage msg) {
throw new ValidatorException(msg); throw new ValidatorException(msg);
} }
......
...@@ -30,8 +30,8 @@ public class ApplicationPermissionWrapper implements Serializable { ...@@ -30,8 +30,8 @@ public class ApplicationPermissionWrapper implements Serializable {
return permission.toString(); return permission.toString();
} }
public String getDescription() { public String getKey() {
return permission.getDescription(); return permission.getI18nKey();
} }
public void setCanHas(boolean canHas) { public void setCanHas(boolean canHas) {
......
...@@ -2,7 +2,7 @@ package fi.insomnia.bortal.web.helpers; ...@@ -2,7 +2,7 @@ package fi.insomnia.bortal.web.helpers;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -17,18 +17,24 @@ public class BortalApplicationWrapper implements Serializable { ...@@ -17,18 +17,24 @@ public class BortalApplicationWrapper implements Serializable {
* *
*/ */
private static final long serialVersionUID = -5552828911388714876L; private static final long serialVersionUID = -5552828911388714876L;
private final ArrayList<ApplicationPermissionWrapper> permissions; private final ArrayList<IAppPermission> permissions;
private Set<String> selected = new HashSet<String>();
private final BortalApplication app; private final BortalApplication app;
private static final Logger logger = LoggerFactory.getLogger(BortalApplicationWrapper.class); private static final Logger logger = LoggerFactory.getLogger(BortalApplicationWrapper.class);
public BortalApplicationWrapper(BortalApplication bApp, Set<IAppPermission> set) { public BortalApplicationWrapper(BortalApplication bApp, Set<IAppPermission> set) {
app = bApp; app = bApp;
permissions = new ArrayList<ApplicationPermissionWrapper>(); permissions = new ArrayList<IAppPermission>();
for (IAppPermission ap : bApp.getPermissions()) { for (IAppPermission ap : bApp.getPermissions()) {
if (set != null) { if (set != null) {
logger.info("App Match {}, {}", ap, set.contains(ap)); logger.info("App Match {}, {}", ap, set.contains(ap));
} }
permissions.add(new ApplicationPermissionWrapper(ap, set != null && set.contains(ap))); boolean has = set != null && set.contains(ap);
if (has)
{
selected.add(ap.toString());
}
getPermissions().add(ap);
} }
} }
...@@ -36,11 +42,19 @@ public class BortalApplicationWrapper implements Serializable { ...@@ -36,11 +42,19 @@ public class BortalApplicationWrapper implements Serializable {
return app.toString(); return app.toString();
} }
public String getDescription() { public String getkey() {
return app.getDescription(); return app.getI18nKey();
}
public Set<String> getSelected() {
return selected;
}
public void setSelected(Set<String> selected) {
this.selected = selected;
} }
public List<ApplicationPermissionWrapper> getPermissions() { public ArrayList<IAppPermission> getPermissions() {
return permissions; return permissions;
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!