Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/17Franco/CulturarteWeb/llms.txt

Use this file to discover all available pages before exploring further.

A Colaboracion (Collaboration) is a financial pledge made by an authenticated Colaborador to fund a cultural proposal. When a Colaborador visits a proposal’s detail page and decides to back it, they choose a return type and an amount — this creates a Colaboracion record linked to both the Colaborador and the Propuesta. Collaborations are the financial backbone of CulturarteWeb: they drive proposals from the funding phase through to execution.

Collaboration Fields

The following fields are defined in the Colaboracion database table:
ColumnTypeDescription
idbigint (auto-increment)Unique identifier for the collaboration
montointAmount pledged by the Colaborador in local currency
tipoRetornoenumThe return the Colaborador expects: EntradaGratis or PorcentajeGanancia
colaboradorvarchar(255)Nickname of the Colaborador (FK → Colaborador.nickname)
propuestavarchar(255)Title of the proposal being funded (FK → Propuesta.Titulo)
creadodateDate the collaboration was created
-- Example collaborations from the seed data
SELECT id, monto, tipoRetorno, colaborador, propuesta, creado
FROM Colaboracion
WHERE propuesta = 'Pilsen Rock';
-- id=11  monto=50000   tipoRetorno=EntradaGratis    colaborador=chino
-- id=12  monto=120000  tipoRetorno=PorcentajeGanancia colaborador=novick
-- id=13  monto=120000  tipoRetorno=EntradaGratis    colaborador=tonyp

Submitting a Collaboration

An authenticated Colaborador submits a new collaboration directly from the proposal detail page. Endpoint: POST /DetallesDePropuesta The DetallesDePropuestaServlet.doPost method handles collaboration submission as one of several possible actions. The accion parameter determines what happens:
accion valueServlet result codeMeaning
(collaboration action)4Colaborador submits a new collaboration
(comment action)1User posts a comment
(cancel action)2Proponente cancels the proposal
(extend action)3Proponente extends the financing period
Required form parameters for a collaboration:
ParameterDescription
tituloPropuestaTitle of the proposal being funded
montoAmount to pledge
tipoRetornoEntradaGratis or PorcentajeGanancia
accionAction discriminator passed from the JSP form
After the action the servlet redirects to:
GET /DetallesDePropuesta?id=<titulo>&resultadoOperacion=4&accionLograda=colaborado+en

Listing a User’s Collaborations

Endpoint: GET /Colaboraciones?nick=<nick>&tipo=<tipo> Retrieves all collaborations made by the specified user. The list is forwarded to Colaboraciones.jsp for display in the user’s profile area.
List<DtoColaboracion> p = portU.colaboraciones(usrPerfil);
request.setAttribute("Colaboraciones", p);
request.getRequestDispatcher("/Colaboraciones.jsp").forward(request, response);

Withdrawing a Collaboration

Endpoint: DELETE /bajaColaboracion?id=<id> A Colaborador can cancel a collaboration before payment has been processed. The servlet calls cancelarColaboracion(Long id) on the web service and returns a JSON response.
// Success
{ "resp": true }

// Failure
{ "resp": false, "error": "<error message>" }
A collaboration cannot be withdrawn after it has been paid. Payment is irreversible — once acreditarColaboracion is called, the datosPago field is populated and the collaboration is considered settled. The /bajaColaboracion endpoint will fail if payment data already exists.

Payment Flow

The Proponente initiates payment on behalf of the collaborator using the collaboration’s ID. Payments are tracked via a DtoPago object containing the payment method and relevant financial details.
1

Proponente lists pending payments

Navigate to GET /ListarColaboracionesAPagar?nick=<nick>&tipo=<tipo>. The servlet retrieves all collaborations for the user, removes any associated with CANCELADA proposals, and filters down to those where datosPago == null (i.e. not yet paid). The list is forwarded to PagarColaboracionDesktop.jsp (desktop) or PagarColaboracion.jsp (mobile).
2

Open the payment form

Navigate to GET /PagarColaboracion?tituloPropuesta=<titulo>. The servlet looks up the collaboration matching the proposal title for the logged-in user and forwards to pago.jsp with the collaboration details pre-populated.
3

Submit payment

POST /PagarColaboracion with the following parameters:
ParameterDescription
tituloPropuestaTitle of the proposal being paid for
montoPayment amount (must be ≥ the collaboration’s pledged amount)
formaPagoPayment method identifier
dato1dato5Additional payment data fields (e.g. card number, expiry, CVV, etc.)
// Payment is only credited if the provided monto >= collaboration monto
if (monto >= colabEncontrada.getMonto()) {
    pagoExitoso = controllerPort.acreditarColaboracion(
        colabEncontrada.getId(), datosPago
    );
}
On success, resultadoOperacion = 5 and the user is redirected to the proposal detail page with accionLograda=acreditado+el+pago+en.
4

Generate a payment certificate

After a successful payment, the Colaborador can generate a downloadable PDF certificate confirming their collaboration (see section below).

Certificate (Constancia) Generation

Once a collaboration has been paid, a PDF certificate can be generated to formally confirm the collaboration details. Endpoint: POST /GenerarConstancia
ParameterDescription
idColaboracionThe id of the paid collaboration
The servlet calls portU.generarPDF(idColaboracion) on the web service, which returns the certificate as a Base64-encoded string. The servlet decodes it and streams the raw PDF bytes directly to the browser.
Long idColaboracion = Long.parseLong(request.getParameter("idColaboracion"));
String pdfFile = portU.generarPDF(idColaboracion);
byte[] pdfByte = Base64.getDecoder().decode(pdfFile);

response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "inline; filename=documento.pdf");
response.setContentLength(pdfByte.length);
// PDF bytes written to response output stream
The browser receives the PDF inline with the filename documento.pdf. If the web service returns an empty string, a 500 Internal Server Error is returned instead.
The /GenerarConstancia endpoint only works for collaborations that have already been paid (datosPago is not null). Attempting to generate a certificate for an unpaid collaboration will cause the web service to return an empty or invalid response.

Return Types at a Glance

Choosing the right return type depends on what the Colaborador values:
  • EntradaGratis is ideal when the Colaborador primarily wants to attend the event. The financial contribution is treated as a ticket purchase in advance, and no monetary return is expected.
  • PorcentajeGanancia is better for Colaboradores who see the event as an investment. If the event sells well, they receive a share of the profits proportional to their contribution. This return type carries more risk but can yield a financial reward.
A proposal can offer both types at once, so Colaboradores are never forced to choose just one model across all their funding activity.

Build docs developers (and LLMs) love