Skip to content

Commit

Permalink
API / Site info / Add all data directory info
Browse files Browse the repository at this point in the history
* Sort by insertion order
* Showing data directory html cache directory setting in admin page

Co-authored-by: Joachim Nielandt <[email protected]>
  • Loading branch information
joachimnielandt authored and fxprunayre committed Jun 26, 2023
1 parent 1300e5b commit abce2ca
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ private Path setDataDirectory(JeevesServlet jeevesServlet, String webappName,
);
formatterDir = setDir(jeevesServlet, webappName, handlerConfig, formatterDir,
".formatter" + KEY_SUFFIX, Geonet.Config.FORMATTER_PATH, "data", "formatter");

htmlCacheDir = setDir(jeevesServlet, webappName, handlerConfig, htmlCacheDir,
".htmlcache" + KEY_SUFFIX, Geonet.Config.HTMLCACHE_DIR, handlerConfig.getValue(Geonet.Config.RESOURCES_DIR), "htmlcache"
);
Expand Down
31 changes: 19 additions & 12 deletions services/src/main/java/org/fao/geonet/api/site/SiteInformation.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,18 @@
import java.io.InputStream;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.*;

/**
* Created by francois on 04/06/16.
*/
public class SiteInformation {
final Properties properties = System.getProperties();
private Map<String, String> catProperties = new HashMap<>();
private Map<String, String> indexProperties = new HashMap<>();
private Map<String, String> systemProperties = new HashMap<>();
private Map<String, String> databaseProperties = new HashMap<>();
private Map<String, String> versionProperties = new HashMap<>();
private Map<String, String> catProperties = new LinkedHashMap<>();
private Map<String, String> indexProperties = new LinkedHashMap<>();
private Map<String, String> systemProperties = new LinkedHashMap<>();
private Map<String, String> databaseProperties = new LinkedHashMap<>();
private Map<String, String> versionProperties = new LinkedHashMap<>();

public SiteInformation(final ServiceContext context, final GeonetContext gc) {
if (context.getUserSession().isAuthenticated()) {
Expand Down Expand Up @@ -124,9 +121,19 @@ public void setVersionProperties(Map<String, String> versionProperties) {
private void loadCatalogueInfo(final GeonetContext gc) {
ServiceConfig sc = gc.getBean(ServiceConfig.class);

String[] props = {Geonet.Config.DATA_DIR, Geonet.Config.CODELIST_DIR, Geonet.Config.CONFIG_DIR,
Geonet.Config.INDEX_CONFIG_DIR, Geonet.Config.SCHEMAPLUGINS_DIR, Geonet.Config.SUBVERSION_PATH,
Geonet.Config.RESOURCES_DIR, Geonet.Config.FORMATTER_PATH, Geonet.Config.BACKUP_DIR};
String[] props = {
Geonet.Config.SYSTEM_DATA_DIR,
Geonet.Config.DATA_DIR,
Geonet.Config.BACKUP_DIR,
Geonet.Config.CODELIST_DIR,
Geonet.Config.RESOURCES_DIR,
Geonet.Config.SCHEMAPLUGINS_DIR,
Geonet.Config.CONFIG_DIR,
Geonet.Config.INDEX_CONFIG_DIR,
Geonet.Config.FORMATTER_PATH,
Geonet.Config.HTMLCACHE_DIR,
Geonet.Config.SUBVERSION_PATH
};

for (String prop : props) {
catProperties.put("data." + prop, sc.getValue(prop));
Expand Down
1 change: 1 addition & 0 deletions web-ui/src/main/resources/catalog/locales/en-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
"data.configDir": "Configuration folder: ",
"data.dataDir": "Data directory: ",
"data.formatterPath": "Formatter directory: ",
"data.htmlCacheDir": "HTML cache directory:",
"data.indexConfigDir": "Index configuration folder: ",
"data.resources": "Resources folder: ",
"data.backupDir": "Backup folder: ",
Expand Down
1 change: 1 addition & 0 deletions web-ui/src/main/resources/catalog/locales/fr-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
"data.configDir": "Répertoire pour la configuration :",
"data.dataDir": "Répertoire des données :",
"data.formatterPath": "Répertoire des mises en page",
"data.htmlCacheDir": "Répertoire de HTML cache:",
"data.indexConfigDir": "Dossier de configuration de l'index :",
"data.resources": "Répertoire pour les ressources (eg. images, logos) :",
"data.backupDir": "Répertoire de sauvgarde",
Expand Down
1 change: 1 addition & 0 deletions web-ui/src/main/resources/catalog/locales/nl-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
"data.configDir": "Configuratie folder:",
"data.dataDir": "Data map:",
"data.formatterPath": "Formatter folder:",
"data.htmlCacheDir": "HTML cache folder:",
"data.indexConfigDir": "Index configuratiemap:",
"data.resources": "Bronnen map:",
"data.backupDir": "Backup folder:",
Expand Down

0 comments on commit abce2ca

Please sign in to comment.