Skip to content

Commit 57efa10

Browse files
committed
add grpc sync endpoint
1 parent 143877c commit 57efa10

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

conf/WEB-INF/actions.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,9 @@ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
664664
<bean id="viewScorecardAction" class="com.cronos.onlinereview.actions.projectreview.ViewScorecardAction" parent="baseViewOrExportGenericReviewAction" scope="request">
665665
</bean>
666666

667+
<bean id="syncProjectAction" class="com.cronos.onlinereview.actions.project.SyncProjectAction" parent="baseProjectAction" scope="request">
668+
</bean>
669+
667670
<!-- Struts1MappingAction action -->
668671
<bean id="struts1MappingAction" class="com.cronos.onlinereview.actions.Struts1MappingAction" scope="request">
669672
</bean>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (C) 2013-2014 TopCoder Inc., All Rights Reserved.
3+
*/
4+
package com.cronos.onlinereview.actions.project;
5+
6+
import com.topcoder.onlinereview.component.exception.BaseException;
7+
import com.topcoder.onlinereview.component.grpcclient.GrpcHelper;
8+
9+
/**
10+
* This class is the struts action class which is used for listing all projects.
11+
* <p>
12+
* Struts 2 Action objects are instantiated for each request, so there are no
13+
* thread-safety issues.
14+
* </p>
15+
*
16+
* @author TCSASSEMBLER
17+
* @version 2.0
18+
*/
19+
public class SyncProjectAction extends BaseProjectAction {
20+
21+
/**
22+
* Default constructor.
23+
*/
24+
public SyncProjectAction() {
25+
}
26+
27+
public String execute() throws BaseException {
28+
String projectId = request.getParameter("projectId");
29+
30+
GrpcHelper.getSyncServiceRpc().saveProjectSync(Long.valueOf(projectId), false, false,
31+
false, false, true, false, false, false);
32+
33+
// Signal about successful execution of the Action
34+
return "syncResult";
35+
}
36+
}

src/main/resources/struts.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@
519519
<action name="eventBusHandleAppealAction" class="eventBusHandleAppealAction">
520520
</action>
521521

522+
<action name="SyncProject" class="syncProjectAction">
523+
<result name="success">/jsp/syncResult.jsp</result>
524+
</action>
525+
522526
<!-- Redirect for old-style Struts1 requests -->
523527
<action name="*.do" class="struts1MappingAction">
524528
<result name="dynamic" type="redirect">${url}</result>

web/jsp/syncResult.jsp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<%--
2+
- Author: TCSASSEMBLER
3+
- Version: 2.0
4+
- Copyright: Copyright (C) 2005 - 2014 TopCoder Inc., All Rights Reserved.
5+
-
6+
- Description: The login page for the online review application.
7+
--%>
8+
<%@ page contentType="text/html;charset=UTF-8" %>
9+
<%@ page language="java" isELIgnored="false" %>
10+
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
11+
<%@ taglib prefix="s" uri="/struts-tags" %>
12+
<%@ taglib prefix="or" uri="/or-tags" %>
13+
<%@ taglib prefix="orfn" uri="/tags/or-functions" %>
14+
<%@ page import="com.topcoder.onlinereview.component.webcommon.ApplicationServer" %>
15+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
16+
<html>
17+
18+
<head>
19+
</head>
20+
<body>
21+
22+
<body>
23+
24+
</body>
25+
</html>

0 commit comments

Comments
 (0)