DeleteProcess.java
上传用户:ahit0551
上传日期:2009-04-15
资源大小:2345k
文件大小:2k
源码类别:

xml/soap/webservice

开发平台:

Java

  1. package name.xio.xiorkflow.web;
  2. import javax.servlet.http.HttpServletRequest;
  3. import javax.servlet.http.HttpServletResponse;
  4. import name.xio.xiorkflow.domain.Process;
  5. import name.xio.xiorkflow.domain.ProcessResult;
  6. import name.xio.xiorkflow.domain.logic.ProcessService;
  7. import name.xio.xml.SimpleXMLWorkShop;
  8. import org.apache.commons.logging.Log;
  9. import org.apache.commons.logging.LogFactory;
  10. import org.springframework.web.servlet.ModelAndView;
  11. import org.springframework.web.servlet.mvc.Controller;
  12. public class DeleteProcess implements Controller {
  13.     public ModelAndView handleRequest(HttpServletRequest request,
  14.             HttpServletResponse response) throws Exception {
  15.         request.setCharacterEncoding("UTF-8");
  16.         String name = request.getParameter("name");
  17.         log.info("delete process:" + name);
  18.         Process process = new Process();
  19.         process.setName(name);
  20.         ProcessResult processResult = this.getProcessService()
  21.                 .deleteProcess(process);
  22.         response.setContentType("text/xml");
  23.         response.setHeader("Cache-Control", "no-cache");
  24.         SimpleXMLWorkShop.outputXML(ProcessResult.convertXml(processResult),
  25.                 response.getOutputStream());
  26.         //not redirect to other view,it processed on response
  27.         return null;
  28.     }
  29.     /**
  30.      * @return Returns the processService.
  31.      */
  32.     public ProcessService getProcessService() {
  33.         return processService;
  34.     }
  35.     /**
  36.      * @param processService The processService to set.
  37.      */
  38.     public void setProcessService(ProcessService processService) {
  39.         this.processService = processService;
  40.     }
  41.     private Log log = LogFactory.getLog(DeleteProcess.class);
  42.     private ProcessService processService;
  43. }