Skip to content

Commit

Permalink
Merge pull request #659 from marklogic-community/feature/ML8_deprecation
Browse files Browse the repository at this point in the history
Feature/ml8 deprecation
  • Loading branch information
aebadirad authored Jan 17, 2018
2 parents 0a593e2 + 9718055 commit 370dd37
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 258 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ with a fix for the issue you filed.
You can request a new feature by submitting an issue to our [GitHub Issue Tracker][issue tracker]. If you
would like to implement a new feature then first create a new issue and discuss it with one of our
project maintainers.
#####Note: as of DHF 2.0.3, pull requests will only be accepted for MarkLogic 9. Only critical bug fixes will be accepted for MarkLogic 8 on the legacy 2.0.2 or earlier branches.

## Building the Framework from Source
Looking to build the code from source? Look no further.

#### Prerequisites
You need these to get started

- MarkLogic 9+
- Java 8 JDK
- Gradle (3.4 or greater)
- A decent IDE. IntelliJ is nice.
Expand Down

This file was deleted.

12 changes: 1 addition & 11 deletions marklogic-data-hub/src/main/java/com/marklogic/hub/DataHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,10 @@ public boolean isServerVersionValid(String versionString) {
versionString = getMarkLogicVersion();
}
int major = Integer.parseInt(versionString.replaceAll("([^.]+)\\..*", "$1"));
if (major < 8) {
if (major < 9) {
return false;
}
boolean isNightly = versionString.matches("[^-]+-(\\d{4})(\\d{2})(\\d{2})");
if (major == 8) {
String alteredString = versionString.replaceAll("[^\\d]+", "");
if (alteredString.length() < 4) {
alteredString = StringUtils.rightPad(alteredString, 4, "0");
}
int ver = Integer.parseInt(alteredString.substring(0, 4));
if (!isNightly && ver < 8070) {
return false;
}
}
if (major == 9) {
String alteredString = versionString.replaceAll("[^\\d]+", "");
if (alteredString.length() < 4) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ xquery version "1.0-ml";

module namespace hent = "http://marklogic.com/data-hub/hub-entities";

import module namespace es-wrapper = "http://marklogic.com/data-hub/es-wrapper"
at "/com.marklogic.hub/lib/entity-services-wrapper.xqy";

import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
import module namespace es = "http://marklogic.com/entity-services"
at "/MarkLogic/entity-services/entity-services.xqy";

declare variable $ENTITY-MODEL-COLLECTION := "http://marklogic.com/entity-services/models";

Expand Down Expand Up @@ -96,13 +93,13 @@ declare function hent:dump-search-options($entities as json:array)
let $uber-model := hent:uber-model(json:array-values($entities) ! xdmp:to-json(.)/object-node())
return
(: call fix-options because of https://github.com/marklogic/entity-services/issues/359 :)
hent:fix-options(es-wrapper:search-options-generate($uber-model))
hent:fix-options(es:search-options-generate($uber-model))
};

declare function hent:dump-indexes($entities as json:array)
{
let $uber-model := hent:uber-model(json:array-values($entities) ! xdmp:to-json(.)/object-node())
let $o := xdmp:from-json(es-wrapper:database-properties-generate($uber-model))
let $o := xdmp:from-json(es:database-properties-generate($uber-model))
let $_ :=
for $x in ("database-name", "schema-database", "triple-index", "collection-lexicon")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ module namespace service = "http://marklogic.com/rest-api/resource/entity";
import module namespace debug = "http://marklogic.com/data-hub/debug"
at "/com.marklogic.hub/lib/debug-lib.xqy";

import module namespace es-wrapper = "http://marklogic.com/data-hub/es-wrapper"
at "/com.marklogic.hub/lib/entity-services-wrapper.xqy";
import module namespace es = "http://marklogic.com/entity-services"
at "/MarkLogic/entity-services/entity-services.xqy";

import module namespace flow = "http://marklogic.com/data-hub/flow-lib"
at "/com.marklogic.hub/lib/flow-lib.xqy";
Expand Down Expand Up @@ -88,7 +88,7 @@ declare function put(

let $model as map:map := $input/object-node()
return
es-wrapper:database-properties-generate($model)
es:database-properties-generate($model)
}
})
};
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import module namespace hent = "http://marklogic.com/data-hub/hub-entities"
import module namespace perf = "http://marklogic.com/data-hub/perflog-lib"
at "/com.marklogic.hub/lib/perflog-lib.xqy";

import module namespace es-wrapper = "http://marklogic.com/data-hub/es-wrapper"
at "/com.marklogic.hub/lib/entity-services-wrapper.xqy";
import module namespace esi = "http://marklogic.com/entity-services-impl"
at "/MarkLogic/entity-services/entity-services-impl.xqy";

