[JBoss JIRA] (FORGE-2323) Being able to create a new servlet
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2323?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2323:
-------------------------------------
Description:
It would be good to have a command to create a Servlet. A command like this :
{code}
servlet-new-servlet --named MyServlet
{code}
Would generate
{code}
@WebServlet(urlPatterns = "myServlet")
public class MyServlet extends HttpServlet
{
}
{code}
Changing the urlPattern would be :
{code}
servlet-new-servlet --named MyServlet --urlPattern myPattern
{code}
This would generate :
{code}
@WebServlet(urlPatterns = "myPattern")
public class MyServlet extends HttpServlet
{
}
{code}
The command also allows to generate several methods (get, post, put, delete) :
{code}
servlet-new-servlet --named MyServlet --methods GET POST DELETE
{code}
This would generate :
{code}
@WebServlet(urlPatterns = "myServlet")
public class MyServlet extends HttpServlet
{
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().println("doGet invoked");
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().println("doPost invoked");
}
@Override
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().println("doDelete invoked");
}
}
{code}
was:
It would be good to have a command to create a Servlet. A command like this :
{code}
servlet-new-endpoint --named MyEndpoint
{code}
Would generate
{code}
@Path("/myEndpoint")
public class CustomerEndpoint
{
}
{code}
Changing the path would be :
{code}
rest-new-endpoint --named MyEndPoint --path endpoint
{code}
This would generate :
{code}
@Path("/endpoint")
public class CustomerEndpoint
{
}
{code}
Also, a REST configuration class needs to be creates, such as :
{code}
@ApplicationPath("/rest")
public class RestApplication extends Application
{
}
{code}
> Being able to create a new servlet
> ----------------------------------
>
> Key: FORGE-2323
> URL: https://issues.jboss.org/browse/FORGE-2323
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.16.0.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> It would be good to have a command to create a Servlet. A command like this :
> {code}
> servlet-new-servlet --named MyServlet
> {code}
> Would generate
> {code}
> @WebServlet(urlPatterns = "myServlet")
> public class MyServlet extends HttpServlet
> {
> }
> {code}
> Changing the urlPattern would be :
> {code}
> servlet-new-servlet --named MyServlet --urlPattern myPattern
> {code}
> This would generate :
> {code}
> @WebServlet(urlPatterns = "myPattern")
> public class MyServlet extends HttpServlet
> {
> }
> {code}
> The command also allows to generate several methods (get, post, put, delete) :
> {code}
> servlet-new-servlet --named MyServlet --methods GET POST DELETE
> {code}
> This would generate :
> {code}
> @WebServlet(urlPatterns = "myServlet")
> public class MyServlet extends HttpServlet
> {
> @Override
> protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doGet invoked");
> }
> @Override
> protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doPost invoked");
> }
> @Override
> protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
> response.getWriter().println("doDelete invoked");
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2323) Being able to create a new servlet
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-2323:
----------------------------------------
Summary: Being able to create a new servlet
Key: FORGE-2323
URL: https://issues.jboss.org/browse/FORGE-2323
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.16.0.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
It would be good to have a command to create a Servlet. A command like this :
{code}
servlet-new-endpoint --named MyEndpoint
{code}
Would generate
{code}
@Path("/myEndpoint")
public class CustomerEndpoint
{
}
{code}
Changing the path would be :
{code}
rest-new-endpoint --named MyEndPoint --path endpoint
{code}
This would generate :
{code}
@Path("/endpoint")
public class CustomerEndpoint
{
}
{code}
Also, a REST configuration class needs to be creates, such as :
{code}
@ApplicationPath("/rest")
public class RestApplication extends Application
{
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2226) Being able to add a CDI injection point
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2226?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2226:
-------------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request: https://github.com/forge/core/pull/560
> Being able to add a CDI injection point
> ---------------------------------------
>
> Key: FORGE-2226
> URL: https://issues.jboss.org/browse/FORGE-2226
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.14.0.Final
> Reporter: Antonio Goncalves
> Assignee: Antonio Goncalves
> Fix For: 2.x Future
>
>
> It would be useful to have a command to add a new CDI injection point to an existing bean. A command such as :
> {code}
> cdi-add-injection-point --named logger --type org.apache.logging.log4j.Logger
> {code}
> Would add to an existing class the following code :
> {code}
> @Inject
> private Logger logger;
> {code}
> A qualifier could be added with:
> {code}
> cdi-add-injection-point --named logger --type org.apache.logging.log4j.Logger --qualifiers Debug Trace
> {code}
> Would add to an existing class the following code :
> {code}
> @Inject @Debug @Trace
> private Logger logger;
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2321) Refactor common code into the xxxOperations classes
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2321?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2321:
-------------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request: https://github.com/forge/core/pull/559
> Refactor common code into the xxxOperations classes
> ---------------------------------------------------
>
> Key: FORGE-2321
> URL: https://issues.jboss.org/browse/FORGE-2321
> Project: Forge
> Issue Type: Enhancement
> Components: UI - API
> Affects Versions: 2.16.0.Final
> Reporter: Antonio Goncalves
> Assignee: Antonio Goncalves
> Fix For: 2.x Future
>
>
> At the moment the class {{JPANewFieldWizard}} defines code as follow :
> {code}
> private List<JavaResource> getProjectEntities(Project project)
> {
> final List<JavaResource> entities = new ArrayList<>();
> if (project != null)
> {
> project.getFacet(JavaSourceFacet.class).visitJavaSources(new JavaResourceVisitor()
> {
> @Override
> public void visit(VisitContext context, JavaResource resource)
> {
> try
> {
> JavaSource<?> javaSource = resource.getJavaType();
> if (javaSource.hasAnnotation(Entity.class) || javaSource.hasAnnotation(Embeddable.class)
> || javaSource.hasAnnotation(MappedSuperclass.class))
> {
> entities.add(resource);
> }
> }
> catch (ResourceException | FileNotFoundException e)
> {
> // ignore
> }
> }
> });
> }
> return entities;
> }
> {code}
> This code should go into the {{PersistenceOperations}} class. There are other places like that.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2321) Refactor common code into the xxxOperations classes
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-2321:
----------------------------------------
Summary: Refactor common code into the xxxOperations classes
Key: FORGE-2321
URL: https://issues.jboss.org/browse/FORGE-2321
Project: Forge
Issue Type: Enhancement
Components: UI - API
Affects Versions: 2.16.0.Final
Reporter: Antonio Goncalves
Assignee: Antonio Goncalves
Fix For: 2.x Future
At the moment the class {{JPANewFieldWizard}} defines code as follow :
{code}
private List<JavaResource> getProjectEntities(Project project)
{
final List<JavaResource> entities = new ArrayList<>();
if (project != null)
{
project.getFacet(JavaSourceFacet.class).visitJavaSources(new JavaResourceVisitor()
{
@Override
public void visit(VisitContext context, JavaResource resource)
{
try
{
JavaSource<?> javaSource = resource.getJavaType();
if (javaSource.hasAnnotation(Entity.class) || javaSource.hasAnnotation(Embeddable.class)
|| javaSource.hasAnnotation(MappedSuperclass.class))
{
entities.add(resource);
}
}
catch (ResourceException | FileNotFoundException e)
{
// ignore
}
}
});
}
return entities;
}
{code}
This code should go into the {{PersistenceOperations}} class. There are other places like that.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month
[JBoss JIRA] (FORGE-2320) Create a UICompleterBuilder to ease the creation of UICompleter
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2320?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2320:
-------------------------------------
Description:
{code}
agoncal Any default UICompleter that goes "give me all the classes of the project" (without filtering) ?
lincolnthree hmm, i dont know if we have that
gastaldi let me check
gastaldi hmm we don't
gastaldi we could have a UICompleterBuilder to ease this
gastaldi something like: UICompleters.allClassesInProject().except(...)
agoncal Would be nice
agoncal Yes, or exclude (and we could play with include/exclude)
gastaldi +1
agoncal UICompleters.allClassesInProject()
agoncal UICompleters.allClassesInProject().exclude(My.class)
agoncal UICompleters.include(My.class)
agoncal But then you could include only a package, exclude a package, annotated classes (eg. include only Entities)...
agoncal So it could become quite rich actually
gastaldi agreed
gastaldi given to the modular nature of Forge, we need different builders for each addon
gastaldi so we'd have ProjectCompleters.allClassesIn(Project project)
gastaldi ProjectCompleters.allClassesIn(Project project).include().exclude().build()
gastaldi ProjectCompleters.allClasses().exclude(...)
gastaldi JavaEECompleters.allJPAEntities()
gastaldi that would be nice
agoncal Oh yes, we could have several methods like
agoncal And has you say, have one per addon so we could have JavaSECompleters.allEnums()
{code}
was:
{code}
agoncal Any default UICompleter that goes "give me all the classes of the project" (without filtering) ?
lincolnthree hmm, i dont know if we have that
gastaldi let me check
gastaldi hmm we don't
gastaldi we could have a UICompleterBuilder to ease this
gastaldi something like: UICompleters.allClassesInProject().except(...)
agoncal Would be nice
agoncal Yes, or exclude (and we could play with include/exclude)
gastaldi +1
agoncal UICompleters.allClassesInProject()
agoncal UICompleters.allClassesInProject().exclude(My.class)
agoncal UICompleters.include(My.class)
agoncal But then you could include only a package, exclude a package, annotated classes (eg. include only Entities)...
agoncal So it could become quite rich actually
gastaldi agreed
{code}
> Create a UICompleterBuilder to ease the creation of UICompleter
> ---------------------------------------------------------------
>
> Key: FORGE-2320
> URL: https://issues.jboss.org/browse/FORGE-2320
> Project: Forge
> Issue Type: Enhancement
> Components: UI - API
> Affects Versions: 2.16.0.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> {code}
> agoncal Any default UICompleter that goes "give me all the classes of the project" (without filtering) ?
> lincolnthree hmm, i dont know if we have that
> gastaldi let me check
> gastaldi hmm we don't
> gastaldi we could have a UICompleterBuilder to ease this
> gastaldi something like: UICompleters.allClassesInProject().except(...)
> agoncal Would be nice
> agoncal Yes, or exclude (and we could play with include/exclude)
> gastaldi +1
> agoncal UICompleters.allClassesInProject()
> agoncal UICompleters.allClassesInProject().exclude(My.class)
> agoncal UICompleters.include(My.class)
> agoncal But then you could include only a package, exclude a package, annotated classes (eg. include only Entities)...
> agoncal So it could become quite rich actually
> gastaldi agreed
> gastaldi given to the modular nature of Forge, we need different builders for each addon
> gastaldi so we'd have ProjectCompleters.allClassesIn(Project project)
> gastaldi ProjectCompleters.allClassesIn(Project project).include().exclude().build()
> gastaldi ProjectCompleters.allClasses().exclude(...)
> gastaldi JavaEECompleters.allJPAEntities()
> gastaldi that would be nice
> agoncal Oh yes, we could have several methods like
> agoncal And has you say, have one per addon so we could have JavaSECompleters.allEnums()
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 1 month