void submit() {

        List<String> siteRootsToDelete = new ArrayList<String>();
        for (CmsSite site : m_sitesToDelete) {

            String currentSite = A_CmsUI.getCmsObject().getRequestContext().getSiteRoot();
            if (currentSite.equals(site.getSiteRoot())) {
                A_CmsUI.getCmsObject().getRequestContext().setSiteRoot("");
            }
            siteRootsToDelete.add(site.getSiteRoot());
        }
        m_manager.deleteElements(siteRootsToDelete);
        if (m_deleteResources.getValue().booleanValue()) {
            for (CmsSite site : m_sitesToDelete) {
                try {
                    m_manager.getRootCmsObject().lockResource(site.getSiteRoot());
                } catch (CmsException e) {
                    LOG.error("unable to lock resource");
                }
                try {
                    m_manager.getRootCmsObject().deleteResource(
                        site.getSiteRoot(),
                        CmsResource.DELETE_PRESERVE_SIBLINGS);
                    try {
                        m_manager.getRootCmsObject().unlockResource(site.getSiteRoot());
                    } catch (CmsLockException e) {
                        LOG.info("Unlock failed.", e);
                    }
                } catch (CmsException e) {
                    //ok, resource was not published and can not be unlocked anymore..
                }
            }
        }
    }
void submit ( ) { List < String > siteRootsToDelete = new ArrayList < String > ( ) ; for ( CmsSite site : m_sitesToDelete ) { String currentSite = A_CmsUI . getCmsObject ( ) . getRequestContext ( ) . getSiteRoot ( ) ; if ( currentSite . equals ( site . getSiteRoot ( ) ) ) { A_CmsUI . getCmsObject ( ) . getRequestContext ( ) . setSiteRoot ( "" ) ; } siteRootsToDelete . add ( site . getSiteRoot ( ) ) ; } m_manager . deleteElements ( siteRootsToDelete ) ; if ( m_deleteResources . getValue ( ) . booleanValue ( ) ) { for ( CmsSite site : m_sitesToDelete ) { try { m_manager . getRootCmsObject ( ) . lockResource ( site . getSiteRoot ( ) ) ; } catch ( CmsException e ) { LOG . error ( "unable to lock resource" ) ; } try { m_manager . getRootCmsObject ( ) . deleteResource ( site . getSiteRoot ( ) , CmsResource . DELETE_PRESERVE_SIBLINGS ) ; try { m_manager . getRootCmsObject ( ) . unlockResource ( site . getSiteRoot ( ) ) ; } catch ( CmsLockException e ) { LOG . info ( "Unlock failed." , e ) ; } } catch ( CmsException e ) { } } } }
delete sites.<p>