use of org.meveo.admin.exception.BusinessException in project meveo by meveo-org.
the class BaseCrudBean method exportXML.
public StreamedContent exportXML() throws IOException, MeveoApiException, BusinessException {
if (baseCrudApi == null) {
throw new BusinessException(getClass().getSimpleName() + " is not using a base crud api");
}
PaginationConfiguration configuration = new PaginationConfiguration(super.getFilters());
File exportXML = baseCrudApi.exportXML(configuration);
DefaultStreamedContent defaultStreamedContent = new DefaultStreamedContent();
defaultStreamedContent.setContentEncoding("UTF-8");
defaultStreamedContent.setContentType("application/xml");
defaultStreamedContent.setStream(new FileInputStream(exportXML));
defaultStreamedContent.setName(exportXML.getName());
return defaultStreamedContent;
}
use of org.meveo.admin.exception.BusinessException in project meveo by meveo-org.
the class BaseCrudBean method exportJSON.
public StreamedContent exportJSON() throws IOException, BusinessException, MeveoApiException {
if (baseCrudApi == null) {
baseCrudApi = getBaseCrudApi();
}
if (baseCrudApi == null) {
throw new BusinessException(getClass().getSimpleName() + " is not using a base crud api");
}
PaginationConfiguration configuration = new PaginationConfiguration(getFilters());
File exportJSON = baseCrudApi.exportJSON(configuration);
DefaultStreamedContent defaultStreamedContent = new DefaultStreamedContent();
defaultStreamedContent.setContentEncoding("UTF-8");
defaultStreamedContent.setContentType("application/json");
defaultStreamedContent.setStream(new FileInputStream(exportJSON));
defaultStreamedContent.setName(exportJSON.getName());
return defaultStreamedContent;
}
use of org.meveo.admin.exception.BusinessException in project meveo by meveo-org.
the class FilterCustomFieldSearchBean method buildFilterParameters.
public void buildFilterParameters(Map<String, Object> filters) {
if (filters != null && filters.containsKey("$FILTER")) {
Filter entity = (Filter) filters.get("$FILTER");
try {
Map<CustomFieldTemplate, Object> parameterMap = customFieldDataEntryBean.loadCustomFieldsFromGUI(entity);
filters.put("$FILTER_PARAMETERS", parameterMap);
} catch (BusinessException e) {
log.error("Failed to load search parameters from custom fields.", e);
messages.error(e.getMessage());
}
}
}
use of org.meveo.admin.exception.BusinessException in project meveo by meveo-org.
the class UserBean method generateKey.
public void generateKey() {
try {
String username = entity.getUserName();
userApi.generateShKey(username, this.getPassphrase());
initEntity(entity.getId());
messages.info(new BundleKey("messages", "user.generate.successful"));
} catch (BusinessException e) {
messages.error(new BundleKey("messages", "user.generate.error"));
}
}
use of org.meveo.admin.exception.BusinessException in project meveo by meveo-org.
the class MeveoInstanceBean method synchRemoteRepositories.
@ActionMethod
public void synchRemoteRepositories() {
try {
Response response = meveoInstanceService.getRemoteRepositories("api/rest/mavenConfiguration", entity);
MavenConfigurationResponseDto result = response.readEntity(MavenConfigurationResponseDto.class);
mavenConfigurationService.updateRepository(result.getMavenConfiguration().getMavenRepositories());
messages.info(new BundleKey("messages", "meveoInstance.remoteRepository.synch.ok"));
} catch (BusinessException e) {
messages.error(new BundleKey("messages", "meveoInstance.remoteRepository.synch.ko"));
}
}
Aggregations