com.sonymobile.jenkins.plugins.teamview
Class TeamViewsProperty

java.lang.Object
  extended by com.sonymobile.jenkins.plugins.teamview.TeamProperty
      extended by com.sonymobile.jenkins.plugins.teamview.TeamViewsProperty
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Action, hudson.model.Describable<TeamProperty>, hudson.model.ModelObject, hudson.model.ReconfigurableDescribable<TeamProperty>, hudson.model.Saveable, hudson.model.ViewGroup, hudson.security.AccessControlled, org.kohsuke.stapler.StaplerFallback

public final class TeamViewsProperty
extends TeamProperty
implements hudson.model.ViewGroup, hudson.model.Action, org.kohsuke.stapler.StaplerFallback

A class that remembers team views.

Author:
Tomas Westling <tomas.westling>

Nested Class Summary
static class TeamViewsProperty.TeamViewsPropertyDescriptor
          Descriptor for the TeamViewsProperty.
 
Nested classes/interfaces inherited from class com.sonymobile.jenkins.plugins.teamview.TeamProperty
TeamProperty.TeamPropertyDescriptor
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class com.sonymobile.jenkins.plugins.teamview.TeamProperty
team
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Method Summary
 void addView(hudson.model.View view)
          Adds a View to the ViewGroupMixIn.
 boolean canDelete(hudson.model.View view)
           
 void checkPermission(hudson.security.Permission permission)
           
 void deleteView(hudson.model.View view)
           
 void doCreateView(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Creates a view and adds it to the ViewGroupMixIn.
 org.kohsuke.stapler.HttpResponse doIndex()
          Shows the primary view.
 hudson.util.FormValidation doViewExistsCheck(String value, boolean exists)
          Checks if a private view with the given name exists.
 hudson.security.ACL getACL()
           
 String getDisplayName()
           
 String getIconFileName()
           
 hudson.model.ItemGroup<? extends hudson.model.TopLevelItem> getItemGroup()
           
 hudson.model.View getPrimaryView()
           
 String getPrimaryViewName()
          Standard getter for the primaryViewName.
 Object getStaplerFallback()
           
 Team getTeam()
          Standard getter for the team.
 String getUrl()
           
 String getUrlName()
          Getter for the url name, relative to nearest ancestor, not ending in a '/'.
 hudson.model.View getView(String name)
           
 List<hudson.model.Action> getViewActions()
           
 Collection<hudson.model.View> getViews()
           
 hudson.views.ViewsTabBar getViewsTabBar()
           
 boolean hasPermission(hudson.security.Permission permission)
           
 void onViewRenamed(hudson.model.View view, String oldName, String newName)
           
 Object readResolve()
          Creates the ViewGroupMixIn and sets the default view.
 TeamProperty reconfigure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject form)
          Reconfigures a TeamProperty from a submitted form.
 void save()
           
 void setPrimaryViewName(String primaryViewName)
          Standard setter for the primaryViewName.
 
Methods inherited from class com.sonymobile.jenkins.plugins.teamview.TeamProperty
all, getDescriptor, setTeam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTeam

public Team getTeam()
Standard getter for the team.

Returns:
the Team.

readResolve

public Object readResolve()
Creates the ViewGroupMixIn and sets the default view.

Returns:
a new TeamViewsProperty.

getPrimaryViewName

public String getPrimaryViewName()
Standard getter for the primaryViewName.

Returns:
the primary view name.

setPrimaryViewName

public void setPrimaryViewName(String primaryViewName)
Standard setter for the primaryViewName.

Parameters:
primaryViewName - the primary view name.

getUrl

public String getUrl()
Specified by:
getUrl in interface hudson.model.ViewGroup

save

public void save()
          throws IOException
Specified by:
save in interface hudson.model.Saveable
Throws:
IOException

getViews

public Collection<hudson.model.View> getViews()
Specified by:
getViews in interface hudson.model.ViewGroup

getView

public hudson.model.View getView(String name)
Specified by:
getView in interface hudson.model.ViewGroup

canDelete

