use of com.haulmont.cuba.core.global.Configuration in project cuba by cuba-platform.
the class JmxLogControl method getLogFileLink.
@Override
public String getLogFileLink(String fileName) throws LogControlException {
// check log file exists
logControl.getLogFile(fileName);
Configuration configuration = AppBeans.get(Configuration.NAME);
GlobalConfig globalConfig = configuration.getConfig(GlobalConfig.class);
String encodedFileName = URLEncodeUtils.encodeUtf8(fileName);
return globalConfig.getDispatcherBaseUrl() + "/log/" + encodedFileName;
}
use of com.haulmont.cuba.core.global.Configuration in project cuba by cuba-platform.
the class DesktopAbstractUploadComponent method getActualFileSizeLimit.
protected long getActualFileSizeLimit() {
final long maxSize;
if (fileSizeLimit > 0) {
maxSize = fileSizeLimit;
} else {
Configuration configuration = AppBeans.get(Configuration.NAME);
final long maxUploadSizeMb = configuration.getConfig(ClientConfig.class).getMaxUploadSizeMb();
maxSize = maxUploadSizeMb * BYTES_IN_MEGABYTE;
}
return maxSize;
}
use of com.haulmont.cuba.core.global.Configuration in project cuba by cuba-platform.
the class DesktopAbstractUploadField method getFileSizeLimitString.
protected String getFileSizeLimitString() {
String fileSizeLimitString;
if (fileSizeLimit > 0) {
if (fileSizeLimit % BYTES_IN_MEGABYTE == 0) {
fileSizeLimitString = String.valueOf(fileSizeLimit / BYTES_IN_MEGABYTE);
} else {
Datatype<Double> doubleDatatype = Datatypes.getNN(Double.class);
double fileSizeInMb = fileSizeLimit / ((double) BYTES_IN_MEGABYTE);
fileSizeLimitString = doubleDatatype.format(fileSizeInMb);
}
} else {
Configuration configuration = AppBeans.get(Configuration.NAME);
fileSizeLimitString = String.valueOf(configuration.getConfig(ClientConfig.class).getMaxUploadSizeMb());
}
return fileSizeLimitString;
}
use of com.haulmont.cuba.core.global.Configuration in project cuba by cuba-platform.
the class DesktopAbstractUploadField method getActualFileSizeLimit.
protected long getActualFileSizeLimit() {
final long maxSize;
if (fileSizeLimit > 0) {
maxSize = fileSizeLimit;
} else {
Configuration configuration = AppBeans.get(Configuration.NAME);
final long maxUploadSizeMb = configuration.getConfig(ClientConfig.class).getMaxUploadSizeMb();
maxSize = maxUploadSizeMb * BYTES_IN_MEGABYTE;
}
return maxSize;
}
use of com.haulmont.cuba.core.global.Configuration in project cuba by cuba-platform.
the class TopLevelFrame method initUI.
protected void initUI() {
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
glassPane = new DisabledGlassPane();
JRootPane rootPane = SwingUtilities.getRootPane(this);
rootPane.setGlassPane(glassPane);
Configuration configuration = AppBeans.get(Configuration.NAME);
DesktopConfig config = configuration.getConfig(DesktopConfig.class);
DesktopResources resources = App.getInstance().getResources();
if (StringUtils.isNotEmpty(config.getWindowIcon())) {
setIconImage(resources.getImage(config.getWindowIcon()));
}
}
Aggregations