1
2 package com.pnpconsult.zeiterfassung.actions;
3
4 import net.sf.hibernate.HibernateException;
5
6 import org.apache.commons.logging.Log;
7 import org.apache.commons.logging.LogFactory;
8
9 import com.pnpconsult.zeiterfassung.helper.ObjectSupport;
10
11
12 /***
13 * @author <a href="mailto:powerpete@users.sf.net">Moritz Petersen</a>
14 * @version $Id: DeleteForm.java,v 1.2 2004/06/24 20:54:20 powerpete Exp $
15 */
16 public abstract class DeleteForm extends EditForm
17 {
18 private static final Log LOG = LogFactory.getLog(DeleteForm.class);
19
20 private String submit;
21 private String information = "";
22 private String name = "";
23 private String description = "";
24
25 public String getDescription()
26 {
27 return description;
28 }
29 public void setDescription(String description)
30 {
31 this.description = description;
32 }
33 public String getInformation()
34 {
35 return information;
36 }
37 public void setInformation(String information)
38 {
39 this.information = information;
40 }
41 public String getName()
42 {
43 return name;
44 }
45 public void setName(String name)
46 {
47 this.name = name;
48 }
49 public String getSubmit()
50 {
51 return submit;
52 }
53
54 public void setSubmit(String submit)
55 {
56 this.submit = submit;
57 }
58
59 public void delete()
60 {
61 ObjectSupport manager = new ObjectSupport();
62 try
63 {
64 manager.delete(dataObjectType(), dataObjectKey());
65 }
66 catch (HibernateException e)
67 {
68 LOG.fatal("Error deleting object of class " + dataObjectType()
69 + " with key " + dataObjectKey(), e);
70 }
71 }
72
73 public boolean isDeleteButtonClicked()
74 {
75 return !"Abbrechen".equals(submit);
76 }
77 }