Skip to content

Commit

Permalink
Merge pull request #175 from geonetwork-ga/ecat3.2-dev
Browse files Browse the repository at this point in the history
Ecat3.2 dev
  • Loading branch information
josephjohn136 authored Sep 3, 2019
2 parents 1b148a3 + 8369f23 commit 8391610
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 2,524 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void verify(String filePath) throws Exception {
Path path = Paths.get(filePath);
if (path.isAbsolute() || filePath.startsWith("/") ||
filePath.startsWith("://", 1)) {
throw new SecurityException("Wrong filename");
throw new BadParameterEx("Invalid character found in path.", filePath);
}
}
}
1 change: 1 addition & 0 deletions common/src/main/java/org/fao/geonet/utils/XmlRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ protected final Element executeAndReadResponse(HttpRequestBase httpMethod) throw
final ClientHttpResponse httpResponse = doExecute(httpMethod);

if (httpResponse.getRawStatusCode() > 399) {
httpMethod.releaseConnection();
throw new BadServerResponseEx(httpResponse.getStatusText() +
" -- URI: " + httpMethod.getURI() +
" -- Response Code: " + httpResponse.getRawStatusCode());
Expand Down
4 changes: 1 addition & 3 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,10 @@
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-opengis</artifactId>
<version>16.0</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-metadata</artifactId>
<version>16.0</version>
<artifactId>gt-metadata</artifactId>
</dependency>
<dependency>
<groupId>com.vividsolutions</groupId>
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/java/jeeves/xlink/Processor.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ public static synchronized Element resolveXLink(String uri, String idSearch, Ser
request.setInputMethod(InputMethod.GET);
remoteFragment = srvContext.execute(request);
} else {

// Avoid references to filesystem
if (uri.toLowerCase().startsWith("file://")) {
return null;
}

uri = uri.replaceAll("&+", "&");
String mappedURI = mapURI(uri);

Expand Down
17 changes: 17 additions & 0 deletions core/src/main/java/org/fao/geonet/constants/Geonet.java
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,19 @@ public static final class Text {
public static final String GRAPH_OVER = "graphOver";
}

/**
* Workflow status
*/
public static final class WorkflowStatus {
public static final int UNKNOWN = 0;
public static final int DRAFT = 1;
public static final int APPROVED = 2;
public static final int RETIRED = 3;
public static final int SUBMITTED = 4;
public static final int REJECTED = 5;

}

/**
* Codelist directories.
*/
Expand Down Expand Up @@ -680,6 +693,10 @@ public static final class Namespaces {

}

public static final class Namespaces2 {
public static final org.jdom2.Namespace MRI = org.jdom2.Namespace.getNamespace("mri", "http://standards.iso.org/iso/19115/-3/mri/1.0");
public static final org.jdom2.Namespace GCO = org.jdom2.Namespace.getNamespace("gco", "http://standards.iso.org/iso/19115/-3/gco/1.0");
}
public static class IndexFieldNames {

public static final String HASXLINKS = "_hasxlinks";
Expand Down
17 changes: 3 additions & 14 deletions core/src/main/java/org/fao/geonet/kernel/TransformManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,21 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

import org.fao.geonet.constants.Geonet;
import org.fao.geonet.utils.Log;
import org.fao.geonet.utils.Xml;
import org.fao.geonet.constants.Geonet.Namespaces2;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.jdom2.filter.Filters;
import org.jdom2.input.SAXBuilder;
import org.jdom2.output.XMLOutputter;
import org.jdom2.xpath.XPathExpression;
import org.jdom2.xpath.XPathFactory;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;


public class TransformManager implements ApplicationEventPublisherAware{
public class TransformManager {

XMLOutputter outputter = new XMLOutputter();

private ApplicationEventPublisher applicationEventPublisher;

Namespace[] namespaces = {Namespace.getNamespace("mri", "http://standards.iso.org/iso/19115/-3/mri/1.0"),
Namespace.getNamespace("gco", "http://standards.iso.org/iso/19115/-3/gco/1.0")};
Namespace[] namespaces = {Namespaces2.MRI, Namespaces2.GCO};

XMLOutputter out = new XMLOutputter();
org.jdom.output.XMLOutputter out1 = new org.jdom.output.XMLOutputter();
Expand Down Expand Up @@ -82,8 +75,4 @@ public Element convertToJdom2Element(org.jdom.Element e) throws Exception{
return e2;
}

@Override
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
this.applicationEventPublisher = applicationEventPublisher;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void doFilter(ServletRequest request, ServletResponse response,
}
}*/

hresp.sendRedirect("/geonetwork/");
hresp.sendRedirect("/" + Geonet.GEONETWORK);
return; // no further chain processing allowed

} else {
Expand All @@ -181,7 +181,7 @@ public void doFilter(ServletRequest request, ServletResponse response,
} else if (SecurityContextHolder.getContext().getAuthentication() != null
&& SecurityContextHolder.getContext().getAuthentication()
.isAuthenticated() && minimal == null) {
Log.warning(Geonet.DATA_MANAGER, "Joseph --> ShibbolethPreAuthFilter, else if condition..");
Log.warning(Geonet.DATA_MANAGER, "ShibbolethPreAuthFilter, else if condition..");
// Are we logged out?
if (req.getSession().getAttribute(SHIB_KEY) != null) {
req.getSession().removeAttribute(SHIB_KEY);
Expand Down
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,16 @@
<artifactId>gt-brewer</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-opengis</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-metadata</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools.jdbc</groupId>
<artifactId>gt-jdbc-postgis</artifactId>
Expand Down
Loading

0 comments on commit 8391610

Please sign in to comment.