Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT Fix tooltip rebase bt5 #480

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9605af0
Added Boostrap 5 webjar dependency
litvinovg May 24, 2024
ef59d70
rebase to bootstrap5 pr
milospp Dec 3, 2024
fed943f
Removed Qtip libraries and modifies style for tooltip
milospp Jan 30, 2024
f080db9
Fixed position of download popup
milospp Jan 30, 2024
82ee4ec
Fixed popper for Vitro, Nemo and Tenderfoot themes
milospp Feb 12, 2024
86760b1
Fixed tooltip design and nemo theme search results page
milospp Feb 13, 2024
7e2e4ad
Removed !important tags
milospp Nov 19, 2024
9256f0a
Fixed opacity difference
milospp Nov 19, 2024
0376451
Created tooltip css for everytheme to reduce reduntant code
milospp Nov 19, 2024
4f16acc
Renamed vivoToolip to vitroTooltip
milospp Nov 19, 2024
890d122
Refactored code
milospp Nov 19, 2024
564862e
Added permissions required to upload images
litvinovg May 29, 2024
8275e63
Avoid duplicate statements in CONSTRUCT query to improve perfomance
litvinovg Apr 22, 2024
4d7a725
refact: removed not used method parameter
litvinovg May 7, 2024
4aabf69
refact: replaced SparqlGraph.sparqlNodeDelete with sparqlNodeDelete
litvinovg May 7, 2024
1ffc9a2
Fixed SparqlSelectQueryResultsChecker
litvinovg Mar 15, 2024
c7f71b4
Disallow forms (with CAPTCHA) to bots (#438)
chenejac Jun 14, 2024
7b5490a
fix: DataAutoCompleteController
litvinovg Jan 15, 2024
8aef4ef
IndividualListController, AutocompleteController
litvinovg Jan 15, 2024
1134755
refactored SearchFiltering methods to get rid of VitroRequest paramet…
litvinovg Jan 18, 2024
143da5f
Apply search filters in DefaultDataPropertyFormGenerator
litvinovg Jan 18, 2024
4765c47
removed unused import
litvinovg Jan 18, 2024
d499317
reverted changes that break language filtering
litvinovg Apr 22, 2024
69d2636
Translated SPARQL interface to DE
hauschke Jun 19, 2024
3789095
Update home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttim…
hauschke Jun 20, 2024
b54b9fa
Update home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttim…
hauschke Jun 20, 2024
2bb32fc
Update home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttim…
hauschke Jun 20, 2024
08db9f4
Avoid lock on graph uri update in rdfServiceSparql
litvinovg Nov 1, 2023
8c87fb1
delete duplicate variable initialization
litvinovg Nov 1, 2023
3fdb20d
fix identation
litvinovg Nov 3, 2023
4c506ba
refact: extracted method to update graph URIs in RDFServiceImpl
litvinovg Nov 3, 2023
b025626
style: fixed layout, removed files from checkstyle suppressions
litvinovg Nov 3, 2023
9b45c07
fix: reset rebuildGraphUriCache flag at start of graphUriRebuild to a…
litvinovg Jun 20, 2024
76df49e
[maven-scm-plugin] prepare release vitro-1.15.0
chenejac Sep 6, 2024
abc942c
[maven-scm-plugin] prepare release vitro-1.15.1-SNAPSHOT
chenejac Sep 6, 2024
678d6a0
Enable tinyMCE for fixed html pages
litvinovg Mar 26, 2024
2c98787
fixes
litvinovg Sep 13, 2024
fceb614
VIVO-4000 Removed text from csv export template. Added date and site …
litvinovg Sep 9, 2024
f761306
fixes for file name
litvinovg Sep 26, 2024
014c4b3
fixed autocompletion cache
litvinovg Sep 24, 2024
196d6c3
Support Unicode characters in reconciliation API (#476)
litvinovg Nov 7, 2024
5de0542
Adding bootstrap-5.3.2
milospp Nov 20, 2024
5639f5c
Added padding in tooltip
milospp Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<groupId>org.vivoweb</groupId>
<artifactId>vitro-api</artifactId>
<version>1.14.1-SNAPSHOT</version>
<version>1.15.1-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-project</artifactId>
<version>1.14.1-SNAPSHOT</version>
<version>1.15.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down Expand Up @@ -88,7 +88,7 @@
<dependency>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-dependencies</artifactId>
<version>1.14.1-SNAPSHOT</version>
<version>1.15.1-SNAPSHOT</version>
<type>pom</type>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static boolean sparqlSelectQueryResultsContain(Check check, Authorization
AccessObject ao = ar.getAccessObject();
Model m = ao.getModel();
if (m == null) {
log.debug("SparqlQueryContains model is not provided");
log.error("Model not provided");
return false;
}

Expand Down Expand Up @@ -116,10 +116,11 @@ private static Set<String> getSparqlSelectResults(Model model, String profileUri
AuthorizationRequest ar) {
HashMap<String, Set<String>> queryMap = QueryResultsMapCache.get();
String queryMapKey = createQueryMapKey(profileUri, queryTemplate, ar);
HashSet<String> results = new HashSet<>();
if (queryMap.containsKey(queryMapKey)) {
return queryMap.get(queryMapKey);
results.addAll(queryMap.get(queryMapKey));
return results;
}
Set<String> results = new HashSet<>();
ParameterizedSparqlString pss = new ParameterizedSparqlString();
pss.setCommandText(queryTemplate);
setVariables(profileUri, ar, pss);
Expand All @@ -140,7 +141,9 @@ private static Set<String> getSparqlSelectResults(Model model, String profileUri
queryExecution.close();
}
debug("query results: " + results);
queryMap.put(queryMapKey, results);
Set<String> queryMapValue = new HashSet<>();
queryMapValue.addAll(results);
queryMap.put(queryMapKey, queryMapValue);
QueryResultsMapCache.update(queryMap);
return results;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;

import javax.servlet.annotation.WebServlet;

Expand All @@ -28,6 +29,8 @@
import edu.cornell.mannlib.vitro.webapp.i18n.I18n;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngineException;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchQuery;
import edu.cornell.mannlib.vitro.webapp.search.controller.SearchFilter;
import edu.cornell.mannlib.vitro.webapp.search.controller.SearchFiltering;
import edu.cornell.mannlib.vitro.webapp.utils.searchengine.SearchQueryUtils;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.ListedIndividual;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.ListedIndividualBuilder;
Expand Down Expand Up @@ -188,15 +191,15 @@ private static IndividualListResults buildAndExecuteVClassQuery(List<String> cla
boolean languageFilter = Boolean.valueOf(props.getProperty(LANGUAGE_FILTER_PROPERTY, "false"));
IndividualListQueryResults results = buildAndExecuteVClassQuery(classUris, alpha,
((languageFilter) ? vreq.getLocale() : null), page, pageSize,
vreq.getWebappDaoFactory().getIndividualDao());
vreq);
IndividualListResults indListResults = getResultsForVClassQuery(results, page, pageSize, alpha, vreq);
return indListResults;
}

public static IndividualListResults getRandomResultsForVClass(String vclassURI, int page, int pageSize, VitroRequest vreq) {
try{
List<String> classUris = Collections.singletonList(vclassURI);
IndividualListQueryResults results = buildAndExecuteRandomVClassQuery(classUris, page, pageSize, vreq.getWebappDaoFactory().getIndividualDao());
IndividualListQueryResults results = buildAndExecuteRandomVClassQuery(classUris, page, pageSize, vreq);
return getResultsForVClassQuery(results, page, pageSize, "", vreq);
} catch(Throwable th) {
log.error("An error occurred retrieving random results for vclass query", th);
Expand All @@ -216,9 +219,12 @@ private static IndividualListResults getResultsForVClassQuery(IndividualListQuer

private static IndividualListQueryResults buildAndExecuteVClassQuery(
List<String> vclassURIs, String alpha, Locale locale, int page,
int pageSize, IndividualDao indDao)
int pageSize, VitroRequest vreq)
throws SearchEngineException {
IndividualDao indDao = vreq.getWebappDaoFactory().getIndividualDao();
SearchQuery query = SearchQueryUtils.getQuery(vclassURIs, alpha, locale, page, pageSize);
Set<String> currentRoles = SearchFiltering.getCurrentUserRoles(vreq);
SearchFiltering.addDefaultFilters(query, currentRoles);
IndividualListQueryResults results = IndividualListQueryResults.runQuery(query, indDao);
log.debug("Executed search query for " + vclassURIs);
if (results.getIndividuals().isEmpty()) {
Expand All @@ -228,9 +234,12 @@ private static IndividualListQueryResults buildAndExecuteVClassQuery(
}

private static IndividualListQueryResults buildAndExecuteRandomVClassQuery(
List<String> vclassURIs, int page, int pageSize, IndividualDao indDao)
List<String> vclassURIs, int page, int pageSize, VitroRequest vreq)
throws SearchEngineException {
IndividualDao indDao = vreq.getWebappDaoFactory().getIndividualDao();
SearchQuery query = SearchQueryUtils.getRandomQuery(vclassURIs, page, pageSize);
Set<String> currentRoles = SearchFiltering.getCurrentUserRoles(vreq);
SearchFiltering.addDefaultFilters(query, currentRoles);
IndividualListQueryResults results = IndividualListQueryResults.runQuery(query, indDao);
log.debug("Executed search query for " + vclassURIs);
if (results.getIndividuals().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package edu.cornell.mannlib.vitro.webapp.controller.grefine;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
Expand All @@ -11,7 +12,6 @@
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand Down Expand Up @@ -70,6 +70,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doGet(req, resp);
resp.setContentType("application/json");
resp.setCharacterEncoding("UTF-8");
VitroRequest vreq = new VitroRequest(req);

try {
Expand All @@ -81,7 +82,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
.toString() : vreq.getParameter("callback") + "("
+ qJson.toString() + ")";
// System.out.println("JSONReconcileServlet result: " + responseStr);
ServletOutputStream out = resp.getOutputStream();
PrintWriter out = resp.getWriter();
out.print(responseStr);
} else { // metadata
String defaultNamespace = null;
Expand All @@ -97,7 +98,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
ObjectNode metaJson = getMetadata(req, resp, defaultNamespace, defaultTypeList, serverName, serverPort);
String callbackStr = (vreq.getParameter("callback") == null) ? ""
: vreq.getParameter("callback");
ServletOutputStream out = resp.getOutputStream();
PrintWriter out = resp.getWriter();
out.print(callbackStr + "(" + metaJson.toString() + ")");
}
} catch (Exception ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

package edu.cornell.mannlib.vitro.webapp.dao.jena;

import static edu.cornell.mannlib.vitro.webapp.dao.jena.SparqlGraph.sparqlNode;
import static edu.cornell.mannlib.vitro.webapp.dao.jena.SparqlGraph.sparqlNodeDelete;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
Expand Down Expand Up @@ -565,25 +568,45 @@ private static List<Statement> sort(List<Statement> stmts) {

private static void addStatementPatterns(List<Statement> stmts,
StringBuffer patternBuff, boolean whereClause) {
Set<String> lines = new HashSet<>();
for(Statement stmt : stmts) {
Triple t = stmt.asTriple();
patternBuff.append(SparqlGraph.sparqlNodeDelete(t.getSubject(), null));
patternBuff.append(" ");
patternBuff.append(SparqlGraph.sparqlNodeDelete(t.getPredicate(), null));
patternBuff.append(" ");
patternBuff.append(SparqlGraph.sparqlNodeDelete(t.getObject(), null));
patternBuff.append(" .\n");
String lineWithoutVars = getLine(t, false);
if (lines.contains(lineWithoutVars)) {
continue;
} else {
lines.add(lineWithoutVars);
}
patternBuff.append(getLine(t, true));
if (whereClause) {
if (t.getSubject().isBlank()) {
patternBuff.append(" FILTER(isBlank(").append(
SparqlGraph.sparqlNodeDelete(t.getSubject(), null)).append(")) \n");
sparqlNodeDelete(t.getSubject(), null)).append(")) \n");
}
if (t.getObject().isBlank()) {
patternBuff.append(" FILTER(isBlank(").append(
SparqlGraph.sparqlNodeDelete(t.getObject(), null)).append(")) \n");
sparqlNodeDelete(t.getObject(), null)).append(")) \n");
}
}
}
}

private static String getLine(Triple t, boolean createBlankNodeVariables) {
if (createBlankNodeVariables) {
return sparqlNodeDelete(t.getSubject(), null) +
" " +
sparqlNodeDelete(t.getPredicate(), null) +
" " +
sparqlNodeDelete(t.getObject(), null) +
" .\n";
} else {
return sparqlNode(t.getSubject(), null) +
" " +
sparqlNode(t.getPredicate(), null) +
" " +
sparqlNode(t.getObject(), null) +
" .\n";
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators;

import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.LANGUAGE_NEUTRAL;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.POLICY_NEUTRAL;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.DISPLAY;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpSession;

Expand Down Expand Up @@ -45,6 +44,7 @@
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchResponse;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchResultDocumentList;
import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames;
import edu.cornell.mannlib.vitro.webapp.search.controller.SearchFiltering;
import edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils;
import edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode;

Expand Down Expand Up @@ -187,7 +187,7 @@ private boolean tooManyRangeOptions(VitroRequest vreq, HttpSession session ) thr
if(types.size() == 0 ){
types.add(VitroVocabulary.OWL_THING);
}

Set<String> currentRoles = SearchFiltering.getCurrentUserRoles(vreq);
long count = 0;
for( String type:types){
//search query for type count.
Expand All @@ -198,6 +198,7 @@ private boolean tooManyRangeOptions(VitroRequest vreq, HttpSession session ) thr
query.setQuery( VitroSearchTermNames.RDFTYPE + ":" + type);
}
query.setRows(0);
SearchFiltering.addDefaultFilters(query, currentRoles);
SearchResponse rsp = searchEngine.query(query);
SearchResultDocumentList docs = rsp.getResults();
long found = docs.getNumFound();
Expand Down Expand Up @@ -549,9 +550,9 @@ public void addFormSpecificDataForAC(EditConfigurationVTwo editConfiguration, Vi
String objectLabel = EditConfigurationUtils.getObjectIndividual(vreq).getName();
formSpecificData.put("objectLabel", objectLabel);
}

Set<String> currentRoles = SearchFiltering.getCurrentUserRoles(vreq);
//TODO: find out if there are any individuals in the classes of objectTypes
formSpecificData.put("rangeIndividualsExist", rangeIndividualsExist(types) );
formSpecificData.put("rangeIndividualsExist", rangeIndividualsExist(types, currentRoles) );

formSpecificData.put("sparqlForAcFilter", getSparqlForAcFilter(vreq));
if(customErrorMessages != null && !customErrorMessages.isEmpty()) {
Expand All @@ -561,7 +562,7 @@ public void addFormSpecificDataForAC(EditConfigurationVTwo editConfiguration, Vi
editConfiguration.setFormSpecificData(formSpecificData);
}

private Object rangeIndividualsExist(List<VClass> types) throws SearchEngineException {
private Object rangeIndividualsExist(List<VClass> types, Set<String> currentRoles) throws SearchEngineException {
SearchEngine searchEngine = ApplicationUtils.instance().getSearchEngine();

boolean rangeIndividualsFound = false;
Expand All @@ -570,6 +571,7 @@ private Object rangeIndividualsExist(List<VClass> types) throws SearchEngineExce
SearchQuery query = searchEngine.createQuery();
query.setQuery( VitroSearchTermNames.RDFTYPE + ":" + type.getURI());
query.setRows(0);
SearchFiltering.addDefaultFilters(query, currentRoles);

SearchResponse rsp = searchEngine.query(query);
SearchResultDocumentList docs = rsp.getResults();
Expand Down
Loading
Loading