use of org.adempiere.service.ISysConfigBL in project metasfresh-webui-api by metasfresh.
the class ProductLookupDescriptor method isAvailableStockQueryActivatedInSysConfig.
private boolean isAvailableStockQueryActivatedInSysConfig() {
final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);
final int clientId = Env.getAD_Client_ID(Env.getCtx());
final int orgId = Env.getAD_Org_ID(Env.getCtx());
final boolean stockQueryActivated = sysConfigBL.getBooleanValue(SYSCONFIG_ATP_QUERY_ENABLED, false, clientId, orgId);
return stockQueryActivated;
}
use of org.adempiere.service.ISysConfigBL in project metasfresh-webui-api by metasfresh.
the class WEBUI_ProcessHelper method retrieveHUPIItemProductRecords.
public List<I_M_HU_PI_Item_Product> retrieveHUPIItemProductRecords(@NonNull final Properties ctx, @NonNull final I_M_Product product, @Nullable final I_C_BPartner bPartner, final boolean includeVirtualItem) {
final IHUPIItemProductDAO hupiItemProductDAO = Services.get(IHUPIItemProductDAO.class);
final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);
final boolean allowInfiniteCapacity = sysConfigBL.getBooleanValue(SYSCONFIG_ALLOW_INFINIT_CAPACITY_TUS, true, Env.getAD_Client_ID(ctx), Env.getAD_Org_ID(ctx));
final List<I_M_HU_PI_Item_Product> list = hupiItemProductDAO.retrieveTUs(ctx, product, bPartner, allowInfiniteCapacity);
if (includeVirtualItem) {
list.add(hupiItemProductDAO.retrieveVirtualPIMaterialItemProduct(ctx));
}
return list;
}
use of org.adempiere.service.ISysConfigBL in project metasfresh-webui-api by metasfresh.
the class ProductLookupDescriptor method addStorageAttributeKeysToQueryBuilder.
private void addStorageAttributeKeysToQueryBuilder(@NonNull final AvailableToPromiseQueryBuilder stockQueryBuilder) {
final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);
final int clientId = Env.getAD_Client_ID(Env.getCtx());
final int orgId = Env.getAD_Org_ID(Env.getCtx());
final String storageAttributesKeys = sysConfigBL.getValue(SYSCONFIG_ATP_ATTRIBUTES_KEYS, AttributesKey.ALL.getAsString(), clientId, orgId);
final Splitter splitter = Splitter.on(",").trimResults(CharMatcher.whitespace()).omitEmptyStrings();
for (final String storageAttributesKey : splitter.splitToList(storageAttributesKeys)) {
if ("<ALL_STORAGE_ATTRIBUTES_KEYS>".equals(storageAttributesKey)) {
stockQueryBuilder.storageAttributesKey(AttributesKey.ALL);
} else if ("<OTHER_STORAGE_ATTRIBUTES_KEYS>".equals(storageAttributesKey)) {
stockQueryBuilder.storageAttributesKey(AttributesKey.OTHER);
} else {
stockQueryBuilder.storageAttributesKey(AttributesKey.ofString(storageAttributesKey));
}
}
}
use of org.adempiere.service.ISysConfigBL in project metasfresh-webui-api by metasfresh.
the class HostKeyConfig method setupHostKeyStorage.
@PostConstruct
public void setupHostKeyStorage() {
Services.registerService(IHttpSessionProvider.class, new SpringHttpSessionProvider());
final IHostKeyBL hostKeyBL = Services.get(IHostKeyBL.class);
// when this method is called, there is not DB connection yet.
// so provide the storage implementation as a supplier when it's actually needed and when (hopefully)
// the system is ready
hostKeyBL.setHostKeyStorage(() -> {
final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);
final IHostKeyStorage hostKeyStorageImpl;
final String hostKeyStorage = sysConfigBL.getValue(PRINTING_WEBUI_HOST_KEY_STORAGE_MODE, "cookies");
if (hostKeyStorage.toLowerCase().startsWith("cookie".toLowerCase())) {
hostKeyStorageImpl = new HttpCookieHostKeyStorage();
} else {
// https://github.com/metasfresh/metasfresh/issues/1274
hostKeyStorageImpl = new SessionRemoteHostStorage();
}
return hostKeyStorageImpl;
});
}
Aggregations