Commit ba3f6556 by Tuomas Riihimäki

Code cleanup

1 parent 8ba089a6
Showing with 1219 additions and 1356 deletions
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.utilities.jpa;
......@@ -55,12 +55,12 @@ public abstract class GenericFacade<C extends ModelInterface> {
/*
* This function does not need to return the persisted entity. All changes are made to the parameter.
*
*
*/
/**
* Persists the entity into database. After calling this function the entity
* is attached and all changes are persisted to database
*
*
* @param entity
* Entity to be created and attached to database.
*/
......@@ -75,9 +75,9 @@ public abstract class GenericFacade<C extends ModelInterface> {
/**
* Merge changes from a detached entity to the database.
*
*
* This function does nothing if entity is already attached.
*
*
* @param entity
* Detached entity to be merged into database
* @return Attached entity with changes merged
......@@ -90,9 +90,9 @@ public abstract class GenericFacade<C extends ModelInterface> {
/**
* Refresh the state of the instance from the database, overwriting changes
* made to the entity, if any.
*
*
* ENTITY MUST BE ATTACHED!
*
*
* @param entity
*/
public void refresh(C entity) {
......@@ -130,7 +130,7 @@ public abstract class GenericFacade<C extends ModelInterface> {
}
protected SearchResult<C> searcher(SearchQuery search, FacadeCallback<C> cb1, FacadeCallback<C> cb2) {
ArrayList<FacadeCallback<C>> cbs = new ArrayList<FacadeCallback<C>>();
ArrayList<FacadeCallback<C>> cbs = new ArrayList<>();
cbs.add(cb1);
cbs.add(cb2);
return searcher(search, cbs);
......@@ -138,7 +138,7 @@ public abstract class GenericFacade<C extends ModelInterface> {
}
protected SearchResult<C> searcher(SearchQuery search, FacadeCallback<C> cb1, FacadeCallback<C> cb2, FacadeCallback<C> cb3) {
ArrayList<FacadeCallback<C>> cbs = new ArrayList<FacadeCallback<C>>();
ArrayList<FacadeCallback<C>> cbs = new ArrayList<>();
cbs.add(cb1);
cbs.add(cb2);
cbs.add(cb3);
......@@ -147,7 +147,7 @@ public abstract class GenericFacade<C extends ModelInterface> {
}
protected SearchResult<C> searcher(SearchQuery search, FacadeCallback<C> cb1, FacadeCallback<C> cb2, FacadeCallback<C> cb3, FacadeCallback<C> cb4) {
ArrayList<FacadeCallback<C>> cbs = new ArrayList<FacadeCallback<C>>();
ArrayList<FacadeCallback<C>> cbs = new ArrayList<>();
cbs.add(cb1);
cbs.add(cb2);
cbs.add(cb3);
......@@ -174,7 +174,7 @@ public abstract class GenericFacade<C extends ModelInterface> {
listQ.setMaxResults(search.getPagesize());
}
return new SearchResult<C>(listQ.getResultList(), countQ.getSingleResult());
return new SearchResult<>(listQ.getResultList(), countQ.getSingleResult());
}
protected From<?, C> searchCallbacks(CriteriaQuery<?> cq, List<FacadeCallback<C>> list, boolean isFullQuery) {
......@@ -185,7 +185,7 @@ public abstract class GenericFacade<C extends ModelInterface> {
Root<T> root = cq.from(clazz);
ArrayList<Predicate> predicates = handlePredicates(cq, list, root, isFullQuery);
if (!predicates.isEmpty()) {
Predicate[] preds = predicates.toArray(new Predicate[predicates.size()]);
Predicate[] preds = predicates.toArray(new Predicate[0]);
cq.where(preds);
}
......@@ -197,7 +197,7 @@ public abstract class GenericFacade<C extends ModelInterface> {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
ArrayList<Predicate> predicates = new ArrayList<Predicate>();
ArrayList<Predicate> predicates = new ArrayList<>();
for (FacadeCallback<T> fc : list) {
if (fc != null) {
fc.exec(cb, cq, root, predicates, isFullQuery);
......@@ -209,7 +209,7 @@ public abstract class GenericFacade<C extends ModelInterface> {
/**
* Synchronize the persistence context to the underlying database.
*
*
* This gives to newly created entities ID, etc.
*/
public void flush() {
......@@ -218,7 +218,7 @@ public abstract class GenericFacade<C extends ModelInterface> {
/**
* Remove the given entity from cache.
*
*
* @param entity
*/
public void evict(C entity) {
......@@ -228,7 +228,7 @@ public abstract class GenericFacade<C extends ModelInterface> {
/**
* Tells wether the entity is attached to this transaction. ie. Changes to
* this object are automatically propagated to the database
*
*
* @param entity
* @return
*/
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.utilities.jsf;
......@@ -28,7 +28,7 @@ import javax.faces.convert.Converter;
* Use this converter if you want to do some database find -magic via string
* @param <T>
*/
public abstract class GenericEntityFinderConverter<T extends ModelInterface> implements Converter {
public abstract class GenericEntityFinderConverter<T extends ModelInterface> implements Converter<T> {
protected abstract T find(Integer id);
protected abstract T find(String searchString);
......@@ -38,7 +38,7 @@ public abstract class GenericEntityFinderConverter<T extends ModelInterface> imp
}
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
public T getAsObject(FacesContext context, UIComponent component, String value) {
T ret = null;
Integer id = null;
if (value != null) {
......@@ -56,11 +56,10 @@ public abstract class GenericEntityFinderConverter<T extends ModelInterface> imp
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
public String getAsString(FacesContext context, UIComponent component, T entity) {
String ret = "0";
if (value != null && value instanceof ModelInterface) {
ModelInterface entity = (ModelInterface) value;
if (entity != null) {
if (entity.getId() != null) {
ret = entity.getId().toString();
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.utilities.jsf;
......@@ -24,7 +24,7 @@ import javax.faces.convert.Converter;
import fi.codecrew.moya.utilities.jpa.ModelInterface;
public abstract class GenericIntegerEntityConverter<T extends ModelInterface> implements Converter {
public abstract class GenericIntegerEntityConverter<T extends ModelInterface> implements Converter<T> {
protected abstract T find(Integer id);
......@@ -33,7 +33,7 @@ public abstract class GenericIntegerEntityConverter<T extends ModelInterface> im
}
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
public T getAsObject(FacesContext context, UIComponent component, String value) {
T ret = null;
Integer id = null;
if (value != null) {
......@@ -46,11 +46,10 @@ public abstract class GenericIntegerEntityConverter<T extends ModelInterface> im
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
public String getAsString(FacesContext context, UIComponent component, T entity) {
String ret = "0";
if (value != null && value instanceof ModelInterface) {
ModelInterface entity = (ModelInterface) value;
if (entity != null) {
if (entity.getId() != null) {
ret = entity.getId().toString();
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.utilities;
......@@ -44,7 +44,7 @@ public class JsonUtilsTest {
@Test
public final void testGetSubObject() {
JsonObject meta = jsonObject("{\"foo\":\"bar\",\"baz\":{\"quuz\":\"plop\"}}");
ArrayList<String> path = new ArrayList<String>();
ArrayList<String> path = new ArrayList<>();
path.add("baz");
JsonValue expected = jsonObject("{\"quuz\":\"plop\"}");
......@@ -57,7 +57,7 @@ public class JsonUtilsTest {
JsonObject meta = jsonObject("{\"foo\":\"bar\"}");
JsonObject newData = jsonObject("{\"quux\":\"plop\"}");
ArrayList<String> path = new ArrayList<String>();
ArrayList<String> path = new ArrayList<>();
path.add("baz");
JsonObject actual = JsonUtils.alterSubObject(meta, path, newData);
......@@ -65,13 +65,13 @@ public class JsonUtilsTest {
Assert.assertEquals(actual.toString(), expected.toString());
}
@Test
public final void testAlterSubSubObject() {
JsonObject meta = jsonObject("{\"bystander1\":\"canary1\", \"module1\":{\"bystander2\":\"canary2\",\"submodule1\":{\"replacee1\":\"replacedvalue1\",\"r2\":\"rv2\"}}}");
JsonObject newData = jsonObject("{\"quux\":\"plop\"}");
ArrayList<String> path = new ArrayList<String>();
ArrayList<String> path = new ArrayList<>();
path.add("module1");
path.add("submodule1");
......
......@@ -49,7 +49,7 @@ public class GraphQLBuilder {
public Set<GraphQLType> getTypes() {
Set<GraphQLType> ret = new HashSet<>(enums.values());
List<GraphQLObjectType> retEnt = entities.values().stream().map(v -> v.build()).collect(Collectors.toList());
logger.warn("Returning entities", retEnt);
logger.warn("Returning entities: {}", retEnt);
ret.addAll(retEnt);
logger.warn("Enums {}, entities {}", enums, entities);
logger.warn("Builder returning types: {}", ret);
......@@ -59,7 +59,7 @@ public class GraphQLBuilder {
public GraphQLTypeReference typeFor(String typeName) {
logger.warn("Adding typeFor: {}", typeName);
if (!entities.containsKey(typeName) && !enums.containsKey(typeName)) {
logger.warn("Adding unknown type: this might be an error!" + typeName, new RuntimeException().fillInStackTrace());
logger.warn("Adding unknown type: {} this might be an error!", typeName, new RuntimeException().fillInStackTrace());
uncheckedTypes.add(typeName);
}
......@@ -71,14 +71,14 @@ public class GraphQLBuilder {
}
public <X extends Enum> GraphQLOutputType getEnum(Class<X> type) {
public <X extends Enum<?>> GraphQLOutputType getEnum(Class<X> type) {
String name = type.getSimpleName();
if (name == null) {
throw new NullPointerException("Trying to get enum with type " + type);
}
if (!enums.containsKey(name)) {
GraphQLEnumType.Builder ret = newEnum().name(name);
for (Enum c : type.getEnumConstants()) {
for (Enum<?> c : type.getEnumConstants()) {
ret.value(c.name());
}
enums.put(name, ret.build());
......
......@@ -16,6 +16,6 @@ public class PropertyFetchWrapper<T, INNER> implements DataFetcher<T> {
@Override
public T get(DataFetchingEnvironment environment) {
INNER field = fetcher.get(environment);
return innerFetcher.get(new DataFetchingEnvironmentWrapper(environment, field));
return innerFetcher.get(new DataFetchingEnvironmentWrapper<>(environment, field));
}
}
......@@ -12,5 +12,5 @@ public class ArrayListWrapper<T> {
this.list = list;
}
public ArrayList<T> list = new ArrayList<T>();
public ArrayList<T> list = new ArrayList<>();
}
\ No newline at end of file
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.rest;
......@@ -22,12 +22,7 @@ import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import fi.codecrew.moya.beans.NetworkAssociationBeanLocal;
......
package fi.codecrew.moya.rest;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
......@@ -65,7 +66,7 @@ public class PojoUtils {
}
public static CardRoot parsePrintedCards(List<PrintedCard> cards) {
ArrayList<PrintedCardRestPojo> ret = new ArrayList<PrintedCardRestPojo>();
ArrayList<PrintedCardRestPojo> ret = new ArrayList<>();
for (PrintedCard c : cards) {
ret.add(initPrintedCardRestPojo(c));
}
......@@ -125,7 +126,7 @@ public class PojoUtils {
}
private static List<PlacePojo> parsePlaces(List<Place> places) {
ArrayList<PlacePojo> ret = new ArrayList<PlacePojo>();
ArrayList<PlacePojo> ret = new ArrayList<>();
for (Place place : places) {
ret.add(initPlacePojo(place));
}
......@@ -205,7 +206,7 @@ public class PojoUtils {
}
public static List<ProductRestPojo> parseProducts(List<Product> prods) {
ArrayList<ProductRestPojo> ret = new ArrayList<ProductRestPojo>();
ArrayList<ProductRestPojo> ret = new ArrayList<>();
for (Product p : prods) {
ret.add(initProductRestPojo(p));
}
......@@ -217,7 +218,7 @@ public class PojoUtils {
ret.setId(product.getId());
ret.setName(product.getName());
ret.setDescription(product.getDescription());
ret.setPrice(product.getPrice().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
ret.setPrice(product.getPrice().setScale(2, RoundingMode.HALF_UP).toString());
return ret;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.rest;
......@@ -22,15 +22,12 @@ import io.swagger.v3.jaxrs2.integration.resources.OpenApiResource;
import io.swagger.v3.oas.integration.SwaggerConfiguration;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.servers.Server;
import org.glassfish.jersey.logging.LoggingFeature;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletConfig;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Context;
import java.util.Arrays;
......
......@@ -2,7 +2,6 @@ package fi.codecrew.moya.rest;
import fi.codecrew.moya.rest.placemap.v1.PlaceCodePojo;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.rest.meta.v1;
......@@ -37,13 +37,13 @@ public abstract class AbstractRestViewV1 {
/**
* Convert List<PathSegment> to List<String>
*
*
* @param path
* List<PathSegment>
* @return List<String>
*/
public List<String> pathToStrings(List<PathSegment> path) {
ArrayList<String> stringList = new ArrayList<String>(path.size());
ArrayList<String> stringList = new ArrayList<>(path.size());
for (PathSegment s : path) {
String segmentString = s.getPath();
if (segmentString != null && !segmentString.isEmpty()) {
......
package fi.codecrew.moya.rest.placemap.v1;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.ejb.EJB;
......@@ -9,38 +8,17 @@ import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.BarcodeBeanLocal;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.beans.PlaceBeanLocal;
import fi.codecrew.moya.beans.UserBeanLocal;
import fi.codecrew.moya.beans.map.QueueBeanLocal;
import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.enums.apps.UserPermission;
import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.Place;
import fi.codecrew.moya.rest.PojoUtils;
import fi.codecrew.moya.rest.pojo.placemap.v1.IntegerRoot;
import fi.codecrew.moya.rest.pojo.placemap.v1.PlacemapMapRootPojo;
import fi.codecrew.moya.rest.pojo.placemap.v1.SimplePlacePojo;
import fi.codecrew.moya.rest.pojo.placemap.v1.SimplePlacelistRoot;
import fi.codecrew.moya.utilities.PasswordFunctions;
import fi.codecrew.moya.web.cdiview.map.MapPlacechangeView;
import fi.codecrew.moya.web.cdiview.map.MapPlacechangeView.MoveContainer;
import fi.codecrew.moya.web.cdiview.user.UserView;
@RequestScoped
@Path("/placemove/v1")
......
package fi.codecrew.moya.rest.v2;
import fi.codecrew.moya.enums.Gender;
import fi.codecrew.moya.model.CardCode;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.PrintedCard;
import fi.codecrew.moya.model.User;
import fi.codecrew.moya.rest.pojo.userinfo.v3.CardCodePojoV3;
import fi.codecrew.moya.rest.pojo.userinfo.v3.PrintedCardRestPojoV3;
import fi.codecrew.moya.rest.v2.pojo.UserPojo;
import java.io.Serializable;
import java.util.ArrayList;
/**
* Created by jkj on 2015-05-31.
......@@ -18,7 +13,7 @@ import java.util.ArrayList;
public class PojoFactoryV2 implements Serializable {
/**
*
*
*/
private static final long serialVersionUID = 1L;
......
......@@ -2,7 +2,6 @@ package fi.codecrew.moya.rest.v2;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
......
......@@ -3,7 +3,6 @@ package fi.codecrew.moya.rest.v3;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.UserBeanLocal;
import fi.codecrew.moya.handler.SessionHandler;
import fi.codecrew.moya.handler.SessionStore;
import fi.codecrew.moya.rest.v3.pojo.LocalePojoV3;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
......
package fi.codecrew.moya.rest.v3.pojo;
import fi.codecrew.moya.model.Vip;
import fi.codecrew.moya.model.VipProduct;
import fi.codecrew.moya.rest.pojo.vip.v2.VipProductPojo;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.servlet;
......@@ -43,7 +43,7 @@ import fi.codecrew.moya.model.UserImage;
public class UserCardPngServlet extends GenericImageServlet {
/**
*
*
*/
private static final long serialVersionUID = -3359999630873773508L;
......@@ -69,7 +69,7 @@ public class UserCardPngServlet extends GenericImageServlet {
@Override
protected ImageMover getImagedata(HttpServletRequest request) {
ImageMover ret = new ImageMover();
List<String> urlparts = new ArrayList<String>();
List<String> urlparts = new ArrayList<>();
if (request.getPathInfo() != null)
{
Matcher matcher = URLPATTERN.matcher(request.getPathInfo());
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
/*
* To change this template, choose Tools | Templates
......@@ -45,7 +45,6 @@ import fi.codecrew.moya.beans.UserBeanLocal;
import fi.codecrew.moya.beans.UserUtilBeanLocal;
import fi.codecrew.moya.enums.apps.EventPermission;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.Poll;
import fi.codecrew.moya.model.PollQuestion;
import fi.codecrew.moya.model.PossibleAnswer;
......@@ -53,7 +52,7 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
import fi.codecrew.moya.web.cdiview.eticket.EticketView;
/**
*
*
* @author tuukka
*/
@Named("testView")
......@@ -61,7 +60,7 @@ import fi.codecrew.moya.web.cdiview.eticket.EticketView;
public class TestDataView extends GenericCDIView {
/**
*
*
*/
private static final long serialVersionUID = 1L;
......
......@@ -2,19 +2,14 @@ package fi.codecrew.moya.web.api;
import fi.codecrew.moya.beans.ApiApplicationBeanLocal;
import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.enums.apps.SpecialPermission;
import fi.codecrew.moya.model.ApiApplication;
import fi.codecrew.moya.model.ApiApplicationInstance;
import fi.codecrew.moya.utilities.PasswordFunctions;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.faces.model.ListDataModel;
import javax.inject.Named;
import java.util.List;
@Named
@ConversationScoped
......
......@@ -6,17 +6,13 @@ import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import org.primefaces.component.log.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.ApiApplicationBeanLocal;
import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.beans.api.ApiBeanLocal;
import fi.codecrew.moya.enums.apps.EventPermission;
import fi.codecrew.moya.enums.apps.SpecialPermission;
import fi.codecrew.moya.model.ApiApplication;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview;
......@@ -84,7 +84,7 @@ public abstract class PaginationView<T extends ModelInterface> extends GenericCD
public ListDataModel<T> getResultdatamodel() {
if (resultdatamodel == null) {
resultdatamodel = new ListDataModel<T>(results);
resultdatamodel = new ListDataModel<>(results);
}
return resultdatamodel;
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.card;
......@@ -64,7 +64,7 @@ public class CardMassPrintView extends GenericCDIView implements Serializable {
public void initView() {
List<EventUser> eventUsers = userCartView.getUsercart();
ArrayList<Integer> userIdList = new ArrayList<Integer>();
ArrayList<Integer> userIdList = new ArrayList<>();
for (EventUser eu : eventUsers) {
userIdList.add(eu.getId());
}
......@@ -95,7 +95,7 @@ public class CardMassPrintView extends GenericCDIView implements Serializable {
cardPrintBean.acceptMassPrintResult(mpr);
}
userCartView.setUsercart(new ArrayList<EventUser>());
userCartView.setUsercart(new ArrayList<>());
return "accepted";
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.card;
......@@ -45,28 +45,28 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class CardTemplateDataEditView extends GenericCDIView {
private static final long serialVersionUID = -9115983838324313414L;
private static final Logger logger = LoggerFactory.getLogger(CardTemplateDataEditView.class);
private Integer templateId = 0;
private Integer cardTextDataId = 0;
private Integer cardObjectDataId = 0;
private CardTemplateDataType createObjectType = CardTemplateDataType.UNKNOWN;
private CardTemplate cardTemplate;
private CardTextData cardTextData;
private CardObjectData cardObjectData;
private String fontColorHex;
@EJB
private transient CardTemplateBeanLocal cfbean;
public void initView() {
if (super.requirePermissions(UserPermission.VIEW_ALL))
{
......@@ -87,7 +87,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
setCardTextData(cfbean.findTextData(cardTextDataId));
logger.info("CardTextData {}", cardTextData);
}
if(templateId != 0) {
setCardTemplate(cfbean.find(templateId));
logger.info("CardTemplate {}", cardTemplate);
......@@ -105,7 +105,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
}
}
}
public void initCardTextData() {
if (super.requirePermissions(UserPermission.VIEW_ALL))
{
......@@ -115,7 +115,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
}
}
}
public void initCardObjectData() {
if (super.requirePermissions(UserPermission.VIEW_ALL))
{
......@@ -125,7 +125,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
}
}
}
public void initCardTemplate() {
if (super.requirePermissions(UserPermission.VIEW_ALL))
{
......@@ -140,7 +140,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
}
}
}
public void initCardTextDataCreate() {
if (super.requirePermissions(UserPermission.VIEW_ALL))
{
......@@ -151,7 +151,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
}
}
}
public void initCardTextObjectCreate() {
if (super.requirePermissions(UserPermission.VIEW_ALL))
{
......@@ -162,7 +162,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
}
}
}
public void initCreateObjectType() {
if (super.requirePermissions(UserPermission.VIEW_ALL))
{
......@@ -176,7 +176,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
}*/
}
}
public String deleteObjectData() {
if(this.cardObjectData != null) {
setCardTemplate(cfbean.removeCardObjectData(this.cardObjectData));
......@@ -185,7 +185,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
logger.info("CardObjectData is null!");
return "/useradmin/listCardTemplateData";
}
public String deleteTextData() {
if(this.cardTextData != null) {
setCardTemplate(cfbean.removeCardTextData(this.cardTextData));
......@@ -194,7 +194,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
logger.info("CardTextData is null!");
return "/useradmin/listCardTemplateData";
}
public String deleteObjectData(Integer objectDataId) {
if(this.cardObjectData != null) {
setCardTemplate(cfbean.removeCardObjectData(cfbean.findObjectData(objectDataId)));
......@@ -203,7 +203,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
logger.info("CardObjectData is null!");
return "/useradmin/listCardTemplateData";
}
public String deleteTextData(Integer textDataId) {
if(this.cardTextData != null) {
setCardTemplate(cfbean.removeCardTextData(cfbean.findTextData(textDataId)));
......@@ -212,11 +212,11 @@ public class CardTemplateDataEditView extends GenericCDIView {
logger.info("CardTextData is null!");
return "/useradmin/listCardTemplateData";
}
public String localisedLabel(String text, String type) {
return I18n.get(text + type);
}
public String getFontColorHex() {
return fontColorHex;
}
......@@ -224,19 +224,19 @@ public class CardTemplateDataEditView extends GenericCDIView {
public void setFontColorHex(String fontColorHex) {
this.fontColorHex = fontColorHex;
}
public String saveTextData() {
//if(cardTextData.getMeta() == null)
// cardTextData.setMeta(Json.createObjectBuilder().build());
cardTextData = cfbean.save(cardTextData);
return null;
}
public String saveObjectData() {
cardObjectData = cfbean.save(cardObjectData);
return null;
}
public CardTextData getCardTextData() {
return cardTextData;
}
......@@ -252,7 +252,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
public void setCardObjectData(CardObjectData cardObjectData) {
this.cardObjectData = cardObjectData;
}
public Integer getCardTextDataId() {
return cardTextDataId;
}
......@@ -276,7 +276,7 @@ public class CardTemplateDataEditView extends GenericCDIView {
public void setCreateObjectType(CardTemplateDataType createObjectType) {
this.createObjectType = createObjectType;
}
public Integer getTemplateId() {
return templateId;
}
......@@ -292,21 +292,21 @@ public class CardTemplateDataEditView extends GenericCDIView {
public void setCardTemplate(CardTemplate cardTemplate) {
this.cardTemplate = cardTemplate;
}
public List<CardObjectDataType> getCardObjectDataTypes() {
return new ArrayList<CardObjectDataType>(Arrays.asList(CardObjectDataType.values()));
return new ArrayList<>(Arrays.asList(CardObjectDataType.values()));
}
public List<CardTextDataType> getCardTextDataTypes() {
List<CardTextDataType> types = new ArrayList<CardTextDataType>(Arrays.asList(CardTextDataType.values()));
List<CardTextDataType> types = new ArrayList<>(Arrays.asList(CardTextDataType.values()));
return types;
}
public List<CardTextStyle> getFontStyles() {
return new ArrayList<CardTextStyle>(Arrays.asList(CardTextStyle.values()));
return new ArrayList<>(Arrays.asList(CardTextStyle.values()));
}
public List<CardTextAlignment> getTextAlignments() {
return new ArrayList<CardTextAlignment>(Arrays.asList(CardTextAlignment.values()));
return new ArrayList<>(Arrays.asList(CardTextAlignment.values()));
}
}
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.content;
......@@ -65,7 +65,7 @@ public class SitePageView extends GenericCDIView {
{
sitepage = new SitePage();
sitepage.setName(managedPage);
sitepage.setContents(new ArrayList<PageContent>());
sitepage.setContents(new ArrayList<>());
sitepage.getContents().add(new PageContent(sitepage));
}
super.beginConversation();
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.eticket;
......@@ -90,9 +90,9 @@ public class EticketView extends GenericCDIView {
super.navihandler.forward("/shop/createBill?faces-redirect=true");
}
}
public ListDataModel<GroupMembership> getGroupMemberships() {
memberlist = new ListDataModel<GroupMembership>(ticketBean.findMembershipPrintlistForUser(userView.getSelectedUser()));
memberlist = new ListDataModel<>(ticketBean.findMembershipPrintlistForUser(userView.getSelectedUser()));
return memberlist;
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.eticket;
......@@ -64,7 +64,7 @@ public class StandaloneEticketView extends GenericCDIView {
@EJB
private TicketBeanLocal ticketBean;
private ListDataModel<GroupMembership> memberlist;
private boolean mapVisible = false;
......@@ -86,9 +86,9 @@ public class StandaloneEticketView extends GenericCDIView {
}
public ListDataModel<GroupMembership> getGroupMemberships() {
memberlist = new ListDataModel<GroupMembership>(ticketBean.findMembershipPrintlistForUser(user));
memberlist = new ListDataModel<>(ticketBean.findMembershipPrintlistForUser(user));
return memberlist;
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.license;
......@@ -44,16 +44,16 @@ public class LicenseView extends GenericCDIView {
private static final long serialVersionUID = -8346420143750551402L;
private EventUser currentUser;
@EJB
private PermissionBeanLocal permissionBean;
@EJB
private EventBeanLocal eventBean;
@EJB
private LicenseBeanLocal licenseBean;
@EJB
private ProductBeanLocal productBean;
......@@ -68,7 +68,7 @@ public class LicenseView extends GenericCDIView {
if (licenses == null) {
this.currentLicense = new LicenseTarget();
this.currentLicense.setEvent(eventBean.getCurrentEvent());
this.licenses = new ListDataModel<LicenseTarget>(licenseBean.findAll(eventBean.getCurrentEvent()));
this.licenses = new ListDataModel<>(licenseBean.findAll(eventBean.getCurrentEvent()));
this.beginConversation();
}
}
......@@ -78,8 +78,8 @@ public class LicenseView extends GenericCDIView {
if (super.requirePermissions(LicensePermission.VIEW_OWN_CODES)) {
if (licenseCodes == null) {
currentUser = permissionBean.getCurrentUser();
this.licenseCodes = new ListDataModel<LicenseCode>(currentUser.getUser().getLicenseCodes());
this.licenses = new ListDataModel<LicenseTarget>(licenseBean.findUnopenedUserGames(currentUser));
this.licenseCodes = new ListDataModel<>(currentUser.getUser().getLicenseCodes());
this.licenses = new ListDataModel<>(licenseBean.findUnopenedUserGames(currentUser));
this.beginConversation();
}
}
......@@ -87,7 +87,7 @@ public class LicenseView extends GenericCDIView {
public String saveCurrentLicense() {
licenseBean.saveOrCreateLicense(currentLicense);
this.licenses = new ListDataModel<LicenseTarget>(licenseBean.findAll(eventBean.getCurrentEvent()));
this.licenses = new ListDataModel<>(licenseBean.findAll(eventBean.getCurrentEvent()));
return null;
}
......@@ -97,16 +97,16 @@ public class LicenseView extends GenericCDIView {
}
public String openSelectedCode() {
if(this.licenses != null && this.licenses.isRowAvailable()) {
LicenseTarget license = this.licenses.getRowData();
try {
LicenseCode code = licenseBean.createAndAccessCode(license, currentUser.getUser());
} catch(GenerationException x) {
this.addFaceMessage("game.out");
this.addFaceMessage("game.out");
}
licenseCodes = null;
initUserView();
......@@ -144,7 +144,7 @@ public class LicenseView extends GenericCDIView {
public void setCurrentLicense(LicenseTarget currentLicense) {
this.currentLicense = currentLicense;
}
public List<Product> getProductsForLicenses() {
return productBean.findPlaceProducts();
}
......
......@@ -31,7 +31,7 @@ public class AjaxMapManageView extends GenericCDIView {
public void placeClicked(ActionEvent event) {
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
String placeIdStr = ec.getRequestParameterMap().get("mgmtPlaceId");
logger.info("Place id {}, str", placeId, placeIdStr);
logger.info("Place id {}, str {}", placeId, placeIdStr);
placeId = Integer.parseInt(placeIdStr);
place = placebean.find(placeId);
......
package fi.codecrew.moya.web.cdiview.map;
import java.awt.*;
import java.io.Serializable;
import java.util.*;
import java.util.List;
......@@ -35,7 +34,7 @@ import fi.codecrew.moya.web.cdiview.user.UserView;
public class AjaxMapView extends GenericCDIView {
/**
*
*
*/
private static final long serialVersionUID = 8203589456357519480L;
// @Inject
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.map;
......@@ -89,7 +89,7 @@ public class PlacegroupView extends GenericCDIView {
public String editGroup() {
setGroup(placegroups.getRowData());
setPlacelist(new ListDataModel<Place>(group.getPlaces()));
setPlacelist(new ListDataModel<>(group.getPlaces()));
return "/place/editGroup";
}
......@@ -197,7 +197,7 @@ public class PlacegroupView extends GenericCDIView {
}
public ListDataModel<GroupMembership> getGroupMemberships() {
memberlist = new ListDataModel<GroupMembership>(placegroupBean.getMembershipsAndCreations(user));
memberlist = new ListDataModel<>(placegroupBean.getMembershipsAndCreations(user));
return memberlist;
}
......@@ -251,8 +251,7 @@ public class PlacegroupView extends GenericCDIView {
public ListDataModel<PlaceGroup> getPlacegroups() {
if (placegroups == null) {
List<PlaceGroup> retlist = new ArrayList<PlaceGroup>();
retlist.addAll(placegroupBean.getPlacegroups(user));
List<PlaceGroup> retlist = new ArrayList<>(placegroupBean.getPlacegroups(user));
for (GroupMembership gm : placegroupBean.getMemberships(user)) {
if (!retlist.contains(gm.getPlaceGroup())) {
......@@ -260,7 +259,7 @@ public class PlacegroupView extends GenericCDIView {
}
}
placegroups = new ListDataModel<PlaceGroup>(retlist);
placegroups = new ListDataModel<>(retlist);
}
return placegroups;
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.map;
......@@ -24,7 +24,6 @@ import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.Place;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import org.joda.time.format.ISODateTimeFormat;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
......
......@@ -24,7 +24,7 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
public class UnlockedPlaceView extends GenericCDIView {
/**
*
*
*/
private static final long serialVersionUID = 7430277821503568386L;
......@@ -76,7 +76,7 @@ public class UnlockedPlaceView extends GenericCDIView {
public void init()
{
if (places == null) {
HashMap<EventUser, UnlockedPlaceContainer> usermap = new HashMap<EventUser, UnlockedPlaceContainer>();
HashMap<EventUser, UnlockedPlaceContainer> usermap = new HashMap<>();
EventMap map = null;
if (getMapId() != null) {
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.menu;
......@@ -65,7 +65,7 @@ public class MenuView implements Serializable{
private HashSet<MenuNavigation> navis;
private Map<String, List<PageContent>> contents = new HashMap<String, List<PageContent>>();
private Map<String, List<PageContent>> contents = new HashMap<>();
@EJB
private SitePageBeanLocal pagebean;
......@@ -125,7 +125,7 @@ public class MenuView implements Serializable{
public List<JsfMenuitem> getViewChangeTopmenu()
{
if (viewchangeTopmenu == null) {
viewchangeTopmenu = new ArrayList<JsfMenuitem>();
viewchangeTopmenu = new ArrayList<>();
for (MenuNavigation topmenu : menubean.getTopmenus()) {
......@@ -155,8 +155,8 @@ public class MenuView implements Serializable{
{
if (menus == null)
{
menus = new LinkedList<List<JsfMenuitem>>();
navis = new HashSet<MenuNavigation>();
menus = new LinkedList<>();
navis = new HashSet<>();
MenuNavigation pathIter = menubean.findNavigation(layoutview.getPagepath());
while (pathIter != null) {
......@@ -172,7 +172,7 @@ public class MenuView implements Serializable{
}
private LinkedList<JsfMenuitem> addMenu(List<MenuNavigation> children) {
LinkedList<JsfMenuitem> ret = new LinkedList<JsfMenuitem>();
LinkedList<JsfMenuitem> ret = new LinkedList<>();
// Iterate through children
for (MenuNavigation child : children) {
// if is visible, permission is null or has permission, continue
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.organisation;
......@@ -256,7 +256,7 @@ public class EventOrgView extends GenericCDIView {
public void setEvent(LanEvent event) {
this.event = event;
eventdomains = new ListDataModel<LanEventDomain>(event.getDomains());
eventdomains = new ListDataModel<>(event.getDomains());
}
public ListDataModel<LanEventDomain> getEventdomains() {
......@@ -317,7 +317,7 @@ public class EventOrgView extends GenericCDIView {
public List<User> getSuperUsers() {
if (!permbean.getCurrentUser().isSuperadmin())
return new ArrayList<User>();
return new ArrayList<>();
return userBean.findSuperusers();
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.organisation;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -66,7 +65,7 @@ public class EventPropertyView extends GenericCDIView {
private LanEventPrivateProperty privateProperty;
public List<LanEventPropertyKey> getAvailablePropertyKeys() {
List<LanEventPropertyKey> ret = new ArrayList<LanEventPropertyKey>(Arrays.asList(LanEventPropertyKey.values()));
List<LanEventPropertyKey> ret = new ArrayList<>(Arrays.asList(LanEventPropertyKey.values()));
if (createKey != null) {
ret.remove(createKey);
}
......@@ -81,7 +80,7 @@ public class EventPropertyView extends GenericCDIView {
public List<LanEventPrivatePropertyKey> getAvailablePrivatePropertyKeys() {
List<LanEventPrivatePropertyKey> ret = null;
if (isPrivatePropertyPermission() && eventbean.getCurrentEvent().equals(eventorgview.getEvent())) {
ret = new ArrayList<LanEventPrivatePropertyKey>(Arrays.asList(LanEventPrivatePropertyKey.values()));
ret = new ArrayList<>(Arrays.asList(LanEventPrivatePropertyKey.values()));
if (createPrivateKey != null) {
ret.remove(createPrivateKey);
}
......@@ -220,14 +219,14 @@ public class EventPropertyView extends GenericCDIView {
public ListDataModel<LanEventProperty> getProperties() {
if (properties == null && eventorgview != null && eventorgview.getEvent() != null) {
properties = new ListDataModel<LanEventProperty>(eventorgview.getEvent().getProperties());
properties = new ListDataModel<>(eventorgview.getEvent().getProperties());
}
return properties;
}
public ListDataModel<LanEventPrivateProperty> getPrivateProperties() {
if (privateProperties == null && eventorgview != null && eventbean.getCurrentEvent().equals(eventorgview.getEvent())) {
privateProperties = new ListDataModel<LanEventPrivateProperty>(eventbean.getPrivateProperties());
privateProperties = new ListDataModel<>(eventbean.getPrivateProperties());
}
return privateProperties;
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.poll;
......@@ -102,13 +102,13 @@ public class PollView extends GenericCDIView {
return;
}
logger.debug("initializing poll questions {}", poll.getQuestions());
pages = new HashMap<Integer, List<QuestionWrapper>>();
pages = new HashMap<>();
for (PollQuestion q : poll.getQuestions()) {
if (!getPages().containsKey(q.getPage())) {
getPages().put(q.getPage(), new LinkedList<QuestionWrapper>());
getPages().put(q.getPage(), new LinkedList<>());
}
getPages().get(q.getPage()).add(new QuestionWrapper(q));
}
......@@ -134,7 +134,7 @@ public class PollView extends GenericCDIView {
}
private List<PollAnswer> createAnswers() {
ArrayList<PollAnswer> ret = new ArrayList<PollAnswer>();
ArrayList<PollAnswer> ret = new ArrayList<>();
for (List<QuestionWrapper> qw : getPages().values()) {
for (QuestionWrapper wrapper : qw) {
ret.addAll(wrapper.getAnswers());
......@@ -200,7 +200,7 @@ public class PollView extends GenericCDIView {
public QuestionWrapper(PollQuestion q) {
question = q;
answers = new ArrayList<PollAnswer>();
answers = new ArrayList<>();
for (PossibleAnswer possible : q.getAnswers()) {
answers.add(new PollAnswer(possible));
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.reader;
......@@ -39,13 +39,13 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
public class ReaderListDataView extends GenericCDIView {
/**
*
*
*/
private static final long serialVersionUID = -601822388844764143L;
@EJB
private ReaderBeanLocal readerbean;
@Inject
private ReaderNameContainer readerNameContainer;
......@@ -61,37 +61,37 @@ public class ReaderListDataView extends GenericCDIView {
public ListDataModel<Reader> getReaders()
{
if (readers == null) {
readers = new ListDataModel<Reader>(readerbean.getReaders());
readers = new ListDataModel<>(readerbean.getReaders());
}
return readers;
}
public String selectReader() {
if(readers.isRowAvailable()) {
readerNameContainer.setReaderId(readers.getRowData().getId());
}
return null;
}
public void selectMultipleReaders() {
if(readers.isRowAvailable()) {
readerNameContainer.addReader(readers.getRowData().getId());
}
}
public ListDataModel<Reader> getSelectedReaders() {
ArrayList<Reader> readers = new ArrayList<Reader>();
ArrayList<Reader> readers = new ArrayList<>();
for(Integer rid : readerNameContainer.getReaders()) {
Reader r = readerbean.getReader(rid);
if(r != null)
readers.add(r);
}
return new ListDataModel<Reader>(readers);
return new ListDataModel<>(readers);
}
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.reader;
......@@ -37,7 +37,7 @@ public class ReaderNameContainer implements Serializable {
//private Integer readerId;
// handling first user when using via getReaderId and setReaderId;
private final List<Integer> readers = new ArrayList<Integer>();;
private final List<Integer> readers = new ArrayList<>();;
private boolean autopoll = false;
......@@ -46,7 +46,7 @@ public class ReaderNameContainer implements Serializable {
/**
* use this function when using readers in "only one reader" -mode
*
*
* @return first selected reader, or null if no reader selected
*/
public Integer getReaderId() {
......@@ -58,7 +58,7 @@ public class ReaderNameContainer implements Serializable {
/**
* Use this function when using readers in "only one reader" -mode
*
*
* @param readerId
* to set, or null to clear all readers
*/
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.reader;
......@@ -27,6 +27,7 @@ import javax.faces.model.ListDataModel;
import javax.inject.Inject;
import javax.inject.Named;
import fi.codecrew.moya.model.role.Role;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -40,12 +41,11 @@ import fi.codecrew.moya.model.Product;
import fi.codecrew.moya.model.Reader;
import fi.codecrew.moya.model.ReaderEvent;
import fi.codecrew.moya.model.ReaderType;
import fi.codecrew.moya.model.Role;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import fi.codecrew.moya.web.cdiview.shop.UserCardWrapper;
import fi.codecrew.moya.web.cdiview.user.UserView;
@Named
@Named
@SessionScoped
public class ReaderView extends GenericCDIView {
......@@ -55,7 +55,7 @@ public class ReaderView extends GenericCDIView {
private ListDataModel<UserCardWrapper> userlist;
private ListDataModel<ReaderEvent> readerEventList;
private Reader editReader = null;
@Inject
......@@ -82,7 +82,7 @@ public class ReaderView extends GenericCDIView {
@Inject
private UserView userview;
public void initEditReader() {
if (super.requirePermissions(ShopPermission.SHOP_TO_OTHERS) && editReader == null) {
editReader = readerbean.getReader(readerid);
......@@ -143,9 +143,9 @@ public class ReaderView extends GenericCDIView {
return "/useradmin/edit";
}
public String searchforuser()
{
if (usersearch == null || usersearch.length() < 2) {
......@@ -156,14 +156,14 @@ public class ReaderView extends GenericCDIView {
return null;
}
*/
public List<Product> getAutoProducts() {
List<Product> ret = new ArrayList<Product>();
List<Product> ret = new ArrayList<>();
ret.add(Product.EMPTY_PRODUCT);
ret.addAll(shopBean.getProducts());
return ret;
......@@ -177,7 +177,7 @@ public class ReaderView extends GenericCDIView {
public ListDataModel<ReaderEvent> getReaderEvents()
{
readerEventList = new ListDataModel<ReaderEvent>(readerbean.getReaderEvents(namecontainer.getReaderId()));
readerEventList = new ListDataModel<>(readerbean.getReaderEvents(namecontainer.getReaderId()));
return readerEventList;
}
......@@ -242,7 +242,7 @@ public class ReaderView extends GenericCDIView {
return ReaderType.values();
}
/**
* Get newest readerevent from any reader
* @return
......@@ -251,18 +251,18 @@ public class ReaderView extends GenericCDIView {
ReaderEvent newestEvent = null;
for(Integer rid : namecontainer.getReaders()) {
ReaderEvent event = readerbean.getLastReaderEvent(rid);
if(newestEvent == null || event.getUpdatetime().getTime() > newestEvent.getUpdatetime().getTime()) {
newestEvent = event;
}
}
return newestEvent;
}
public ReaderEvent getReaderEvent() {
if(namecontainer.isAutopoll()) {
if(isNewCodes()) {
return pollingCodeHandled();
......@@ -272,7 +272,7 @@ public class ReaderView extends GenericCDIView {
return null;
}
}
if (readerEventList == null)
return null;
......@@ -293,13 +293,13 @@ public class ReaderView extends GenericCDIView {
/**
* Mark pollingcode handled (for autoread-stuff)
*
*
* And also return last code, just in case.
* @return
*/
public ReaderEvent pollingCodeHandled() {
lastReadEvent = getNewestEvent();
return lastReadEvent;
}
......@@ -312,30 +312,30 @@ public class ReaderView extends GenericCDIView {
public boolean isNewCodes() {
if (!namecontainer.isAutopoll())
return false;
for(Integer rid : namecontainer.getReaders()) {
ReaderEvent event = readerbean.getLastReaderEvent(rid);
if(event == null || event.getId() == null) {
continue;
}
// found new code, and there is no previous code, that's true
if(lastReadEvent == null || lastReadEvent.getId() == null)
return true;
// is new code newer than previous code?
if(lastReadEvent.getUpdatetime().getTime() < event.getUpdatetime().getTime())
return true;
}
return false;
}
public String getUserInsertCode() {
return "";
}
......@@ -351,22 +351,22 @@ public class ReaderView extends GenericCDIView {
public void setPollingMode(boolean pollingMode) {
if(!namecontainer.isAutopoll() && pollingMode) {
this.initializeForPolling();
}
namecontainer.setAutopoll(pollingMode);
}
public void changeReader() {
namecontainer.setReaderId(null);
navihandler.forward("/info/index");
}
public Reader getCurrentReader() {
return readerbean.getReader(namecontainer.getReaderId());
}
......@@ -380,5 +380,5 @@ public class ReaderView extends GenericCDIView {
public void setEditReader(Reader editReader) {
this.editReader = editReader;
}
}
......@@ -28,7 +28,6 @@ import javax.inject.Named;
import fi.codecrew.moya.beans.CheckoutFiV2BeanLocal;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.checkout.CheckoutCreateResponsePojo;
import fi.codecrew.moya.model.LanEventProperty;
import fi.codecrew.moya.model.LanEventPropertyKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.shop;
......@@ -52,7 +52,7 @@ import fi.codecrew.moya.web.helpers.LazyEntityDataModel;
public class BillListView extends GenericCDIView {
/**
*
*
*/
private static final long serialVersionUID = -4668803787903428161L;
......@@ -131,7 +131,7 @@ public class BillListView extends GenericCDIView {
public void initSummaryView()
{
if (super.requirePermissions(BillPermission.READ_ALL)) {
setBillsummary(new ArrayList<BillSummary>(billbean.getBillLineSummary()));
setBillsummary(new ArrayList<>(billbean.getBillLineSummary()));
}
}
......
......@@ -18,15 +18,12 @@
*/
package fi.codecrew.moya.web.cdiview.shop;
import fi.codecrew.moya.beans.CheckoutFiBeanLocal;
import fi.codecrew.moya.beans.CheckoutFiV2BeanLocal;
import fi.codecrew.moya.util.CheckoutReturnType;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ComponentSystemEvent;
import javax.inject.Named;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.shop;
......@@ -66,7 +66,7 @@ public class DiscountView extends GenericCDIView {
public String create() {
if (product.getDiscounts() == null) {
product.setDiscounts(new ArrayList<Discount>());
product.setDiscounts(new ArrayList<>());
}
product.getDiscounts().add(discount);
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.shop;
......@@ -51,13 +51,13 @@ import fi.codecrew.moya.web.helpers.ProductShopItem;
public class FoodWaveFoodView extends GenericCDIView {
/**
*
*
*/
private static final long serialVersionUID = 5723448087928988814L;
@EJB
private FoodWaveBeanLocal foodWaveBean;
@Inject
private ProductShopItemHelper psiHelper;
......@@ -90,7 +90,7 @@ public class FoodWaveFoodView extends GenericCDIView {
foodWave = foodWaveBean.findFoodwave(getFoodwaveid());
logger.debug("Foodwave {}", foodWave);
shoppingcart = new ListDataModel<ProductShopItem>(ProductShopItem.productGTList(foodWave.getTemplate().getProducts(), userview.getSelectedUser()));
shoppingcart = new ListDataModel<>(ProductShopItem.productGTList(foodWave.getTemplate().getProducts(), userview.getSelectedUser()));
this.beginConversation();
}
......@@ -146,7 +146,7 @@ public class FoodWaveFoodView extends GenericCDIView {
/**
* Just create bills, they are nice <insert picture of bill gates here>
*
*
* @return
*/
public Bill createBillFromShoppingcart() {
......@@ -167,16 +167,16 @@ public class FoodWaveFoodView extends GenericCDIView {
return bill;
}
public String buyAndPayWithCredits() {
Bill b = createBillFromShoppingcart();
try {
billBean.markPaid(b, Calendar.getInstance(), true, Bill.BillPaymentSource.CREDITS);
} catch (BillException e) {
throw new RuntimeException(e);
}
super.addFaceMessage("foodwave.markPaid");
return "/useradmin/edit";
}
......@@ -184,14 +184,14 @@ public class FoodWaveFoodView extends GenericCDIView {
public String buyAndPay()
{
Bill b = createBillFromShoppingcart();
try {
billBean.markPaid(b, Calendar.getInstance(), false, Bill.BillPaymentSource.CASH);
} catch (BillException e) {
throw new RuntimeException(e);
}
super.addFaceMessage("foodwave.markPaid");
return "/useradmin/edit";
}
......@@ -232,9 +232,8 @@ public class FoodWaveFoodView extends GenericCDIView {
}
private boolean productsInCart() {
Iterator<ProductShopItem> nullcheckIter = getShoppingcart().iterator();
while (nullcheckIter.hasNext()) {
if (nullcheckIter.next().getCount().compareTo(BigDecimal.ZERO) > 0) {
for (ProductShopItem productShopItem : getShoppingcart()) {
if (productShopItem.getCount().compareTo(BigDecimal.ZERO) > 0) {
return true;
}
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.shop;
......@@ -107,8 +107,8 @@ public class FoodWaveView extends GenericCDIView {
super.beginConversation();
}
}
foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
foodWaves = new ListDataModel<>(foodWaveBean.getEventFoodWaves());
}
public String createFoodwave() {
......@@ -122,9 +122,9 @@ public class FoodWaveView extends GenericCDIView {
return "/foodmanager/listFoodwaves";
}
public void initListFoodwaves()
{
if (super.requirePermissions(ShopPermission.SHOP_FOODWAVE) && template == null)
......@@ -132,9 +132,9 @@ public class FoodWaveView extends GenericCDIView {
if (templateId != null)
{
template = foodWaveBean.findTemplate(templateId);
foodWaves = new ListDataModel<FoodWave>(template.getFoodwaves());
foodWaves = new ListDataModel<>(template.getFoodwaves());
} else {
foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getOpenFoodWaves());
foodWaves = new ListDataModel<>(foodWaveBean.getOpenFoodWaves());
}
super.beginConversation();
}
......@@ -160,7 +160,7 @@ public class FoodWaveView extends GenericCDIView {
if (super.requirePermissions(ShopPermission.MANAGE_PRODUCTS) && template == null)
{
template = new FoodWaveTemplate();
template.setProducts(new ArrayList<Product>());
template.setProducts(new ArrayList<>());
template.setEvent(eventbean.getCurrentEvent());
createNewProductSkeleton();
......@@ -171,8 +171,8 @@ public class FoodWaveView extends GenericCDIView {
public List<FoodwaveProductSummary> getProductSummaries() {
HashMap<Product, FoodwaveProductSummary> pmap = new HashMap<Product, FoodwaveProductSummary>();
HashMap<Product, FoodwaveProductSummary> pmap = new HashMap<>();
for (AccountEvent ae : getSelectedFoodWave().getAccountEvents()) {
if (!pmap.containsKey(ae.getProduct())) {
......@@ -183,11 +183,11 @@ public class FoodWaveView extends GenericCDIView {
pmap.get(ae.getProduct()).add(ae);
}
System.out.println("::" + pmap.values().size());
return new ArrayList<FoodwaveProductSummary>(pmap.values());
return new ArrayList<>(pmap.values());
}
private void createNewProductSkeleton() {
TreeSet<ProductFlag> ts = new TreeSet<ProductFlag>();
TreeSet<ProductFlag> ts = new TreeSet<>();
currentProduct = new Product();
currentProduct.setProductFlags(ts);
......@@ -216,10 +216,10 @@ public class FoodWaveView extends GenericCDIView {
}
return ret.negate();
}
public BigDecimal getFoodwaveBuyInPrice()
{
......@@ -257,19 +257,19 @@ public class FoodWaveView extends GenericCDIView {
return null;
}
public String markBillPaid() {
if (permbean.hasPermission(BillPermission.WRITE_ALL) && bills != null && bills.isRowAvailable()) {
Bill b = bills.getRowData();
try {
b = billbean.markPaid(b, Calendar.getInstance(), false, Bill.BillPaymentSource.CASH);
} catch (BillException e) {
throw new RuntimeException(e);
}
foodWaveId = selectedFoodWave.getId();
selectedFoodWave = null;
......@@ -279,17 +279,17 @@ public class FoodWaveView extends GenericCDIView {
return null;
}
public String markBillPaidWithCredits() {
if (permbean.hasPermission(BillPermission.WRITE_ALL) && bills != null && bills.isRowAvailable()) {
Bill b = bills.getRowData();
try {
b = billbean.markPaid(b, Calendar.getInstance(), true, Bill.BillPaymentSource.CREDITS);
} catch (BillException e) {
throw new RuntimeException(e);
}
}
foodWaveId = selectedFoodWave.getId();
selectedFoodWave = null;
......@@ -335,15 +335,15 @@ public class FoodWaveView extends GenericCDIView {
}
public void initFoodWaveOrderList() {
if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES) && selectedFoodWave == null) {
selectedFoodWave = foodWaveBean.findFoodwave(foodWaveId);
logger.debug("Got foodwave {} with id {}", selectedFoodWave, foodWaveId);
super.beginConversation();
}
HashSet<Bill> billList = new HashSet<Bill>();
HashSet<Bill> billList = new HashSet<>();
for (BillLine line : getSelectedFoodWave().getBillLines()) {
if (!line.getBill().isPaid()) {
......@@ -351,11 +351,11 @@ public class FoodWaveView extends GenericCDIView {
}
}
bills = new ListDataModel<Bill>(new ArrayList<Bill>(billList));
accountEventLines = new ListDataModel<AccountEvent>(getSelectedFoodWave().getAccountEvents());
bills = new ListDataModel<>(new ArrayList<>(billList));
accountEventLines = new ListDataModel<>(getSelectedFoodWave().getAccountEvents());
}
......@@ -427,15 +427,15 @@ public class FoodWaveView extends GenericCDIView {
public ListDataModel<FoodWave> getFoodWaves() {
return foodWaves;
}
public ListDataModel<AccountEvent> getAccountEventLines() {
return accountEventLines;
}
/*
* public List<BillLine> getUnpaidBills() { return unpaidBills; }
*
*
* public void setUnpaidBills(List<BillLine> unpaidBills) { this.unpaidBills
* = unpaidBills; }
*/
......
......@@ -127,8 +127,8 @@ public class ProductShopView extends GenericCDIView {
return;
}
shoppingcart = new ListDataModel<ProductShopItem>(
ProductShopItem.productList(productBean.listUserShoppableProducts(), userView.getSelectedUser()));
shoppingcart = new ListDataModel<>(
ProductShopItem.productList(productBean.listUserShoppableProducts(), userView.getSelectedUser()));
for (ProductShopItem item : shoppingcart) {
psiHelper.updateProductShopItemCount(item);
......@@ -172,7 +172,7 @@ public class ProductShopView extends GenericCDIView {
public void initShopView() {
if (requirePermissions(ShopPermission.SHOP_TO_OTHERS) && shoppingcart == null) {
shoppingcart = new ListDataModel<ProductShopItem>(ProductShopItem.productGTList(productBean.findForStaffshop(), userView.getSelectedUser()));
shoppingcart = new ListDataModel<>(ProductShopItem.productGTList(productBean.findForStaffshop(), userView.getSelectedUser()));
updateCartLimits(null);
LanEventProperty cashdefault = eventbean.getProperty(LanEventPropertyKey.SHOP_DEFAULT_CASH);
......@@ -236,7 +236,7 @@ public class ProductShopView extends GenericCDIView {
public void updateCartLimits(ProductShopItem item) {
if (boughtItems == null) {
boughtItems = new ListDataModel<ProductShopItem>(new ArrayList<ProductShopItem>());
boughtItems = new ListDataModel<>(new ArrayList<>());
}
@SuppressWarnings("unchecked")
......@@ -246,7 +246,7 @@ public class ProductShopView extends GenericCDIView {
listdata.add(item);
}
Map<Integer, BigDecimal> prodCounts = new HashMap<Integer, BigDecimal>();
Map<Integer, BigDecimal> prodCounts = new HashMap<>();
for (ProductShopItem sc : shoppingcart) {
prodCounts.put(sc.getProduct().getId(), sc.getCount());
}
......@@ -438,9 +438,7 @@ public class ProductShopView extends GenericCDIView {
}
private boolean productsInCart() {
Iterator<ProductShopItem> nullcheckIter = shoppingcart.iterator();
while (nullcheckIter.hasNext()) {
ProductShopItem prod = nullcheckIter.next();
for (ProductShopItem prod : shoppingcart) {
// Autoproduct is not counted as a real product.
if (!prod.getProduct().getProductFlags().contains(ProductFlag.USERSHOP_AUTOPRODUCT) && prod.getCount().compareTo(BigDecimal.ZERO) > 0) {
return true;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.shop;
import fi.codecrew.moya.beans.BillBeanLocal;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.VerkkomaksutFiBeanLocal;
import fi.codecrew.moya.bortal.views.BillSummary;
import fi.codecrew.moya.entitysearch.BillSearchQuery;
import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.exceptions.BillException;
import fi.codecrew.moya.model.Bill;
import fi.codecrew.moya.model.BillLine;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.utilities.SearchQuery.QuerySortOrder;
import fi.codecrew.moya.utilities.SearchResult;
import fi.codecrew.moya.utilities.jsf.MessageHelper;
import fi.codecrew.moya.web.annotations.SelectedUser;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import fi.codecrew.moya.web.helpers.LazyEntityDataModel;
import org.primefaces.model.SortOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@Named
@ConversationScoped
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.shop;
......@@ -160,7 +160,7 @@ public class ProductView extends GenericCDIView {
public String saveLimit()
{
if (product.getProductLimits() == null) {
product.setProductLimits(new ArrayList<ProductLimitation>());
product.setProductLimits(new ArrayList<>());
}
if (!product.getProductLimits().contains(limit)) {
product.getProductLimits().add(limit);
......@@ -182,7 +182,7 @@ public class ProductView extends GenericCDIView {
{
this.productOptionGroup = new ProductOptionGroup();
this.productOptionGroup.setProduct(product);
return "/product/editProductOptionGroup";
}
......@@ -217,13 +217,13 @@ public class ProductView extends GenericCDIView {
{
List<Discount> discs = product.getDiscounts();
discs.sort(Discount.SORT_COMPARATOR);
productDiscounts = new ListDataModel<Discount>(discs);
productDiscounts = new ListDataModel<>(discs);
return productDiscounts;
}
public ListDataModel<ProductLimitation> getProductLimits()
{
productLimits = new ListDataModel<ProductLimitation>(product.getProductLimits());
productLimits = new ListDataModel<>(product.getProductLimits());
return productLimits;
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.shop;
......@@ -49,8 +49,8 @@ public class SalespointListView extends GenericCDIView {
if (super.requirePermissions(SalespointPermission.VIEW)) {
beginConversation();
salespoints = new ListDataModel<Salespoint>(
salespointBean.findAll());
salespoints = new ListDataModel<>(
salespointBean.findAll());
modifySalespoint = permbean
.hasPermission(SalespointPermission.MODIFY);
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.shop;
......@@ -42,17 +42,17 @@ public class UserCardWrapper implements Serializable {
if (user != null) {
cards = user.getPrintedCards();
}
printedCards = new ListDataModel<PrintedCard>(cards);
printedCards = new ListDataModel<>(cards);
}
public static ListDataModel<UserCardWrapper> initWrapper(List<User> users, UserBeanLocal userbean)
{
List<UserCardWrapper> ret = new ArrayList<UserCardWrapper>();
List<UserCardWrapper> ret = new ArrayList<>();
for (User u : users)
{
ret.add(new UserCardWrapper(u, userbean));
}
return new ListDataModel<UserCardWrapper>(ret);
return new ListDataModel<>(ret);
}
public EventUser getUser() {
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.tournaments;
......@@ -30,7 +30,7 @@ import javax.inject.Named;
public class TournamentAddTeamView implements Serializable {
/**
*
*
*/
private static final long serialVersionUID = 1L;
......@@ -38,14 +38,14 @@ public class TournamentAddTeamView implements Serializable {
public TournamentAddTeamView() {
// Players
setPlayers(new ArrayList<String>());
setPlayers(new ArrayList<>());
getPlayers().add("");
getPlayers().add("");
getPlayers().add("");
getPlayers().add("");
getPlayers().add("");
getPlayers().add("");
}
public List<String> getPlayers() {
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.tournaments;
......@@ -38,19 +38,19 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
@ConversationScoped
public class TournamentParticipantsView extends GenericCDIView {
private static final long serialVersionUID = -6066216858686165211L;
private HashMap<Integer, String> eventUserGameID = null;
@EJB private UserBeanLocal userBean;
@EJB private TournamentBeanLocal tournamentBean;
private Tournament tournament = null;
public String showView(Integer tournamentId) {
if(eventUserGameID == null) {
this.tournament = tournamentBean.getTournamentById(tournamentId);
this.beginConversation();
eventUserGameID = new HashMap<Integer, String>();
for(TournamentParticipant tp : tournament.getParticipants()) {
eventUserGameID = new HashMap<>();
for(TournamentParticipant tp : tournament.getParticipants()) {
for(TournamentTeamMember ttm : tp.getTeamMembers()) {
GameID gid = userBean.getGameIDByGameAndUser(tournament.getTournamentGame(), ttm.getEventUser());
if(gid != null)
......@@ -65,18 +65,18 @@ public class TournamentParticipantsView extends GenericCDIView {
else
return "/tournaments/admin/view_tournament_team.xhtml";
}
public void deleteParticipation(ActionEvent ae) {
try {
Integer id = (Integer)ae.getComponent().getAttributes().get("participantid");
tournamentBean.deleteParticipationById(id);
this.tournament = tournamentBean.getTournamentById(this.tournament.getId());
} catch(Exception e) {
MessageHelper.err(e.getMessage());
}
}
public String cancel() {
this.endConversation();
return "/tournaments/admin/index.xhtml";
......@@ -89,7 +89,7 @@ public class TournamentParticipantsView extends GenericCDIView {
public void setTournament(Tournament tournament) {
this.tournament = tournament;
}
public HashMap<Integer, String> getEventUserGameID() {
return eventUserGameID;
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.tournaments;
......@@ -114,7 +114,7 @@ public class TournamentParticipateView extends GenericCDIView {
tournamentParticipant = new TournamentParticipant();
tournamentParticipant.setTournament(tournament);
tournamentParticipant.setParticipator(permissionBean.getCurrentUser());
tournamentParticipant.setTeamMembers(new ArrayList<TournamentTeamMember>());
tournamentParticipant.setTeamMembers(new ArrayList<>());
TournamentTeamMember captain = new TournamentTeamMember();
captain.setRole(TournamentTeamMemberRole.CAPTAIN);
captain.setEventUser(permissionBean.getCurrentUser());
......
......@@ -19,44 +19,17 @@
package fi.codecrew.moya.web.cdiview.user;
import fi.codecrew.moya.beans.*;
import fi.codecrew.moya.enums.CardState;
import fi.codecrew.moya.enums.apps.UserPermission;
import fi.codecrew.moya.model.*;
import fi.codecrew.moya.rest.meta.v1.PrintedCardRestViewV1;
import fi.codecrew.moya.util.MassPrintResult;
import fi.codecrew.moya.utilities.jsf.MessageHelper;
import fi.codecrew.moya.web.annotations.LoggedIn;
import fi.codecrew.moya.web.annotations.SelectedUser;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import fi.codecrew.moya.web.cdiview.reader.ReaderView;
import fi.codecrew.moya.web.helper.LayoutView;
import org.primefaces.event.CaptureEvent;
import org.primefaces.event.FileUploadEvent;
import org.primefaces.model.CroppedImage;
import org.primefaces.model.DefaultStreamedContent;
import org.primefaces.model.StreamedContent;
import org.primefaces.model.UploadedFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ejb.EJB;
import javax.enterprise.context.Conversation;
import javax.enterprise.context.ConversationScoped;
import javax.enterprise.inject.Produces;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
import javax.inject.Inject;
import javax.inject.Named;
import javax.json.*;
import javax.json.stream.JsonGenerator;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Named()
@ConversationScoped
......@@ -116,11 +89,11 @@ public class CardHolderizeView extends GenericCDIView {
JsonObjectBuilder filingBuilder = Json.createObjectBuilder();
if (meta != null) {
meta.entrySet().forEach(e -> metaBuilder.add(e.getKey(), e.getValue()));
meta.forEach(metaBuilder::add);
JsonObject filingObj = meta.getJsonObject("card-filing");
if (filingObj != null) {
filingObj.entrySet().forEach(e -> filingBuilder.add(e.getKey(), e.getValue()));
filingObj.forEach(filingBuilder::add);
}
}
filingBuilder.add("cardplace", sb.toString());
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.user;
......@@ -70,7 +70,7 @@ public class CardView extends GenericCDIView {
private static final Logger logger = LoggerFactory.getLogger(CardView.class);
private Integer clonedTemplateId;
public void initCardCreate() {
if (super.requirePermissions(UserPermission.WRITE_ROLES))
{
......@@ -78,7 +78,7 @@ public class CardView extends GenericCDIView {
super.beginConversation();
}
}
public void initCardClone() {
if (super.requirePermissions(UserPermission.WRITE_ROLES))
{
......@@ -111,7 +111,7 @@ public class CardView extends GenericCDIView {
}
public List<CardTemplate> getTemplatesWithNull() {
ArrayList<CardTemplate> retlist = new ArrayList<CardTemplate>();
ArrayList<CardTemplate> retlist = new ArrayList<>();
CardTemplate dummytempl = new CardTemplate();
dummytempl.setName(I18n.get("cardTemplate.emptyCardTemplate"));
retlist.add(dummytempl);
......@@ -156,10 +156,10 @@ public class CardView extends GenericCDIView {
CardTemplate srcTemplate = cfbean.find(clonedTemplateId);
cfbean.create(getCardTemplate());
CardTemplate dstTemplate = getCardTemplate();
List<CardObjectData> srcObjectDatas = cfbean.findCardObjectDatas(srcTemplate);
List<CardTextData> srcTextDatas = cfbean.findCardTextDatas(srcTemplate);
for (CardTextData cardTextData : srcTextDatas) {
CardTextData dstTextData = new CardTextData();
dstTextData.setCardTemplate(dstTemplate);
......@@ -179,7 +179,7 @@ public class CardView extends GenericCDIView {
logger.info("Saving cardTextData for cloned cardTemplate");
dstTextData = cfbean.save(dstTextData);
}
for (CardObjectData cardObjectData : srcObjectDatas) {
CardObjectData dstObjectData = new CardObjectData();
dstObjectData.setCardTemplate(dstTemplate);
......@@ -191,12 +191,12 @@ public class CardView extends GenericCDIView {
logger.info("Saving cardObjectData for cloned cardTemplate");
dstObjectData = cfbean.save(dstObjectData);
}
cardTemplates = getCardTemplate().getEvent().getCardTemplates();
}
return "/useradmin/listCardTemplates";
}
public String saveTemplate()
{
cardTemplate = cfbean.save(cardTemplate);
......@@ -242,15 +242,15 @@ public class CardView extends GenericCDIView {
public void setTemplateImage(UploadedFile templateImage) {
this.templateImage = templateImage;
}
public CardTemplateDataType getTextDataType() {
return CardTemplateDataType.TEXT_DATA;
}
public CardTemplateDataType getObjectDataType() {
return CardTemplateDataType.OBJECT_DATA;
}
public Integer getClonedTemplateId() {
return clonedTemplateId;
}
......@@ -258,5 +258,5 @@ public class CardView extends GenericCDIView {
public void setClonedTemplateId(Integer clonedTemplateId) {
this.clonedTemplateId = clonedTemplateId;
}
}
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.user;
......@@ -57,7 +57,7 @@ public class CreditTransferView extends GenericCDIView {
public void init(List<EventUser> users) {
ArrayList<EventUserWrapper> wrap = new ArrayList<EventUserWrapper>();
ArrayList<EventUserWrapper> wrap = new ArrayList<>();
for (EventUser u : users) {
wrap.add(new EventUserWrapper(u));
}
......@@ -84,7 +84,7 @@ public class CreditTransferView extends GenericCDIView {
}
public String commitTransfer() {
List<User> transfer = new ArrayList<User>();
List<User> transfer = new ArrayList<>();
for (EventUserWrapper u : users) {
if (!u.isSkip())
{
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.user;
import java.io.IOException;
import java.io.Serializable;
import java.nio.charset.Charset;
import java.util.ArrayList;
......@@ -81,7 +80,7 @@ public class ImportView extends GenericCDIView {
public String parse()
{
ArrayList<ImportWrapper> ret = new ArrayList<ImportWrapper>();
ArrayList<ImportWrapper> ret = new ArrayList<>();
byte[] bytes = FileUploadUtils.getFileContents(file);
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.user;
......@@ -39,7 +39,7 @@ public class ImportWrapper implements Serializable {
public ImportWrapper(IUser usr) {
user = usr;
potential = new ArrayList<User>();
potential = new ArrayList<>();
selected = new User();
potential.add(selected);
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.user;
......@@ -41,7 +41,7 @@ public class OrgRoleDataView extends GenericCDIView {
public ListDataModel<OrgRole> getOrgRoles() {
if (orgRoles == null) {
orgRoles = new ListDataModel<OrgRole>(orgRolesBean.listOrgRoles());
orgRoles = new ListDataModel<>(orgRolesBean.listOrgRoles());
}
return orgRoles;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.user;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.OrgRoleBeanLocal;
import fi.codecrew.moya.beans.RoleBeanLocal;
......@@ -34,10 +25,17 @@ import fi.codecrew.moya.beans.UserBeanLocal;
import fi.codecrew.moya.entitysearch.UserSearchQuery;
import fi.codecrew.moya.enums.apps.UserPermission;
import fi.codecrew.moya.model.OrgRole;
import fi.codecrew.moya.model.Role;
import fi.codecrew.moya.model.User;
import fi.codecrew.moya.model.role.Role;
import fi.codecrew.moya.utilities.SearchResult;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import java.util.List;
@ConversationScoped
@Named
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.user;
import java.util.List;
import fi.codecrew.moya.beans.RoleBeanLocal;
import fi.codecrew.moya.enums.apps.UserPermission;
import fi.codecrew.moya.model.role.Role;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.model.ListDataModel;
import javax.inject.Named;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.RoleBeanLocal;
import fi.codecrew.moya.enums.apps.UserPermission;
import fi.codecrew.moya.model.Role;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import java.util.List;
@Named
@RequestScoped
......@@ -72,7 +70,7 @@ public class RoleDataView extends GenericCDIView {
if (roles == null) {
List<Role> list = rolebean.listRoles();
list.add(0, Role.EMPTY_ROLE);
roles = new ListDataModel<Role>(list);
roles = new ListDataModel<>(list);
logger.info("rolecount {}", roles.getRowCount());
}
return roles;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.user;
......@@ -55,7 +55,7 @@ public class UserCardView extends GenericCDIView {
public ListDataModel<PrintedCard> getPrintedCards() {
if (printedCards == null && user != null)
{
printedCards = new ListDataModel<PrintedCard>(cardBean.getCards(user));
printedCards = new ListDataModel<>(cardBean.getCards(user));
}
return printedCards;
}
......
......@@ -21,7 +21,6 @@ package fi.codecrew.moya.web.cdiview.user;
import fi.codecrew.moya.beans.UserBeanLocal;
import fi.codecrew.moya.beans.UserPropertyBeanLocal;
import fi.codecrew.moya.model.*;
import fi.codecrew.moya.utilities.jsf.MessageHelper;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
import org.primefaces.event.RowEditEvent;
import org.slf4j.Logger;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.user;
......@@ -54,25 +54,25 @@ public class UserOverviewView extends GenericCDIView {
@EJB
private UserBeanLocal userBean;
private ListDataModel<UserOverviewItem> userOverviewItems = null;
private static final Logger logger = LoggerFactory.getLogger(UserOverviewView.class);
public void initView() {
if (userOverviewItems == null) {
ArrayList<UserOverviewItem> ovlist = new ArrayList<UserOverviewItem>();
ArrayList<UserOverviewItem> ovlist = new ArrayList<>();
for (EventUser eu : getUserCartView().getUsercart()) {
PrintedCard pc = cardTemplateBean.checkPrintedCard(eu);
UserOverviewItem uoi = new UserOverviewItem(eu, pc, I18n.get("rejectcard.mailSubject"), I18n.get("rejectcard.mailBody"));
ovlist.add(uoi);
}
userOverviewItems = new ListDataModel<>(ovlist);
super.beginConversation();
}
}
public ListDataModel<UserOverviewItem> getUserOverviewItems() {
return userOverviewItems;
}
......@@ -91,9 +91,9 @@ public class UserOverviewView extends GenericCDIView {
logger.info("rejectCard(): Rejecting card {}", cardItem.getPrintedCard());
PrintedCard card = cardItem.getPrintedCard();
if(card != null) {
MailMessage mail = null;
if(cardItem.isSendRejectionMail()) {
mail = new MailMessage();
......@@ -103,7 +103,7 @@ public class UserOverviewView extends GenericCDIView {
mail.setSubject(cardItem.getRejectionMsgSubject());
mail.setMessage(cardItem.getRejectionMsgBody());
}
card = userBean.rejectPrintedCard(card, mail);
cardItem.setPrintedCard(card);
logger.info("rejectCard(): Rejected card {}, state {}", card, card.getCardState() );
......@@ -127,7 +127,7 @@ public class UserOverviewView extends GenericCDIView {
public String crop()
{
UserOverviewItem cardItem = userOverviewItems.getRowData();
if (cardItem == null || cardItem.getCroppedImage() == null )
return null;
......@@ -147,7 +147,7 @@ public class UserOverviewView extends GenericCDIView {
}
return null;
}
public void setUserOverviewItems(ListDataModel<UserOverviewItem> userOverviewItems) {
this.userOverviewItems = userOverviewItems;
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.user;
......@@ -80,7 +80,7 @@ public class UserSearchView extends PaginationView<UserWrapper> {
}
/**
*
*
*/
private static final long serialVersionUID = -7131921062890234604L;
......@@ -204,7 +204,7 @@ public class UserSearchView extends PaginationView<UserWrapper> {
private List<UserWrapper> getUserWrappers(List<User> users)
{
ArrayList<UserWrapper> res = new ArrayList<UserWrapper>();
ArrayList<UserWrapper> res = new ArrayList<>();
for (User u : users) {
res.add(new UserWrapper(u, userbean.getEventUser(u, false)));
}
......
......@@ -42,7 +42,7 @@ public class VipListView extends PaginationView<Vip> {
public void initView() {
if (super.requirePermissions(VipPermission.VIEW) && viplist == null) {
viplist = new ListDataModel<Vip>(vipBean.getAvailableVips());
viplist = new ListDataModel<>(vipBean.getAvailableVips());
filteredVips = null;
super.beginConversation();
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.voting;
import java.io.ByteArrayInputStream;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.model.ListDataModel;
......
......@@ -94,7 +94,7 @@ public class CompoMgmtView extends GenericCDIView {
for (CompoEntry e : entries) {
setCompo(votingBean.saveSort(e).getCompo());
}
entries = new ListDataModel<CompoEntry>(getCompo().getCompoEntries());
entries = new ListDataModel<>(getCompo().getCompoEntries());
return null;
}
......@@ -110,7 +110,7 @@ public class CompoMgmtView extends GenericCDIView {
public void initView() {
if (super.requirePermissions(CompoPermission.MANAGE) && entries == null) {
setCompo(votingBean.getCompoById(compoId));
entries = new ListDataModel<CompoEntry>(getCompo().getCompoEntries());
entries = new ListDataModel<>(getCompo().getCompoEntries());
super.beginConversation();
}
}
......
......@@ -18,11 +18,6 @@
*/
package fi.codecrew.moya.web.cdiview.voting;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
import javax.ejb.EJB;
......@@ -31,10 +26,8 @@ import javax.enterprise.inject.Produces;
import javax.faces.model.ListDataModel;
import javax.inject.Named;
import fi.codecrew.moya.beans.RoleBeanLocal;
import fi.codecrew.moya.beans.UserBeanLocal;
import fi.codecrew.moya.model.*;
import fi.codecrew.moya.web.helpers.FileUploadUtils;
import org.primefaces.event.RateEvent;
import org.primefaces.model.UploadedFile;
import org.slf4j.Logger;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.voting;
......@@ -34,7 +34,7 @@ import fi.codecrew.moya.model.Vote;
public class EntryWrapper implements Serializable {
/**
*
*
*/
private static final long serialVersionUID = -8261328741517788115L;
private Integer votetotal;
......@@ -58,7 +58,7 @@ public class EntryWrapper implements Serializable {
}
public static ListDataModel<EntryWrapper> init(List<CompoEntry> compoEntries, VotingBeanLocal votbean, boolean calcSummary) {
ArrayList<EntryWrapper> ret = new ArrayList<EntryWrapper>();
ArrayList<EntryWrapper> ret = new ArrayList<>();
for (CompoEntry entry : compoEntries)
{
if (entry.getSort() != null && entry.getSort() > 0)
......@@ -69,7 +69,7 @@ public class EntryWrapper implements Serializable {
}
}
return new ListDataModel<EntryWrapper>(ret);
return new ListDataModel<>(ret);
}
public CompoEntry getEntry() {
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.voting;
import java.io.IOException;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.converter;
import javax.enterprise.context.RequestScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.inject.Named;
@Named("taskTypeConverter")
@RequestScoped
public class ActionlogTaskTypeConverter implements Converter {
@Override
public Object getAsObject(FacesContext context, UIComponent component,
String value) {
// TODO Auto-generated method stub
return null;
}
@Override
public String getAsString(FacesContext context, UIComponent component,
Object value) {
if(value == null) {
return "";
}
else {
return "x";
}
}
}
package fi.codecrew.moya.web.converter;
import javax.enterprise.context.RequestScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.inject.Named;
@Named("taskTypeConverter")
@RequestScoped
public class ActionlogTaskTypeConverter implements Converter<Object> {
@Override
public Object getAsObject(FacesContext context, UIComponent component,
String value) {
// TODO Auto-generated method stub
return null;
}
@Override
public String getAsString(FacesContext context, UIComponent component,
Object value) {
if(value == null) {
return "";
}
else {
return "x";
}
}
}
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.converter;
......@@ -30,18 +30,14 @@ import fi.codecrew.moya.enums.CardState;
@Named()
@RequestScoped
public class CardStateConverter implements Converter {
@EJB
private RoleBeanLocal rolebean;
public class CardStateConverter implements Converter<CardState> {
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
public CardState getAsObject(FacesContext context, UIComponent component, String value) {
return CardState.valueOf(value);
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
public String getAsString(FacesContext context, UIComponent component, CardState value) {
return value.toString();
}
}
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.converter;
......@@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
@Named("emptytonullconverter")
@RequestScoped
public class EmptyToNullConverter implements Converter {
public class EmptyToNullConverter implements Converter<Object> {
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(EmptyToNullConverter.class);
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.converter;
......@@ -29,12 +29,12 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Named
public class LocaleConverter implements Converter {
public class LocaleConverter implements Converter<Locale> {
private static final Logger logger = LoggerFactory.getLogger(LocaleConverter.class);
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
public Locale getAsObject(FacesContext context, UIComponent component, String value) {
Locale ret = null;
if (value != null && !value.isEmpty() && !"null".equals(value)) {
try {
......@@ -48,7 +48,7 @@ public class LocaleConverter implements Converter {
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
public String getAsString(FacesContext context, UIComponent component, Locale value) {
String ret = "null";
if (value != null && value instanceof Locale) {
Locale loc = (Locale) value;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.converter;
......@@ -31,7 +31,7 @@ import fi.codecrew.moya.model.PossibleAnswer;
@Named("pollAnswerConverter")
@RequestScoped()
public class PollAnswerConverter implements Converter {
public class PollAnswerConverter implements Converter<PollAnswer> {
@EJB
private PollBeanLocal pollbean;
......@@ -40,7 +40,7 @@ public class PollAnswerConverter implements Converter {
}
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
public PollAnswer getAsObject(FacesContext context, UIComponent component, String value) {
PossibleAnswer possibleAnswer = pollbean.findPossibleAnwerById(Integer.parseInt(value));
PollAnswer ret = new PollAnswer();
......@@ -50,15 +50,8 @@ public class PollAnswerConverter implements Converter {
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
String ret = null;
if (value instanceof PollAnswer) {
ret = ((PollAnswer) value).getChoice().getId().toString();
}
return ret;
public String getAsString(FacesContext context, UIComponent component, PollAnswer value) {
return value.getChoice().getId().toString();
}
}
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.converter;
......@@ -28,17 +28,15 @@ import fi.codecrew.moya.model.ProductFlag;
@Named("productFlagConverter")
@RequestScoped()
public class ProductFlagConverter implements Converter {
public class ProductFlagConverter implements Converter<ProductFlag> {
@Override
public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
// TODO Auto-generated method stub
public ProductFlag getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
return ProductFlag.valueOf(arg2);
}
@Override
public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
// TODO Auto-generated method stub
public String getAsString(FacesContext arg0, UIComponent arg1, ProductFlag arg2) {
return arg2.toString();
}
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.converter;
import fi.codecrew.moya.beans.ProductBeanLocal;
import fi.codecrew.moya.model.Product;
import fi.codecrew.moya.model.ProductOption;
import fi.codecrew.moya.utilities.jsf.GenericIntegerEntityConverter;
import org.slf4j.Logger;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.converter;
import fi.codecrew.moya.beans.RoleBeanLocal;
import fi.codecrew.moya.model.role.Role;
import fi.codecrew.moya.utilities.jsf.GenericIntegerEntityConverter;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import fi.codecrew.moya.beans.RoleBeanLocal;
import fi.codecrew.moya.model.Role;
import fi.codecrew.moya.utilities.jsf.GenericIntegerEntityConverter;
@Named("roleConverter")
@RequestScoped
public class RoleConverter extends GenericIntegerEntityConverter<Role> {
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.converter;
......@@ -29,7 +29,7 @@ import fi.codecrew.moya.beans.SessionMgmtBeanLocal.UserContainer;
import fi.codecrew.moya.utilities.I18n;
@Named()
public class SessionToHostnameConverter implements Converter {
public class SessionToHostnameConverter implements Converter<Object> {
@EJB
private SessionMgmtBeanLocal sessbean;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.converter;
......@@ -29,7 +29,7 @@ import fi.codecrew.moya.beans.SessionMgmtBeanLocal.UserContainer;
import fi.codecrew.moya.utilities.I18n;
@Named()
public class SessionToUsernameConverter implements Converter {
public class SessionToUsernameConverter implements Converter<Object> {
@EJB
private SessionMgmtBeanLocal sessbean;
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.flow;
......@@ -41,7 +41,6 @@ import javax.inject.Named;
import javax.json.JsonObject;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
@Named
@ConversationScoped
......@@ -52,7 +51,7 @@ public class IncomingView extends GenericCDIView {
private static final Logger logger = LoggerFactory.getLogger(IncomingView.class);
/*
* @Inject
*
*
* @SelectedUser private transient EventUser user;
*/
@Inject
......@@ -248,7 +247,7 @@ public class IncomingView extends GenericCDIView {
/**
* Try to get card filing info from the metadata. Empty string if not found.
*
*
* @return Card filing info String or empty string.
*/
public String getCardFiling() {
......@@ -286,7 +285,7 @@ public class IncomingView extends GenericCDIView {
}
public ListDataModel<GroupMembership> getGroupMemberships() {
memberlist = new ListDataModel<GroupMembership>(ticketBean.findMembershipPrintlistForUser(userview.getSelectedUser()));
memberlist = new ListDataModel<>(ticketBean.findMembershipPrintlistForUser(userview.getSelectedUser()));
return memberlist;
}
......@@ -320,9 +319,9 @@ public class IncomingView extends GenericCDIView {
public ListDataModel<CardCode> getCardCodes() {
if (userview.getPrintedCard() == null)
return new ListDataModel<CardCode>(new ArrayList<CardCode>());
return new ListDataModel<>(new ArrayList<>());
cardCodes = new ListDataModel<CardCode>(userview.getPrintedCard().getCardCodes());
cardCodes = new ListDataModel<>(userview.getPrintedCard().getCardCodes());
return cardCodes;
}
......
......@@ -5,7 +5,6 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
import javax.enterprise.context.ConversationScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;
import java.io.Serializable;
import java.util.Map;
/**
......
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.helper;
......@@ -64,10 +64,10 @@ public class FeedbackView extends GenericCDIView {
public ListDataModel<Feedback> getFeedbacks() {
if (feedbacks == null && permissionBean.getCurrentUser().isSuperadmin())
{
feedbacks = new ListDataModel<Feedback>(userbean.getFeedbacks());
feedbacks = new ListDataModel<>(userbean.getFeedbacks());
}
else {
feedbacks = new ListDataModel<Feedback>();
feedbacks = new ListDataModel<>();
}
return feedbacks;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!