[JBoss JIRA] (FORGE-2246) Refactoring the JPA Commands
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2246?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2246:
-------------------------------------
Description:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculateDefaultPackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them by prefixing them with {{JPA}}
*** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
*** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
*** ...
Questions : some classes redifine {{named}} and {{targetPackage}} some don't :
{code}
@Inject
@WithAttributes(label = "Entity name", description = "The simple name of the generated class", required = true)
private UIInput<String> named;
@Inject
@WithAttributes(label = "Target package", type = InputType.JAVA_PACKAGE_PICKER)
private UIInput<String> targetPackage;
{code}
was:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them by prefixing them with {{JPA}}
*** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
*** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
*** ...
Questions : some classes redifine {{named}} and {{targetPackage}} some don't :
{code}
@Inject
@WithAttributes(label = "Entity name", description = "The simple name of the generated class", required = true)
private UIInput<String> named;
@Inject
@WithAttributes(label = "Target package", type = InputType.JAVA_PACKAGE_PICKER)
private UIInput<String> targetPackage;
{code}
> Refactoring the JPA Commands
> ----------------------------
>
> Key: FORGE-2246
> URL: https://issues.jboss.org/browse/FORGE-2246
> Project: Forge
> Issue Type: Sub-task
> Components: UI - API
> Reporter: Antonio Goncalves
> Priority: Minor
> Fix For: 2.x Future, 3.x Future
>
>
> The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
> * Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
> ** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
> ** {{isProjectRequired}}
> ** {{getPrerequisiteCommands}}
> ** Add a method {{calculateDefaultPackage}}
> * Refactor the classes
> ** They extend from {{AbstractJPACommand}}
> ** Rename them by prefixing them with {{JPA}}
> *** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
> *** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
> *** ...
> Questions : some classes redifine {{named}} and {{targetPackage}} some don't :
> {code}
> @Inject
> @WithAttributes(label = "Entity name", description = "The simple name of the generated class", required = true)
> private UIInput<String> named;
> @Inject
> @WithAttributes(label = "Target package", type = InputType.JAVA_PACKAGE_PICKER)
> private UIInput<String> targetPackage;
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 1 month
[JBoss JIRA] (FORGE-2246) Refactoring the JPA Commands
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2246?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2246:
-------------------------------------
Description:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them by prefixing them with {{JPA}}
*** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
*** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
*** ...
Questions : some classes redifine {{named}} and {{targetPackage}} some don't :
{code}
@Inject
@WithAttributes(label = "Entity name", description = "The simple name of the generated class", required = true)
private UIInput<String> named;
@Inject
@WithAttributes(label = "Target package", type = InputType.JAVA_PACKAGE_PICKER)
private UIInput<String> targetPackage;
{code}
was:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them by prefixing them with {{JPA}}
*** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
*** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
*** ...
> Refactoring the JPA Commands
> ----------------------------
>
> Key: FORGE-2246
> URL: https://issues.jboss.org/browse/FORGE-2246
> Project: Forge
> Issue Type: Sub-task
> Components: UI - API
> Reporter: Antonio Goncalves
> Priority: Minor
> Fix For: 2.x Future, 3.x Future
>
>
> The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
> * Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
> ** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
> ** {{isProjectRequired}}
> ** {{getPrerequisiteCommands}}
> ** Add a method {{calculatePackage}}
> * Refactor the classes
> ** They extend from {{AbstractJPACommand}}
> ** Rename them by prefixing them with {{JPA}}
> *** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
> *** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
> *** ...
> Questions : some classes redifine {{named}} and {{targetPackage}} some don't :
> {code}
> @Inject
> @WithAttributes(label = "Entity name", description = "The simple name of the generated class", required = true)
> private UIInput<String> named;
> @Inject
> @WithAttributes(label = "Target package", type = InputType.JAVA_PACKAGE_PICKER)
> private UIInput<String> targetPackage;
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 1 month
[JBoss JIRA] (FORGE-2246) Refactoring the JPA Commands
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2246?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2246:
-------------------------------------
Description:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them by prefixing them with {{JPA}}
*** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
*** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
*** ...
was:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / "
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them by prefixing them with {{JPA}}
*** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
*** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
*** ...
> Refactoring the JPA Commands
> ----------------------------
>
> Key: FORGE-2246
> URL: https://issues.jboss.org/browse/FORGE-2246
> Project: Forge
> Issue Type: Sub-task
> Components: UI - API
> Reporter: Antonio Goncalves
> Priority: Minor
> Fix For: 2.x Future, 3.x Future
>
>
> The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
> * Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
> ** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
> ** {{isProjectRequired}}
> ** {{getPrerequisiteCommands}}
> ** Add a method {{calculatePackage}}
> * Refactor the classes
> ** They extend from {{AbstractJPACommand}}
> ** Rename them by prefixing them with {{JPA}}
> *** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
> *** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
> *** ...
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 1 month
[JBoss JIRA] (FORGE-2246) Refactoring the JPA Commands
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2246?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2246:
-------------------------------------
Description:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / "
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them by prefixing them with {{JPA}}
*** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
*** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
*** ...
was:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them by prefixing them with {{JPA}}
*** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
*** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
*** ...
> Refactoring the JPA Commands
> ----------------------------
>
> Key: FORGE-2246
> URL: https://issues.jboss.org/browse/FORGE-2246
> Project: Forge
> Issue Type: Sub-task
> Components: UI - API
> Reporter: Antonio Goncalves
> Priority: Minor
> Fix For: 2.x Future, 3.x Future
>
>
> The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
> * Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
> ** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / "
> ** {{isProjectRequired}}
> ** {{getPrerequisiteCommands}}
> ** Add a method {{calculatePackage}}
> * Refactor the classes
> ** They extend from {{AbstractJPACommand}}
> ** Rename them by prefixing them with {{JPA}}
> *** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
> *** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
> *** ...
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 1 month
[JBoss JIRA] (FORGE-2246) Refactoring the JPA Commands
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2246?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2246:
-------------------------------------
Description:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them by prefixing them with {{JPA}}
*** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
*** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
*** ...
was:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them
*** {{NewEmbeddableCommand -> JPANewEmbeddableCommand
> Refactoring the JPA Commands
> ----------------------------
>
> Key: FORGE-2246
> URL: https://issues.jboss.org/browse/FORGE-2246
> Project: Forge
> Issue Type: Sub-task
> Components: UI - API
> Reporter: Antonio Goncalves
> Priority: Minor
> Fix For: 2.x Future, 3.x Future
>
>
> The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
> * Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
> ** {{isProjectRequired}}
> ** {{getPrerequisiteCommands}}
> ** Add a method {{calculatePackage}}
> * Refactor the classes
> ** They extend from {{AbstractJPACommand}}
> ** Rename them by prefixing them with {{JPA}}
> *** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
> *** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
> *** ...
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 1 month
[JBoss JIRA] (FORGE-2246) Refactoring the JPA Commands
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2246?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2246:
-------------------------------------
Description:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
* Refactor the classes
** They extend from {{AbstractJPACommand}}
** Rename them
*** {{NewEmbeddableCommand -> JPANewEmbeddableCommand
was:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}}
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
> Refactoring the JPA Commands
> ----------------------------
>
> Key: FORGE-2246
> URL: https://issues.jboss.org/browse/FORGE-2246
> Project: Forge
> Issue Type: Sub-task
> Components: UI - API
> Reporter: Antonio Goncalves
> Priority: Minor
> Fix For: 2.x Future, 3.x Future
>
>
> The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
> * Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
> ** {{isProjectRequired}}
> ** {{getPrerequisiteCommands}}
> ** Add a method {{calculatePackage}}
> * Refactor the classes
> ** They extend from {{AbstractJPACommand}}
> ** Rename them
> *** {{NewEmbeddableCommand -> JPANewEmbeddableCommand
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 1 month
[JBoss JIRA] (FORGE-2246) Refactoring the JPA Commands
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2246?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2246:
-------------------------------------
Description:
The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
* Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}}
** {{isProjectRequired}}
** {{getPrerequisiteCommands}}
** Add a method {{calculatePackage}}
> Refactoring the JPA Commands
> ----------------------------
>
> Key: FORGE-2246
> URL: https://issues.jboss.org/browse/FORGE-2246
> Project: Forge
> Issue Type: Sub-task
> Components: UI - API
> Reporter: Antonio Goncalves
> Priority: Minor
> Fix For: 2.x Future, 3.x Future
>
>
> The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
> * Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}}
> ** {{isProjectRequired}}
> ** {{getPrerequisiteCommands}}
> ** Add a method {{calculatePackage}}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 1 month
[JBoss JIRA] (FORGE-2245) ResourceFactory : creating a resource from a file
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-2245?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III commented on FORGE-2245:
-------------------------------------------
Because you are creating a reference to a resource *within* a file, not an actual File itself, you should be using URLResource, which might be surprisingly simple :)
Just do:
{code}
URL voilaURL = getClass().getClassLoader().getResource("voila.txt");
Resource<?> resource = rfactory.create(voilaURL);
URLResource urlResource = resource.reify(URLResource.class);
{code}
> ResourceFactory : creating a resource from a file
> -------------------------------------------------
>
> Key: FORGE-2245
> URL: https://issues.jboss.org/browse/FORGE-2245
> Project: Forge
> Issue Type: Bug
> Components: Resources
> Affects Versions: 2.13.1.Final
> Environment: w764, java 7
> Reporter: Jerome B
>
> As I was trying to use a file contained in the JAR of my addon, I used this (intuitive) code
> URL voilaURL = getClass().getClassLoader().getResource("voila.txt");
> File f = new File(voilaURL.toExternalForm());
> Resource<?> resource = rfactory.create(f); // KO
> FileResource fresource = rfactory.create(FileResource.class, f); // KO
> both last two line lead to a FileResource which, in debug is displayed as this form
> [PROJECT_ROOT][Correct full path of file in jar]
> D:\workspace_addons\ADDONS\jar:file:\C:\Users\me\.forge\addons\fr-company-addons-ADDONS213b-1-0-1-SNAPSHOT\ADDONS213b-1.0.1-SNAPSHOT-forge-addon.jar!\voila.txt
> Then, those FileResources when used with the templateFactory
> Template template = tfactory.create(resource,FreemarkerTemplate.class);
> lead to an error like "template does not exist"
> Hint?: The toString value is wrong but the path of the file within FileResource is ok
> See https://developer.jboss.org/thread/252367 for more data
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 1 month
[JBoss JIRA] (ROASTER-63) JavaClassSource - Cannot extend another class when using the fluent builder
by Nicolas Challut (JIRA)
[ https://issues.jboss.org/browse/ROASTER-63?page=com.atlassian.jira.plugin... ]
Nicolas Challut commented on ROASTER-63:
----------------------------------------
Okay, the doc isn't perfect but I think that you could find this one ;)
{code}
JavaClassSource source = Roaster.create(JavaClassSource.class);
source.setName("Bar");
source.setSuperType("org.apache.camel.builder.RouteBuilder");
{code}
> JavaClassSource - Cannot extend another class when using the fluent builder
> ---------------------------------------------------------------------------
>
> Key: ROASTER-63
> URL: https://issues.jboss.org/browse/ROASTER-63
> Project: Roaster
> Issue Type: Enhancement
> Reporter: Claus Ibsen
>
> I need to create a java class that extends another. As there is no .addExtends or .extends or something I had to work around and use the parse.
> I can only find an .addInterface
> Here is the code I use with my workaround
> {code}
> // need to parse to be able to extends another class
> String top = String.format("public class %s extends RouteBuilder {}", name.getValue());
> final JavaClassSource javaClass = Roaster.parse(JavaClassSource.class, top);
> if (targetPackage.getValue() != null) {
> javaClass.setPackage(targetPackage.getValue());
> }
> {code}
> eg what I want to do is
> {code}
> javaClass.extends("RouteBuilder");
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years, 1 month