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


Java IMendixObject.getValue方法代码示例

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


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

示例1: findUser

import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的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

示例2: cacheModules

import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的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

示例3: isTokenPresent

import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
public static boolean isTokenPresent(IContext context, String text, IMendixObject token) throws CoreException
{
	if (token == null)
	{
		throw new CoreException("The given token is empty.");
	}
	if (text == null)
	{
		throw new CoreException("The source text is empty.");
	}

	Boolean tokenOptional = (Boolean) token.getValue(context, Token.MemberNames.IsOptional.toString());
	String tokenValue = (String) token.getValue(context, Token.MemberNames.CombinedToken.toString());
	if (!Status.Valid.toString().equals(token.getValue(context, Token.MemberNames.Status.toString())))
	{
		throw new CoreException("The token: " + tokenValue + " is not valid, only valid tokens can be replaced.");
	}

	try
	{
		int tokenPosition = text.indexOf(tokenValue);
		_logger.debug("Token: " + tokenValue+" located at position: " + tokenPosition);

		return tokenOptional || tokenPosition >= 0;
	} 
	catch (Exception e)
	{
		_logger.error(e.getMessage(), e);
	}

	return tokenOptional;
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:33,代码来源:TokenReplacer.java

示例4: handleEnumMember

import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private IMendixObject handleEnumMember(IContext context, IMendixObject enumObject, IMetaPrimitive enumPrimitive, IMendixObject curObject) throws CoreException
{
	if(enumObject == null)
		enumObject = Core.instantiate(context, MxObjectEnum.getType());

	Map<String,IMendixObject> curEnumValues = new HashMap<String, IMendixObject>();
	List<IMendixIdentifier> enumValueIds = (List<IMendixIdentifier>) enumObject.getValue(context, MxObjectEnum.MemberNames.Values.toString());
	if(enumValueIds != null)
		for(IMendixObject enumValueObject : Core.retrieveIdList(context, enumValueIds))
			curEnumValues.put((String)enumValueObject.getValue(context, MxObjectEnumValue.MemberNames.Name.toString()), enumValueObject);

	List<IMendixIdentifier> valueIds = new ArrayList<IMendixIdentifier>();
	List<IMendixObject> valueObjs = new ArrayList<IMendixObject>();
	

	List<IMendixIdentifier> captionIds = new ArrayList<IMendixIdentifier>();
	List<IMendixObject> captionObjs = new ArrayList<IMendixObject>();
	for(IMetaEnumValue metaEnumValue : enumPrimitive.getEnumValues())
	{
		IMendixObject enumValue = null;
		if(curEnumValues.containsKey(metaEnumValue.getIdentifier()))
			enumValue = curEnumValues.get(metaEnumValue.getIdentifier());
		else
			enumValue = Core.instantiate(context, MxObjectEnumValue.getType());

		Map<String,IMendixObject> curEnumCaptions = new HashMap<String, IMendixObject>();
		List<IMendixIdentifier> enumCaptionIds = (List<IMendixIdentifier>) enumValue.getValue(context, MxObjectEnumValue.MemberNames.Captions.toString());
		if(enumCaptionIds != null )
			for(IMendixObject enumCaptionObject : Core.retrieveIdList(context, enumCaptionIds))
				curEnumCaptions.put((String)enumCaptionObject.getValue(context, MxObjectEnumCaptions.MemberNames.LanguageCode.toString()), enumCaptionObject);

		IMendixObject enumCaption;
		for(String languageCode : this.languageCodes)
		{
			if(curEnumCaptions.containsKey(languageCode))
				enumCaption = curEnumCaptions.get(languageCode);
			else
				enumCaption = Core.instantiate(context, MxObjectEnumCaptions.getType());

			enumCaption.setValue(context, MxObjectEnumCaptions.MemberNames.Caption.toString(), Core.getInternationalizedString(languageCode, metaEnumValue.getI18NCaptionKey()));
			enumCaption.setValue(context, MxObjectEnumCaptions.MemberNames.LanguageCode.toString(), languageCode);
			captionObjs.add(enumCaption);
			captionIds.add(enumCaption.getId());
		}

		enumValue.setValue(context, MxObjectEnumValue.MemberNames.Name.toString(), metaEnumValue.getIdentifier());
		enumValue.setValue(context, MxObjectEnumValue.MemberNames.Captions.toString(), captionIds);
		Core.commit(context, captionObjs);
		captionObjs.clear();
		captionIds.clear();
		valueIds.add(enumValue.getId());
		valueObjs.add(enumValue);
	}
	
	enumObject.setValue(context, MxObjectEnum.MemberNames.Values.toString(), valueIds);
	enumObject.setValue(context, MxObjectMember.MemberNames.AttributeName.toString(), enumPrimitive.getName());
	enumObject.setValue(context, MxObjectMember.MemberNames.AttributeType.toString(), enumPrimitive.getType().toString());
	enumObject.setValue(context, MxObjectMember.MemberNames.AttributeTypeEnum.toString(), PrimitiveTypes.EnumType.toString());
	enumObject.setValue(context, MxObjectMember.MemberNames.MxObjectMember_MxObjectType.toString(), curObject.getId());
	enumObject.setValue(context, MxObjectMember.MemberNames.MxObjectMember_Type.toString(), this.builder.getTypeId(context,
			Core.createDataType(enumPrimitive.getParent().getName(), enumPrimitive.getName())
	));
	
	
	Core.commit(context, valueObjs);
	valueObjs.clear();
	valueIds.clear();
	
	
	return enumObject;
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:73,代码来源:MetaObjectBuilder.java

示例5: hmset

import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
public String hmset(IContext context, String Key, IMendixObject HashMapObject) {
	try {
		_logNode.debug("HMSET " + Key);
		redis = pool.getResource();
		setDatabase();
		Map<String, String> hashMap = new HashMap<String, String>();
		Map<String, ? extends IMendixObjectMember<?>> members = HashMapObject.getMembers(context);

		for (String key : members.keySet()) {
			IMendixObjectMember<?> m = members.get(key);
			if (m.isVirtual() || m instanceof MendixAutoNumber || HashMapObject.getValue(context, key) == null) {
				continue;
			}
			if (m instanceof MendixDateTime) {
				hashMap.put(key, processDate(context, (Date) HashMapObject.getValue(context, key),
						((MendixDateTime) m).shouldLocalize()));
				continue;
			}
			if (m instanceof MendixInteger) {
				hashMap.put(key, Integer.toString((int) (HashMapObject.getValue(context, key))));
				continue;
			}
			if (m instanceof MendixDecimal) {
				hashMap.put(key, ((BigDecimal) (HashMapObject.getValue(context, key))).toString());
				continue;
			}
			if (m instanceof MendixEnum) {
				hashMap.put(key, HashMapObject.getValue(context, key).toString());
				continue;
			}
			if (m instanceof MendixBoolean) {
				hashMap.put(key, Boolean.toString((boolean) (HashMapObject.getValue(context, key))));
				continue;
			}
			if (m instanceof MendixLong) {
				hashMap.put(key, Long.toString((long) (HashMapObject.getValue(context, key))));
				continue;
			}
			if (((!(m instanceof MendixObjectReference) && !(m instanceof MendixObjectReferenceSet)))) {
				hashMap.put(key, HashMapObject.getValue(context, key).toString());
			}
		}
		return redis.hmset(Key, hashMap);
	} catch (JedisConnectionException e) {
		if (redis != null) {
			redis.close();
		}
		throw e;
	} finally {
		if (redis != null) {
			redis.close();
		}
	}
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:55,代码来源:RedisConnector.java


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