[forge-dev] Required Parameter is ignored although it is set

Alex Soto Bueno asotobue at redhat.com
Wed Jan 25 11:09:02 EST 2017


:) Nice that it is already identified. I am going to convert to a Forge
expert some day if I continue working on it :D

On Wed, Jan 25, 2017 at 5:06 PM, George Gastaldi <ggastald at redhat.com>
wrote:

> Glad you found the cause.
>
> There is a JIRA already asking to provide a more rigid option parsing
> strategy. Right now if you use UISelectOne and call setValue with a value
> that is not in its valueChoices list, it will set to null.
>
> Keep on Forgin'!
>
> *George Gastaldi*
>
> https://onename.com/gastaldi
>
> On Wed, Jan 25, 2017 at 1:56 PM, Alex Soto Bueno <asotobue at redhat.com>
> wrote:
>
> > I have found that the error was that instead of using UISelectOne I need
> to
> > use UIInput since it is the default input type used. But I think that
> error
> > message should be improved about incompatible types instead of an error
> > that it is not really the error it is happening.
> >
> > WDYT?
> >
> > On Wed, Jan 25, 2017 at 4:40 PM, Alex Soto Bueno <asotobue at redhat.com>
> > wrote:
> >
> > > Hello,
> > >
> > > I  have next command:
> > >
> > > public class AddAlgeronFolderPublisher extends AbstractProjectCommand
> > > implements UICommand
> > > {
> > >
> > >    @Inject
> > >    private ProjectFactory projectFactory;
> > >
> > >    @Inject
> > >    private FacetFactory facetFactory;
> > >
> > >    @Inject
> > >    @WithAttributes(shortName = 'o', label = "Output Folder", required =
> > > true)
> > >    private UISelectOne<String> outputFolder;
> > >
> > >    @Inject
> > >    @WithAttributes(shortName = 'c', label = "Contracts Folder")
> > >    private UISelectOne<String> contractFolder;
> > >
> > >    @Override
> > >    public UICommandMetadata getMetadata(UIContext context)
> > >    {
> > >       return Metadata.from(super.getMetadata(context), getClass())
> > >               .category(Categories.create("Algeron"))
> > >               .name("Arquillian Algeron: Add Folder Publisher")
> > >               .description("This command registers a Folder Publisher
> for
> > > Algeron");
> > >    }
> > >
> > >    @Override
> > >    public void initializeUI(UIBuilder builder) throws Exception
> > >    {
> > >       builder.add(outputFolder).add(contractFolder);
> > >       contractFolder.setDefaultValue("target/pacts");
> > >    }
> > >
> > > // ......
> > > }
> > >
> > > When in Forge console I run:
> > >
> > > arquillian-algeron-add-folder-publisher --output-folder /tmp
> > >
> > > I got:
> > >
> > > ***INFO*** Required inputs not satisfied, entering interactive mode
> > > ***ERROR*** Output Folder must be specified.
> > >
> > > But you can see that I am setting the attribute in the command so any
> > idea
> > > of why this is failing?
> > >
> > >
> > >
> > >
> > >
> > _______________________________________________
> > forge-dev mailing list
> > forge-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/forge-dev
> >
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>


More information about the forge-dev mailing list