1 31 32 package org.opencms.workplace.tools.database; 33 34 import org.opencms.jsp.CmsJspActionElement; 35 import org.opencms.main.CmsException; 36 import org.opencms.main.OpenCms; 37 import org.opencms.workplace.administration.A_CmsImportFromHttp; 38 import org.opencms.workplace.tools.CmsToolDialog; 39 import org.opencms.workplace.tools.CmsToolManager; 40 41 import java.io.IOException ; 42 import java.util.HashMap ; 43 import java.util.Map ; 44 45 import javax.servlet.ServletException ; 46 import javax.servlet.http.HttpServletRequest ; 47 import javax.servlet.http.HttpServletResponse ; 48 import javax.servlet.jsp.PageContext ; 49 50 60 public class CmsDatabaseImportFromHttp extends A_CmsImportFromHttp { 61 62 63 public static final String DIALOG_URI = PATH_WORKPLACE + "admin/database/importhttp.jsp"; 64 65 70 public CmsDatabaseImportFromHttp(CmsJspActionElement jsp) { 71 72 super(jsp); 73 } 74 75 82 public CmsDatabaseImportFromHttp(PageContext context, HttpServletRequest req, HttpServletResponse res) { 83 84 this(new CmsJspActionElement(context, req, res)); 85 } 86 87 90 public void actionCommit() throws IOException , ServletException { 91 92 try { 93 copyFileToServer(OpenCms.getSystemInfo().getPackagesRfsPath()); 94 } catch (CmsException e) { 95 setException(e); 97 return; 98 } 99 Map params = new HashMap (); 100 params.put(PARAM_FILE, getParamImportfile()); 101 params.put(PARAM_STYLE, CmsToolDialog.STYLE_NEW); 103 params.put(PARAM_CLOSELINK, CmsToolManager.linkForToolPath(getJsp(), "/database")); 105 getToolManager().jspForwardPage(this, CmsDatabaseImportFromServer.IMPORT_ACTION_REPORT, params); 107 } 108 109 112 public String getDialogReturnUri() { 113 114 return DIALOG_URI; 115 } 116 117 120 public String getImportMessage() { 121 122 return key(Messages.GUI_DATABASE_IMPORT_FILE_0); 123 } 124 125 128 public String getStarttext() { 129 130 return key(Messages.GUI_DATABASE_IMPORT_BLOCK_0); 131 } 132 133 136 protected void initMessages() { 137 138 addMessages(Messages.get().getBundleName()); 140 addMessages(org.opencms.workplace.Messages.get().getBundleName()); 142 addMessages(org.opencms.workplace.tools.Messages.get().getBundleName()); 143 } 144 } | Popular Tags |