[JBoss JIRA] (FORGE-2293) Forge XML parser - Add api so you can insert a child node at a given index
by Claus Ibsen (JIRA)
[ https://issues.jboss.org/browse/FORGE-2293?page=com.atlassian.jira.plugin... ]
Claus Ibsen commented on FORGE-2293:
------------------------------------
Yes it is, so I guess there isnt much work on this xml parser api since such an important api has been missing for close to 2 years ?
> Forge XML parser - Add api so you can insert a child node at a given index
> --------------------------------------------------------------------------
>
> Key: FORGE-2293
> URL: https://issues.jboss.org/browse/FORGE-2293
> Project: Forge
> Issue Type: Feature Request
> Components: Parsers / File Manipulation
> Affects Versions: 2.15.2.Final
> Reporter: Claus Ibsen
>
> I am using the nice XMLParser API from
> https://github.com/forge/xml-parser
> But having a Node, I need to add a new child node at a specific order. Today the child node is added at the end. But my XSD has a structure so I must add the child node at a given position.
> I cannot find an api to do that. I may have to remove all child nodes, and rebuild the structure in the order I need. But I think that is a bit drastic - would be nice if there was an api to do that.
> For example a addSibling method that creates a sibling node, and inserts it just after current node, eg
> If the children is
> A,B,C,D,E,F
> And then I want to add a C2, I can do
> Node c = ...
> c.addSibling("C2);
> And then we have
> A,B,C,C2,D,E
> {code}
> Node camel = ...
> for (Node child : camel.getChildren()) {
> ...
> logic here
> if (yeah) {
> Node newEndpoint = child.addSibiling("endpoint);
> newEndpoint.attribute("id", "foo");
> newEndpoint.attribute("url", "bla bla");
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 10 months
[JBoss JIRA] (FORGE-2293) Forge XML parser - Add api so you can insert a child node at a given index
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2293?page=com.atlassian.jira.plugin... ]
George Gastaldi commented on FORGE-2293:
----------------------------------------
I think this is a duplicate of FORGE-998, no?
> Forge XML parser - Add api so you can insert a child node at a given index
> --------------------------------------------------------------------------
>
> Key: FORGE-2293
> URL: https://issues.jboss.org/browse/FORGE-2293
> Project: Forge
> Issue Type: Feature Request
> Components: Parsers / File Manipulation
> Affects Versions: 2.15.2.Final
> Reporter: Claus Ibsen
>
> I am using the nice XMLParser API from
> https://github.com/forge/xml-parser
> But having a Node, I need to add a new child node at a specific order. Today the child node is added at the end. But my XSD has a structure so I must add the child node at a given position.
> I cannot find an api to do that. I may have to remove all child nodes, and rebuild the structure in the order I need. But I think that is a bit drastic - would be nice if there was an api to do that.
> For example a addSibling method that creates a sibling node, and inserts it just after current node, eg
> If the children is
> A,B,C,D,E,F
> And then I want to add a C2, I can do
> Node c = ...
> c.addSibling("C2);
> And then we have
> A,B,C,C2,D,E
> {code}
> Node camel = ...
> for (Node child : camel.getChildren()) {
> ...
> logic here
> if (yeah) {
> Node newEndpoint = child.addSibiling("endpoint);
> newEndpoint.attribute("id", "foo");
> newEndpoint.attribute("url", "bla bla");
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 10 months
[JBoss JIRA] (FORGE-2293) Forge XML parser - Add api so you can insert a child node at a given index
by Claus Ibsen (JIRA)
Claus Ibsen created FORGE-2293:
----------------------------------
Summary: Forge XML parser - Add api so you can insert a child node at a given index
Key: FORGE-2293
URL: https://issues.jboss.org/browse/FORGE-2293
Project: Forge
Issue Type: Feature Request
Components: Parsers / File Manipulation
Affects Versions: 2.15.2.Final
Reporter: Claus Ibsen
I am using the nice XMLParser API from
https://github.com/forge/xml-parser
But having a Node, I need to add a new child node at a specific order. Today the child node is added at the end. But my XSD has a structure so I must add the child node at a given position.
I cannot find an api to do that. I may have to remove all child nodes, and rebuild the structure in the order I need. But I think that is a bit drastic - would be nice if there was an api to do that.
For example a addSibling method that creates a sibling node, and inserts it just after current node, eg
If the children is
A,B,C,D,E,F
And then I want to add a C2, I can do
Node c = ...
c.addSibling("C2);
And then we have
A,B,C,C2,D,E
{code}
Node camel = ...
for (Node child : camel.getChildren()) {
...
logic here
if (yeah) {
Node newEndpoint = child.addSibiling("endpoint);
newEndpoint.attribute("id", "foo");
newEndpoint.attribute("url", "bla bla");
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 10 months
[JBoss JIRA] (FORGE-2291) Saying No to display all NNN possibilities in CLI completer exits instead of allowing to continue
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2291?page=com.atlassian.jira.plugin... ]
George Gastaldi updated FORGE-2291:
-----------------------------------
Description:
I have some Camel forge commands, and we have completers for some options.
One of the options is to provide a Camel component name. And as we have a lot of then, eg 180 then the completer asks if you want to show them all or not. If you type N then the CLI exits, and you have to redo the command again. I would expected N to go back so I can continue typing on the current command as if I didnt press TAB to trigger the completer.
See below for example
{code}
[foo]$ camel-add-endpoint-xml
--componentNameFilter --componentName --instanceName --xml
[foo]$ camel-add-endpoint-xml --componentName
Display all 180 possibilities? (y or n)
[foo]$
{code}
If I hit ESC instead I would expect it to exit which it does. So typing N should take me back, so I can continue typing that command as-is.
was:
I have some Camel forge commands, and we have completers for some options.
One of the options is to provide a Camel component name. And as we have a lot of then, eg 180 then the completer asks if you want to show them all or not. If you type N then the CLI exists, and you have to redo the command again. I would expected N to go back so I can continue typing on the current command as if I didnt press TAB to trigger the completer.
See below for example
{code}
[foo]$ camel-add-endpoint-xml
--componentNameFilter --componentName --instanceName --xml
[foo]$ camel-add-endpoint-xml --componentName
Display all 180 possibilities? (y or n)
[foo]$
{code}
If I hit ESC instead I would expect it to exit which it does. So typing N should take me back, so I can continue typing that command as-is.
> Saying No to display all NNN possibilities in CLI completer exits instead of allowing to continue
> -------------------------------------------------------------------------------------------------
>
> Key: FORGE-2291
> URL: https://issues.jboss.org/browse/FORGE-2291
> Project: Forge
> Issue Type: Bug
> Components: UI - Shell
> Affects Versions: 2.15.2.Final
> Reporter: Claus Ibsen
> Priority: Minor
>
> I have some Camel forge commands, and we have completers for some options.
> One of the options is to provide a Camel component name. And as we have a lot of then, eg 180 then the completer asks if you want to show them all or not. If you type N then the CLI exits, and you have to redo the command again. I would expected N to go back so I can continue typing on the current command as if I didnt press TAB to trigger the completer.
> See below for example
> {code}
> [foo]$ camel-add-endpoint-xml
> --componentNameFilter --componentName --instanceName --xml
> [foo]$ camel-add-endpoint-xml --componentName
> Display all 180 possibilities? (y or n)
> [foo]$
> {code}
> If I hit ESC instead I would expect it to exit which it does. So typing N should take me back, so I can continue typing that command as-is.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 10 months
[JBoss JIRA] (FORGE-2291) Saying No to display all NNN possibilities in CLI completer exits instead of allowing to continue
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2291?page=com.atlassian.jira.plugin... ]
George Gastaldi updated FORGE-2291:
-----------------------------------
Summary: Saying No to display all NNN possibilities in CLI completer exits instead of allowing to continue (was: Saying No to display all NNN possibilities in CLI completer exists instead of allowing to continue)
> Saying No to display all NNN possibilities in CLI completer exits instead of allowing to continue
> -------------------------------------------------------------------------------------------------
>
> Key: FORGE-2291
> URL: https://issues.jboss.org/browse/FORGE-2291
> Project: Forge
> Issue Type: Bug
> Components: UI - Shell
> Affects Versions: 2.15.2.Final
> Reporter: Claus Ibsen
> Priority: Minor
>
> I have some Camel forge commands, and we have completers for some options.
> One of the options is to provide a Camel component name. And as we have a lot of then, eg 180 then the completer asks if you want to show them all or not. If you type N then the CLI exists, and you have to redo the command again. I would expected N to go back so I can continue typing on the current command as if I didnt press TAB to trigger the completer.
> See below for example
> {code}
> [foo]$ camel-add-endpoint-xml
> --componentNameFilter --componentName --instanceName --xml
> [foo]$ camel-add-endpoint-xml --componentName
> Display all 180 possibilities? (y or n)
> [foo]$
> {code}
> If I hit ESC instead I would expect it to exit which it does. So typing N should take me back, so I can continue typing that command as-is.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 10 months
[JBoss JIRA] (FORGE-2292) ResourcesFacet - A Resource should have API to get the project FQN name
by Claus Ibsen (JIRA)
Claus Ibsen created FORGE-2292:
----------------------------------
Summary: ResourcesFacet - A Resource should have API to get the project FQN name
Key: FORGE-2292
URL: https://issues.jboss.org/browse/FORGE-2292
Project: Forge
Issue Type: Feature Request
Affects Versions: 2.15.2.Final
Reporter: Claus Ibsen
Priority: Minor
Using the following code to find all Camel xml files in my project
{code}
public XmlFileCompleter(ResourcesFacet facet) {
// find package names in the source code
facet.visitResources(new ResourceVisitor() {
@Override
public void visit(VisitContext context, Resource<?> resource) {
String name = resource.getName();
if (name.endsWith(".xml")) {
// must contain <camelContext...
boolean camel = resource.getContents().contains("<camelContext");
if (camel) {
files.add(resource.getName());
}
}
}
});
}
{code}
The problem is that I cannot get the FQN package name of the resource.
getName returns the name without any parents - that is okay and would be expected.
getFullyQualifiedName() returns the absolute path on my computer, so its
/opt/jboss-forge/foo/src/main/resources/spring/foo.xml
eg the project is stored in /opt/jboss-forge/foo. So I need an api to give me the java package name of the resource - which in this case would be spring/foo.xml.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 10 months
[JBoss JIRA] (FORGE-2291) Saying No to display all NNN possibilities in CLI completer exists instead of allowing to continue
by Claus Ibsen (JIRA)
Claus Ibsen created FORGE-2291:
----------------------------------
Summary: Saying No to display all NNN possibilities in CLI completer exists instead of allowing to continue
Key: FORGE-2291
URL: https://issues.jboss.org/browse/FORGE-2291
Project: Forge
Issue Type: Bug
Components: UI - Shell
Affects Versions: 2.15.2.Final
Reporter: Claus Ibsen
Priority: Minor
I have some Camel forge commands, and we have completers for some options.
One of the options is to provide a Camel component name. And as we have a lot of then, eg 180 then the completer asks if you want to show them all or not. If you type N then the CLI exists, and you have to redo the command again. I would expected N to go back so I can continue typing on the current command as if I didnt press TAB to trigger the completer.
See below for example
{code}
[foo]$ camel-add-endpoint-xml
--componentNameFilter --componentName --instanceName --xml
[foo]$ camel-add-endpoint-xml --componentName
Display all 180 possibilities? (y or n)
[foo]$
{code}
If I hit ESC instead I would expect it to exit which it does. So typing N should take me back, so I can continue typing that command as-is.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 10 months
[JBoss JIRA] (FORGE-2290) Using an UICompleter does not work in interactive mode in the CLI
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2290?page=com.atlassian.jira.plugin... ]
George Gastaldi updated FORGE-2290:
-----------------------------------
Fix Version/s: 2.x Future
> Using an UICompleter does not work in interactive mode in the CLI
> -----------------------------------------------------------------
>
> Key: FORGE-2290
> URL: https://issues.jboss.org/browse/FORGE-2290
> Project: Forge
> Issue Type: Enhancement
> Components: UI - Shell
> Affects Versions: 2.15.2.Final
> Reporter: Claus Ibsen
> Fix For: 2.x Future
>
>
> I have a UIInput where the end user should enter a class name for a Camel route builder class.
> So I have a completer that implements the logic to find all route builders in the java source
> {code}
> routeBuilder.setCompleter(new RouteBuilderCompleter(facet));
> {code}
> And that only works from cli in non interactive mode, eg
> {code}
> [foo]$ camel-new-endpoint-routebuilder --componentName smtp --instanceName mail --routeBuilder com.foo.
> com.foo.MyRoute com.foo.YourRoute
> {code}
> When pressing TAB it shows the 2 route builder classes I have.
> But in interactive mode the TAB does not work
> {code}
> Press <ENTER> to confirm, or <CTRL>+C to cancel.
> ? componentName (Name of component type to add): [0-180] 146
> ? routeBuilder (The RouteBuilder class to use): co
> {code}
> I do not get any suggestions when pressing TAB.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 10 months
[JBoss JIRA] (ROASTER-66) JavaClass - hasSuper(Class) and getSuper(Class)
by Claus Ibsen (JIRA)
Claus Ibsen created ROASTER-66:
----------------------------------
Summary: JavaClass - hasSuper(Class) and getSuper(Class)
Key: ROASTER-66
URL: https://issues.jboss.org/browse/ROASTER-66
Project: Roaster
Issue Type: Enhancement
Reporter: Claus Ibsen
I want to know from a JavaClass which super class and its parents extend. So I can check if it extends a given class.
Today the only way is to use getSuperType which returns a String with the FQN. Then I manually need to look into that class and its parent and so on.
I want a one stop method to do that for me.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 10 months