0

Could not able to Import documents with custom transform module option.

I am trying to Import through mlcp as a gradle task over SSL. When I try to Run task , it is building successfully but not importing any modules.

Code:

task DeployPatterns(type: com.marklogic.gradle.task.MlcpTask) {
classpath = configurations.mlcp
command = "IMPORT"
ssl = true
port = project.mlRestPort.toInteger()
database = mlAppConfig.contentDatabaseName
input_file_type = "documents"
document_type = "xml"
input_file_path = "data/patterns/"
transform_param = "template temp"
transform_module = "/ext/mlcp/transform.xqy"
transform_namespace = "http://transform-test"
output_collections = "config, patterns"
output_permissions = "rest-reader,read,rest-writer,update"
output_uri_replace = ".*data/,'/'"

}

The Task is running successfully but not performing any import.
MarkLogic - 8.0.6-6
Gradle - 3.9.0
mlcp - 9.0.5

mpuram
  • 149
  • 9
  • Are you sure https is enabled on mlRestPort? You also don't provide a host, are you running against localhost? – grtjn Dec 10 '18 at 20:17
  • Hi @grtjn , yes the https is enabled on mlRestport and it is connecting to localhost itself. the gradle console prints the below – mpuram Dec 11 '18 at 14:35
  • IMPORT, -port, 8003, -transform_module, /ext/mlcp/transform.xqy, -document_type, xml, -output_uri_replace, .*data/,'/',-output_collections, config, patterns, -input_file_path, data/patterns/, -transform_namespace, http://transform-test, -input_file_type, documents, -output_permissions, rest-reader,read,rest-writer,update, -transform_param, template temp, -ssl, true, -database, pattern-content, -host, localhost, -username, deployuser – mpuram Dec 11 '18 at 14:37
  • Hi @grtjn I figured out the issue. The user I am using for Import needs additional privileges "hadoop-user-write" to enable use of MarkLogic as a destination/data source. I am not sure how it was working in my old version of gradle and mlcp but the latest version needs this privileges. resolved and working now. – mpuram Dec 14 '18 at 09:59

1 Answers1

0

When you use mlcp, you supply the name of a user(s) with which to interact with MarkLogic Server. If the user does not have admin privileges, then the user must have at least the privileges as below

  • import - hadoop-user-write
  • export - hadoop-user-read
  • copy - hadoop-user-read (input) , hadoop-user-write (output)
Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
mpuram
  • 149
  • 9