use of com.marklogic.client.io.StringHandle in project components by Talend.
the class MarkLogicWriter method patchRecord.
private void patchRecord(String docId, String docContent) {
StringHandle patchHandle = new StringHandle(docContent);
if (MarkLogicOutputProperties.DocType.JSON == docType) {
patchHandle.withFormat(Format.JSON);
} else if (MarkLogicOutputProperties.DocType.XML == docType) {
patchHandle.withFormat(Format.XML);
} else {
throw new MarkLogicException(new MarkLogicErrorCode("Cant patch for docType " + docType));
}
docMgr.patch(docId, patchHandle);
}
use of com.marklogic.client.io.StringHandle in project components by Talend.
the class MarkLogicCriteriaReader method prepareQueryOption.
private void prepareQueryOption() {
QueryOptionsManager qryOptMgr = connectionClient.newServerConfigManager().newQueryOptionsManager();
if (StringUtils.isNotEmpty(settings.queryOptionLiterals)) {
StringHandle strHandle = new StringHandle();
switch(settings.queryLiteralType) {
case "JSON":
{
strHandle.withFormat(Format.JSON);
break;
}
case "XML":
{
strHandle.withFormat(Format.XML);
break;
}
}
strHandle.set(settings.queryOptionLiterals);
qryOptMgr.writeOptions(settings.queryOptionName, strHandle);
}
}
Aggregations