diff --git a/jeeves/src/main/java/jeeves/utils/IO.java b/jeeves/src/main/java/jeeves/utils/IO.java index 172c7e95755..0e29bcf33b4 100644 --- a/jeeves/src/main/java/jeeves/utils/IO.java +++ b/jeeves/src/main/java/jeeves/utils/IO.java @@ -26,11 +26,14 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; +import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.Charset; import java.sql.ResultSet; import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; import jeeves.constants.Jeeves; import jeeves.server.context.ServiceContext; @@ -163,6 +166,43 @@ public static void closeQuietly(Statement stmt) { } } } + + /** + * Returns a list of all file names in a directory - if recurse is true, + * processes all subdirectories too. + * @param directory + * @param recurse + * @return + */ + public static List getFilesInDirectory(File directory, boolean recurse, FilenameFilter filter) throws IOException { + List fileList = new ArrayList(); + if(! directory.exists()) { + throw new IOException("Directory does not exist: "+ directory.getAbsolutePath()); + } + if(! directory.canRead()) { + throw new IOException("Cannot read directory: "+ directory.getAbsolutePath()); + } + if(! directory.isDirectory()) { + throw new IOException("Directory is not a directory: "+ directory.getAbsolutePath()); + } + for(File file : directory.listFiles(filter)) { + if(file.isDirectory()) { + if(recurse) { + // recurse + fileList.addAll(getFilesInDirectory(file, recurse, filter)); + } + } + else { + if(! file.canRead()) { + throw new IOException("Cannot read file "+ file.getAbsolutePath()); + } + else { + fileList.add(file); + } + } + } + return fileList; + } } //============================================================================= diff --git a/web/src/main/java/org/fao/geonet/constants/Params.java b/web/src/main/java/org/fao/geonet/constants/Params.java index e2a3da8a8db..3aadb94d1f0 100644 --- a/web/src/main/java/org/fao/geonet/constants/Params.java +++ b/web/src/main/java/org/fao/geonet/constants/Params.java @@ -29,6 +29,7 @@ public final class Params { public static final String ACCESS = "access"; public static final String BTN = "btn"; + public static final String RECURSE = "recurse"; public static final String CATEGORY = "category"; public static final String CHOICE = "choice"; public static final String JURISDICTION = "jurisdiction"; diff --git a/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/Harvester.java b/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/Harvester.java index 54cec12abff..410c871655d 100644 --- a/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/Harvester.java +++ b/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/Harvester.java @@ -440,7 +440,7 @@ private String getCqlConstraint(Search s) } } } else { - System.out.println("no search criterion specified, harvesting all ... "); + log.debug("no search criterion specified, harvesting all ... "); } /* diff --git a/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/localfilesystem/LocalFilesystemHarvester.java b/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/localfilesystem/LocalFilesystemHarvester.java index c74e4d35261..865988c4ed3 100644 --- a/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/localfilesystem/LocalFilesystemHarvester.java +++ b/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/localfilesystem/LocalFilesystemHarvester.java @@ -22,12 +22,22 @@ //============================================================================== package org.fao.geonet.kernel.harvest.harvester.localfilesystem; +import java.io.File; +import java.sql.SQLException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; + import jeeves.exceptions.BadInputEx; import jeeves.interfaces.Logger; import jeeves.resources.dbms.Dbms; import jeeves.server.context.ServiceContext; import jeeves.server.resources.ResourceManager; +import jeeves.utils.IO; import jeeves.utils.Xml; + import org.fao.geonet.constants.Geonet; import org.fao.geonet.kernel.harvest.harvester.AbstractHarvester; import org.fao.geonet.kernel.harvest.harvester.AbstractParams; @@ -41,13 +51,6 @@ import org.jdom.Element; import org.jdom.JDOMException; -import java.io.File; -import java.io.IOException; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - /** * Harvester for local filesystem. * @@ -57,7 +60,6 @@ public class LocalFilesystemHarvester extends AbstractHarvester { private LocalFilesystemParams params; - private HarvestResult result; public static void init(ServiceContext context) throws Exception { } @@ -66,11 +68,12 @@ public static void init(ServiceContext context) throws Exception { protected void storeNodeExtra(Dbms dbms, AbstractParams params, String path, String siteId, String optionsId) throws SQLException { LocalFilesystemParams lp = (LocalFilesystemParams) params; super.setParams(lp); - + settingMan.add(dbms, "id:"+siteId, "icon", lp.icon); settingMan.add(dbms, "id:"+siteId, "recurse", lp.recurse); settingMan.add(dbms, "id:"+siteId, "directory", lp.directoryname); settingMan.add(dbms, "id:"+siteId, "nodelete", lp.nodelete); + settingMan.add(dbms, "id:"+siteId, "checkFileLastModifiedForUpdate", lp.checkFileLastModifiedForUpdate); } @Override @@ -93,57 +96,18 @@ protected String doAdd(Dbms dbms, Element node) throws BadInputEx, SQLException return id; } - /** - * Returns a list of all file names in a directory - if recurse is true, - * processes all subdirectories too. - * @param directory - * @param recurse - * @return - */ - private List harvestFromDirectory(File directory, boolean recurse) throws IOException { - System.out.println("LocalFilesystem harvesting: directory " + directory.getAbsolutePath()); - List results = new ArrayList(); - if(! directory.exists()) { - throw new IOException("directory does not exist: "+ directory.getAbsolutePath()); - } - if(! directory.canRead()) { - throw new IOException("cannot read directory: "+ directory.getAbsolutePath()); - } - if(! directory.isDirectory()) { - throw new IOException("directory is not a directory: "+ directory.getAbsolutePath()); - } - for(File file : directory.listFiles(new XMLExtensionFilenameFilter(XMLExtensionFilenameFilter.ACCEPT_DIRECTORIES))) { - if(file.isDirectory()) { - if(recurse) { - // recurse - results.addAll(harvestFromDirectory(file, recurse)); - } - } - else { - if(! file.canRead()) { - throw new IOException("cannot read file "+ file.getAbsolutePath()); - } - else { - System.out.println("adding file: " + file.getName()); - results.add(file.getAbsolutePath()); - } - } - } - return results; - } - /** * Aligns new results from filesystem harvesting. Contrary to practice in e.g. CSW Harvesting, * files removed from the harvesting source are NOT removed from the database. Also, no checks * on modification date are done; the result gets inserted or replaced if the result appears to * be in a supported schema. - * @param results + * @param listOfFiles * @param rm * @throws Exception */ - private void align(List results, ResourceManager rm) throws Exception { - System.out.println("Start of alignment for : "+ params.name); - this.result = new HarvestResult(); + private HarvestResult align(List listOfFiles, ResourceManager rm) throws Exception { + log.debug("Start of alignment for : "+ params.name); + result = new HarvestResult(); Dbms dbms = (Dbms) rm.open(Geonet.Res.MAIN_DB); boolean transformIt = false; @@ -163,19 +127,21 @@ private void align(List results, ResourceManager rm) throws Exception { //----------------------------------------------------------------------- //--- insert/update new metadata - for(String xmlFile : results) { + for(File file : listOfFiles) { result.totalMetadata++; Element xml; + String filePath = file.getCanonicalPath(); + try { - System.out.println("reading file: " + xmlFile); - xml = Xml.loadFile(xmlFile); + log.debug("reading file: " + filePath); + xml = Xml.loadFile(file); } catch (JDOMException e) { // JDOM problem - System.out.println("Error loading XML from file " + xmlFile +", ignoring"); + log.debug("Error loading XML from file " + filePath +", ignoring"); e.printStackTrace(); result.badFormat++; continue; // skip this one } catch (Exception e) { // some other error - System.out.println("Error retrieving XML from file " + xmlFile +", ignoring"); + log.debug("Error retrieving XML from file " + filePath +", ignoring"); e.printStackTrace(); result.unretrievable++; continue; // skip this one @@ -186,7 +152,7 @@ private void align(List results, ResourceManager rm) throws Exception { try { Xml.validate(xml); } catch (Exception e) { - System.out.println("Cannot validate XML from file " + xmlFile +", ignoring. Error was: "+e.getMessage()); + log.debug("Cannot validate XML from file " + filePath +", ignoring. Error was: "+e.getMessage()); result.doesNotValidate++; continue; // skip this one } @@ -197,7 +163,7 @@ private void align(List results, ResourceManager rm) throws Exception { try { xml = Xml.transform(xml, thisXslt); } catch (Exception e) { - System.out.println("Cannot transform XML from file " + xmlFile+", ignoring. Error was: "+e.getMessage()); + log.debug("Cannot transform XML from file " + filePath+", ignoring. Error was: "+e.getMessage()); result.badFormat++; continue; // skip this one } @@ -215,14 +181,40 @@ private void align(List results, ResourceManager rm) throws Exception { else { String id = dataMan.getMetadataId(dbms, uuid); if (id == null) { - System.out.println("adding new metadata"); - id = addMetadata(xml, uuid, dbms, schema, localGroups, localCateg); + // For new record change date will be the time + // the record was harvested + String createDate = new ISODate().toString(); + // or the last modified date of the file + if (params.checkFileLastModifiedForUpdate) { + createDate = new ISODate(file.lastModified()).toString(); + } + + + log.debug("adding new metadata"); + id = addMetadata(xml, uuid, dbms, schema, localGroups, localCateg, createDate); result.addedMetadata++; - } - else { - System.out.println("updating existing metadata, id is: " + id); - updateMetadata(xml, id, dbms, localGroups, localCateg); - result.updatedMetadata++; + } else { + // Check last modified date of the file with the record change date + // to check if an update is required + if (params.checkFileLastModifiedForUpdate) { + Date fileDate = new Date(file.lastModified()); + String modified = dataMan.getMetadataInfo(dbms, id).changeDate; + Date recordDate = new SimpleDateFormat(ISODate.ISO_DATE_FORMAT).parse(modified); + + log.debug(" File date is: " + fileDate.toString() + " / record date is: " + modified); + if (recordDate.before(fileDate)) { + log.debug(" Db record is older than file. Updating record with id: " + id); + updateMetadata(xml, id, dbms, localGroups, localCateg); + result.updatedMetadata ++; + } else { + log.debug(" Db record is not older than last modified date of file. No need for update."); + result.unchangedMetadata ++; + } + } else { + log.debug(" updating existing metadata, id is: " + id); + updateMetadata(xml, id, dbms, localGroups, localCateg); + result.updatedMetadata++; + } } idsForHarvestingResult.add(id); } @@ -238,16 +230,18 @@ private void align(List results, ResourceManager rm) throws Exception { for(Element existingId : existingMetadata) { String ex$ = existingId.getChildText("id"); if(!idsForHarvestingResult.contains(ex$)) { + log.debug(" Removing: " + ex$); dataMan.deleteMetadata(context, dbms, ex$); result.locallyRemoved++; } } } - System.out.println("End of alignment for : "+ params.name); + log.debug("End of alignment for : "+ params.name); + return result; } private void updateMetadata(Element xml, String id, Dbms dbms, GroupMapper localGroups, CategoryMapper localCateg) throws Exception { - System.out.println(" - Updating metadata with id: "+ id); + log.debug(" - Updating metadata with id: "+ id); // // update metadata @@ -277,14 +271,14 @@ private void updateMetadata(Element xml, String id, Dbms dbms, GroupMapper local * @param schema * @param localGroups * @param localCateg + * @param createDate TODO * @throws Exception */ - private String addMetadata(Element xml, String uuid, Dbms dbms, String schema, GroupMapper localGroups, CategoryMapper localCateg) throws Exception { - System.out.println(" - Adding metadata with remote uuid: "+ uuid); + private String addMetadata(Element xml, String uuid, Dbms dbms, String schema, GroupMapper localGroups, CategoryMapper localCateg, String createDate) throws Exception { + log.debug(" - Adding metadata with remote uuid: "+ uuid); String source = params.uuid; - String createDate = new ISODate().toString(); - + // // insert metadata // @@ -307,11 +301,11 @@ private String addMetadata(Element xml, String uuid, Dbms dbms, String schema, G @Override protected void doHarvest(Logger l, ResourceManager rm) throws Exception { - System.out.println("LocalFilesystem doHarvest: top directory is " + params.directoryname + ", recurse is " + params.recurse); + log.debug("LocalFilesystem doHarvest: top directory is " + params.directoryname + ", recurse is " + params.recurse); File directory = new File(params.directoryname); - List results = harvestFromDirectory(directory, params.recurse); - System.out.println("LocalFilesystem doHarvest: found #" + results.size() + " results"); - align(results, rm); + List results = IO.getFilesInDirectory(directory, params.recurse, new XMLExtensionFilenameFilter(XMLExtensionFilenameFilter.ACCEPT_DIRECTORIES)); + log.debug("LocalFilesystem doHarvest: found #" + results.size() + " XML files."); + this.result = align(results, rm); } @Override diff --git a/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/localfilesystem/LocalFilesystemParams.java b/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/localfilesystem/LocalFilesystemParams.java index ecf82a4155d..787e78fd555 100644 --- a/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/localfilesystem/LocalFilesystemParams.java +++ b/web/src/main/java/org/fao/geonet/kernel/harvest/harvester/localfilesystem/LocalFilesystemParams.java @@ -27,6 +27,7 @@ import org.fao.geonet.kernel.DataManager; import org.fao.geonet.kernel.harvest.harvester.AbstractParams; import org.jdom.Element; +import org.jfree.util.Log; /** * Params for local filesystem harvesting. @@ -39,6 +40,7 @@ public class LocalFilesystemParams extends AbstractParams { public String icon; public String directoryname; public boolean recurse; + public boolean checkFileLastModifiedForUpdate; public boolean nodelete; public LocalFilesystemParams(DataManager dm) { @@ -80,7 +82,9 @@ private void createOrUpdate(Element node) { recurse = (recurseString.equals("on") || recurseString.equals("true")); String nodeleteString = Util.getParam(site, "nodelete", "true"); nodelete = (nodeleteString.equals("on") || nodeleteString.equals("true")); - System.out.println("recurse: " + recurse + " nodelete: " + nodelete); + String checkFileLastModifiedForUpdateString = Util.getParam(site, "checkFileLastModifiedForUpdate", "true"); + checkFileLastModifiedForUpdate = (checkFileLastModifiedForUpdateString.equals("on") || checkFileLastModifiedForUpdateString.equals("true")); + } public LocalFilesystemParams copy() { @@ -90,6 +94,7 @@ public LocalFilesystemParams copy() { copy.directoryname = directoryname; copy.recurse = recurse; copy.nodelete = nodelete; - return copy; + copy.checkFileLastModifiedForUpdate = checkFileLastModifiedForUpdate; + return copy; } } \ No newline at end of file diff --git a/web/src/main/java/org/fao/geonet/services/metadata/ImportFromDir.java b/web/src/main/java/org/fao/geonet/services/metadata/ImportFromDir.java index 154b83eca09..b96dd17f94f 100644 --- a/web/src/main/java/org/fao/geonet/services/metadata/ImportFromDir.java +++ b/web/src/main/java/org/fao/geonet/services/metadata/ImportFromDir.java @@ -43,6 +43,7 @@ import jeeves.server.ServiceConfig; import jeeves.server.UserSession; import jeeves.server.context.ServiceContext; +import jeeves.utils.IO; import jeeves.utils.Util; import jeeves.utils.Xml; @@ -80,22 +81,35 @@ public boolean accept(File dir, String name) /** * Filter xml or mef files. */ - private FilenameFilter mdFilter = new FilenameFilter() - { - public boolean accept(File dir, String name) - { - if (name.equals(CONFIG_FILE)) - return false; - - if (name.startsWith(".")) - return false; - - if (name.toLowerCase().endsWith(".xml") || name.toLowerCase().endsWith(".mef")) - return true; - else - return false; - } - }; + public class BatchImportFilenameFilter implements FilenameFilter { + + private boolean acceptDirectories = false; + + public static final boolean ACCEPT_DIRECTORIES = true; + + public BatchImportFilenameFilter(boolean acceptDirectories) { + this.acceptDirectories = acceptDirectories; + } + + public BatchImportFilenameFilter() {} + + public boolean accept(File dir, String name) { + if(acceptDirectories) { + File f = new File(dir + File.separator + name); + return f.isDirectory() || checkFile(name); + } + return checkFile(name); + } + + private boolean checkFile(String name) { + if (name.equals(CONFIG_FILE)) + return false; + if (name.toLowerCase().endsWith(".xml") || name.toLowerCase().endsWith(".mef")) + return true; + else + return false; + } + } //-------------------------------------------------------------------------- @@ -245,12 +259,11 @@ public class ImportMetadataReindexer extends MetadataIndexerProcessor { ArrayList exceptions = new ArrayList(); - public ImportMetadataReindexer(DataManager dm, Element params, ServiceContext context, File files[], String stylePath, boolean failOnError) { + public ImportMetadataReindexer(DataManager dm, Element params, ServiceContext context, List fileList, String stylePath, boolean failOnError) { super (dm); this.params = params; this.context = context; - this.files = new File[files.length]; - System.arraycopy(files, 0, this.files, 0, files.length); + this.files = fileList.toArray(new File[fileList.size()]); this.stylePath = stylePath; } @@ -304,17 +317,18 @@ private int standardImport(Element params, ServiceContext context) throws Except DataManager dm = gc.getDataManager(); String dir = Util.getParam(params, Params.DIR); + boolean recurse = Util.getParam(params, Params.RECURSE, "off").equals("on"); - File files[] = new File(dir).listFiles(mdFilter); + List files = IO.getFilesInDirectory(new File(dir), recurse, new BatchImportFilenameFilter(recurse)); - if (files == null) - throw new Exception("Directory not found: " + dir); + if (files.size() == 0) + throw new Exception("No XML or MEF file found in " + dir); ImportMetadataReindexer r = new ImportMetadataReindexer(dm, params, context, files, stylePath, failOnError); r.process(); exceptions = r.getExceptions(); - return files.length; + return files.size(); } //-------------------------------------------------------------------------- @@ -361,7 +375,7 @@ private int configImport(Element params, ServiceContext context, File configFile context.debug(" Scanning category : "+categs[j]); String catDir = categs[j].getName(); - File files[] = categs[j].listFiles(mdFilter); + File files[] = categs[j].listFiles(new BatchImportFilenameFilter()); if (files == null) throw new Exception("Cannot scan files in : " + categs[j].getPath()); diff --git a/web/src/main/java/org/fao/geonet/util/ISODate.java b/web/src/main/java/org/fao/geonet/util/ISODate.java index 1598851bad5..ef58168d033 100644 --- a/web/src/main/java/org/fao/geonet/util/ISODate.java +++ b/web/src/main/java/org/fao/geonet/util/ISODate.java @@ -39,7 +39,7 @@ public class ISODate implements Cloneable public int hour; //--- 0..23 public int min; //--- 0..59 public int sec; //--- 0..59 - + public static final String ISO_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss"; public boolean isShort; //--- 'true' if the format is yyyy-mm-dd //--------------------------------------------------------------------------- diff --git a/web/src/main/java/org/fao/geonet/util/XMLExtensionFilenameFilter.java b/web/src/main/java/org/fao/geonet/util/XMLExtensionFilenameFilter.java index 193ffa8c342..03f3fed541a 100644 --- a/web/src/main/java/org/fao/geonet/util/XMLExtensionFilenameFilter.java +++ b/web/src/main/java/org/fao/geonet/util/XMLExtensionFilenameFilter.java @@ -45,10 +45,9 @@ public XMLExtensionFilenameFilter() {} public boolean accept(File dir, String name) { if(acceptDirectories) { - System.out.println("checking: " + dir + File.separator + name); File f = new File(dir + File.separator + name); - return f.isDirectory() || name.endsWith(".xml"); + return f.isDirectory() || name.toLowerCase().endsWith(".xml"); } - return name.endsWith(".xml"); + return name.toLowerCase().endsWith(".xml"); } } \ No newline at end of file diff --git a/web/src/main/webapp/loc/ara/xml/harvesting.xml b/web/src/main/webapp/loc/ara/xml/harvesting.xml index cc816e65528..3023af5d008 100644 --- a/web/src/main/webapp/loc/ara/xml/harvesting.xml +++ b/web/src/main/webapp/loc/ara/xml/harvesting.xml @@ -212,8 +212,9 @@ Source Criteria Validate - Recurse - Keep local if deleted at source + Also search in subfolders + Update catalog record only if file as been updated + Keep catalog record even if deleted at source Server Database Privileges diff --git a/web/src/main/webapp/loc/cat/xml/harvesting.xml b/web/src/main/webapp/loc/cat/xml/harvesting.xml index bdefd91680b..6f66e2928a6 100644 --- a/web/src/main/webapp/loc/cat/xml/harvesting.xml +++ b/web/src/main/webapp/loc/cat/xml/harvesting.xml @@ -211,7 +211,8 @@ Font Criteris Validar - Recurs + Also search in subfolders + Update catalog record only if file as been updated Conservar en local quan la font s'esborri Servidor Base de dades diff --git a/web/src/main/webapp/loc/chi/xml/harvesting.xml b/web/src/main/webapp/loc/chi/xml/harvesting.xml index a07b60de643..d7cbfb5fe44 100644 --- a/web/src/main/webapp/loc/chi/xml/harvesting.xml +++ b/web/src/main/webapp/loc/chi/xml/harvesting.xml @@ -212,8 +212,9 @@ Source Criteria Validate - Recurse - Keep local if deleted at source + Also search in subfolders + Update catalog record only if file as been updated + Keep catalog record even if deleted at source Server Database Privileges diff --git a/web/src/main/webapp/loc/dut/xml/harvesting.xml b/web/src/main/webapp/loc/dut/xml/harvesting.xml index 44d2a8f55e5..21ec9b256e2 100644 --- a/web/src/main/webapp/loc/dut/xml/harvesting.xml +++ b/web/src/main/webapp/loc/dut/xml/harvesting.xml @@ -213,6 +213,7 @@ Bron Criteria Valideren + Update catalog record only if file as been updated Teruggaan Bewaar lokaal indien verwijderd bij de bronhouder Server diff --git a/web/src/main/webapp/loc/eng/xml/harvesting.xml b/web/src/main/webapp/loc/eng/xml/harvesting.xml index 00d20f724e0..094ca2525c7 100644 --- a/web/src/main/webapp/loc/eng/xml/harvesting.xml +++ b/web/src/main/webapp/loc/eng/xml/harvesting.xml @@ -214,8 +214,9 @@ Source Criteria Validate - Recurse - Keep local if deleted at source + Also search in subfolders + Update catalog record only if file as been updated + Keep catalog record even if deleted at source Server Database Privileges diff --git a/web/src/main/webapp/loc/eng/xml/strings.xml b/web/src/main/webapp/loc/eng/xml/strings.xml index da8ad71c67d..83f6c87af61 100644 --- a/web/src/main/webapp/loc/eng/xml/strings.xml +++ b/web/src/main/webapp/loc/eng/xml/strings.xml @@ -16,6 +16,7 @@ Türkçe Polski + Also search in subfolders Other: Warning Is administrator ? diff --git a/web/src/main/webapp/loc/fin/xml/harvesting.xml b/web/src/main/webapp/loc/fin/xml/harvesting.xml index 4e7110eb43a..7cc1274c4de 100644 --- a/web/src/main/webapp/loc/fin/xml/harvesting.xml +++ b/web/src/main/webapp/loc/fin/xml/harvesting.xml @@ -198,6 +198,7 @@ Lähtösijainti Kriteeri Validoi + Update catalog record only if file as been updated Rekursoi Pidä paikallinen, jos poistetaan alkuperäisestä sijainnista. Palvelin diff --git a/web/src/main/webapp/loc/fin/xml/strings.xml b/web/src/main/webapp/loc/fin/xml/strings.xml index 7a1be0393ae..75201440aa5 100644 --- a/web/src/main/webapp/loc/fin/xml/strings.xml +++ b/web/src/main/webapp/loc/fin/xml/strings.xml @@ -16,6 +16,7 @@ Türkçe Polski + Also search in subfolders Other: Warning Is administrator ? diff --git a/web/src/main/webapp/loc/fre/xml/harvesting.xml b/web/src/main/webapp/loc/fre/xml/harvesting.xml index 072f5050fc8..129361257b4 100644 --- a/web/src/main/webapp/loc/fre/xml/harvesting.xml +++ b/web/src/main/webapp/loc/fre/xml/harvesting.xml @@ -214,8 +214,9 @@ Source Critères Valider - Récursif - Conserver les fichiers + Rechercher dans les sous répertoires également + Mettre à jour la fiche du catalogue si le fichier est plus récent + Conserver la fiche du catalogue même si le fichier n'est plus présent Serveur Base de données Privilèges diff --git a/web/src/main/webapp/loc/fre/xml/strings.xml b/web/src/main/webapp/loc/fre/xml/strings.xml index af9212f0408..78c78eeec6b 100644 --- a/web/src/main/webapp/loc/fre/xml/strings.xml +++ b/web/src/main/webapp/loc/fre/xml/strings.xml @@ -16,6 +16,7 @@ Türkçe Polski + Rechercher dans les sous répertoires également Autre : Attention Est administrateur ? diff --git a/web/src/main/webapp/loc/ger/xml/harvesting.xml b/web/src/main/webapp/loc/ger/xml/harvesting.xml index 7b8ec977597..d8269ecb47a 100644 --- a/web/src/main/webapp/loc/ger/xml/harvesting.xml +++ b/web/src/main/webapp/loc/ger/xml/harvesting.xml @@ -187,7 +187,8 @@ Quelle Kriterium Validieren - Rekursiv + Also search in subfolders + Update catalog record only if file as been updated Behalte lokal, wenn Quelle gelöscht wird Server Datenbank diff --git a/web/src/main/webapp/loc/ger/xml/strings.xml b/web/src/main/webapp/loc/ger/xml/strings.xml index a478785e362..8525d81b560 100644 --- a/web/src/main/webapp/loc/ger/xml/strings.xml +++ b/web/src/main/webapp/loc/ger/xml/strings.xml @@ -16,6 +16,7 @@ Türkçe Polski + Also search in subfolders Other: Warning Is administrator ? diff --git a/web/src/main/webapp/loc/ita/xml/harvesting.xml b/web/src/main/webapp/loc/ita/xml/harvesting.xml index b3d26d61c63..baa1117d206 100644 --- a/web/src/main/webapp/loc/ita/xml/harvesting.xml +++ b/web/src/main/webapp/loc/ita/xml/harvesting.xml @@ -163,7 +163,8 @@ Criteri Convalidare Ricorsione - Mantieni localmente se eliminato sul sito originario + Update catalog record only if file as been updated + Mantieni localmente se eliminato sul sito originario Server Database Privilegi diff --git a/web/src/main/webapp/loc/ita/xml/strings.xml b/web/src/main/webapp/loc/ita/xml/strings.xml index f4a3b0b99a8..b2443a0ed3b 100644 --- a/web/src/main/webapp/loc/ita/xml/strings.xml +++ b/web/src/main/webapp/loc/ita/xml/strings.xml @@ -16,6 +16,7 @@ Türkçe Polski + Also search in subfolders Other: Warning Is administrator ? diff --git a/web/src/main/webapp/loc/nor/xml/harvesting.xml b/web/src/main/webapp/loc/nor/xml/harvesting.xml index 56451bdda0d..6105cfcde23 100644 --- a/web/src/main/webapp/loc/nor/xml/harvesting.xml +++ b/web/src/main/webapp/loc/nor/xml/harvesting.xml @@ -212,7 +212,8 @@ Kilde Kriteria Validér - Recurse + Also search in subfolders + Update catalog record only if file as been updated Behold lokalt hvis slettet på kilden Server Database diff --git a/web/src/main/webapp/loc/nor/xml/strings.xml b/web/src/main/webapp/loc/nor/xml/strings.xml index 85770bc11df..c0b36ec27bd 100644 --- a/web/src/main/webapp/loc/nor/xml/strings.xml +++ b/web/src/main/webapp/loc/nor/xml/strings.xml @@ -16,6 +16,7 @@ Türkçe Polski + Also search in subfolders Other: Warning Is administrator ? diff --git a/web/src/main/webapp/loc/pol/xml/harvesting.xml b/web/src/main/webapp/loc/pol/xml/harvesting.xml index b1f59294ed1..e33ea436182 100644 --- a/web/src/main/webapp/loc/pol/xml/harvesting.xml +++ b/web/src/main/webapp/loc/pol/xml/harvesting.xml @@ -220,6 +220,7 @@ Kryteria Waliduj Rekursywnie + Update catalog record only if file as been updated Zachowaj lokalnie jeśli usunięto źródło Serwer Baza danych diff --git a/web/src/main/webapp/loc/pol/xml/strings.xml b/web/src/main/webapp/loc/pol/xml/strings.xml index a14f11c8fde..e5b1e198359 100644 --- a/web/src/main/webapp/loc/pol/xml/strings.xml +++ b/web/src/main/webapp/loc/pol/xml/strings.xml @@ -18,6 +18,7 @@ Dowolny język + Also search in subfolders Other: Is administrator ? Extract Register Items diff --git a/web/src/main/webapp/loc/por/xml/harvesting.xml b/web/src/main/webapp/loc/por/xml/harvesting.xml index 4e6687167e6..066089a4110 100644 --- a/web/src/main/webapp/loc/por/xml/harvesting.xml +++ b/web/src/main/webapp/loc/por/xml/harvesting.xml @@ -215,6 +215,7 @@ Critério Validar Incluir + Update catalog record only if file as been updated Manter uma cópia local, quando apagado na fonte. Servidor Banco de dados diff --git a/web/src/main/webapp/loc/por/xml/strings.xml b/web/src/main/webapp/loc/por/xml/strings.xml index 5efd1cb107b..9ca27447396 100644 --- a/web/src/main/webapp/loc/por/xml/strings.xml +++ b/web/src/main/webapp/loc/por/xml/strings.xml @@ -16,6 +16,7 @@ Türkçe Polski + Also search in subfolders Other: Warning Is administrator ? diff --git a/web/src/main/webapp/loc/rus/xml/harvesting.xml b/web/src/main/webapp/loc/rus/xml/harvesting.xml index 46599caf05c..41e090eb8bc 100644 --- a/web/src/main/webapp/loc/rus/xml/harvesting.xml +++ b/web/src/main/webapp/loc/rus/xml/harvesting.xml @@ -218,6 +218,7 @@ Критерий Проверить Рекурсивно + Update catalog record only if file as been updated Keep local if deleted at source Server Database diff --git a/web/src/main/webapp/loc/rus/xml/strings.xml b/web/src/main/webapp/loc/rus/xml/strings.xml index f401010face..9a66bc14ab0 100644 --- a/web/src/main/webapp/loc/rus/xml/strings.xml +++ b/web/src/main/webapp/loc/rus/xml/strings.xml @@ -17,6 +17,7 @@ Polski + Also search in subfolders Other: Null Is administrator ? diff --git a/web/src/main/webapp/loc/spa/xml/harvesting.xml b/web/src/main/webapp/loc/spa/xml/harvesting.xml index 0b2c22a493f..3c24e3a4c49 100644 --- a/web/src/main/webapp/loc/spa/xml/harvesting.xml +++ b/web/src/main/webapp/loc/spa/xml/harvesting.xml @@ -214,7 +214,8 @@ Criterios Validar Recurso - Keep local if deleted at source + Update catalog record only if file as been updated + Keep catalog record even if deleted at source Server Database Privilegios diff --git a/web/src/main/webapp/loc/spa/xml/strings.xml b/web/src/main/webapp/loc/spa/xml/strings.xml index 55119e11185..88909ea4724 100644 --- a/web/src/main/webapp/loc/spa/xml/strings.xml +++ b/web/src/main/webapp/loc/spa/xml/strings.xml @@ -16,6 +16,7 @@ Türkçe Polski + Also search in subfolders Otro: Advertencia ¿Es administrador? diff --git a/web/src/main/webapp/loc/tur/xml/harvesting.xml b/web/src/main/webapp/loc/tur/xml/harvesting.xml index 46c3c9706ba..6f15c2d6de8 100644 --- a/web/src/main/webapp/loc/tur/xml/harvesting.xml +++ b/web/src/main/webapp/loc/tur/xml/harvesting.xml @@ -139,6 +139,7 @@ Kriterler Doğrula Tekrarla +Update catalog record only if file as been updated Kaynakta silinmiş ise yerel bilgisayarda sakla Sunucu Veritabanı diff --git a/web/src/main/webapp/loc/tur/xml/strings.xml b/web/src/main/webapp/loc/tur/xml/strings.xml index 0d1b75a923a..bdb3fb052c3 100644 --- a/web/src/main/webapp/loc/tur/xml/strings.xml +++ b/web/src/main/webapp/loc/tur/xml/strings.xml @@ -16,7 +16,8 @@ Türkçe Polski - Lucene indeksi bu diller için durma kelimelerini (stopwords) kullanır : + Also search in subfolders + Lucene indeksi bu diller için durma kelimelerini (stopwords) kullanır : Bu değerleri değiştirirseniz, Lucene indeksini yeniden oluşturmanız tavsiye edilir. Uzak sunucudan HTML göster diff --git a/web/src/main/webapp/scripts/harvesting/filesystem/model.js b/web/src/main/webapp/scripts/harvesting/filesystem/model.js index 78655c9d918..00d2bbd45e1 100644 --- a/web/src/main/webapp/scripts/harvesting/filesystem/model.js +++ b/web/src/main/webapp/scripts/harvesting/filesystem/model.js @@ -108,6 +108,7 @@ var updateTemp = ' {DIRECTORYNAME}'+ ' {RECURSE}'+ ' {NODELETE}'+ +' {checkFileLastModifiedForUpdate}'+ ' {ICON}'+ ' '+ ' '+ diff --git a/web/src/main/webapp/scripts/harvesting/filesystem/view.js b/web/src/main/webapp/scripts/harvesting/filesystem/view.js index c238cb35294..90657ac6aaa 100644 --- a/web/src/main/webapp/scripts/harvesting/filesystem/view.js +++ b/web/src/main/webapp/scripts/harvesting/filesystem/view.js @@ -44,9 +44,7 @@ function init() valid.add( [ { id:'filesystem.name', type:'length', minSize :1, maxSize :200 }, - { id:'filesystem.directoryname', type:'length', minSize :1, maxSize :500 }, - { id:'filesystem.recurse', type:'length', minSize :1, maxSize :10 }, - { id:'filesystem.nodelete', type:'length', minSize :1, maxSize :10 } + { id:'filesystem.directoryname', type:'length', minSize :1, maxSize :500 } ]); } @@ -79,7 +77,8 @@ function setData(node) var nodelete = node.getElementsByTagName('nodelete') [0]; hvutil.setOption(node, 'directory', 'filesystem.directoryname'); hvutil.setOption(node, 'recurse', 'filesystem.recurse'); - hvutil.setOption(node, 'nodelete', 'filesystem.nodelete'); + hvutil.setOption(node, 'checkFileLastModifiedForUpdate', 'filesystem.checkFileLastModifiedForUpdate'); + hvutil.setOption(node, 'nodelete', 'filesystem.nodelete'); hvutil.setOption(node, 'icon', 'filesystem.icon'); @@ -106,9 +105,11 @@ function getData() data.DIRECTORYNAME = $F('filesystem.directoryname'); - data.RECURSE = $F('filesystem.recurse'); - data.NODELETE = $F('filesystem.nodelete'); - + data.RECURSE = $('filesystem.recurse').checked; + data.NODELETE = $('filesystem.nodelete').checked; + data.checkFileLastModifiedForUpdate = $('filesystem.checkFileLastModifiedForUpdate').checked; + + data.ICON = $F('filesystem.icon'); //--- retrieve privileges and categories information diff --git a/web/src/main/webapp/xsl/harvesting/filesystem/filesystem.xsl b/web/src/main/webapp/xsl/harvesting/filesystem/filesystem.xsl index d581082d11a..f96c05c3ecf 100644 --- a/web/src/main/webapp/xsl/harvesting/filesystem/filesystem.xsl +++ b/web/src/main/webapp/xsl/harvesting/filesystem/filesystem.xsl @@ -62,6 +62,10 @@ + + + + diff --git a/web/src/main/webapp/xsl/metadata-batchimport.xsl b/web/src/main/webapp/xsl/metadata-batchimport.xsl index 35547b692d2..656fe8cc0b2 100644 --- a/web/src/main/webapp/xsl/metadata-batchimport.xsl +++ b/web/src/main/webapp/xsl/metadata-batchimport.xsl @@ -63,6 +63,20 @@ + + + + + + + + + + + +