Fix for Bug #16599, Validation portlet not dealing with "<" and ">" signs

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/branches/portlets/user/PerformFISH-Apps/1.3@179229 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2019-05-02 10:30:42 +00:00
parent f1a1063383
commit a6ca6a9409
11 changed files with 56 additions and 41 deletions

38
pom.xml
View File

@ -1,8 +1,22 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<repositories>
<repository>
<id>gcube-releases</id>
<name>gCube Releases</name>
<url>http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
@ -13,7 +27,7 @@
<artifactId>PerformFISH-Apps-portlet</artifactId>
<packaging>war</packaging>
<name>PerformFISH-Apps Portlet</name>
<version>1.3.0-SNAPSHOT</version>
<version>1.3.1-SNAPSHOT</version>
<description>
PerformFISH Apps is a set of portlet for the implementation of the Form Submission useful to calculate KPIs
</description>
@ -53,10 +67,12 @@
<dependency>
<groupId>org.gcube.resources.discovery</groupId>
<artifactId>ic-client</artifactId>
<version>1.0.4-4.13.1-162683</version>
</dependency>
<dependency>
<groupId>org.gcube.resources</groupId>
<artifactId>registry-publisher</artifactId>
<version>1.2.9-4.13.1-151412</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
@ -66,19 +82,18 @@
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>storagehub-icons-library</artifactId>
<version>1.1.1-4.13.1-173244</version>
</dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
<version>2.4.0-4.13.1-164813</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>storagehub-icons-library</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common.portal</groupId>
<artifactId>portal-manager</artifactId>
<version>2.4.1-4.13.1-169423</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -89,6 +104,12 @@
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-client-library</artifactId>
<version>1.0.3-4.13.1-176597</version>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-model</artifactId>
<version>1.0.3-4.13.1-176521</version>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
@ -98,26 +119,31 @@
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<version>2.10.2-4.13.1-164488</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<version>2.11.5-4.13.1-169333</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-model</artifactId>
<version>1.8.1-4.13.1-164481</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-client</artifactId>
<version>2.0.3-4.13.1-177201</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-authorization</artifactId>
<version>2.1.5-4.13.1-177311</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -182,7 +182,7 @@ public class CompanyFarmRepository extends MVCPortlet {
.append(farmId).append("?gcube-token="+authorizationToken);
String request = sb.toString();
fixUntrustCertificate() ;
URL url= new URL(request);
URL url= new URL(null, request, new sun.net.www.protocol.https.Handler());
HttpsURLConnection conn= (HttpsURLConnection) url.openConnection();
conn.setDoOutput( true );
conn.setInstanceFollowRedirects( false );
@ -218,7 +218,7 @@ public class CompanyFarmRepository extends MVCPortlet {
*/
_log.debug("*** List Processed, no of items = "+jobs.keySet().size());
for (String key : jobs.keySet()) {
System.out.println(jobs.get(key));
_log.debug(jobs.get(key));
}
//
StorageHubClient shub = new StorageHubClient();
@ -235,7 +235,7 @@ public class CompanyFarmRepository extends MVCPortlet {
}
public void displayVersions(ActionRequest request, ActionResponse response) throws Exception {
System.out.println("**** displayVersionsdisplayVersionsdisplayVersionsdisplayVersions");
_log.debug("**** displayVersionsdisplayVersionsdisplayVersionsdisplayVersions");
String itemId = ParamUtil.getString(request, "fileItem");
long farmId = ParamUtil.getLong(request, "farmId");
@ -332,12 +332,14 @@ public class CompanyFarmRepository extends MVCPortlet {
e.printStackTrace();
}
}
else {
else {//check threshold
String batchType = ParamUtil.getString(resourceRequest, "batchType", null);
String farmIdStr = ParamUtil.getString(resourceRequest, "farmId", null);
String context = Utils.getCurrentContext(resourceRequest);
long farmId = Long.parseLong(farmIdStr);
boolean analyisisEnabled = false;
_log.debug("check threshold batchType" + batchType + " farmId="+farmIdStr + " context="+context);
_log.info("calling ImportedBatchChecker.checkAnalysisAvailability");
try {
analyisisEnabled = ImportedBatchChecker.checkAnalysisAvailability(farmId, batchType, context);
}
@ -411,7 +413,7 @@ public class CompanyFarmRepository extends MVCPortlet {
int status = -1;
try {
fixUntrustCertificate() ;
URL url= new URL(request);
URL url= new URL(null, request, new sun.net.www.protocol.https.Handler());
HttpsURLConnection conn= (HttpsURLConnection) url.openConnection();
conn.setDoOutput( true );
conn.setInstanceFollowRedirects( false );

View File

@ -213,8 +213,8 @@ public class SubmittedFormValidation extends MVCPortlet {
String line;
List<String> resultLines = new ArrayList<>();
while ((line = reader.readLine()) != null) {
if (line.split("=").length > 1)
resultLines.add(line.split("=")[1]); //if the split fails it means there is no comment
if (line.split("=").length > 1)
resultLines.add(line.substring(line.indexOf("=")+1));
else
resultLines.add("Validation is successful");
}

View File

@ -94,7 +94,7 @@ public class ImportedBatchChecker {
private static long readCSVLines(String csvUrl) throws IOException {
URL url= new URL(csvUrl);
URL url= new URL(null, csvUrl, new sun.net.www.protocol.https.Handler());
HttpURLConnection conn= (HttpURLConnection) url.openConnection();
conn.setDoOutput( true );
conn.setInstanceFollowRedirects( true );
@ -108,7 +108,7 @@ public class ImportedBatchChecker {
}
private static JSONObject readFromURL(String request) throws IOException, JSONException {
URL url= new URL(request);
URL url= new URL(null, request, new sun.net.www.protocol.https.Handler());
HttpsURLConnection conn= (HttpsURLConnection) url.openConnection();
conn.setDoOutput( true );
conn.setInstanceFollowRedirects( false );

View File

@ -22,10 +22,9 @@ div.submitted-form-validation-portlet {
height: 32px;
display: block;
border: 1px solid #AAA;
border-radius: 32px;
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
background-position: 50% 50%;
border-radius: 2em;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
}
/* file upload css */

View File

@ -28,13 +28,11 @@
<tr>
<c:if test="${not empty logoURL}">
<td>
<div class="logo-circular"
style="background-image: url('${logoURL}');
background-size: cover; "></div>
<img class="logo-circular" src="${logoURL}" />
</td>
</c:if>
<td><p
style="font-size: 1.5em; padding-top: 12px; padding-left: 5px;">${theCompanyName}
style="font-size: 1.5em; padding-top: 12px; padding-left: 5px;">${theCompanyName} -
Private Repository Content</p></td>
</tr>
</table>

View File

@ -76,13 +76,11 @@ $(function () {
<tr>
<c:if test="${not empty logoURL}">
<td>
<div class="logo-circular"
style="background-image: url('${logoURL}');
background-size: cover; "></div>
<img class="logo-circular" src="${logoURL}" />
</td>
</c:if>
<td><p
style="font-size: 1.5em; padding-top: 12px; padding-left: 5px;">${theCompanyName} - ${farmyName} Private Repository Content</p></td>
style="font-size: 1.5em; padding-top: 12px; padding-left: 5px;">${theCompanyName} / ${farmyName} - Private Repository Content</p></td>
</tr>
</table>
</div>

View File

@ -28,9 +28,7 @@
<tr>
<c:if test="${not empty logoURL}">
<td>
<div class="logo-circular"
style="background-image: url('${logoURL}');
background-size: cover; "></div>
<img class="logo-circular" src="${logoURL}" />
</td>
</c:if>

View File

@ -28,9 +28,7 @@
<tr>
<c:if test="${not empty logoURL}">
<td>
<div class="logo-circular"
style="background-image: url('${logoURL}');
background-size: cover; "></div>
<img class="logo-circular" src="${logoURL}" />
</td>
</c:if>
<td><p

View File

@ -34,14 +34,12 @@
<tr>
<c:if test="${not empty logoURL}">
<td>
<div class="logo-circular"
style="background-image: url('${logoURL}');
background-size: cover; "></div>
<img class="logo-circular" src="${logoURL}" />
</td>
</c:if>
<td><p
style="font-size: 1.5em; padding-top: 12px; padding-left: 5px;">${theCompanyName} - ${farmName}
style="font-size: 1.5em; padding-top: 12px; padding-left: 5px;">${theCompanyName} / ${farmName} -
Administrators</p></td>
</tr>
</table>

View File

@ -31,12 +31,10 @@
<tr>
<c:if test="${not empty logoURL}">
<td>
<div class="logo-circular"
style="background-image: url('${logoURL}');
background-size: cover; "></div>
<img class="logo-circular" src="${logoURL}" />
</td>
</c:if>
<td><p style="font-size: 1.5em;padding-top: 12px; padding-left: 5px;">${theCompanyName} - ${farmName} Users</p></td>
<td><p style="font-size: 1.5em;padding-top: 12px; padding-left: 5px;">${theCompanyName} / ${farmName} - Users</p></td>
</tr>
</table>
</div>