public boolean canDelete(hudson.model.View view)
Specified by:
canDelete in interface hudson.model.ViewGroup

deleteView

public void deleteView(hudson.model.View view)
                throws IOException
Specified by:
deleteView in interface hudson.model.ViewGroup
Throws:
IOException

onViewRenamed

public void onViewRenamed(hudson.model.View view,
                          String oldName,
                          String newName)
Specified by:
onViewRenamed in interface hudson.model.ViewGroup

addView

public void addView(hudson.model.View view)
             throws IOException
Adds a View to the ViewGroupMixIn.

Parameters:
view - the View to add.
Throws:
IOException - if the View can't be added.

getPrimaryView

public hudson.model.View getPrimaryView()
Specified by:
getPrimaryView in interface hudson.model.ViewGroup

doIndex

public org.kohsuke.stapler.HttpResponse doIndex()
Shows the primary view.

Returns:
a HttpResponse containing the primary view.

doCreateView

public void doCreateView(org.kohsuke.stapler.StaplerRequest req,
                         org.kohsuke.stapler.StaplerResponse rsp)
                  throws IOException,
                         javax.servlet.ServletException,
                         ParseException,
                         hudson.model.Descriptor.FormException
Creates a view and adds it to the ViewGroupMixIn.

Parameters:
req - the StaplerRequest.
rsp - the StaplerResponse.
Throws:
IOException - if the View can't be added.
javax.servlet.ServletException - if the View can't be created.
ParseException - if the View can't be created.
Descriptor.FormException - if the View can't be created.

getACL

public hudson.security.ACL getACL()
Specified by:
getACL in interface hudson.security.AccessControlled

checkPermission

public void checkPermission(hudson.security.Permission permission)
Specified by:
checkPermission in interface hudson.security.AccessControlled

hasPermission

public boolean hasPermission(hudson.security.Permission permission)
Specified by:
hasPermission in interface hudson.security.AccessControlled

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject

getIconFileName

public String getIconFileName()
Specified by:
getIconFileName in interface hudson.model.Action

getUrlName

public String getUrlName()
Description copied from class: TeamProperty
Getter for the url name, relative to nearest ancestor, not ending in a '/'.

Specified by:
getUrlName in interface hudson.model.Action
Specified by:
getUrlName in class TeamProperty
Returns:
the url name for this property.

doViewExistsCheck

public hudson.util.FormValidation doViewExistsCheck(@QueryParameter
                                                    String value,
                                                    @QueryParameter
                                                    boolean exists)
Checks if a private view with the given name exists. An error is returned if exists==true but the view does not exist. An error is also returned if exists==false but the view does exist.

Parameters:
value - the view name to check.
exists - whether the view is supposed to exist or not.
Returns:
a FormValidation describing whether the view exists or not.

reconfigure

public TeamProperty reconfigure(org.kohsuke.stapler.StaplerRequest req,
                                net.sf.json.JSONObject form)
                         throws hudson.model.Descriptor.FormException
Description copied from class: TeamProperty
Reconfigures a TeamProperty from a submitted form.

Specified by:
reconfigure in interface hudson.model.ReconfigurableDescribable<TeamProperty>
Overrides:
reconfigure in class TeamProperty
Parameters:
req - the StaplerRequest.
form - the submitted form.
Returns:
a new TeamProperty instance.
Throws:
Descriptor.FormException - if there is a problem in the submitted form.

getViewsTabBar

public hudson.views.ViewsTabBar getViewsTabBar()
Specified by:
getViewsTabBar in interface hudson.model.ViewGroup

getItemGroup

public hudson.model.ItemGroup<? extends hudson.model.TopLevelItem> getItemGroup()
Specified by:
getItemGroup in interface hudson.model.ViewGroup

getViewActions

public List<hudson.model.Action> getViewActions()
Specified by:
getViewActions in interface hudson.model.ViewGroup

getStaplerFallback

public Object getStaplerFallback()
Specified by:
getStaplerFallback in interface org.kohsuke.stapler.StaplerFallback


Copyright © 2004-2013. All Rights Reserved.