1 package de.webman.form.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 import com.teamkonzept.webman.mainint.db.queries.*; 9 import com.teamkonzept.webman.mainint.events.*; 10 import com.teamkonzept.lib.*; 11 import com.teamkonzept.field.*; 12 import com.teamkonzept.field.db.*; 13 import com.teamkonzept.db.*; 14 import com.teamkonzept.publishing.markups.*; 15 import de.webman.form.Form; 16 17 23 public class CTDeleteHandler 24 extends DefaultEventHandler 25 implements ParameterTypes, 26 FrameConstants, 27 DatabaseDefaults 28 { 29 30 33 private static final CTDeleteHandler INSTANCE = new CTDeleteHandler(); 34 35 38 private CTDeleteHandler () 39 { 40 } 42 43 48 public static CTDeleteHandler getInstance () 49 { 50 return INSTANCE; 51 } 52 53 59 public void handleEvent (TKEvent event) 60 throws TKException 61 { 62 try 63 { 64 WebManEvent.checkEvent(event.getRemoteUser(), event.getName(), ContextConstants.CONTENT_TREE); 66 67 Form form = new Form(Integer.valueOf(event.getParameter(PARAMETER, "FORM_ID"))); 69 70 if (form.hasDependencies()) 71 { 72 throw new TKUserException("Form", OBJECT_IN_USE, USER_SEVERITY, true, null); 74 } 75 76 TKFormDBInterface.Del(new TKFormDBData(form.getIdentifierAsInt())); 78 79 CTFramesHandler.getInstance().handleEvent(event); 81 } 82 catch (Throwable e) 83 { 84 throw WebmanExceptionHandler.getException(e); 86 } 87 } 88 89 96 public boolean isHandler (TKEvent event) 97 { 98 return event.getName().equalsIgnoreCase("CT_DELETE"); 99 } 100 101 } 102 | Popular Tags |