Approach to Spring Boot handling JPA
by Ivan St. Ivanov
Hi folks,
As some of you probably heard, in Bulgarian JUG we are going to adopt an
addon (as George put it a couple of months ago). Beginning of August we are
going to develop a Forge extension for Spring Boot. One of the things that
we are not sure yet how to tackle is persistence.
You see, Spring supports JPA. However instead of configuring it in the Java
EE way with persistence.xml, in Spring Boot they use a properties file for
that (and for all their configuration). The current JPA facet
implementations however are developed with presistence.xml in mind. The JPA
setup wizard itself is also bound somehow to presistence.xml - it picks the
facet to install based on that file.
What we want to do is not to rewrite all the Forge commands for JPA just
because of the fact above. We were thinking of a small change - extend
JPAFacet with SpringBootJPAFacet. And then add a new implementation of
PersistenceContainer -> SpringBootContainer or something? And then we have
to change JPASetupWizardImpl to pick the facet not only based on the JPA
version, but also based on the container.
Or maybe there is a better way?
I am expecting your feedback :)
Cheers,
Ivan
9 years, 4 months
Forge Meeting minutes - 2015-07-21
by George Gastaldi
==============
#forge Meeting
==============
Meeting started by gastaldi at 14:00:42 UTC. The full logs are available
at
http://transcripts.jboss.org/meeting/irc.freenode.org/forge/2015/forge.20...
.
Meeting summary
---------------
* Agenda (gastaldi, 14:01:27)
* Status reports (gastaldi, 14:04:33)
* I've been working on fixing some Forge bugs and helping the Windup
team with some ideas this week. The website seems finished
(gastaldi, 14:05:12)
* The JBoss Forge Spring Boot code retreat is already scheduled for
7-9 August and we already have 12 geeks that subscribed to it!
(ivannov, 14:11:40)
* reviewed some of your work (lincolnthree, 14:22:07)
* helped design the new test extension feature for @deployment-less
tests (lincolnthree, 14:22:13)
* LINK:
https://github.com/forge/core/blob/master/addons/tests/src/test/java/org/...
(gastaldi, 14:25:25)
* Priority (gastaldi, 14:42:46)
* This week we'll fix some Forge bugs and help contributors
(gastaldi, 14:46:00)
* Forge is now on GVM (gvmtool.net). Installation instructions:
https://gist.github.com/marcoVermeulen/0eefdfcff323f5d3bdcf
(gastaldi, 14:47:13)
Meeting ended at 15:00:23 UTC.
Action Items
------------
Action Items, by person
-----------------------
* **UNASSIGNED**
* (none)
People Present (lines said)
---------------------------
* gastaldi (52)
* ivannov (31)
* lincolnthree (7)
* jbott (6)
* jbossbot (2)
* vineetreynolds (0)
Generated by `MeetBot`_ 0.1.4
.. _`MeetBot`: http://wiki.debian.org/MeetBot
9 years, 5 months
Forge meeting minutes - 2015-07-07
by George Gastaldi
==============
#forge Meeting
==============
Meeting started by gastaldi at 14:00:01 UTC. The full logs are available
at
http://transcripts.jboss.org/meeting/irc.freenode.org/forge/2015/forge.20...
.
Meeting summary
---------------
* Agenda (gastaldi, 14:00:22)
* Priorities (gastaldi, 14:02:11)
* the Website is still a priority. I implemented the change for the
addon page, which can be seen in
http://forge.jboss.org/addon/org.jboss.forge.addon:wildfly-swarm for
example, but the Search fields are still not working (gastaldi,
14:03:13)
* As the search feature is the only remaining issue for the Website to
fully perform, we'll work on it this week (gastaldi, 14:05:13)
* Current Status (gastaldi, 14:05:57)
* vineetreynolds is updating the AngularJS addon this week (gastaldi,
14:08:26)
* I've been working in the website in the past week, fixing some
Roaster bugs and reviewing the GSoC student's work (gastaldi,
14:14:13)
* I've been working in the website in the past week, fixing some
Roaster bugs and reviewing the GSoC student's work (gastaldi,
14:16:44)
* GSoC (gastaldi, 14:22:38)
* As I beforementioned, last week I reviewed the GSoC student's work
(gastaldi, 14:23:04)
* I am proud to say that both passed the midterm evaluation. Looking
forward to seeing both completed in the end :) (gastaldi, 14:24:03)
* Devanshu is working in the Docker addon and Wicem (addonis1990) is
working in the Database Migration addon (gastaldi, 14:24:30)
Meeting ended at 14:37:29 UTC.
Action Items
------------
Action Items, by person
-----------------------
* **UNASSIGNED**
* (none)
People Present (lines said)
---------------------------
* gastaldi (52)
* Devanshu (11)
* jbott (10)
* vineetreynolds (6)
* addonis1990 (3)
* jbossbot (2)
* lincolnthree (1)
* maxandersen (1)
* koentsje (0)
Generated by `MeetBot`_ 0.1.4
.. _`MeetBot`: http://wiki.debian.org/MeetBot
9 years, 5 months
JPA facet isInstalled implementation
by Ivan St. Ivanov
Hi everybody,
I am working on a project that is not mainstream Java EE. Its target is
Tomcat, but it uses JPA 2.0 (Eclipselink). I have tailored the dependencies
in the pom.xml as well as the persistence.xml.
And now I want to use Forge to add some fields to the existing entities.
What I noticed is that when I run the jpa-new-field command for the first
time, it also installs the JPA facet. Which in turns adds some unwanted
dependencies to my pom.xml and completely overwrites persistence.xml.
I dig into the code and found that the isInstalled method of the JPA Facet
returns true when persistence.xml file does not exist and when pom.xml does
not contain some dependencies. These dependencies are different for JPA 2.0
and 2.1, but are basically Hibernate JPA API and the Java EE API.
As a result of this, projects that don't target Java EE or that use
different artifacts for it or for JPA are going to get their poms polluted
and their persistence.xml files overwritten.
So my proposal is to change the isInstalled method to only check for the
presence of persistence.xml. What do you think?
Regards,
Ivan
9 years, 5 months
Some questions on wizard steps
by Ivan St. Ivanov
Hey everybody,
It's me again, using a new thread for the sake of keeping stuff separated :)
My next questions concern defining wizard steps. There we go:
1) Suppose I define a wizard. But already at the first window the user can
say "I am done". And can press the Finish button. How can I specify in a
wizard step that the Finish button is clickable. From the docs I got it is
just by returning null from the next() method. But I want to have both the
opportunity to go to the next step or finish everything immediately. So
both Next and Finish buttons have to be enabled
2) That's a more tricky question. In a command window I want to give the
opportunity to the user to define one or more security roles. Pay attention
to the 'one or more' requirement: the user should be able to enter in one,
two, three, four or *n* text fields the name of the role they want to add
to the security constraint. How can I implement that?
Thanks,
Ivan
9 years, 5 months
Interesting behavior of CommandController (bug or feature ; ))
by Ivan St. Ivanov
Hi everybody,
Believe it or not, but I resumed my work on the Servlet Security addon for
Forge (https://issues.jboss.org/browse/FORGEPLUGINS-152) :)
And I found something that I don't know whether is a bug or a feature. If
my Command class implements the PrerequisiteCommandsProvider and if I try
to use the CommandController in my integration test, then I have a problem.
Here is a sample code:
try (CommandController commandController = testHarness
.createCommandController(SecuritySetupCommand.class,
project.getRoot()))
{
commandController.initialize();
commandController.setValueFor("securityRealm", realm);
commandController.setValueFor("authMethod", authenticationMethod);
commandController.execute();
}
This code fails at the setValueFor method simply because the UI was not
initialized in the initialize method above it and there are no such inputs
like securityRealm and authMethod.
I did some debugging and found that if SecuritySetupCommand implements the
PrerequisiteCommandsProvider interface, the
commandController.initialize() method does not
call PrerequisiteCommandsProvider#initializeUI method. Instead it
triggeres PrerequisiteCommandTransformer.DelegateWizard#initializeUI. Which
is empty and does nothing. And that's the reason why there are no
securityRealm and authMethod controls.
I guess that it is caused by some CDI "magic"? So I wonder is it a bug or a
feature? Can I use CommandController to test commands that implement
PrerequisiteCommandsProvider?
Thanks,
Ivan
9 years, 5 months