本文整理汇总了Java中org.compiere.util.Env.CTXVALUE_AD_Client_ID_System方法的典型用法代码示例。如果您正苦于以下问题:Java Env.CTXVALUE_AD_Client_ID_System方法的具体用法?Java Env.CTXVALUE_AD_Client_ID_System怎么用?Java Env.CTXVALUE_AD_Client_ID_System使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.compiere.util.Env
的用法示例。
在下文中一共展示了Env.CTXVALUE_AD_Client_ID_System方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUserLogin
import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public void onUserLogin(final int AD_Org_ID, final int AD_Role_ID, final int AD_User_ID)
{
final Properties ctx = Env.getCtx();
final int adClientId = Env.getAD_Client_ID(ctx);
//
// Set default conversion type to context
if (adClientId > 0 && adClientId != Env.CTXVALUE_AD_Client_ID_System)
{
try
{
final Date date = Env.getDate(ctx);
final I_C_ConversionType conversionType = Services.get(ICurrencyDAO.class).retrieveDefaultConversionType(ctx, adClientId, AD_Org_ID, date);
Env.setContext(ctx, CTXNAME_C_ConversionType_ID, conversionType.getC_ConversionType_ID());
}
catch (Exception e)
{
logger.warn("Failed finding the default conversion type. Skip", e);
}
}
}
示例2: DocTypeSequence
import org.compiere.util.Env; //导入方法依赖的package包/类
private DocTypeSequence(final int adClientId, final int adOrgId, final int docSequenceId)
{
super();
this.adClientId = adClientId <= 0 ? Env.CTXVALUE_AD_Client_ID_System : adClientId;
this.adOrgId = adOrgId <= 0 ? Env.CTXVALUE_AD_Org_ID_Any : adOrgId;
if (docSequenceId <= 0)
{
throw new IllegalArgumentException("docSequenceId <= 0");
}
this.docSequenceId = docSequenceId;
}
示例3: createResetPasswordByEMailRequest
import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public void createResetPasswordByEMailRequest(final String userId)
{
final I_AD_User user = Services.get(IUserDAO.class).retrieveLoginUserByUserId(userId);
if (user.getAD_Client_ID() == Env.CTXVALUE_AD_Client_ID_System)
{
throw new AdempiereException("Reseting password for system users is not allowed");
}
createResetPasswordByEMailRequest(user);
}
示例4: addAccessToRolesWithAutomaticMaintenance
import org.compiere.util.Env; //导入方法依赖的package包/类
@ModelChange(timings = ModelValidator.TYPE_AFTER_NEW)
public void addAccessToRolesWithAutomaticMaintenance(final I_AD_Org org)
{
final int orgClientId = org.getAD_Client_ID();
int orgAccessCreatedCounter = 0;
final IUserRolePermissionsDAO permissionsDAO = Services.get(IUserRolePermissionsDAO.class);
final Properties ctx = InterfaceWrapperHelper.getCtx(org);
for (final I_AD_Role role : Services.get(IRoleDAO.class).retrieveAllRolesWithAutoMaintenance(ctx))
{
// Don't create org access for system role
if (role.getAD_Role_ID() == Env.CTXVALUE_AD_Role_ID_System)
{
continue;
}
// Don't create org access for roles which are not defined on system level nor on org's AD_Client_ID level
final int roleClientId = role.getAD_Client_ID();
if (roleClientId != orgClientId && roleClientId != Env.CTXVALUE_AD_Client_ID_System)
{
continue;
}
permissionsDAO.createOrgAccess(role.getAD_Role_ID(), org.getAD_Org_ID());
orgAccessCreatedCounter++;
}
logger.info("{} - created #{} role org access entries", org, orgAccessCreatedCounter);
// Reset role permissions, just to make sure we are on the safe side
// NOTE: not needed shall be triggered automatically
// if (orgAccessCreatedCounter > 0)
// {
// Services.get(IUserRolePermissionsDAO.class).resetCacheAfterTrxCommit();
// }
}
示例5: beforeSave
import org.compiere.util.Env; //导入方法依赖的package包/类
@ModelChange(timings = { ModelValidator.TYPE_BEFORE_NEW, ModelValidator.TYPE_BEFORE_CHANGE })
public void beforeSave(final I_AD_Role role)
{
if (role.getAD_Client_ID() == Env.CTXVALUE_AD_Client_ID_System)
{
role.setUserLevel(X_AD_Role.USERLEVEL_System);
}
else if (role.getUserLevel().equals(X_AD_Role.USERLEVEL_System))
{
throw new AdempiereException("@[email protected] @[email protected]");
}
}
示例6: getTablesToIgnoreUC
import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public Set<String> getTablesToIgnoreUC()
{
final Properties ctx = Env.getCtx();
final int adClientId = Env.getAD_Client_ID(ctx);
if (adClientId == Env.CTXVALUE_AD_Client_ID_System)
{
return _tablesIgnoreSystemRO;
}
else
{
return _tablesIgnoreClientRO;
}
}