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" forItemGroupimplementations. Not meant for a consumption from outsideItemGroups.- Author:
- Kohsuke Kawaguchi
- See Also:
ViewGroupMixIn
-
-
Field Summary
Fields Modifier and Type Field Description static Function1<String,Item>KEYED_BY_NAMEItem→ name function.
-
Constructor Summary
Constructors Modifier Constructor Description protectedItemGroupMixIn(ItemGroup parent, AccessControlled acl)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidadd(TopLevelItem item)Adds a newly created item to the parent.<T extends TopLevelItem>
Tcopy(T src, String name)Copies an existingTopLevelItemto a new name.TopLevelItemcreateProject(TopLevelItemDescriptor type, String name, boolean notify)TopLevelItemcreateProjectFromXML(String name, InputStream xml)TopLevelItemcreateTopLevelItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Creates aTopLevelItemfor example from the submission of the/lib/hudson/newFromList/formtag or throws an exception if it fails.protected abstract FilegetRootDirFor(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 childItems.protected StringredirectAfterCreateItem(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 childItems.- 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 aTopLevelItemfor example from the submission of the/lib/hudson/newFromList/formtag or throws an exception if it fails.- Throws:
IOExceptionjavax.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 existingTopLevelItemto 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
-
-