Package org.cast.cwm.data

Examples of org.cast.cwm.data.Site


     
      SortedSet<User> userSet = new TreeSet<User>();
      userSet.add(user);
     
      // create a new site
      Site newSite = SiteService.get().newSite();
      newSite.setName("Site_" + user.getUsername()); // make this unique

      // create a new period
      Period newPeriod = SiteService.get().newPeriod();
      newPeriod.setSite(newSite);
      newPeriod.setName("Class_" + user.getUsername()); // make this unique
     
      // add the period to the user and the site
      SortedSet<Period> periodSet = new TreeSet<Period>();
      periodSet.add(newPeriod);
      user.getPeriods().add(newPeriod);
      newSite.getPeriods().add(newPeriod);     
     
      // a default student must be added to the new period
      User studentUser = UserService.get().newUser();
      studentUser.setRole(Role.STUDENT);
      studentUser.setFirstName("Student");
View Full Code Here


        }

        // Set default Period
        if (user != null && user.usesPeriods()) {
          session.setCurrentPeriodModel(new HibernateObjectModel<Period>(user.getPeriods().iterator().next()));
          Site currentSite = ISISession.get().getCurrentPeriodModel().getObject().getSite();
          IModel<Site> mCurrentSite = new Model<Site>(currentSite);
          session.setCurrentSiteModel(mCurrentSite);
        }       

        if (!continueToOriginalDestination()) {
View Full Code Here

      @Override
      protected void onUpdate(AjaxRequestTarget target) {
        ISISession.get().setStudentModel(null); // Reset session's selected student since period changed
        ISISession.get().setCurrentPeriodModel(periodChoice.getModel()); // Save period change in session
        // Save current site information
        Site currentSite = ISISession.get().getCurrentPeriodModel().getObject().getSite();
        IModel<Site> mCurrentSite = new Model<Site>(currentSite);
        ISISession.get().setCurrentSiteModel(mCurrentSite);
        if (showStudents) {
          studentChoice.setChoices(getUserListModel()); // Alert student drop-down of the change
          target.addComponent(studentChoice);
View Full Code Here

TOP

Related Classes of org.cast.cwm.data.Site

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.