Skip to content

Commit f1b107d

Browse files
committed
Merge develop into main
2 parents d3472f4 + cfd3239 commit f1b107d

4 files changed

Lines changed: 25 additions & 55 deletions

File tree

‎wise-api/pom.xml‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,34 +117,34 @@
117117
<dependency>
118118
<groupId>org.postgresql</groupId>
119119
<artifactId>postgresql</artifactId>
120-
<version>42.7.8</version>
120+
<version>42.7.10</version>
121121
</dependency>
122122
<dependency>
123123
<groupId>jakarta.xml.bind</groupId>
124124
<artifactId>jakarta.xml.bind-api</artifactId>
125-
<version>4.0.4</version>
125+
<version>4.0.5</version>
126126
</dependency>
127127

128128
<dependency>
129129
<groupId>jakarta.mail</groupId>
130130
<artifactId>jakarta.mail-api</artifactId>
131-
<version>2.2.0-M1</version>
131+
<version>2.1.3</version>
132132
</dependency>
133133
<!-- Hibernate Validator -->
134134
<dependency>
135135
<groupId>org.hibernate.validator</groupId>
136136
<artifactId>hibernate-validator</artifactId>
137-
<version>8.0.3.Final</version>
137+
<version>9.1.0.Final</version>
138138
</dependency>
139139
<dependency>
140140
<groupId>com.mysql</groupId>
141141
<artifactId>mysql-connector-j</artifactId>
142-
<version>8.4.0</version>
142+
<version>9.2.0</version>
143143
</dependency>
144144
<dependency>
145145
<groupId>org.eclipse.angus</groupId>
146146
<artifactId>jakarta.mail</artifactId>
147-
<version>2.1.0-M1</version>
147+
<version>2.0.3</version>
148148
</dependency>
149149
<!-- https://mvnrepository.com/artifact/commons-validator/commons-validator -->
150150
<dependency>
@@ -158,7 +158,7 @@
158158
<dependency>
159159
<groupId>com.zaxxer</groupId>
160160
<artifactId>HikariCP</artifactId>
161-
<version>6.3.3</version>
161+
<version>7.0.0</version>
162162
</dependency>
163163

164164
<!-- Only for test purposes -->
@@ -198,7 +198,7 @@
198198
<dependency>
199199
<groupId>org.jsoup</groupId>
200200
<artifactId>jsoup</artifactId>
201-
<version>1.21.2</version>
201+
<version>1.22.1</version>
202202
</dependency>
203203

204204
<!-- JWT dependencies -->

