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


Java Env.getAD_Language方法代码示例

本文整理汇总了Java中org.compiere.util.Env.getAD_Language方法的典型用法代码示例。如果您正苦于以下问题:Java Env.getAD_Language方法的具体用法?Java Env.getAD_Language怎么用?Java Env.getAD_Language使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.compiere.util.Env的用法示例。


在下文中一共展示了Env.getAD_Language方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: completeOrder

import org.compiere.util.Env; //导入方法依赖的package包/类
private void completeOrder(final MOrder order, final ILoggable process)
{
	if (order == null)
	{
		return;
	}

	if (order.processIt(X_C_Order.DOCACTION_Complete))
	{
		order.saveEx();
		Loggables.get().withLogger(logger, Level.INFO).addLog("@[email protected] @[email protected] " + order.getDocumentNo());
	}
	else
	{
		throw new AdempiereException(
				Env.getAD_Language(order.getCtx()),
				OLCandBL.MSG_OL_CAND_PROCESSOR_ORDER_COMPLETION_FAILED_2P,
				new Object[] { order.getDocumentNo(), order.getProcessMsg() });
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:21,代码来源:OLCandBL.java

示例2: updateDataEntry

import org.compiere.util.Env; //导入方法依赖的package包/类
@ModelChange(
		timings = { ModelValidator.TYPE_BEFORE_CHANGE },
		ifColumnsChanged = {I_C_Order.COLUMNNAME_DateOrdered} )
public void updateDataEntry(final I_C_Order order)
{
	final IOrderDAO orderDAO = Services.get(IOrderDAO.class);
	final IInvoiceCandDAO invoiceCandDB = Services.get(IInvoiceCandDAO.class);
	final Properties ctx = InterfaceWrapperHelper.getCtx(order);

	for (final I_C_OrderLine ol : orderDAO.retrieveOrderLines(order, I_C_OrderLine.class))
	{
		for (final I_C_Invoice_Candidate icOfOl : invoiceCandDB.retrieveReferencing(ol))
		{
			if (icOfOl.isToClear())
			{
				throw new AdempiereException(Env.getAD_Language(ctx), MSG_ORDER_DATE_ORDERED_CHANGE_FORBIDDEN_1P, new Object[] { ol.getLine() });
			}
		}
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:21,代码来源:C_Order.java

示例3: getWarehouseId

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public int getWarehouseId(final I_C_Flatrate_Term term)
{
	final Properties ctx = InterfaceWrapperHelper.getCtx(term);

	final int warehouseId;
	if (term.getC_OrderLine_Term_ID() > 0)
	{
		warehouseId = term.getC_OrderLine_Term().getM_Warehouse_ID();
	}
	else
	{
		final List<I_M_Warehouse> warehousesForOrg = Services.get(IWarehouseDAO.class).retrieveForOrg(ctx, term.getAD_Org_ID());
		if (warehousesForOrg.size() == 0)
		{
			throw new AdempiereException(
					"de.metas.flatrate.Org.Warehouse_Missing",
					Env.getAD_Language(ctx),
					new Object[] { msgBL.translate(ctx, I_AD_Org.COLUMNNAME_AD_Org_ID), InterfaceWrapperHelper.loadOutOfTrx(term.getAD_Org_ID(), I_AD_Org.class) });
		}
		warehouseId = warehousesForOrg.get(0).getM_Warehouse_ID();
	}
	return warehouseId;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:25,代码来源:FlatrateBL.java

示例4: getProcessData

import org.compiere.util.Env; //导入方法依赖的package包/类
public KeyNamePair[] getProcessData()
	{
		// Processes
		final IUserRolePermissions role = Env.getUserRolePermissions(); // metas
//		int AD_Role_ID = Env.getAD_Role_ID(Env.getCtx());

		boolean trl = !Env.isBaseLanguage(Env.getCtx(), "AD_Process");
		String lang = Env.getAD_Language(Env.getCtx());
		// TODO: ASP - implement process and window access ASP control
		String sql = "SELECT DISTINCT p.AD_Process_ID,"
				+ (trl ? "trl.Name" : "p.Name ")
			+ " FROM AD_Process p INNER JOIN AD_Process_Access pa ON (p.AD_Process_ID=pa.AD_Process_ID) "
			+ (trl ? "LEFT JOIN AD_Process_Trl trl on (trl.AD_Process_ID=p.AD_Process_ID and trl.AD_Language=" + DB.TO_STRING(lang) + ")" : "")
			+ " WHERE "+role.getIncludedRolesWhereClause("pa.AD_Role_ID", null) // metas: use included roles
			+ " AND p.IsReport='Y' AND p.IsActive='Y' AND pa.IsActive='Y' "
			+ "ORDER BY 2";
		return DB.getKeyNamePairs(sql, true);
	}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:19,代码来源:Archive.java

示例5: translate

import org.compiere.util.Env; //导入方法依赖的package包/类
public static <T> T translate(final T model, final Class<T> cl, String trlAdLanguage)
{
	final PO po = getStrictPO(model);

	if (trlAdLanguage == null)
	{
		final Properties ctx = getCtx(model);
		trlAdLanguage = Env.getAD_Language(ctx);
	}
	if (Env.isBaseLanguage(trlAdLanguage, po.get_TableName()))
	{
		// no need to translate because context language is same as base language
		trlAdLanguage = null;
	}

	final boolean useOldValues = false;
	return create(po, cl, useOldValues, trlAdLanguage);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:19,代码来源:POWrapper.java

示例6: newInstanceFromCurrentContext

import org.compiere.util.Env; //导入方法依赖的package包/类
public static final ViewEvaluationCtx newInstanceFromCurrentContext()
{
	final Properties ctx = Env.getCtx();
	final String adLanguage = Env.getAD_Language(ctx);
	final UserRolePermissionsKey permissionsKey = UserRolePermissionsKey.of(ctx);
	return new ViewEvaluationCtx(adLanguage, permissionsKey);
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:8,代码来源:ViewEvaluationCtx.java

示例7: getActions

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * @return the actions that are available according to which row is currently selected and to also according to whether there are already existing TUs or LUs in the context.
 */
public final LookupValuesList getActions(final int processId)
{
	final Set<String> allowedActions = new HashSet<>();

	final HUEditorRow huRow = getSelectedRow();
	if (huRow.isCU())
	{
		allowedActions.addAll(getActionTypesForCUs());
	}

	else if (huRow.isTU())
	{
		allowedActions.addAll(getActionTypesForTUs());
	}

	else if (huRow.isLU())
	{
		allowedActions.add(ActionType.LU_Set_Ownership.toString());
	}

	final IADProcessDAO adProcessDAO = Services.get(IADProcessDAO.class);
	final I_AD_Process_Para processParameter = adProcessDAO.retriveProcessParameter(Env.getCtx(), processId, WEBUI_M_HU_Transform.PARAM_Action);
	final int actionsReferenceId = processParameter.getAD_Reference_Value_ID();
	final Collection<ADRefListItem> allActiveActionItems = adReferenceDAO.retrieveListItems(actionsReferenceId);

	final String adLanguage = Env.getAD_Language();

	return allActiveActionItems.stream()
			.filter(item -> allowedActions.contains(item.getValueName()))
			.map(item -> StringLookupValue.of(item.getValueName(), item.getName()))
			.sorted(Comparator.comparing(lookupValue -> lookupValue.getDisplayName(adLanguage)))
			.collect(LookupValuesList.collect());
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:37,代码来源:WebuiHUTransformParametersFiller.java

示例8: build

import org.compiere.util.Env; //导入方法依赖的package包/类
public LookupDataSourceContext build()
{
	//
	// Pre-build preparations
	{
		//
		// Standard values, needed by each query
		final Properties ctx = Env.getCtx();
		final String adLanguage = Env.getAD_Language(ctx);
		final String permissionsKey = UserRolePermissionsKey.toPermissionsKeyString(ctx);
		putValue(PARAM_AD_Language, adLanguage);
		putValue(PARAM_UserRolePermissionsKey, permissionsKey);
	}

	//
	// Collect all values required for given query
	// failIfNotFound=true
	collectContextValues(getRequiredParameters(), true);

	//
	// Collect all values required by the post-query predicate
	// failIfNotFound=false because it might be that NOT all postQueryPredicate's parameters are mandatory!
	collectContextValues(CtxNames.parseAll(postQueryPredicate.getParameters()), false);

	//
	// Build the effective context
	return new LookupDataSourceContext(lookupTableName, valuesCollected, idToFilter, postQueryPredicate);
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:29,代码来源:LookupDataSourceContext.java

示例9: ofLookupValue

import org.compiere.util.Env; //导入方法依赖的package包/类
public static final JSONLookupValue ofLookupValue(final LookupValue lookupValue)
{
	final String id = lookupValue.getIdAsString();

	final ITranslatableString displayNameTrl = lookupValue.getDisplayNameTrl();
	final String adLanguage = Env.getAD_Language(Env.getCtx()); // FIXME add it as parameter!
	final String displayName = displayNameTrl.translate(adLanguage);

	return new JSONLookupValue(id, displayName, lookupValue.getAttributes());
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:11,代码来源:JSONLookupValue.java

示例10: getTextSnippext

import org.compiere.util.Env; //导入方法依赖的package包/类
public String getTextSnippext(String AD_Language)
{
	if (AD_Language == null)
	{
		AD_Language = Env.getAD_Language(getCtx());
	}
	return get_Translation(COLUMNNAME_TextSnippext, AD_Language);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:9,代码来源:MADBoilerPlate.java

示例11: retrieveDocActionItemsIndexedByValue

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public final Map<String, IDocActionItem> retrieveDocActionItemsIndexedByValue()
{
	final IADReferenceDAO referenceDAO = Services.get(IADReferenceDAO.class);
	final Properties ctx = Env.getCtx();
	final String adLanguage = Env.getAD_Language(ctx);

	final Map<String, IDocActionItem> docActionItemsByValue = referenceDAO.retrieveListItems(X_C_Order.DOCACTION_AD_Reference_ID) // 135
			.stream()
			.map(adRefListItem -> new DocActionItem(adRefListItem, adLanguage))
			.sorted(Comparator.comparing(DocActionItem::toString))
			.collect(GuavaCollectors.toImmutableMapByKey(IDocActionItem::getValue));
	return docActionItemsByValue;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:15,代码来源:AbstractDocumentBL.java

示例12: buildMsg

import org.compiere.util.Env; //导入方法依赖的package包/类
private static String buildMsg(Properties ctx, boolean isSOTrx, I_M_AttributeValue attributeValue, final String referenceName)
{
	final String transactionType = Services.get(IMsgBL.class).getMsg(ctx, (isSOTrx ? MSG_SOTransaction : MSG_POTransaction));

	final String adLanguage = Env.getAD_Language(ctx);
	return Services.get(IMsgBL.class).getMsg(adLanguage,
			MSG,
			new Object[] { attributeValue.getM_Attribute().getName(), referenceName, transactionType });
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:10,代码来源:AttributeRestrictedException.java

示例13: buildCacheKey

import org.compiere.util.Env; //导入方法依赖的package包/类
private static final ArrayKey buildCacheKey(final Properties ctx)
{
	return new ArrayKey(
			Env.getAD_Client_ID(ctx),
			Env.getAD_Role_ID(ctx),
			Env.getAD_User_ID(ctx),
			Env.getAD_Language(ctx));
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:9,代码来源:CacheCtxParamDescriptor.java

示例14: getAD_Language

import org.compiere.util.Env; //导入方法依赖的package包/类
public String getAD_Language()
{
	// TODO: introduce AD_Language as parameter
	return Env.getAD_Language(getCtx());
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:6,代码来源:SqlDocumentQueryBuilder.java

示例15: updateCandidates

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public List<I_C_Invoice_Candidate> updateCandidates(final I_C_Flatrate_DataEntry dataEntry)
{
	final Properties ctx = InterfaceWrapperHelper.getCtx(dataEntry);
	final String trxName = InterfaceWrapperHelper.getTrxName(dataEntry);

	final String wc = I_C_Invoice_Candidate.COLUMNNAME_DateOrdered + " >= ? AND "
			+ I_C_Invoice_Candidate.COLUMNNAME_DateOrdered + " <= ? AND "
			+ " NOT EXISTS ( "
			+ "     select 1 from " + I_C_Invoice_Clearing_Alloc.Table_Name + " ica "
			+ "     where ica." + I_C_Invoice_Clearing_Alloc.COLUMNNAME_C_Invoice_Cand_ToClear_ID + "="
			+ I_C_Invoice_Candidate.Table_Name + "." + I_C_Invoice_Candidate.COLUMNNAME_C_Invoice_Candidate_ID
			+ " )";

	final I_C_Period period = dataEntry.getC_Period();
	final List<I_C_Invoice_Candidate> cands = new Query(ctx, I_C_Invoice_Candidate.Table_Name, wc, trxName)
			.setParameters(
					period.getStartDate(), period.getEndDate())
			.setOnlyActiveRecords(true)
			.setClient_ID()
			.setOrderBy(I_C_Invoice_Candidate.COLUMNNAME_C_Invoice_Candidate_ID)
			.list(I_C_Invoice_Candidate.class);

	final StringBuffer processedCands = new StringBuffer();

	for (final I_C_Invoice_Candidate cand : cands)
	{
		final I_C_Flatrate_Term term = retrieveNonSimTermOrNull(cand);
		if (term == null || term.getC_Flatrate_Term_ID() != dataEntry.getC_Flatrate_Term_ID())
		{
			continue;
		}

		if (cand.isProcessed() && cand.getQtyInvoiced().signum() != 0)
		{
			if (processedCands.length() > 0)
			{
				processedCands.append(", ");
			}
			processedCands.append(cand.getC_Invoice_Candidate_ID());
			continue;
		}

		final I_C_Invoice_Clearing_Alloc ica = InterfaceWrapperHelper.create(ctx, I_C_Invoice_Clearing_Alloc.class, trxName);
		ica.setAD_Org_ID(cand.getAD_Org_ID());

		ica.setC_Invoice_Cand_ToClear_ID(cand.getC_Invoice_Candidate_ID());
		ica.setC_Flatrate_Term_ID(term.getC_Flatrate_Term_ID());
		ica.setC_Flatrate_DataEntry_ID(dataEntry.getC_Flatrate_DataEntry_ID());
		InterfaceWrapperHelper.save(ica);

		cand.setIsToClear(true);
		InterfaceWrapperHelper.save(cand);
	}

	if (processedCands.length() > 0)
	{
		throw new AdempiereException(
				Env.getAD_Language(ctx),
				MSP_DATA_ENTRY_ERROR_INVOICE_CAND_PROCESSED_3P,
				new Object[] { dataEntry.getC_UOM().getName(), dataEntry.getC_Period().getName(), processedCands.toString() });
	}

	return null;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:66,代码来源:FlatrateDAO.java


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