Is there a way to refer the log4j property file from an external place.
Example: Keeping the file in one location and using that in java classes.
Thanks and Regards,
Joe
Its a tremendously lazy question, Use the property configurator.
Reggards,
Hari
Related
I have a custom XML format that links to Java resources. For the sake of simplicity let's assume my XML file would look like this:
<root>
<java-class>my.fully.qualified.class.name</java-class>
</root>
Eventually my references will be somewhat more complicated. It will not contain the fully qualified class name directly and I will need some logic to resolve the correct class, but I want to keep the example as simple as possible here.
Now I want it to be possible to Strg+Click on the element's text and want IntelliJ to carry me to the .java file, just like it is possible in Spring-XML files. In the IDEA Plugin Development FAQ there is a link called "How do I add custom references to Java elements in XML files?" which so much sounds like exactly what I need. Unfortunately it links to a discussion where someone is more or less done implementing something like this, having some minor problems. Nevertheless I understood that I probably need to write an implementation of the interface com.intellij.psi.PsiReference. Googling for "PsiReference" and "IntelliJ" or "IDEA" unfortunately did not bring up any tutorials on how to use it, but I found the class XmlValueReference which sounds useful. Yet again googling for "XmlValueReference" did not turn up anything useful on how to use the class. At least the PSI Cookbook tells me that I can find the Java class by using JavaPsiFacade.findClass(). I'd be thankful for any tutorials, hints and the like, that tell the correct usage.
The above linked discussion mentions that I need to call registry.registerReferenceProvider(XmlTag.class, provider) in order to register my provider once I eventually managed to implement it, but of which type is "registry" and where do I get it from?
First of all, here's a nice tutorial that came up a few days ago, which explains the basics of IntelliJ plugin development (you should take a look at the section Reference Contributor).
You will likely have to define your own PsiReferenceContributor, which will be referenced in your plugin.xml like this:
<psi.referenceContributor implementation="com.yourplugin.YourReferenceContributor"/>
In your reference contributor, there's a method registerReferenceProviders(PsiReferenceRegistrar) where you will be able to call registry.registerReferenceProvider(XmlTag.class, provider).
Finally, in your instance of PsiReferenceProvider, you will have to test the tag name to filter out tags which don't contain class references, then find the right Java class using JavaPsiFacade.findClass().
From my experience, the best place to get help regarding IntelliJ plugin development is JetBrains' forums.
Is there a way to read a properties file using any kind of resource bundle in PowerBuilder as we do in Java? I tried searching couple of places but I couldn't find any resolution for the same. It would be great if someone can share you thoughts on this
Speaking in absence of what "using" a properties file means in Java, you can at least use the FileOpen(), FileRead() and FileClose() set of functions to read the data.
Good luck,
Terry
When using VS, the preferred way to store user- and application settings seems to be to access VS "settings" tab for the given assembly and simply type the settings you need.
Monodevelop does not have this feature (or at least I did not find it...)
What is the preferred way to do this under mono using monodevelop?
If the answer is "well, do the same - but hand-type the code needed" I'd love some pointers to a nice tutorial.
On the mono list, John Ludlow had the answer I needed:
...First, the ConfigurationManager (
http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx ) will expose two section handlers by default...
If you want more complex configuration option then you can define your own
handlers by inheriting from ConfigurationSection and ConfigurationElement.
See http://msdn.microsoft.com/en-us/library/system.configuration.configurationsection.aspx
and http://msdn.microsoft.com/en-us/library/system.configuration.configurationelement.aspx.
You may also need to provide a class inheriting from ConfigurationElementCollection
as well, if you want to be able to configure a collection of values.
Thanks to John and the people of the mono-list.
You still can use .settings files to keep settings, just edit them by-hand.
Also you can use App.config / another .config files
I use Tomcat 6.0.20 and JDK 1.6.0.13.
How can I load libraries from sub-folders of %TOMCAT_HOME%/lib/ without taking the .jars out of sub-folders and putting them straight into %TOMCAT_HOME%/lib/?
The reason I want to do this, is because many apps are going to be sharing lots of libraries.
So, for the sakes of organization I want to store them into folders as such:
%TOMCAT_HOME%/lib/novell/*.jar
%TOMCAT_HOME%/lib/mail/*.jar
%TOMCAT_HOME%/lib/upload/*.jar
etc.
How would I go about this? And please provide an example.
Do I use setclasspath.bat, catalina.properties or something completely different?
Thanks in advance.
Define those paths in shared.loader property of /conf/catalina.properties file.
E.g.
shared.loader = ${catalina.home}/lib/novell/*.jar, ${catalina.home}/lib/mail/*.jar, ${catalina.home}/lib/upload/*.jar
[Edit] optionally you can also use the common.loader property for this. See what has your preference.
I'm looking for a resource to list all the built-in properties defined in an MSBuild project file. Specifically I'm using a Team Build project file, but from what I understand they are one in the same (correct me if I'm wrong).
I already know about the reserved properties: http://msdn.microsoft.com/en-us/library/ms164309.aspx
But I've noticed other handy variables being referenced in examples, like $(SolutionRoot) and $(OutDir).
Is there a comprehensive list of all the properties I have access to? Where are these other properties defined? I found a forum post where the same question was asked, and it pointed to the Microsoft.TeamFoundation.Build.targets file, but I looked in there and could not find definitions for $(SolutionRoot) and $(OutDir) listed.
Thanks for any help you can give, Daniel
This is another great reference:
http://blogs.msdn.com/aaronhallberg/archive/2008/02/12/team-build-2008-property-reference.aspx
Vaccano
Did you see this: http://www.woodwardweb.com/vsts/30_useful_team.html