diff --git a/geoportal_1/README.md b/geoportal_1/README.md
new file mode 100644
index 0000000..5236a2f
--- /dev/null
+++ b/geoportal_1/README.md
@@ -0,0 +1,2 @@
+UC Berkeley Opengeoportal Fork
+==================================
diff --git a/geoportal_1/pom.xml b/geoportal_1/pom.xml
index 22b5c78..deec34b 100644
--- a/geoportal_1/pom.xml
+++ b/geoportal_1/pom.xml
@@ -7,274 +7,300 @@
1.2.RELEASEopengeoportal webapphttp://opengeoportal.org
-
-
-
- maven2-repository.dev.java.net
- Java.net repository
- http://download.java.net/maven/2
-
-
- osgeo
- Open Source Geospatial Foundation Repository
- http://download.osgeo.org/webdav/geotools/
-
-
-
-
- 3.1.4.RELEASE
- 3.1.4.RELEASE
- 1.9.12
- UTF-8
- UTF-8
-
-
-
-
- org.springframework
- spring-core
- ${org.springframework.version}
-
+
+
-
-
+
+ 3.1.4.RELEASE
+
+ 3.2.0.CI-SNAPSHOT
+
+ 1.9.12
+ UTF-8
+ UTF-8
+
+
+
+
+
+
-
-
- org.springframework
- spring-beans
- ${org.springframework.version}
-
+
+
+ org.springframework
+ spring-beans
+ ${org.springframework.version}
+
-
-
+
-
+
-
-
-
-
+
-
-
-
-
+
-
-
- org.springframework
- spring-oxm
- ${org.springframework.version}
-
+
+
+ org.springframework
+ spring-oxm
+ ${org.springframework.version}
+
-
+
-
- org.springframework
- spring-web
- ${org.springframework.version}
-
+
+ org.springframework
+ spring-web
+ ${org.springframework.version}
+
-
- org.springframework
- spring-context
- ${org.springframework.version}
-
+
+ org.springframework
+ spring-context
+ ${org.springframework.version}
+
-
+
-
- org.springframework
- spring-webmvc
- ${org.springframework.version}
-
+
+ org.springframework
+ spring-webmvc
+ ${org.springframework.version}
+
-
-
+
-
-
- org.springframework
- spring-test
- ${org.springframework.version}
- test
-
+
+ org.springframework
+ spring-test
+ ${org.springframework.version}
+ test
+
-
-
-
- org.apache.httpcomponents
- httpcore
- 4.2.1
-
+
+ org.apache.httpcomponents
+ httpcore
+ 4.2.1
+
-
- org.apache.httpcomponents
- httpclient
- 4.2.1
-
+
+ org.apache.httpcomponents
+ httpclient
+ 4.2.1
+
-
- junit
- junit
- 4.8.1
- test
-
+
+ junit
+ junit
+ 4.8.1
+ test
+
-
- org.seleniumhq.selenium
- selenium-java
- 2.20.0
- runtime
-
+
+ org.seleniumhq.selenium
+ selenium-java
+ 2.20.0
+ runtime
+
-
-
- org.slf4j
- jcl-over-slf4j
- 1.6.6
-
-
- org.slf4j
- slf4j-api
- 1.6.6
-
-
- org.slf4j
- slf4j-log4j12
- 1.6.6
-
-
- log4j
- log4j
- 1.2.14
-
+
+ org.slf4j
+ jcl-over-slf4j
+ 1.6.6
+
+
+ org.slf4j
+ slf4j-api
+ 1.6.6
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.6.6
+
+
+ log4j
+ log4j
+ 1.2.14
+
-
- org.apache.solr
- solr-solrj
- 4.0.0
-
-
- org.springframework.security
- spring-security-core
- ${org.springframework.security.version}
-
-
- org.springframework.security
- spring-security-config
- ${org.springframework.security.version}
-
-
- org.springframework.security
- spring-security-web
- ${org.springframework.security.version}
-
-
- org.springframework.security
- spring-security-ldap
- ${org.springframework.security.version}
-
-
- org.codehaus.jackson
- jackson-core-lgpl
- ${jackson.version}
-
-
- org.codehaus.jackson
- jackson-mapper-lgpl
- ${jackson.version}
-
-
+
+ org.apache.solr
+ solr-solrj
+ 4.0.0
+
+
+
+ org.springframework.security
+ spring-security-core
+ ${org.springframework.security.version}
+
+
+
+ org.springframework.security
+ spring-security-cas
+ ${org.springframework.security.version}
+
+
+ org.springframework.security
+ spring-security-config
+ ${org.springframework.security.version}
+
+
+ org.springframework.security
+ spring-security-web
+ ${org.springframework.security.version}
+
+
+ org.springframework.security
+ spring-security-ldap
+ ${org.springframework.security.version}
+
+
+ org.codehaus.jackson
+ jackson-core-lgpl
+ ${jackson.version}
+
+
+ org.codehaus.jackson
+ jackson-mapper-lgpl
+ ${jackson.version}
+
+ org.apache.commonscommons-compress1.4.1
-
-
- org.apache.httpcomponents
- httpmime
- 4.2.1
-
-
- javax.servlet
- servlet-api
- 2.5
- provided
-
-
- com.thetransactioncompany
- cors-filter
- 1.6
-
+
+
+ org.apache.httpcomponents
+ httpmime
+ 4.2.1
+
+
+ javax.servlet
+ servlet-api
+ 2.5
+ provided
+
+
+ com.thetransactioncompany
+ cors-filter
+ 1.6
+ opengeoportal
-
-
- org.apache.maven.plugins
- maven-failsafe-plugin
- 2.12
-
-
-
- integration-test
- verify
-
-
-
-
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+ 2.12
+
+
+
+ integration-test
+ verify
+
+
+
+
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.0
-
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.0
+ 1.6
-
-
-
+
+
+
diff --git a/geoportal_1/src/main/java/org/OpenGeoPortal/Download/Methods/WfsDownloadMethod.java b/geoportal_1/src/main/java/org/OpenGeoPortal/Download/Methods/WfsDownloadMethod.java
index 9db1152..5a0995b 100644
--- a/geoportal_1/src/main/java/org/OpenGeoPortal/Download/Methods/WfsDownloadMethod.java
+++ b/geoportal_1/src/main/java/org/OpenGeoPortal/Download/Methods/WfsDownloadMethod.java
@@ -43,6 +43,8 @@ public String createDownloadRequest() throws Exception {
//info needed: geometry column, bbox coords, epsg code, workspace & layername
//all client bboxes should be passed as lat-lon coords. we will need to get the appropriate epsg code for the layer
//in order to return the file in original projection to the user (will also need to transform the bbox)
+
+ logger.info("Layer name in WfsDownloadMethod: " + this.currentLayer.getLayerNameNS());
String layerName = this.currentLayer.getLayerNameNS();
SolrRecord layerInfo = this.currentLayer.getLayerInfo();
BoundingBox nativeBounds = new BoundingBox(layerInfo.getMinX(), layerInfo.getMinY(), layerInfo.getMaxX(), layerInfo.getMaxY());
diff --git a/geoportal_1/src/main/java/org/OpenGeoPortal/Ogc/Wfs/WfsGetFeature.java b/geoportal_1/src/main/java/org/OpenGeoPortal/Ogc/Wfs/WfsGetFeature.java
index cc43290..422a968 100644
--- a/geoportal_1/src/main/java/org/OpenGeoPortal/Ogc/Wfs/WfsGetFeature.java
+++ b/geoportal_1/src/main/java/org/OpenGeoPortal/Ogc/Wfs/WfsGetFeature.java
@@ -1,8 +1,16 @@
package org.OpenGeoPortal.Ogc.Wfs;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.OpenGeoPortal.Download.Types.BoundingBox;
public class WfsGetFeature {
+
+ final static Logger logger = LoggerFactory.getLogger(WfsGetFeature.class);
+
+
+
public static String createWfsGetFeatureRequest(String layerName, String workSpace, String nameSpace, String outputFormat, String filter) throws Exception {
return createWfsGetFeatureRequest(layerName, workSpace, nameSpace, -1, "", outputFormat, filter);
@@ -26,9 +34,23 @@ private static String getAttributeString(String attrName, String value){
public static String createWfsGetFeatureRequest(String layerName, String workSpace, String nameSpace, int maxFeatures, String epsgCode, String outputFormat, String filter) throws Exception {
- //--generate POST message
- //info needed: geometry column, bbox coords, epsg code, workspace & layername
+
+ logger.info("In createWfsGetFeatureRequest passed in, layerName: " + layerName + ", workSpace: " + workSpace);
+
+
+ //--generate POST message
+ //info needed: geometry column, bbox coords, epsg code, workspace & layername
+ if (!workSpace.trim().isEmpty()){
+ if (layerName.contains(":")){
+ layerName = layerName.substring(layerName.indexOf(":") + 1);
+ }
+ layerName = workSpace + ":" + layerName;
+ } else {
+ }
+
+
+ /* old code
if (!workSpace.trim().isEmpty()){
layerName = workSpace + ":" + layerName;
} else {
@@ -36,11 +58,14 @@ public static String createWfsGetFeatureRequest(String layerName, String workSpa
layerName = layerName.substring(layerName.indexOf(":"));
}
}
+ */
+ logger.info("In createWfsGetFeatureRequest converted, layerName: " + layerName);
+
String getFeatureRequest = ""
+ "";
+ logger.info("Feature Request: " + getFeatureRequest);
+
+
return getFeatureRequest;
}
diff --git a/geoportal_1/src/main/java/org/OpenGeoPortal/Ogc/Wfs/WfsGetFeature.java~ b/geoportal_1/src/main/java/org/OpenGeoPortal/Ogc/Wfs/WfsGetFeature.java~
new file mode 100644
index 0000000..422a968
--- /dev/null
+++ b/geoportal_1/src/main/java/org/OpenGeoPortal/Ogc/Wfs/WfsGetFeature.java~
@@ -0,0 +1,112 @@
+package org.OpenGeoPortal.Ogc.Wfs;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.OpenGeoPortal.Download.Types.BoundingBox;
+
+public class WfsGetFeature {
+
+ final static Logger logger = LoggerFactory.getLogger(WfsGetFeature.class);
+
+
+
+ public static String createWfsGetFeatureRequest(String layerName, String workSpace, String nameSpace, String outputFormat, String filter) throws Exception {
+ return createWfsGetFeatureRequest(layerName, workSpace, nameSpace, -1, "", outputFormat, filter);
+
+ }
+
+ private static String getAttributeString(String attrName, int value){
+ String attrString = "";
+ if(value > 0){
+ attrString = " " + attrName + "=\"" + Integer.toString(value) + "\"";
+ }
+ return attrString;
+ }
+
+ private static String getAttributeString(String attrName, String value){
+ String attrString = "";
+ if(!value.trim().isEmpty()){
+ attrString = " " + attrName + "=\"" + value.trim() + "\"";
+ }
+ return attrString;
+ }
+
+ public static String createWfsGetFeatureRequest(String layerName, String workSpace, String nameSpace, int maxFeatures, String epsgCode, String outputFormat, String filter) throws Exception {
+
+
+ logger.info("In createWfsGetFeatureRequest passed in, layerName: " + layerName + ", workSpace: " + workSpace);
+
+
+ //--generate POST message
+ //info needed: geometry column, bbox coords, epsg code, workspace & layername
+
+ if (!workSpace.trim().isEmpty()){
+ if (layerName.contains(":")){
+ layerName = layerName.substring(layerName.indexOf(":") + 1);
+ }
+ layerName = workSpace + ":" + layerName;
+ } else {
+ }
+
+
+ /* old code
+ if (!workSpace.trim().isEmpty()){
+ layerName = workSpace + ":" + layerName;
+ } else {
+ if (layerName.contains(":")){
+ layerName = layerName.substring(layerName.indexOf(":"));
+ }
+ }
+ */
+ logger.info("In createWfsGetFeatureRequest converted, layerName: " + layerName);
+
+ String getFeatureRequest = ""
+ + ""
+ + filter
+ + ""
+ + "";
+
+ logger.info("Feature Request: " + getFeatureRequest);
+
+
+ return getFeatureRequest;
+ }
+
+ public static String getMethod(){
+ return "POST";
+ }
+
+ private static String getNameSpaceString(String workSpace, String nameSpace){
+ //if either is missing, skip the whole thing
+ String nsString = "";
+ if (!workSpace.trim().isEmpty() && !nameSpace.trim().isEmpty()){
+ nsString = " xmlns:" + workSpace + "=\"" + nameSpace + "\"";
+ }
+ return nsString;
+ }
+
+ public static String getBboxFilter(BoundingBox bounds, String geometryColumn, int epsgCode){
+
+ String bboxFilter = ""
+ + ""
+ + "" + geometryColumn + ""
+ + bounds.generateGMLBox(epsgCode)
+ + ""
+ + "";
+
+ return bboxFilter;
+ }
+
+
+}
diff --git a/geoportal_1/src/main/java/org/OpenGeoPortal/Security/IframeLoginController.java b/geoportal_1/src/main/java/org/OpenGeoPortal/Security/IframeLoginController.java
new file mode 100644
index 0000000..271b844
--- /dev/null
+++ b/geoportal_1/src/main/java/org/OpenGeoPortal/Security/IframeLoginController.java
@@ -0,0 +1,52 @@
+package org.OpenGeoPortal.Security;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.io.*;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.ObjectWriter;
+//import com.fasterxml.jackson.core.JsonProcessingException;
+//import com.fasterxml.jackson.databind.ObjectMapper;
+//import com.fasterxml.jackson.databind.ObjectWriter;
+
+@Controller
+public class IframeLoginController {
+ @Autowired
+ @Qualifier("formLoginService")
+ LoginService loginService;
+
+ private @Value("${ogp.domain}") String localDomain;
+
+ final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+ @RequestMapping(value="restricted/weblogin", method=RequestMethod.GET)
+ @ResponseBody public ModelAndView getStatus() throws IOException {
+ logger.debug("Login status checked");
+
+ String sendingPage = localDomain;
+ //create the model to return
+ ModelAndView mav = new ModelAndView("iframeLogin");
+ LoginStatus status = loginService.getStatus();
+
+ ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
+ String json = ow.writeValueAsString(status);
+
+ //test
+ //json = json.replace("false", "true");
+ mav.addObject("authStatus", json);
+ mav.addObject("sendingPage", sendingPage);
+
+ return mav;
+ }
+
+}
diff --git a/geoportal_1/src/main/java/org/OpenGeoPortal/Security/SimpleCasUserService.java b/geoportal_1/src/main/java/org/OpenGeoPortal/Security/SimpleCasUserService.java
new file mode 100755
index 0000000..915d898
--- /dev/null
+++ b/geoportal_1/src/main/java/org/OpenGeoPortal/Security/SimpleCasUserService.java
@@ -0,0 +1,96 @@
+package org.OpenGeoPortal.Security;
+/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.security.cas.userdetails.AbstractCasAssertionUserDetailsService;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.core.userdetails.User;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.util.Assert;
+import org.apache.commons.lang.ArrayUtils;
+import org.jasig.cas.client.validation.Assertion;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+* Populates the {@link org.springframework.security.core.GrantedAuthority}s for a user by reading a list of attributes that were returned as
+* part of the CAS response. Each attribute is read and each value of the attribute is turned into a GrantedAuthority. If the attribute has no
+* value then its not added.
+*
+* --modified: if the user has been authenticated via CAS, they are granted the role "ROLE_USER". If the user is found in the admins list, they
+* are also granted the role "ROLE_ADMIN". Note that at this point the admin user has no special privileges in the application. the addition is
+* for future functionality and parity with the LDAP authorization as it stands.
+*
+* @author Scott Battaglia, modified Chris Barnett
+* @since 3.0
+*/
+public final class SimpleCasUserService implements UserDetailsService {
+
+ protected String admins;
+ protected String[] adminList;
+ final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+ private static final String NON_EXISTENT_PASSWORD_VALUE = "NO_PASSWORD";
+
+ private String[] attributes = null;
+
+ private boolean convertToUpperCase = true;
+
+ public void setAdmins(String admins){
+ admins = admins.replace(" ", "");
+ adminList = admins.split(",");
+ }
+
+ protected Boolean isAdmin(String username){
+ return ArrayUtils.contains(adminList, username);
+ }
+
+
+ public SimpleCasUserService() {}
+
+ public SimpleCasUserService(final String[] attributes) {
+ Assert.notNull(attributes, "attributes cannot be null.");//should null attributes be allowed, since we are not using CAS attributes for our roles?
+ // Assert.isTrue(attributes.length > 0, "At least one attribute is required to retrieve roles from.");
+ this.attributes = attributes;
+ }
+
+ /**
+* Converts the returned attribute values to uppercase values.
+*
+* @param convertToUpperCase true if it should convert, false otherwise.
+*/
+ public void setConvertToUpperCase(final boolean convertToUpperCase) {
+ this.convertToUpperCase = convertToUpperCase;
+ }
+
+ public UserDetails loadUserByUsername(String userName) {
+
+ final List grantedAuthorities = new ArrayList();
+ if(userName == null || userName.equals("")) {
+ } else if(userName.equals("175219")) {
+ grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_ADMIN"));
+ }
+
+ if(userName != null && !userName.equals("")) {
+ grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_USER"));
+ }
+ return new User(userName, NON_EXISTENT_PASSWORD_VALUE, true, true, true, true, grantedAuthorities);
+ }
+}
\ No newline at end of file
diff --git a/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/Http/HttpComponentsHttpRequester.java b/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/Http/HttpComponentsHttpRequester.java
index 2ebc143..079197a 100644
--- a/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/Http/HttpComponentsHttpRequester.java
+++ b/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/Http/HttpComponentsHttpRequester.java
@@ -112,18 +112,19 @@ public InputStream sendRequest(String serviceURL, String requestString,
return sendRequest(serviceURL, requestString, requestMethod, "text/xml");
}
- protected InputStream sendPostRequest(String serviceURL,
- String requestBody, String contentType) {
+ protected InputStream sendPostRequest(String serviceURL, String requestBody, String contentType) {
HttpClient httpclient = ogpHttpClient.getHttpClient();
InputStream replyStream = null;
+
try {
HttpPost httppost = new HttpPost(serviceURL);
- logger.debug(requestBody);
+ logger.info("Request body in sendPostRequest: " + requestBody);
StringEntity postEntity = new StringEntity(requestBody, ContentType.create(contentType, "UTF-8"));
httppost.setEntity(postEntity);
logger.info("executing POST request to " + httppost.getURI());
HttpResponse response = httpclient.execute(httppost);
this.setStatus(response.getStatusLine().getStatusCode());
+ logger.info("response in sendPostRequest: " + response.getStatusLine());
this.setHeaders(response.getAllHeaders());
HttpEntity entity = response.getEntity();
diff --git a/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/JsonpCallbackFilter.java b/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/JsonpCallbackFilter.java
index 9bc0a61..bbc7845 100644
--- a/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/JsonpCallbackFilter.java
+++ b/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/JsonpCallbackFilter.java
@@ -11,6 +11,8 @@
import java.io.OutputStream;
import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -21,38 +23,60 @@
public class JsonpCallbackFilter implements Filter {
- final Logger logger = LoggerFactory.getLogger(this.getClass());
+ final Logger logger = LoggerFactory.getLogger(this.getClass());
- public void init(FilterConfig fConfig) throws ServletException {}
+ public void init(FilterConfig fConfig) throws ServletException {}
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
- HttpServletRequest httpRequest = (HttpServletRequest) request;
- HttpServletResponse httpResponse = (HttpServletResponse) response;
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
- @SuppressWarnings("unchecked")
- Map parms = httpRequest.getParameterMap();
- if(parms.containsKey("callback")) {
- if(logger.isDebugEnabled())
- logger.debug("Wrapping response with JSONP callback '" + parms.get("callback")[0] + "'");
+ System.out.println("In JsonpCallbackFilter");
- OutputStream out = httpResponse.getOutputStream();
+ HttpServletRequest httpRequest = (HttpServletRequest) request;
+ HttpServletResponse httpResponse = (HttpServletResponse) response;
- GenericResponseWrapper wrapper = new GenericResponseWrapper(httpResponse);
+ @SuppressWarnings("unchecked")
+ Map parms = httpRequest.getParameterMap();
- chain.doFilter(request, wrapper);
+ System.out.println("In JsonpCallbackFilter, the size of pmap is: " + parms.size());
- out.write(new String(parms.get("callback")[0] + "(").getBytes());
- out.write(wrapper.getData());
- out.write(new String(");").getBytes());
+ Set keys = parms.keySet();
- wrapper.setContentType("text/javascript;charset=UTF-8");
+ Iterator it = keys.iterator();
- out.close();
- } else {
- chain.doFilter(request, response);
- }
- }
+ while(it.hasNext()) {
+ String key = (String)it.next();
- public void destroy() {}
+ System.out.println("Params in JsonpCallbackFilter:\n");
+ System.out.println("\tKey: " + key);
+ String[] vals = parms.get(key);
+ for(int i = 0;i < vals.length;i++) {
+ System.out.println("\t\tValue: " + vals[i] + "\n");
+ }
+ }
+
+ if(parms.containsKey("callback")) {
+ // if(logger.isDebugEnabled())
+ // logger.debug("Wrapping response with JSONP callback '" + parms.get("callback")[0] + "'");
+ System.out.println("Wrapping response with JSONP callback '" + parms.get("callback")[0] + "'");
+
+ OutputStream out = httpResponse.getOutputStream();
+
+ GenericResponseWrapper wrapper = new GenericResponseWrapper(httpResponse);
+
+ chain.doFilter(request, wrapper);
+
+ out.write(new String(parms.get("callback")[0] + "(").getBytes());
+ out.write(wrapper.getData());
+ out.write(new String(");").getBytes());
+
+ wrapper.setContentType("text/javascript;charset=UTF-8");
+
+ out.close();
+ } else {
+ chain.doFilter(request, response);
}
+ }
+
+ public void destroy() {}
+}
diff --git a/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/ParseJSONSolrLocationField.java b/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/ParseJSONSolrLocationField.java
index e04c793..15a98b8 100644
--- a/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/ParseJSONSolrLocationField.java
+++ b/geoportal_1/src/main/java/org/OpenGeoPortal/Utilities/ParseJSONSolrLocationField.java
@@ -18,16 +18,21 @@ public final class ParseJSONSolrLocationField {
final static Logger logger = LoggerFactory.getLogger(ParseJSONSolrLocationField.class.getName());
public static String getWmsUrl(String locationField) throws JsonParseException{
+ logger.info("Returning WmsUrl: " + parseLocationFromPath(locationField, "wms").get(0));
return parseLocationFromPath(locationField, "wms").get(0);
}
public static String getTilecacheUrl(String locationField) throws JsonParseException{
+
return parseLocationFromPath(locationField, "tilecache").get(0);
}
public static String getWfsUrl(String locationField) throws JsonParseException{
+
+ logger.info("Returning WfsUrl: " + parseLocationFromPath(locationField, "wfs").get(0));
+
return parseLocationFromPath(locationField, "wfs").get(0);
}
diff --git a/geoportal_1/src/main/webapp/WEB-INF/appServlet-servlet.xml b/geoportal_1/src/main/webapp/WEB-INF/appServlet-servlet.xml
index 1b28fa1..ebdb540 100644
--- a/geoportal_1/src/main/webapp/WEB-INF/appServlet-servlet.xml
+++ b/geoportal_1/src/main/webapp/WEB-INF/appServlet-servlet.xml
@@ -14,6 +14,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/geoportal_1/src/main/webapp/WEB-INF/download.xml b/geoportal_1/src/main/webapp/WEB-INF/download.xml
new file mode 100644
index 0000000..90cbae8
--- /dev/null
+++ b/geoportal_1/src/main/webapp/WEB-INF/download.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/geoportal_1/src/main/webapp/WEB-INF/ogp.properties b/geoportal_1/src/main/webapp/WEB-INF/ogp.properties
index df12f92..a697365 100644
--- a/geoportal_1/src/main/webapp/WEB-INF/ogp.properties
+++ b/geoportal_1/src/main/webapp/WEB-INF/ogp.properties
@@ -1,7 +1,8 @@
-ogp.proxyToWMS=http://127.0.0.1:8580/wms
-ogp.proxyToWFS=http://127.0.0.1:8580/wfs
-ogp.proxyToWCS=http://127.0.0.1:8580/wcs
-
+ogp.domain=http://linuxdev.lib.berkeley.edu:8080
+ogp.relativePath=/opt/tomcat/webapps/opengeoportal
+ogp.proxyToWMS=http://gis.lib.berkeley.edu:10080/wms
+ogp.proxyToWFS=http://gis.lib.berkeley.edu:10080/wfs
+ogp.proxyToWCS=http://gis.lib.berkeley.edu:10080/wcs
ldap.url=ldapurl
ldap.userSearchFilter=(uid={0})
-admins=admin
\ No newline at end of file
+admins=admin
diff --git a/geoportal_1/src/main/webapp/WEB-INF/security-app-context.xml b/geoportal_1/src/main/webapp/WEB-INF/security-app-context.xml
index 7a08955..640c3b2 100644
--- a/geoportal_1/src/main/webapp/WEB-INF/security-app-context.xml
+++ b/geoportal_1/src/main/webapp/WEB-INF/security-app-context.xml
@@ -6,24 +6,74 @@
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/geoportal_1/src/main/webapp/jspf/about.jspf b/geoportal_1/src/main/webapp/jspf/about.jspf
index df4c7f8..1d1ff4e 100644
--- a/geoportal_1/src/main/webapp/jspf/about.jspf
+++ b/geoportal_1/src/main/webapp/jspf/about.jspf
@@ -1,18 +1,18 @@
- GeoData@Tufts is developed and maintained by Tufts University Information Technology.
+ Geodata@Berkeley is derived from GeoData@Tufts which is developed and maintained by Tufts University Information Technology.
Tufts is leading the development in collaboration with Harvard of this open source, federated web application to rapidly discover, preview,
- and retrieve geospatial data from multiple repositories. GeoData@Tufts combines an intuitive, map-based search interface along with traditional
+ and retrieve geospatial data from multiple repositories. GeoData@Berkeley combines an intuitive, map-based search interface along with traditional
text-based metadata search tools for rapid data discovery and for use in teaching, learning, and research.
- GeoData@Tufts is part of The Open Geoportal. The Open Geoportal is a consortium comprised of contributions
+ GeoData@Berkeley is part of The Open Geoportal. The Open Geoportal is a consortium comprised of contributions
of several universities and organizations to help facilitate the discovery and acquisition of geospatial data across many organizations and platforms.
- Current partners include: Harvard, MIT, MassGIS, Princeton, Columbia, Stanford, UC Berkeley, UCLA, Yale, and UConn. Built on open source technology,
+ Current partners include: Tufts, Harvard, MIT, MassGIS, Princeton, Columbia, Stanford, UC Berkeley, UCLA, Yale, and UConn. Built on open source technology,
The Open Geoportal provides organizations the opportunity to share thousands of geospatial data layers, maps, metadata, and development resources through
a single common interface.
<%@include file="mailto.jspf"%>
-
\ No newline at end of file
+
diff --git a/geoportal_1/src/main/webapp/jspf/contact.jspf b/geoportal_1/src/main/webapp/jspf/contact.jspf
index 2d75085..013b5e1 100644
--- a/geoportal_1/src/main/webapp/jspf/contact.jspf
+++ b/geoportal_1/src/main/webapp/jspf/contact.jspf
@@ -6,12 +6,12 @@
Project Management:
Patrick Florance, Manager of Geospatial Technology Services, UIT, Tufts University
+
Berkeley Project Management:
+ Harrison Dekker, Head, Library Data Lab, University of California at Berkeley
-
-
-
+
diff --git a/geoportal_1/src/main/webapp/jspf/footer.jspf b/geoportal_1/src/main/webapp/jspf/footer.jspf
index ca7b701..1fa271d 100644
--- a/geoportal_1/src/main/webapp/jspf/footer.jspf
+++ b/geoportal_1/src/main/webapp/jspf/footer.jspf
@@ -5,13 +5,12 @@
Contact
<%@include file="about.jspf"%>
<%@include file="contact.jspf"%>
<%@include file="highlights.jspf"%>
-
\ No newline at end of file
+
diff --git a/geoportal_1/src/main/webapp/jspf/highlights.jspf b/geoportal_1/src/main/webapp/jspf/highlights.jspf
index 09f7dd3..9625774 100644
--- a/geoportal_1/src/main/webapp/jspf/highlights.jspf
+++ b/geoportal_1/src/main/webapp/jspf/highlights.jspf
@@ -1,7 +1,7 @@
-
Welcome to GeoData@Tufts! We are happy to announce that as of 11/4/2011 we are live. We will be making updates regularly.
+
Welcome to GeoData@Berkeley! Happy mapping!
Please zoom in and pan around with the map and/or enter search terms to begin discovering our geospatial data holdings.
You are previewing an ungeoreferenced image, which cannot be displayed on the map.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/geoportal_1/src/main/webapp/resources/javascript/layerSettings.js b/geoportal_1/src/main/webapp/resources/javascript/layerSettings.js
index e6d7637..6da51f7 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/layerSettings.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/layerSettings.js
@@ -41,8 +41,12 @@ org.OpenGeoPortal.LayerSettings = function(){
};
this.addNewLayer = function(layerID, params){
+
+ //alert("addNewLayer called. layerId: " + layerID + ", dataType: " + params.dataType );
+
var dataType = params.dataType;
+
if ((typeof dataType == 'undefined')||(dataType == '')){
throw new Error("dataType (Point, Line, Polygon, or Raster) must be specified to create a new layer.");
}
diff --git a/geoportal_1/src/main/webapp/resources/javascript/layerTable.js b/geoportal_1/src/main/webapp/resources/javascript/layerTable.js
index e96df17..27ab9d7 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/layerTable.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/layerTable.js
@@ -1,2428 +1,2504 @@
-/**
- * This javascript module includes functions for dealing with the search
- * results table under the object LayerTable. LayerTable uses the excellent
- * jQuery-based dataTables as the basis for the table.
- *
- * @author Chris Barnett
- *
- */
-if (typeof org == 'undefined'){
- org = {};
-} else if (typeof org != "object"){
- throw new Error("org already exists and is not an object");
-}
-
-// Repeat the creation and type-checking code for the next level
-if (typeof org.OpenGeoPortal == 'undefined'){
- org.OpenGeoPortal = {};
-} else if (typeof org.OpenGeoPortal != "object"){
- throw new Error("org.OpenGeoPortal already exists and is not an object");
-}
-
-/**
- * LayerTable constructor
- * this object defines the behavior of the search results table, as well as the saved layers table
- *
- * @param userDiv the id of the div element to place the table in
- * @param tableName the id of the actual table element
- */
-org.OpenGeoPortal.LayerTable = function(userDiv, tableName){
-
- var analytics = new org.OpenGeoPortal.Analytics();
-
- //set default for the name of the table div...these defaults should not be in the generic layertable code
- //but in the extensions of the object
- if ((typeof userDiv == 'undefined')||(userDiv.length === 0)){
- userDiv = 'resultsTable';
- }
-
- if ((typeof tableName == 'undefined')||(tableName.length === 0)){
- tableName = 'searchResults';
- }
- var that = this;
-
- this.getTableDiv = function(){
- return userDiv;
- };
- //this.tableDiv = userDiv;
- this.getTableID = function(){
- return tableName;
- };
-
- this.getTableObj = function(){
- return jQuery('#' + tableName).dataTable();
- };
-
- this.tableHeadingsObj = new org.OpenGeoPortal.LayerTable.TableHeadings(this);
- //temporary?
- var tableHeadings = this.tableHeadingsObj.getTableHeadings();
-
- this.tableLayerState = new org.OpenGeoPortal.LayerTable.TableLayerState();
- this.getImage = function(imageName){
- return org.OpenGeoPortal.Utility.getImage(imageName);
- };
- /*private methods
- *
- */
- //maintains state for how the table is sorted
- //*******Search Results only
- this.tableOrganize = {
- //set some defaults
- settings: {"organizeBy": "score", "organizeType": "numeric", "organizeDirection": "desc"},
- //we only need organizetype if there is more than one possibility per column
- //get the current sort state
- getState: function(){
- return this.settings;
- },
-
- //set the state
- setState: function(updateObj){//can't directly set organizeType; this will be looked up in tableHeading
- //test to see if the state is changed; if so, fire new solr search
- var innerThat = this;
- compareState = function(key){
- if (updateObj[key] == innerThat.settings[key]){
- return true;
- } else {
- return false;
- }
- };
- setSortColumn = function(){
- //test for rank first
- var newColumn = updateObj.organizeBy;
-
- analytics.track("Change Results Sort Order", newColumn);
-
- if (newColumn == 'score'){
- innerThat.settings.organizeBy = newColumn;
- innerThat.settings.organizeType = "numeric";
- } else {
- for (var columnName in tableHeadings){
- if (newColumn == columnName){
- var newOrganize = columnName.organize;
- if (newOrganize){
- throw new Error("This column cannot be organized."); //you can't organize this column
- } else {
- innerThat.settings.organizeBy = newColumn;
- innerThat.settings.organizeType = newOrganize;
- return;
- }
- }
- }
- throw new Error("The specified column name does not exist."); //if it gets here, this means that there was no matching column name in tableHeadings
- }
- };
-
- setSortDirection = function(){
- if (typeof updateObj.organizeDirection == 'undefined'){
- updateObj.organizeDirection = innerThat.settings.organizeDirection;
- }
- if ((updateObj.organizeDirection == 'asc')||(updateObj.organizeDirection == 'desc')){
- innerThat.settings.organizeDirection = updateObj.organizeDirection;
- } else {
- throw new Error("The specified sort direction is invalid for this column."); //invalid organize direction type
- }
- };
-
- if (typeof updateObj.organizeBy == 'undefined'){
- if (typeof updateObj.organizeDirection == 'undefined'){
- //these values can't both be unspecified
- throw new Error("Must specify a column and/or direction.");
- } else {
- //set organizeBy to current value, continue processing
- updateObj.organizeBy = innerThat.settings.organizeBy;
- setSortColumn();
- setSortDirection();
- that.searchRequest(0);
- org.OpenGeoPortal.ui.updateSortMenu();
- }
- } else if (compareState('organizeBy')){
- if (compareState('organizeDirection')){
- //don't do anything...the object hasn't changed exit function
- return;
- } else {
- setSortDirection();
- that.searchRequest(0);
- org.OpenGeoPortal.ui.updateSortMenu();
- }
- } else {
- setSortColumn();
- setSortDirection();
- that.searchRequest(0);
- org.OpenGeoPortal.ui.updateSortMenu();
- }
- }
- };
- //wrap the content of each table cell in a div so we can control the size
- this.wrapCells = function(){
- var tableName = that.getTableID();
- jQuery('#' + tableName + ' td').add('#' + tableName + ' th').each(function (iPosition, Element){
- //reference the column, so we can set the width of each div
- var tableCell = jQuery(this);
- if (!tableCell.children().first().is("div")){
- tableCell.wrapInner('');
- }
- });
- that.sizeCells();
- };
- //dynamically size the table depending on visible columns & the width of the container
- this.sizeCells = function(){
- //determine which fields are showing, set widths from header object
- //if they add up to the total width, we're done. otherwise we need to adjust
- //we need to maintain minimum widths
- var currentTab = org.OpenGeoPortal.Utility.whichTab();
- var tableID = this.getTableID();
- var adjustObj;
-
- if (!currentTab.tableObject){
- return;
- }
- if (currentTab.tableName != tableID){
- return;
- }
- var totalWidth = jQuery('#left_col').width();
- var arrColumns = this.getVisibleColumns();
- totalWidth = totalWidth - (arrColumns.length * 7) + 1;//account for cell padding plus right borders of cells, leftmost border
- //var divWidth = totalWidth;
- var arrSizable = new Array();
- var sizableWidth = 0;
- var headingsObj = this.tableHeadingsObj;
- for (var i in arrColumns){
- var currentColumn = arrColumns[i];
- var currentWidth = headingsObj.getWidth(currentColumn);
- if (headingsObj.getValue(currentColumn, "resizable")){
- sizableWidth += currentWidth;
- arrSizable.push(currentColumn);
- } else {
- var fixedColumnWidth = parseFloat(currentWidth);
- totalWidth = totalWidth - fixedColumnWidth;
- }
- }
- var numberSizable = arrSizable.length;
- if (numberSizable == 0){
- return;//we're done. exit the function
- }
- //working here....
- if (numberSizable == 1){
- var currentClass = headingsObj.getValue(arrSizable[0], "sClass");
- var currentMinWidth = headingsObj.getValue(arrSizable[0], "minWidth");
- if (totalWidth >= currentMinWidth){
- jQuery('#' + tableID + ' .' + currentClass + ' > div').width(totalWidth);
- } else {
- //debugging
- this.removeExtraColumn();
- //alert('remaining width is less than the minWidth for the column (sizable = 1)');
- //what can we do here? I think we have to remove columns to make things fit.
- //this will fail to adjust columns properly if the visible resizable column is not
- //removed by the above function
- }
- //should also update the currentWidth;
- headingsObj.setWidth(arrSizable[0], totalWidth);
- return;//we're done. exit the function
- }
-
- //following is executed if numberSizable is > 1
- //determine if the total width currently set for the sizable columns is equal to the
- //width available on the page.
- var remainingWidth = totalWidth - sizableWidth;
- if (remainingWidth == 0){
- //set columns to currentWidth values
- for (var j in arrSizable){
- var currentSizable = arrSizable[j];
- //var currentMinWidth = headingsObj.getValue(currentSizable, "minWidth");
- var currentWidth = headingsObj.getValue(currentSizable, "currentWidth");
- var currentClass = headingsObj.getValue(currentSizable, "sClass");
- jQuery('#' + tableID + ' .' + currentClass + ' > div').width(currentWidth);
- //since setWidth cannot set a 'currentWidth' smaller than 'minWidth', we
- //should be ok not comparing with 'minWidth' here
- headingsObj.setWidth(currentSizable, currentWidth);
- };
- } else {
- //split the difference between columns and add to each currentWidth, taking care not to go below minWidth
- var remainder = remainingWidth % numberSizable;
- // widthDifference * numberSizable will always be <= remainingWidth
- var widthDifference = Math.floor(remainingWidth / numberSizable);
- var propagate = 0;//we need this variable outside the loop.
- var adjustArr = [];
- for (var j in arrSizable){
- var currentSizable = arrSizable[j];
- var currentMinWidth = headingsObj.getValue(currentSizable, "minWidth");
- var currentWidth = headingsObj.getValue(currentSizable, "currentWidth") + widthDifference - propagate;
- var currentClass = headingsObj.getValue(currentSizable, "sClass");
- //we only want to apply the remainder to the first field if possible
- if (remainder > 0){
- currentWidth++;
- remainder--;
- }
- if (currentWidth >= currentMinWidth){
- adjustObj = {};
- adjustObj.sClass = currentClass;
- adjustObj.availableWidth = currentWidth - currentMinWidth;
- adjustObj.currentWidth = currentWidth;
- adjustObj.currentSizable = currentSizable;
- adjustArr.push(adjustObj);
- jQuery('#' + tableID + ' .' + currentClass + ' > div').width(currentWidth);
- headingsObj.setWidth(currentSizable, currentWidth);
- propagate = 0;
- } else {
- //if we set the column to the currentMinWidth, we have to propagate the difference to
- //another column.
- propagate = currentMinWidth - currentWidth;
- jQuery('#' + tableID + ' .' + currentClass + ' > div').width(currentMinWidth);
- headingsObj.setWidth(currentSizable, currentMinWidth);
- }
- };
- while (propagate > 0){
- //in this case, we need to start taking width from earlier columns
- if (adjustArr.length > 0){
- for (var k in adjustArr){
- var currentAdjust = adjustArr[k];
- //compare the value of propagate with the value of currentAdjust.availableWidth
- var adjustDelta = propagate - currentAdjust.availableWidth;
- if (adjustDelta <= 0){
- jQuery('#' + tableID + ' .' + currentAdjust.sClass + ' > div').width(currentAdjust.currentWidth - propagate);
- headingsObj.setWidth(adjustObj.currentSizable, currentAdjust.currentWidth - propagate);
- return; //we're done
- } else {
- jQuery('#' + tableID + ' .' + currentAdjust.sClass + ' > div').width(currentAdjust.currentWidth - currentAdjust.availableWidth);
- headingsObj.setWidth(adjustObj.currentSizable, currentAdjust.currentWidth - currentAdjust.availableWidth);
- propagate = adjustDelta;
- }
- }
- } else {
- //if propagate is still > 0 when all columns are at minWidth, we have to remove a column from display
- this.removeExtraColumn();
- return; //avoid possible infinite loop
- }
- }
- }
- //totalWidth must be shared between all visible columns
- };
-
- //html content/formatting for expanded row
- this.formatDetails = function(rowNode){
- var tableID = this.getTableID();
- var tableObj = this.getTableObj();
- var rowData = tableObj.fnGetData(rowNode);
- //layerIDs returned from the search are used as OpenLayers layer names
- var layerID = rowData[this.tableHeadingsObj.getColumnIndex("LayerId")];
- var escapedLayerID = org.OpenGeoPortal.Utility.idEscape(layerID);
- var dataType = rowData[this.tableHeadingsObj.getColumnIndex("DataType")];
- var displayName = org.OpenGeoPortal.Utility.escapeQuotes(rowData[this.tableHeadingsObj.getColumnIndex("LayerDisplayName")]);
- var extent = [];
- extent.push(rowData[this.tableHeadingsObj.getColumnIndex("MinX")]);
- extent.push(rowData[this.tableHeadingsObj.getColumnIndex("MinY")]);
- extent.push(rowData[this.tableHeadingsObj.getColumnIndex("MaxX")]);
- extent.push(rowData[this.tableHeadingsObj.getColumnIndex("MaxY")]);
- var sOut = '
';
- //read state
- if (!org.OpenGeoPortal.layerState.layerStateDefined(layerID)){
- org.OpenGeoPortal.layerState.addNewLayer(layerID, {"dataType": dataType});
- }
-
- var opacityVal = org.OpenGeoPortal.layerState.getState(layerID, "opacity") + '%';
-
- sOut += '