Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
package hudson.plugins.emailext; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import hudson.Extension; | ||
import jenkins.model.Jenkins; | ||
import org.jenkinsci.lib.configprovider.AbstractConfigProviderImpl; | ||
import org.jenkinsci.lib.configprovider.ConfigProvider; | ||
import org.jenkinsci.lib.configprovider.model.Config; | ||
import org.jenkinsci.lib.configprovider.model.ContentType; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class GroovyTemplateConfig extends Config { | ||
|
||
@Override | ||
public ConfigProvider getDescriptor() { | ||
return Jenkins.getActiveInstance().getDescriptorByType(GroovyTemplateConfigProvider.class); | ||
} | ||
|
||
@DataBoundConstructor | ||
public GroovyTemplateConfig(String id, String name, String comment, String content) { | ||
super(id, name, comment, content); | ||
|
@@ -17,10 +25,6 @@ public GroovyTemplateConfig(String id, String name, String comment, String conte | |
@Extension(optional=true) | ||
public static final class GroovyTemplateConfigProvider extends AbstractConfigProviderImpl { | ||
|
||
public GroovyTemplateConfigProvider() { | ||
load(); | ||
} | ||
|
||
@Override | ||
public ContentType getContentType() { | ||
return ContentType.DefinedType.GROOVY; | ||
|
@@ -31,15 +35,10 @@ public String getDisplayName() { | |
return Messages.GroovyTemplateConfigProvider_DisplayName(); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public Config newConfig() { | ||
String id = getProviderId() + System.currentTimeMillis(); | ||
public Config newConfig(@Nonnull String id) { | ||
return new GroovyTemplateConfig(id, "Groovy Email Template", "", ""); | ||
} | ||
|
||
@Override | ||
protected String getXmlFileName() { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
imod
Member
|
||
return "email-ext-groovy-config-files.xml"; | ||
} | ||
} | ||
} | ||
} |
@davidvanlaatum because this method was removed (also for
JellyTemplateConfigProvider
), config-file-provider plugin is not able to migrate the old data to the new datastructure. It is not able to find the old file