diff --git a/src/java/edu/slu/common/Constant.java b/src/java/edu/slu/common/Constant.java index 9a45303e..b95735f3 100644 --- a/src/java/edu/slu/common/Constant.java +++ b/src/java/edu/slu/common/Constant.java @@ -10,38 +10,33 @@ * @author hanyan */ public class Constant { + public static final String RERUM_API_VERSION="1.0.0"; + + //Mongo Connection String + public static final String DATABASE_CONNECTION = "mongodb://some-user:SomePassword@some-server:27017/DBNAME?w=majority&authMechanism=PICK-ONE"; - //permission of annotation - public static final int PERMISSION_PRIVATE = 0; - public static final int PERMISSION_PROJECT = 1; - public static final int PERMISSION_PUBLIC = 2; + //Mongo Database Name + public static final String DATABASE_NAME = "annotationStore"; // NOTE this changes between dev and prod - //collection name - public static final String COLLECTION_ANNOTATION = "alpha"; // for RERUM alpha - public static final String COLLECTION_ACCEPTEDSERVER = "acceptedServer"; - public static final String COLLECTION_USER = "user"; - public static final String COLLECTION_PROJECT_USER_PROFILE = "projectUserProfile"; - public static final String COLLECTION_AGENT = "agent"; + //Database Collection Name + public static final String COLLECTION_ANNOTATION = "alpha"; //db.alpha.doStuff() - public static final String AGENT_DEPENDENCY_TYPE_USER = "user"; - public static final String AGENT_DEPENDENCY_TYPE_STRING = "string"; + //Legacy Collection Names + public static final String COLLECTION_ACCEPTEDSERVER = "acceptedServer"; //db.acceptedServer.doStuff() + public static final String COLLECTION_V0 = "annotation"; // db.annotation.doStuff() + //RERUM URL and endpoint paterns public static final String RERUM_BASE="http://test-store.rerum.io"; public static final String RERUM_PREFIX="http://test-store.rerum.io/prd02-img01/"; public static final String RERUM_ID_PREFIX="http://test-store.rerum.io/prd02-img01/id/"; - public static final String RERUM_AGENT_PREFIX="http://devstore.rerum.io/v1/agent"; public static final String RERUM_AGENT_ClAIM="http://devstore.rerum.io/v1/agent"; + + //RERUM API Linked Data context public static final String RERUM_CONTEXT="http://test-store.rerum.io/prd02-img01/context.json"; - public static final String RERUM_API_VERSION="1.0.0"; + //The location of the public API documents. This is necessary for JSON-LD context purposes. public static final String RERUM_API_DOC="https://github.com/CenterForDigitalHumanities/rerum_server/blob/master/API.md#__rerum"; - //number of annotation versions - public static final int NUMBER_OF_ANNO_VERSION = 10; - - //get by objectID url - //public static final String GET_BY_OBJECTid_URL = "http://test-store.rerum.io/rerumserver/anno/getAnnotationByObjectID"; - //return result message public static final String DUPLICATED = "duplicated"; public static final String SUCCESS = "success"; diff --git a/src/java/edu/slu/util/MongoDBUtil.java b/src/java/edu/slu/util/MongoDBUtil.java index b97a647c..bf59262d 100644 --- a/src/java/edu/slu/util/MongoDBUtil.java +++ b/src/java/edu/slu/util/MongoDBUtil.java @@ -8,6 +8,7 @@ import com.mongodb.MongoClient; import com.mongodb.MongoClientOptions; import com.mongodb.MongoClientURI; +import edu.slu.common.Constant; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -38,11 +39,9 @@ public static MongoDBUtil getInstance() { final MongoClientOptions options = MongoClientOptions.builder() .connectionsPerHost(100) .build(); - MongoClientURI uri = new MongoClientURI( - "mongodb://USER:PASS@f-vl-cdh-img-01:27017/DATABASE?w=majority&authMechanism=PICK_ONE" - ); + MongoClientURI uri = new MongoClientURI(Constant.DATABASE_CONNECTION); mg = new MongoClient(uri); - db = mg.getDB("annotationStoreDev"); + db = mg.getDB(Constant.DATABASE_NAME); } catch (Exception e) { Logger.getLogger(MongoDBUtil.class.getName()).log(Level.SEVERE, null, e); } diff --git a/src/java/struts.xml b/src/java/struts.xml index dce2cd75..e43b1ddc 100644 --- a/src/java/struts.xml +++ b/src/java/struts.xml @@ -13,11 +13,7 @@ - - - - - + /403.jsp /down.html @@ -30,7 +26,6 @@ - @@ -43,7 +38,6 @@ - @@ -56,7 +50,6 @@ - @@ -69,13 +62,21 @@ - askAuth0, getByProperties, getByID, getAllAncestors, getAllDescendants, getAllVersions + askAuth0, getByProperties, getByID, getAllAncestors, getAllDescendants, getAllVersions + + + + + saveNewObject, batchSaveFromCopy, releaseObject, patchUpdateObject, putUpdateObject, overwriteObject, patchSetUpdate, patchUnsetUpdate, deleteObject + + +