Package org.olat.core.gui.components.table

Examples of org.olat.core.gui.components.table.TableEvent


   */
  public void event(UserRequest ureq, Controller source, Event event) { 
    String cmd = event.getCommand();
     if (source == tableCtr) {
      if (cmd.equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        int rowid = te.getRowId();
        BusinessGroup choosenGroup = groupListModel.getBusinessGroupAt(rowid);
        addLoggingResourceable(LoggingResourceable.wrap(choosenGroup));
       
        if (actionid.equals(CMD_ENROLL_IN_GROUP)) {
          if (Tracing.isDebugEnabled(this.getClass())) Tracing.logDebug("CMD_ENROLL_IN_GROUP ureq.getComponentID()=" + ureq.getComponentID() + "  ureq.getComponentTimestamp()=" + ureq.getComponentTimestamp(), this.getClass());
View Full Code Here


 
  @Override
  public void event(UserRequest ureq, Controller source, Event event) {
    if(source == tableListParticipants) {
      if(event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent tableEvent = (TableEvent)event;
        //open window for choosen date to manage the enrolled users or manually add
        if(tableEvent.getActionId().equals(DENListTableDataModel.CHANGE_ACTION)) {
          selectedEvent = (KalendarEvent)listTableData.getObject(tableEvent.getRowId());
          List<Identity> participants = denManager.getEventParticipants(selectedEvent);
          participantsTableData = new DENParticipantsTableDataModel(participants);
          tableManageParticipants = denManager.createParticipantsTable(ureq, getWindowControl(), getTranslator(), this, participantsTableData);
          formManageParticipants = new DENManageParticipantsForm(ureq, getWindowControl());
          formManageParticipants.addControllerListener(this);
          participantsVC = new VelocityContainer("participants.manage", VELOCITY_ROOT + "/participants.html", getTranslator(), this);
          SimpleText dateTitle = new SimpleText("dateTitle", translate("dates.table.subject") + ": " + selectedEvent.getSubject());
          DateFormat df = new SimpleDateFormat();
          SimpleText dateTimeframe = new SimpleText("dateTimeframe", translate("dates.table.date") + ": " + df.format(selectedEvent.getBegin()) + " - " + df.format(selectedEvent.getEnd()));
          participantsVC.put("dateTitle", dateTitle);
          participantsVC.put("dateTimeframe", dateTimeframe);
          participantsVC.put("participantsTable", tableManageParticipants.getInitialComponent());
          participantsVC.put("addParticipants", formManageParticipants.getInitialComponent());
          CloseableModalController manageParticipantsModalCntrl = new CloseableModalController(getWindowControl(), "close", participantsVC, true, translate("dates.table.participant.manage"));
          manageParticipantsModalCntrl.activate();
        }
      } else {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent)event;
        BitSet selection = tmse.getSelection();
        //delete all users from the selected dates
        if(tmse.getAction().equals(DENListTableDataModel.DELETE_ACTION) && selection.cardinality() > 0) {
          removed = denManager.getSelectedEventParticipants(dateList, selection);
          dateList = denManager.deleteParticipants(ores, courseNode, denManager.getSelectedEventIDs(dateList, selection));
          listTableData.setObjects(dateList);
          //send notification mail
          createRemovedNotificationMail(ureq, dateList.get(0).getSubject());
        } else if(tmse.getAction().equals(DENListTableDataModel.MAIL_ACTION) && selection.cardinality() > 0) {
          //send email to all users from the selected dates
          List<Identity> participants = denManager.getSelectedEventParticipants(dateList, selection);
          createParticipantsMail(ureq, participants);
        } else if(selection.cardinality() == 0) {
          getWindowControl().setWarning(translate("participants.message.empty"));
        }
      }
    } else if(source == formManageParticipants && event == DENManageParticipantsForm.ADD_PARTICIPANTS) {
      //open user search controller to manually add users in date
      userSearchCntrl = new UserSearchController(ureq, getWindowControl(), true, true, true);
      userSearchCntrl.addControllerListener(this);
      userSearchCMC = new CloseableModalController(getWindowControl(), "close", userSearchCntrl.getInitialComponent());
      userSearchCMC.activate();
    } else if(source == userSearchCntrl) {
      if(event == Event.CANCELLED_EVENT) {
        userSearchCMC.deactivate();
      } else {
        List<Identity> toAdd = null;
        added = new ArrayList<Identity>();
        if (event instanceof SingleIdentityChosenEvent) {
          SingleIdentityChosenEvent singleEvent = (SingleIdentityChosenEvent) event;
          Identity choosenIdentity = singleEvent.getChosenIdentity();
          toAdd = new ArrayList<Identity>();
          toAdd.add(choosenIdentity);
        } else if (event instanceof MultiIdentityChosenEvent) {
          MultiIdentityChosenEvent multiEvent = (MultiIdentityChosenEvent) event;
          toAdd = multiEvent.getChosenIdentities();
        }
        boolean showMessage = false;
        if(toAdd != null && toAdd.size() > 0) {
          for( Identity identity : toAdd ) {
            status = denManager.doEnroll(identity, selectedEvent, ores, courseNode, true);
            if(!status.isEnrolled() && status.getErrorMessage().equals(DENStatus.ERROR_ALREADY_ENROLLED))
              showMessage = true;
            else
              added.add(identity);
          }
          if(showMessage)
            getWindowControl().setWarning(translate("enrollment.warning.manual"));
          refreshTables();
        }
        userSearchCMC.deactivate();
        if(added.size() > 0) {
          //write notification mail
          createAddedNotificationMail(ureq, dateList.get(0).getSubject());
        }
      }
      userSearchCntrl.dispose();
      userSearchCntrl = null;
    } else if(source == tableManageParticipants) {
      if(event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent tableEvent = (TableEvent)event;
        //delete single user from event
        if(tableEvent.getActionId().equals(DENParticipantsTableDataModel.REMOVE_ACTION)) {
          Identity identity = participantsTableData.getEntryAt(tableEvent.getRowId());
          status = denManager.cancelEnroll(identity, selectedEvent, ores, courseNode);
          if(!status.isCancelled()) showError();
          //send notification mail
          else {
            removed.clear();
            removed.add(identity);
            createRemovedNotificationMail(ureq, dateList.get(0).getSubject());
          }
          refreshTables();
        //write email to single user
        } else if(tableEvent.getActionId().equals(DENParticipantsTableDataModel.MAIL_ACTION)) {
          List<Identity> participants = new ArrayList<Identity>();
          participants.add(participantsTableData.getEntryAt(tableEvent.getRowId()));
          createParticipantsMail(ureq, participants);
        }
      }
    } else if(source == addedNotificationCtr && event == Event.DONE_EVENT) {
      if(addedNotificationCtr.getMailTemplate() != null) {
View Full Code Here

   *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == tableCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        if (te.getActionId().equals(ACTION_SINGLESELECT_CHOOSE)) {
          int rowid = te.getRowId();
          GroupDeletionManager.getInstance().setLastUsageNowFor((BusinessGroup) redtm.getObject(rowid));
          updateGroupList();
        }
      } else if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
View Full Code Here

  /**
   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest urequest, Controller source, Event event) {
    if ( (source == tableController) && (event instanceof TableEvent) ) {
      TableEvent te = (TableEvent) event;
      Project currentProject = (Project)tableController.getTableDataModel().getObject(te.getRowId());
      if ( te.getActionId().equals(TABLE_ACTION_SHOW_DETAIL)) {
        activateProjectController(currentProject, urequest);
      } else if ( te.getActionId().equals(TABLE_ACTION_ACCOUNT_MANAGER)) {
        activateUserController(currentProject, urequest);
      } else if ( te.getActionId().equals(TABLE_ACTION_SELECT)) {
        getLogger().debug("start enrollProjectParticipant identity=" + urequest.getIdentity() + " to project=" + currentProject);
        List<Project> projects = ProjectBrokerManagerFactory.getProjectBrokerManager().getProjectListBy(projectBrokerId)
        boolean enrolled = ProjectBrokerManagerFactory.getProjectBrokerManager().enrollProjectParticipant(urequest.getIdentity(), currentProject, moduleConfig, nbrSelectedProjects, isParticipantInAnyProject);
        if (enrolled) {
          ProjectBrokerManagerFactory.getProjectBrokerEmailer().sendEnrolledEmailToParticipant(urequest.getIdentity(), currentProject, this.getTranslator());
          if (currentProject.isMailNotificationEnabled()) {
            ProjectBrokerManagerFactory.getProjectBrokerEmailer().sendEnrolledEmailToManager(urequest.getIdentity(), currentProject, this.getTranslator());
          }
          ProjectBrokerManagerFactory.getProjectGroupManager().sendGroupChangeEvent(currentProject, courseId, urequest.getIdentity());
        } else {
          showInfo("info.msg.could.not.enroll");
        }
        updateProjectListModelOf(tableController, urequest.getIdentity());
      } else if ( te.getActionId().equals(TABLE_ACTION_CANCEL_SELECT)) {
        getLogger().debug("start cancelProjectEnrollmentOf identity=" + urequest.getIdentity() + " to project=" + currentProject);
        boolean cancelEnrollmend = ProjectBrokerManagerFactory.getProjectBrokerManager().cancelProjectEnrollmentOf(urequest.getIdentity(), currentProject, moduleConfig);
        if (cancelEnrollmend) {
          ProjectBrokerManagerFactory.getProjectBrokerEmailer().sendCancelEnrollmentEmailToParticipant(urequest.getIdentity(), currentProject, this.getTranslator());
          if (currentProject.isMailNotificationEnabled()) {
View Full Code Here

   *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == tableCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        if (te.getActionId().equals(ACTION_SINGLESELECT_CHOOSE)) {
          int rowid = te.getRowId();
          GroupDeletionManager.getInstance().setLastUsageNowFor( (BusinessGroup) redtm.getObject(rowid) );
          updateGroupList();
        }
      } else if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
View Full Code Here

    if (Tracing.isDebugEnabled(TaskController.class)){
      Tracing.logDebug("Test Controller.event source" + source + "  , event=" + event, TaskController.class);
    }
    if (source == tableCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent ta = (TableEvent) event;
        if (ta.getActionId().equals(TaskController.ACTION_PREVIEW)) {
          String previewTask = taskTableModel.getRowData(ta.getRowId());
          doFileDelivery(ureq, previewTask);
        } else {
          // select a task
          assignedTask = taskTableModel.getRowData(ta.getRowId());
          List availableTasks = compileAvailableTasks();
          if (!availableTasks.contains(assignedTask)) {
            getWindowControl().setWarning(translator.translate("task.chosen"));
            taskTableModel.setTasks(availableTasks);
            tableCtr.modelChanged();
View Full Code Here

   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == nodeListCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        if (actionid.equals(CMD_SELECT_NODE)) {
          int rowid = te.getRowId();
          Map nodeData = (Map) nodeTableModel.getObject(rowid);
          ICourse course = CourseFactory.loadCourse(ores);
          this.currentCourseNode = course.getRunStructure().getNode((String) nodeData.get(AssessmentHelper.KEY_IDENTIFYER));
         
          olatResource = course.getResourceableId();
View Full Code Here

  }

  @Override
  protected void event(UserRequest ureq, Controller source, Event event) {
    if (source==tableCtr_ && event instanceof TableEvent) {
      TableEvent tableEvent = (TableEvent)event;
      if (CLICK_NODE_ACTION.equals(tableEvent.getActionId())) {

        int rowId = tableEvent.getRowId();
        Graph graph = calculateNodeGraph(ureq, rowId);
        generateCharts(graph);
      } else if (tableEvent.getActionId().startsWith(CLICK_TOTAL_ACTION)) {
       
        try{
          int columnId = Integer.parseInt(tableEvent.getActionId().substring(CLICK_TOTAL_ACTION.length()));
          Graph graph = calculateTotalGraph(ureq, columnId);
          generateCharts(graph);
        } catch(NumberFormatException e) {
          log_.warn("event: Could not convert event into columnId for rendering graph: "+tableEvent.getActionId());
          return;
        }
       
      }
    }
View Full Code Here

   */
  public void event(UserRequest ureq, Controller source, Event event) {
    super.event(ureq, source, event);
    if (source == tableCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        if (actionid.equals(CMD_LAUNCH)) {
          int rowid = te.getRowId();
          Bookmark bookmark = bookmarkListModel.getBookmarkAt(rowid);
          BookmarkManager.getInstance().launchBookmark(bookmark, ureq, getWindowControl());
        }
      }
    }
View Full Code Here

   */
  public void event(UserRequest ureq, Controller source, Event event) {
    // if row has been cklicked
    if (source == tableCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        int rowid = te.getRowId();
        this.chosenBm = (BookmarkImpl) tdm.getObject(rowid);
        if (actionid.equals("choose")) {
          // launch bookmark
          BookmarkManager.getInstance().launchBookmark(chosenBm, ureq, getWindowControl());
          return;
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.table.TableEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.