1 package org.campware.cream.modules.actions; 2 3 42 43 import org.apache.velocity.context.Context; 44 45 import org.apache.turbine.util.RunData; 46 import org.campware.cream.om.Notification; 47 48 52 public class NotificationSQL extends CreamAction 53 { 54 protected void initScreen() 55 { 56 setModuleType(SYSTEM); 57 setModuleName("NOTIFICATION"); 58 } 59 60 68 public void doUpdate(RunData data, Context context) 69 throws Exception 70 { 71 Notification entry = new Notification(); 72 73 String not1= data.getParameters().getString("notification1"); 74 String not2= data.getParameters().getString("notification2"); 75 String not3= data.getParameters().getString("notification3"); 76 77 String subj1= data.getParameters().getString("subject1"); 78 String subj2= data.getParameters().getString("subject2"); 79 String subj3= data.getParameters().getString("subject3"); 80 81 Notification entry1 = new Notification(); 82 83 entry1.setNotificationId(1001); 84 entry1.setNotificationType(10); 85 entry1.setSubject(subj1); 86 entry1.setBody(not1); 87 88 entry1.setModified(true); 89 entry1.setNew(false); 90 entry1.save(); 91 92 Notification entry2 = new Notification(); 93 94 entry2.setNotificationId(1002); 95 entry2.setNotificationType(20); 96 entry2.setSubject(subj2); 97 entry2.setBody(not2); 98 99 entry2.setModified(true); 100 entry2.setNew(false); 101 entry2.save(); 102 103 Notification entry3 = new Notification(); 104 105 entry3.setNotificationId(1003); 106 entry3.setNotificationType(30); 107 entry3.setSubject(subj3); 108 entry3.setBody(not3); 109 110 entry3.setModified(true); 111 entry3.setNew(false); 112 entry3.save(); 113 114 } 115 116 117 } 118 | Popular Tags |