How to test RichFaces setup?
by Richard Kennard
Hi guys,
When running my unit tests through Forge test-harness, how should I add RichFaces to my project? Doing...
Project project = setupScaffoldProject();
getShell().execute("richfaces setup");
...does not seem to work?
Regards,
Richard.
13 years, 1 month
Annotation.getName question
by Richard Kennard
Hi guys,
org.jboss.forge.parser.java.Annotation.getName() appears to return the name (eg. Id), not the fully qualified name (eg. javax.persistence.Id), of the
annotation. How can I get the qualified name?
Regards,
Richard.
13 years, 1 month
Method.getReturnType questions
by Richard Kennard
Hi guys,
A couple questions regarding org.jboss.forge.parser.java.Method.getReturnType:
1. How come it returns a String, instead of a JavaType?
2. The String is just the name, not the fully qualified name. How can I get the fully qualified name?
Regards,
Richard.
13 years, 1 month
Recommended way to retrieve properties from a JavaClass?
by Richard Kennard
Hi guys,
As I understand it, Forge has an understanding of your project that transcends Java's own understanding. So for example if I say...
field string --named foo
...Forge knows I'm creating a property, and it creates getters and setters for that property. But later if I do...
org.jboss.forge.parser.java.JavaClass.getMethods()
...then I get back just normal methods. I'll have to check their signature for 'get' or 'set' to see if they're properties. Equally if I do...
org.jboss.forge.parser.java.JavaClass.getFields()
...I'm not really sure if these are properties (and if so, what their getter/setter methods are), or whether they're just normal internal fields.
Is there a recommended way to 'get back out' the list of properties for a class? Something that tells me a) the field; b) the getter; c) the setter?
Richard.
13 years, 1 month
Possible to lookup classes in project being forged?
by Richard Kennard
Hi guys,
I was hoping there was a way in Forge to lookup the classes in the project being 'forged'. For example, in regular Java I can do...
Class.forName( "foo.Bar" );
So I was hoping for a Forge equivalent like...
org.jboss.forge.parser.java.JavaClass.forName( "foo.Bar" )
...that would return me an org.jboss.forge.parser.java.JavaClass representing Bar. Note that Bar is a class in the project being forged. It is not an
actual Class in the VM.
Regards,
Richard.
13 years, 1 month
Plugins new-plugin failure when groupId is wrong
by Cordenier Christophe
Hi
The creation of a new plugin fails if the groupId does not match a java package, maybe it should ask for a package and warn the user that its groupId is probably mis-written.
Cheers
Christophe.
________________________________
Ce message et les pi?ces jointes sont confidentiels et r?serv?s ? l'usage exclusif de ses destinataires. Il peut ?galement ?tre prot?g? par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir imm?diatement l'exp?diteur et de le d?truire. L'int?grit? du message ne pouvant ?tre assur?e sur Internet, la responsabilit? d'Atos ne pourra ?tre recherch?e quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'exp?diteur ne donne aucune garantie ? cet ?gard et sa responsabilit? ne saurait ?tre recherch?e pour tout dommage r?sultant d'un virus transmis.
This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.
13 years, 1 month
Re: [forge-dev] Generate Code with Forge
by Rafael Pestano
I've managed to clone forge repo with this address
https://github.com/forge/core.git now, i was using the old
github.com/seam/forge.git.
2011/10/23 Rafael Pestano <rmpestano(a)gmail.com>
>
>> Hello Paul, thanks for your enlightening reply.
>>
>> The plugin is about a code generator for a home made Java EE6 framework
>> and for instance it will generate very simple xhtml and java classes, so for
>> example the generate-controller plugin would generate
>>
>> *@ViewAccessScoped
>> @Named("personMBean")
>> public class PersonMBean extends AbstractBaseMBean<Person> implements
>> Serializable, ModalObserver {
>>
>> @Inject
>> public void setPersonService(PersonService personService) {*//service
>> layer will be generated togheter*
>> super.setBaseService(personService);
>> }
>>
>> some other very simple methods
>> }*
>>
>> for the controller-plugin maybe i dont need to understand the model class
>> (just to import it) cause its just a matter of replacing parammeters by the
>> domain object but in the view-plugin it will be necessary for sure.
>>
>> Another concern i have is how to format the generated code? maybe the
>> velocity template could help on that.
>>
>> Ive seen the Arquillian example, how can i clone it and forge project?
>>
>> Thanks again!
>>
>>
>>
>>
>> 2011/10/23 Paul Bakker <paul.bakker.nl(a)gmail.com>
>>
>>> Hi Rafael,
>>>
>>> There are two things you need to do:
>>> 1) "understand" the Person class
>>> 2) generate new code
>>>
>>>
>>> 1)
>>> You can use a command parameter to get the Person class: @Option(name =
>>> "class", required = true, type = PromptType.JAVA_CLASS) JavaResource
>>> classUnderTest
>>>
>>> JavaResource is a rich file representation of the class.
>>> Now you can use the JavaSourceFacet to get information about the class
>>> itself:
>>>
>>> JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
>>> JavaSource<?> javaSource = classUnderTest.getJavaSource();
>>>
>>> javaSource has methods such as getPackage() etc.
>>>
>>> 2)
>>> Now you have to generate code. There are two ways to do this, depending
>>> on your needs.
>>> The most elegant way is to use the "JavaParser" builder API:
>>>
>>> JavaClass javaClass = JavaParser.create(JavaClass.class)
>>> .setPackage(entityPackage)
>>> .setName(entityName)
>>> .setPublic()
>>> .addAnnotation(Entity.class).getOrigin()
>>> .addInterface(Serializable.class);
>>> Field<JavaClass> id = javaClass.addField("private Long id = null;");
>>> ….
>>>
>>> My experience is that this works best for small classes. If you need to
>>> generate a lot of code it might be better to use a tempting framework such
>>> as Apache Velocity.
>>> You can find an example of this in the code of the Arquillian plugin:
>>> https://github.com/forge/plugin-arquillian/blob/master/src/main/java/org/...
>>>
>>> You can just add Velocity to your pom file and it will work.
>>>
>>> If you have any more questions, let us know! What kind of plugin are you
>>> writing?
>>>
>>> Paul Bakker
>>>
>>>
>>> On Oct 23, 2011, at 2:26 AM, Rafael Pestano wrote:
>>>
>>> Hi everyone,
>>>
>>> this is my first mail to this list and id like to congratulate the Forge
>>> team for their work.
>>>
>>> my question is, what's the best way to generate .java, .xhtml files with
>>> forge?
>>>
>>> Id like to write a plugin which would receive an entity class as
>>> parameter and generate some code on top of it, eg:
>>>
>>> $ generate-service Person
>>> $ generate-controller Person
>>> $ generate-view Person
>>>
>>>
>>> Where Person is a domain object, is it possible with Forge? if yes, whats
>>> the best way?
>>>
>>>
>>> thanks in advance.
>>>
>>>
>>>
>>>
>>> --
>>> <http://www.advancedit.com.br/>Att,
>>>
>>> Rafael M. Pestano
>>>
>>> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>> Graduando em Ciência da Computação UFRGS
>>> _______________________________________________
>>> forge-dev mailing list
>>> forge-dev(a)lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>
>>>
>>>
>>
>>
>> --
>> <http://www.advancedit.com.br/>Att,
>>
>> Rafael M. Pestano
>>
>> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>> Graduando em Ciência da Computação UFRGS
>>
>
>
>
> --
> <http://www.advancedit.com.br/>Att,
>
> Rafael M. Pestano
>
> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> Graduando em Ciência da Computação UFRGS
>
--
<http://www.advancedit.com.br/>Att,
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
13 years, 1 month
Re: [forge-dev] Food for thought: Forge scaffolding is not 'continuous'
by Lincoln Baxter, III
This is in the pipeline, but not there yet. Mostly I think the feature you
are referring to is for communicating file changes *to* JBoss tools.
On Mon, Oct 24, 2011 at 10:32 AM, Rodney Russ <rruss(a)redhat.com> wrote:
> Isn't there already a mechanism for recognizing changes for the integration
> with JBoss Tools? Or is that just one way?
>
> ----- "Lincoln Baxter, III" <lincolnbaxter(a)gmail.com> wrote:
>
> > From: "Lincoln Baxter, III" <lincolnbaxter(a)gmail.com>
> > To: "forge-dev List" <forge-dev(a)lists.jboss.org>
> > Sent: Monday, October 24, 2011 12:28:25 AM GMT -07:00 US/Canada Mountain
> > Subject: Re: [forge-dev] Food for thought: Seam Forge scaffolding is not
> 'continuous'
> >
> > This is possibly because if you don't "reload" the entity after making
> > changes in an external editor, Forge doesn't know the file has
> > changed, and rewrites the same contents... probably something to fix.
> >
> > That's my guess as to what they are referring to. Good point though.
> >
> > ~Lincoln
> >
> >
> > On Mon, Oct 24, 2011 at 1:02 AM, Jason Porter <
> > lightguard.jp(a)gmail.com > wrote:
> >
> >
> > I'm a little confused by this thinking. Forge will work with whatever
> > you have there. Generated or not. It isn't going to overwrite anything
> > you put in there, maybe they were using an old version?
> >
> > Sent from my iPhone
> >
> >
> >
> >
> > On Oct 23, 2011, at 22:50, Richard Kennard <
> > richard(a)kennardconsulting.com > wrote:
> >
> > > Hi guys,
> > >
> > > There's a nice looking presentation up at...
> > >
> > >
> >
> http://www.slideshare.net/jbaruch/pure-java-rad-and-scaffolding-tools-race
> > >
> > > ...that slightly 'dings' Seam Forge for not being 'continuous'
> > (slide 43). I asked the authors what they meant by this. They said:
> > >
> > > "The reason we stated SeamForge scaffolding as one-time is not
> > because of Metawidget, but because of the fact that generated code
> > inside the entities is
> > > not separated from user-created one. e.g. - I generated Person
> > entity, then changed stuff and added some stuff to it, and SeamForge's
> > entities editing
> > > feature is not usable for me anymore (Metawidget's forms rendering
> > will still work, of course). Just for the contrast, Spring Roo
> > separated the
> > > user-generated content from auto-generated content by using
> > Inter-type declarations. I can edit my entities the way I like and Roo
> > can mess with its ITDs
> > > the way it likes"
> > >
> > > Just some food for thought?
> > >
> > > Richard.
> > >
> > > _______________________________________________
> > > forge-dev mailing list
> > > forge-dev(a)lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/forge-dev
> >
> > _______________________________________________
> > forge-dev mailing list
> > forge-dev(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/forge-dev
> >
> >
> >
> > --
> > Lincoln Baxter, III
> > http://ocpsoft.com
> > http://scrumshark.com
> > "Keep it Simple"
> >
> > _______________________________________________
> > forge-dev mailing list
> > forge-dev(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/forge-dev
> _______________________________________________
> forge-dev mailing list
> forge-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
13 years, 1 month