1 7 8 package org.enhydra.snapper.presentation; 9 10 import com.lutris.appserver.server.httpPresentation.ClientPageRedirectException; 12 import com.lutris.appserver.server.httpPresentation.HttpPresentationException; 13 14 15 import org.enhydra.snapper.SnapperManager; 17 import org.enhydra.snapper.spec.*; 18 19 import org.enhydra.snapper.presentation.html.*; 20 import org.enhydra.xml.xmlc.XMLObject; 21 22 24 public class DeleteSite extends BasePO { 25 26 27 protected XMLObject getDOM() throws Exception { 28 29 String siteID = comms.request.getParameter("id"); 30 31 SiteListHTML siteList; 32 33 Site site = null; 34 35 try { 36 site = (SiteFactory.getSite("org.enhydra.snapper.business.SiteImpl")).findSiteByID(siteID, dbTransaction); 37 String name = site.getName(); 38 39 if (site.getLOCKED() == true) { 40 41 SnapperManager.getInstance().getLoggingManager().info( 42 "Site locked! Indexing Aborted."); 43 throw new ClientPageRedirectException(comms.request 44 .getAppFileURIPath("SiteListPresentation.po?l="+site.getName())); 45 } 46 String siteHandle = site.getID(); 47 site.deleteDir(name); 48 site.delete(); 49 } catch(Exception ex) { 50 throw new HttpPresentationException("Could not delete", ex); 51 } 52 53 55 57 throw new ClientPageRedirectException(comms.request.getAppFileURIPath("SiteListPresentation.po")); 58 59 } 60 } 61 | Popular Tags |