-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DHFPROD-10566: Ignore flow when properties file is missing in legacy …
…flow directory
- Loading branch information
1 parent
970aefd
commit 974782e
Showing
9 changed files
with
164 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...src/test/resources/upgrade-projects/dhf43x/plugins/entities/Employee/Employee.entity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"info" : { | ||
"title" : "Employee", | ||
"version" : "0.0.1" | ||
}, | ||
"definitions" : { | ||
"Employee" : { | ||
"required" : [ ], | ||
"rangeIndex" : [ ], | ||
"wordLexicon" : [ ], | ||
"properties" : { } | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...rces/upgrade-projects/dhf43x/plugins/entities/Employee/harmonize/NoProperties/content.sjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Create Content Plugin | ||
* | ||
* @param id - the identifier returned by the collector | ||
* @param rawContent - the raw content being loaded. | ||
* @param options - an object containing options. Options are sent from Java | ||
* | ||
* @return - your content | ||
*/ | ||
function createContent(id, rawContent, options) { | ||
return rawContent; | ||
} | ||
|
||
module.exports = { | ||
createContent: createContent | ||
}; |
17 changes: 17 additions & 0 deletions
17
...rces/upgrade-projects/dhf43x/plugins/entities/Employee/harmonize/NoProperties/headers.sjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Create Headers Plugin | ||
* | ||
* @param id - the identifier returned by the collector | ||
* @param content - the output of your content plugin | ||
* @param options - an object containing options. Options are sent from Java | ||
* | ||
* @return - an object of headers | ||
*/ | ||
function createHeaders(id, content, options) { | ||
return {}; | ||
} | ||
|
||
module.exports = { | ||
createHeaders: createHeaders | ||
}; | ||
|
45 changes: 45 additions & 0 deletions
45
...sources/upgrade-projects/dhf43x/plugins/entities/Employee/harmonize/NoProperties/main.sjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// dhf.sjs exposes helper functions to make your life easier | ||
// See documentation at: | ||
// https://marklogic.github.io/marklogic-data-hub/docs/server-side/ | ||
const dhf = require('/data-hub/4/dhf.sjs'); | ||
|
||
const contentPlugin = require('./content.sjs'); | ||
const headersPlugin = require('./headers.sjs'); | ||
const triplesPlugin = require('./triples.sjs'); | ||
|
||
/* | ||
* Plugin Entry point | ||
* | ||
* @param id - the identifier returned by the collector | ||
* @param rawContent - the raw content being loaded | ||
* @param options - a map containing options. Options are sent from Java | ||
* | ||
*/ | ||
function main(id, rawContent, options) { | ||
var contentContext = dhf.contentContext(rawContent); | ||
var content = dhf.run(contentContext, function() { | ||
return contentPlugin.createContent(id, rawContent, options); | ||
}); | ||
|
||
var headerContext = dhf.headersContext(content); | ||
var headers = dhf.run(headerContext, function() { | ||
return headersPlugin.createHeaders(id, content, options); | ||
}); | ||
|
||
var tripleContext = dhf.triplesContext(content, headers); | ||
var triples = dhf.run(tripleContext, function() { | ||
return triplesPlugin.createTriples(id, content, headers, options); | ||
}); | ||
|
||
var envelope = dhf.makeEnvelope(content, headers, triples, options.dataFormat); | ||
|
||
// log the final envelope as a trace | ||
// only fires if tracing is enabled | ||
dhf.logTrace(dhf.writerContext(envelope)); | ||
|
||
return envelope; | ||
} | ||
|
||
module.exports = { | ||
main: main | ||
}; |
18 changes: 18 additions & 0 deletions
18
...rces/upgrade-projects/dhf43x/plugins/entities/Employee/harmonize/NoProperties/triples.sjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Create Triples Plugin | ||
* | ||
* @param id - the identifier returned by the collector | ||
* @param content - the output of your content plugin | ||
* @param headers - the output of your heaaders plugin | ||
* @param options - an object containing options. Options are sent from Java | ||
* | ||
* @return - an array of triples | ||
*/ | ||
function createTriples(id, content, headers, options) { | ||
return []; | ||
} | ||
|
||
module.exports = { | ||
createTriples: createTriples | ||
}; | ||
|
14 changes: 14 additions & 0 deletions
14
...urces/upgrade-projects/dhf43x/plugins/entities/Employee/harmonize/NoProperties/writer.sjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/*~ | ||
* Writer Plugin | ||
* | ||
* @param id - the identifier returned by the collector | ||
* @param envelope - the final envelope | ||
* @param options - an object options. Options are sent from Java | ||
* | ||
* @return - nothing | ||
*/ | ||
function write(id, envelope, options) { | ||
xdmp.documentInsert(id, envelope, xdmp.defaultPermissions(), options.flow); | ||
} | ||
|
||
module.exports = write; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters