public void deletePostedSyllabus(SyllabusData data) { BaseResourceEdit bre = new BaseResourceEdit(data.getSyllabusId().toString(), data); addLiveSyllabusProperties(bre); bre.setEvent(EVENT_SYLLABUS_DELETE_POST); String emailNotify = data.getEmailNotification(); int priority; // for adding more logging info and not send out email notification // if(emailNotify.equalsIgnoreCase("none")) // { // priority = NotificationService.NOTI_NONE; // } // else if(emailNotify.equalsIgnoreCase("high")) // { // priority = NotificationService.NOTI_REQUIRED; // } // else if(emailNotify.equalsIgnoreCase("low")) // { // priority = NotificationService.NOTI_OPTIONAL; // } // else // { // priority = NotificationService.NOTI_NONE; // } priority = NotificationService.NOTI_NONE; Event event = EventTrackingService.newEvent(bre.getEvent(), bre.getReference(), true, priority); EventTrackingService.post(event); }
public void postChangeSyllabus(SyllabusData data) { BaseResourceEdit bre = new BaseResourceEdit(data.getSyllabusId().toString(), data); addLiveSyllabusProperties(bre); bre.setEvent(EVENT_SYLLABUS_POST_CHANGE); String emailNotify = data.getEmailNotification(); int priority; if (emailNotify.equalsIgnoreCase("none")) { priority = NotificationService.NOTI_NONE; } else if (emailNotify.equalsIgnoreCase("high")) { priority = NotificationService.NOTI_REQUIRED; } else if (emailNotify.equalsIgnoreCase("low")) { priority = NotificationService.NOTI_OPTIONAL; } else { priority = NotificationService.NOTI_NONE; } Event event = EventTrackingService.newEvent(bre.getEvent(), bre.getReference(), true, priority); EventTrackingService.post(event); }
public void draftNewSyllabus(SyllabusData data) { BaseResourceEdit bre = new BaseResourceEdit(data.getSyllabusId().toString(), data); addLiveSyllabusProperties(bre); bre.setEvent(EVENT_SYLLABUS_DRAFT_NEW); int priority; priority = NotificationService.NOTI_NONE; Event event = EventTrackingService.newEvent(bre.getEvent(), bre.getReference(), true, priority); EventTrackingService.post(event); }
protected void addLiveSyllabusProperties(BaseResourceEdit r) { ResourcePropertiesEdit p = r.getPropertiesEdit(); String current = SessionManager.getCurrentSessionUserId(); p.addProperty(ResourceProperties.PROP_CREATOR, current); p.addProperty(ResourceProperties.PROP_MODIFIED_BY, current); String now = TimeService.newTime().toString(); p.addProperty(ResourceProperties.PROP_CREATION_DATE, now); p.addProperty(ResourceProperties.PROP_MODIFIED_DATE, now); p.addProperty(ResourceProperties.PROP_IS_COLLECTION, "false"); }
// permission convert public String getSyllabusApplicationSiteReference(String thisSiteId) { BaseResourceEdit bre = new BaseResourceEdit(thisSiteId); return bre.getReference(); }
// permission convert public String getEntityReference(SyllabusData sd, String thisSiteId) { BaseResourceEdit bre = new BaseResourceEdit(sd.getSyllabusId().toString(), sd, thisSiteId); return bre.getReference(); }