* The types of objects that can be indexed and queried.\r
*/\r
public static enum SearchObjectType {\r
- commit, blob, issue;\r
+ commit, blob;\r
\r
static SearchObjectType fromName(String name) {\r
for (SearchObjectType value : values()) {\r
private static final String FIELD_COMMITTER = "committer";\r
private static final String FIELD_DATE = "date";\r
private static final String FIELD_TAG = "tag";\r
- private static final String FIELD_LABEL = "label";\r
\r
private static final String CONF_FILE = "lucene.conf";\r
private static final String LUCENE_DIR = "lucene";\r
if (doc.get(FIELD_TAG) != null) {\r
result.tags = StringUtils.getStringsFromValue(doc.get(FIELD_TAG));\r
}\r
- if (doc.get(FIELD_LABEL) != null) {\r
- result.labels = StringUtils.getStringsFromValue(doc.get(FIELD_LABEL));\r
- }\r
return result;\r
}\r
\r
int branchCount;\r
int commitCount;\r
int blobCount;\r
- int issueCount;\r
\r
void add(IndexResult result) {\r
this.branchCount += result.branchCount;\r
this.commitCount += result.commitCount;\r
this.blobCount += result.blobCount;\r
- this.issueCount += result.issueCount; \r
}\r
\r
void success() {\r
\r
public String path;\r
\r
- public String issueId;\r
-\r
public List<String> tags;\r
\r
- public List<String> labels;\r
-\r
public SearchObjectType type;\r
\r
public SearchResult() {\r
return path;\r
case commit:\r
return commitId;\r
- case issue:\r
- return issueId;\r
}\r
return commitId;\r
}\r
}\r
}\r
\r
- public static void setTicketCssClass(Component container, String state) {\r
- String css = null;\r
- if (state.equals("open")) {\r
- css = "label label-important";\r
- } else if (state.equals("hold")) {\r
- css = "label label-warning";\r
- } else if (state.equals("resolved")) {\r
- css = "label label-success";\r
- } else if (state.equals("invalid")) {\r
- css = "label";\r
- }\r
- if (css != null) {\r
- setCssClass(container, css);\r
- }\r
- }\r
- \r
public static void setPermissionClass(Component container, AccessPermission permission) {\r
if (permission == null) {\r
setCssClass(container, "badge");\r
item.add(new Label("tags").setVisible(false));\r
break;\r
}\r
- case issue: {\r
- Label icon = WicketUtils.newIcon("type", "icon-file");\r
- WicketUtils.setHtmlTooltip(icon, "issue");\r
- item.add(icon);\r
- item.add(new Label("summary", "issue: " + sr.issueId));\r
- item.add(new Label("tags").setVisible(false));\r
- break;\r
- }\r
}\r
item.add(new Label("fragment", sr.fragment).setEscapeModelStrings(false).setVisible(!StringUtils.isEmpty(sr.fragment)));\r
item.add(new LinkPanel("repository", null, sr.repository, SummaryPage.class, WicketUtils.newRepositoryParameter(sr.repository)));\r