TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/LuisAMoralesA/tallerIngles-UAEMEcatepec/llms.txt
Use this file to discover all available pages before exploring further.
Respaldo class (package controller) implements two independent backup strategies: an Excel workbook export via Apache POI and a SQL dump via mysqldump. Both are triggered from the administrator interface and delivered as browser file downloads — no intermediate files are written to the server’s filesystem. The download filename includes the current year and active semester (e.g. Respaldo_TEI_2025_Periodo_A.xlsx).
Respaldo en Excel
iniciarRespaldo(OutputStream flujoSalida, String rutaImagen)
Creates an .xlsx workbook with four sheets, writes all data collected from BaseDatos, and streams the result to flujoSalida (the HTTP response output stream).
Respaldo.java
| Parámetro | Descripción |
|---|---|
flujoSalida | OutputStream obtenido de response.getOutputStream() |
rutaImagen | Ruta absoluta al archivo Logo_Taller2_BN.png dentro del directorio Images/ |
Hojas del workbook
| Hoja | Contenido |
|---|---|
Alumnos | Nombre completo, nombre de usuario, teléfono principal, correo electrónico, ¿sale solo? (SI/NO), fecha de nacimiento, grupo asignado, profesor asignado |
Profesores | Nombre completo, nombre de usuario, teléfono, correo electrónico, fecha de nacimiento, grupo asignado |
Calificaciones | Nombre completo, nombre de usuario, 1er parcial, 2do parcial, calificación final |
Seguimiento de Pago | Nombre completo, pago de inscripción, mensualidades 1–7 (SI/NO cada una), estatus del alumno |
BaseDatos.obtenerDatosAlumnos(), BaseDatos.obtenerDatosProfesores(), Respaldo.obtenerCalificaciones() (JOIN students + users + report), and Respaldo.obtenerSeguimientoPago() (JOIN students + payment + payment_status).
Disparar respaldo Excel
Access the Excel export from the administrator interface or directly via:backupServlet sets the following response headers before writing:
backupServlet.java
Respaldo.iniciarRespaldo(response.getOutputStream(), imagenLogo) and written directly to the browser. The TEI logo path is resolved via getServletContext().getRealPath("/Images/") and appended with Logo_Taller2_BN.png.
Respaldo SQL (mysqldump)
iniciarRespaldoSQL(OutputStream flujoSalida, String rutaEjecutable)
Spawns a mysqldump child process and pipes its stdout directly to flujoSalida. The dump includes all tables and stored routines (-R flag).
Respaldo.java
| Parámetro | Descripción |
|---|---|
flujoSalida | OutputStream obtenido de response.getOutputStream() |
rutaEjecutable | Ruta absoluta al binario mysqldump (por defecto WEB-INF/mysqldump.exe) |
Respaldo.java
mysqldump process is read in 4 KB chunks and written directly to flujoSalida:
Respaldo.java
Disparar respaldo SQL
backupServlet.java
mysqldump executable path is resolved via getServletContext().getRealPath("/WEB-INF/mysqldump.exe"). If getRealPath returns null, the fallback is Constantes.ARCHIVO_MYSQLDUMP (/tallerDeInglesUAEM/WEB-INF/mysqldump.exe).
mysqldump en Linux/macOS
Formato del respaldo Excel
Each of the four sheets is built with a consistent visual style applied by helper methods inRespaldo:
| Elemento | Especificación |
|---|---|
| Logo TEI | Imagen PNG (Logo_Taller2_BN.png) insertada en la esquina superior izquierda de cada hoja, abarcando las filas 1–6 |
| Fila de título | Fila 1 — texto "Taller de Inglés para Niños y Adolescentes" con estilo de encabezado; fusionada en columnas 2–5 |
| Fila de subtítulo | Fila 2 — nombre de la hoja (p. ej. "Respaldo de Alumnos del TEI"); fusionada en columnas 2–5 |
| Encabezados de columna | Fila 7 — texto en negrita blanca sobre fondo negro, fuente Arial 11pt, centrado y con altura de 24pt |
| Datos | A partir de la fila 8 — fuente Arial 10pt, alineación izquierda para texto largo, centrado para valores cortos/fechas/booleanos, altura de 18pt |
| Bordes | BorderStyle.THIN en color gris (GREY_25_PERCENT) en los cuatro lados de cada celda |
| Ancho de columna | autoSizeColumn() seguido de +1200 unidades de relleno adicional para evitar texto truncado |
Estilos aplicados
Respaldo.java