Skip to content
This repository was archived by the owner on May 10, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ jobs:
command: ./jfrog rt config --url $ARTIFACTORY_URL --user $ARTIFACTORY_USER --apikey $ARTIFACTORY_APIKEY --interactive=false
- run:
name: Send mms-amp
command: ./jfrog rt u 'mms-ent/repo-amp/target/*.amp' libs-snapshot-local/gov/nasa/jpl/mms/mms-amp/3.4.3-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
command: ./jfrog rt u 'mms-ent/repo-amp/target/*.amp' libs-snapshot-local/gov/nasa/jpl/mms/mms-amp/3.4.4-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms-share-amp
command: ./jfrog rt u 'mms-ent/share-amp/target/*.amp' libs-snapshot-local/gov/nasa/jpl/mms/mms-share-amp/3.4.3-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
command: ./jfrog rt u 'mms-ent/share-amp/target/*.amp' libs-snapshot-local/gov/nasa/jpl/mms/mms-share-amp/3.4.4-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms java client
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-java-client/mms-java-*.jar' libs-snapshot-local/org/openmbee/mms/mms-java-client/3.4.3-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-java-client/mms-java-*.jar' libs-snapshot-local/org/openmbee/mms/mms-java-client/3.4.4-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms python client
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms_python_*.zip' libs-snapshot-local/gov/nasa/jpl/mms/mms-python-client/3.4.3-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms_python_*.zip' libs-snapshot-local/gov/nasa/jpl/mms/mms-python-client/3.4.4-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms mathematica client
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-mathematica-*.zip' libs-snapshot-local/gov/nasa/jpl/mms/mms-mathematica-client/3.4.3-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-mathematica-*.zip' libs-snapshot-local/gov/nasa/jpl/mms/mms-mathematica-client/3.4.4-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms matlab client
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-matlab-*.zip' libs-snapshot-local/gov/nasa/jpl/mms/mms-matlab-client/3.4.3-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-matlab-*.zip' libs-snapshot-local/gov/nasa/jpl/mms/mms-matlab-client/3.4.4-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true

workflows:
version: 2
Expand Down
2 changes: 1 addition & 1 deletion mms-ent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>gov.nasa.jpl.mbee</groupId>
<artifactId>mms-ent</artifactId>
<version>3.4.3-SNAPSHOT</version>
<version>3.4.4-SNAPSHOT</version>
<name>Alfresco Repository and Share Quickstart with database and an embedded Tomcat runner.</name>
<description>This All-in-One project allows to manage all the components involved in Alfresco development (Repo, Share, Solr4, AMPs) in one project
</description>
Expand Down
2 changes: 1 addition & 1 deletion mms-ent/repo-amp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>gov.nasa.jpl.mbee</groupId>
<artifactId>mms-ent</artifactId>
<version>3.4.3-SNAPSHOT</version>
<version>3.4.4-SNAPSHOT</version>
</parent>

<properties>
Expand Down
4 changes: 4 additions & 0 deletions mms-ent/repo-amp/src/main/amp/web/mms/mms.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,10 @@ paths:
required: true
description: "ref identifier"
type: "string"
- in: "query"
name: "commitId"
description: ""
type: "string"
get:
tags:
- "other"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,30 @@ public List<Map<String, Object>> getAllArtifactsWithLastCommitTimestamp() {
return result;
}

public List<Map<String, Object>> getAllNodesWithoutLastCommitTimestamp() {
List<Map<String, Object>> result = new ArrayList<>();

try {
ResultSet rs = execQuery(String.format(
"SELECT nodes%1$s.id, nodes%1$s.elasticid, nodes%1$s.sysmlid "
+ "FROM nodes%1$s "
+ "WHERE nodes%1$s.lastcommit IS NULL AND deleted IS NOT TRUE;", workspaceId));

while (rs.next()) {
Map<String, Object> node = new HashMap<>();
node.put(Sjm.ELASTICID, rs.getString(2));
node.put(Sjm.SYSMLID, rs.getString(3));
result.add(node);
}
} catch (Exception e) {
logger.warn(String.format("%s", LogUtil.getStackTrace(e)));
} finally {
close();
}

return result;
}

public boolean isDeleted(String sysmlid) {
try (PreparedStatement query = getConn()
.prepareStatement("SELECT id FROM \"nodes" + workspaceId + "\" WHERE sysmlid = ? AND deleted = true")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,27 @@ public JsonObject getModelAtCommit(String commitId) {
return result;
}

public List<String> getModelIdsAtCommit(String commitId) {
List<String> result = new ArrayList<>();
Map<String, Object> commit = pgh.getCommit(commitId);
if (commit != null) {
// project and holding bin nodes
for (Map<String, Object> n : pgh.getAllNodesWithoutLastCommitTimestamp()) {
result.add((String) n.get(Sjm.SYSMLID));
}
for (Map<String, Object> n : pgh.getAllNodesWithLastCommitTimestamp()) {
if ((boolean) n.get("deleted")) {
if (!commitId.equals(n.get("lastCommit")) && ( n.get(Sjm.TIMESTAMP) != null && ((Timestamp) n.get(Sjm.TIMESTAMP)).after((Timestamp) commit.get(Sjm.TIMESTAMP)))) {
result.add((String) n.get(Sjm.SYSMLID));
}
continue;
}
result.add((String) n.get(Sjm.SYSMLID));
}
}
return result;
}

public void processElementForModelAtCommit(Map<String, Object> element, Map<String, String> deletedElementIds,
Map<String, Object> commit, String commitId, List<String> refsCommitsIds, JsonArray elements,
List<String> elasticIds) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
import com.google.gson.JsonObject;
import gov.nasa.jpl.mbee.util.Timer;
import gov.nasa.jpl.mbee.util.Utils;
import gov.nasa.jpl.view_repo.db.GraphInterface;
import gov.nasa.jpl.view_repo.db.Node;
import gov.nasa.jpl.view_repo.util.EmsNodeUtil;
import gov.nasa.jpl.view_repo.util.Sjm;
import java.io.IOException;
import java.sql.SQLException;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -80,9 +77,17 @@ protected Map<String, Object> handleElementGet(WebScriptRequest req, Status stat
private JsonObject getAllElementIds(WebScriptRequest req) {
String refId = getRefId(req);
String projectId = getProjectId(req);
String commit = req.getParameter(Sjm.COMMITID.replace("_", ""));
EmsNodeUtil emsNodeUtil = new EmsNodeUtil(projectId, refId);
String commit = emsNodeUtil.getHeadCommit();
List<String> sysmlIds = emsNodeUtil.getModel(true);

List<String> sysmlIds;
if (commit == null || commit.isEmpty()) {
commit = emsNodeUtil.getHeadCommit();
sysmlIds = emsNodeUtil.getModel(true);
} else {
sysmlIds = emsNodeUtil.getModelIdsAtCommit(commit);
}

JsonArray array = new JsonArray();
JsonObject result = new JsonObject();
for (String s: sysmlIds) {
Expand Down
2 changes: 1 addition & 1 deletion mms-ent/repo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>gov.nasa.jpl.mbee</groupId>
<artifactId>mms-ent</artifactId>
<version>3.4.3-SNAPSHOT</version>
<version>3.4.4-SNAPSHOT</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion mms-ent/runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>gov.nasa.jpl.mbee</groupId>
<artifactId>mms-ent</artifactId>
<version>3.4.3-SNAPSHOT</version>
<version>3.4.4-SNAPSHOT</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion mms-ent/share-amp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>gov.nasa.jpl.mbee</groupId>
<artifactId>mms-ent</artifactId>
<version>3.4.3-SNAPSHOT</version>
<version>3.4.4-SNAPSHOT</version>
</parent>

<!--
Expand Down
2 changes: 1 addition & 1 deletion mms-ent/share/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>gov.nasa.jpl.mbee</groupId>
<artifactId>mms-ent</artifactId>
<version>3.4.3-SNAPSHOT</version>
<version>3.4.4-SNAPSHOT</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion mms-ent/solr-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>gov.nasa.jpl.mbee</groupId>
<artifactId>mms-ent</artifactId>
<version>3.4.3-SNAPSHOT</version>
<version>3.4.4-SNAPSHOT</version>
</parent>

<!-- Build Solr Configuration only when we run an embedded Tomcat (i.e. profile run is enabled).
Expand Down