From 9b480fa3117903eb607104a751e5fb74237de4e0 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 30 Dec 2008 01:40:27 +0000 Subject: [PATCH] pushing up the getUrl method. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13959 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/ListView.java | 4 ---- core/src/main/java/hudson/model/MyView.java | 5 ----- core/src/main/java/hudson/model/View.java | 4 +++- core/src/main/java/hudson/model/ViewGroup.java | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/hudson/model/ListView.java b/core/src/main/java/hudson/model/ListView.java index 2b7d69ebaa..1cd6c41ac3 100644 --- a/core/src/main/java/hudson/model/ListView.java +++ b/core/src/main/java/hudson/model/ListView.java @@ -118,10 +118,6 @@ public class ListView extends View { return item; } - public String getUrl() { - return "view/"+name+'/'; - } - @Override public synchronized void onJobChange(Item item, String oldName, String newName) { jobNames.remove(oldName); diff --git a/core/src/main/java/hudson/model/MyView.java b/core/src/main/java/hudson/model/MyView.java index 7b47523e45..3f195f0964 100644 --- a/core/src/main/java/hudson/model/MyView.java +++ b/core/src/main/java/hudson/model/MyView.java @@ -55,11 +55,6 @@ public class MyView extends View { return Collections.unmodifiableList(items); } - @Override - public String getUrl() { - return "view/" + getViewName() + "/"; - } - @Override public String getPostConstructLandingPage() { return ""; // there's no configuration page diff --git a/core/src/main/java/hudson/model/View.java b/core/src/main/java/hudson/model/View.java index e75a57d9d2..571fd4f930 100644 --- a/core/src/main/java/hudson/model/View.java +++ b/core/src/main/java/hudson/model/View.java @@ -100,7 +100,9 @@ public abstract class View extends AbstractModelObject implements AccessControll * Doesn't start with '/' but ends with '/'. (except when this is * Hudson, */ - public abstract String getUrl(); + public String getUrl() { + return owner.getUrl()+"view/"+getViewName()+'/'; + } public String getSearchUrl() { return getUrl(); diff --git a/core/src/main/java/hudson/model/ViewGroup.java b/core/src/main/java/hudson/model/ViewGroup.java index 34cfeb8291..19928d7e98 100644 --- a/core/src/main/java/hudson/model/ViewGroup.java +++ b/core/src/main/java/hudson/model/ViewGroup.java @@ -28,7 +28,7 @@ public interface ViewGroup extends Saveable, ModelObject { /** * Gets a view of the given name. * - * This also creates the URL binding for views (in the form of ".../view/FOOBAR/..." + * This also creates the URL binding for views (in the form of ".../view/FOOBAR/...") */ View getView(String name);