当前位置: 首页>>代码示例>>Java>>正文


Java DocumentMetadataHandle.Capability方法代码示例

本文整理汇总了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;
}
 
开发者ID:marklogic,项目名称:marklogic-rdf4j,代码行数:15,代码来源:ConnectedRESTQA.java

示例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));
}
 
开发者ID:rjrudin,项目名称:ml-migration-starter,代码行数:34,代码来源:ColumnMapProcessor.java

示例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;
}
 
开发者ID:marklogic-community,项目名称:ml-javaclient-util,代码行数:8,代码来源:SimpleDocumentWriteOperation.java

示例5: setPermissions

import com.marklogic.client.io.DocumentMetadataHandle; //导入方法依赖的package包/类
public void setPermissions(Map<String, DocumentMetadataHandle.Capability[]> permissions) {
	this.permissions = permissions;
}
 
开发者ID:marklogic-community,项目名称:ml-javaclient-util,代码行数:4,代码来源:SimpleDocumentWriteOperation.java


注:本文中的com.marklogic.client.io.DocumentMetadataHandle.Capability方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。