예제 #1
0
  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();
    }
  }
예제 #2
0
  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();
  }
예제 #3
0
 public void joinClick() {
   scheduleEventBean.joinEvent();
 }
예제 #4
0
 public void pinClick() {
   scheduleEventBean.pinEvent();
 }
예제 #5
0
 public void handleFileUpload(FileUploadEvent event) throws IOException {
   scheduleEventBean.handleFileUpload(event);
 }
예제 #6
0
 public void setFileBean(FileBean fileBean) {
   if (scheduleEventBean == null) {
     scheduleEventBean = new ScheduleEventBean();
   }
   scheduleEventBean.setFileBean(fileBean);
 }
예제 #7
0
 public FileBean getFileBean() {
   if (scheduleEventBean == null) {
     scheduleEventBean = new ScheduleEventBean();
   }
   return scheduleEventBean.getFileBean();
 }