public static enum RpcRequest {\r
// Order is important here. anything above LIST_SETTINGS requires\r
// administrator privileges and web.allowRpcManagement.\r
- CLEAR_REPOSITORY_CACHE, GET_PROTOCOL, LIST_REPOSITORIES, LIST_BRANCHES, GET_USER, LIST_SETTINGS,\r
+ CLEAR_REPOSITORY_CACHE, REINDEX_TICKETS, GET_PROTOCOL, LIST_REPOSITORIES, LIST_BRANCHES, GET_USER, LIST_SETTINGS,\r
CREATE_REPOSITORY, EDIT_REPOSITORY, DELETE_REPOSITORY,\r
LIST_USERS, CREATE_USER, EDIT_USER, DELETE_USER,\r
LIST_TEAMS, CREATE_TEAM, EDIT_TEAM, DELETE_TEAM,\r
\r
private static final long serialVersionUID = 1L;\r
\r
- public static final int PROTOCOL_VERSION = 6;\r
+ public static final int PROTOCOL_VERSION = 7;\r
\r
private IStoredSettings settings;\r
\r
} else {\r
response.sendError(notAllowedCode);\r
}\r
+ } else if (RpcRequest.REINDEX_TICKETS.equals(reqType)) {\r
+ if (allowManagement) {\r
+ if (StringUtils.isEmpty(objectName)) {\r
+ // reindex all tickets\r
+ gitblit.getTicketService().reindex();\r
+ } else {\r
+ // reindex tickets in a specific repository\r
+ RepositoryModel model = gitblit.getRepositoryModel(objectName);\r
+ gitblit.getTicketService().reindex(model);\r
+ }\r
+ } else {\r
+ response.sendError(notAllowedCode);\r
+ }\r
}\r
\r
// send the result of the request\r
password);\r
}\r
\r
+ /**\r
+ * Reindex all tickets on the Gitblit server.\r
+ *\r
+ * @param serverUrl\r
+ * @param account\r
+ * @param password\r
+ * @return true if the action succeeded\r
+ * @throws IOException\r
+ */\r
+ public static boolean reindexTickets(String serverUrl, String account,\r
+ char[] password) throws IOException {\r
+ return doAction(RpcRequest.REINDEX_TICKETS, null, null, serverUrl, account,\r
+ password);\r
+ }\r
+\r
+ /**\r
+ * Reindex tickets for the specified repository on the Gitblit server.\r
+ *\r
+ * @param serverUrl\r
+ * @param repositoryName\r
+ * @param account\r
+ * @param password\r
+ * @return true if the action succeeded\r
+ * @throws IOException\r
+ */\r
+ public static boolean reindexTickets(String serverUrl, String repositoryName,\r
+ String account, char[] password) throws IOException {\r
+ return doAction(RpcRequest.REINDEX_TICKETS, repositoryName, null, serverUrl,\r
+ account, password);\r
+ }\r
+\r
/**\r
* Create a user on the Gitblit server.\r
*\r
<tr><td>Gitblit v1.1.0</td><td>4</td></tr>\r
<tr><td>Gitblit v1.2.0+</td><td>5</td></tr>\r
<tr><td>Gitblit v1.3.1+</td><td>6</td></tr>\r
+<tr><td>Gitblit v1.4.0+</td><td>7</td></tr>\r
</tbody>\r
</table>\r
\r
<tr><td>SET_REPOSITORY_TEAM_PERMISSIONS</td><td>repository name</td><td><em>admin</em></td><td>5</td><td>List<String></td><td>-</td></tr>\r
<tr><td>LIST_SETTINGS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>ServerSettings (management keys)</td></tr>\r
<tr><td>CLEAR_REPOSITORY_CACHE</td><td>-</td><td><em>-</em></td><td>4</td><td>-</td><td>-</td></tr>\r
+<tr><td>REINDEX_TICKETS</td><td>repository name</td><td><em>-</em></td><td>7</td><td>-</td><td>-</td></tr>\r
<tr><td colspan='6'><em>web.enableRpcAdministration=true</em></td></tr>\r
<tr><td>LIST_FEDERATION_REGISTRATIONS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>List<FederationModel></td></tr>\r
<tr><td>LIST_FEDERATION_RESULTS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>List<FederationModel></td></tr>\r