[JBoss JIRA] (FORGE-368) Return list of properties based on higher-level understanding
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-368?page=com.atlassian.jira.plugin.... ]
George Gastaldi closed FORGE-368.
---------------------------------
Closing this issue as duplicated from FORGE-1342
> Return list of properties based on higher-level understanding
> -------------------------------------------------------------
>
> Key: FORGE-368
> URL: https://issues.jboss.org/browse/FORGE-368
> Project: Forge
> Issue Type: Feature Request
> Components: Parsers / File Manipulation
> Reporter: Richard Kennard
> Fix For: 2.x Future
>
>
> 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 get back just normal fields. I don't know if these are property fields (and if so, what their corresponding getter/setter methods are) or whether they're just internal fields (and should be ignored).
> 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?
> If it helps, for now I am using a rough implementation at: https://github.com/kennardconsulting/forge/blob/master/scaffold-metawidge...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 4 months
[JBoss JIRA] (FORGE-1595) Being able to create an empty JSF backing bean
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-1595:
----------------------------------------
Summary: Being able to create an empty JSF backing bean
Key: FORGE-1595
URL: https://issues.jboss.org/browse/FORGE-1595
Project: Forge
Issue Type: Sub-task
Components: Scaffold
Affects Versions: 2.0.0.Final
Reporter: Antonio Goncalves
Priority: Minor
Fix For: 2.x Future
At the moment the only way to generate JSF backing beans is with scaffolding. To save time and help the developer in creating new backing beans, it would be good to have a command such :
{code}
faces-new-bean --named MyBean
{code}
This will create a {{MyBean}}, of scope request, under the {{view}} package. You could also give a different sub-package with :
{code}
faces-new-page --named MyBean --targetPackage view.admin
{code}
This will create the page under {{view/admin/MyBean.java}}.
{code}
@Named
@RequestScoped
public class MyBean {
}
{code}
Then, depending on the scope, the generated code would be different (e.g. implements Serializable for most of the other stateful scopes)
{code}
faces-new-bean --named MyBean --scoped Conversation
{code}
This would generate the following code
{code}
@Named
@ConversationScoped
public class MyBean implements Serializable {
@Inject
private Conversation conversation;
public String begin() {
conversation.begin();
}
public String end() {
conversation.end();
}
}
{code}
PS : I'm on holidays skiing, and the internet connection is really bad. So I could search for similar JIRAs if they existed
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 4 months
[JBoss JIRA] (FORGE-1594) Being able to create an empty JSF page
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-1594:
----------------------------------------
Summary: Being able to create an empty JSF page
Key: FORGE-1594
URL: https://issues.jboss.org/browse/FORGE-1594
Project: Forge
Issue Type: Sub-task
Components: Scaffold
Affects Versions: 2.0.0.Final
Reporter: Antonio Goncalves
Priority: Minor
Fix For: 2.x Future
At the moment the only way to generate JSF pages is with scaffolding. When you create an application, you realize that these scaffolded pages are not enough and that you need to create new ones. To save time and help the developer in creating new pages, it would be good to have a command such :
{code}
faces-new-page --named mypage
{code}
This will create a mypage.xhtml on the root of the webapp directory. You could also give a different directory with :
{code}
faces-new-page --named mypage --targetDirectory admin
{code}
This will create the page under webapp/admin/mypage.xhtml.
{code}
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
template="/resources/scaffold/pageTemplate.xhtml">
<ui:param name="pageTitle" value="mypage"/>
<ui:define name="header">
mypage
</ui:define>
<ui:define name="subheader">
mypage
</ui:define>
<ui:define name="footer"/>
<ui:define name="main">
</ui:define>
</ui:composition>
{code}
The name of the page {{mypage}} is used for the title, header, subheader. But we could customize this using optional attributes for title, header, subheader :
{code}
faces-new-page --named mypage --targetDirectory admin --title Administration Page --header Admin Header --subheader Admin Sub Header
{code}
It would just create a minimum JSF page such as :
{code}
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
template="/resources/scaffold/pageTemplate.xhtml">
<ui:param name="pageTitle" value="Administration Page"/>
<ui:define name="header">
Admin Header
</ui:define>
<ui:define name="subheader">
Admin Sub Header
</ui:define>
<ui:define name="footer"/>
<ui:define name="main">
</ui:define>
</ui:composition>
{code}
PS : I'm on holidays skiing, and the internet connection is really bad. So I could search for similar JIRAs if they existed
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 4 months