本文整理汇总了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;
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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();
}
}
}