01: package org.claros.mini.actions;
02:
03: import java.util.List;
04:
05: import javax.servlet.http.HttpServletRequest;
06: import javax.servlet.http.HttpServletResponse;
07: import org.apache.struts.action.ActionForm;
08: import org.apache.struts.action.ActionForward;
09: import org.apache.struts.action.ActionMapping;
10:
11: import org.claros.commons.mail.models.ConnectionMetaHandler;
12: import org.claros.commons.mail.models.ConnectionProfile;
13: import org.claros.commons.models.AuthProfile;
14: import org.claros.mini.common.BaseLoggedAction;
15: import org.claros.mini.controllers.FolderController;
16: import org.claros.mini.factory.FolderControllerFactory;
17:
18: /**
19: * @version 1.0
20: * @author Umut Gökbayrak
21: */
22: public class FoldersAction extends BaseLoggedAction {
23:
24: public ActionForward myExecute(ActionMapping mapping,
25: ActionForm form, HttpServletRequest request,
26: HttpServletResponse response) throws Exception {
27: ConnectionMetaHandler handler = getConnectionHandler(request);
28: ConnectionProfile profile = getConnectionProfile(request);
29: AuthProfile auth = getAuthProfile(request);
30:
31: FolderControllerFactory factory = new FolderControllerFactory(
32: auth, profile, handler);
33: FolderController foldCont = factory.getFolderController();
34:
35: List folders = foldCont.getFolders();
36: request.setAttribute("mailFolders", folders);
37:
38: return mapping.findForward("success");
39: }
40: }
|