1 31 32 package org.opencms.workplace.tools.database; 33 34 import org.opencms.jsp.CmsJspActionElement; 35 import org.opencms.workplace.CmsReport; 36 import org.opencms.workplace.CmsWorkplaceSettings; 37 38 import javax.servlet.http.HttpServletRequest ; 39 import javax.servlet.http.HttpServletResponse ; 40 import javax.servlet.jsp.JspException ; 41 import javax.servlet.jsp.PageContext ; 42 43 52 public class CmsStaticExportReport extends CmsReport { 53 54 55 public static final String DIALOG_TYPE = "sync"; 56 57 62 public CmsStaticExportReport(CmsJspActionElement jsp) { 63 64 super(jsp); 65 } 66 67 74 public CmsStaticExportReport(PageContext context, HttpServletRequest req, HttpServletResponse res) { 75 76 this(new CmsJspActionElement(context, req, res)); 77 } 78 79 84 public void actionReport() throws JspException { 85 86 getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this); 88 switch (getAction()) { 89 case ACTION_REPORT_UPDATE: 90 setParamAction(REPORT_UPDATE); 91 getJsp().include(FILE_REPORT_OUTPUT); 92 break; 93 case ACTION_REPORT_BEGIN: 94 case ACTION_CONFIRMED: 95 default: 96 CmsStaticExportThread thread = new CmsStaticExportThread(getCms()); 97 setParamAction(REPORT_BEGIN); 98 setParamThread(thread.getUUID().toString()); 99 getJsp().include(FILE_REPORT_OUTPUT); 100 break; 101 } 102 } 103 104 107 protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest request) { 108 109 fillParamValues(request); 111 setParamDialogtype(DIALOG_TYPE); 113 if (DIALOG_CONFIRMED.equals(getParamAction())) { 115 setAction(ACTION_CONFIRMED); 116 } else if (REPORT_UPDATE.equals(getParamAction())) { 117 setAction(ACTION_REPORT_UPDATE); 118 } else if (REPORT_BEGIN.equals(getParamAction())) { 119 setAction(ACTION_REPORT_BEGIN); 120 } else if (REPORT_END.equals(getParamAction())) { 121 setAction(ACTION_REPORT_END); 122 } else if (DIALOG_CANCEL.equals(getParamAction())) { 123 setAction(ACTION_CANCEL); 124 } else { 125 setAction(ACTION_DEFAULT); 126 setParamTitle(Messages.get().getBundle(getLocale()).key(Messages.GUI_TITLE_STATICEXPORT_0)); 128 } 129 } 130 } 131 | Popular Tags |