public void saveEvent() { if (getEvent().getRelatedType() == EventRelatedType.PRIVATE) { // TODO: try catch? scheduleEventBean.updateEvent(); if (getEvent().getId() == null) { // TODO: pre defined may be better; String uuid = UUID.randomUUID().toString(); getEvent().setId(uuid); getFileBean().setUuid(uuid); getEvent().setOwner(currentUser.getAccount()); // getEvent().setPublishTime(new Date()); // // event.setModelClass(ActivityModel.class.getName()); // // getEvent().setCategory( // scheduleEventBean.getClassificationSelection() // .getSelectedCategory()); } // // event.setImageDefault(fileBean.getFile().getFileName()); // getEvent().setImageCount( // getEvent().getImageCount() + getFileBean().getFileCount()); // Set diffSet = scheduleEventBean.getFriendPickList().getDifferenceList(); if (diffSet.size() > 0) { scheduleService.storeEventWithRelatedUsersDiff(getEvent(), diffSet); } else { scheduleService.storeEvent(getEvent()); } // TODO: if mergeTemp false? through exception? mergeTemp(); // this.initialize(); // this.friendList.initialize(); // this.friendList.setEvent(null); // this.friendList.getDifferenceList().clear(); scheduleEventBean = new ScheduleEventBean(); // reset dialog form updateSchedule(); // fileBean = new FileBean(); } }
public void onDateSelect(SelectEvent selectEvent) { MyScheduleEvent scheduleEvent = new MyScheduleEvent( "", (Date) selectEvent.getObject(), (Date) selectEvent.getObject(), false); scheduleEvent.setNewEvent(true); scheduleEvent.setEditable(true); scheduleEvent.setOwner(currentUser.getAccount()); scheduleEvent.setTitle("NEW TITLE"); scheduleEvent.setRelatedType(EventRelatedType.PRIVATE); // test scheduleEvent.setLocation("NA"); // scheduleEventBean = new ScheduleEventBean(); scheduleEventBean.setEvent(scheduleEvent); // this.fileBean = new FileBean(); // this.category.setSelectedCategory(null); // this.friendList.setEvent(null); // this.friendList.initialize(); // this.friendList.getDifferenceList().clear(); }
public void joinClick() { scheduleEventBean.joinEvent(); }
public void pinClick() { scheduleEventBean.pinEvent(); }
public void handleFileUpload(FileUploadEvent event) throws IOException { scheduleEventBean.handleFileUpload(event); }
public void setFileBean(FileBean fileBean) { if (scheduleEventBean == null) { scheduleEventBean = new ScheduleEventBean(); } scheduleEventBean.setFileBean(fileBean); }
public FileBean getFileBean() { if (scheduleEventBean == null) { scheduleEventBean = new ScheduleEventBean(); } return scheduleEventBean.getFileBean(); }