[JBoss JIRA] (FORGE-1271) Adding code conventions to scaffolded code
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1271?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1271:
-------------------------------------
Summary: Adding code conventions to scaffolded code (was: Adding code conventions to generated code)
> Adding code conventions to scaffolded code
> ------------------------------------------
>
> Key: FORGE-1271
> URL: https://issues.jboss.org/browse/FORGE-1271
> Project: Forge
> Issue Type: Sub-task
> Components: Resources, Scaffold
> Affects Versions: 2.0.0.Alpha14
> Reporter: Antonio Goncalves
> Fix For: 2.x Future, 3.x Future
>
>
> Discussion on : https://community.jboss.org/message/842429
> Developers look at Forge as the "way to write Java EE code" or if you like "if those guys write code like this, then we should".
> I am digging into some details of the generated code (I am writing a blog about several architectural styles starting with Forge) and I feel coding convention should be homogenized. I know extensions are written by different individuals, but some basic coding conventions should be applied. For example, when you generate a web app with REST and Faces scaffolding, you get some difference :
> * Faces Backing Bean use query builder (e.g {{getAll}} method is {{entityManager.createQuery(criteria.select(criteria.from(Book.class))).getResultList();}} and
> * REST Endpoint use dynamic queries (the {{listAll}} method is {{"SELECT DISTINCT b FROM Book b ORDER BY b.id"))}}
> Method names are different and do the same :
> * JSF : {{getAll}}
> * REST : {{listAll}}
> Attributes
> * {{private EntityManager em;}}
> * {{private EntityManager entityManager;}} // em would be better
> Or the use of {{this}} keyword (JSF beans use {{this.entityManager}} instead of directly {{em}} in REST)
> And there are several examples like this. If Forge is seen as "the way of writing code" maybe something should be created to get homogenized code. PMD, Checkstyle, human review and so one.....
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (FORGE-1271) Adding code conventions to scaffolded code
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1271?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1271:
-------------------------------------
Fix Version/s: 3.x Future
> Adding code conventions to scaffolded code
> ------------------------------------------
>
> Key: FORGE-1271
> URL: https://issues.jboss.org/browse/FORGE-1271
> Project: Forge
> Issue Type: Sub-task
> Components: Resources, Scaffold
> Affects Versions: 2.0.0.Alpha14
> Reporter: Antonio Goncalves
> Fix For: 2.x Future, 3.x Future
>
>
> Discussion on : https://community.jboss.org/message/842429
> Developers look at Forge as the "way to write Java EE code" or if you like "if those guys write code like this, then we should".
> I am digging into some details of the generated code (I am writing a blog about several architectural styles starting with Forge) and I feel coding convention should be homogenized. I know extensions are written by different individuals, but some basic coding conventions should be applied. For example, when you generate a web app with REST and Faces scaffolding, you get some difference :
> * Faces Backing Bean use query builder (e.g {{getAll}} method is {{entityManager.createQuery(criteria.select(criteria.from(Book.class))).getResultList();}} and
> * REST Endpoint use dynamic queries (the {{listAll}} method is {{"SELECT DISTINCT b FROM Book b ORDER BY b.id"))}}
> Method names are different and do the same :
> * JSF : {{getAll}}
> * REST : {{listAll}}
> Attributes
> * {{private EntityManager em;}}
> * {{private EntityManager entityManager;}} // em would be better
> Or the use of {{this}} keyword (JSF beans use {{this.entityManager}} instead of directly {{em}} in REST)
> And there are several examples like this. If Forge is seen as "the way of writing code" maybe something should be created to get homogenized code. PMD, Checkstyle, human review and so one.....
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (FORGE-1271) Adding code conventions to generated code
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1271?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1271:
-------------------------------------
Parent: FORGE-2277
Issue Type: Sub-task (was: Feature Request)
> Adding code conventions to generated code
> -----------------------------------------
>
> Key: FORGE-1271
> URL: https://issues.jboss.org/browse/FORGE-1271
> Project: Forge
> Issue Type: Sub-task
> Components: Resources, Scaffold
> Affects Versions: 2.0.0.Alpha14
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> Discussion on : https://community.jboss.org/message/842429
> Developers look at Forge as the "way to write Java EE code" or if you like "if those guys write code like this, then we should".
> I am digging into some details of the generated code (I am writing a blog about several architectural styles starting with Forge) and I feel coding convention should be homogenized. I know extensions are written by different individuals, but some basic coding conventions should be applied. For example, when you generate a web app with REST and Faces scaffolding, you get some difference :
> * Faces Backing Bean use query builder (e.g {{getAll}} method is {{entityManager.createQuery(criteria.select(criteria.from(Book.class))).getResultList();}} and
> * REST Endpoint use dynamic queries (the {{listAll}} method is {{"SELECT DISTINCT b FROM Book b ORDER BY b.id"))}}
> Method names are different and do the same :
> * JSF : {{getAll}}
> * REST : {{listAll}}
> Attributes
> * {{private EntityManager em;}}
> * {{private EntityManager entityManager;}} // em would be better
> Or the use of {{this}} keyword (JSF beans use {{this.entityManager}} instead of directly {{em}} in REST)
> And there are several examples like this. If Forge is seen as "the way of writing code" maybe something should be created to get homogenized code. PMD, Checkstyle, human review and so one.....
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (FORGE-1524) Change the JSF preRenderView to fit the new viewAction
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1524?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1524:
-------------------------------------
Parent Issue: FORGE-2277 (was: FORGE-1491)
> Change the JSF preRenderView to fit the new viewAction
> ------------------------------------------------------
>
> Key: FORGE-1524
> URL: https://issues.jboss.org/browse/FORGE-1524
> Project: Forge
> Issue Type: Sub-task
> Components: Scaffold
> Affects Versions: 2.0.0.CR2
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> When a JSF page is generated, it uses the old JSF 2.0 {{preRenderView}} :
> {code}
> <f:event type="preRenderView" listener='#{authorBean.retrieve}'/>
> {code}
> Instead, it should be using the new Java EE 7 {{viewAction}} :
> {code}
> <f:viewAction action="#{authorBean.retrieve}"/>
> {code}
> I've replaced all occurrences in every pages and it works fine.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (FORGE-1520) Use Java EE 7 Default Datasource in persistence.xml
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1520?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1520:
-------------------------------------
Parent Issue: FORGE-2277 (was: FORGE-1491)
> Use Java EE 7 Default Datasource in persistence.xml
> ---------------------------------------------------
>
> Key: FORGE-1520
> URL: https://issues.jboss.org/browse/FORGE-1520
> Project: Forge
> Issue Type: Sub-task
> Components: Scaffold
> Affects Versions: 2.0.0.CR2
> Reporter: Antonio Goncalves
> Fix For: 3.x Future
>
>
> If I create project with default values I get the following {{persistence.xml}} :
> {code}
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
> <persistence-unit name="forge-default" transaction-type="JTA">
> <description>Forge Persistence Unit</description>
> <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
> <exclude-unlisted-classes>false</exclude-unlisted-classes>
> <properties>
> <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
> <property name="javax.persistence.schema-generation.scripts.action" value="drop-and-create"/>
> <property name="javax.persistence.schema-generation.scripts.create-target" value="pluralsight-persistenceCreate.ddl"/>
> <property name="javax.persistence.schema-generation.scripts.drop-target" value="pluralsight-persistenceDrop.ddl"/>
> </properties>
> </persistence-unit>
> </persistence>
> {code}
> This code doesn't work in GlassFish because of the Datasource {{java:jboss/datasources/ExampleDS}}.
> This {{persistence.xml}} is JPA 2.1 compatible, so you should use the default Datasource that is portable accross application server : just get rid of the {{<jta-data-source>}} element and it will work on both GlassFish and WildFly 8 CR1.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (FORGE-1512) Rename JSF scaffold-generate command
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1512?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1512:
-------------------------------------
Parent Issue: FORGE-2277 (was: FORGE-1491)
> Rename JSF scaffold-generate command
> ------------------------------------
>
> Key: FORGE-1512
> URL: https://issues.jboss.org/browse/FORGE-1512
> Project: Forge
> Issue Type: Sub-task
> Components: UI - Shell
> Affects Versions: 2.0.0.CR2
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> Had a chat with @VineetReynolds about the difference between scaffolding and generation. JSF scaffolding is just another code generation (we could keep the 'scaffolding' term when generating an entire app).
> So, to generate a JSF interface, we should use the following command :
> {code}
> faces-generate-pages-from-entities
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (FORGE-2353) Check if we have all the needed Facets for Java EE 6 and Java EE 7 projects
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2353?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2353:
-------------------------------------
Parent: FORGE-1926
Issue Type: Sub-task (was: Feature Request)
> Check if we have all the needed Facets for Java EE 6 and Java EE 7 projects
> ---------------------------------------------------------------------------
>
> Key: FORGE-2353
> URL: https://issues.jboss.org/browse/FORGE-2353
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.16.1.Final
> Reporter: Antonio Goncalves
> Assignee: Antonio Goncalves
> Fix For: 3.x Future
>
>
> Versionned facets :
> || Spec || Java EE 5 || Java EE 6 || Java EE 7 ||
> | CDI | | CDIFacet_1_0 | CDIFacet_1_0 |
> | EJB | | EJBFacet_3_1 | EJBFacet_3_2 |
> | JSF | | FacesFacet_2_0 | FacesFacet_2_2 |
> | JPA | | JPAFacet_2_0 | JPAFacet_2_1 |
> | JTA | | JTAFacet_1_1 | JTAFacet_1_2 |
> | JAX-RS | | RestFacet_1_1 | RestFacet_2_0 |
> | Servlet | ServletFacet_2_5 | ServletFacet_3_0 | ServletFacet_3_1 |
> No versionned facets :
> || Spec || Facet ||
> | JAX-WS | JAXWSFacet |
> | JMS | JMSFacet |
> | JSTL | JSTLFacet |
> | Bean Validation | ValidationFacet |
> | Web Socket | WebSocketFacet |
> Missing spec :
> || Spec || Comment ||
> | Batch | Arun created an addon, it should be integrated for EE 7 see https://github.com/forge/addon-batch|
> | JSon-P| For EE 7|
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months