What I am trying to do is to save the properties of the Scala class and the
Jahia class. For that I defined a Profil class which is abstract and those
class extend Profil.
I have a config.jelly where I use the taglib f:drowDownDescriptorSelector :
<f:dropdownDescriptorSelector title="Profils" field="profil"
descriptors="${it.profilDescriptors}" />
and the associated class :
private final Profil profil;
@DataBoundConstructor
public RemoteDeploymentBuilder(Profil profil, String environment,
String component, String version)
{
this.environment = environment;
this.profil = profil;
this.component = component;
this.version = version;
}
My problem is that the properties of each class (Jahia and Scala) are
properly saved but they do not display properly, the textboxes where I
defined them are empty. How can I solve that?
Here is the profil class and his subclass :
public static abstract class Profil implements Describable < Profil >
{
protected String name;
private Profil(String name)
{
this.name
= name;
}
public String getName() {
return name;
}
public Descriptor < Profil > getDescriptor()
{
return Jenkins.getInstance().getDescriptor(getClass());
}
}
public static class ProfilDescriptor extends Descriptor < Profil >
{
public ProfilDescriptor(Class < ? extends Profil > clazz)
{
super(clazz);
}
@Override
public String getDisplayName()
{
return clazz.getSimpleName();
}
}
public static class Jahia extends Profil
{
private String tomcatService, jahiaWebApp;
@DataBoundConstructor
public Jahia(String tomcatService, String jahiapublic static
abstract class Profil implements Describable < Profil >
{
protected String name;
private Profil(String name)
{
this.name = name;
}
public String getName() {
return name;
}
public Descriptor < Profil > getDescriptor()
{
return Jenkins.getInstance().getDescriptor(getClass());
}
}
public static class ProfilDescriptor extends Descriptor < Profil >
{
public ProfilDescriptor(Class < ? extends Profil > clazz)
{
super(clazz);
}
@Override
public String getDisplayName()
{
return clazz.getSimpleName();
}
}
public static class Jahia extends Profil
{
private String tomcatService, jahiaWebApp;
@DataBoundConstructor
public Jahia(String tomcatService, String jahiaWebApp)
{
super("deploy-jahia-module");
this.tomcatService = tomcatService;
this.jahiaWebApp = jahiaWebApp;
}
public String getTomcatService()
{
return tomcatService;
}
public String getJahiaWebApp()
{
return jahiaWebApp;
}
@Extension
public static final ProfilDescriptor descriptor = new
ProfilDescriptor(Jahia.class);
}
public static class Scala extends Profil
{
private String scalaRootDir;
@DataBoundConstructor
public Scala(String scalaRootDir)
{
super("deploy-play-module");
this.scalaRootDir = scalaRootDir;
}
public String getScalaRootDir()
{
return scalaRootDir;
}
@Extension
public static final ProfilDescriptor descriptor = new
ProfilDescriptor(Scala.class);
}WebApp)
{
super("deploy-jahia-module");
this.tomcatService = tomcatService;
this.jahiaWebApp = jahiaWebApp;
}
public String getTomcatService()
{
return tomcatService;
}
public String getJahiaWebApp()
{
return jahiaWebApp;
}
@Extension
public static final ProfilDescriptor descriptor = new
ProfilDescriptor(Jahia.class);
}
public static class Scala extends Profil
{
private String scalaRootDir;
@DataBoundConstructor
public Scala(String scalaRootDir)
{
super("deploy-play-module");
this.scalaRootDir = scalaRootDir;
}
public String getScalaRootDir()
{
return scalaRootDir;
}
@Extension
public static final ProfilDescriptor descriptor = new
ProfilDescriptor(Scala.class);
}
How can I solve this problem?