Skip to content

Commit

Permalink
Merge pull request #1822 from adamretter/853-2
Browse files Browse the repository at this point in the history
Rebased small fixes.
  • Loading branch information
dizzzz authored Apr 15, 2018
2 parents abdce9b + 593023b commit b66fade
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 136 deletions.
41 changes: 18 additions & 23 deletions src/org/exist/collections/triggers/XQueryTrigger.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,38 +165,33 @@ public void configure(DBBroker broker, Collection parent, Map<String, List<?>> p

final List<String> strQueries = (List<String>) parameters.get("query");
strQuery = strQueries != null ? strQueries.get(0) : null;
for(final Iterator itParamName = parameters.keySet().iterator(); itParamName.hasNext();)
{
final String paramName = (String)itParamName.next();

for (final Map.Entry<String, List<?>> entry : parameters.entrySet()) {
final String paramName = entry.getKey();
final Object paramValue = entry.getValue().get(0);

//get the binding prefix (if any)
if("bindingPrefix".equals(paramName))
{
final String bindingPrefix = (String)parameters.get("bindingPrefix").get(0);
if(bindingPrefix != null && !"".equals(bindingPrefix.trim()))
{
if("bindingPrefix".equals(paramName)) {
final String bindingPrefix = (String) paramValue;
if(bindingPrefix != null && !bindingPrefix.trim().isEmpty()) {
this.bindingPrefix = bindingPrefix.trim() + ":";
}
}

//get the URL of the query (if any)
else if("url".equals(paramName))
{
urlQuery = (String)parameters.get("url").get(0);
else if("url".equals(paramName)) {
urlQuery = (String) paramValue;
}

//get the query (if any)
else if("query".equals(paramName))
{
strQuery = (String)parameters.get("query").get(0);
else if("query".equals(paramName)) {
strQuery = (String) paramValue;
}

//make any other parameters available as external variables for the query
else
{
else {
//TODO could be enhanced to setup a sequence etc
userDefinedVariables.put(paramName, parameters.get(paramName).get(0));
userDefinedVariables.put(paramName, paramValue);
}
}

Expand All @@ -222,7 +217,7 @@ else if("query".equals(paramName))
/**
* Get's a Source for the Trigger's XQuery
*
* @param the database broker
* @param broker the database broker
*
* @return the Source for the XQuery
*/
Expand Down
2 changes: 1 addition & 1 deletion src/org/exist/http/RESTServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ private void writeResourceAs(final DocumentImpl resource, final DBBroker broker,
serializer.reset();

//setup the http context
final HttpContext httpContext = serializer.new HttpContext();
final HttpContext httpContext = new HttpContext();
final HttpRequestWrapper reqw = new HttpRequestWrapper(request, formEncoding, containerEncoding);
httpContext.setRequest(reqw);
httpContext.setSession(reqw.getSession(false));
Expand Down
4 changes: 2 additions & 2 deletions src/org/exist/storage/BackupSystemTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void configure(final Configuration config, final Properties properties) t
try {
zipFilesMax = Integer.parseInt(filesMaxStr);
} catch (final NumberFormatException e) {
LOG.debug("zip-files-max property error", e);
LOG.error("zip-files-max property error", e);
}
}
}
Expand All @@ -123,7 +123,7 @@ public void execute(final DBBroker broker) throws EXistException {
try {
backup.backup(false, null);
} catch (final XMLDBException | SAXException | IOException e) {
LOG.debug(e.getMessage(), e);
LOG.error(e.getMessage(), e);
throw new EXistException(e.getMessage(), e);
}

Expand Down
2 changes: 2 additions & 0 deletions src/org/exist/storage/BrokerPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,8 @@ public DBBroker get(final Optional<Subject> subject) throws EXistException {
LOG.debug("Db instance is in service mode. Waiting for db to become available again ...");
wait();
} catch(final InterruptedException e) {
Thread.currentThread().interrupt();
LOG.error("Interrupt detected");
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/org/exist/storage/DataBackup.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ public class DataBackup implements SystemTask {

public static final String DATE_FORMAT_PICTURE = "yyyyMMddHHmmssS";
private final SimpleDateFormat creationDateFormat = new SimpleDateFormat(DATE_FORMAT_PICTURE);

private Path dest;
private Optional<Path> lastBackup = Optional.empty();

public DataBackup() {
}

public DataBackup(final Path destination) {
dest = destination;
}

@Override
public boolean afterCheckpoint() {
return true;
Expand Down
Loading

0 comments on commit b66fade

Please sign in to comment.