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.

CulturarteWeb features a social follow system that lets any registered user subscribe to another user’s activity. The system is fully AJAX-driven: the follow and unfollow actions are triggered from JavaScript without a full-page reload, and the follow icon on profile pages updates dynamically to reflect the current relationship. The follow graph is persisted by the back-end SOAP web service and is consulted in real time whenever a profile page loads.

POST /Seguir

Creates a follow relationship between two users — the seguidor (follower) begins following the seguido (followed user).

Request parameters

seguidor
string
required
The nickname of the user who wants to follow someone (the logged-in user initiating the action).
seguido
string
required
The nickname of the user to be followed (the profile being visited).

Behavior

  1. Reads service coordinates from config.properties and instantiates ControllerWS_Service.
  2. Calls portU.seguir(seguidor, seguido) on the SOAP back-end.
  3. Returns a JSON response indicating whether the operation succeeded.

Response (JSON)

{ "resp": true }
{ "resp": false }

Example

curl -X POST "http://localhost:8080/CulturarteWeb/Seguir" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Cookie: JSESSIONID=<your-session-id>" \
  -d "seguidor=alice&seguido=bob"

JavaScript client (Seguir.js)

The front-end calls this endpoint using the seguir() async function defined in JS/Seguir.js. On a successful response (data.resp === true) it immediately invokes actualizarIcono() to swap the UI button from “Follow” to “Unfollow” without reloading the page.
async function seguir(seguidor, objetivo, contenedorIcono, accion) {
  const datos = new URLSearchParams();
  datos.append('seguidor', seguidor);
  datos.append('seguido', objetivo);

  const resp = await fetch('Seguir', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: datos
  });

  const data = await resp.json();

  if (data.resp) {
    actualizarIcono(seguidor, objetivo, contenedorIcono);
  }
}
The Content-Type must be application/x-www-form-urlencoded. The servlet reads seguidor and seguido via request.getParameter() and does not accept JSON request bodies.

POST /DejarDeSeguir

Removes an existing follow relationship between two users.

Request parameters

seguidor
string
required
The nickname of the user who wants to unfollow (the logged-in user).
seguido
string
required
The nickname of the user to unfollow.

Behavior

  1. Reads service coordinates from config.properties and instantiates ControllerWS_Service.
  2. Calls portU.unFollowUser(seguidor, seguido) on the SOAP back-end.
  3. Returns a JSON response indicating whether the operation succeeded.

Response (JSON)

{ "resp": true }
{ "resp": false }

Example

curl -X POST "http://localhost:8080/CulturarteWeb/DejarDeSeguir" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Cookie: JSESSIONID=<your-session-id>" \
  -d "seguidor=alice&seguido=bob"

JavaScript client (DejarDeSeguir.js)

The front-end calls this endpoint using dejarDeSeguir() defined in JS/DejarDeSeguir.js. The function handles two distinct UI contexts via the accion parameter:
  • "Perfil" — the user is on someone’s profile page; on success, actualizarIcono() is called to swap the icon back to “Follow”.
  • "Seguidos" — the user is on the “Users I Follow” list; on success, the card for the unfollowed user is removed from the DOM entirely.
async function dejarDeSeguir(seguidor, objetivo, tarjetaPadre, contenedorIcono, accion) {
  const datos = new URLSearchParams();
  datos.append('seguidor', seguidor);
  datos.append('seguido', objetivo);

  const resp = await fetch('DejarDeSeguir', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: datos
  });

  const data = await resp.json();

  if (data.resp) {
    if (accion === "Perfil") {
      actualizarIcono(seguidor, objetivo, contenedorIcono);
    } else if (accion === "Seguidos") {
      contenedorTarjetas.removeChild(tarjetaPadre);
    }
  }
}

GET /SigueAUsuario

Checks whether a given user currently follows another. Used on page load to determine which icon (Follow or Unfollow) to render on a profile page.

Request parameters

