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


Java Core.retrieveXPathQuery方法代码示例

本文整理汇总了Java中com.mendix.core.Core.retrieveXPathQuery方法的典型用法代码示例。如果您正苦于以下问题:Java Core.retrieveXPathQuery方法的具体用法?Java Core.retrieveXPathQuery怎么用?Java Core.retrieveXPathQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mendix.core.Core的用法示例。


在下文中一共展示了Core.retrieveXPathQuery方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTypeId

import com.mendix.core.Core; //导入方法依赖的package包/类
protected IMendixIdentifier getTypeId(IContext context, IDataType dataType) throws CoreException {
	String valueTypeName = dataType.getDSLType();
	if (dataType.getType() == DataTypeEnum.Enumeration)
		valueTypeName = "Enum";
	else if (dataType.isList())
		valueTypeName = "List of type: " + dataType.getObjectType();
	else if (dataType.isMendixObject())
		valueTypeName = "Object of type: " + dataType.getObjectType();

	List<IMendixObject> result = Core.retrieveXPathQuery(context, "//" + ValueType.getType() + "[" + ValueType.MemberNames.Name + "='" + valueTypeName + "']");
	if (result.size() > 0)
		return result.get(0).getId();

	IMendixObject memberTypeObject = Core.instantiate(context, ValueType.getType());
	memberTypeObject.setValue(context, ValueType.MemberNames.Name.toString(), valueTypeName);
	memberTypeObject.setValue(context, ValueType.MemberNames.ValueType_MxObjectType.toString(), this.getObjectTypeId(context, dataType));
	
	PrimitiveTypes type = getPrimitiveTypesFromDatatype(dataType);
	memberTypeObject.setValue(context, ValueType.MemberNames.TypeEnum.toString(), (type == null ? null : type.toString()));
	Core.commit(context, memberTypeObject);
	return memberTypeObject.getId();
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:23,代码来源:Builder.java

示例2: firstWhere

import com.mendix.core.Core; //导入方法依赖的package包/类
public static IMendixObject firstWhere(IContext c, String entityName,
		Object member, String value) throws CoreException
{
	List<IMendixObject> items = Core.retrieveXPathQuery(c, String.format("//%s[%s =  '%s']", entityName, member, value), 1, 0, new HashMap<String, String>());
	if (items == null || items.size() == 0)
		return null;
	return items.get(0);
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:9,代码来源:ORM.java

示例3: findUser

import com.mendix.core.Core; //导入方法依赖的package包/类
private static IUser findUser(IContext c, String openID) throws CoreException {
	List<IMendixObject> userList = Core.retrieveXPathQuery(c, String.format("//%s[%s='%s']", USER_ENTITY, USER_ENTITY_NAME, openID));
	
	if (userList.size() > 0) {
		IMendixObject userObject = userList.get(0);
		String username = userObject.getValue(c, DEFAULT_MENDIX_USERNAME_ATTRIBUTE);
		if (LOG.isTraceEnabled())
			LOG.trace("Getting System.User using username: '" + username + "'");
		
		return Core.getUser(c, username);
	} else {
		return null;
	}
}
 
开发者ID:mendix,项目名称:IBM-Watson-Connector-Suite,代码行数:15,代码来源:SessionInitializer.java

示例4: handleMembers

import com.mendix.core.Core; //导入方法依赖的package包/类
private void handleMembers(IContext context, IMetaObject metaObject, IMendixObject curObject) throws CoreException
{
	Map<String,IMendixObject> membersByName = new HashMap<String, IMendixObject>();
	List<IMendixObject> existingMembers = Core.retrieveXPathQuery(context, "//" + MxObjectMember.getType() + "[" + MxObjectMember.MemberNames.MxObjectMember_MxObjectType + "='" + curObject.getId().toLong() + "']");
	for(IMendixObject obj : existingMembers)
		membersByName.put((String)obj.getValue(context, MxObjectMember.MemberNames.AttributeName.toString()), obj);

	List<IMendixObject> memberList = new ArrayList<IMendixObject>();
	for(IMetaPrimitive metaPrimitive : metaObject.getMetaPrimitives())
	{
		String name = metaPrimitive.getName();
		if(metaPrimitive.getType() == PrimitiveType.Enum)
		{
			if(membersByName.containsKey(name))
			{
				IMendixObject curMember = membersByName.get(name);
				if(MxObjectEnum.getType().equals(curMember.getType()))
				{
					memberList.add(this.handleEnumMember(context, curMember, metaPrimitive, curObject));
					membersByName.remove(name);
				}
				else
				{
					Core.delete(context, curMember);
					memberList.add(this.handleEnumMember(context, null, metaPrimitive, curObject));
				}
			}
			else
				memberList.add(this.handleEnumMember(context, null, metaPrimitive, curObject));
		}
		else
		{
			processMember(context, curObject, membersByName, memberList, metaPrimitive, name);
		}
	}		
	Core.commit(context, memberList);

	this.builder.removeDeletedObjects(context, membersByName);
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:40,代码来源:MetaObjectBuilder.java

示例5: handleMicroflowParams

import com.mendix.core.Core; //导入方法依赖的package包/类
private List<IMendixObject> handleMicroflowParams(IContext context, String microflowName, IMendixObject obj) throws CoreException
{
	Map<String, IMendixObject> existingParams = new HashMap<String, IMendixObject>();
	List<IMendixObject> params = Core.retrieveXPathQuery(context, "//" + Parameter.getType() + "[" + Microflows.MemberNames.Microflows_InputParameter + "='" + obj.getId().toLong() + "']");
	for(IMendixObject param : params)
		existingParams.put((String)param.getValue(context, Parameter.MemberNames.Name.toString()), param);

	List<IMendixIdentifier> inputParameterIds = new ArrayList<IMendixIdentifier>();
	List<IMendixObject> inputParameterObjs = new ArrayList<IMendixObject>();
	for(Entry<String,IDataType> entry : Core.getInputParameters(microflowName).entrySet())
	{
		String inputParameterName = entry.getKey();
		IDataType inputParameterType = entry.getValue();

		IMendixObject parameter;
		if(existingParams.containsKey(inputParameterName))
		{
			parameter = existingParams.get(inputParameterName);
			existingParams.remove(inputParameterName);
		}
		else
			parameter = Core.instantiate(context, Parameter.getType());

		parameter.setValue(context, Parameter.MemberNames.Name.toString(), inputParameterName);
		parameter.setValue(context, Parameter.MemberNames.Parameter_ValueType.toString(), this.builder.getTypeId(context, inputParameterType));
		parameter.setValue(context, Parameter.MemberNames.Parameter_MxObjectType.toString(), this.builder.getObjectTypeId(context, inputParameterType));
		inputParameterObjs.add( parameter );
		inputParameterIds.add(parameter.getId());
	}

	obj.setValue(context, Microflows.MemberNames.Microflows_Output_Type.toString(), this.builder.getTypeId(context, Core.getReturnType(microflowName)));
	obj.setValue(context, Microflows.MemberNames.Microflows_InputParameter.toString(), inputParameterIds);

	this.builder.removeDeletedObjects(context, existingParams);
	return inputParameterObjs;
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:37,代码来源:MicroflowBuilder.java

示例6: cacheModules

import com.mendix.core.Core; //导入方法依赖的package包/类
public void cacheModules(IContext context) throws CoreException {
	List<IMendixObject> result = Core.retrieveXPathQuery(context, "//" + Module.getType());
	if (result.size() == 0)
		this.allNewModules = true;
	else {
		for (IMendixObject object : result) {
			boolean syncModule = (Boolean) object.getValue(context, Module.MemberNames.SynchronizeObjectsWithinModule.toString());
			String moduleName = (String) object.getValue(context, Module.MemberNames.ModuleName.toString());
			if (syncModule)
				this.moduleMap.put(moduleName, object);
			else
				this.moduleMap.put(moduleName, null);
		}
	}
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:16,代码来源:Builder.java

示例7: firstMendixObject

import com.mendix.core.Core; //导入方法依赖的package包/类
public IMendixObject firstMendixObject() throws CoreException {
	assertEmptyStack();
	
	List<IMendixObject> result = Core.retrieveXPathQuery(context, getXPath(), 1, offset, sorting);
	if (result.isEmpty())
		return null;
	return result.get(0);
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:9,代码来源:XPath.java

示例8: allMendixObjects

import com.mendix.core.Core; //导入方法依赖的package包/类
public List<IMendixObject> allMendixObjects() throws CoreException {
	assertEmptyStack();

	return Core.retrieveXPathQuery(context, getXPath(), limit, offset, sorting);
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:6,代码来源:XPath.java

示例9: cacheLanguageCodes

import com.mendix.core.Core; //导入方法依赖的package包/类
private void cacheLanguageCodes(IContext context) throws CoreException
{
	for(IMendixObject language :  Core.retrieveXPathQuery(context, "//" + Language.entityName))
		this.languageCodes.add(Language.initialize(context, language).getCode());
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:6,代码来源:MetaObjectBuilder.java


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