{
log.info("Loading BaseDirectory from OR_PROPERTIES table.");
String baseDirectory = null;
ORProperty property = propertiesProvider.getProperty(ORProperty.BASE_DIRECTORY);
if (property != null) baseDirectory = property.getValue();
if (baseDirectory == null || baseDirectory.trim().length() < 1)
{
log.info("BaseDirectory not set in OR_PROPERTIES table. Trying to get path from ServletContext.");
try
{
baseDirectory = ServletActionContext.getServletContext().getRealPath("");
baseDirectory = baseDirectory + separator + "reports";
}
catch (NullPointerException npe)
{
log.info("ServletActionContext not available.");
baseDirectory = ".";
}
}
reportDirectory = baseDirectory;
if (!reportDirectory.endsWith(separator)) reportDirectory +=separator;
log.info("Report Directory: " + reportDirectory);
reportImageDirectory = reportDirectory + "images" + separator;
log.info("Report Image Directory: " + reportImageDirectory);
//set temp directory path for report virtualization and image generation
property = propertiesProvider.getProperty(ORProperty.TEMP_DIRECTORY);
if (property != null && property.getValue() != null && property.getValue().trim().length() > 0)
{
tempDirectory = property.getValue();
if (!tempDirectory.endsWith(separator)) tempDirectory +=separator;
log.info("TempDirectory: " + tempDirectory);
}
//set report generation directory path for storing generated reports
property = propertiesProvider.getProperty(ORProperty.REPORT_GENERATION_DIRECTORY);
if (property != null && property.getValue() != null && property.getValue().trim().length() > 0)
{
reportGenerationDirectory = property.getValue();
if (!reportGenerationDirectory.endsWith(separator)) reportGenerationDirectory +=separator;
log.info("ReportGenerationDirectory: " + reportGenerationDirectory);
}
log.info("Created");