1 23 24 package org.infoglue.cms.applications.managementtool.actions; 25 26 import java.io.OutputStream ; 27 import java.io.OutputStreamWriter ; 28 29 import org.apache.log4j.Logger; 30 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction; 31 import org.infoglue.cms.controllers.kernel.impl.simple.UpdateController; 32 import org.infoglue.cms.util.CmsPropertyHandler; 33 34 35 40 public class InstallUpdateAction extends InfoGlueAbstractAction 41 { 42 private final static Logger logger = Logger.getLogger(InstallUpdateAction.class.getName()); 43 44 UpdateController uc; 45 private String updatePackageId; 46 47 48 protected String doExecute() throws Exception { 49 50 OutputStream os = getResponse().getOutputStream(); 51 OutputStreamWriter writer = new OutputStreamWriter (os); 52 getResponse().setBufferSize(1); 53 getResponse().setContentType("text/html"); 54 logger.info("Executing doExecute on RefreshUpdates.."); 57 String path = getRequest().getRealPath("/") + "up2date/"; 58 59 System.out.println("UP2DATE: PATH: " + path); 60 String url = CmsPropertyHandler.getUp2dateUrl(); 61 62 63 64 uc = new UpdateController(url, path); 65 66 writer.write("<!-- INFOGLUE AUTO-UPDATE SYSTEM -->\n"); 67 for(int i = 0;i<1200;i++) 68 { 69 writer.write(" "); 70 } 71 writer.write("\n"); 72 73 writer.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" HREF=\"css/cms.css\" /></head><body class=\"managementtooledit\"><font color=\"#888888\">"); 74 writer.flush(); 75 uc.runUpdatePackage(getUpdatePackageId(), writer); 76 78 writer.write("<script language='javascript'>\n"); 79 writer.write("alert('Infoglue Up2Date\\n\\nThis installation has finished. ');\n"); 80 82 writer.write("</script>"); 83 84 writer.write("</font></body></html>"); 85 writer.flush(); 86 87 os.flush(); 88 89 return null; 90 } 91 92 93 96 public String getUpdatePackageId() { 97 return updatePackageId; 98 } 99 100 103 public void setUpdatePackageId(String string) { 104 updatePackageId = string; 105 } 106 107 } 108 | Popular Tags |