|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.model.AbstractModelObject
hudson.model.Actionable
hudson.model.AbstractItem
@ExportedBean public abstract class AbstractItem
Partial default implementation of Item
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu |
---|
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.MenuItem |
Field Summary | |
---|---|
protected String |
description
Project description. |
protected String |
displayName
|
protected String |
name
Project name. |
static AlternativeUiTextProvider.Message<AbstractItem> |
PRONOUN
Replaceable pronoun of that points to a job. |
Fields inherited from interface hudson.model.Item |
---|
BUILD, CANCEL, CONFIGURE, CREATE, DELETE, DISCOVER, EXTENDED_READ, PERMISSIONS, READ, WIPEOUT, WORKSPACE |
Fields inherited from interface hudson.model.Saveable |
---|
NOOP |
Constructor Summary | |
---|---|
protected |
AbstractItem(ItemGroup parent,
String name)
|
Method Summary | |
---|---|
void |
checkPermission(Permission p)
Short for getACL().checkPermission(p) |
void |
delete()
Deletes this item. |
void |
delete(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
|
void |
doConfigDotXml(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Accepts config.xml submission, as well as serve it. |
void |
doDoDelete(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Deletes this item. |
protected void |
doSetName(String name)
Just update name without performing the rename operation,
which would involve copying files and etc. |
void |
doSubmitDescription(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Accepts the new description. |
String |
getAbsoluteUrl()
Returns the absolute URL of this item. |
ACL |
getACL()
Returns the ACL for this object. |
abstract Collection<? extends Job> |
getAllJobs()
Gets all the jobs that this Item contains as descendants. |
Api |
getApi()
Remote API access. |
XmlFile |
getConfigFile()
|
String |
getDescription()
Gets the project description HTML. |
Descriptor |
getDescriptorByName(String className)
Exposes all Descriptor s by its name to URL. |
String |
getDisplayName()
Gets the human readable short name of this item. |
String |
getDisplayNameOrNull()
|
String |
getFullDisplayName()
Works like Item.getDisplayName() but return
the full path that includes all the display names
of the ancestors. |
String |
getFullName()
Gets the full name of this item, like "abc/def/ghi". |
String |
getName()
Gets the name of the item. |
ItemGroup |
getParent()
This bridge method is to maintain binary compatibility with Item.getParent() . |
String |
getPronoun()
Get the term used in the UI to represent this kind of Item . |
String |
getRelativeNameFrom(Item item)
Short for getRelativeNameFrom(item.getParent()) |
String |
getRelativeNameFrom(ItemGroup p)
Gets the relative name to this item from the specified group. |
String |
getRelativeNameFromGroup(ItemGroup p)
This method only exists to disambiguate getRelativeNameFrom(ItemGroup) and getRelativeNameFrom(Item) |
File |
getRootDir()
Gets the root directory on the file system that this Item can use freely for storing the configuration data. |
String |
getSearchName()
Default implementation that returns the display name. |
String |
getSearchUrl()
Returns the URL of this item relative to the parent SearchItem . |
String |
getShortUrl()
Returns the URL of this item relative to the parent ItemGroup . |
String |
getUrl()
Returns the URL of this item relative to the context root of the application. |
boolean |
hasPermission(Permission p)
Short for getACL().hasPermission(p) |
void |
onCopiedFrom(Item src)
When a Item is copied from existing one,
the files are first copied on the file system,
then it will be loaded, then this method will be invoked
to perform any implementation-specific work. |
void |
onCreatedFromScratch()
When an item is created from scratch (instead of copied), this method will be invoked. |
void |
onLoad(ItemGroup<? extends Item> parent,
String name)
Called right after when a Item is loaded from disk. |
protected void |
performDelete()
Does the real job of deleting the item. |
protected void |
renameTo(String newName)
Renames this item. |
static AbstractItem |
resolveForCLI(String name)
Used for CLI binding. |
void |
save()
Save the settings to a file. |
void |
setDescription(String description)
Sets the project description HTML. |
void |
setDisplayName(String displayName)
|
void |
setDisplayNameOrNull(String displayName)
This method exists so that the Job configuration pages can use getDisplayNameOrNull so that nothing is shown in the display name text box if the display name is not set. |
String |
toString()
|
void |
updateByXml(Source source)
Updates Job by its XML definition. |
void |
updateByXml(StreamSource source)
Deprecated. as of 1.473 Use updateByXml(Source) |
Methods inherited from class hudson.model.Actionable |
---|
addAction, doContextMenu, getAction, getAction, getActions, getActions, getDynamic |
Methods inherited from class hudson.model.AbstractModelObject |
---|
getSearch, getSearchIndex, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface hudson.search.SearchableModelObject |
---|
getSearch |
Methods inherited from interface hudson.search.SearchItem |
---|
getSearchIndex |
Field Detail |
---|
protected transient String name
protected volatile String description
protected String displayName
public static final AlternativeUiTextProvider.Message<AbstractItem> PRONOUN
Constructor Detail |
---|
protected AbstractItem(ItemGroup parent, String name)
Method Detail |
---|
public void onCreatedFromScratch()
Item
onCreatedFromScratch
in interface Item
@Exported(visibility=999) public String getName()
Item
The name must be unique among other Item
s that belong
to the same parent.
This name is also used for directory name, so it cannot contain any character that's not allowed on the file system.
getName
in interface Item
Item.getFullName()
public String getPronoun()
Item
. Must start with a capital letter.
@Exported public String getDisplayName()
Item
This method should try to return a short concise human readable string that describes this item. The string need not be unique.
The returned string should not include the display names
of ancestor items
.
getDisplayName
in interface Item
getDisplayName
in interface ModelObject
@Exported public String getDisplayNameOrNull()
public void setDisplayNameOrNull(String displayName) throws IOException
displayName
-
IOException
public void setDisplayName(String displayName) throws IOException
IOException
public File getRootDir()
PersistenceRoot
Item
can use freely for storing the configuration data.
This parameter is given by the ItemGroup
when
Item
is loaded from memory.
getRootDir
in interface PersistenceRoot
@WithBridgeMethods(value=Jenkins.class, castRequired=true) public ItemGroup getParent()
Item.getParent()
.
getParent
in interface Item
@Exported public String getDescription()
public void setDescription(String description) throws IOException
IOException
protected void doSetName(String name)
name
without performing the rename operation,
which would involve copying files and etc.
protected void renameTo(String newName) throws IOException
IOException
public abstract Collection<? extends Job> getAllJobs()
Item
contains as descendants.
getAllJobs
in interface Item
public final String getFullName()
Item
Full name consists of name
s of Item
s
that lead from the root Jenkins
to this Item
,
separated by '/'. This is the unique name that identifies this
Item
inside the whole Jenkins
.
getFullName
in interface Item
Jenkins.getItemByFullName(String,Class)
public final String getFullDisplayName()
Item
Item.getDisplayName()
but return
the full path that includes all the display names
of the ancestors.
getFullDisplayName
in interface Item
public String getRelativeNameFromGroup(ItemGroup p)
getRelativeNameFrom(ItemGroup)
and getRelativeNameFrom(Item)
getRelativeNameFrom(ItemGroup)
public String getRelativeNameFrom(ItemGroup p)
Item
getRelativeNameFrom
in interface Item
p
- The ItemGroup instance used as context to evaluate the relative name of this AbstractItem
public String getRelativeNameFrom(Item item)
Item
getRelativeNameFrom(item.getParent())
getRelativeNameFrom
in interface Item
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
Item
is loaded from disk.
This is an opporunity to do a post load processing.
onLoad
in interface Item
name
- Name of the directory (not a path --- just the name portion) from
which the configuration was loaded. This usually becomes the
name
of this item.
IOException
public void onCopiedFrom(Item src)
Item
is copied from existing one,
the files are first copied on the file system,
then it will be loaded, then this method will be invoked
to perform any implementation-specific work.
onCopiedFrom
in interface Item
src
- Item from which it's copied from. The same type as this
. Never null.public final String getUrl()
Item
getUrl
in interface Item
for how to implement this.
public String getShortUrl()
Item
ItemGroup
.
getShortUrl
in interface Item
for how to implement this.
public String getSearchUrl()
SearchItem
SearchItem
.
getSearchUrl
in interface SearchItem
@Exported(visibility=999, name="url") public final String getAbsoluteUrl()
Item
StaplerRequest
to figure out what the host name is,
so can be used only during processing client requests.
getAbsoluteUrl
in interface Item
public final Api getApi()
public ACL getACL()
ACL
for this object.
getACL
in interface AccessControlled
public void checkPermission(Permission p)
getACL().checkPermission(p)
checkPermission
in interface AccessControlled
public boolean hasPermission(Permission p)
getACL().hasPermission(p)
hasPermission
in interface AccessControlled
public void save() throws IOException
save
in interface Item
save
in interface Saveable
IOException
- if the persistence failed.public final XmlFile getConfigFile()
public Descriptor getDescriptorByName(String className)
DescriptorByNameOwner
Descriptor
s by its name to URL.
Implementation should always delegate to Jenkins.getDescriptorByName(String)
.
getDescriptorByName
in interface DescriptorByNameOwner
className
- Either Descriptor.getId()
(recommended) or the short name.public void doSubmitDescription(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
@CLIMethod(name="delete-job") public void doDoDelete(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, InterruptedException
/doDelete
since it predates <l:confirmationLink>
. /delete
goes to a Jelly page
which should now be unused by core but is left in case plugins are still using it.
IOException
javax.servlet.ServletException
InterruptedException
public void delete(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
delete
in interface org.kohsuke.stapler.HttpDeletable
IOException
javax.servlet.ServletException
public void delete() throws IOException, InterruptedException
Any exception indicates the deletion has failed, but AbortException
would prevent the caller
from showing the stack trace. This
delete
in interface Item
IOException
InterruptedException
protected void performDelete() throws IOException, InterruptedException
IOException
InterruptedException
@WebMethod(name="config.xml") public void doConfigDotXml(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
IOException
public void updateByXml(StreamSource source) throws IOException
updateByXml(Source)
IOException
public void updateByXml(Source source) throws IOException
IOException
public String getSearchName()
AbstractModelObject
getSearchName
in interface SearchItem
getSearchName
in class AbstractModelObject
public String toString()
toString
in class Object
@CLIResolver public static AbstractItem resolveForCLI(String name) throws org.kohsuke.args4j.CmdLineException
org.kohsuke.args4j.CmdLineException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |