diff --git a/.lgtm.yml b/.lgtm.yml
new file mode 100644
index 00000000..0997e2d8
--- /dev/null
+++ b/.lgtm.yml
@@ -0,0 +1,4 @@
+extraction:
+ javascript:
+ index:
+ exclude: mms-ent/share-amp
diff --git a/mms-ent/docker/Dockerfile b/mms-ent/docker/Dockerfile
index 0a1fb9ee..5bcac265 100644
--- a/mms-ent/docker/Dockerfile
+++ b/mms-ent/docker/Dockerfile
@@ -73,7 +73,7 @@ RUN addgroup -S tomcat \
&& chown -R tomcat:tomcat ${ALF_DATA_DIR}
# Alfresco
-EXPOSE 8080:8080
+#EXPOSE 8080:8080
# Postgres
#EXPOSE 5432:5432
# ElasticSearch
diff --git a/mms-ent/docker/config/alfresco-global.properties b/mms-ent/docker/config/alfresco-global.properties
index 08f03425..17c80ad4 100644
--- a/mms-ent/docker/config/alfresco-global.properties
+++ b/mms-ent/docker/config/alfresco-global.properties
@@ -3,8 +3,6 @@
###############################
dir.root=/mnt/alf_data
-dir.keystore=${dir.root}/keystore
-
dir.contentstore=${dir.root}/contentstore
dir.contentstore.deleted=${dir.root}/contentstore.deleted
@@ -17,19 +15,19 @@ system.content.caching.maxFileSizeMB=0
alfresco.context=alfresco
alfresco.host=localhost
-alfresco.port=8443
-alfresco.protocol=https
+alfresco.port=8080
+alfresco.protocol=http
share.context=share
share.host=localhost
-share.port=8443
-share.protocol=https
+share.port=8080
+share.protocol=http
### database connection properties ###
db.driver=org.postgresql.Driver
db.name=alfresco
-db.username=alfresco
-db.password=alfresco
+db.username=
+db.password=
db.host=
db.port=5432
# probably can up this to same as max connections in db configuration (currently 225)
@@ -39,15 +37,6 @@ db.pool.validate.query
db.url=jdbc:postgresql://${db.host}:${db.port}/${db.name}
-
-## Install Enterprise license if this is an enterprise host.
-
-## License file pulled from SaltMaster
-dir.license.external=/usr/local/tomcat/shared/classes/alfresco/extension/license
-
-
-
-
# The server mode. Set value here
# # UNKNOWN | TEST | BACKUP | PRODUCTION
system.serverMode=TEST
diff --git a/mms-ent/docker/config/set_properties.sh b/mms-ent/docker/config/set_properties.sh
index 2b425362..41283515 100644
--- a/mms-ent/docker/config/set_properties.sh
+++ b/mms-ent/docker/config/set_properties.sh
@@ -1,33 +1,47 @@
#!/bin/sh
-# Configure alfresco-global.properties
+# Configure alfresco-global.properties and mms.properties
if [[ -z "$PG_HOST" ]];then
echo "Postgres host not set"
exit 1
+else
+ sed -i'' -e "s/db.host=/db.host=${PG_HOST}/" /usr/local/tomcat/shared/classes/alfresco-global.properties
+ if [[ -z "$PG_PORT" ]];then
+ echo "Postgres port not set, using default 5432"
+ sed -i'' -e "s/pg.host=jdbc:postgresql:\/\/127.0.0.1\//pg.host=jdbc:postgresql:\/\/${PG_HOST}\//" /usr/local/tomcat/shared/classes/mms.properties
+ else
+ sed -i'' -e "s/db.port=5432/db.port=${PG_PORT}/" /usr/local/tomcat/shared/classes/alfresco-global.properties
+ sed -i'' -e "s/pg.host=jdbc:postgresql:\/\/127.0.0.1\//pg.host=jdbc:postgresql:\/\/${PG_HOST}:${PG_PORT}\//" /usr/local/tomcat/shared/classes/mms.properties
+ fi
fi
if [[ -z "$PG_DB_NAME" ]];then
echo "Postgres Database name not set"
exit 1
+else
+ sed -i'' -e "s/pg.name=/pg.name=${PG_DB_NAME}/" /usr/local/tomcat/shared/classes/mms.properties
fi
if [[ -z "$PG_DB_USER" ]];then
echo "Postgres Database User not set"
exit 1
+else
+ sed -i'' -e "s/db.username=/db.username=${PG_DB_USER}/" /usr/local/tomcat/shared/classes/alfresco-global.properties
+ sed -i'' -e "s/pg.user=/pg.user=${PG_DB_USER}/" /usr/local/tomcat/shared/classes/mms.properties
fi
if [[ -z "$PG_DB_PASS" ]];then
echo "Postgres Database User password not set"
exit 1
+else
+ sed -i'' -e "s/db.password=/db.password=${PG_DB_PASS}/" /usr/local/tomcat/shared/classes/alfresco-global.properties
+ sed -i'' -e "s/pg.pass=/pg.pass=${PG_DB_PASS}/" /usr/local/tomcat/shared/classes/mms.properties
fi
if [[ -z "$ES_HOST" ]];then
- echo "ElasticSearch host not set"
+ echo "Elasticsearch host not set"
exit 1
+else
+ if [[ -z "$ES_PORT" ]];then
+ echo "Elasticsearch port not set, using default 9200"
+ sed -i'' -e "s/elastic.host=http:\/\/localhost/elastic.host=http:\/\/${ES_HOST}/" /usr/local/tomcat/shared/classes/mms.properties
+ else
+ sed -i'' -e "s/elastic.host=http:\/\/localhost:9200/elastic.host=http:\/\/${ES_HOST}:${ES_PORT}/" /usr/local/tomcat/shared/classes/mms.properties
+ fi
fi
-
-sed -i'' -e "s/db.host=/db.host=${PG_HOST}/" /usr/local/tomcat/shared/classes/alfresco-global.properties
-
-# Configure mms.properties file
-sed -i'' -e "s/pg.host=jdbc:postgresql:\/\/127.0.0.1\//pg.host=jdbc:postgresql:\/\/${PG_HOST}\//" /usr/local/tomcat/shared/classes/mms.properties
-sed -i'' -e "s/pg.name=/pg.name=${PG_DB_NAME}/" /usr/local/tomcat/shared/classes/mms.properties
-sed -i'' -e "s/pg.user=/pg.user=${PG_DB_USER}/" /usr/local/tomcat/shared/classes/mms.properties
-sed -i'' -e "s/pg.pass=/pg.pass=${PG_DB_PASS}/" /usr/local/tomcat/shared/classes/mms.properties
-
-sed -i'' -e "s/elastic.host=http:\/\/localhost/elastic.host=http:\/\/${ES_HOST}/" /usr/local/tomcat/shared/classes/mms.properties
diff --git a/mms-ent/docs/SingleServerDeploy.md b/mms-ent/docs/SingleServerDeploy.md
index ada2606b..386a5685 100644
--- a/mms-ent/docs/SingleServerDeploy.md
+++ b/mms-ent/docs/SingleServerDeploy.md
@@ -50,7 +50,7 @@ See: [Alfresco Documentation on Installation](https://docs.alfresco.com/5.1/conc
## Install Postgresql 9.4.x (Optional if using the Alfresco installer which includes Postgresql)
1. Run the following commands as root:
- * `yum -y http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm`
+ * `yum -y install http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm`
* `yum -y install postgresql94 postgresql94-server postgresql94-contrib postgresql94-libs`
* `systemctl enable postgresql-9.4`
* `$PATH_TO_PG_BIN/postgresql94-setup initdb`
diff --git a/mms-ent/pom.xml b/mms-ent/pom.xml
index 5f688dd9..18f8d555 100755
--- a/mms-ent/pom.xml
+++ b/mms-ent/pom.xml
@@ -4,7 +4,7 @@
4.0.0
gov.nasa.jpl.mbee
mms-ent
- 3.3.0-RC1
+ 3.3.0-RC2
Alfresco Repository and Share Quickstart with database and an embedded Tomcat runner.
This All-in-One project allows to manage all the components involved in Alfresco development (Repo, Share, Solr4, AMPs) in one project
diff --git a/mms-ent/repo-amp/pom.xml b/mms-ent/repo-amp/pom.xml
index 122c4c15..1b5ef761 100755
--- a/mms-ent/repo-amp/pom.xml
+++ b/mms-ent/repo-amp/pom.xml
@@ -10,7 +10,7 @@
gov.nasa.jpl.mbee
mms-ent
- 3.3.0-RC1
+ 3.3.0-RC2
diff --git a/mms-ent/repo-amp/src/main/amp/web/mms/mms.swagger.yaml b/mms-ent/repo-amp/src/main/amp/web/mms/mms.swagger.yaml
index 57f55d5f..c5435bd3 100644
--- a/mms-ent/repo-amp/src/main/amp/web/mms/mms.swagger.yaml
+++ b/mms-ent/repo-amp/src/main/amp/web/mms/mms.swagger.yaml
@@ -574,7 +574,7 @@ paths:
200:
description: "OK"
schema:
- $ref: "#/definitions/Elements"
+ $ref: "#/definitions/RejectableElements"
401:
$ref: "#/responses/Unauthorized"
403:
@@ -630,7 +630,7 @@ paths:
200:
description: "OK"
schema:
- $ref: "#/definitions/Elements"
+ $ref: "#/definitions/RejectableElements"
401:
$ref: "#/responses/Unauthorized"
403:
@@ -1186,6 +1186,23 @@ definitions:
type: "string"
additionalProperties:
type: "object"
+ Rejection:
+ type: "object"
+ required:
+ - "code"
+ - "message"
+ - "severity"
+ properties:
+ code:
+ type: "number"
+ id:
+ type: "string"
+ element:
+ $ref: "#/definitions/Element"
+ message:
+ type: "string"
+ severity:
+ type: "string"
Artifact:
type: "object"
required:
@@ -1255,6 +1272,23 @@ definitions:
type: "string"
source:
type: "string"
+ RejectableElements:
+ type: "object"
+ required:
+ - "elements"
+ properties:
+ elements:
+ type: "array"
+ items:
+ $ref: "#/definitions/Element"
+ rejected:
+ type: "array"
+ items:
+ $ref: "#/definitions/Rejection"
+ comment:
+ type: "string"
+ source:
+ type: "string"
Artifacts:
type: "object"
required:
diff --git a/mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/GraphInterface.java b/mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/GraphInterface.java
index 23e50306..10d52024 100644
--- a/mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/GraphInterface.java
+++ b/mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/GraphInterface.java
@@ -35,7 +35,7 @@ public interface GraphInterface {
void rollBackToSavepoint(Savepoint savepoint) throws SQLException;
- void execUpdate(String query) throws SQLException;
+ int execUpdate(String query) throws SQLException;
ResultSet execQuery(String query) throws SQLException;
diff --git a/mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/PostgresHelper.java b/mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/PostgresHelper.java
index b9e3aea7..78ce189a 100644
--- a/mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/PostgresHelper.java
+++ b/mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/PostgresHelper.java
@@ -234,17 +234,18 @@ public void rollBackToSavepoint(Savepoint savepoint) throws SQLException {
getConn().rollback(savepoint);
}
- public void execUpdate(String query) {
+ public int execUpdate(String query) {
if (logger.isDebugEnabled()) {
logger.debug(String.format("execUpdate: %s", query));
}
try {
- getConn().createStatement().executeUpdate(query);
+ return getConn().createStatement().executeUpdate(query);
} catch (SQLException e) {
if (logger.isDebugEnabled()) {
logger.debug(String.format("%s", LogUtil.getStackTrace(e)));
}
}
+ return 0;
}
public ResultSet execQuery(String query) {
@@ -292,16 +293,17 @@ public int insert(String table, Map values) {
String query = String
.format("INSERT INTO \"%s\" (%s) VALUES (%s) RETURNING id", table, columns.toString(), vals.toString());
- PreparedStatement statement = prepareStatement(query);
- for (int i = 0; i < columnList.size(); i++) {
- statementSetter(statement, values.getOrDefault(columnList.get(i), null), i);
- }
+ try (PreparedStatement statement = prepareStatement(query)) {
+ for (int i = 0; i < columnList.size(); i++) {
+ statementSetter(statement, values.getOrDefault(columnList.get(i), null), i);
+ }
- if (logger.isDebugEnabled()) {
- logger.debug(String.format("Query: %s", query));
+ if (logger.isDebugEnabled()) {
+ logger.debug(String.format("Query: %s", query));
+ }
+ statement.execute();
+ return 1;
}
- statement.execute();
- return 1;
} catch (Exception e) {
logger.error(String.format("%s", LogUtil.getStackTrace(e)));
} finally {
@@ -473,13 +475,13 @@ public List