本文整理汇总了Java中com.mendix.systemwideinterfaces.core.ISession.createContext方法的典型用法代码示例。如果您正苦于以下问题:Java ISession.createContext方法的具体用法?Java ISession.createContext怎么用?Java ISession.createContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mendix.systemwideinterfaces.core.ISession
的用法示例。
在下文中一共展示了ISession.createContext方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getContextFor
import com.mendix.systemwideinterfaces.core.ISession; //导入方法依赖的package包/类
public static IContext getContextFor(IContext context, String username, boolean sudoContext) {
if (username == null || username.isEmpty()) {
throw new RuntimeException("Assertion: No username provided");
}
ISession session = getSessionFor(context, username);
IContext c = session.createContext();
if (sudoContext) {
return c.getSudoContext();
}
return c;
}
示例2: executeAction
import com.mendix.systemwideinterfaces.core.ISession; //导入方法依赖的package包/类
@Override
public java.lang.Boolean executeAction() throws Exception
{
// BEGIN USER CODE
ISession session = getContext().getSession();
IContext newContext = session.createContext();
Core.commit(newContext, mxObject);
newContext.endTransaction();
return true;
// END USER CODE
}
示例3: getContextFor
import com.mendix.systemwideinterfaces.core.ISession; //导入方法依赖的package包/类
public static IContext getContextFor(IContext context, String username, boolean sudoContext) {
if (username == null || username.isEmpty()) {
throw new RuntimeException("Assertion: No username provided");
}
if (username.equals(context.getSession().getUser().getName()))
{
return context;
}
else
{
ISession session = getSessionFor(context, username);
IContext c = session.createContext();
if (sudoContext) {
return c.getSudoContext();
}
return c;
}
}
示例4: getContextFor
import com.mendix.systemwideinterfaces.core.ISession; //导入方法依赖的package包/类
public static IContext getContextFor(IContext context, String username, boolean sudoContext) {
if (username == null || username.isEmpty()) {
throw new RuntimeException("Assertion: No username provided");
}
// Session does not have a user when it's a scheduled event.
if (context.getSession().getUser() != null && username.equals(context.getSession().getUser().getName()))
{
return context;
}
else
{
ISession session = getSessionFor(context, username);
IContext c = session.createContext();
if (sudoContext) {
return c.createSudoClone();
}
return c;
}
}
示例5: executeAction
import com.mendix.systemwideinterfaces.core.ISession; //导入方法依赖的package包/类
@Override
public Boolean executeAction() throws Exception
{
// BEGIN USER CODE
ISession session = getContext().getSession();
IContext newContext = session.createContext();
Core.commit(newContext, mxObject);
newContext.endTransaction();
return true;
// END USER CODE
}
示例6: executeAction
import com.mendix.systemwideinterfaces.core.ISession; //导入方法依赖的package包/类
@Override
public java.lang.Boolean executeAction() throws Exception
{
// BEGIN USER CODE
ISession session = getContext().getSession();
IContext newContext = session.createContext();
Core.delete(newContext, objectList);
newContext.endTransaction();
return true;
// END USER CODE
}