Package hudson.model
Class ItemGroupMixIn
- java.lang.Object
-
- hudson.model.ItemGroupMixIn
-
public abstract class ItemGroupMixIn extends Object
Defines a bunch of static methods to be used as a "mix-in" forItemGroup
implementations. Not meant for a consumption from outsideItemGroup
s.- Author:
- Kohsuke Kawaguchi
- See Also:
ViewGroupMixIn
-
-
Field Summary
Fields Modifier and Type Field Description static Function1<String,Item>
KEYED_BY_NAME
Item
→ name function.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ItemGroupMixIn(ItemGroup parent, AccessControlled acl)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
add(TopLevelItem item)
Adds a newly created item to the parent.<T extends TopLevelItem>
Tcopy(T src, String name)
Copies an existingTopLevelItem
to a new name.TopLevelItem
createProject(TopLevelItemDescriptor type, String name, boolean notify)
TopLevelItem
createProjectFromXML(String name, InputStream xml)
TopLevelItem
createTopLevelItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Creates aTopLevelItem
for example from the submission of the/lib/hudson/newFromList/form
tag or throws an exception if it fails.protected abstract File
getRootDirFor(String name)
Assigns the root directory for a prospective item.static <K,V extends Item>
Map<K,V>loadChildren(ItemGroup parent, File modulesDir, Function1<? extends K,? super V> key)
Loads all the childItem
s.protected String
redirectAfterCreateItem(org.kohsuke.stapler.StaplerRequest req, TopLevelItem result)
Computes the redirection target URL for the newly createdTopLevelItem
.
-
-
-
Constructor Detail
-
ItemGroupMixIn
protected ItemGroupMixIn(ItemGroup parent, AccessControlled acl)
-
-
Method Detail
-
add
protected abstract void add(TopLevelItem item)
Adds a newly created item to the parent.
-
getRootDirFor
protected abstract File getRootDirFor(String name)
Assigns the root directory for a prospective item.
-
loadChildren
public static <K,V extends Item> Map<K,V> loadChildren(ItemGroup parent, File modulesDir, Function1<? extends K,? super V> key)
Loads all the childItem
s.- Parameters:
modulesDir
- Directory that contains sub-directories for each child item.
-
createTopLevelItem
public TopLevelItem createTopLevelItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
Creates aTopLevelItem
for example from the submission of the/lib/hudson/newFromList/form
tag or throws an exception if it fails.- Throws:
IOException
javax.servlet.ServletException
-
redirectAfterCreateItem
protected String redirectAfterCreateItem(org.kohsuke.stapler.StaplerRequest req, TopLevelItem result) throws IOException
Computes the redirection target URL for the newly createdTopLevelItem
.- Throws:
IOException
-
copy
public <T extends TopLevelItem> T copy(T src, String name) throws IOException
Copies an existingTopLevelItem
to a new name.- Throws:
IOException
-
createProjectFromXML
public TopLevelItem createProjectFromXML(String name, InputStream xml) throws IOException
- Throws:
IOException
-
createProject
@NonNull public TopLevelItem createProject(@NonNull TopLevelItemDescriptor type, @NonNull String name, boolean notify) throws IOException
- Throws:
IOException
-
-