use of javax.help.HelpSetException in project zaproxy by zaproxy.
the class ExtensionHelp method loadExtensionHelpSet.
private static void loadExtensionHelpSet(Extension ext) {
URL helpSetUrl = getExtensionHelpSetUrl(ext);
if (helpSetUrl != null) {
try {
logger.debug("Load help files for extension '" + ext.getName() + "' and merge with core help.");
addHelpSet(ext.getAddOn(), new HelpSet(ext.getClass().getClassLoader(), helpSetUrl));
} catch (HelpSetException e) {
logger.error("An error occured while adding help file of extension '" + ext.getName() + "': " + e.getMessage(), e);
}
}
}
use of javax.help.HelpSetException in project zaproxy by zaproxy.
the class ExtensionHelp method loadAddOnHelpSet.
private static void loadAddOnHelpSet(AddOn addOn) {
addOn.getLoadedExtensions().forEach(ExtensionHelp::loadExtensionHelpSet);
AddOn.HelpSetData helpSetData = addOn.getHelpSetData();
if (helpSetData.isEmpty()) {
return;
}
ClassLoader classLoader = addOn.getClassLoader();
URL helpSetUrl = LocaleUtils.findResource(helpSetData.getBaseName(), HELP_SET_FILE_EXTENSION, helpSetData.getLocaleToken(), Constant.getLocale(), classLoader::getResource);
if (helpSetUrl == null) {
logger.error("Declared helpset not found for '" + addOn.getId() + "' add-on, with base name: " + helpSetData.getBaseName() + (helpSetData.getLocaleToken().isEmpty() ? "" : " and locale token: " + helpSetData.getLocaleToken()));
return;
}
try {
logger.debug("Loading help for '" + addOn.getId() + "' add-on and merging with core help.");
addHelpSet(addOn, new HelpSet(classLoader, helpSetUrl));
} catch (HelpSetException e) {
logger.error("An error occured while adding help for '" + addOn.getId() + "' add-on:", e);
}
}
use of javax.help.HelpSetException in project zaproxy by zaproxy.
the class ExtensionFactory method intitializeHelpSet.
/**
* If there are help files within the extension, they are loaded and merged
* with existing help files if the core help was correctly loaded.
* @param ext the extension being initialised
*/
private static void intitializeHelpSet(Extension ext) {
HelpBroker hb = ExtensionHelp.getHelpBroker();
if (hb == null) {
return;
}
URL helpSetUrl = getExtensionHelpSetUrl(ext);
if (helpSetUrl != null) {
try {
log.debug("Load help files for extension '" + ext.getName() + "' and merge with core help.");
HelpSet extHs = new HelpSet(ext.getClass().getClassLoader(), helpSetUrl);
hb.getHelpSet().add(extHs);
} catch (HelpSetException e) {
log.error("An error occured while adding help file of extension '" + ext.getName() + "': " + e.getMessage(), e);
}
}
}
use of javax.help.HelpSetException in project ACS by ACS-Community.
the class CommandCenterLogic method prepare.
//
// ============ Startup / Shutdown ====================
//
public void prepare(StartupOptions startupOptions) {
this.startupOptions = startupOptions;
log = MiscUtils.getPackageLogger(this);
// Make up the creator string for command center projects.
projectCreatorId = (version().equals("")) ? null : "acc-" + version();
projectMaker = new ProjectMaker(projectCreatorId);
project = projectMaker.createProject();
model = new MyProjectRunModel(project);
executeServices = new ExecuteServices(model);
executeManager = new ExecuteManager(model);
executeContainer = new ExecuteContainer();
executeAcs = new ExecuteAcs(model);
executeTools = new ExecuteTools(model);
firestarter = new Firestarter("AcsCommandCenter", log, null);
// msc (2007-11): needed for talking to daemons
Executor.remoteDaemonEnable(firestarter);
deploymentTreeControllerImpl = new DeploymentTreeControllerImpl();
gui = new CommandCenterGui(this);
gui.prepare();
// --- read the built-in tools
try {
URL url = findResource(ToolManager.getDefaultBuiltinToolsName(), "");
loadBuiltinTools(url);
} catch (Exception exc) {
log.severe("*** FATAL: Could not read definition of built-in tools." + " Printing stacktrace to stderr and exiting. ***");
exc.printStackTrace(System.err);
exit(4);
}
// --- read the extra tools
try {
URL url = findResource(ToolManager.getDefaultExtraToolsName(), "");
installExtraTools(url);
} catch (Exception exc) {
log.info("Failed to read " + ToolManager.getDefaultExtraToolsName() + "; reason was: " + exc);
}
try {
ClassLoader cl = null;
URL url = findResource(HELPSET_NAME, "");
this.helpSet = new HelpSet(cl, url);
} catch (HelpSetException ex) {
log.info("couldn't read helpset, no help available");
}
}
use of javax.help.HelpSetException in project bundle-app-ui by astrapi69.
the class DesktopMenu method getHelpSet.
/**
* Gets the help set.
*
* @return the help set
*/
public HelpSet getHelpSet() {
HelpSet hs = null;
final String filename = "simple-hs.xml";
final String directoryPath = "help/";
try {
hs = JComponentFactory.newHelpSet(directoryPath, filename);
} catch (final HelpSetException e) {
log.error("Instanciation problem of class HelpSet.", e);
}
return hs;
}
Aggregations