diff --git a/geoportal_1/.classpath b/geoportal_1/.classpath
index 6e460c9..38f832c 100644
--- a/geoportal_1/.classpath
+++ b/geoportal_1/.classpath
@@ -23,7 +23,7 @@
-
+
diff --git a/geoportal_1/.project b/geoportal_1/.project
index 863a191..ec3a2d2 100644
--- a/geoportal_1/.project
+++ b/geoportal_1/.project
@@ -30,6 +30,11 @@
+
+ org.springframework.ide.eclipse.core.springbuilder
+
+
+ org.eclipse.m2e.core.maven2Builder
@@ -37,6 +42,7 @@
+ org.springframework.ide.eclipse.core.springnatureorg.eclipse.jem.workbench.JavaEMFNatureorg.eclipse.wst.common.modulecore.ModuleCoreNatureorg.eclipse.jdt.core.javanature
diff --git a/geoportal_1/.settings/org.eclipse.jdt.core.prefs b/geoportal_1/.settings/org.eclipse.jdt.core.prefs
index 107056a..6249222 100644
--- a/geoportal_1/.settings/org.eclipse.jdt.core.prefs
+++ b/geoportal_1/.settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/geoportal_1/.settings/org.eclipse.wst.common.component b/geoportal_1/.settings/org.eclipse.wst.common.component
new file mode 100644
index 0000000..7b3d8d6
--- /dev/null
+++ b/geoportal_1/.settings/org.eclipse.wst.common.component
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/geoportal_1/.settings/org.eclipse.wst.common.project.facet.core.xml b/geoportal_1/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 0000000..5302da1
--- /dev/null
+++ b/geoportal_1/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/geoportal_1/.settings/org.eclipse.wst.validation.prefs b/geoportal_1/.settings/org.eclipse.wst.validation.prefs
new file mode 100644
index 0000000..04cad8c
--- /dev/null
+++ b/geoportal_1/.settings/org.eclipse.wst.validation.prefs
@@ -0,0 +1,2 @@
+disabled=06target
+eclipse.preferences.version=1
diff --git a/geoportal_1/.settings/org.springframework.ide.eclipse.beans.core.prefs b/geoportal_1/.settings/org.springframework.ide.eclipse.beans.core.prefs
new file mode 100644
index 0000000..b0a7cb9
--- /dev/null
+++ b/geoportal_1/.settings/org.springframework.ide.eclipse.beans.core.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+org.springframework.ide.eclipse.beans.core.ignoreMissingNamespaceHandler=false
diff --git a/geoportal_1/.springBeans b/geoportal_1/.springBeans
new file mode 100644
index 0000000..43fe690
--- /dev/null
+++ b/geoportal_1/.springBeans
@@ -0,0 +1,19 @@
+
+
+ 1
+
+
+
+
+
+
+ src/main/webapp/WEB-INF/sample-cas-security-app-context.xml
+ src/main/webapp/WEB-INF/security-app-context.xml
+
+
+ src/main/webapp/WEB-INF/applicationContext.xml
+ src/main/webapp/WEB-INF/appServlet-servlet.xml
+
+
+
+
diff --git a/geoportal_1/pom.xml b/geoportal_1/pom.xml
index 2259289..f2f8e9d 100644
--- a/geoportal_1/pom.xml
+++ b/geoportal_1/pom.xml
@@ -318,6 +318,11 @@
eclipselink2.5.2-M1
+
+ commons-net
+ commons-net
+ 3.3
+ ${warFile.name}
diff --git a/geoportal_1/src/main/java/org/opengeoportal/download/methods/AbstractDownloadMethod.java b/geoportal_1/src/main/java/org/opengeoportal/download/methods/AbstractDownloadMethod.java
index 55ef4c2..a0dd474 100644
--- a/geoportal_1/src/main/java/org/opengeoportal/download/methods/AbstractDownloadMethod.java
+++ b/geoportal_1/src/main/java/org/opengeoportal/download/methods/AbstractDownloadMethod.java
@@ -143,7 +143,7 @@ protected String getUrl(LayerRequest layer) throws Exception{
}
- private File getDirectory() throws IOException{
+ protected File getDirectory() throws IOException{
File downloadDirectory = this.directoryRetriever.getDownloadDirectory();
File newDir = File.createTempFile("OGP", "", downloadDirectory);
newDir.delete();
diff --git a/geoportal_1/src/main/java/org/opengeoportal/download/methods/FileDownloadMethod.java b/geoportal_1/src/main/java/org/opengeoportal/download/methods/FileDownloadMethod.java
index 85182fa..d3f6191 100644
--- a/geoportal_1/src/main/java/org/opengeoportal/download/methods/FileDownloadMethod.java
+++ b/geoportal_1/src/main/java/org/opengeoportal/download/methods/FileDownloadMethod.java
@@ -2,6 +2,7 @@
import java.net.MalformedURLException;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -44,13 +45,24 @@ public String createDownloadRequest() throws Exception {
@Override
public List getUrls(LayerRequest layer) throws MalformedURLException, JsonParseException{
List urls = layer.getDownloadUrl();
- for (String currentUrl: urls){
- logger.info("download url:" + currentUrl);
- try {
- this.checkUrl(currentUrl);
- } catch (MalformedURLException e){
-
+
+ Iterator iter = urls.iterator();
+
+ while(iter.hasNext()){
+ //TODO: expedient way logic to check if its http download.
+ //Should be more elegant in future.
+ String currentUrl = iter.next();
+ if(currentUrl.contains("http")){
+ logger.info("download url:" + currentUrl);
+ try {
+ this.checkUrl(currentUrl);
+ } catch (MalformedURLException e){
+
+ }
}
+ else{
+ iter.remove();
+ }
}
return urls;
};
diff --git a/geoportal_1/src/main/java/org/opengeoportal/download/methods/FtpFileDownloadMethod.java b/geoportal_1/src/main/java/org/opengeoportal/download/methods/FtpFileDownloadMethod.java
new file mode 100644
index 0000000..fa726c5
--- /dev/null
+++ b/geoportal_1/src/main/java/org/opengeoportal/download/methods/FtpFileDownloadMethod.java
@@ -0,0 +1,171 @@
+package org.opengeoportal.download.methods;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.Future;
+import java.io.IOException;
+import java.net.URL;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.net.ftp.FTP;
+import org.apache.commons.net.ftp.FTPClient;
+import org.apache.commons.net.ftp.FTPFile;
+import org.apache.commons.net.ftp.FTPReply;
+import org.opengeoportal.download.types.LayerRequest;
+import org.opengeoportal.utilities.OgpFileUtils;
+import org.springframework.scheduling.annotation.AsyncResult;
+
+import com.fasterxml.jackson.core.JsonParseException;
+
+public class FtpFileDownloadMethod extends AbstractDownloadMethod implements PerLayerDownloadMethod {
+ private static final Boolean INCLUDES_METADATA = false;
+ private static final String METHOD = "GET";
+
+ @Override
+ public Boolean includesMetadata() {
+ return INCLUDES_METADATA;
+ }
+
+ @Override
+ public String getMethod(){
+ return METHOD;
+ }
+
+ @Override
+ public Set getExpectedContentType(){
+ Set expectedContentType = new HashSet();
+ expectedContentType.add("application/zip");
+ return expectedContentType;
+ }
+
+ @Override
+ public Boolean expectedContentTypeMatched(String foundContentType){
+ //a file download could be anything
+ return true;
+ }
+
+ @Override
+ public String createDownloadRequest() throws Exception {
+ return "";
+ }
+
+ @Override
+ public List getUrls(LayerRequest layer) throws MalformedURLException, JsonParseException{
+ List urls = layer.getDownloadUrl();
+ Iterator iter = urls.iterator();
+
+
+ while(iter.hasNext()){
+ String currentUrl = iter.next();
+ if(currentUrl.contains("ftp")){
+ logger.info("download url:" + currentUrl);
+ try {
+ this.checkUrl(currentUrl);
+ } catch (MalformedURLException e){
+
+ }
+ }
+ else
+ urls.remove(currentUrl);
+ }
+ return urls;
+ };
+
+ @Override
+ public Future> download(LayerRequest currentLayer) throws Exception {
+ this.currentLayer = currentLayer;
+ currentLayer.setMetadata(this.includesMetadata());
+
+ File directory = getDirectory();
+ Set fileSet = new HashSet();
+ List urls = this.getUrls(currentLayer);
+ for (String url: urls){
+ InputStream inputStream = null;
+ URL currentURL = new URL(url);
+ String ftpServerAddress = currentURL.getHost();
+ String currentPath = currentURL.getPath();
+
+ FTPClient ftp = new FTPClient();
+ int delimiterIndex = currentPath.lastIndexOf("/");
+ String remoteDirectory = currentPath.substring(0,delimiterIndex);
+ String fileName = currentPath.substring(delimiterIndex+1);
+
+ try{
+ int reply;
+ ftp.connect(ftpServerAddress);
+ ftp.setFileType(FTP.BINARY_FILE_TYPE);
+ //Although they are open FTP servers, in order to access the files, a anonymous login is necessary.
+ ftp.login("anonymous", "anonymous");
+ System.out.println("Connected to " + ftpServerAddress + ".");
+ System.out.print(ftp.getReplyString());
+
+ // After connection attempt, you should check the reply code to verify success.
+ reply = ftp.getReplyCode();
+
+ if(!FTPReply.isPositiveCompletion(reply)) {
+ ftp.disconnect();
+ System.err.println("FTP server refused connection.");
+ System.exit(1);
+ }
+ reply = ftp.getReplyCode();
+
+ //enter passive mode
+ ftp.enterLocalPassiveMode();
+
+ //change current directory
+ ftp.changeWorkingDirectory(remoteDirectory);
+
+ //check if the file with given name exists on ftp server
+ try{
+ FTPFile[] ftpFiles = ftp.listFiles(fileName);
+ if (ftpFiles != null && ftpFiles.length > 0){
+ for (FTPFile file: ftpFiles){
+ if(!file.isFile())
+ continue;
+ System.out.println("Found file:" + file.getName());
+
+ //transfer the file
+ inputStream = ftp.retrieveFileStream(file.getName());
+
+ //save the file and add to fileset
+ //TODO: ftp file does not contain MIME type.
+ File outputFile = OgpFileUtils.createNewFileFromDownload(fileName, "ZIP", directory);
+ //FileUtils with a BufferedInputStream seems to be the fastest method with a small sample size. requires more testing
+ BufferedInputStream bufferedIn = null;
+ try {
+ bufferedIn = new BufferedInputStream(inputStream);
+ FileUtils.copyInputStreamToFile(bufferedIn, outputFile);
+ fileSet.add(outputFile);
+ } finally {
+ IOUtils.closeQuietly(bufferedIn);
+ }
+ }
+ }
+ } catch(IOException e){
+ e.printStackTrace();
+ } finally {
+ ftp.logout();
+ }
+ } catch(IOException e) {
+ e.printStackTrace();
+ } finally {
+ if(ftp.isConnected()) {
+ try {
+ ftp.disconnect();
+ } catch(IOException ioe) {
+ // do nothing
+ }
+ }
+ IOUtils.closeQuietly(inputStream);
+ }
+ }
+ return new AsyncResult>(fileSet);
+ };
+}
diff --git a/geoportal_1/src/main/webapp/WEB-INF/applicationContext.xml b/geoportal_1/src/main/webapp/WEB-INF/applicationContext.xml
index 7f9e3f3..bc3a571 100644
--- a/geoportal_1/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/geoportal_1/src/main/webapp/WEB-INF/applicationContext.xml
@@ -1,7 +1,9 @@
+
+
+
+
+
@@ -306,5 +315,4 @@
-
diff --git a/geoportal_1/src/main/webapp/WEB-INF/ogp.properties b/geoportal_1/src/main/webapp/WEB-INF/ogp.properties
index ac26b80..70df716 100644
--- a/geoportal_1/src/main/webapp/WEB-INF/ogp.properties
+++ b/geoportal_1/src/main/webapp/WEB-INF/ogp.properties
@@ -34,7 +34,7 @@ apikey.google=
# .external needs to be a web accessible url
# note: currently ogp will use only /select and /terms
solr.url.internal=
-solr.url.external=http://geodata.tufts.edu/solr
+solr.url.external=http://ec2-54-87-229-228.compute-1.amazonaws.com:8080/solr
#solr.url.external=http://localhost:8080/solr
diff --git a/geoportal_1/src/main/webapp/WEB-INF/views/jspf/devincludes.jspf b/geoportal_1/src/main/webapp/WEB-INF/views/jspf/devincludes.jspf
index d7f79d4..849fbf3 100644
--- a/geoportal_1/src/main/webapp/WEB-INF/views/jspf/devincludes.jspf
+++ b/geoportal_1/src/main/webapp/WEB-INF/views/jspf/devincludes.jspf
@@ -6,9 +6,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/geoportal_1/src/main/webapp/WEB-INF/views/jspf/includes.jspf b/geoportal_1/src/main/webapp/WEB-INF/views/jspf/includes.jspf
index ac1d5d1..0600437 100644
--- a/geoportal_1/src/main/webapp/WEB-INF/views/jspf/includes.jspf
+++ b/geoportal_1/src/main/webapp/WEB-INF/views/jspf/includes.jspf
@@ -22,6 +22,9 @@ if (!Object.create) {
};
+<%@include file="devincludes.jspf"%>
+
+
+
+
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/ZeroClipboard/ZeroClipboard.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/ZeroClipboard/ZeroClipboard.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/copy document.psd b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/copy document.psd
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/copy.png b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/copy.png
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/copy_hover.png b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/copy_hover.png
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/csv.png b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/csv.png
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/csv_hover.png b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/csv_hover.png
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/file_types.psd b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/file_types.psd
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/print.png b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/print.png
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/print_hover.png b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/print_hover.png
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/printer.psd b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/printer.psd
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/xls.png b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/xls.png
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/xls_hover.png b/geoportal_1/src/main/webapp/resources/javascript/DataTables/extras/TableTools/media/images/xls_hover.png
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests/1_dom/_zero_config.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests/1_dom/_zero_config.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aaSorting.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aaSorting.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aaSortingFixed.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aaSortingFixed.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.bSearchable.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.bSearchable.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.bSortable.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.bSortable.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.bUseRendered.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.bUseRendered.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.bVisible.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.bVisible.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.fnRender.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.fnRender.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.iDataSort.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.iDataSort.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.sClass.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.sClass.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.sName.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.sName.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.sTitle.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.sTitle.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.sWidth.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoColumns.sWidth.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoSearchCols.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/aoSearchCols.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/asStripClasses.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/asStripClasses.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bAutoWidth.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bAutoWidth.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bFilter.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bFilter.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bInfo.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bInfo.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bLengthChange.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bLengthChange.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bPaginate.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bPaginate.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bProcessing.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bProcessing.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bServerSide.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bServerSide.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bSort.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bSort.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bSortClasses.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/bSortClasses.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/fnDrawCallback.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/fnDrawCallback.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/fnFooterCallback.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/fnFooterCallback.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/fnHeaderCallback.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/fnHeaderCallback.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/fnInitComplete.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/fnInitComplete.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/fnRowCallback.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/fnRowCallback.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/iDisplayLength.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/iDisplayLength.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.oPaginate.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.oPaginate.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sInfo.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sInfo.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sInfoEmpty.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sInfoEmpty.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sInfoPostFix.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sInfoPostFix.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sLengthMenu.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sLengthMenu.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sProcessing.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sProcessing.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sSearch.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sSearch.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sUrl.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sUrl.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sZeroRecords.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oLanguage.sZeroRecords.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oSearch.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/oSearch.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/sAjaxSource.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/sAjaxSource.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/sDom.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/sDom.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/sPaginationType.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/1_dom/sPaginationType.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.bSearchable.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.bSearchable.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.bSortable.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.bSortable.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.bUseRendered.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.bUseRendered.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.bVisible.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.bVisible.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.fnRender.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.fnRender.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.iDataSort.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.iDataSort.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.sClass.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.sClass.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.sName.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.sName.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.sWidth.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/2_js/aoColumns.sWidth.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.bSortable.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.bSortable.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.bUseRendered.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.bUseRendered.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.bVisible.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.bVisible.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.fnRender.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.fnRender.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.iDataSort.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.iDataSort.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.sClass.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.sClass.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.sName.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.sName.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.sTitle.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.sTitle.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.sWidth.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/3_ajax/aoColumns.sWidth.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.bSearchable.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.bSearchable.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.bSortable.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.bSortable.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.bUseRendered.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.bUseRendered.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.bVisible.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.bVisible.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.fnRender.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.fnRender.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.sClass.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.sClass.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.sName.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.sName.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.sTitle.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.sTitle.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.sWidth.js b/geoportal_1/src/main/webapp/resources/javascript/DataTables/media/unit_testing/tests_onhold/4_server-side/aoColumns.sWidth.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/jquery/js/jquery-1.5.1.min.js b/geoportal_1/src/main/webapp/resources/javascript/jquery/js/jquery-1.5.1.min.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/jquery/js/jquery-ui-1.8.11.custom.min.js b/geoportal_1/src/main/webapp/resources/javascript/jquery/js/jquery-ui-1.8.11.custom.min.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/jquery/js/jquery-ui-1.8.16.custom.min.js b/geoportal_1/src/main/webapp/resources/javascript/jquery/js/jquery-ui-1.8.16.custom.min.js
old mode 100755
new mode 100644
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/mapDiv.js b/geoportal_1/src/main/webapp/resources/javascript/lib/mapDiv.js
index a8d4f19..0952e07 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/mapDiv.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/mapDiv.js
@@ -191,8 +191,7 @@ OpenGeoportal.MapController = function() {
var options = {
allOverlays : true,
- /* at least until we update our GeoServer instance */
- projection : new OpenLayers.Projection("EPSG:900913"),
+ projection : new OpenLayers.Projection("EPSG:3857"),
maxResolution : 2.8125,
maxExtent : mapBounds,
numZoomLevels: 19,
@@ -294,21 +293,9 @@ OpenGeoportal.MapController = function() {
// register events
jQuery(document).on("container.resize", function(e, data) {
-
- //update the size of the map if the container size actually changed.
- var map$ = jQuery(".olMap");
-
- var newHeight = Math.max(data.ht, data.minHt);
- var oldHeight = map$.height();
-
- var newWidth = Math.max(data.wd, data.minWd);
- var oldWidth = map$.width();
-
- if (newHeight !== oldHeight || newWidth !== oldWidth){
- map$.height(newHeight).width(newWidth);
- that.updateSize();
- }
-
+ jQuery(".olMap").height(Math.max(data.ht, data.minHt));
+ jQuery(".olMap").width(Math.max(data.wd, data.minWd));
+ that.updateSize();
});
@@ -373,7 +360,6 @@ OpenGeoportal.MapController = function() {
this.bboxHandler();
this.styleChangeHandler();
this.opacityHandler();
- this.zIndexHandler();
this.zoomToLayerExtentHandler();
this.previewLayerHandler();
this.getFeatureInfoHandler();
@@ -759,21 +745,6 @@ OpenGeoportal.MapController = function() {
}
});
};
-
- this.zIndexHandler = function() {
- var that = this;
- jQuery(document)
- .on(
- "map.zIndexChange",
- function(event, data) {
- // console.log(data);
- for ( var i in that.getLayersBy("ogpLayerId",
- data.LayerId)) {
- that.getLayersBy("ogpLayerId", data.LayerId)[0]
- .setZIndex(data.zIndex);
- }
- });
- };
this.previewLayerHandler = function() {
var that = this;
@@ -853,9 +824,10 @@ OpenGeoportal.MapController = function() {
var that = this;
jQuery(document)
.on(
- "map.attributeInfoOn",
+ "attributeInfoOn",
+ ".olMap",
function() {
- jQuery(".olMap").css('cursor', "crosshair");
+ jQuery(this).css('cursor', "crosshair");
// also deactivate regular map controls
var zoomControl = that
.getControlsByClass("OpenLayers.Control.ZoomBox")[0];
@@ -868,20 +840,6 @@ OpenGeoportal.MapController = function() {
panControl.deactivate();
}
});
- jQuery(document)
- .on(
- "map.attributeInfoOff",
- function() {
- // if neither zoom or pan is active, activate pan control
- var zoomControl = that
- .getControlsByClass("OpenLayers.Control.ZoomBox")[0];
-
- var panControl = that
- .getControlsByClass("OpenLayers.Control.Navigation")[0];
- if (!panControl.active && !zoomControl.active) {
- panControl.activate();
- }
- });
};
/**
@@ -1116,7 +1074,7 @@ OpenGeoportal.MapController = function() {
this.getGeodeticExtent = function() {
var mercatorExtent = this.getVisibleExtent();
- var sphericalMercator = new OpenLayers.Projection('EPSG:3857');
+ var sphericalMercator = new OpenLayers.Projection('EPSG:900913');
var geodetic = new OpenLayers.Projection('EPSG:4326');
return mercatorExtent.transform(sphericalMercator, geodetic);
};
@@ -1128,7 +1086,7 @@ OpenGeoportal.MapController = function() {
};
this.getSearchCenter = function() {
- var sphericalMercator = new OpenLayers.Projection('EPSG:3857');
+ var sphericalMercator = new OpenLayers.Projection('EPSG:900913');
var geodetic = new OpenLayers.Projection('EPSG:4326');
var topLeft = this.getMapOffset();
var width = jQuery(".olMap").width();
@@ -1497,7 +1455,7 @@ OpenGeoportal.MapController = function() {
var bbox = extent.toBBOX();
requestObj.bbox = bbox;
- requestObj.srs = 'EPSG:900913';
+ requestObj.srs = 'EPSG:3857';
var offset = this.getMapOffset();
var ar = this.getAspectRatio(extent);
@@ -2174,19 +2132,6 @@ OpenGeoportal.MapController = function() {
return layerName;
};
- this.getMaxZ = function(){
- var arrZ = [];
- _.each(this.layers, function(layer){
- arrZ.push(layer.getZIndex());
- });
- return _.max(arrZ);
- },
-
- this.getNextZ = function(){
- return this.getMaxZ() + 5;
- },
-
-
this.addWMSLayer = function(layerModel) {
// mapObj requires institution, layerName, title, datatype, access
/*
@@ -2203,26 +2148,18 @@ OpenGeoportal.MapController = function() {
var layerId = layerModel.get("LayerId");
// check to see if layer is on openlayers map, if so, show layer
var opacitySetting = layerModel.get("opacity");
- var that = this;
-
- var matchingLayers = this.getLayersBy("ogpLayerId", layerId);
- if (matchingLayers.length > 1) {
- throw new Error("ERROR: There should never be more than one copy of the layer on the map");
- } else if (matchingLayers.length === 1){
-
- _.each(matchingLayers, function(layer){
- var nextZ = that.getNextZ();
- layerModel.set({zIndex: nextZ});
-
- that.showLayer(layerId);
- layer.setOpacity(opacitySetting * .01);
-
- });
+ var matchingLayers = this.getLayersBy("ogpLayerId", layerId);
+ for ( var i in matchingLayers) {
+ this.showLayer(layerId);
+ matchingLayers[i].setOpacity(opacitySetting * .01);
return;
}
-
+ if (matchingLayers.length > 1) {
+ console
+ .log("ERROR: There should never be more than one copy of the layer on the map");
+ }
// use a tilecache if we are aware of it
@@ -2232,12 +2169,16 @@ OpenGeoportal.MapController = function() {
// won't actually do anything, since noMagic is true and transparent is
// true
var format;
- if (layerModel.isVector) {
- format = "image/png";
- } else {
+ var dataType = layerModel.get("DataType");
+ if ((dataType == "Raster") || (dataType == "Paper Map")) {
format = "image/jpeg";
+ } else {
+ format = "image/png";
}
+
+ var that = this;
+
// we do a check to see if the layer exists before we add it
jQuery("body").bind(layerModel.get("LayerId") + 'Exists',
@@ -2279,41 +2220,19 @@ OpenGeoportal.MapController = function() {
//console.log(newLayer);
that.addLayer(newLayer);
- try {
- layerModel.set({zIndex: newLayer.getZIndex()});
- } catch (e){
- console.log(e);
- console.log(newLayer.getZIndex());
- }
});
this.layerExists(layerModel);
};
-
+
+ this.openExternalWindow = function(layerModel){
+ var newWindowURL = layerModel.get("Location").externalLink;
+ window.open(newWindowURL, "_blank","toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500, width=400, height=400");
+ };
+
+
// thanks to Allen Lin, U of MN
this.addArcGISRestLayer = function(layerModel) {
- var layerId = layerModel.get("LayerId");
- // check to see if layer is on openlayers map, if so, show layer
- var opacitySetting = layerModel.get("opacity");
- var that = this;
-
- var matchingLayers = this.getLayersBy("ogpLayerId", layerId);
-
- if (matchingLayers.length > 1) {
- throw new Error("ERROR: There should never be more than one copy of the layer on the map");
- } else if (matchingLayers.length === 1){
-
- _.each(matchingLayers, function(layer){
- var nextZ = that.getNextZ();
- layerModel.set({zIndex: nextZ});
-
- that.showLayer(layerId);
- layer.setOpacity(opacitySetting * .01);
-
- });
- return;
- }
-
// won't actually do anything, since noMagic is true and transparent is
// true
var format;
@@ -2327,23 +2246,23 @@ OpenGeoportal.MapController = function() {
// (per geoserver docs)
var newLayer = new OpenLayers.Layer.ArcGIS93Rest(
layerModel.get("LayerDisplayName"),
- layerModel.get("Location").ArcGISRest,
+ layerModel.get("Location").ArcGISRest + "/export",
{
- layers : "show:" + layerModel.get("Name"),
+ layers : "show:" + layerModel.get("Location").layerId,
transparent : true
}, {
buffer : 0,
transitionEffect : 'resize',
- opacity : opacitySetting,
- ogpLayerId : layerId
+ opacity : layerModel.get("opacity"),
+ ogpLayerId : layerModel.get("LayerId")
});
newLayer.projection = new OpenLayers.Projection("EPSG:3857");
// how should this change? trigger custom events with jQuery
newLayer.events.register('loadstart', newLayer, function() {
- jQuery(document).trigger({type: "showLoadIndicator", loadType: "layerLoad", layerId: layerId});
+ jQuery(document).trigger({type: "showLoadIndicator", loadType: "layerLoad", layerId: layerModel.get("LayerId")});
});
newLayer.events.register('loadend', newLayer, function() {
- jQuery(document).trigger({type: "hideLoadIndicator", loadType: "layerLoad", layerId: layerId});
+ jQuery(document).trigger({type: "hideLoadIndicator", loadType: "layerLoad", layerId: layerModel.get("LayerId")});
});
var that = this;
// we do a cursory check to see if the layer exists before we add it
@@ -2435,7 +2354,11 @@ OpenGeoportal.MapController = function() {
type : "default",
onHandler : this.addMapBBox,
offHandler : this.hideLayer
- } ];
+ }, {
+ type : "externalLink",
+ onHandler : this.openExternalWindow,
+ offHandler : this.hideLayer
+ }];
for ( var i in previewMethods) {
if (previewMethods[i].type === previewType) {
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/models/cartCollection.js b/geoportal_1/src/main/webapp/resources/javascript/lib/models/cartCollection.js
index a9f3caa..cd49f3f 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/models/cartCollection.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/models/cartCollection.js
@@ -59,7 +59,7 @@ OpenGeoportal.CartCollection = Backbone.Collection
model : OpenGeoportal.Models.CartLayer,
initialize : function() {
- this.template = OpenGeoportal.ogp.template;
+
this.listenTo(this, "invalid", function(model, error) {
console.log(error);
});
@@ -74,17 +74,14 @@ OpenGeoportal.CartCollection = Backbone.Collection
},
addLayer : function(model, options) {
+
// check the login object
- var loginModel = OpenGeoportal.ogp.appState.get("login").model;
- var hasAccess = loginModel.hasAccess(model);
+ var hasAccess = OpenGeoportal.ogp.appState.get("login").model
+ .hasAccess(model);
if (!hasAccess) {
- var canLogin = loginModel.canLogin(model);
- if (this.showAuthWarning(model, canLogin)){
- this.addWithWarning(model, canLogin);
- } else {
- this.add(model);
- }
+ this.addWithWarning(model);
+ // alert("Must log in to preview or download this layer.");
} else {
this.add(model);
@@ -110,34 +107,62 @@ OpenGeoportal.CartCollection = Backbone.Collection
}
},
- ShowWarningId: "showAuthenticationWarning",
-
- getLocalProperty: function(){
- return this.ShowWarningId + "Local";
-
+ ignoreAuthenticationWarning : {
+ local : false,
+ external : false
},
-
- getExternalProperty: function(){
- return this.ShowWarningId + "External";
- },
-
- showAuthWarning: function(model, canLogin){
- var showDialog = true;
+ addWithWarning : function(layerModel) {
+ var ignoreWarning = false;
+ if (typeof options !== "undefined"
+ && typeof options.ignoreWarning != "undefined") {
+ ignoreWarning = options.ignoreWarning;
+ }
+ var canLogin = OpenGeoportal.ogp.appState.get("login").model
+ .canLogin(layerModel);
+
+ var institution = layerModel.get("Institution");
+ var ignoreWarningId = "ignoreAuthenticationWarning";
+ var disposition;
+ var warningMessage = 'This layer is restricted by licensing agreement to the '
+ + institution + ' community. ';
+ var that = this;
+
if (canLogin) {
- //check local storage for val;
- showDialog = OpenGeoportal.Utility.LocalStorage.getBool(this.getLocalProperty(), true);
+ disposition = "local";
+
+ warningMessage += 'Restricted layers can be added to the Cart, but you must login before you can preview or download restricted layers.';
+
} else {
- //check local storage for val;
- showDialog = OpenGeoportal.Utility.LocalStorage.getBool(this.getExternalProperty(), true);
+ disposition = "external";
+
+ warningMessage += 'Restricted layers can be added to the Cart here, but you must use '
+ + institution;
+ warningMessage += "'s site and login to preview or download restricted layers.";
+
}
- return showDialog;
- },
+ warningMessage += " ";
+ warningMessage += '';
+
+ if (this.ignoreAuthenticationWarning[disposition]) {
+ this.add(layerModel);
+ return;
+ }
+
+ jQuery(document)
+ .on(
+ "change",
+ "#" + ignoreWarningId,
+ function() {
+ that.ignoreAuthenticationWarning[disposition] = jQuery(
+ this).is(":checked");
+ });
+
+ var dialog$ = OpenGeoportal.ogp.widgets.genericModalDialog(warningMessage, "Restricted Layer");
-
- addWithWarning : function(layerModel, canLogin) {
- var that = this;
var addToCartFunction = function() {
that.add(layerModel);
jQuery(this).dialog('close');
@@ -177,40 +202,22 @@ OpenGeoportal.CartCollection = Backbone.Collection
};
var cancelFunction = function() {
-
+ // that.IgnoreAuthenticationWarning[disposition] =
+ // jQuery("#" + ignoreWarningId).is(":checked");
jQuery(this).dialog('close');
};
- var institution = layerModel.get("Institution");
- var localeWarning = "";
var buttons = {};
- var lsProperty = "";
-
if (canLogin) {
- localeWarning = this.template.restrictedWarningLocal();
buttons["Login & Add"] = loginAndAddFunction;
buttons["Add Only"] = addToCartFunction;
buttons["Cancel"] = cancelFunction;
- lsProperty = this.getLocalProperty();
} else {
- localeWarning = this.template.restrictedWarningExternal({repository: institution});
buttons["Add"] = addToCartFunction;
buttons["Cancel"] = cancelFunction;
- lsProperty = this.getExternalProperty();
}
-
- var warningMessage = this.template.restrictedWarning({repository: institution, localeWarning: localeWarning});
- var dialog$ = OpenGeoportal.ogp.widgets.genericModalDialog(warningMessage, "Restricted Layer");
-
- dialog$.on("click", ".doNotShow", function(){
- var show = true;
- if (jQuery(this).is("input:checked")){
- show = false;
- }
- OpenGeoportal.Utility.LocalStorage.setBool(lsProperty, show);
- });
-
+ //var dialog$ = jQuery('#' + divId);
dialog$.dialog({
width : 535,
buttons : buttons
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/models/previewedLayers.js b/geoportal_1/src/main/webapp/resources/javascript/lib/models/previewedLayers.js
index c5d36f8..e82f5c5 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/models/previewedLayers.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/models/previewedLayers.js
@@ -137,7 +137,10 @@ OpenGeoportal.Models.PreviewLayer = OpenGeoportal.Models.ProtocolAware.extend({
} else if (OpenGeoportal.Utility.hasLocationValueIgnoreCase(
locationObj, [ "externalLink" ])) {
previewType = "externalLink";
- }
+ } else if (OpenGeoportal.Utility.hasLocationValueIgnoreCase(
+ locationObj, [ "download" ])) {
+ previewType = "externalLink";
+ } //TODO: this is a expedient elseif, will ultimately be deleted.
this.set({
@@ -169,31 +172,9 @@ OpenGeoportal.PreviewedLayers = Backbone.Collection.extend({
this.listenTo(this, "change:graphicWidth change:color",
this.changeLayerStyle);
this.listenTo(this, "change:opacity", this.changeLayerOpacity);
- this.listenTo(this, "change:zIndex", this.changeZIndex);
this.listenTo(this, "change:getFeature", this.changeGetFeatureState);
},
-
- comparator: function(model1, model2){
- var getComparison = function(model){
- var comp = 0;
- if (model.has("zIndex")){
- comp = model.get("zIndex");
- }
- return comp;
- };
-
- var val1 = getComparison(model1);
- var val2 = getComparison(model2);
- if (val1 > val2){
- return -1;
- } else if (val2 > val1){
- return 1;
- } else {
- return 0;
- }
- },
-
changeLayerStyle : function(model, val, options) {
var layerId = model.get("LayerId");
// tell map to change the linewidth/pointsize/borderwidth for this layer
@@ -203,7 +184,6 @@ OpenGeoportal.PreviewedLayers = Backbone.Collection.extend({
LayerId : layerId
});
},
-
changeLayerOpacity : function(model, val, options) {
var value = model.get("opacity");
var layerId = model.get("LayerId");
@@ -213,19 +193,6 @@ OpenGeoportal.PreviewedLayers = Backbone.Collection.extend({
opacity : value
});
},
-
- changeZIndex : function(model, val, options) {
- this.sort();
-
- var value = model.get("zIndex");
- var layerId = model.get("LayerId");
- // tell map to change the zIndex for this layer
- jQuery(document).trigger("map.zIndexChange", {
- LayerId : layerId,
- zIndex : value
- });
- },
-
changeGetFeatureState : function(model, val, options) {
var value = model.get("getFeature");
var layerId = model.get("LayerId");
@@ -242,34 +209,14 @@ OpenGeoportal.PreviewedLayers = Backbone.Collection.extend({
jQuery(document).trigger(mapEvent, {
LayerId : layerId
});
-
- this.checkGetFeatureState();
},
-
- /**
- * check to see if getFeature is turned on for any layers and fire
- * appropriate event
- */
- checkGetFeatureState : function(){
- var gfEvent = "map.attributeInfoOff";
- this.each(function(model){
- if (model.get("getFeature")){
- gfEvent = "map.attributeInfoOn";
- return;
- }
- });
-
- jQuery(document).trigger(gfEvent);
-
-
- },
-
changePreview : function(model, val, options) {
// console.log(arguments);
var preview = model.get("preview");
var layerId = model.get("LayerId");
if (preview === "on") {
+
jQuery(document).trigger("previewLayerOn", {
LayerId : layerId
});// show layer on map
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/templates/template.js b/geoportal_1/src/main/webapp/resources/javascript/lib/templates/template.js
index 6f74ab6..f622220 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/templates/template.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/templates/template.js
@@ -182,7 +182,7 @@ OpenGeoportal.Template = function() {
formatControlHtml += ' ';
this.formatSelectionControl = _.template(formatControlHtml);
- var clipControlHtml = 'checked="checked" <% } %>/> \n';
+ var clipControlHtml = ' \n';
this.clipControl = _.template(clipControlHtml);
var addEmailHtml = '
\n';
@@ -221,23 +221,11 @@ OpenGeoportal.Template = function() {
this.webServicesDialogContent = _.template(webServicesDialogContentHtml);
- var doNotShowHtml = '';
-
- var restrictedWarningHtml = 'This layer is restricted by licensing agreement to the <%= repository %> community. <%= localeWarning %> ' + doNotShowHtml + '';
- this.restrictedWarning = _.template(restrictedWarningHtml);
-
- var restrictedWarningLocalHtml = 'Restricted layers can be added to the Cart, but you must login before you can preview or download restricted layers.';
- this.restrictedWarningLocal = _.template(restrictedWarningLocalHtml);
-
- var restrictedWarningExternalHtml = 'Restricted layers can be added to the Cart here, but you must use <%= repository %>\'s site and login to preview or download restricted layers.';
- this.restrictedWarningExternal = _.template(restrictedWarningExternalHtml);
-
-
+
var infoBubbleHtml = '
<%= content %>'
- + doNotShowHtml
- + '
';
+ + '
';
this.infoBubble = _.template(infoBubbleHtml);
var welcomeTextHtml = '
'
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/userInterface.js b/geoportal_1/src/main/webapp/resources/javascript/lib/userInterface.js
index c7e35c9..217c3cb 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/userInterface.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/userInterface.js
@@ -23,11 +23,6 @@ OpenGeoportal.Structure = function() {
*/
this.init = function() {
- this.WelcomeBubbleAttr = "welcomeBubble";
- this.DirectionsBubble1Attr = "directionsBubble";
-
- this.infoBubbleAttrs = [this.WelcomeBubbleAttr, this.DirectionsBubble1Attr];
-
this.resizeWindowHandler();
this.searchToggleHandler();
@@ -50,40 +45,20 @@ OpenGeoportal.Structure = function() {
};
this.resetHandler = function() {
- var that = this;
jQuery(".reset").on("click", function() {
analytics.track("Interface", "Reset Page");
-
- var cartAuthWarningArr = ["showAuthenticationWarningExternal", "showAuthenticationWarningLocal"];
- OpenGeoportal.Utility.LocalStorage.resetItems(cartAuthWarningArr);
- that.resetShowInfo();
-
-
window.location = window.location;
});
};
- //clear info bubble prefs from local storage
- this.resetShowInfo = function(){
- OpenGeoportal.Utility.LocalStorage.resetItems(this.infoBubbleAttrs);
- },
-
- this.doShowInfo = function(key){
- return OpenGeoportal.Utility.LocalStorage.getBool(key, true);
- },
-
-
-
this.introFlow = function(hasSharedLayers) {
- var bubble1 = "welcomeBubble";
-
- if (this.doShowInfo(bubble1) && !hasSharedLayers) {
- var $bubble1 = this.showInfoBubble(bubble1);
+ if (!hasSharedLayers) {
+ this.showInfoBubble();
var that = this;
jQuery(document).one("fireSearch", function(event) {
- $bubble1.hide({
+ jQuery("#welcomeBubble").hide({
effect : "drop",
duration : 250,
//queue : false,
@@ -92,13 +67,10 @@ OpenGeoportal.Structure = function() {
mode : "open"
});
jQuery(document).one("panelOpen", function() {
- var bubble2 = "directionsBubble";
- if (that.doShowInfo(bubble2)){
- var $bubbleDir = that.showDirectionsBubble_1(bubble2);
- jQuery(document).one("click focus", function() {
- $bubbleDir.hide("drop");
- });
- }
+ that.showDirectionsBubble();
+ jQuery(document).one("click focus", function() {
+ jQuery("#directionsBubble").hide("drop");
+ });
});
}
});
@@ -106,26 +78,21 @@ OpenGeoportal.Structure = function() {
});
} else {
- // if there are shared layers or user has selected "do not show again", don't show the infobubble intro
+ // if there are shared layers, don't show the infobubble intro
// open the left column panel
this.panelView.model.set({
mode : "open"
});
-
- if (hasSharedLayers){
- // set tab to the "cart" tab if there are shared layers
- jQuery("#tabs").tabs({
- active : 1
- });
- } else {
- //fire a search
- jQuery(document).trigger("fireSearch");
- }
+ // set tab to the "cart" tab
+ jQuery("#tabs").tabs({
+ active : 1
+ });
}
};
this.initializeTabs = function() {
+ var that = this;
jQuery("#tabs").tabs(
{
active : 0,
@@ -210,30 +177,25 @@ OpenGeoportal.Structure = function() {
this.resizeWindowHandler = function() {
+ var rollRightWidth = jQuery("#roll_right").width() + 1;// border
var minHeight = parseInt(jQuery("#container").css("min-height"));
var minWidth = parseInt(jQuery("#container").css("min-width"));
+ var that = this;
var resizeElements = function() {
-
var headerHeight = jQuery("#header").height();
var footerHeight = jQuery("#footer").height();
- var fixedHeights = headerHeight + footerHeight + 3;
- var container$ = jQuery("#container");
-
- var oldContainerWidth = container$.width();
+ var fixedHeights = headerHeight + footerHeight + 4;
var newContainerWidth = Math.max(jQuery(window).width(), minWidth);
-
- var oldContainerHeight = container$.height();
+ //jQuery("#map").width(newContainerWidth);
+ // if left_col is visible. else other siblings width update map
+ // size...
var newContainerHeight = Math.max(jQuery(window).height()
- fixedHeights, minHeight);
+ jQuery("#container").height(newContainerHeight).width(newContainerWidth);
- //resize the container if there is a change.
- if ((newContainerWidth !== oldContainerWidth)||(newContainerHeight !== oldContainerHeight)){
- container$.height(newContainerHeight).width(newContainerWidth);
- jQuery(document).trigger("container.resize", {ht: newContainerHeight, wd: newContainerWidth, minHt: minHeight, minWd: minWidth});
- }
-
+ jQuery(document).trigger("container.resize", {ht: newContainerHeight, wd: newContainerWidth, minHt: minHeight, minWd: minWidth});
};
resizeElements();
jQuery(window).resize(resizeElements);
@@ -252,7 +214,7 @@ OpenGeoportal.Structure = function() {
var stepTime = 50;
var thisId = jQuery(thisObj).attr('id');
var hght = jQuery(".searchFormRow").height();
- jQuery(".olControlModPanZoomBar, .olControlPanel, #mapToolBar, #neCorner, #nwCorner").addClass("slideVertical");
+ jQuery(".olControlModPanZoomBar, .olControlPanel, #mapToolBar").addClass("slideVertical");
if (thisId === 'moreSearchOptions') {
@@ -389,7 +351,7 @@ OpenGeoportal.Structure = function() {
}
};
- this.showInfoBubble = function(elId) {
+ this.showInfoBubble = function() {
var params = {
"height" : 335,
"width" : 700,
@@ -397,10 +359,10 @@ OpenGeoportal.Structure = function() {
"left" : 269,
"arrow" : "top"
};
- return this.infoBubble(elId, this.template.welcomeText(), params);
+ this.infoBubble("welcomeBubble", this.template.welcomeText(), params);
};
- this.showDirectionsBubble_1 = function(elId) {
+ this.showDirectionsBubble = function() {
var params = {
"height" : 250,
@@ -409,7 +371,7 @@ OpenGeoportal.Structure = function() {
"left" : 520,
"arrow" : "left"
};
- return this.infoBubble(elId, this.template.directionsText(), params);
+ this.infoBubble("directionsBubble", this.template.directionsText(), params);
};
this.showDowntimeNotice = function() {
@@ -450,13 +412,6 @@ OpenGeoportal.Structure = function() {
infoBubble$.fadeOut("slow");
}).fadeIn("slow");
- infoBubble$.on("click", ".doNotShow", function(){
- var show = true;
- if (jQuery(this).is("input:checked")){
- show = false;
- }
- OpenGeoportal.Utility.LocalStorage.setBool(bubbleId, show);
- });
return infoBubble$;
};
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/utility.js b/geoportal_1/src/main/webapp/resources/javascript/lib/utility.js
index 35e55cb..dbf22b6 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/utility.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/utility.js
@@ -83,42 +83,6 @@ OpenGeoportal.Utility.CurrentTab = 0;
}
return searchInfo;
};*/
-OpenGeoportal.Utility.LocalStorage = {};
-OpenGeoportal.Utility.LocalStorage.setBool = function(key, boolVal){
-
- if (window.localStorage){
- var val = "false";
- if (boolVal){
- val = "true";
- }
- window.localStorage.setItem(key, val);
- }
-
-};
-
-OpenGeoportal.Utility.LocalStorage.getBool = function(key, defaultVal){
- var bool = false;
- if (typeof defaultVal !== "undefined"){
- bool = defaultVal;
- }
- if (window.localStorage){
- var item = window.localStorage.getItem(key);
- if (item !== null){
- bool = item == "true";
- }
- }
-
- return bool;
-};
-
-OpenGeoportal.Utility.LocalStorage.resetItems = function(arrKeys){
- if (window.localStorage){
- _.each(arrKeys, function(item){
- window.localStorage.removeItem(item);
- });
- }
-};
-
OpenGeoportal.Utility.rgb2hex = function(rgb) {
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/views/download.js b/geoportal_1/src/main/webapp/resources/javascript/lib/views/download.js
index de3d355..f069ea1 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/views/download.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/views/download.js
@@ -258,7 +258,7 @@ OpenGeoportal.Views.Download = OpenGeoportal.Views.CartActionView
jQuery(document).on("change", "#" + rasterControlId,
function() {
var uiValue = jQuery(this).val();
- that.preferences.set({
+ this.preferences.set({
rasterChoice : uiValue
});
@@ -272,19 +272,19 @@ OpenGeoportal.Views.Download = OpenGeoportal.Views.CartActionView
} else {
// create the clip control
- var clipControlId = "downloadClipControl";
html += this.template.clipControl({
- elId : clipControlId,
+ id : "downloadClipControl",
isClipped : this.preferences.get("isClipped")
});
// update the preferences model when the ui element changes
- jQuery(document).on("change", "#" + clipControlId,
+ jQuery(document).on("change", "#downloadClipControl",
function() {
- that.preferences.set({
+ this.preferences.set({
isClipped : jQuery(this).is(":checked")
});
+
});
}
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/views/dynamicWebServices.js b/geoportal_1/src/main/webapp/resources/javascript/lib/views/dynamicWebServices.js
index 46fef30..b42342e 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/views/dynamicWebServices.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/views/dynamicWebServices.js
@@ -140,9 +140,6 @@ OpenGeoportal.Views.WebServices = OpenGeoportal.Views.CartActionView
serviceTypes.wmc = wmcService;
var that = this;
- //remove existing click handlers for the button
- jQuery(document).off("click", "#" + wmcButtonId);
-
jQuery(document).on("click", "#" + wmcButtonId, function(){
//generate and return the wmc
//var bbox = jQuery("#" + bboxId).val();
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/views/layerTable.js b/geoportal_1/src/main/webapp/resources/javascript/lib/views/layerTable.js
index 2b7c1eb..2237df3 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/views/layerTable.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/views/layerTable.js
@@ -104,7 +104,7 @@ OpenGeoportal.Views.LayerTable = Backbone.View
renderHeaders: function(){
- this.$el.children(".tableWrapper").children(".tableHeaders").first().replaceWith(this.template.tableHeader(this.getHeaderInfo()));
+ this.$el.children(".tableWrapper").children(".tableHeaders").html(this.template.tableHeader(this.getHeaderInfo()));
},
@@ -142,6 +142,7 @@ OpenGeoportal.Views.LayerTable = Backbone.View
this.updateColWidths();
this.resizeColumns();
+
this.$el.trigger("render");
return this;
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/views/leftPanel.js b/geoportal_1/src/main/webapp/resources/javascript/lib/views/leftPanel.js
index 1c08ffb..7457394 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/views/leftPanel.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/views/leftPanel.js
@@ -178,7 +178,7 @@ OpenGeoportal.Views.LeftPanel = Backbone.View
jQuery(".slideHorizontal").fadeOut();
this.$el.animate({
- 'width' : jQuery('#container').width()
+ 'width' : jQuery('#container').width() - 2
}, {
queue : false,
duration : 500,
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewControls.js b/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewControls.js
index ecfb648..550323f 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewControls.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewControls.js
@@ -354,6 +354,7 @@ OpenGeoportal.Views.PreviewTools = Backbone.View.extend({
var getFeature = model.get("getFeature");
if (getFeature) {
button$.removeClass(offClass).addClass(onClass);
+ jQuery(".olMap").trigger("attributeInfoOn");
} else {
button$.removeClass(onClass).addClass(offClass);
}
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewedLayersRow.js b/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewedLayersRow.js
index 037ee05..1196f13 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewedLayersRow.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewedLayersRow.js
@@ -25,13 +25,32 @@ OpenGeoportal.Views.PreviewedLayersRow = OpenGeoportal.Views.LayerRow.extend({
},
toggleSave: function(e){
- //if not in cart, add it. if in cart, remove it.
- var match = this.cart.findWhere({LayerId: this.model.get("LayerId")});
- if (typeof match === "undefined"){
- var that = this;
- jQuery(e.currentTarget).effect("transfer", { to: ".shoppingCartIcon", easing: "swing", className: "ui-effects-transfer-to-cart inCart" }, 400, function(){that.cart.toggleCartState(that.model);});
- } else {
- this.cart.toggleCartState(this.model);
+ //First check if it's externalDownload, if yes. Open don't add it to cart
+ if (this.model.get("Location").externalDownload){
+ var dialogText = "To download this layer, please visit this link. ";
+ var dialogDiv = "
" + dialogText + "
";
+ jQuery(dialogDiv).dialog({
+ modal: true,
+ draggable: false,
+ buttons: [
+ {
+ text: "OK",
+ click: function() {
+ $( this ).dialog( "close" );
+ }
+ }
+ ]
+ });
+ }
+ else{
+ //if not in cart, add it. if in cart, remove it.
+ var match = this.cart.findWhere({LayerId: this.model.get("LayerId")});
+ if (typeof match === "undefined"){
+ var that = this;
+ jQuery(e.currentTarget).effect("transfer", { to: ".shoppingCartIcon", easing: "swing", className: "ui-effects-transfer-to-cart inCart" }, 400, function(){that.cart.toggleCartState(that.model);});
+ } else {
+ this.cart.toggleCartState(this.model);
+ }
}
},
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewedLayersTable.js b/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewedLayersTable.js
index 4412a55..326d09b 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewedLayersTable.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/views/previewedLayersTable.js
@@ -25,7 +25,6 @@ OpenGeoportal.Views.PreviewedLayersTable = OpenGeoportal.Views.LayerTable
var that = this;
this.tableConfig.listenTo(this.collection, "change:visible", function(model){ that.updateSubviews.call(that);});
this.listenTo(this.collection, "change:showControls", function(){jQuery(document).trigger("previewRow.expand");});
- this.listenTo(this.collection, "change:zIndex", this.render);
},
diff --git a/geoportal_1/src/main/webapp/resources/javascript/lib/views/searchResultsRow.js b/geoportal_1/src/main/webapp/resources/javascript/lib/views/searchResultsRow.js
index e7ad80c..0750d26 100644
--- a/geoportal_1/src/main/webapp/resources/javascript/lib/views/searchResultsRow.js
+++ b/geoportal_1/src/main/webapp/resources/javascript/lib/views/searchResultsRow.js
@@ -60,7 +60,7 @@ OpenGeoportal.Views.SearchResultsRow = OpenGeoportal.Views.LayerRow.extend({
// "model" to be called
var that = this;
this.$el.css("opacity", ".5");
- var to$ = jQuery(".previewedLayers").find(".tableRow").first();
+ var to$ = jQuery(".previewedLayers").find(".tableRow").last();
if (to$.length === 0){
to$ = jQuery(".previewedLayers");
}
@@ -77,7 +77,7 @@ OpenGeoportal.Views.SearchResultsRow = OpenGeoportal.Views.LayerRow.extend({
update.showControls = true;
var that = this;
this.$el.css("opacity", ".5");
- var to$ = jQuery(".previewedLayers").find(".tableRow").first();
+ var to$ = jQuery(".previewedLayers").find(".tableRow").last();
if (to$.length === 0){
to$ = jQuery(".previewedLayers");
}
@@ -154,14 +154,32 @@ OpenGeoportal.Views.SearchResultsRow = OpenGeoportal.Views.LayerRow.extend({
},
toggleSave: function(e){
- //if not in cart, add it. if in cart, remove it.
- var match = this.cart.findWhere({LayerId: this.model.get("LayerId")});
- if (typeof match === "undefined"){
- var that = this;
- jQuery(e.currentTarget).effect("transfer", { to: ".shoppingCartIcon", easing: "swing", className: "ui-effects-transfer-to-cart inCart" }, 400, function(){that.cart.toggleCartState(that.model);});
- } else {
- this.cart.toggleCartState(this.model);
+ //First check if it's externalDownload, if yes. Open don't add it to cart
+ if (this.model.get("Location").externalDownload){
+ var dialogText = "To download this layer, please visit this link. ";
+ var dialogDiv = "