Re: [Xdoclet-user] xdoclet2 not recognizing ant env properties
--- Shishir K. Singh [EMAIL PROTECTED] wrote: No problem. I decided to get my hands dirty and did the following changes in XDocletTask to make things work for me (till a better soln is found) That's cool - engaged developers are always cool ;) a) To overcome the Id issue, I changed the addProperties() method to addConfiguredProperties() so that ant populates the attributes by the time the getId() and getFile() validation is called. I think I made a mistake there - I do not use ant build, and never used property substiturion of tag value. From what I recall from ant , correcto specification of property file could be: properties id=foo file=bar/ Instead of what I wrote before :) This stuff definitely needs some improvement, so feel free to send in the patches. regards, [ Konstantin Pribluda http://www.pribluda.de ] JTec quality components: http://www.pribluda.de/projects/ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user
Re: [Xdoclet-user] xdoclet2 not recognizing ant env properties
--- java.lang.IllegalArgumentException: Properties id cannot be null at org.xdoclet.ant.XDocletTask.addProperties(XDocletTask.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tools.ant.IntrospectionHelper$AddNestedCreator.istore(Introsp ectionHelper.java:1327) at org.apache.tools.ant.IntrospectionHelper$AddNestedCreator.create(Introsp ectionHelper.java:1311) at org.apache.tools.ant.IntrospectionHelper$Creator.create(IntrospectionHel per.java:1176) at org.apache.tools.ant.UnknownElement.handleChild(UnknownElement.java:547) at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:3 43) at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:198) at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:1 60) at org.apache.tools.ant.Task.perform(Task.java:347) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut or.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Am I missing something here? Regards Shishir -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Konstantin Priblouda Sent: Tuesday, December 11, 2007 6:31 AM To: End-user support for the XDoclet code generator Subject: Re: [Xdoclet-user] xdoclet2 not recognizing ant env properties --- Shishir K. Singh [EMAIL PROTECTED] wrote: It seems that Xdoclet2 does not supports the same (at least just by replacing xdoclet by xdoclet2). Is there a way to achieve the same in xdoclet2. The fact that I am unable to replicate the above feature is preventing me from moving to xdoclet2. XD2 provides property expanders, which are not registered by default ( org.xdoclet.tools.PropertiesQDoxPropertyExpander , org.xdoclet.tools.SystemQDoxPropertyExpander ) to use them, you shall register them together with individual plugins regards, [ Konstantin Pribluda http://www.pribluda.de ] JTec quality components: http://www.pribluda.de/projects/ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user [ Konstantin Pribluda http://www.pribluda.de ] JTec quality components: http://www.pribluda.de/projects/ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user
Re: [Xdoclet-user] xdoclet2 not recognizing ant env properties
No problem. I decided to get my hands dirty and did the following changes in XDocletTask to make things work for me (till a better soln is found) a) To overcome the Id issue, I changed the addProperties() method to addConfiguredProperties() so that ant populates the attributes by the time the getId() and getFile() validation is called. b) Added this piece in the composeContainer method of createGenerama method (at the end very end of the method): java.util.Properties props = System.getProperties(); props.putAll(getProject().getProperties()); System.setProperties(props); This allowed me to define the properties file in ant build file as property file=xxx and then access them by registering org.xdoclet.tools.SystemQDoxPropertyExpander Regards Shishir -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Konstantin Priblouda Sent: Wednesday, December 12, 2007 3:51 AM To: End-user support for the XDoclet code generator Subject: Re: [Xdoclet-user] xdoclet2 not recognizing ant env properties I'm sorry, but for next 2 days I'm on conference ( javapolis ) and can not give much of assystance. regards, --- Shishir K. Singh [EMAIL PROTECTED] wrote: Thanks for the info Here's what I am doing (I got the xdoclet2 from the source ..trunk version, compiled and hibernate plugin 1.0.4-SNAPSHOT) a) I have the properties file in my build file as property environment=env/ property file=myproperties.properties/ And here's the def for the hibernate target name= hibernate property name=xdoclet2.lib.dir value=${basedir}/lib/xdoclect2/ path id=xdoclet2.task.classpath fileset dir=${xdoclet2.lib.dir} includes=**/*.jar/ /path taskdef name=xdoclet2 classname=org.xdoclet.ant.XDocletTask classpathref=xdoclet2.task.classpath/ xdoclet2 !-- defines the file handled by xdoclet2 -- fileset dir=${java.src.dir} includes=**/*.java/ !-- Register Expander -- component classname=org.xdoclet.tools.SystemQDoxPropertyExpander/ !-- defines the processing of a plugin -- component classname=org.xdoclet.plugin.hibernate.HibernateMappingPlugin destdir=${dest.dir} version=3.0 multioutput=true encoding=UTF-8/ /xdoclet2 /target It does not seem to work with the above setup. The assumption is that SystemQDoxPropertyExpander will get the properties as system properties from myproperties.properties. However, it does not seem that the properties from the file is getting loaded and accessible in SystemQDoxPropertyExpander, even though I see the values by echoing in the build.xml. b) I tried to use PropertiesQDoxPropertyExpander too with the following setup xdoclet2 !-- defines the file handled by xdoclet2 -- fileset dir=${java.src.dir} includes=**/*.java/ !-- Register Expander -- properties idprops/id filemyfile.properties/file /properties component classname=org.xdoclet.tools.PropertiesQDoxPropertyExpander/ !-- defines the processing of a plugin -- component classname=org.xdoclet.plugin.hibernate.HibernateMappingPlugin destdir=${dest.dir} version=3.0 multioutput=true encoding=UTF-8/ /xdoclet2 With the above piece of config, ant flat out errors out with the following (I am not too clear as to the function of the id tag) C:\project\build.xml:312: java.lang.IllegalArgumentException: Properties id cannot be null at org.apache.tools.ant.IntrospectionHelper$Creator.create(IntrospectionHel per.java:1197) at org.apache.tools.ant.UnknownElement.handleChild(UnknownElement.java:547) at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:3 43) at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:198) at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:1 60) at org.apache.tools.ant.Task.perform(Task.java:347) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut or.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698
Re: [Xdoclet-user] xdoclet2 not recognizing ant env properties
) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tools.ant.IntrospectionHelper$AddNestedCreator.istore(Introsp ectionHelper.java:1327) at org.apache.tools.ant.IntrospectionHelper$AddNestedCreator.create(Introsp ectionHelper.java:1311) at org.apache.tools.ant.IntrospectionHelper$Creator.create(IntrospectionHel per.java:1176) at org.apache.tools.ant.UnknownElement.handleChild(UnknownElement.java:547) at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:3 43) at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:198) at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:1 60) at org.apache.tools.ant.Task.perform(Task.java:347) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut or.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Am I missing something here? Regards Shishir -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Konstantin Priblouda Sent: Tuesday, December 11, 2007 6:31 AM To: End-user support for the XDoclet code generator Subject: Re: [Xdoclet-user] xdoclet2 not recognizing ant env properties --- Shishir K. Singh [EMAIL PROTECTED] wrote: It seems that Xdoclet2 does not supports the same (at least just by replacing xdoclet by xdoclet2). Is there a way to achieve the same in xdoclet2. The fact that I am unable to replicate the above feature is preventing me from moving to xdoclet2. XD2 provides property expanders, which are not registered by default ( org.xdoclet.tools.PropertiesQDoxPropertyExpander , org.xdoclet.tools.SystemQDoxPropertyExpander ) to use them, you shall register them together with individual plugins regards, [ Konstantin Pribluda http://www.pribluda.de ] JTec quality components: http://www.pribluda.de/projects/ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user