1 package de.webman.config.eventhandler; 2 3 import com.teamkonzept.web.*; 4 import com.teamkonzept.webman.*; 5 import com.teamkonzept.webman.db.TKWebmanDBManager; 6 import com.teamkonzept.webman.mainint.*; 7 import com.teamkonzept.webman.mainint.db.*; 8 9 import de.webman.content.workflow.*; 10 import com.teamkonzept.webman.mainint.db.queries.*; 11 import com.teamkonzept.webman.mainint.events.*; 12 import com.teamkonzept.lib.*; 13 import com.teamkonzept.field.*; 14 import com.teamkonzept.field.db.*; 15 import com.teamkonzept.db.*; 16 import com.teamkonzept.publishing.markups.*; 17 18 import java.sql.*; 19 import java.io.*; 20 21 27 public class COSaveStatusHandler extends DefaultEventHandler implements ParameterTypes, FrameConstants, DatabaseDefaults 28 { 29 private COSaveStatusHandler() 30 {} 31 32 private static COSaveStatusHandler instance = new COSaveStatusHandler(); 33 34 public static COSaveStatusHandler getInstance() 35 { 36 return instance; 37 } 38 39 public void handleEvent(TKEvent evt) throws TKException 40 { 41 try 42 { 43 WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(), ContextConstants.CUSTOMIZE_PROPERTIES); 44 45 String statusID = evt.getParameter(PARAMETER, "STATUS_ID"); 46 VersionStatics statics = VersionStatics.setup(); 48 VersionStatus status; 49 TKHashtable params = (TKHashtable)evt.getParams().get(PARAMETER); 50 51 if (statusID != null) 52 { 53 status = (VersionStatus)statics.getStatusPool().get(new Integer (statusID)); 55 56 status.getFromEvent(params); 57 status.saveToDB(); 58 } 59 else 60 { 61 status = new VersionStatus(); 63 status.getFromEvent(params); 64 status.saveToDB(); 65 VersionStatics.reFresh(); 66 } 67 68 69 77 78 COWorkflowListHandler.getInstance().handleEvent(evt); 80 } 81 catch (Throwable e) 82 { 83 throw WebmanExceptionHandler.getException(e); 85 } 86 } 87 88 public boolean isHandler(TKEvent evt) 89 { 90 return evt.getName().equalsIgnoreCase("CO_SAVE_STATUS"); 91 } 92 } 93 | Popular Tags |