The administrator is the most privileged actor in SiCom — Eventos Campestre. After authenticating through the shared login screen, an administrator gains access to the complete back-office: the article catalog, the full rental and quotation pipeline, employee management, inventory movement cards, table-linen combination configurator, and a multi-tab analytics dashboard. All protected pages hook intoDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dinogamer089/SiCom/llms.txt
Use this file to discover all available pages before exploring further.
LoginBeanUI.preventBackAfterLogout() on every preRenderView event, so navigating back after logout immediately redirects to the authentication selector.
Authentication Flow
The login form atlogin.xhtml binds its fields to the @SessionScoped bean loginUI (LoginBeanUI). When the administrator clicks Iniciar Sesión, loginUI.login() is invoked:
LoginHelper.login() delegates through ServiceFacadeLocator → FacadeLogin → DelegateLogin, which queries the database for a matching credential. When the returned object is an instance of Administrador, the session stores it and the browser is redirected to principalAdministrador.xhtml. Any other result stays on the login page with a warning message.
Administrador Entity
The Administrador JPA entity maps to the administrador table in MySQL:
| Column | Type | Constraint |
|---|---|---|
idAdmin | INT AUTO_INCREMENT | Primary key |
correo | VARCHAR(45) | NOT NULL |
contrasena | VARCHAR(100) | NOT NULL |
Pages Accessible to the Administrator
After login, the administrator lands onprincipalAdministrador.xhtml, which displays a card-grid dashboard that links to every back-office section. Every one of these pages fires #{loginUI.preventBackAfterLogout} on preRenderView.
| Page | Purpose |
|---|---|
principalAdministrador.xhtml | Home hub — card grid linking to Inventario, Cotizaciones, Artículos, and Rentas |
Articulos.xhtml | Create, modify, and delete rentable articles; filter by name; upload product images |
CombinacionMesa.xhtml | Define table-linen combinations (mesa + mantel + camino/cubre) with preview images |
AdminEmpleados.xhtml | Register, view, delete, and reset passwords for employee accounts |
Rentas.xhtml | View all rentals across every status; filter by client name or rental state |
Cotizaciones.xhtml | View all quotations in Solicitada state; search by client name |
Dashboard.xhtml | Overview tab — KPI cards (successful rentals, total revenue, average per rental) with bar and pie charts; configurable time range |
DashboardRentas.xhtml | Rental-specific analytics tab (linked from Dashboard nav strip) |
DashboardCotizaciones.xhtml | Quotation analytics tab (linked from Dashboard nav strip) |
DashboardClientes.xhtml | Client analytics tab (linked from Dashboard nav strip) |
TarjetaAlmacen.xhtml | Inventory movement card — per-article ledger showing entries, exits, balances, and running totals filtered by date or date range |
Page Details
-
principalAdministrador.xhtml— Landing page rendered after successful admin login. The four primary cards navigate directly toTarjetaAlmacen.xhtml,Cotizaciones.xhtml,Articulos.xhtml, andRentas.xhtml. -
Articulos.xhtml— Backed byarticuloUI(ArticuloBeanUI). Supports categoriesMESA,TEXTIL,SILLA,CARPA,COOLER, andCALENTON. Images are uploaded via afetchPOSTtoupload-imageand stored in the session before saving. Duplicate name detection runs client-side againstwindow.articulosData. -
CombinacionMesa.xhtml— Backed bycombinacionMesaAdminUI. Selecting a mesa triggers Ajax cascades to populate compatible mantel, camino, and cubre drop-downs. Camino and cubre are mutually exclusive. -
AdminEmpleados.xhtml— Backed byempleadoUI(EmpleadoBeanUI). The Alta dialog collectsapellidoPaterno,apellidoMaterno,nombre,correo, andcontrasena. Deletion is blocked if the employee has pending rental assignments; a 3-second undo toast allows the administrator to cancel the deletion before it commits. -
Rentas.xhtml— Backed byrentaUI. CallsrentaUI.obtenerTodasLasRentas()onpreRenderView. Each rental card shows the client name, phone, and a colour-coded status dot. Clicking a card opens the rental detail view. -
Cotizaciones.xhtml— Also backed byrentaUI, callingobtenerTodasLasCotizaciones(). Displays only quotation-state rentals with a client-name search filter. -
Dashboard.xhtml— Backed bydashboardBean. The time-range selector offers HOY, Últimos 30 días, or a custom N días spinner. Metrics compare the current period against the equivalent prior period and show a coloured percentage phrase (pct-green/pct-red). Charts use PrimeFaces<p:barChart>and<p:pieChart>. -
TarjetaAlmacen.xhtml— Backed bytarjetaAlmacenUI. Supports two modes toggled by buttons: Consulta por Día (singlep:datePicker) and Consulta por Rango (start + endp:datePicker). The resulting ledger table shows columns: Fecha, Movimiento (Renta #N), Concepto, Inventario Inicial, Entrada, Salida, Existencia, Precio Unitario, Debe, Haber, Saldo.
Session Management and Back-Navigation Guard
LoginBeanUI is @SessionScoped, so the usuario field persists for the entire HTTP session. Every protected page registers a preRenderView listener:
preventBackAfterLogout() sets aggressive no-cache headers and, if no valid session or user is found, redirects immediately to AutenticacionUsuario.xhtml:
Logout
CallingloginUI.logout() invalidates the Jakarta EE session and redirects to the authentication selector page:
preventBackAfterLogout() because the session and usuario are now null.
Creating the First Administrator Account
LoginBeanUI.registrarAdministrador() constructs an Administrador entity from the form fields and persists it through LoginHelper → FacadeLogin → DelegateLogin:
correo and contrasena are required by the Administrador entity.
SiCom uses Jakarta EE session invalidation for authentication — there is no JWT, OAuth, or external identity provider. The
LoginBeanUI bean is @SessionScoped, meaning the usuario object lives in the server-side HTTP session. If the application server restarts, all active sessions are lost and users must log in again. In production, passwords should be stored as BCrypt hashes rather than plain text.