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


Java Env.CTXVALUE_AD_Client_ID_System方法代码示例

本文整理汇总了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);
		}
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:23,代码来源:AcctModuleInterceptor.java

示例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;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:12,代码来源:DocTypeSequenceMap.java

示例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);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:11,代码来源:UserBL.java

示例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();
	// }
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:36,代码来源:AD_Org.java

示例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]");
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:13,代码来源:AD_Role.java

示例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;
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:15,代码来源:MigrationLogger.java


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