Package org.cast.isi.data

Examples of org.cast.isi.data.ClassMessage


    add(new QuickFlipForm("quickFlipForm", true));
   
    // Loads the Class Message for this period
    WebMarkupContainer classMessageBox = new WebMarkupContainer("classMessageBox");
    add(classMessageBox);
    ClassMessage m = responseService.getClassMessage(ISISession.get().getCurrentPeriodModel());
    if (m == null) {
      classMessageBox.add(new Label("classMessage", new ResourceModel("classMessage")));
    } else {
      classMessageBox.add(new Label("classMessage", m.getMessage()));
    }
    classMessageBox.setVisible(ISIApplication.get().isClassMessageOn());

    // Loads a list of locations that have Unread Messages and Regular Messages
    locsWithUnread = responseService.getPagesWithNotes(ISISession.get().getUser(), true);
View Full Code Here


    }
   
    @Override
    protected void onBeforeRender() {
      if (m == null) {
        m = new ClassMessage();
        m.setMessage((new StringResourceModel("ManageClasses.noClassMessage", this, null, "No Class Message").getString()));
     
      setDefaultModel(new CompoundPropertyModel<ClassMessage>(m));
      classMessageForm.setModel(new CompoundPropertyModel<ClassMessage>(m));
      add(new SimpleAttributeModifier("style", "display:block"));
View Full Code Here

   */
  public void setClassMessage(IModel<Period> mPeriod, String s) {
   
    Period p = mPeriod.getObject();
   
    ClassMessage m = new ClassMessage();
    m.setTimestamp(new Date());
    m.setPeriod(p);
    m.setCurrent(true);
    m.setMessage(s);
    m.setAuthor(ISISession.get().getUser());
   
    ClassMessage old = getClassMessage(mPeriod);
    if (old != null) {
      old.setCurrent(false);
    }
    Databinder.getHibernateSession().save(m);
    cwmService.flushChanges();
    eventService.saveEvent("classmessage:create", "Period Id: " + p.getId() + " Message Id: " + m.getId(), null);   
  }
View Full Code Here

   */
  public ClassMessage getClassMessage(IModel<Period> p) {
    Query q = Databinder.getHibernateSession().getNamedQuery("ClassMessage.queryByPeriod");
    q.setParameter("period", p.getObject());
    q.setCacheable(true);
    ClassMessage m = (ClassMessage) q.uniqueResult();
    // Databinder.getHibernateSession().evict(m);
    // TODO: test without evict
    return m;
  }
View Full Code Here

   * @see org.cast.isi.service.IISIResponseService#deleteClassMessage(org.apache.wicket.model.IModel)
   */
  public void deleteClassMessage(IModel<Period> mPeriod) {
   
    Period p = mPeriod.getObject();
    ClassMessage m = getClassMessage(mPeriod);
    if (m != null) {
      m.setCurrent(false);
      cwmService.flushChanges();
      eventService.saveEvent("classmessage:delete", "Period Id: " + p.getId() + " Message Id: " + m.getId(), null);
    }
  }
View Full Code Here

TOP

Related Classes of org.cast.isi.data.ClassMessage

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.