declare namespace es = "http://marklogic.com/entity-services";

Expand Down Expand Up @@ -111,7 +111,7 @@ declare function service:generate-lets($model as map:map, $entity-type-name)
let $property := map:get($properties, $property-name)
let $is-array := map:get($property, "datatype") eq "array"
let $property := map:get($properties, $property-name)
let $property-datatype := es-wrapper:resolve-datatype($model, $entity-type-name, $property-name)
let $property-datatype := esi:resolve-datatype($model, $entity-type-name, $property-name)
let $casting-function-name :=
if (map:contains($property, "datatype") and map:get($property, "datatype") ne "array") then
service:casting-function-name-xqy($property-datatype)
Expand Down Expand Up @@ -364,7 +364,7 @@ declare function service:generate-vars($model as map:map, $entity-type-name)

let $property := map:get($properties, $property-name)
let $is-array := map:get($property, "datatype") eq "array"
let $property-datatype := es-wrapper:resolve-datatype($model, $entity-type-name, $property-name)
let $property-datatype := esi:resolve-datatype($model, $entity-type-name, $property-name)
let $casting-function-name := service:casting-function-name-sjs($property-datatype)
let $wrap-if-array := function($str) {
if ($is-array) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public void testInstallHubModules() throws IOException {
assertTrue(getModulesFile("/com.marklogic.hub/lib/config.xqy").startsWith(getResource("data-hub-test/core-modules/config.xqy")));
int totalCount = getDocCount(HubConfig.DEFAULT_MODULES_DB_NAME, null);
int hubModulesCount = getDocCount(HubConfig.DEFAULT_MODULES_DB_NAME, "hub-core-module");
assertTrue(totalCount + " is not correct", 84 == totalCount || 64 == totalCount);
assertTrue(hubModulesCount + " is not correct", 42 == hubModulesCount || 22 == hubModulesCount);
//As a note, whenever you see the 83 || 63, it's due to the additional building of the javascript files bundling down that will then get
//deployed with the rest of the modules code. This means it'll be 20 higher than if the trace UI was never built
assertTrue(totalCount + " is not correct", 83 == totalCount || 63 == totalCount);
assertTrue(hubModulesCount + " is not correct", 41 == hubModulesCount || 21 == hubModulesCount);

assertTrue("trace options not installed", getModulesFile("/Default/data-hub-TRACING/rest-api/options/traces.xml").length() > 0);
assertTrue("trace options not installed", getModulesFile("/Default/data-hub-JOBS/rest-api/options/jobs.xml").length() > 0);
Expand All @@ -59,12 +61,12 @@ public void testInstallUserModules() throws IOException, ParserConfigurationExce
DataHub dataHub = new DataHub(hubConfig);

int totalCount = getDocCount(HubConfig.DEFAULT_MODULES_DB_NAME, null);
assertTrue(totalCount + " is not correct", 84 == totalCount || 64 == totalCount);
assertTrue(totalCount + " is not correct", 83 == totalCount || 63 == totalCount);

dataHub.installUserModules(true);

totalCount = getDocCount(HubConfig.DEFAULT_MODULES_DB_NAME, null);
assertTrue(totalCount + " is not correct", 84 == totalCount || 104 == totalCount);
assertTrue(totalCount + " is not correct", 83 == totalCount || 103 == totalCount);

assertEquals(
getResource("data-hub-test/plugins/entities/test-entity/harmonize/final/collector.xqy"),
Expand Down Expand Up @@ -186,17 +188,17 @@ public void testClearUserModules() throws URISyntaxException {
dataHub.clearUserModules();

int totalCount = getDocCount(HubConfig.DEFAULT_MODULES_DB_NAME, null);
assertTrue(totalCount + " is not correct", 84 == totalCount || 64 == totalCount);
assertTrue(totalCount + " is not correct", 83 == totalCount || 63 == totalCount);

dataHub.installUserModules(true);

totalCount = getDocCount(HubConfig.DEFAULT_MODULES_DB_NAME, null);
assertTrue(totalCount + " is not correct", 84 == totalCount || 104 == totalCount);
assertTrue(totalCount + " is not correct", 83 == totalCount || 103 == totalCount);

dataHub.clearUserModules();

totalCount = getDocCount(HubConfig.DEFAULT_MODULES_DB_NAME, null);
assertTrue(totalCount + " is not correct", 84 == totalCount || 64 == totalCount);
assertTrue(totalCount + " is not correct", 83 == totalCount || 63 == totalCount);

}
}
Loading

0 comments on commit 370dd37

Please sign in to comment.