Allow defining a default dashboard for projects

It is now possible to define a default dashboard for a project in the
project.config file in the refs/meta/config branch.

Example:
[dashboard]
  default = refs/meta/dashboards/main:default

When it will be possible to inherit dashboards from parent projects, it
will be important to differentiate between a default dashboard that
is be used for this project and the dashboard that will be inherited
by the child projects as default dashboard.

This is why we allow overwriting the default dashboard by explicitly
setting a local default dashboard, which will only be used by this
project.

Example:
[dashboard]
  default = refs/meta/dashboards/main:default
  local-default = refs/meta/dashboards/main:local

Via the /dashboards/ REST endpoint it is now possible to either
retrieve all dashboards of the project or only the default dashboard
of the project.

Change-Id: I119408968bc86c3fd112c186638d3176235ca28e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2012-11-14 20:46:58 +01:00
parent b2efe218a5
commit 488534349a
7 changed files with 217 additions and 34 deletions

View File

@@ -109,6 +109,10 @@ public final class Project {
protected InheritedBoolean useContentMerge;
protected String defaultDashboardId;
protected String localDefaultDashboardId;
protected Project() {
}
@@ -186,6 +190,22 @@ public final class Project {
state = newState;
}
public String getDefaultDashboard() {
return defaultDashboardId;
}
public void setDefaultDashboard(final String defaultDashboardId) {
this.defaultDashboardId = defaultDashboardId;
}
public String getLocalDefaultDashboard() {
return localDefaultDashboardId;
}
public void setLocalDefaultDashboard(final String localDefaultDashboardId) {
this.localDefaultDashboardId = localDefaultDashboardId;
}
public void copySettingsFrom(final Project update) {
description = update.description;
useContributorAgreements = update.useContributorAgreements;