use of net.sourceforge.processdash.i18n.Resources in project processdash by dtuma.
the class ProcessDashboard method displayStartupPermissionError.
private void displayStartupPermissionError(String resourceKey) {
Resources res = Resources.getDashBundle("Authentication.Errors");
String title = res.getString(resourceKey + ".Title");
Object message = res.getStrings(resourceKey + ".Message");
JOptionPane.showMessageDialog(hideSS(), message, title, JOptionPane.ERROR_MESSAGE);
}
use of net.sourceforge.processdash.i18n.Resources in project processdash by dtuma.
the class BrokenDataFileHandler method showMissingDataFileWarnings.
public void showMissingDataFileWarnings() {
// no missing data files? Great! Do nothing and return.
if (missingDataFiles.isEmpty())
return;
// prepare to display an error dialog.
ProcessDashboard.dropSplashScreen();
Resources resources = Resources.getDashBundle("ProcessDashboard.Errors");
// find the errors which can be attributed to missing MCFs.
Map<String, String> warnings = new HashMap(missingDataFiles);
Map<String, List<String>> mcfProjects = findMissingMcfProjects(warnings);
// If they are missing one of the standard MCFs, print a message
// telling them to download and run the dashboard installer.
showMcfWarning(resources, "Missing_MCF.TSP_Footer", "TSP", mcfProjects.remove("TSP"), DOWNLOAD_URL);
showMcfWarning(resources, "Missing_MCF.TSP_Footer", "PDSSD", mcfProjects.remove("PDSSD"), DOWNLOAD_URL);
// If they are missing a custom MCF, print a message telling them
// to obtain it from their team leader and install it.
String resKey = CompressedInstanceLauncher.isRunningFromCompressedData() ? "Missing_MCF.Custom_Footer_Zip_FMT" : "Missing_MCF.Custom_Footer_FMT";
for (Map.Entry<String, List<String>> e : mcfProjects.entrySet()) showMcfWarning(resources, resKey, e.getKey(), e.getValue(), SHARE_MCF_URL);
// if any other files are missing, display a more generic error.
ErrorReporter errorReporter = new ErrorReporter(resources.getString("Broken_Data_Title"), resources.getStrings("Broken_Data_Header"), resources.getStrings("Broken_Data_Footer"));
for (String dataPrefix : warnings.keySet()) errorReporter.logError(dataPrefix);
errorReporter.done();
}
use of net.sourceforge.processdash.i18n.Resources in project processdash by dtuma.
the class ProcessDashboard method displayPermissionsTamperingError.
private void displayPermissionsTamperingError() {
Resources res = Resources.getDashBundle("Permissions.Tamper_Error");
String title = res.getString("Title");
Object message = res.getStrings("Message");
JOptionPane.showMessageDialog(hideSS(), message, title, JOptionPane.ERROR_MESSAGE);
}
use of net.sourceforge.processdash.i18n.Resources in project processdash by dtuma.
the class OpenDocument method getProp.
private String getProp(Element e, String resName, String defValue) {
if (e == null)
return defValue;
Document doc = e.getOwnerDocument();
if (doc == null)
return defValue;
Resources bundle = (Resources) resourceMap.get(doc);
if (bundle == null)
return defValue;
resName = resName.replace(' ', '_');
try {
return resolveMetaReferences(bundle.getString(resName));
} catch (MissingResourceException mre) {
}
return defValue;
}
use of net.sourceforge.processdash.i18n.Resources in project processdash by dtuma.
the class OpenDocument method getDocumentTree.
protected Document getDocumentTree(String url) throws IOException {
Document result = null;
if (parameters.get("init") == null)
result = (Document) documentMap.get(url);
if (result == null) {
try {
result = XMLUtils.parse(new ByteArrayInputStream(getRequest(url, true)));
documentMap.put(url, result);
} catch (SAXException se) {
se.printStackTrace();
return null;
}
try {
String resourceName = url;
int dotPos = resourceName.lastIndexOf('.');
if (dotPos != -1) {
resourceName = resourceName.substring(0, dotPos);
dotPos = resourceName.indexOf('.');
if (dotPos != -1)
resourceName = StringUtils.findAndReplace(resourceName, ".", "%2e");
}
resourceName = resourceName.replace('/', '.');
if (resourceName.startsWith("."))
resourceName = resourceName.substring(1);
Resources bundle = Resources.getTemplateBundle(resourceName);
resourceMap.put(result, bundle);
} catch (Exception e) {
}
}
return result;
}
Aggregations