Skip to content

Commit

Permalink
Merge branch 'develop' into feature/elasticsearch_index
Browse files Browse the repository at this point in the history
  • Loading branch information
voxparcxls authored Jun 6, 2024
2 parents 467c52f + 2c37af2 commit 0b1d8d9
Show file tree
Hide file tree
Showing 31 changed files with 541 additions and 124 deletions.
2 changes: 1 addition & 1 deletion cws-adaptation-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>common-workflow-service</artifactId>
<version>2.6.0-pre.1</version><!-- update this each CWS release -->
<version>2.6.0</version><!-- update this each CWS release -->
</parent>
<artifactId>cws-adaptation-engine</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion cws-adaptation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>common-workflow-service</artifactId>
<version>2.6.0-pre.1</version><!-- update this each CWS release -->
<version>2.6.0</version><!-- update this each CWS release -->
</parent>
<artifactId>cws-adaptation</artifactId>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.annotations.ApiIgnore;

@Controller
@RequestMapping("/api")
Expand All @@ -27,6 +28,7 @@ public MyRestService() {
* Example POST service
*
*/
@ApiIgnore
@RequestMapping(value = "/example", method = POST)
public @ResponseBody String example(
final HttpSession session) {
Expand Down
2 changes: 1 addition & 1 deletion cws-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>common-workflow-service</artifactId>
<version>2.6.0-pre.1</version><!-- update this each CWS release -->
<version>2.6.0</version><!-- update this each CWS release -->
</parent>
<artifactId>cws-core</artifactId>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ public int getCountForClaimedProcInstPerKey(String procDefKey, List<String> clai

public List<Map<String, Object>> getProcDefKeyLatestCompleteInst(String procDefKey) {
return jdbcTemplate.queryForList(
"SELECT proc_inst_id, start_time, end_time FROM cws_proc_inst_status WHERE proc_def_key=? AND status='complete' ORDER BY start_time DESC LIMIT 1",
new Object[]{procDefKey}
"SELECT proc_inst_id, start_time, end_time FROM cws_proc_inst_status WHERE proc_def_key=? AND status='complete' ORDER BY start_time DESC LIMIT 1",
new Object[]{procDefKey}
);
}

Expand Down Expand Up @@ -604,8 +604,8 @@ public int getNumUpWorkers() {
*/
public List<Map<String, Object>> getWorkerNumRunningProcs() {
return jdbcTemplate.queryForList(
"SELECT cws_worker.id, active_count as cnt " +
"FROM cws_worker");
"SELECT cws_worker.id, COUNT(*) AS cnt FROM cws_proc_inst_status,cws_worker "
+ "WHERE cws_proc_inst_status.status NOT LIKE '%complete%' GROUP BY cws_worker.id");
}


Expand Down
2 changes: 1 addition & 1 deletion cws-engine-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>common-workflow-service</artifactId>
<version>2.6.0-pre.1</version><!-- update this each CWS release -->
<version>2.6.0</version><!-- update this each CWS release -->
</parent>
<artifactId>cws-engine-service</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion cws-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>common-workflow-service</artifactId>
<version>2.6.0-pre.1</version><!-- update this each CWS release -->
<version>2.6.0</version><!-- update this each CWS release -->
</parent>
<artifactId>cws-engine</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion cws-installer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>common-workflow-service</artifactId>
<version>2.6.0-pre.1</version><!-- update this each CWS release -->
<version>2.6.0</version><!-- update this each CWS release -->
</parent>
<artifactId>cws-installer</artifactId>

Expand Down
13 changes: 10 additions & 3 deletions cws-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>common-workflow-service</artifactId>
<version>2.6.0-pre.1</version><!-- update this each CWS release -->
<version>2.6.0</version><!-- update this each CWS release -->
</parent>
<artifactId>cws-service</artifactId>

Expand All @@ -29,8 +29,6 @@
<artifactId>spring-test</artifactId>
</dependency>



<!-- AWS JAVA API -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
Expand Down Expand Up @@ -255,6 +253,15 @@
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
</dependency>

<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
Expand Down
14 changes: 13 additions & 1 deletion cws-service/src/main/java/jpl/cws/controller/MvcCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,17 @@ protected ModelAndView buildModelerModel(String message) {
return model;
}

}
protected ModelAndView buildApiDocsModel(String message) {
log.trace("Building apidocs's model...");
ModelAndView model = new ModelAndView("api-docs");
try {
model.addObject("base", appRoot);
model.addObject("msg", message);

log.trace("MODEL for Modeler page: "+model.getModel());
}
catch (Throwable t) {
log.error("Unexpected exception", t);
}
return model;
}
48 changes: 31 additions & 17 deletions cws-service/src/main/java/jpl/cws/controller/MvcService.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import jpl.cws.process.initiation.InitiatorsService;
import jpl.cws.scheduler.Scheduler;
import jpl.cws.service.CwsConsoleService;
import springfox.documentation.annotations.ApiIgnore;

@Controller
public class MvcService extends MvcCore {
Expand All @@ -50,6 +51,7 @@ public MvcService() {}
/**
*
*/
@ApiIgnore
@RequestMapping(value = "/login", method = GET)
public ModelAndView login(final HttpSession session) {
return buildModel("login", "Please log in");
Expand All @@ -59,6 +61,7 @@ public ModelAndView login(final HttpSession session) {
/**
*
*/
@ApiIgnore
@RequestMapping(value = "/not_authorized", method = GET)
public ModelAndView notAuthorized(final HttpSession session) {
return buildModel("not_authorized", "Not authorized. Please navigate elsewhere");
Expand All @@ -68,6 +71,7 @@ public ModelAndView notAuthorized(final HttpSession session) {
/**
*
*/
@ApiIgnore
@RequestMapping(value = "/home", method = GET)
public ModelAndView index(final HttpSession session) {
return buildHomeModel("");
Expand All @@ -76,6 +80,7 @@ public ModelAndView index(final HttpSession session) {
/**
*
*/
@ApiIgnore
@RequestMapping(value = "/summary", method = GET)
public ModelAndView summary(final HttpSession session) {
return buildSummaryModel("");
Expand All @@ -87,6 +92,7 @@ public ModelAndView summary(final HttpSession session) {
* and results in displaying the home page with a welcome message
*
*/
@ApiIgnore
@RequestMapping(value = "/logintotarget", method = POST)
public ModelAndView logintotarget(
final HttpSession session,
Expand Down Expand Up @@ -140,26 +146,26 @@ public ModelAndView logintotarget(
return buildHomeModel("Welcome " + (user == null ? username : user.getFirstName()));
}
}


@ApiIgnore
@RequestMapping(value = "/deployments", method = GET)
public ModelAndView deployments() {
return buildDeploymentsModel("");
}


@ApiIgnore
@RequestMapping(value = "/logs", method = GET)
public ModelAndView logs() {
return buildLogsModel("");
}


@ApiIgnore
@RequestMapping(value = "/history", method = GET)
public ModelAndView history() {
return buildHistoryModel("");
}


@ApiIgnore
@RequestMapping(value = "/workers", method = GET)
public ModelAndView workers() {
return buildWorkersModel();
Expand All @@ -170,6 +176,7 @@ public ModelAndView workers() {
* Returns Initiators page model and view
*
*/
@ApiIgnore
@RequestMapping(value = "/initiators", method = GET)
public ModelAndView initiators() {
ModelAndView model = new ModelAndView("initiators");
Expand All @@ -187,44 +194,51 @@ public ModelAndView initiators() {
}
return model;
}


@ApiIgnore
@RequestMapping(value = "/snippets", method = GET)
public ModelAndView snippets() {
ModelAndView model = new ModelAndView("snippets");
model.addObject("base", appRoot);
model.addObject("msg", "");
return model;
}


@ApiIgnore
@RequestMapping(value = "/processes", method = GET)
public ModelAndView processes() {
return buildProcessesModel("");
}


@ApiIgnore
@RequestMapping(value = "/configuration", method = GET)
public ModelAndView configuration() {
return buildConfigurationModel("");
}


@ApiIgnore
@RequestMapping(value = "/documentation", method = GET)
public ModelAndView documentation() {
return buildDocumentationModel("");
}


@ApiIgnore
@RequestMapping(value = "/modeler", method = GET)
public ModelAndView modeler() {
return buildModelerModel("");
}

@ApiIgnore
@RequestMapping(value = "/api-docs", method = GET)
public ModelAndView apidocs() {
return buildApiDocsModel("");
}


/**
*
*/
@ApiIgnore
@RequestMapping(value = "/logout", method = GET)
public ModelAndView logout(
final HttpSession session,
Expand Down
Loading

0 comments on commit 0b1d8d9

Please sign in to comment.