how to obtain the information about System Configuration in RCP 4 - eclipse

I am trying to obtain information about the system configuration in RCP 4 application. I got a link RCP3 System Configuration which implemented in RCP3 for getting the system configuration. WorkbenchMessages properties and WorkbenchPlugin are used to get the system configuration in RCP3 application but in RCP4 those are not available. How can I implement to get the system configuration?

The ConfigurationInfo class you reference is using the org.eclipse.ui.systemSummarySection extension point and calling the ISystemSummarySection interfaces it defines to get the system summary.
This extension point and the ISystemSummarySection interface do not exist in a plain e4 app so this information is not available using this code.
You may be able to get some of the information by looking at the individual classes that implement ISystemSummarySection and copying the code for those parts that don't use 3.x compatibility mode classes.
For example the ConfigurationLogDefaultSection class just uses System.getProperties() to list the system properties section.

Related

Aurelia - How to do composite applications that can be loaded at runtime

What I'm trying to do in Aurelia, is something like Prism is doing in WPF- Composite applications.
So lets say I have a "shell" application that defines the main application layout, then i have modules that I can plugin at run-time. Those modules can be an Aurelia application per se or Aurelia plugin (don't know what to use - need recommendation).
When loaded, the module needs to add it's menu items to the main application menu to expose it's features.
This is a mockup of the application:
Each module can have multiple menu items and can be pretty complex.
I'm using latest Typescript, Aurelia-CLI to create the application, and I'm using the built-in bundler : Aurelia's new built-in bundler.
So What I don't know is:
Those modules/features - what must they be? (Maybe Aurelia Plugins, or another Aurelia application?)
How to load those modules/features at run-time? (like deploy it in some plugins folder and tell the main shell application to load them)
How to modify the main menu and add new menu items from the loaded module?
Please help
Aurelia supports ultra dynamic applications. Also, there have been other community members who have had similar requirements and was able to resolve it. So I think the scenario is possible.
It seems the sub-application can just be a route.How/where to load the route should be determined based on the application URL
Those modules doesn't need to do anything specific, they can just be a normal, plain JS/TS class with lifecycle methods to handle activation/deactivation. I guess that main shell and all sub-applications need to share a common URL, you cannot have more than one router.
There could be a singleton/central store for new route to register information about loaded features, or it can be loaded upfront by a configuration file/metadata file or a database fetch.
Here is a similar question from another community member that I think can help you see how to glue things to https://discourse.aurelia.io/t/dynamicaly-load-routes/1906

Jasper quits PDF generation with Error while loading available fonts

On my local jBoss machine, generation of PDFs works fine. However, when I try publish (so far it seems so) basically anything on NetWeaver deployed same code of application, generation crashes with this error:
08-06-18:00:46:45 [HTTP Worker [#802492534]] ERROR [JRStyledTextParser:paveljanicek] Error while loading available fonts
net.sf.jasperreports.engine.JRRuntimeException: javax.xml.parsers.ParserConfigurationException
at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.<init>(SimpleFontExtensionHelper.java:156)
at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.getInstance(SimpleFontExtensionHelper.java:131)
at net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.ensureFontExtensions(FontExtensionsRegistry.java:80)
at net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.getExtensions(FontExtensionsRegistry.java:57)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:130)
at net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:86)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:111)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:69)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:219)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:234)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:134)
Worst part is, I cannot think about how to reproduce this error. This is what I already checked on target machine:
Fonts are installed and accessible to the app
jasperreports-fonts.jar is accessible to the Jasper reports
On my local machine:
PDF does generate with warnings (I am using old attributes like issplitAllowed or border)
If fonts are deleted, local instance crashes with different error (mostly "Fonts are not available to the JVM")
Does anyone has any idea what to check, where to look?
NW uses default XML parser, which doesn't support setting security feature "http://apache.org/xml/features/disallow-doctype-decl". This feature is set by Jasper style sheet parser from version 6.4.2
Quick solution is to use different XML parser, which supports mentioned feature by setting system property "javax.xml.parsers.DocumentBuilderFactory" to proper XML parser in NW properties.
Definitely the issue is on NW side.
However, I did find an Oracle equivalent XML parser (still based on Xerces) that is more forgiving when setting XML features: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl.
This parser comes with the Oracle JVM used in the project so we do not need to add an additional library and is actually the default parser based on JavaDocs.
Netweaver JVM decided to use oracle.xml.jaxp.JXDocumentBuilderFactory as default instead.

How to distinguish wizards in Eclipse RCP?

We have an Eclipse IDE application on 3.x that uses various newWizards to allow the user to create different files. Although these files differ slightly contentwise, the structure of the wizards is quite similar.
Thus, a sound object-oriented approach would be to instantiate different wizards from the same class and initialize them with different data.
Problem:
To decide what wizard needs which data we need a way to distinguish the different already instantiated wizards (e.g during the call to the init method of the wizard).
Is there any way to do so? It would e.g. help if somebody knows a way to get the wizard's id defined in the extension point from within the instantiated wizard.
If your wizard implements IExecutableExtension, it will be passed the configuration element that represents the extension for which it is created.
You can also use extension factories in that you specify a type that implements IExecutableExtensionFactory.
The interface allows you to control how the instances provided to extension-points (wizards in your case) are created.
Extension example:
<extension point="org.eclipse.ui.wizards">
<newWizard
name="..."
class="com.example.WizardFactory">
</newWizard>
Note that the extension factory may also implement IExecutableExtension to gain access to extension attributes before creating the extension's executable class.

.NET ETW - Manifest file not generated

doing logging component using .NET 4.5
working to log into event log, using ETW
4.5 did include ETW framework into System.Diagnostic.Tracing.*
however samples and external project lead to install Microsft.Diagnostic.Tracing.*
it's really confusing. But for testing purposes, I'm sticking to Microsoft.*
RegisterEvent tool is installed, and attached to the class library containing the custom EventSource, build is good, but I can't see the manifest file (.man) being generated
I'm lost. afaik, I need that .man for manual registration, only then event log will spew out my magic
my custom EventSource is named exactly "EventSource", need to rename to something else like "OMGEventSource"
while trying to fix the initial issue, I switched to using System.Diagnostic.Tracing
however, it's Event class doesn't have Channel property, which is needed by the RegisterEvent tool to generate the man file
have to switch back to use Microsoft.*
in short, forget about System.Diagnostic.Tracing, just stick to Microsoft.*

Programmatically configure ActiveRecordFacility for multiple databases

I'm trying to build a small application (ASP.NET MVC) that uses the plugin architecture. Along with Castle ActiveRecord Integration Facility. And I wish to let each plugin configure its own ActiveRecord behaviors. Like database connection string, proxy, etc..
However, I couldn't find a way to set multiple configurations without the use of web.config. The idea is to make this programmatically.
My goal is for each plugin in this system, if it defines its own ActiveRecord settings, the main application can set up next to ActiveRecordFacility these behaviors.
has someone do something like that?
P.S.: sorry, bad grammar...google translate...;P
You can set up the ActiveRecord configuration programmatically using InPlaceConfigurationSource (lots of examples around), then after initializing ActiveRecord (in your own code), call the ActiveRecordFacility with the skipARInitialization flag. e.g.:
container.AddFacility("ar", new ActiveRecordFacility(true));
This tells the facility not to try to initialize ActiveRecord, so it picks up the existing configuration.
Ok...the example in Lostechies works great. (link text)
Mauricio, thanks for the tip!