‎wise-api/src/main/java/com/wisemapping/service/spam/HtmlContentStrategy.java‎

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ public class HtmlContentStrategy implements SpamDetectionStrategy {
4646
private final static Logger logger = LogManager.getLogger();
4747
private final SpamContentExtractor contentExtractor;
4848

49-
@Value("${app.batch.spam-detection.html.max-elements:50}")
50-
private int maxHtmlElements;
51-
5249
@Value("${app.batch.spam-detection.html.max-ratio:0.7}")
5350
private double maxHtmlToTextRatio;
5451

@@ -107,12 +104,6 @@ public SpamDetectionResult detectSpam(SpamDetectionContext context) {
107104
return patternResult;
108105
}
109106

110-
// Check HTML element count
111-
SpamDetectionResult elementCountResult = checkHtmlElementCount(mapModel);
112-
if (elementCountResult.isSpam()) {
113-
return elementCountResult;
114-
}
115-
116107
// Check HTML to text ratio
117108
SpamDetectionResult ratioResult = checkHtmlToTextRatio(htmlContent);
118109
if (ratioResult.isSpam()) {
@@ -184,42 +175,6 @@ private SpamDetectionResult checkHtmlPatterns(String htmlContent) {
184175
return SpamDetectionResult.notSpam();
185176
}
186177

187-
/**
188-
* Checks if the HTML element count exceeds the threshold.
189-
*/
190-
private SpamDetectionResult checkHtmlElementCount(MapModel mapModel) {
191-
long htmlElementCount = countHtmlElements(mapModel);
192-
193-
if (htmlElementCount > maxHtmlElements) {
194-
return new SpamDetectionResult(true,
195-
"Excessive HTML elements detected",
196-
String.format("Found %d HTML elements, threshold: %d", htmlElementCount, maxHtmlElements),
197-
SpamStrategyType.HTML_CONTENT);
198-
}
199-
200-
return SpamDetectionResult.notSpam();
201-
}
202-
203-
/**
204-
* Counts HTML elements in the mindmap model.
205-
* Only counts suspicious/non-formatting HTML elements, excluding common text
206-
* formatting tags.
207-
*/
208-
private long countHtmlElements(MapModel mapModel) {
209-
long count = 0;
210-
211-
// Count HTML tags in all notes
212-
for (Topic topic : mapModel.getAllTopics()) {
213-
String note = topic.getNote();
214-
if (note != null && !note.trim().isEmpty() && contentExtractor.isHtmlContent(note)) {
215-
// Count only suspicious HTML tags (exclude text formatting tags)
216-
count += countSuspiciousHtmlElements(note);
217-
}
218-
}
219-
220-
return count;
221-
}
222-
223178
/**
224179
* Counts only suspicious HTML elements, excluding common text formatting tags.
225180
* Text formatting tags (h1-h6, p, b, strong, i, em, u, ul, ol, li, br, span,
@@ -260,7 +215,8 @@ private long countSuspiciousHtmlElements(String htmlContent) {
260215
"cite", "q", // Citations and quotes
261216
"time", // Time elements
262217
"wbr", // Word break opportunities
263-
"img" // Images - handled by HtmlContentValidator, not considered spam here
218+
"img", // Images - handled by HtmlContentValidator, not considered spam here
219+
"font" // Font styling
264220
);
265221

266222
long suspiciousCount = 0;

‎wise-api/src/main/resources/application.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ app:
229229
enabled: false # Disable DescriptionLengthStrategy (can be re-enabled per environment)
230230
startup-enabled: false # Enable spam detection on application startup (async)
231231
months-back: 60 # Only process mindmaps created in the last 60 months
232-
version: 8 # Current spam detection version - increment this to skip processing mindmaps with higher or equal version
232+
version: 9 # Current spam detection version - increment this to skip processing mindmaps with higher or equal version
233233
service-directory:
234234
keyword-stuffing-separators: 25 # Number of separator characters (pipes, commas) indicating keyword stuffing
235235
location-variants: 8 # Number of distinct location variants (cities, neighborhoods) indicating keyword stuffing
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"jsonProps": "{\"zoom\":0.8}",
3+
"title": "Graficacndo mi PLE intergaláctico",
4+
"isLockedBy": null,
5+
"creatorFullName": "Francisco Evangelista",
6+
"role": "none",
7+
"description": " ",
8+
"createdBy": "faed893@gmail.com",
9+
"creationTime": "2026-02-14T14:49:45Z",
10+
"lastModificationBy": "Francisco Evangelista",
11+
"lastModificationTime": "2026-02-15T17:40:16Z",
12+
"xml": "<map name=\"2013730\" theme=\"prism\" layout=\"tree\" version=\"tango\"><topic central=\"true\" text=\"Graficacndo mi PLE intergaláctico\" id=\"1\"><topic position=\"-552,109\" order=\"0\" text=\"Búsqueda de la información \" id=\"2\"><topic position=\"-552,215\" order=\"0\" text=\"Khan Academy \" id=\"9\"><link url=\"https://es.khanacademy.org/math\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Ofrece lecciones interactivas, videos instructivos y ejercicios con retroalimentación.</font></font>]]></note><topic position=\"-552,319\" order=\"0\" text=\"YOUTUBEls \" id=\"10\"><link url=\"https://www.youtube.com/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Aquí los estudiantes pueden observar vídeos con ejemplos sobre los temas de matemáticas</font></font>]]></note><topic position=\"-552,423\" order=\"0\" text=\"Matematicasonline. \" id=\"11\"><link url=\"https://www.matematicasonline.es/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una pagina que contiene lecciones y actividades de matemáticas.&nbsp;</font></font>]]></note><topic position=\"-552,527\" order=\"0\" text=\"matefacil \" id=\"12\"><link url=\"https://www.youtube.com/@MateFacilYT\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es un canal de tutoriales de matemáticas.</font></font>]]></note></topic></topic></topic></topic></topic><topic position=\"-374,109\" order=\"1\" text=\"Publicar\" id=\"6\"><topic position=\"-374,215\" order=\"0\" text=\"Clasrroom\" id=\"44\"><link url=\"https://classroom.google.com/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<span style=\"letter-spacing: 0.15008px;\"><font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una plataforma educativa gratuita diseñada para gestionar aulas.</font></font></span>]]></note><topic position=\"-374,319\" order=\"0\" text=\"Canva\" id=\"45\"><link url=\"https://www.canva.com/ai\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<span style=\"letter-spacing: 0.15008px;\"><font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una herramienta de diseño y publicación online que tiene como misión poner el poder del diseño al alcance de todo el mundo.</font></font></span>]]></note><topic position=\"-374,423\" order=\"0\" text=\"Gmail\" id=\"46\"><link url=\"http://e.google.com/intl/es-419/gmail/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<span style=\"letter-spacing: 0.15008px;\"><font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es un servicio de correo electrónico de Google.</font></font></span>]]></note><topic position=\"-374,527\" order=\"0\" text=\"WhatsApp\" id=\"47\"><link url=\"https://web.whatsapp.com/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<span style=\"letter-spacing: 0.15008px;\"><font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una aplicación gratuita de mensajes y videollamadas.</font></font></span>]]></note></topic></topic></topic></topic></topic><topic position=\"-107,109\" order=\"2\" text=\"Almacenamiento y creación/generación de contenido \" id=\"5\"><topic position=\"-107,215\" order=\"0\" text=\"Classroom \" id=\"26\"><link url=\"https://classroom.google.com/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una plataforma educativa gratuita diseñada para gestionar aulas.</font></font>]]></note><topic position=\"-107,319\" order=\"0\" text=\"Genially \" id=\"27\"><link url=\"https://app.genially.com/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una herramienta en linea multimedia para crear contenido interactivo.</font></font>]]></note><topic position=\"-107,423\" order=\"0\" text=\"Canva \" id=\"28\"><link url=\"https://www.canva.com/ai\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una herramienta de diseño y publicación online que tiene como misión poner el poder del diseño al alcance de todo el mundo.</font></font></font></font>]]></note><topic position=\"-107,527\" order=\"0\" text=\"Google drive \" id=\"29\"><link url=\"https://drive.google.com/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es un servicio de almacenamiento en la nube propiedad de Google.</font></font>]]></note></topic></topic></topic></topic></topic><topic position=\"212,109\" order=\"3\" text=\"Comunicación con los demás \" id=\"4\"><topic position=\"212,215\" order=\"0\" text=\"WhatsApp\" id=\"20\"><link url=\"https://web.whatsapp.com/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">&nbsp;Es una aplicación gratuita de mensajes y videollamadas.</font></font></font></font>]]></note><topic position=\"212,319\" order=\"0\" text=\"Intagram \" id=\"21\"><link url=\"https://www.instagram.com/?flo=true\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una red social enfocada en fotos y video</font></font>]]></note><topic position=\"212,423\" order=\"0\" text=\"Gmail \" id=\"22\"><link url=\"https://workspace.google.com/intl/es-419/gmail/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es un servicio de correo electrónico de Google.</font></font></font></font>]]></note><topic position=\"212,527\" order=\"0\" text=\"Facebook\" id=\"23\"><link url=\"https://www.facebook.com/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">&nbsp;Es una red social creada para mantener en contacto a personas, y que éstas puedan compartir información, noticias y contenidos audiovisuales.</font></font>]]></note></topic></topic></topic></topic></topic><topic position=\"424,109\" order=\"4\" text=\"Filtrado y organización \" id=\"3\"><topic position=\"424,215\" order=\"0\" text=\"Scoop.it \" id=\"13\"><link url=\"https://www.scoop.it/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una herramienta para buscar y seleccionar contenidos.</font></font>]]></note><topic position=\"424,319\" order=\"0\" text=\"zotero \" id=\"15\"><link url=\"https://www.zotero.org/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es un gestor bibiográfico de código abierto.</font></font>]]></note><topic position=\"424,423\" order=\"0\" text=\"Trello \" id=\"16\"><link url=\"https://trello.com/u/franciscoevangelista9/boards\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una herramienta flexible para gestión de trabajos.</font></font>]]></note><topic position=\"424,527\" order=\"0\" text=\"Padlet \" id=\"18\"><link url=\"https://padlet.com/dashboard/make?mobile_page=LayoutPicker\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es una plataforma en línea que permite a los usuarios confeccionar espacios digitales interactivos denominados “muros”</font></font>]]></note></topic></topic></topic></topic></topic><topic position=\"593,109\" order=\"5\" text=\"Colaborar \" id=\"7\"><topic position=\"593,215\" order=\"0\" text=\"Google Drive \" id=\"48\"><link url=\"https://drive.google.com/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Permite crear documentos y presentaciones colaborativas en línea</font></font>]]></note><topic position=\"593,319\" order=\"0\" text=\"Padlet \" id=\"49\"><link url=\"https://padlet.com/dashboard/make?mobile_page=LayoutPicker\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Permite trabajar muros colaborativos&nbsp;</font></font>]]></note><topic position=\"593,423\" order=\"0\" text=\"Canva \" id=\"50\"><link url=\"https://www.canva.com/ai\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Es ideal para crear presentaciones y vídeos colaborativos.</font></font>]]></note><topic position=\"593,527\" order=\"0\" text=\"Genilly \" id=\"51\"><link url=\"https://app.genially.com/\" urlType=\"url\"/><note contentType=\"html\"><![CDATA[<font dir=\"auto\" style=\"vertical-align: inherit;\"><font dir=\"auto\" style=\"vertical-align: inherit;\">Permite crear presentaciones colaborativas.</font></font>]]></note></topic></topic></topic></topic></topic></topic></map>",
13+
"public": false
14+
}

0 commit comments

Comments
 (0)