本文整理汇总了Java中com.marklogic.client.io.DocumentMetadataHandle.Capability方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentMetadataHandle.Capability方法的具体用法?Java DocumentMetadataHandle.Capability怎么用?Java DocumentMetadataHandle.Capability使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.marklogic.client.io.DocumentMetadataHandle
的用法示例。
在下文中一共展示了DocumentMetadataHandle.Capability方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPermissionNode
import com.marklogic.client.io.DocumentMetadataHandle; //导入方法依赖的package包/类
public static ObjectNode getPermissionNode(String roleName, DocumentMetadataHandle.Capability... cap){
ObjectMapper mapper= new ObjectMapper();
ObjectNode mNode = mapper.createObjectNode();
ArrayNode aNode = mapper.createArrayNode();
for(DocumentMetadataHandle.Capability c : cap){
ObjectNode roleNode =mapper.createObjectNode();
roleNode.put("role-name",roleName);
roleNode.put("capability", c.toString().toLowerCase());
aNode.add(roleNode);
}
mNode.withArray("permission").addAll(aNode);
return mNode;
}
示例2: process
import com.marklogic.client.io.DocumentMetadataHandle; //导入方法依赖的package包/类
@Override
public DocumentWriteOperation process(Map<String, Object> item) throws Exception {
String tableName = null;
if (item.containsKey(tableNameKey)) {
tableName = (String)item.get(tableNameKey);
item.remove(tableNameKey);
}
String thisRootLocalName = tableName != null ? tableName : rootLocalName;
String content = columnMapSerializer.serializeColumnMap(item, thisRootLocalName);
String uuid = UUID.randomUUID().toString();
String uri = "/" + thisRootLocalName + "/" + uuid + uriSuffix;
DocumentMetadataHandle metadata = new DocumentMetadataHandle();
if (collections != null) {
metadata.withCollections(collections);
}
if (tableName != null) {
metadata.withCollections(tableName);
}
if (permissions != null) {
for (int i = 0; i < permissions.length; i += 2) {
String role = permissions[i];
DocumentMetadataHandle.Capability c = DocumentMetadataHandle.Capability.valueOf(permissions[i + 1].toUpperCase());
metadata.withPermission(role, c);
}
}
return new DocumentWriteOperationImpl(DocumentWriteOperation.OperationType.DOCUMENT_WRITE,
uri, metadata, new StringHandle(content));
}
示例3: getDocumentMetadata
import com.marklogic.client.io.DocumentMetadataHandle; //导入方法依赖的package包/类
protected DocumentMetadataHandle getDocumentMetadata(T item) {
DocumentMetadataHandle metadata = new DocumentMetadataHandle();
if (collections != null) {
metadata.withCollections(collections);
}
if (permissions != null) {
for (int i = 0; i < permissions.length; i += 2) {
String role = permissions[i];
DocumentMetadataHandle.Capability c = DocumentMetadataHandle.Capability.valueOf(permissions[i + 1].toUpperCase());
metadata.withPermission(role, c);
}
}
return metadata;
}
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:15,代码来源:AbstractMarkLogicItemProcessor.java
示例4: addPermissions
import com.marklogic.client.io.DocumentMetadataHandle; //导入方法依赖的package包/类
public SimpleDocumentWriteOperation addPermissions(String role, DocumentMetadataHandle.Capability... capabilities) {
if (permissions == null) {
permissions = new HashMap<>();
}
permissions.put(role, capabilities);
return this;
}
示例5: setPermissions
import com.marklogic.client.io.DocumentMetadataHandle; //导入方法依赖的package包/类
public void setPermissions(Map<String, DocumentMetadataHandle.Capability[]> permissions) {
this.permissions = permissions;
}