class TemplateServiceImpl extends RemoteServiceServlet implements TemplateService {

	@Override
	public void delete(long templateId) throws ServerException {
		Session session = ServiceUtil.validateSession(getThreadLocalRequest());

		try {
			TemplateDAO dao = (TemplateDAO) Context.get().getBean(TemplateDAO.class);
			boolean deleted = dao.delete(templateId);
			if (!deleted)
				throw new Exception("Template has not been deleted");
		} catch (Throwable t) {
			ServiceUtil.throwServerException(session, log, t);
		}
	}

}