Skip to content

Commit 4794f3f

Browse files
authored
Merge pull request #1718 from vladak/repolisting_tunable
tunable for displaying listing of repositories on index page
2 parents f156522 + da33a4b commit 4794f3f

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

src/org/opensolaris/opengrok/configuration/Configuration.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ public final class Configuration {
232232
*/
233233
private int MaxSearchThreadCount;
234234

235+
/**
236+
* If false, do not display listing or projects/repositories on the index page.
237+
*/
238+
private boolean displayRepositories;
239+
235240
/*
236241
* types of handling history for remote SCM repositories:
237242
* ON - index history and display it in webapp
@@ -350,7 +355,7 @@ public void setGroupsCollapseThreshold(int groupsCollapseThreshold) throws Illeg
350355
* Creates a new instance of Configuration
351356
*/
352357
public Configuration() {
353-
//defaults for an opengrok instance configuration
358+
// defaults for an opengrok instance configuration
354359
cmds = new HashMap<>();
355360
setAllowedSymlinks(new HashSet<>());
356361
setAuthorizationWatchdogEnabled(false);
@@ -362,6 +367,7 @@ public Configuration() {
362367
setCtags(System.getProperty("org.opensolaris.opengrok.analysis.Ctags", "ctags"));
363368
setCurrentIndexedCollapseThreshold(27);
364369
setDataRoot(null);
370+
setDisplayRepositories(true);
365371
setFetchHistoryWhenNotInCache(true);
366372
setFoldingEnabled(true);
367373
setGenerateHtml(true);
@@ -917,6 +923,14 @@ public void setCurrentIndexedCollapseThreshold(int currentIndexedCollapseThresho
917923
this.currentIndexedCollapseThreshold = currentIndexedCollapseThreshold;
918924
}
919925

926+
public boolean getDisplayRepositories() {
927+
return this.displayRepositories;
928+
}
929+
930+
public void setDisplayRepositories(boolean flag) {
931+
this.displayRepositories = flag;
932+
}
933+
920934
/**
921935
* Get the contents of a file or empty string if the file cannot be read.
922936
*/

src/org/opensolaris/opengrok/configuration/RuntimeEnvironment.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,14 @@ public void setHistoryEnabled(boolean flag) {
11901190
threadConfig.get().setHistoryEnabled(flag);
11911191
}
11921192

1193+
public boolean getDisplayRepositories() {
1194+
return threadConfig.get().getDisplayRepositories();
1195+
}
1196+
1197+
public void setDisplayRepositories(boolean flag) {
1198+
threadConfig.get().setDisplayRepositories(flag);
1199+
}
1200+
11931201
/**
11941202
* Read an configuration file and set it as the current configuration.
11951203
*

web/index.jsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ include file="menu.jspf"
5757
</div>
5858
<div id="results">
5959
<%= PageConfig.get(request).getEnv().getConfiguration().getBodyIncludeFileContent() %>
60-
<%@
60+
<% if (PageConfig.get(request).getEnv().getDisplayRepositories()) { %><%@
6161
6262
include file="repos.jspf"
6363
64-
%>
64+
%><% } %>
6565
</div>
6666
<%
6767
/* ---------------------- index.jsp end --------------------- */

0 commit comments

Comments
 (0)