diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e69de29bb2..6169b7de27 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -0,0 +1,67 @@ +name: Linux GitHub CI + +on: [pull_request,push,workflow_dispatch] + +env: + MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Xmx512m -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS + TAKARI_SMART_BUILDER_VERSION: 0.6.1 + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-22.04 + jdk: 8 + steps: + - uses: actions/checkout@v4 + with: + # 500 commits, set to 0 to get all + fetch-depth: 500 + submodules: 'recursive' + show-progress: 'false' + - name: Set up JDK + uses: actions/setup-java@v3.12.0 + with: + distribution: 'temurin' + java-version: ${{ matrix.jdk }} + cache: 'maven' + - name: Build with Maven + run: mvn -B -V install -DskipTests=true -Dmaven.javadoc.skip=true + - name: Remove SNAPSHOT jars from repository + run: | + find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {} + - name: Remove Schema 3.8 jars from repository + run: | + find ~/.m2/repository -name "*3.8*" -type d | xargs rm -rf {} + + QA: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + # 500 commits, set to 0 to get all + fetch-depth: 500 + submodules: 'recursive' + show-progress: 'false' + - name: Set up JDK + uses: actions/setup-java@v3.12.0 + with: + distribution: 'temurin' + java-version: 8 + cache: 'maven' + - name: Set up Maven + uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.6.3 + - name: Test with maven + run: | + mvn resources:resources@copy-index-schema-to-source -f web + mvn -B -V -fae verify -Pit + - name: Remove SNAPSHOT jars from repository + run: | + find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {} + - name: Remove Schema 3.8 jars from repository + run: | + find ~/.m2/repository -name "*3.8*" -type d | xargs rm -rf {} diff --git a/core/pom.xml b/core/pom.xml index e05b8180e9..7080b4b325 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -128,18 +128,6 @@ log4j-core ${log4j2.version} - - - org.apache.logging.log4j - log4j-jul - ${log4j2.version} - - - - org.apache.logging.log4j - log4j-slf4j-impl - test - org.apache.logging.log4j @@ -454,19 +442,10 @@ com.github.librepdf openpdf - - com.github.librepdf - openpdf - org.mapfish.print print-lib - - - com.itextpdf - itextpdf - com.itextpdf diff --git a/core/src/main/java/jeeves/config/springutil/JeevesNodeAwareLogoutSuccessHandler.java b/core/src/main/java/jeeves/config/springutil/JeevesNodeAwareLogoutSuccessHandler.java index 9c61ff3a74..8442c90959 100644 --- a/core/src/main/java/jeeves/config/springutil/JeevesNodeAwareLogoutSuccessHandler.java +++ b/core/src/main/java/jeeves/config/springutil/JeevesNodeAwareLogoutSuccessHandler.java @@ -88,14 +88,14 @@ protected String determineTargetUrl(HttpServletRequest request, HttpServletRespo String siteHost = settingManager.getValue(Settings.SYSTEM_SERVER_HOST); String siteProtocol = settingManager.getValue(Settings.SYSTEM_SERVER_PROTOCOL); - + // some conditional logic to handle the case where there's no port in the settings SettingInfo si = new SettingInfo(); - int sitePort = si.getSitePort(); + int sitePort = si.getSitePort(); if (!hostName.equalsIgnoreCase(siteHost) || - !protocol.equalsIgnoreCase(siteProtocol) || - port != sitePort) { + !protocol.equalsIgnoreCase(siteProtocol) || + port != sitePort) { urlPatternValue = getDefaultTargetUrl(); } } catch (MalformedURLException e) { diff --git a/core/src/main/java/org/fao/geonet/kernel/AccessManager.java b/core/src/main/java/org/fao/geonet/kernel/AccessManager.java index 46e8b17e3c..4c8820b248 100644 --- a/core/src/main/java/org/fao/geonet/kernel/AccessManager.java +++ b/core/src/main/java/org/fao/geonet/kernel/AccessManager.java @@ -23,7 +23,6 @@ package org.fao.geonet.kernel; -import static org.fao.geonet.kernel.setting.Settings.SYSTEM_METADATAPRIVS_PUBLICATIONBYGROUPOWNERONLY; import jeeves.server.UserSession; import jeeves.server.context.ServiceContext; import org.apache.commons.lang.StringUtils; diff --git a/core/src/main/java/org/fao/geonet/kernel/GeonetworkDataDirectory.java b/core/src/main/java/org/fao/geonet/kernel/GeonetworkDataDirectory.java index ab467a227e..7d3403a208 100644 --- a/core/src/main/java/org/fao/geonet/kernel/GeonetworkDataDirectory.java +++ b/core/src/main/java/org/fao/geonet/kernel/GeonetworkDataDirectory.java @@ -210,6 +210,17 @@ public static File getLogfile() { return Log.getLogfile(); } + /** + * Logfile location as determined from appender, or system property, or default. + *