seguidor
string
required
The nickname of the user whose follow state is being checked (typically the logged-in user).
seguido
string
required
The nickname of the user being checked against (the profile being viewed).

Behavior

  1. Reads service coordinates from config.properties and instantiates ControllerWS_Service.
  2. Calls portU.sigueAUsuario(seguidor, seguido) on the SOAP back-end, which returns a boolean.
  3. Returns a JSON response with the key "seguido".

Response (JSON)

{ "seguido": true }
{ "seguido": false }

Example

curl -X GET "http://localhost:8080/CulturarteWeb/SigueAUsuario?seguidor=alice&seguido=bob" \
  -H "Cookie: JSESSIONID=<your-session-id>"

JavaScript client (MostrarIconoSeguirODejarDeSeguir.js)

On DOMContentLoaded, the profile page runs the following logic to decide which icon to show. The global JS variables USUARIO_OBJETIVO (the profile owner’s nick) and USUARIO_LOGUEADO (the session user’s nick) are injected server-side by the JSP.
document.addEventListener('DOMContentLoaded', function () {
  const objetivo  = USUARIO_OBJETIVO;   // injected by perfilUsuario.jsp
  const seguidor  = USUARIO_LOGUEADO;   // injected by perfilUsuario.jsp
  const contenedorIcono = document.getElementById('iconoSeguir');

  if (seguidor && seguidor !== "null") {
    // actualizarIcono internally calls GET /SigueAUsuario
    actualizarIcono(seguidor, objetivo, contenedorIcono, false);
  }
});
The iconoSeguir container is only rendered by the JSP when the logged-in user is not the profile owner. If USUARIO_LOGUEADO equals USUARIO_OBJETIVO, no icon is shown and this script has no effect.

GET /Seguidores

Retrieves the list of all users who follow a given user and forwards to the followers view.

Request parameters

nick
string
required
The nickname of the user whose followers you want to list.
tipo
string
The account type of the profile user (Proponente or Colaborador). Passed through to the JSP for navigation context.

Behavior

  1. Calls portU.getSeguidores(nick) on the SOAP back-end.
  2. Returns a List<DtoUsuario> of all users following nick.
  3. Sets the following request attributes:
AttributeTypeDescription
SeguidoresList<DtoUsuario>Users who follow nick
nickStringThe queried user’s nickname
tipoStringThe queried user’s account type
paginaStringAlways "Seguidores" — used by the shared nav component
  1. Forwards to /Seguidores.jsp.

JSP rendering

Seguidores.jsp iterates over the Seguidores list and renders a card for each follower showing their avatar and a clickable link to PerfilUsuario?nick=…&tipo=….

Example

curl -X GET "http://localhost:8080/CulturarteWeb/Seguidores?nick=bob&tipo=Proponente" \
  -H "Cookie: JSESSIONID=<your-session-id>"

GET /UsuariosSeguidos

Retrieves the list of all users that a given user is following and forwards to the following view.

Request parameters

nick
string
required
The nickname of the user whose following list you want to view.
tipo
string
The account type of the profile user. Passed through to the JSP for navigation context.

Behavior

  1. Calls portU.seguidos(nick) on the SOAP back-end.
  2. Returns a List<DtoUsuario> of all users that nick is currently following.
  3. Sets the following request attributes:
AttributeTypeDescription
UsuariosSeguidosList<DtoUsuario>Users that nick follows
nickStringThe queried user’s nickname
tipoStringThe queried user’s account type
paginaStringAlways "Seguidos" — used by the shared nav component
  1. Forwards to /UsuarioSeguidos.jsp.

Example

curl -X GET "http://localhost:8080/CulturarteWeb/UsuariosSeguidos?nick=alice&tipo=Colaborador" \
  -H "Cookie: JSESSIONID=<your-session-id>"
From the /UsuarioSeguidos.jsp view, the logged-in user can unfollow any of the listed users. The unfollow action calls POST /DejarDeSeguir with accion="Seguidos", which removes the corresponding card from the DOM without a full-page reload.

Build docs developers (and LLMs) love