Commit 922082b2 by Tuomas Riihimäki

Serializable + transient findbugs fixes

Findbugs complains in view-classes about @EJB injected classes not being serializable
This is actually wrong, and actually the injected class is a serializable object which is
managed correctly by CDI and EJB.

This is explained in detail in https://stackoverflow.com/a/45681747

Due to incorrect understanding of the not so obvious problem, many @EJB
annotated fields were marked 'transient' which is incorrect.

We also add 'Serializable' inheritance to many classes which actually
should be serializable
1 parent 0e601340
Showing with 424 additions and 405 deletions
package fi.codecrew.moya.beans.map;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
......@@ -31,7 +32,7 @@ public interface QueueBeanLocal {
MapQueueRules findRules(EventMap map);
public interface MapQueueI {
public interface MapQueueI extends Serializable {
Collection<MapReservationQueueEntry> getQueue();
......
......@@ -18,11 +18,12 @@
*/
package fi.codecrew.moya.bortal.views;
import java.io.Serializable;
import java.math.BigDecimal;
import fi.codecrew.moya.model.BillLine;
public class BillSummary {
public class BillSummary implements Serializable{
public BillSummary(String name) {
this.name = name;
......
......@@ -18,6 +18,7 @@
*/
package fi.codecrew.moya.util;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
......@@ -27,7 +28,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class CheckoutBank {
public class CheckoutBank implements Serializable {
private final String key;
private final String url;
......
......@@ -18,11 +18,14 @@
*/
package fi.codecrew.moya.util;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import fi.codecrew.moya.model.EventUser;
public class MassPrintResult {
public class MassPrintResult implements Serializable {
private static final long serialVersionUID = -7489122040594726017L;
private byte[] pdf;
private List<EventUser> affectedUsers = new ArrayList<EventUser>();
public byte[] getPdf() {
......
......@@ -18,7 +18,9 @@
*/
package fi.codecrew.moya.util;
public class Valuepair {
import java.io.Serializable;
public class Valuepair implements Serializable {
private String key;
private String value;
......
package fi.codecrew.moya.utilities;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Comparator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class NumericStringComparator implements Comparator<String> {
public class NumericStringComparator implements Comparator<String>, Serializable {
// \D non numeric
// \d numeric
......
......@@ -38,7 +38,7 @@ public class NavigationHandler implements Serializable {
private String destNavi;
@Inject
private transient Conversation conversation;
private Conversation conversation;
public void saveNavigation(String navigation)
{
......
......@@ -75,7 +75,7 @@ public class MapAdminView {
@EJB
private UserBeanLocal eventuserbean;
@EJB
private transient PlaceBeanLocal placebean;
private PlaceBeanLocal placebean;
private static final Logger logger = LoggerFactory.getLogger(MapAdminView.class);
......
......@@ -65,22 +65,22 @@ public class FileDownloadServlet extends GenericImageServlet {
*/
private static final long serialVersionUID = -3359999630873773508L;
@EJB
private transient CardTemplateBeanLocal ctbean;
private CardTemplateBeanLocal ctbean;
@EJB
private transient UserBeanLocal userbean;
private UserBeanLocal userbean;
@EJB
private transient CardTemplateBeanLocal cardbean;
private CardTemplateBeanLocal cardbean;
@EJB
private transient CardPrintBeanLocal cardprint;
private CardPrintBeanLocal cardprint;
@EJB
private transient PermissionBeanLocal permbean;
private PermissionBeanLocal permbean;
@EJB
private transient EventBeanLocal orgbean;
private EventBeanLocal orgbean;
private static final Logger logger = LoggerFactory.getLogger(FileDownloadServlet.class);
......
......@@ -45,12 +45,12 @@ public class PlaceGroupPdf extends HttpServlet {
private static final long serialVersionUID = 1L;
@EJB
private transient PlaceGroupBeanLocal pgbean;
private PlaceGroupBeanLocal pgbean;
@EJB
private transient PermissionBeanLocal permbean;
private PermissionBeanLocal permbean;
@EJB
private transient UserBeanLocal userbean;
private UserBeanLocal userbean;
private static final Logger logger = LoggerFactory.getLogger(PlaceGroupPdf.class);
/**
......
......@@ -69,13 +69,13 @@ public class PlaceMapServlet extends HttpServlet {
private static final long serialVersionUID = 8769688627918936258L;
@EJB
private transient PlaceBeanLocal placeBean;
private PlaceBeanLocal placeBean;
@EJB
private transient PermissionBeanLocal permbean;
private PermissionBeanLocal permbean;
@EJB
private transient LoggingBeanLocal loggerbean;
private LoggingBeanLocal loggerbean;
@EJB
private UserBeanLocal userBean;
......
......@@ -45,9 +45,9 @@ public class PrintBill extends HttpServlet {
private static final String BILL_ID = "billid";
@EJB
private transient BillBeanLocal billentity;
private BillBeanLocal billentity;
@EJB
private transient EventBeanLocal eventbean;
private EventBeanLocal eventbean;
/**
* @see HttpServlet#HttpServlet()
......
......@@ -48,10 +48,10 @@ public class UserCardPngServlet extends GenericImageServlet {
private static final long serialVersionUID = -3359999630873773508L;
@EJB
private transient UserBeanLocal userbean;
private UserBeanLocal userbean;
@EJB
private transient PermissionBeanLocal permbean;
private PermissionBeanLocal permbean;
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
......
......@@ -61,10 +61,10 @@ public class UserCardServlet extends GenericImageServlet {
private static final long serialVersionUID = -3359999630873773508L;
@EJB
private transient UserBeanLocal userbean;
private UserBeanLocal userbean;
@EJB
private transient PermissionBeanLocal permbean;
private PermissionBeanLocal permbean;
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
......@@ -74,7 +74,7 @@ public class UserCardServlet extends GenericImageServlet {
private final Pattern lhMatcher = Pattern.compile("^127.[0-9.]*|(0:)*1%0");
@EJB
private transient CardTemplateBeanLocal cardbean;
private CardTemplateBeanLocal cardbean;
private static final Logger logger = LoggerFactory
.getLogger(UserCardServlet.class);
......
......@@ -16,95 +16,95 @@
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.actionlog;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import org.primefaces.event.SelectEvent;
import org.primefaces.model.tagcloud.DefaultTagCloudItem;
import org.primefaces.model.tagcloud.DefaultTagCloudModel;
import org.primefaces.model.tagcloud.TagCloudItem;
import org.primefaces.model.tagcloud.TagCloudModel;
import fi.codecrew.moya.beans.ActionLogBeanLocal;
import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.model.ActionLogMessage;
import fi.codecrew.moya.model.ActionLogMessageTag;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class ActionLogMessageView extends GenericCDIView {
private static final long serialVersionUID = 1L;
private boolean updateEnabled = true;
private TagCloudModel tagCloud = null;
private List<ActionLogMessageTag> activeTags = null;
@EJB
private transient ActionLogBeanLocal actionLogBean;
public void initView() {
if(super.requirePermissions(ContentPermission.MANAGE_ACTIONLOG)) {
this.beginConversation();
refreshTagCloud();
if(activeTags == null) {
activeTags = new ArrayList<>();
}
}
}
public void refreshTagCloud() {
tagCloud = new DefaultTagCloudModel();
for(ActionLogMessageTag almt : actionLogBean.getAllTags()) {
tagCloud.addTag(new DefaultTagCloudItem(almt.getTag(), 1));
}
}
public boolean getUpdateEnabled() {
return updateEnabled;
}
public void setUpdateEnabled(boolean updateEnabled) {
this.updateEnabled = updateEnabled;
}
public List<ActionLogMessage> getMessages() {
return actionLogBean.getAllActionLogEventsByFilter(activeTags);
}
public TagCloudModel getTagCloud() {
return tagCloud;
}
public void onTagSelect(SelectEvent event) {
TagCloudItem item = (TagCloudItem)event.getObject();
ActionLogMessageTag almt = actionLogBean.getActionLogMessageTagByString(item.getLabel());
if(!activeTags.contains(almt))
activeTags.add(almt);
}
public void selectFilterTag(String tag) {
for(ActionLogMessageTag almt : this.activeTags) {
if(tag.equals(almt.getTag())) {
this.activeTags.remove(almt);
break;
}
}
}
public List<ActionLogMessageTag> getActiveTags() {
return this.activeTags;
}
}
package fi.codecrew.moya.web.cdiview.actionlog;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import org.primefaces.event.SelectEvent;
import org.primefaces.model.tagcloud.DefaultTagCloudItem;
import org.primefaces.model.tagcloud.DefaultTagCloudModel;
import org.primefaces.model.tagcloud.TagCloudItem;
import org.primefaces.model.tagcloud.TagCloudModel;
import fi.codecrew.moya.beans.ActionLogBeanLocal;
import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.model.ActionLogMessage;
import fi.codecrew.moya.model.ActionLogMessageTag;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class ActionLogMessageView extends GenericCDIView {
private static final long serialVersionUID = 1L;
private boolean updateEnabled = true;
private TagCloudModel tagCloud = null;
private List<ActionLogMessageTag> activeTags = null;
@EJB
private ActionLogBeanLocal actionLogBean;
public void initView() {
if (super.requirePermissions(ContentPermission.MANAGE_ACTIONLOG)) {
this.beginConversation();
refreshTagCloud();
if (activeTags == null) {
activeTags = new ArrayList<>();
}
}
}
public void refreshTagCloud() {
tagCloud = new DefaultTagCloudModel();
for (ActionLogMessageTag almt : actionLogBean.getAllTags()) {
tagCloud.addTag(new DefaultTagCloudItem(almt.getTag(), 1));
}
}
public boolean getUpdateEnabled() {
return updateEnabled;
}
public void setUpdateEnabled(boolean updateEnabled) {
this.updateEnabled = updateEnabled;
}
public List<ActionLogMessage> getMessages() {
return actionLogBean.getAllActionLogEventsByFilter(activeTags);
}
public TagCloudModel getTagCloud() {
return tagCloud;
}
public void onTagSelect(SelectEvent event) {
TagCloudItem item = (TagCloudItem) event.getObject();
ActionLogMessageTag almt = actionLogBean.getActionLogMessageTagByString(item.getLabel());
if (!activeTags.contains(almt))
activeTags.add(almt);
}
public void selectFilterTag(String tag) {
for (ActionLogMessageTag almt : this.activeTags) {
if (tag.equals(almt.getTag())) {
this.activeTags.remove(almt);
break;
}
}
}
public List<ActionLogMessageTag> getActiveTags() {
return this.activeTags;
}
}
......@@ -16,89 +16,89 @@
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.actionlog;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import fi.codecrew.moya.beans.ActionLogBeanLocal;
import fi.codecrew.moya.enums.ActionLogMessageState;
import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.model.ActionLogMessage;
import fi.codecrew.moya.model.ActionLogMessageResponse;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class TaskModificationView extends GenericCDIView {
/**
*
*/
private static final long serialVersionUID = 938879097893244897L;
private Integer id;
private ActionLogMessage message;
private List<ActionLogMessageResponse> responses;
private String responseMessage;
private ActionLogMessageState responseStateChange;
@EJB
private transient ActionLogBeanLocal logbean;
public void initView() {
if (super.requirePermissions(ContentPermission.MANAGE_ACTIONLOG) && message == null) {
super.beginConversation();
message = logbean.find(id);
}
}
public String createResponse() {
if (responseStateChange == null || responseStateChange == message.getState())
logbean.addActionLogMessageResponse(message, responseMessage, null);
else {
logbean.addActionLogMessageResponse(message, responseMessage, responseStateChange);
if (responseStateChange != message.getState()) {
this.message = logbean.find(id);
}
}
responseMessage = "";
responseStateChange = null;
return null;
}
public List<ActionLogMessageResponse> getResponses() {
responses = logbean.getActionLogMessageResponses(message);
return responses;
}
public ActionLogMessage getMessage() {
return message;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getResponseMessage() {
return responseMessage;
}
public void setResponseMessage(String responseMessage) {
this.responseMessage = responseMessage;
}
public ActionLogMessageState getResponseStateChange() {
return responseStateChange;
}
public void setResponseStateChange(ActionLogMessageState responseStateChange) {
this.responseStateChange = responseStateChange;
}
}
package fi.codecrew.moya.web.cdiview.actionlog;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import fi.codecrew.moya.beans.ActionLogBeanLocal;
import fi.codecrew.moya.enums.ActionLogMessageState;
import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.model.ActionLogMessage;
import fi.codecrew.moya.model.ActionLogMessageResponse;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class TaskModificationView extends GenericCDIView {
/**
*
*/
private static final long serialVersionUID = 938879097893244897L;
private Integer id;
private ActionLogMessage message;
private List<ActionLogMessageResponse> responses;
private String responseMessage;
private ActionLogMessageState responseStateChange;
@EJB
private ActionLogBeanLocal logbean;
public void initView() {
if (super.requirePermissions(ContentPermission.MANAGE_ACTIONLOG) && message == null) {
super.beginConversation();
message = logbean.find(id);
}
}
public String createResponse() {
if (responseStateChange == null || responseStateChange == message.getState())
logbean.addActionLogMessageResponse(message, responseMessage, null);
else {
logbean.addActionLogMessageResponse(message, responseMessage, responseStateChange);
if (responseStateChange != message.getState()) {
this.message = logbean.find(id);
}
}
responseMessage = "";
responseStateChange = null;
return null;
}
public List<ActionLogMessageResponse> getResponses() {
responses = logbean.getActionLogMessageResponses(message);
return responses;
}
public ActionLogMessage getMessage() {
return message;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getResponseMessage() {
return responseMessage;
}
public void setResponseMessage(String responseMessage) {
this.responseMessage = responseMessage;
}
public ActionLogMessageState getResponseStateChange() {
return responseStateChange;
}
public void setResponseStateChange(ActionLogMessageState responseStateChange) {
this.responseStateChange = responseStateChange;
}
}
......@@ -39,7 +39,7 @@ public class NewsListView extends GenericCDIView {
private static final long serialVersionUID = 1720809638296537794L;
@EJB
private transient NewsBeanLocal newsbean;
private NewsBeanLocal newsbean;
private List<NewsGroup> newsgroups;
......
......@@ -31,7 +31,7 @@ public class NewsView extends GenericCDIView {
private static final long serialVersionUID = 4141547312297765524L;
@EJB
private transient NewsBeanLocal newsbean;
private NewsBeanLocal newsbean;
private NewsGroup group;
......
......@@ -45,7 +45,7 @@ public class NewsgroupView extends GenericCDIView {
private News news;
@EJB
private transient NewsBeanLocal newsbean;
private NewsBeanLocal newsbean;
public void initView() {
if (super.requirePermissions(permbean.hasPermission(ContentPermission.MANAGE_NEWS)) && newsgroup == null) {
......
......@@ -37,7 +37,7 @@ public class PageOutputView extends GenericCDIView {
private static final long serialVersionUID = 1384298744925823293L;
@EJB
private transient SitePageBeanLocal pagebean;
private SitePageBeanLocal pagebean;
@Inject
private SessionStore store;
......
......@@ -39,7 +39,7 @@ public class SiteNewsListView extends GenericCDIView {
private static final long serialVersionUID = 1720809638296537794L;
@EJB
private transient SitePageBeanLocal sitepagebean;
private SitePageBeanLocal sitepagebean;
private List<SitePage> pages;
......
......@@ -40,7 +40,7 @@ public class SitePageView extends GenericCDIView {
private static final long serialVersionUID = -513285802858190970L;
@EJB
private transient SitePageBeanLocal sitepagebean;
private SitePageBeanLocal sitepagebean;
private Integer id;
private SitePage sitepage;
private List<SitePage> pages;
......
......@@ -71,7 +71,7 @@ public class EticketView extends GenericCDIView {
@EJB
private TicketBeanLocal ticketBean;
private transient ListDataModel<GroupMembership> memberlist;
private ListDataModel<GroupMembership> memberlist;
......
......@@ -65,7 +65,7 @@ public class StandaloneEticketView extends GenericCDIView {
@EJB
private TicketBeanLocal ticketBean;
private transient ListDataModel<GroupMembership> memberlist;
private ListDataModel<GroupMembership> memberlist;
private boolean mapVisible = false;
......
......@@ -55,7 +55,7 @@ public class HelpView {
@Inject
private transient SessionStore sessionstore;
private SessionStore sessionstore;
public void populateHelpText() {
......
package fi.codecrew.moya.web.cdiview.map;
import java.awt.*;
import java.io.Serializable;
import java.util.*;
import java.util.List;
......@@ -43,14 +44,14 @@ public class AjaxMapView extends GenericCDIView {
private String testVal = "Testval1";
@EJB
private transient EventBeanLocal eventbean;
private EventBeanLocal eventbean;
@EJB
private PlaceBeanLocal placebean;
@EJB
private PermissionBeanLocal permbean;
@Inject
private transient FacesContext context;
private FacesContext context;
private EventMap map;
private Place place;
......@@ -65,7 +66,7 @@ public class AjaxMapView extends GenericCDIView {
private Boolean reserving;
private Integer placeId;
public static class Slotcounter {
public static class Slotcounter implements Serializable {
private final Product product;
private Integer count = 0;
private Integer unused = 0;
......
package fi.codecrew.moya.web.cdiview.map;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -40,7 +41,7 @@ public class MapPlacechangeView extends GenericCDIView {
private List<MoveContainer> moveContainers;
private boolean toggleSuccess;
public static class MoveContainer {
public static class MoveContainer implements Serializable {
private boolean moving = false;
private final PlaceSlot src;
......
......@@ -50,9 +50,9 @@ public class MapView extends GenericCDIView {
private EventMap activeMap;
@EJB
private transient PlaceBeanLocal placeBean;
private PlaceBeanLocal placeBean;
@EJB
private transient EventBeanLocal eventBean;
private EventBeanLocal eventBean;
private BigDecimal balance;
private static final Logger logger = LoggerFactory.getLogger(MapView.class);
......
......@@ -63,10 +63,10 @@ public class PlaceView extends GenericCDIView {
private Place place;
@EJB
private transient UserBeanLocal userbean;
private UserBeanLocal userbean;
@EJB
private transient PlaceBeanLocal placebean;
private PlaceBeanLocal placebean;
@Inject
@SelectedUser
......@@ -76,7 +76,7 @@ public class PlaceView extends GenericCDIView {
private EventMap currentMap;
private String searchuser;
private transient ListDataModel<User> userlist;
private ListDataModel<User> userlist;
public boolean canEdit() {
return permbean.hasPermission(MapPermission.MANAGE_MAPS);
......
......@@ -38,8 +38,9 @@ import java.util.Date;
public class TimelapseMapView extends GenericCDIView {
public static final String JSON_DATETIME = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
private static final long serialVersionUID = 8454455874174728343L;
@EJB
private transient PlaceBeanLocal placebean;
private PlaceBeanLocal placebean;
@EJB
private PermissionBeanLocal permbean;
......
......@@ -20,7 +20,9 @@ package fi.codecrew.moya.web.cdiview.menu;
import fi.codecrew.moya.model.MenuNavigation;
public class JsfMenuitem {
import java.io.Serializable;
public class JsfMenuitem implements Serializable {
private boolean selected;
private final MenuNavigation navigation;
......
......@@ -54,21 +54,21 @@ public class MenuView implements Serializable{
protected NavigationHandler navihandler;
@Inject
private transient LayoutView layoutview;
private LayoutView layoutview;
@Inject
private transient SessionStore sessionstore;
private SessionStore sessionstore;
@EJB
private transient MenuBeanLocal menubean;
private MenuBeanLocal menubean;
private transient LinkedList<List<JsfMenuitem>> menus;
private LinkedList<List<JsfMenuitem>> menus;
private HashSet<MenuNavigation> navis;
private Map<String, List<PageContent>> contents = new HashMap<String, List<PageContent>>();
@EJB
private transient SitePageBeanLocal pagebean;
private SitePageBeanLocal pagebean;
private String menuChange;
......@@ -117,7 +117,7 @@ public class MenuView implements Serializable{
return getViewChangeTopmenu().size() > 1;
}
private transient List<JsfMenuitem> viewchangeTopmenu;
private List<JsfMenuitem> viewchangeTopmenu;
@EJB
private PermissionBeanLocal permbean;
......
......@@ -50,9 +50,9 @@ public class EventOrgView extends GenericCDIView {
private static final long serialVersionUID = -1351272199807699797L;
@EJB
private transient EventOrganiserBeanLocal eventorgbean;
private EventOrganiserBeanLocal eventorgbean;
@EJB
private transient EventBeanLocal eventbean;
private EventBeanLocal eventbean;
@EJB
private SitePageBeanLocal sitepagebean;
......@@ -83,7 +83,7 @@ public class EventOrgView extends GenericCDIView {
@EJB
private UserBeanLocal userBean;
private transient ListDataModel<LanEventDomain> eventdomains;
private ListDataModel<LanEventDomain> eventdomains;
ScheduleModel eventsCalendar = null;
......
......@@ -52,15 +52,15 @@ public class EventPropertyView extends GenericCDIView {
private LanEventProperty property;
@Inject
private transient EventOrgView eventorgview;
private EventOrgView eventorgview;
@EJB
private transient EventBeanLocal eventbean;
private EventBeanLocal eventbean;
private UploadedFile file;
private static final Logger logger = LoggerFactory.getLogger(EventPropertyView.class);
private transient ListDataModel<LanEventProperty> properties;
private transient ListDataModel<LanEventPrivateProperty> privateProperties;
private ListDataModel<LanEventProperty> properties;
private ListDataModel<LanEventPrivateProperty> privateProperties;
private LanEventPrivateProperty privateProperty;
......
......@@ -18,6 +18,7 @@
*/
package fi.codecrew.moya.web.cdiview.poll;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
......@@ -192,7 +193,7 @@ public class PollView extends GenericCDIView {
this.canManage = canManage;
}
public static class QuestionWrapper {
public static class QuestionWrapper implements Serializable {
private PollQuestion question;
private ArrayList<PollAnswer> answers;
......
......@@ -62,13 +62,13 @@ public class ReaderView extends GenericCDIView {
private ReaderNameContainer namecontainer;
@EJB
private transient ReaderBeanLocal readerbean;
private ReaderBeanLocal readerbean;
@EJB
private transient UserBeanLocal userbean;
private UserBeanLocal userbean;
@EJB
private transient BarcodeBeanLocal barcodebean;
private BarcodeBeanLocal barcodebean;
// private UserCardWrapper neighborUser;
......
......@@ -41,7 +41,7 @@ public class AddInventoryView extends GenericCDIView {
private static final long serialVersionUID = 1L;
@EJB
private ProductBeanLocal pblocal;
private ProductBeanLocal productBean;
@EJB
private PermissionBeanLocal permBeanLocal;
......@@ -58,13 +58,13 @@ public class AddInventoryView extends GenericCDIView {
{
inventoryEvent = new InventoryEvent();
super.beginConversation();
setProducts(pblocal.findProductsForEvent());
setProducts(productBean.findProductsForEvent());
logger.debug("Initialized {} products for inventoryview", products.size());
}
}
public String save() {
pblocal.saveInventoryEvent(inventoryEvent);
productBean.saveInventoryEvent(inventoryEvent);
return null;
}
......
......@@ -40,9 +40,9 @@ public class BillReviewView extends GenericCDIView {
*/
private static final long serialVersionUID = -4665348757236295800L;
@EJB
private transient VerkkomaksutFiBeanLocal vmbean;
private VerkkomaksutFiBeanLocal vmbean;
@EJB
private transient BillBeanLocal billbean;
private BillBeanLocal billbean;
private Bill bill;
private VerkkomaksutReturnEntry vmreturn;
......
......@@ -42,7 +42,7 @@ public class DiscountView extends GenericCDIView {
private Discount discount;
@EJB
private transient ProductBeanLocal prodbean;
private ProductBeanLocal prodbean;
public void initEditView() {
if (super.requirePermissions(ShopPermission.MANAGE_PRODUCTS) && discount == null) {
......
......@@ -70,7 +70,7 @@ public class FoodWaveFoodView extends GenericCDIView {
private FoodWave foodWave = null;
@EJB
private transient ProductBeanLocal productBean;
private ProductBeanLocal productBean;
@Inject
private UserView userview;
......@@ -81,7 +81,7 @@ public class FoodWaveFoodView extends GenericCDIView {
private Integer foodwaveid = 0;
private ListDataModel<Product> products;
private transient ListDataModel<ProductShopItem> shoppingcart;
private ListDataModel<ProductShopItem> shoppingcart;
private static final Logger logger = LoggerFactory.getLogger(FoodWaveFoodView.class);
......
......@@ -37,7 +37,7 @@ public class ProductListView extends PaginationView<Product> {
private static final long serialVersionUID = -5621674984772482156L;
@EJB
private transient ProductBeanLocal productBean;
private ProductBeanLocal productBean;
public void initView() {
if (super.requirePermissions(ShopPermission.LIST_ALL_PRODUCTS)) {
......
......@@ -66,15 +66,15 @@ public class ProductShopView extends GenericCDIView {
*/
private static final long serialVersionUID = 1288114954999406683L;
@EJB
private transient ProductBeanLocal productBean;
private ProductBeanLocal productBean;
@EJB
private transient BillBeanLocal billbean;
private BillBeanLocal billbean;
@EJB
private transient UserBeanLocal userbean;
private UserBeanLocal userbean;
@EJB
private transient EventBeanLocal eventbean;
private EventBeanLocal eventbean;
public void cashChanged() {
payInstant = false;
......@@ -84,7 +84,7 @@ public class ProductShopView extends GenericCDIView {
private BigDecimal cash = BigDecimal.ZERO;
private transient ListDataModel<ProductShopItem> shoppingcart;
private ListDataModel<ProductShopItem> shoppingcart;
@Inject
private BillListView billListView;
......
......@@ -34,7 +34,7 @@ public class UserCardWrapper implements Serializable {
private static final long serialVersionUID = -2755200540851855878L;
private final EventUser user;
private transient final ListDataModel<PrintedCard> printedCards;
private final ListDataModel<PrintedCard> printedCards;
public UserCardWrapper(User u, UserBeanLocal userbean) {
user = userbean.getEventUser(u, false);
......
......@@ -52,19 +52,19 @@ public class CardView extends GenericCDIView {
private Integer templateId;
private CardTemplate cardTemplate;
@EJB
private transient CardTemplateBeanLocal cfbean;
private CardTemplateBeanLocal cfbean;
@EJB
private transient EventBeanLocal eventBean;
private EventBeanLocal eventBean;
@Inject
@SelectedUser
private transient EventUser user;
private EventUser user;
private Integer cardid;
private List<CardTemplate> cardTemplates;
private transient UploadedFile templateImage;
private UploadedFile templateImage;
private static final Logger logger = LoggerFactory.getLogger(CardView.class);
......
......@@ -18,6 +18,7 @@
*/
package fi.codecrew.moya.web.cdiview.user;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -142,7 +143,7 @@ public class CreditTransferView extends GenericCDIView {
this.totalTransferred = totalTransferred;
}
public static class EventUserWrapper {
public static class EventUserWrapper implements Serializable {
private final EventUser user;
private BigDecimal credits = BigDecimal.ZERO;
private EventUser sourceEventuser;
......
......@@ -19,6 +19,7 @@
package fi.codecrew.moya.web.cdiview.user;
import java.io.IOException;
import java.io.Serializable;
import java.nio.charset.Charset;
import java.util.ArrayList;
......@@ -120,7 +121,7 @@ public class ImportView extends GenericCDIView {
return "/useradmin/list?faces-redirect=true";
}
public static class ImportWrapper
public static class ImportWrapper implements Serializable
{
private final EventUser eventuser;
......
......@@ -33,10 +33,10 @@ public class OrgRoleDataView extends GenericCDIView {
private static final long serialVersionUID = -607046631885684171L;
private transient ListDataModel<OrgRole> orgRoles;
private ListDataModel<OrgRole> orgRoles;
@EJB
private transient OrgRoleBeanLocal orgRolesBean;
private OrgRoleBeanLocal orgRolesBean;
public ListDataModel<OrgRole> getOrgRoles() {
......
......@@ -49,14 +49,14 @@ public class OrgRoleView extends GenericCDIView {
private Integer id;
@EJB
private transient OrgRoleBeanLocal orgRoleBean;
private OrgRoleBeanLocal orgRoleBean;
@EJB
private transient EventBeanLocal eventBean;
private EventBeanLocal eventBean;
@EJB
private transient UserBeanLocal userbean;
private UserBeanLocal userbean;
@EJB
private transient RoleBeanLocal rolebean;
private RoleBeanLocal rolebean;
private User addableUser;
private Role eventRole;
......
......@@ -47,7 +47,7 @@ public class PasswordResetView extends GenericCDIView {
private String emailaddr;
@EJB
private transient UserBeanLocal userbean;
private UserBeanLocal userbean;
@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(PasswordResetView.class);
......
......@@ -40,9 +40,9 @@ public class RoleDataView extends GenericCDIView {
private static final long serialVersionUID = -5165373936500592099L;
@EJB
private transient RoleBeanLocal rolebean;
private RoleBeanLocal rolebean;
private transient ListDataModel<Role> roles;
private ListDataModel<Role> roles;
private static final Logger logger = LoggerFactory.getLogger(RoleDataView.class);
......
......@@ -36,13 +36,13 @@ public class UserCardView extends GenericCDIView {
private static final long serialVersionUID = -7316229268164228981L;
@EJB
private transient CardTemplateBeanLocal cardBean;
private CardTemplateBeanLocal cardBean;
@Inject
@SelectedUser
private transient EventUser user;
private EventUser user;
private transient ListDataModel<PrintedCard> printedCards;
private ListDataModel<PrintedCard> printedCards;
public EventUser getUser() {
return user;
......
......@@ -38,10 +38,10 @@ public class UserSessionView extends GenericCDIView {
private static final long serialVersionUID = -5305969666679378884L;
@EJB
private transient SessionMgmtBeanLocal sessionMgmt;
private transient ListDataModel<HttpSessionWrapper> sessions;
private SessionMgmtBeanLocal sessionMgmtBean;
private ListDataModel<HttpSessionWrapper> sessions;
private transient HttpSession session;
private HttpSession session;
@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(UserSessionView.class);
......@@ -49,7 +49,7 @@ public class UserSessionView extends GenericCDIView {
public void initView()
{
if (super.requirePermissions(UserPermission.MANAGE_HTTP_SESSION) && sessions == null) {
sessions = new ListDataModel<>(HttpSessionWrapper.wrap(sessionMgmt.getSessions(),sessionMgmt));
sessions = new ListDataModel<>(HttpSessionWrapper.wrap(sessionMgmtBean.getSessions(),sessionMgmtBean));
super.beginConversation();
}
}
......
package fi.codecrew.moya.web.cdiview.vip;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -76,7 +77,7 @@ public class VipDeliverView extends GenericCDIView {
this.notes = notes;
}
public static class VipProductWrapper
public static class VipProductWrapper implements Serializable
{
private final VipProduct product;
private BigDecimal deliver;
......
......@@ -41,11 +41,11 @@ public class CompoFileDownloadView extends GenericCDIView {
private static final long serialVersionUID = -262883747402530562L;
@EJB
private transient VotingBeanLocal votebean;
private VotingBeanLocal votebean;
@Inject
private CompoEntry entry;
private transient ListDataModel<CompoEntryFile> files;
private ListDataModel<CompoEntryFile> files;
private CompoEntryFile file;
private DefaultStreamedContent dlfile;
......
......@@ -16,120 +16,120 @@
* future versions of the Software.
*
*/
package fi.codecrew.moya.web.cdiview.voting;
import java.util.Date;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.faces.model.ListDataModel;
import javax.inject.Named;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.VotingBeanLocal;
import fi.codecrew.moya.enums.apps.CompoPermission;
import fi.codecrew.moya.model.Compo;
import fi.codecrew.moya.model.CompoEntry;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class CompoMgmtView extends GenericCDIView {
/**
*
*/
private static final long serialVersionUID = -8373473936336396427L;
@EJB
private transient VotingBeanLocal votingBean;
private Integer compoId;
private String compoName;
private Compo compo;
private transient ListDataModel<CompoEntry> entries;
@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(CompoMgmtView.class);
public Integer getCompoId() {
return compoId;
}
public void initCreate()
{
if (super.requirePermissions(fi.codecrew.moya.enums.apps.CompoPermission.MANAGE) && compo == null)
{
compo = new Compo();
Date now = new Date();
compo.setStartTime(now);
compo.setEndTime(now);
compo.setSubmitStart(now);
compo.setSubmitEnd(now);
compo.setVoteStart(now);
compo.setVoteEnd(now);
super.beginConversation();
}
}
public String createCompo() {
votingBean.createCompo(compo);
return "details";
}
public String saveCompo()
{
compo = votingBean.saveCompo(compo);
return null;
}
public String saveSort()
{
for (CompoEntry e : entries)
{
setCompo(votingBean.saveSort(e).getCompo());
}
entries = new ListDataModel<CompoEntry>(getCompo().getCompoEntries());
return null;
}
public void setCompoId(Integer compoId) {
this.compoId = compoId;
}
public ListDataModel<CompoEntry> getEntries() {
return entries;
}
public void initView() {
if (super.requirePermissions(CompoPermission.MANAGE) && entries == null)
{
setCompo(votingBean.getCompoById(compoId));
entries = new ListDataModel<CompoEntry>(getCompo().getCompoEntries());
super.beginConversation();
}
}
public String getCompoName() {
return compoName;
}
public void setCompoName(String compoName) {
this.compoName = compoName;
}
public Compo getCompo() {
return compo;
}
public void setCompo(Compo compo) {
this.compo = compo;
}
}
package fi.codecrew.moya.web.cdiview.voting;
import java.util.Date;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.faces.model.ListDataModel;
import javax.inject.Named;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.VotingBeanLocal;
import fi.codecrew.moya.enums.apps.CompoPermission;
import fi.codecrew.moya.model.Compo;
import fi.codecrew.moya.model.CompoEntry;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class CompoMgmtView extends GenericCDIView {
/**
*
*/
private static final long serialVersionUID = -8373473936336396427L;
@EJB
private VotingBeanLocal votingBean;
private Integer compoId;
private String compoName;
private Compo compo;
private ListDataModel<CompoEntry> entries;
@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(CompoMgmtView.class);
public Integer getCompoId() {
return compoId;
}
public void initCreate()
{
if (super.requirePermissions(fi.codecrew.moya.enums.apps.CompoPermission.MANAGE) && compo == null)
{
compo = new Compo();
Date now = new Date();
compo.setStartTime(now);
compo.setEndTime(now);
compo.setSubmitStart(now);
compo.setSubmitEnd(now);
compo.setVoteStart(now);
compo.setVoteEnd(now);
super.beginConversation();
}
}
public String createCompo() {
votingBean.createCompo(compo);
return "details";
}
public String saveCompo()
{
compo = votingBean.saveCompo(compo);
return null;
}
public String saveSort()
{
for (CompoEntry e : entries)
{
setCompo(votingBean.saveSort(e).getCompo());
}
entries = new ListDataModel<CompoEntry>(getCompo().getCompoEntries());
return null;
}
public void setCompoId(Integer compoId) {
this.compoId = compoId;
}
public ListDataModel<CompoEntry> getEntries() {
return entries;
}
public void initView() {
if (super.requirePermissions(CompoPermission.MANAGE) && entries == null)
{
setCompo(votingBean.getCompoById(compoId));
entries = new ListDataModel<CompoEntry>(getCompo().getCompoEntries());
super.beginConversation();
}
}
public String getCompoName() {
return compoName;
}
public void setCompoName(String compoName) {
this.compoName = compoName;
}
public Compo getCompo() {
return compo;
}
public void setCompo(Compo compo) {
this.compo = compo;
}
}
......@@ -49,25 +49,25 @@ public class CompoView extends GenericCDIView {
private VotingBeanLocal votbean;
@EJB
private transient PermissionBeanLocal permbean;
private PermissionBeanLocal permbean;
private boolean manage;
private transient ListDataModel<Compo> compolist;
private ListDataModel<Compo> compolist;
@Produces
private CompoEntry entry;
private static final Logger logger = LoggerFactory.getLogger(CompoView.class);
private transient UploadedFile uploadedFile;
private UploadedFile uploadedFile;
private Compo compo;
private Integer entryId;
private Integer compoId;
private transient ListDataModel<EntryWrapper> voteEntries;
private ListDataModel<EntryWrapper> voteEntries;
public ListDataModel<Compo> getCompos() {
return compolist;
......
......@@ -53,7 +53,7 @@ public class LayoutView implements Serializable {
*
*/
private static final long serialVersionUID = 4468645109141859301L;
private ResourceBundle rb;
private transient ResourceBundle rb;
private String pagename;
@EJB
private transient EventBeanLocal eventbean;
......
......@@ -18,6 +18,7 @@
*/
package fi.codecrew.moya.web.helpers;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -30,7 +31,7 @@ import org.slf4j.LoggerFactory;
import javax.faces.model.ListDataModel;
public class ProductShopItem {
public class ProductShopItem implements Serializable {
private static final Logger logger = LoggerFactory.getLogger(ProductShopItem.class);
private final Product product;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!