query.append(configData.get(WHERECLAUSE).trim());
}
try {
if (session != null) {
ISearch search = session.getSearch();
search.execute(query.toString());
}
} catch (RepositoryException e) {
if (e.getCause().toString().trim().contains(ACCESS_DENIED_EXCEPTION)) {
LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
this.validation = OBJECT_STORE;
form = makeConfigForm(configData, this.validation);
return new ConfigureResponse(
resource.getString("object_store_access_error"),
form);
} else if (e.getCause().toString().trim().contains(RETRIEVE_SQL_SYNTAX_ERROR)) {
LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
this.validation = WHERECLAUSE;
form = makeConfigForm(configData, this.validation);
return new ConfigureResponse(
resource.getString("additional_where_clause_invalid"),
form);
} else {
LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
this.validation = "FileNet exception";
form = makeConfigForm(configData, this.validation);
return new ConfigureResponse(e.getLocalizedMessage(),
form);
}
}
StringBuffer deleteuery = new StringBuffer();
if (configData.get(DELETEWHERECLAUSE).trim().toUpperCase()
.startsWith(SELECT)) {
if (configData.get(DELETEWHERECLAUSE).trim().toUpperCase()
.startsWith(QUERYFORMAT)) {
if (configData.get(DELETEWHERECLAUSE).trim().toUpperCase()
.contains(((VERSIONQUERY)).toUpperCase())) {
deleteuery = new StringBuffer(
configData.get(DELETEWHERECLAUSE).trim());
LOGGER.fine("Using Custom Query["
+ configData.get(DELETEWHERECLAUSE).trim()
+ "]");
} else {
this.validation = DELETEWHERECLAUSE;
form = makeConfigForm(configData, this.validation);
return new ConfigureResponse(
resource.getString("delete_query_not_having_versionstatus_condition"),
form);
}
} else {
this.validation = DELETEWHERECLAUSE;
form = makeConfigForm(configData, this.validation);
return new ConfigureResponse(
resource.getString("delete_query_not_starting_with_SELECT_Id,DateLastModified_FROM_or_with_AND"),
form);
}
} else {
deleteuery.append("SELECT TOP 1 Id, DateLastModified FROM Document WHERE VersionStatus=1 and ContentSize IS NOT NULL ");
deleteuery.append(configData.get(DELETEWHERECLAUSE).trim());
}
try {
if (session != null) {
ISearch search = session.getSearch();
search.execute(deleteuery.toString());
}
} catch (RepositoryException e) {
if (e.getCause().toString().trim().contains(ACCESS_DENIED_EXCEPTION)) {
LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
this.validation = OBJECT_STORE;