+ * Note this code is duplicated with the deprecated {@code LogConfig}. + * + * @return logfile location, or {@code null} if unable to determine + */ + public static File getLogfile() { + return Log.getLogfile(); + } + /** * Determines the location of a property based on the * following lookup mechanism: diff --git a/core/src/main/java/org/fao/geonet/kernel/Thesaurus.java b/core/src/main/java/org/fao/geonet/kernel/Thesaurus.java index 7b819e6c76..d9937ed895 100644 --- a/core/src/main/java/org/fao/geonet/kernel/Thesaurus.java +++ b/core/src/main/java/org/fao/geonet/kernel/Thesaurus.java @@ -125,9 +125,6 @@ public class Thesaurus { private Cache THESAURUS_SEARCH_CACHE; - private Cache THESAURUS_SEARCH_CACHE; - - /** * Available for subclasses. */ diff --git a/core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataManager.java b/core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataManager.java index 0c2bad2f03..61ba225106 100644 --- a/core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataManager.java +++ b/core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataManager.java @@ -49,7 +49,6 @@ import org.fao.geonet.kernel.schema.SchemaPlugin; import org.fao.geonet.kernel.search.EsSearchManager; import org.fao.geonet.kernel.search.IndexingMode; -import org.fao.geonet.kernel.search.IndexingMode; import org.fao.geonet.kernel.search.index.BatchOpsMetadataReindexer; import org.fao.geonet.kernel.setting.SettingManager; import org.fao.geonet.kernel.setting.Settings; @@ -742,7 +741,8 @@ public synchronized AbstractMetadata updateMetadata(final ServiceContext context session.removeProperty(Geonet.Session.VALIDATION_REPORT + metadataId); } String schema = metadataSchemaUtils.getMetadataSchema(metadataId); -final AbstractMetadata metadata = metadataUtils.findOne(metadataId); + + final AbstractMetadata metadata = metadataUtils.findOne(metadataId); if (updateDateStamp) { if (StringUtils.isEmpty(changeDate)) { @@ -752,6 +752,7 @@ public synchronized AbstractMetadata updateMetadata(final ServiceContext context metadata.getDataInfo().setChangeDate(new ISODate(changeDate)); } } + String uuidBeforeUfo = null; if (ufo) { String parentUuid = null; diff --git a/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java b/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java index f6fec5105f..746b9d8cc1 100644 --- a/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java +++ b/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java @@ -212,7 +212,7 @@ private void addMDFields(Element doc, Path schemaDir, IndexingMode indexingMode) { final Path styleSheet = getXSLTForIndexing(schemaDir, metadataType); try { - Map indexParams = new HashMap(); + Map indexParams = new HashMap<>(); indexParams.put("fastIndexMode", indexingMode.equals(IndexingMode.core)); Element fields = Xml.transform(metadata, styleSheet, indexParams); diff --git a/core/src/main/java/org/fao/geonet/kernel/security/openidconnect/OidcUser2GeonetworkUser.java b/core/src/main/java/org/fao/geonet/kernel/security/openidconnect/OidcUser2GeonetworkUser.java index af9c456f8e..3c0cf6f3d7 100644 --- a/core/src/main/java/org/fao/geonet/kernel/security/openidconnect/OidcUser2GeonetworkUser.java +++ b/core/src/main/java/org/fao/geonet/kernel/security/openidconnect/OidcUser2GeonetworkUser.java @@ -161,9 +161,6 @@ public UserDetails getUserDetails(OidcIdToken idToken, Map attributes, boolean w */ //from keycloak protected void updateGroups(Map> profileGroups, User user) { - // First we remove all previous groups - userGroupRepository.deleteAll(UserGroupSpecs.hasUserId(user.getId())); - Set userGroups = new HashSet<>(); // Now we add the groups diff --git a/core/src/test/java/org/fao/geonet/kernel/LocalXLinksInMetadataIntegrationTest.java b/core/src/test/java/org/fao/geonet/kernel/LocalXLinksInMetadataIntegrationTest.java index 59be77bf04..5b141a82cb 100644 --- a/core/src/test/java/org/fao/geonet/kernel/LocalXLinksInMetadataIntegrationTest.java +++ b/core/src/test/java/org/fao/geonet/kernel/LocalXLinksInMetadataIntegrationTest.java @@ -110,8 +110,6 @@ public void testResolveLocalXLink() throws Exception { String id = _dataManager.insertMetadata(context, schema, metadata, uuid, owner, groupOwner, source, metadataType, null, null, createDate, changeDate, false, IndexingMode.none); - SpringLocalServiceInvoker mockInvoker = resetAndGetMockInvoker(); - String keyword1 = "World"; Element element1 = new SAXBuilder().build(new StringReader(String.format(responseTemplate, keyword1))).getRootElement(); when(springLocalServiceInvoker.invoke(any(String.class))).thenReturn(element1); diff --git a/csw-server/src/main/java/org/fao/geonet/component/csw/Transaction.java b/csw-server/src/main/java/org/fao/geonet/component/csw/Transaction.java index e5e174bc20..f571bb968b 100644 --- a/csw-server/src/main/java/org/fao/geonet/component/csw/Transaction.java +++ b/csw-server/src/main/java/org/fao/geonet/component/csw/Transaction.java @@ -23,8 +23,6 @@ package org.fao.geonet.component.csw; -import org.fao.geonet.kernel.search.IndexingMode; -import org.locationtech.jts.util.Assert; import jeeves.server.UserSession; import jeeves.server.context.ServiceContext; import org.fao.geonet.ApplicationContextHolder; @@ -360,6 +358,7 @@ private int updateTransaction(Element request, Element xml, ServiceContext conte } beforeMetadata = metadataUtils.findOneByUuid(uuid).getXmlData(false); + String language = context.getLanguage(); dataMan.updateMetadata(context, id, xml, applyValidation, applyUpdateFixedInfo, diff --git a/docs/manual/overrides/.icons/.DS_Store b/docs/manual/overrides/.icons/.DS_Store new file mode 100644 index 0000000000..f215feb303 Binary files /dev/null and b/docs/manual/overrides/.icons/.DS_Store differ diff --git a/docs/manual/pom.xml b/docs/manual/pom.xml index ce640cbbb1..ddf7357a22 100644 --- a/docs/manual/pom.xml +++ b/docs/manual/pom.xml @@ -27,7 +27,7 @@ gn-docs org.geonetwork-opensource - 4.2.6-0 + 4.2.6-georchestra 4.0.0 gn-guide diff --git a/doi/src/main/java/org/fao/geonet/doi/client/DoiClient.java b/doi/src/main/java/org/fao/geonet/doi/client/DoiClient.java deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/doi/src/main/java/org/fao/geonet/doi/client/DoiManager.java b/doi/src/main/java/org/fao/geonet/doi/client/DoiManager.java index 99ba085056..87871c21d7 100644 --- a/doi/src/main/java/org/fao/geonet/doi/client/DoiManager.java +++ b/doi/src/main/java/org/fao/geonet/doi/client/DoiManager.java @@ -301,11 +301,6 @@ private void checkPreConditions(AbstractMetadata metadata, String doi) throws Do .withDescriptionKey("exception.doi.missingSavedquery.description", new String[]{ metadata.getUuid(), schema.getName(), SavedQuery.DOI_GET, e.getMessage(), - schema.getName() }) - .withMessageKey("exception.doi.missingSavedquery") - .withDescriptionKey("exception.doi.missingSavedquery.description", - new String[]{ metadata.getUuid(), schema.getName(), - DOI_GET_SAVED_QUERY, e.getMessage(), schema.getName() }); } } diff --git a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java index b7bc3247d7..bec3d2cda1 100644 --- a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java +++ b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java @@ -26,7 +26,6 @@ import jeeves.server.UserSession; import jeeves.server.context.ServiceContext; import org.apache.commons.lang.StringUtils; -import org.apache.logging.log4j.ThreadContext; import org.fao.geonet.Logger; import org.fao.geonet.constants.Geonet; import org.fao.geonet.csw.common.exceptions.InvalidParameterValueEx; @@ -606,6 +605,7 @@ protected OperResult harvest() { cancelMonitor.set(false); try { String logfile = LogUtil.initializeHarvesterLog(getType(), this.getParams().getName()); + this.log.info("Starting harvesting of " + this.getParams().getName()); error = null; errors.clear(); diff --git a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/Aligner.java b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/Aligner.java index e0ea47b0f4..b7f4ac58be 100644 --- a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/Aligner.java +++ b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/Aligner.java @@ -43,7 +43,6 @@ import org.fao.geonet.kernel.harvest.harvester.*; import org.fao.geonet.kernel.mef.*; import org.fao.geonet.kernel.search.IndexingMode; -import org.fao.geonet.kernel.search.IndexingMode; import org.fao.geonet.kernel.setting.SettingManager; import org.fao.geonet.kernel.setting.Settings; import org.fao.geonet.repository.GroupRepository; diff --git a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/simpleUrl/Aligner.java b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/simpleUrl/Aligner.java deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/integration-test/pom.xml b/integration-test/pom.xml index c00bed3fb8..a0e5f8e69a 100644 --- a/integration-test/pom.xml +++ b/integration-test/pom.xml @@ -60,7 +60,7 @@ org.apache.logging.log4j - log4j-slf4j18-impl + log4j-slf4j-impl ${log4j2.version} diff --git a/pom.xml b/pom.xml index 7ebc810090..99943707c4 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,8 @@ geonetwork-users-fr@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geonetwork-users-fr https://lists.sourceforge.net/lists/options/geonetwork-users-fr - http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-francophone-f3880536.html + http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-francophone-f3880536.html + Usuarios (es) @@ -228,6 +229,10 @@ org.apache.maven.plugins maven-compiler-plugin 3.8.1 + + 1.8 + 1.8 + maven-assembly-plugin @@ -260,10 +265,8 @@ 1.8 true UTF-8 - - - -proc:none - + -proc:none + @@ -529,12 +532,9 @@ 1.10 - - org.apache.logging.log4j - log4j-slf4j18-impl - ${log4j2.version} - - + + + org.apache.logging.log4j log4j-slf4j-impl ${log4j2.version} @@ -649,6 +649,11 @@ gt-xsd-gml3 ${geotools.version} + + org.geotools.xsd + gt-xsd-fes + ${geotools.version} + org.geotools.xsd gt-xsd-core @@ -691,11 +696,6 @@ gt-xsd-wfs ${geotools.version} - - org.geotools.xsd - gt-xsd-fes - ${geotools.version} - org.geotools gt-epsg-extension @@ -924,14 +924,6 @@ test - - - org.apache.directory.server - apacheds-all - 2.0.0-M24 - test - - com.h2database @@ -966,20 +958,15 @@ - org.jsoup - jsoup - 1.14.3 + org.springframework + spring-context + ${spring.version} com.neovisionaries nv-i18n 1.29 - - org.springframework - spring-context - ${spring.version} - org.springframework spring-beans @@ -1178,7 +1165,7 @@ com.sun.xml.bind jaxb-impl - 2.3.0 + 2.2.11 org.elasticsearch.client @@ -1326,52 +1313,9 @@ messaging estest index - georchestra-integration - - jdk11+ - - [11,) - - - 11 - - - - - javax.annotation - javax.annotation-api - 1.3.2 - - - javax.xml.bind - jaxb-api - 2.3.1 - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 11 - 11 - true - UTF-8 - - -proc:none - --add-exports - java.base/sun.net.ftp=ALL-UNNAMED - - - - - - toolchain @@ -1491,6 +1435,8 @@ geonetwork WEB-INF/config.properties + 1.8 + 1.8 @@ -1505,10 +1451,9 @@ GEONETWORK_DB_CONNECTION_PROPERTIES= --> - - + ${geonetwork.db.type:h2} - ../config-db/postgres-postgis.xml + ../config-db/${db.type}.xml #{systemEnvironment['GEONETWORK_DB_HOST']?:'localhost'} #{systemEnvironment['GEONETWORK_DB_PORT']} #{systemEnvironment['GEONETWORK_DB_NAME']?:'~/gn'} diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/formatter/xsl-view/view.xsl b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/formatter/xsl-view/view.xsl index c00ff22be6..abb49d9377 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/formatter/xsl-view/view.xsl +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/formatter/xsl-view/view.xsl @@ -192,7 +192,8 @@ - + @@ -200,8 +201,7 @@ - - + @@ -257,18 +257,19 @@

{$schemaStrings/overview} - - -
- - - -
-
-
+ class="gn-img-thumbnail center-block" + alt="{$schemaStrings/overview}" + src="{mcc:fileName/*}" + onerror="{$imgOnError}"/> + + +
+ + + +
+
+ @@ -318,7 +319,7 @@ select="mdb:identificationInfo/*/mri:citation/*/cit:otherCitationDetails"/> --> - + diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/layout/config-editor.xml b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/layout/config-editor.xml index 59faa4af1f..2fd90f1191 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/layout/config-editor.xml +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/layout/config-editor.xml @@ -321,14 +321,14 @@ data-variables="cit:role/cit:CI_RoleCode/@codeListValue~{role}"/> - + diff --git a/services/src/main/java/org/fao/geonet/api/records/MetadataInsertDeleteApi.java b/services/src/main/java/org/fao/geonet/api/records/MetadataInsertDeleteApi.java index 837192ec1b..0c7c8388d8 100644 --- a/services/src/main/java/org/fao/geonet/api/records/MetadataInsertDeleteApi.java +++ b/services/src/main/java/org/fao/geonet/api/records/MetadataInsertDeleteApi.java @@ -982,13 +982,6 @@ private Pair loadRecord(MetadataType metadataType, Element xmlE metadataValidator.doValidate(metadata, context.getLanguage()); } - if (rejectIfInvalid) { - // Persist the validation status - AbstractMetadata metadata = metadataRepository.findOneById(iId); - - metadataValidator.doValidate(metadata, context.getLanguage()); - } - dataManager.indexMetadata(id.get(0), true); return Pair.read(Integer.valueOf(id.get(0)), uuid); } @@ -1011,24 +1004,6 @@ private void checkUserProfileToImportMetadata(UserSession userSession) { } - /** - * Checks if the user profile is allowed to import metadata. - * - * @param userSession - */ - private void checkUserProfileToDeletePublishedMetadata(UserSession userSession) { - if (userSession.getProfile() != Profile.Administrator) { - String allowedUserProfileToImportMetadata = - StringUtils.defaultIfBlank(settingManager.getValue(Settings.METADATA_PUBLISHED_DELETE_USERPROFILE), Profile.Editor.toString()); - - // Is the user profile is higher than the profile allowed to import metadata? - if (!hasHierarchyRole(allowedUserProfileToImportMetadata, this.roleHierarchy)) { - throw new NotAllowedException("The user has no permissions to delete published metadata."); - } - } - - } - /** * Checks if the user profile is allowed to import metadata. * diff --git a/services/src/main/java/org/fao/geonet/api/records/MetadataUtils.java b/services/src/main/java/org/fao/geonet/api/records/MetadataUtils.java index 633588e205..89ec9b7ab0 100644 --- a/services/src/main/java/org/fao/geonet/api/records/MetadataUtils.java +++ b/services/src/main/java/org/fao/geonet/api/records/MetadataUtils.java @@ -742,38 +742,6 @@ private static Element getRecord(String uuid, ServiceContext context, DataManage return content; } - public static void backupRecord(AbstractMetadata metadata, ServiceContext context) { - Log.trace(Geonet.DATA_MANAGER, "Backing up record " + metadata.getId()); - Path outDir = Lib.resource.getRemovedDir(metadata.getId()); - Path outFile; - try { - // When metadata records contains character not supported by filesystem - // it may be an issue. eg. acri-st.fr/96443 - outFile = outDir.resolve(URLEncoder.encode(metadata.getUuid(), Constants.ENCODING) + ".zip"); - } catch (UnsupportedEncodingException e1) { - outFile = outDir.resolve(String.format( - "backup-%s-%s.mef", - new Date(), metadata.getUuid())); - } - - Path file = null; - try { - file = MEFLib.doExport(context, metadata.getUuid(), "full", false, true, false, false, true); - Files.createDirectories(outDir); - try (InputStream is = IO.newInputStream(file); - OutputStream os = Files.newOutputStream(outFile)) { - BinaryFile.copy(is, os); - } - } catch (Exception e) { - throw new RuntimeException("Error performing backup on record '" + metadata.getUuid() + "'. Contact the system administrator if the problem persists: " + e.getMessage(), e); - } finally { - if (file != null) { - IO.deleteFile(file, false, Geonet.MEF); - } - } - } - - /** * Returns the metadata validation status from the database, calculating/storing the validation if not stored. * diff --git a/services/src/main/java/org/fao/geonet/api/site/LogUtils.java b/services/src/main/java/org/fao/geonet/api/site/LogUtils.java index 22916ad274..4c96a564e7 100644 --- a/services/src/main/java/org/fao/geonet/api/site/LogUtils.java +++ b/services/src/main/java/org/fao/geonet/api/site/LogUtils.java @@ -23,7 +23,6 @@ package org.fao.geonet.api.site; -import net.bytebuddy.pool.TypePool; import org.apache.log4j.xml.DOMConfigurator; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.LoggerContext; @@ -33,13 +32,10 @@ import org.fao.geonet.exceptions.OperationAbortedEx; import org.fao.geonet.kernel.setting.Settings; import org.fao.geonet.repository.SettingRepository; -import org.springframework.beans.BeansException; import java.io.IOException; import java.net.URISyntaxException; -import java.net.MalformedURLException; import java.net.URL; -import java.nio.file.Paths; import java.util.Optional; /** diff --git a/services/src/main/java/org/fao/geonet/api/site/LoggingApi.java b/services/src/main/java/org/fao/geonet/api/site/LoggingApi.java index c24332baaa..23aa1cc388 100644 --- a/services/src/main/java/org/fao/geonet/api/site/LoggingApi.java +++ b/services/src/main/java/org/fao/geonet/api/site/LoggingApi.java @@ -26,7 +26,6 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.commons.io.IOUtils; -import org.fao.geonet.ApplicationContextHolder; import org.fao.geonet.api.site.model.ListLogFilesResponse; import org.fao.geonet.kernel.GeonetworkDataDirectory; import org.fao.geonet.util.FileUtil; @@ -89,15 +88,8 @@ public List getLogFiles( ) throws Exception { java.util.List logFileList = new ArrayList<>(); - String loggingConfigurationFolder = dataDirectory.getWebappDir() + "/WEB-INF/classes"; - // overrides if a "loggingConfigurationPath" bean is available - try { - loggingConfigurationFolder = (String) ApplicationContextHolder.get().getBean("loggingConfigurationPath"); - } catch (Exception e) { - // stick with the folder in the classpath. - } - - File folder = new File(loggingConfigurationFolder); + String classesFolder = dataDirectory.getWebappDir() + "/WEB-INF/classes"; + File folder = new File(classesFolder); if (folder != null && folder.isDirectory()) { Pattern pattern = Pattern.compile(regexp, Pattern.CASE_INSENSITIVE); diff --git a/services/src/test/java/org/fao/geonet/api/records/extent/MetadataExtentApiTest.java b/services/src/test/java/org/fao/geonet/api/records/extent/MetadataExtentApiTest.java index 5e77ab4277..11508b137f 100644 --- a/services/src/test/java/org/fao/geonet/api/records/extent/MetadataExtentApiTest.java +++ b/services/src/test/java/org/fao/geonet/api/records/extent/MetadataExtentApiTest.java @@ -126,7 +126,7 @@ public void getOneRecordExtentAsImage() throws Exception { .andReturn().getResponse().getContentAsByteArray(); saveImageToDiskIfConfiguredToDoSo(reponseBuffer, name.getMethodName()); - assertEquals("a50d8f6a997196220c53f17ec7208e9f", DigestUtils.md5DigestAsHex(reponseBuffer)); + assertEquals("0a2ea00341921f0c6e8b8997e3b87c14", DigestUtils.md5DigestAsHex(reponseBuffer)); } @Test @@ -156,7 +156,7 @@ public void lastModifiedModified() throws Exception { .andExpect(content().contentType(API_PNG_EXPECTED_ENCODING)) .andReturn().getResponse().getContentAsByteArray(); - assertEquals("a50d8f6a997196220c53f17ec7208e9f", DigestUtils.md5DigestAsHex(reponseBuffer)); + assertEquals("0a2ea00341921f0c6e8b8997e3b87c14", DigestUtils.md5DigestAsHex(reponseBuffer)); } @Test @@ -173,7 +173,7 @@ public void aggregatedWithTwoExtent() throws Exception { .andReturn().getResponse().getContentAsByteArray(); saveImageToDiskIfConfiguredToDoSo(reponseBuffer, name.getMethodName()); - assertEquals("76ddbcef8515da9c7282df2e87326216", DigestUtils.md5DigestAsHex(reponseBuffer)); + assertEquals("5808105ac9395326b81e9d036a6f3e81", DigestUtils.md5DigestAsHex(reponseBuffer)); } @Test @@ -198,7 +198,7 @@ public void twoExtentFirstOneWithBothBoundingBoxAndPolygon() throws Exception { .andReturn().getResponse().getContentAsByteArray(); saveImageToDiskIfConfiguredToDoSo(reponseBuffer, name.getMethodName() + "-1"); - assertEquals("f67948f632c73da0d9f803c4ebc23837", DigestUtils.md5DigestAsHex(reponseBuffer)); + assertEquals("b3e8eef2afbfc83c363119f6e8e613e2", DigestUtils.md5DigestAsHex(reponseBuffer)); reponseBuffer = mockMvc.perform(get(String.format("/srv/api/records/%s/extents/2.png", uuid)) .session(mockHttpSession) @@ -208,7 +208,7 @@ public void twoExtentFirstOneWithBothBoundingBoxAndPolygon() throws Exception { .andReturn().getResponse().getContentAsByteArray(); saveImageToDiskIfConfiguredToDoSo(reponseBuffer, name.getMethodName() + "-2"); - assertEquals("6e3dce78985748504058eb89c690a0bf", DigestUtils.md5DigestAsHex(reponseBuffer)); + assertEquals("cfe247f701d64118453981245c793972", DigestUtils.md5DigestAsHex(reponseBuffer)); reponseBuffer = mockMvc.perform(get(String.format("/srv/api/records/%s/extents/3.png", uuid)) .session(mockHttpSession) @@ -218,7 +218,7 @@ public void twoExtentFirstOneWithBothBoundingBoxAndPolygon() throws Exception { .andReturn().getResponse().getContentAsByteArray(); saveImageToDiskIfConfiguredToDoSo(reponseBuffer, name.getMethodName() + "-3"); - assertEquals("d69a05542cf41eb63b633dbd79b9c6ac", DigestUtils.md5DigestAsHex(reponseBuffer)); + assertEquals("25812922c1f5f660d922e80a1ccc3689", DigestUtils.md5DigestAsHex(reponseBuffer)); } @@ -244,7 +244,7 @@ public void threeExtentThirdOne() throws Exception { .andReturn().getResponse().getContentAsByteArray(); saveImageToDiskIfConfiguredToDoSo(reponseBuffer, name.getMethodName()); - assertEquals("ac1cfd40a4c9600c6cd8951bdc9cf201", DigestUtils.md5DigestAsHex(reponseBuffer)); + assertEquals("0d28fdd025cb58cd50a5fa7c1f43995c", DigestUtils.md5DigestAsHex(reponseBuffer)); } @Test @@ -269,7 +269,7 @@ public void threeExtentThirdOne115_3() throws Exception { .andReturn().getResponse().getContentAsByteArray(); saveImageToDiskIfConfiguredToDoSo(reponseBuffer, name.getMethodName()); - assertEquals("860aa9005026571e3a0428546e411771", DigestUtils.md5DigestAsHex(reponseBuffer)); + assertEquals("d4d930688949095e2cd41996113a1455", DigestUtils.md5DigestAsHex(reponseBuffer)); } @Test @@ -286,7 +286,7 @@ public void threeExtentThirdOneIsABoundingBox() throws Exception { .andReturn().getResponse().getContentAsByteArray(); saveImageToDiskIfConfiguredToDoSo(reponseBuffer, name.getMethodName()); - assertEquals("d69a05542cf41eb63b633dbd79b9c6ac", DigestUtils.md5DigestAsHex(reponseBuffer)); + assertEquals("25812922c1f5f660d922e80a1ccc3689", DigestUtils.md5DigestAsHex(reponseBuffer)); } private String createTestData() throws Exception { diff --git a/web-ui/pom.xml b/web-ui/pom.xml index 08b0757cc5..ed0da4f910 100644 --- a/web-ui/pom.xml +++ b/web-ui/pom.xml @@ -118,40 +118,4 @@ - - - tests-and-static-analysis - - - !skipTests - - - - - - com.github.searls - jasmine-maven-plugin - 1.3.1.3 - - - jasmine-javascript-tests - test - - - - - - ${project.basedir}/src/main/resources/catalog/js - ${project.basedir}/src/test/jasmine - INTERNET_EXPLORER_9 - true - - - - - - diff --git a/web-ui/src/main/resources/catalog/components/common/map/print/PrintDirective.js b/web-ui/src/main/resources/catalog/components/common/map/print/PrintDirective.js index bd0a25e1cb..c931fbd411 100644 --- a/web-ui/src/main/resources/catalog/components/common/map/print/PrintDirective.js +++ b/web-ui/src/main/resources/catalog/components/common/map/print/PrintDirective.js @@ -108,6 +108,7 @@ var http = $http.get($scope.options.printConfigUrl); http.then(function (response) { var data = response.data; + $scope.capabilities = data; // default values: diff --git a/web-ui/src/main/resources/catalog/components/common/map/print/PrintMapDirective.js b/web-ui/src/main/resources/catalog/components/common/map/print/PrintMapDirective.js index 7b4d8e529c..1c9deec232 100644 --- a/web-ui/src/main/resources/catalog/components/common/map/print/PrintMapDirective.js +++ b/web-ui/src/main/resources/catalog/components/common/map/print/PrintMapDirective.js @@ -97,6 +97,7 @@ var http = $http.get(options.printConfigUrl); http.then(function (response) { var data = response.data; + // default values: var layout = data.layouts[0]; if ($scope.defaultLayout) { diff --git a/web-ui/src/main/resources/catalog/components/common/ows/OWSService.js b/web-ui/src/main/resources/catalog/components/common/ows/OWSService.js index 411e75e4f0..d4f963e3c9 100644 --- a/web-ui/src/main/resources/catalog/components/common/ows/OWSService.js +++ b/web-ui/src/main/resources/catalog/components/common/ows/OWSService.js @@ -335,17 +335,20 @@ cache: true, timeout: timeout }) - .then(function (response) { + .then( + function (response) { var data = response.data; - if (data) { - defer.resolve(parseWMTSCapabilities(data)); - } else { - defer.reject(); + + if (data) { + defer.resolve(parseWMTSCapabilities(data)); + } else { + defer.reject(); + } + }, + function (response) { + defer.reject(response.status); } - }, - function (response) { - defer.reject(response.status); - }); + ); } } return defer.promise; @@ -370,7 +373,7 @@ }) .then( function (response) { - var xfsCap = parseWFSCapabilities(response.data); + var xfsCap = parseWFSCapabilities(response.data); if (!xfsCap || xfsCap.exception != undefined) { defer.reject({ @@ -408,7 +411,7 @@ }) .then( function (response) { - var xfsCap = parseWCSCapabilities(response.data); + var xfsCap = parseWCSCapabilities(response.data); if (!xfsCap || xfsCap.exception != undefined) { defer.reject({ @@ -585,7 +588,6 @@ name == layers[i].name.localPart || name == layers[i].name.prefix + ":" + layers[i].name.localPart || name == layers[i].Name - ) { needles.push(layers[i]); continue; diff --git a/web-ui/src/main/resources/catalog/components/common/savedselections/SavedSelectionsDirective.js b/web-ui/src/main/resources/catalog/components/common/savedselections/SavedSelectionsDirective.js index 55715735b1..9862ed92e3 100644 --- a/web-ui/src/main/resources/catalog/components/common/savedselections/SavedSelectionsDirective.js +++ b/web-ui/src/main/resources/catalog/components/common/savedselections/SavedSelectionsDirective.js @@ -442,14 +442,15 @@ } scope.$watch( - "user", function (n, o) { - if (n !== o || scope.selections === null) { - scope.selections = null; - controller.getSelections(scope.user).then(function (selections) { - scope.selections = selections; - }); - } - }, + "user", + function (n, o) { + if (n !== o || scope.selections === null) { + scope.selections = null; + controller.getSelections(scope.user).then(function (selections) { + scope.selections = selections; + }); + } + }, true ); diff --git a/web-ui/src/main/resources/catalog/components/common/scrollspy/partials/scrollspy.html b/web-ui/src/main/resources/catalog/components/common/scrollspy/partials/scrollspy.html index 73a39ac3ef..3ec5ec7e00 100644 --- a/web-ui/src/main/resources/catalog/components/common/scrollspy/partials/scrollspy.html +++ b/web-ui/src/main/resources/catalog/components/common/scrollspy/partials/scrollspy.html @@ -2,14 +2,14 @@ diff --git a/web-ui/src/main/resources/catalog/components/edit/geopublisher/GeoPublisherDirective.js b/web-ui/src/main/resources/catalog/components/edit/geopublisher/GeoPublisherDirective.js index da23bfae4d..f91efaab94 100644 --- a/web-ui/src/main/resources/catalog/components/edit/geopublisher/GeoPublisherDirective.js +++ b/web-ui/src/main/resources/catalog/components/edit/geopublisher/GeoPublisherDirective.js @@ -272,7 +272,7 @@ scope.statusCode = response.data.description; scope.isPublished = false; } -); + ); }; /** diff --git a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcService.js b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcService.js index ff9bbc2568..6d0003da1d 100644 --- a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcService.js +++ b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcService.js @@ -140,8 +140,7 @@ if (params.wmsResources.addLayerNamesMode == "resourcename") { angular.extend(params, { - name: names.join(","), - desc: descs.join(",") + name: names.join(",") }); } } @@ -210,7 +209,6 @@ } ); }); - }); }; /** @@ -715,12 +713,14 @@ * @param {Object} onlinesrc the online resource to remove */ removeOnlinesrc: function (onlinesrc) { -var url = onlinesrc.lUrl || onlinesrc.url; + var url = onlinesrc.lUrl || onlinesrc.url; if ( url.match(".*/api/records/' + gnCurrentEdit.uuid + '/attachments/.*") != null ) { url = gnUrlUtils.remove(url, ["approved"], true); - } return runProcess( + } + + return runProcess( this, setParams("onlinesrc-remove", { id: gnCurrentEdit.id, diff --git a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html index 17b5ff46ef..405682e079 100644 --- a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html +++ b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html @@ -64,7 +64,10 @@ data-ng-if="key === 'function' && !params.linkType.fields.function.hidden" > - @@ -77,7 +80,6 @@ data-allow-blank="true" data-selected-info="params.function" data-gn-schema-info="function" - lang="lang" > @@ -94,7 +96,10 @@ data-ng-if="key === 'protocol' && !params.linkType.fields.protocol.hidden" > - @@ -125,29 +130,7 @@ id="gn-addonlinesrc-mimeType-label" class="col-sm-2 control-label" data-gn-field-tooltip="{{schema}}|{{params.linkType.fields.mimeType.tooltip}}" - > - mimeType - -
- -
- -
- - -
-
@@ -156,7 +139,6 @@ type="text" name="format" data-ng-model="params.mimeType" - data-gn-field-tooltip="{{schema}}|{{params.linkType.fields.mimeType.tooltip}}" />
@@ -175,7 +157,8 @@ for="gn-addonlinesrc-url-list-single-input" class="col-sm-2 control-label" data-translate="" - data-gn-field-tooltip="{{schema}}|{{params.linkType.fields.url.tooltip}}">urlurl
+
@@ -215,7 +197,6 @@ type="text" data-ng-blur="loadCurrentLink()" id="gn-addonlinesrc-url-list-single-input" - data-gn-field-tooltip="{{schema}}|{{params.linkType.fields.url.tooltip}}" placeholder="{{params.linkType.fields.url.placeholder || 'https://...'}}" /> @@ -353,7 +334,6 @@ class="form-control input-sm" lang="{{val}}" data-ng-model="params.name[val]" - data-gn-field-tooltip="{{schema}}|{{params.linkType.fields.name.tooltip}}" data-ng-readonly='config.wmsResources.addLayerNamesMode == "resourcename" && OGCProtocol != null && isWMSProtocol()' /> @@ -411,7 +391,6 @@ data-ng-model="params.desc[val]" class="form-control input-sm" placeholder="description" - data-gn-field-tooltip="{{schema}}|{{params.linkType.fields.desc.tooltip}}" name="description" />
@@ -445,7 +424,8 @@ for="gn-addonlinesrc-profile-input" class="col-sm-2 control-label" data-translate="" - data-gn-field-tooltip="{{schema}}|{{params.linkType.fields.applicationProfile.tooltip}}">applicationProfileapplicationProfile
diff --git a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/fileUploader.html b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/fileUploader.html index 414fd5b90e..632e09735d 100644 --- a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/fileUploader.html +++ b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/fileUploader.html @@ -17,10 +17,10 @@ data-ng-src="{{onlinesrcService.getApprovedUrl(f.lUrl || f.id)}}" /> - -
-
- +
+
+
+
{{::ctrl.item.count}} {{::ctrl.item.value | facetTranslator: (ctrl.facet.meta && - ctrl.facet.meta.field) ||ctrl.facet.key | - capitalize}} + ctrl.facet.meta.field) || ctrl.facet.key | capitalize}} diff --git a/web-ui/src/main/resources/catalog/components/elasticsearch/directives/partials/facet.html b/web-ui/src/main/resources/catalog/components/elasticsearch/directives/partials/facet.html index 5437ad91b0..f9e101a394 100644 --- a/web-ui/src/main/resources/catalog/components/elasticsearch/directives/partials/facet.html +++ b/web-ui/src/main/resources/catalog/components/elasticsearch/directives/partials/facet.html @@ -44,13 +44,13 @@ - {{::(ctrl.item.inverted ? 'filterWithValue' : 'allValuesExcept') | translate}} + {{(ctrl.item.inverted ? 'filterWithValue' : 'allValuesExcept') | translate}}
diff --git a/web-ui/src/main/resources/catalog/components/index/partials/datafilterview.html b/web-ui/src/main/resources/catalog/components/index/partials/datafilterview.html index a0784048b9..62a4ed3470 100644 --- a/web-ui/src/main/resources/catalog/components/index/partials/datafilterview.html +++ b/web-ui/src/main/resources/catalog/components/index/partials/datafilterview.html @@ -15,7 +15,10 @@
+ data-url="{{layer.get('url')}}" + class="clearfix" + data-map="map" + >
', - className: "gn-status-popup", - onCloseCallback: function () { - scope.$emit("metadataStatusUpdated", true); - scope.$emit("StatusUpdated", true); - scope.$broadcast("operationOnSelectionStop"); - scope.processReport = null; - } - }, - scope, - "StatusUpdated" - ); - }, - function (response) { - scope.$broadcast("operationOnSelectionStop"); - scope.$emit("metadataStatusUpdated", false); - - scope.$emit("StatusUpdated", { - title: $translate.instant("metadataStatusUpdatedErrors"), - error: response.data, - timeout: 0, - type: "danger" - }); - } - ); - }; - } - }; - } - ]); - - module.directive("gnMetadataBatchSubmit", [ - "$translate", - "$http", - "gnMetadataManager", - "gnUtilityService", - function ($translate, $http, gnMetadataManager, gnUtilityService) { - return { - restrict: "A", - replace: true, - templateUrl: - "../../catalog/components/metadataactions/partials/" + "batchsubmit.html", - scope: { - selectionBucket: "@" - }, - link: function (scope) { - var translations = null; - $translate(["metadataSubmitted"]).then(function (t) { - translations = t; - }); - - scope.changeMessage = ""; - - scope.submit = function () { - scope.$broadcast("operationOnSelectionStart"); - - return $http - .put("../api/records/submit", { - bucket: scope.selectionBucket, - message: scope.changeMessage - }) - .then( - function (response) { - scope.processReport = response.data; - var reportTemplate = - "../../catalog/components/utility/" + - "partials/batchreport-workflow.html"; - - scope.$broadcast("operationOnSelectionStop"); - - // A report is returned - gnUtilityService.openModal( - { - title: translations.metadataSubmitted, - content: '
', className: "gn-status-popup", onCloseCallback: function () { - scope.$emit("metadataStatusUpdated", true); scope.$emit("metadataStatusUpdated", true); scope.$emit("StatusUpdated", true); scope.$broadcast("operationOnSelectionStop"); diff --git a/web-ui/src/main/resources/catalog/components/metadataactions/partials/relatedDropdown.html b/web-ui/src/main/resources/catalog/components/metadataactions/partials/relatedDropdown.html index d7c9da803a..ce2d0c1b2b 100644 --- a/web-ui/src/main/resources/catalog/components/metadataactions/partials/relatedDropdown.html +++ b/web-ui/src/main/resources/catalog/components/metadataactions/partials/relatedDropdown.html @@ -12,7 +12,7 @@
  • -
  • -
  • +
  • +
  • +
  • diff --git a/web-ui/src/main/resources/catalog/components/search/searchfiltertag/SearchFilterTagsDirective.js b/web-ui/src/main/resources/catalog/components/search/searchfiltertag/SearchFilterTagsDirective.js index d459361ae2..7f4fcbd8d3 100644 --- a/web-ui/src/main/resources/catalog/components/search/searchfiltertag/SearchFilterTagsDirective.js +++ b/web-ui/src/main/resources/catalog/components/search/searchfiltertag/SearchFilterTagsDirective.js @@ -40,7 +40,6 @@ .title : rangeValue; }; - }; } ]); diff --git a/web-ui/src/main/resources/catalog/components/search/searchfiltertag/partials/searchFilterTagsTemplate.html b/web-ui/src/main/resources/catalog/components/search/searchfiltertag/partials/searchFilterTagsTemplate.html index af98f4b340..cbb48b7df8 100644 --- a/web-ui/src/main/resources/catalog/components/search/searchfiltertag/partials/searchFilterTagsTemplate.html +++ b/web-ui/src/main/resources/catalog/components/search/searchfiltertag/partials/searchFilterTagsTemplate.html @@ -37,16 +37,17 @@
    + > {{::value | renderRangeExpression:filter.key}} {{::key | facetTranslator: filter.key | capitalize}} - + +
    diff --git a/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js b/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js index 06389b2260..f69b79f083 100644 --- a/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js +++ b/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js @@ -132,7 +132,9 @@ hits && hits.map && hits.map(function (h) { - var overview = h.overview || (h._source && h._source.overview)|| + var overview = + h.overview || + (h._source && h._source.overview) || (h.fields && h.fields.overview); if (overview) { scope.images = scope.images.concat(overview); @@ -993,7 +995,8 @@ function () { deferred.resolve(); }, - function () { + function (r) { + console.warn(r); deferred.reject(); } ); @@ -1332,37 +1335,6 @@ } ]); - module.directive("gnLinkIcon", [ - "gnRelatedResources", - function (gnRelatedResources) { - return { - restrict: "A", - templateUrl: "../../catalog/components/utility/" + "partials/linkicon.html", - scope: { - link: "=gnLinkIcon", - mode: "@" - }, - link: function (scope, element, attrs) { - scope.mainType = gnRelatedResources.getType(scope.link, null); - scope.badge = gnRelatedResources.getBadgeLabel(scope.mainType, scope.link); - - scope.mimeTypeIconClass = scope.link.mimeType - ? "gn-icon-" + scope.link.mimeType - : ""; - scope.protocolIconClass = scope.link.protocol - ? "gn-icon-" + - scope.link.protocol.replace(":", "-").replace(" ", "-").toLowerCase() - : ""; - scope.typeIconClass = gnRelatedResources.getClassIcon(scope.mainType); - - scope.typeClass = - "gn-icontype-" + - scope.mainType.replace(":", "-").replace(" ", "-").toLowerCase(); - } - }; - } - ]); - module.directive("gnCircleLetterIcon", [ "$http", function ($http) { @@ -2400,7 +2372,7 @@ ' ' + ' ' + (label != "" ? labelDiv : "") + "" + diff --git a/web-ui/src/main/resources/catalog/components/utility/partials/linklabel.html b/web-ui/src/main/resources/catalog/components/utility/partials/linklabel.html index 839f43625e..2901bfd1fb 100644 --- a/web-ui/src/main/resources/catalog/components/utility/partials/linklabel.html +++ b/web-ui/src/main/resources/catalog/components/utility/partials/linklabel.html @@ -4,6 +4,6 @@ data-ng-if="link.lUrl.match('^http|ftp') !== null" target="_blank" > - {{link.lUrl.split('/').pop()}} + {{link.lUrl}} {{link.lUrl}} diff --git a/web-ui/src/main/resources/catalog/components/viewer/gfi/partials/featurestables.html b/web-ui/src/main/resources/catalog/components/viewer/gfi/partials/featurestables.html index 8c6c84a5e4..57285eed5a 100644 --- a/web-ui/src/main/resources/catalog/components/viewer/gfi/partials/featurestables.html +++ b/web-ui/src/main/resources/catalog/components/viewer/gfi/partials/featurestables.html @@ -9,7 +9,8 @@ +
    {{format | lowercase | translate}} diff --git a/web-ui/src/main/resources/catalog/js/LoginController.js b/web-ui/src/main/resources/catalog/js/LoginController.js index dd20ddfaff..e8b2ccdf7c 100644 --- a/web-ui/src/main/resources/catalog/js/LoginController.js +++ b/web-ui/src/main/resources/catalog/js/LoginController.js @@ -87,8 +87,8 @@ // take the bigger of the two values$scope.passwordMinLength = Math.max( gnConfig["system.security.passwordEnforcement.minLength"], 6 - ); - $scope.passwordMaxLength = Math.max( + + );$scope.passwordMaxLength = Math.max( gnConfig["system.security.passwordEnforcement.maxLength"], 6 diff --git a/web-ui/src/main/resources/catalog/js/admin/DashboardRecordLinkController.js b/web-ui/src/main/resources/catalog/js/admin/DashboardRecordLinkController.js index 70e35c5991..8cc6ec7fd3 100644 --- a/web-ui/src/main/resources/catalog/js/admin/DashboardRecordLinkController.js +++ b/web-ui/src/main/resources/catalog/js/admin/DashboardRecordLinkController.js @@ -147,7 +147,6 @@ sidePagination: "server", queryParamsType: "page,size", contentType: "application/x-www-form-urlencoded", - method: "get", pagination: true, paginationLoop: true, paginationHAlign: "right", diff --git a/web-ui/src/main/resources/catalog/js/admin/HarvestSettingsController.js b/web-ui/src/main/resources/catalog/js/admin/HarvestSettingsController.js index e9adb6b07b..b7544f92ef 100644 --- a/web-ui/src/main/resources/catalog/js/admin/HarvestSettingsController.js +++ b/web-ui/src/main/resources/catalog/js/admin/HarvestSettingsController.js @@ -240,14 +240,14 @@ $http .get("admin.harvester.info?_content_type=json&type=harvesterTypes", { cache: true - }) - .then(function (response) { - angular.forEach(response.data[0], function (value) { - $scope.harvesterTypes[value] = { - type: value, - label: "harvester-" + value - }; + .then( + function (response) { + angular.forEach(response.data[0], function (value) { + $scope.harvesterTypes[value] = { + type: value, + label: "harvester-" + value + }; $.getScript("../../catalog/templates/admin/harvest/type/" + value + ".js") .done(function (script, textStatus) { @@ -409,18 +409,21 @@ function (response) { deferred.reject(response.data); $rootScope.$broadcast("StatusUpdated", { - msg: $translate.instant("harvesterUpdated"), - error: response.data, - timeout: 2, - type: "danger" - }); - }); + msg: $translate.instant("harvesterUpdated"), + error: response.data, + timeout: 2, + type: "danger" + }); + } + ); return deferred.promise; }; - $scope.selectHarvester = function (h) {$scope.activeTab.settings = true; + $scope.selectHarvester = function (h) { + $scope.activeTab.settings = true; $scope.setSimpleUrlPagination(); + // TODO: Specific to thredds if (h["@type"] === "thredds") { $scope.threddsCollectionsMode = @@ -468,25 +471,26 @@ }; $scope.deleteHarvester = function () { - $scope.deleting.push($scope.harvesterSelected["@id"]); - return $http - .get( - "admin.harvester.remove?_content_type=json&id=" + - $scope.harvesterSelected["@id"] - ) - .success(function (data) { - $scope.harvesterSelected = {}; - $scope.harvesterUpdated = false; - $scope.harvesterNew = false; - $scope.$parent.loadHarvesters(); - }) - .error(function (data) { - console.log(data); - }) - .then(function () { - $scope.deleting.splice($scope.deleting.indexOf(3), 1); - }); - }; + $scope.deleting.push($scope.harvesterSelected["@id"]); + return $http + .get( + "admin.harvester.remove?_content_type=json&id=" + + $scope.harvesterSelected["@id"] + ) + .then( + function (response) { + $scope.harvesterSelected = {}; + $scope.harvesterUpdated = false; + $scope.harvesterNew = false; + $scope.$parent.loadHarvesters(); + + $scope.deleting.splice($scope.deleting.indexOf(3), 1); + }, + function (response) { + console.log(response.data); + } + ); + }; $scope.deleteHarvesterRecord = function () { return $http @@ -530,7 +534,6 @@ return $http .get( "admin.harvester.history.delete?uuid=" + $scope.harvesterSelected.site.uuid - ) .then(function (response) { $scope.$parent.loadHarvesters().then(function () { @@ -542,7 +545,6 @@ return $http .get( "admin.harvester.run?_content_type=json&id=" + $scope.harvesterSelected["@id"] - ) .then(function (response) { $scope.$parent.loadHarvesters().then(function () { @@ -559,7 +561,6 @@ .get("admin.harvester.stop?_content_type=json&id=" + id + "&status=" + status) .then(function () { $scope.$parent.loadHarvesters().then(refreshSelectedHarvester); - $scope.stopping = false; }); }; @@ -709,24 +710,26 @@ .get($scope.proxyUrl + encodeURIComponent(url + "/srv/eng/info?type=sources")) .then( function (response) { - $scope.geonetworkSources = []; - var i = 0; - var xmlDoc = $.parseXML(response.data); - var $xml = $(xmlDoc); - $sources = $xml.find("uuid"); - $names = $xml.find("name"); - - angular.forEach($sources, function (s) { - // FIXME: probably some issue on IE ? - $scope.geonetworkSources.push({ - uuid: s.textContent, - name: $names[i].textContent + $scope.geonetworkSources = []; + var i = 0; + var xmlDoc = $.parseXML(response.data); + var $xml = $(xmlDoc); + $sources = $xml.find("uuid"); + $names = $xml.find("name"); + + angular.forEach($sources, function (s) { + // FIXME: probably some issue on IE ? + $scope.geonetworkSources.push({ + uuid: s.textContent, + name: $names[i].textContent + }); + i++; }); - i++; - }); - },function (response) { - // TODO - }); + }, + function (response) { + // TODO + } + ); }; // OGCWxS @@ -929,8 +932,7 @@ "SERVICE=CSW&REQUEST=GetCapabilities&VERSION=2.0.2"; } - $http - .get($scope.proxyUrl + encodeURIComponent(url)).then( + $http.get($scope.proxyUrl + encodeURIComponent(url)).then( function (response) { $scope.cswCriteria = []; diff --git a/web-ui/src/main/resources/catalog/js/admin/LogoSettingsController.js b/web-ui/src/main/resources/catalog/js/admin/LogoSettingsController.js index 2e3f668f25..f13073cf0d 100644 --- a/web-ui/src/main/resources/catalog/js/admin/LogoSettingsController.js +++ b/web-ui/src/main/resources/catalog/js/admin/LogoSettingsController.js @@ -100,7 +100,8 @@ type: "danger" }); loadLogo(); - }); + } + ); }; /** diff --git a/web-ui/src/main/resources/catalog/js/admin/MapServerController.js b/web-ui/src/main/resources/catalog/js/admin/MapServerController.js index 36f3e958b0..3aaa87f5a1 100644 --- a/web-ui/src/main/resources/catalog/js/admin/MapServerController.js +++ b/web-ui/src/main/resources/catalog/js/admin/MapServerController.js @@ -123,23 +123,23 @@ .post("../api/mapservers/" + $scope.mapserverSelected.id + "/auth", data, { headers: { "Content-Type": "application/x-www-form-urlencoded" } }) - .then(function (response) { + .then( + function (response) { $scope.resetPassword = null; $("#passwordResetModal").modal("hide"); - },function (response) { + }, + function (response) { // TODO } ); }; - }; $scope.deleteMapserverConfig = function () { $("#gn-confirm-remove-mapserver").modal("show"); }; $scope.confirmDeleteMapserverConfig = function () { - $http - .delete("../api/mapservers/" + $scope.mapserverSelected.id).then( + $http.delete("../api/mapservers/" + $scope.mapserverSelected.id).then( function (response) { loadMapservers(); }, diff --git a/web-ui/src/main/resources/catalog/js/admin/SystemSettingsController.js b/web-ui/src/main/resources/catalog/js/admin/SystemSettingsController.js index eed870fa9a..2d81d091a7 100644 --- a/web-ui/src/main/resources/catalog/js/admin/SystemSettingsController.js +++ b/web-ui/src/main/resources/catalog/js/admin/SystemSettingsController.js @@ -198,7 +198,6 @@ $http.get("../api/site/info/notificationLevels").then(function (response) { $scope.notificationLevels = response.data; - $scope.notificationLevels .unshift(""); $scope.notificationLevels.unshift(""); }); @@ -207,10 +206,10 @@ $scope.logfiles = response.data; }); - $http - .get("../api/site/settings/details").then( + $http.get("../api/site/settings/details").then( function (response) { var data = response.data; + var sectionsLevel1 = []; var sectionsLevel2 = []; @@ -272,9 +271,11 @@ }, 900); } } - },function (response) { + }, + function (response) { // TODO - }); + } + ); loadUiConfigurations(); } @@ -286,6 +287,7 @@ $scope.uiConfigurationIdIsValid = false; return $http.get("../api/ui").then(function (response) { var data = response.data; + for (var i = 0; i < data.length; i++) { data[i].configuration == angular.toJson(data[i].configuration); @@ -440,18 +442,18 @@ }) .then( function (response) { - $(".gn-no-setting").attr("disabled", false); + $(".gn-no-setting").attr("disabled", false); - $rootScope.$broadcast("StatusUpdated", { - msg: $translate.instant("settingsUpdated"), - timeout: 2, - type: "success" - }); + $rootScope.$broadcast("StatusUpdated", { + msg: $translate.instant("settingsUpdated"), + timeout: 2, + type: "success" + }); - $scope.loadCatalogInfo(); - }, - function (response) { - $(".gn-no-setting").attr("disabled", false); + $scope.loadCatalogInfo(); + }, + function (response) { + $(".gn-no-setting").attr("disabled", false); $rootScope.$broadcast("StatusUpdated", { title: $translate.instant("settingsUpdateError"), diff --git a/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js b/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js index bcc304db51..2d80718db6 100644 --- a/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js +++ b/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js @@ -186,11 +186,9 @@ function loadUsers() { $scope.isLoadingUsers = true; - $http - .get("../api/users") - .then(function (response) { + $http.get("../api/users").then( + function (response) { $scope.users = response.data; - $scope.isLoadingUsers = false; // Search if requested user in location is @@ -292,30 +290,30 @@ $scope.userSelected = null; $scope.userGroups = null; - $http - .get("../api/users/" + u.id).then( + $http.get("../api/users/" + u.id).then( function (response) { var data = response.data; + $scope.userSelected = data; $scope.userIsAdmin = data.profile === "Administrator"; $scope.userIsEnabled = data.enabled; // Load user group and then select user - $http - .get("../api/users/" + u.id + "/groups").then( + $http.get("../api/users/" + u.id + "/groups").then( function (response) { $scope.userGroups = response.data; }, function (response) { // TODO } - ) - ; - },function (response) { + ); + }, + function (response) { // TODO } -); + ); + // Retrieve records in that group $scope.$broadcast("resetSearch", { isTemplate: ["y", "n", "s", "t"], @@ -618,8 +616,7 @@ * Remove the user and refresh the list when done. */ $scope.confirmRemoveUser = function () { - $http - .delete("../api/users/" + $scope.userSelected.id).then( + $http.delete("../api/users/" + $scope.userSelected.id).then( function (response) { $rootScope.$broadcast("StatusUpdated", { msg: $translate.instant("userRemoved"), @@ -715,7 +712,6 @@ "../api/groups" + ($scope.groupSelected.id != -99 ? "/" + $scope.groupSelected.id : ""), $scope.groupSelected - ) .then(createOrModifyGroupSuccess, createOrModifyGroupError); }; @@ -761,8 +757,7 @@ * Remove the group and refresh the list when done. */ $scope.confirmRemoveGroup = function () { - $http - .delete("../api/groups/" + $scope.groupSelected.id + "?force=true").then( + $http.delete("../api/groups/" + $scope.groupSelected.id + "?force=true").then( function (response) { $rootScope.$broadcast("StatusUpdated", { msg: $translate.instant("groupRemoved"), diff --git a/web-ui/src/main/resources/catalog/js/edit/DirectoryController.js b/web-ui/src/main/resources/catalog/js/edit/DirectoryController.js index e6ca57ca5c..280d0e27e3 100644 --- a/web-ui/src/main/resources/catalog/js/edit/DirectoryController.js +++ b/web-ui/src/main/resources/catalog/js/edit/DirectoryController.js @@ -450,7 +450,9 @@ if (!$scope.delEntryId) { return; } - gnMetadataManager.remove($scope.delEntryId).then(refreshEntriesInfo, function (e) { + gnMetadataManager + .remove($scope.delEntryId) + .then(refreshEntriesInfo, function (e) { gnAlertService.addAlert({ msg: $translate.instant("directoryEntry-removeError-referenced"), delay: 5000, diff --git a/web-ui/src/main/resources/catalog/js/edit/EditorController.js b/web-ui/src/main/resources/catalog/js/edit/EditorController.js index e3489bbe21..d4d2232de0 100644 --- a/web-ui/src/main/resources/catalog/js/edit/EditorController.js +++ b/web-ui/src/main/resources/catalog/js/edit/EditorController.js @@ -264,7 +264,7 @@ if ($scope.metadataFound) { // Default view to display is default // it may be overriden by route params or custom function - var defaultTab = "default"; + var defaultTab = ""; // It may be overriden by an application // settings. For example, you may have different diff --git a/web-ui/src/main/resources/catalog/js/search/SearchController.js b/web-ui/src/main/resources/catalog/js/search/SearchController.js index 54bb07d5f2..ca50303f31 100644 --- a/web-ui/src/main/resources/catalog/js/search/SearchController.js +++ b/web-ui/src/main/resources/catalog/js/search/SearchController.js @@ -26,14 +26,12 @@ goog.require("gn_catalog_service"); goog.require("gn_searchsuggestion_service"); - goog.require("gn_static_pages"); goog.require("gn_usersearches"); var module = angular.module("gn_search_controller", [ "ui.bootstrap.typeahead", "gn_searchsuggestion_service", "gn_catalog_service", - "gn_static_pages", "gn_usersearches" ]); @@ -161,7 +159,8 @@ promise: (function () { var defer = $q.defer(); $http.get("../api/tags", { cache: true }).then(function (response) { - var res = [];var data = response.data; + var res = []; + var data = response.data; for (var i = 0; i < data.length; i++) { res.push({ id: data[i].name, diff --git a/web-ui/src/main/resources/catalog/style/gn.less b/web-ui/src/main/resources/catalog/style/gn.less index 64830212fc..7717d2c482 100644 --- a/web-ui/src/main/resources/catalog/style/gn.less +++ b/web-ui/src/main/resources/catalog/style/gn.less @@ -489,9 +489,6 @@ div.thumb-small { } .gn-list-file { position: relative; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; width: 100%; text-align: left; margin-bottom: 5px !important; diff --git a/web-ui/src/main/resources/catalog/templates/admin/usergroup/users.html b/web-ui/src/main/resources/catalog/templates/admin/usergroup/users.html index 598b670ffb..19c897e416 100644 --- a/web-ui/src/main/resources/catalog/templates/admin/usergroup/users.html +++ b/web-ui/src/main/resources/catalog/templates/admin/usergroup/users.html @@ -95,8 +95,8 @@ data-ng-disabled="!gnUserEdit.$valid && !gnUserEdit.dirty" data-ng-click="saveUser('#gn-user-edit')" id="gn-btn-user-save" - > - saveUser + + > saveUser
    diff --git a/web-ui/src/main/resources/catalog/templates/editor/batchedit.html b/web-ui/src/main/resources/catalog/templates/editor/batchedit.html index 011b856a34..3d4b4e5890 100644 --- a/web-ui/src/main/resources/catalog/templates/editor/batchedit.html +++ b/web-ui/src/main/resources/catalog/templates/editor/batchedit.html @@ -373,7 +373,16 @@

    batchediting

    type="text" class="form-control" data-ng-model="currentXpath.condition" - placeholder="{{'condition' | translate}}"/> + placeholder="{{'condition' | translate}}" + /> +
    +