本文整理汇总了Java中com.mendix.core.Core.getUser方法的典型用法代码示例。如果您正苦于以下问题:Java Core.getUser方法的具体用法?Java Core.getUser怎么用?Java Core.getUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mendix.core.Core
的用法示例。
在下文中一共展示了Core.getUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
}
示例2: initializeSessionForUser
import com.mendix.core.Core; //导入方法依赖的package包/类
private static ISession initializeSessionForUser(IContext context, String username) throws CoreException {
IUser user = Core.getUser(context, username);
if (user == null) {
throw new RuntimeException("Assertion: user with username '" + username + "' does not exist");
}
return Core.initializeSession(user, null);
}
示例3: executeAction
import com.mendix.core.Core; //导入方法依赖的package包/类
@Override
public java.lang.Boolean executeAction() throws Exception
{
// BEGIN USER CODE
IUser user = Core.getUser(getContext(), userName);
return user != null && Core.authenticate(getContext(), user, password);
// END USER CODE
}