Methods Summary |
---|
public java.lang.String | delete()Prepare to present a confirmation page before removing
Subscription.
setTask(Constants.DELETE);
return find();
|
public java.lang.String | edit()Prepare to edit User Subscription.
setTask(Constants.EDIT);
return find();
|
public java.lang.String | find()Load User Subscription for the local Host property.
Usually, the Host is being set from the request by a link to an Edit
or Delete task.
org.apache.struts.apps.mailreader.dao.Subscription
sub = findSubscription();
if (sub == null) {
return ERROR;
}
setSubscription(sub);
return INPUT;
|
public java.util.Map | getTypes()Provide the list of MailServer types.
return types;
|
public java.lang.String | input()Setup a temporary User Subscription object to capture input
values.
createInputSubscription();
setTask(Constants.CREATE);
return INPUT;
|
public void | prepare()Setup the MailerServer types and set the local Host property from
the User Subscription (if any).
Map m = new LinkedHashMap();
m.put("imap", "IMAP Protocol");
m.put("pop3", "POP3 Protocol");
types = m;
setHost(getSubscriptionHost());
|
public java.lang.String | save() Examine the Task property and DELETE, CREATE, or save the User
Subscription, as appropriate.
if (Constants.DELETE.equals(getTask())) {
removeSubscription();
}
if (Constants.CREATE.equals(getTask())) {
copySubscription(getHost());
}
if (hasErrors()) return INPUT;
saveUser();
return SUCCESS;
|