當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。