[JBoss JIRA] (FORGE-2247) Introduce InputComponent.setNote()
by Claus Ibsen (JIRA)
[ https://issues.jboss.org/browse/FORGE-2247?page=com.atlassian.jira.plugin... ]
Claus Ibsen commented on FORGE-2247:
------------------------------------
Thanks a lot for creating this ticket - this will benefit us for the Camel and Kube / Fabric8 forge commands.
> Introduce InputComponent.setNote()
> ----------------------------------
>
> Key: FORGE-2247
> URL: https://issues.jboss.org/browse/FORGE-2247
> Project: Forge
> Issue Type: Feature Request
> Components: UI - API
> Affects Versions: 2.14.0.Final
> Reporter: George Gastaldi
> Assignee: George Gastaldi
> Fix For: 2.14.1.Final
>
>
> This component would display text
> - below the input in a GUI;
> - as something that gets printed to the outstream when it changes above the buffer in the Shell
> e.g. when you select a valid value for the component above (in this scenario) it would print: "Description: This component does XYZ" above the buffer
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGE-2245) ResourceFactory : creating a resource from a file
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2245?page=com.atlassian.jira.plugin... ]
George Gastaldi updated FORGE-2245:
-----------------------------------
Fix Version/s: 2.x Future
> 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
> Fix For: 2.x Future
>
>
> 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)
9 years, 4 months
[JBoss JIRA] (FORGE-2245) ResourceFactory : creating a resource from a file
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2245?page=com.atlassian.jira.plugin... ]
George Gastaldi updated FORGE-2245:
-----------------------------------
Steps to Reproduce:
{code:java}
import java.io.File;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import javax.inject.Inject;
import org.jboss.forge.addon.resource.FileResource;
import org.jboss.forge.addon.resource.Resource;
import org.jboss.forge.addon.resource.ResourceFactory;
import org.jboss.forge.addon.templates.Template;
import org.jboss.forge.addon.templates.TemplateFactory;
import org.jboss.forge.addon.templates.freemarker.FreemarkerTemplate;
import org.jboss.forge.addon.ui.command.AbstractUICommand;
import org.jboss.forge.addon.ui.context.UIBuilder;
import org.jboss.forge.addon.ui.context.UIContext;
import org.jboss.forge.addon.ui.context.UIExecutionContext;
import org.jboss.forge.addon.ui.metadata.UICommandMetadata;
import org.jboss.forge.addon.ui.result.Result;
import org.jboss.forge.addon.ui.result.Results;
import org.jboss.forge.addon.ui.util.Categories;
import org.jboss.forge.addon.ui.util.Metadata;
public class FileAddon extends AbstractUICommand {
@Inject
private TemplateFactory tfactory;
@Inject
private ResourceFactory rfactory;
@Override
public UICommandMetadata getMetadata(UIContext context) {
return Metadata.forCommand(FileAddon.class).name("readVoila")
.category(Categories.create("test"));
}
@Override
public void initializeUI(UIBuilder builder) throws Exception {
}
@Override
public Result execute(UIExecutionContext context) throws Exception {
URL voilaURL = getClass().getClassLoader().getResource("voila.txt");
File f = new File(voilaURL.toExternalForm());
// Resource<?> fresource = rfactory.create(f);
FileResource fresource = rfactory.create(FileResource.class, f);
Template template = null;
try {
template = tfactory.create(fresource, FreemarkerTemplate.class);
} catch (Exception e) {
e.printStackTrace();
return Results.fail( e.getMessage() );
}
assert(template!=null);
Map<String, Object> params = new HashMap<String, Object>();
params.put("slogan", "JBoss Forge c'est bon mangez en");
String output = template.process(params);
return Results.success(output+ " Command 'lireFichier' successfully executed!");
}
}
{code}
was:
import java.io.File;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import javax.inject.Inject;
import org.jboss.forge.addon.resource.FileResource;
import org.jboss.forge.addon.resource.Resource;
import org.jboss.forge.addon.resource.ResourceFactory;
import org.jboss.forge.addon.templates.Template;
import org.jboss.forge.addon.templates.TemplateFactory;
import org.jboss.forge.addon.templates.freemarker.FreemarkerTemplate;
import org.jboss.forge.addon.ui.command.AbstractUICommand;
import org.jboss.forge.addon.ui.context.UIBuilder;
import org.jboss.forge.addon.ui.context.UIContext;
import org.jboss.forge.addon.ui.context.UIExecutionContext;
import org.jboss.forge.addon.ui.metadata.UICommandMetadata;
import org.jboss.forge.addon.ui.result.Result;
import org.jboss.forge.addon.ui.result.Results;
import org.jboss.forge.addon.ui.util.Categories;
import org.jboss.forge.addon.ui.util.Metadata;
public class FileAddon extends AbstractUICommand {
@Inject
private TemplateFactory tfactory;
@Inject
private ResourceFactory rfactory;
@Override
public UICommandMetadata getMetadata(UIContext context) {
return Metadata.forCommand(FileAddon.class).name("readVoila")
.category(Categories.create("test"));
}
@Override
public void initializeUI(UIBuilder builder) throws Exception {
}
@Override
public Result execute(UIExecutionContext context) throws Exception {
URL voilaURL = getClass().getClassLoader().getResource("voila.txt");
File f = new File(voilaURL.toExternalForm());
// Resource<?> fresource = rfactory.create(f);
FileResource fresource = rfactory.create(FileResource.class, f);
Template template = null;
try {
template = tfactory.create(fresource, FreemarkerTemplate.class);
} catch (Exception e) {
e.printStackTrace();
return Results.fail( e.getMessage() );
}
assert(template!=null);
Map<String, Object> params = new HashMap<String, Object>();
params.put("slogan", "JBoss Forge c'est bon mangez en");
String output = template.process(params);
return Results.success(output+ " Command 'lireFichier' successfully executed!");
}
}
> 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)
9 years, 4 months
[JBoss JIRA] (FORGE-2240) project-new - Do not show from-archetype-catalog if there are no catalogs
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2240?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-2240.
----------------------------------
Assignee: George Gastaldi
Fix Version/s: 2.14.1.Final
(was: 2.x Future)
Resolution: Done
> project-new - Do not show from-archetype-catalog if there are no catalogs
> -------------------------------------------------------------------------
>
> Key: FORGE-2240
> URL: https://issues.jboss.org/browse/FORGE-2240
> Project: Forge
> Issue Type: Enhancement
> Components: Build Tools - Maven, Projects
> Affects Versions: 2.14.0.Final
> Reporter: Claus Ibsen
> Assignee: George Gastaldi
> Priority: Minor
> Fix For: 2.14.1.Final
>
>
> eg out of the box there is no archetype-catalogs registered, but if you choose no #7 in the project-new it would fail
> {code}
> [forge-distribution-2.14.0.Final]$ project-new
> ***INFO*** Required inputs not satisfied, entering interactive mode
> ? Project name: mydemo
> ? Top level package [org.mydemo]:
> ? Version [1.0.0-SNAPSHOT]:
> ? Final name:
> ? Project location [/opt/forge-distribution-2.14.0.Final]:
> [0] (x) war
> [1] ( ) jar
> [2] ( ) parent
> [3] ( ) addon
> [4] ( ) resource-jar
> [5] ( ) ear
> [6] ( ) from-archetype
> [7] ( ) from-archetype-catalog
> Press <ENTER> to confirm, or <CTRL>+C to cancel.
> ? Project type: [0-7] 7
> [0] (x) Maven
> Press <ENTER> to confirm, or <CTRL>+C to cancel.
> ? Build system: [0]
> ***ERROR*** Catalog must be specified.
> ***ERROR*** Archetype must be specified.
> {code}
> So I think project-new should hide [7] if there is no catalogs, eg archetype-list is empty.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGE-2253) Artifact resolution does not fallback to Central
by George Gastaldi (JIRA)
George Gastaldi created FORGE-2253:
--------------------------------------
Summary: Artifact resolution does not fallback to Central
Key: FORGE-2253
URL: https://issues.jboss.org/browse/FORGE-2253
Project: Forge
Issue Type: Bug
Components: Build Tools - Maven
Affects Versions: 2.14.0.Final
Reporter: George Gastaldi
Assignee: George Gastaldi
Fix For: 2.x Future
When an artifact is not available in the configured repositories AND no mirrors are set in the settings.xml file, the embedded Maven session should resolve to the central repository as a fallback mechanism.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months