use of com.netsteadfast.greenstep.vo.OlapCatalogVO in project bamboobsc by billchen198318.
the class AnalyticsCatalogSaveOrUpdateAction method delete.
private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
OlapCatalogVO olapCatalog = new OlapCatalogVO();
this.transformFields2ValueObject(olapCatalog, new String[] { "oid" });
DefaultResult<Boolean> result = this.analyticsCatalogLogicService.delete(olapCatalog);
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null && result.getValue()) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.OlapCatalogVO in project bamboobsc by billchen198318.
the class AnalyticsProcessAction method loadOlapCatalog.
private OlapCatalogVO loadOlapCatalog(String oid) throws ServiceException, Exception {
OlapCatalogVO catalog = new OlapCatalogVO();
catalog.setOid(oid);
DefaultResult<OlapCatalogVO> result = this.olapCatalogService.findObjectByOid(catalog);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
catalog = result.getValue();
return catalog;
}
use of com.netsteadfast.greenstep.vo.OlapCatalogVO in project bamboobsc by billchen198318.
the class AnalyticsProcessAction method exportExcel.
private void exportExcel(File catalogFile) throws ControllerException, AuthorityException, ServiceException, Exception {
this.oid = "";
this.checkFields("query");
boolean showDimensionTitle = true;
boolean showParentMembers = true;
if (!"true".equals(this.getFields().get("showDimensionTitle"))) {
showDimensionTitle = false;
}
if (!"true".equals(this.getFields().get("showParentMembers"))) {
showParentMembers = false;
}
OlapCatalogVO catalog = this.loadOlapCatalog(this.getFields().get("catalogOid"));
OlapConfVO config = this.loadOlapConfig(this.getFields().get("configOid"));
catalogFile = OlapUtils.writeCatalogContentToFile(catalog.getId() + "_" + super.getAccountOid(), new String(catalog.getContent(), Constants.BASE_ENCODING));
String mondrianUrl = OlapUtils.getMondrianUrl(config.getJdbcUrl(), config.getJdbcDrivers(), catalogFile.getPath());
File file = null;
try {
file = Pivot4JUtils.exportExcelFile(mondrianUrl, this.getFields().get("expression"), showDimensionTitle, showParentMembers);
this.oid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, true, file, "analytics-export.xlsx");
} catch (Exception e) {
throw e;
} finally {
file = null;
}
this.message = this.getText("MESSAGE.QCHARTS_PROG002D0002Q_msg1") + super.getHtmlBr();
this.success = IS_YES;
}
use of com.netsteadfast.greenstep.vo.OlapCatalogVO in project bamboobsc by billchen198318.
the class OlapCatalogServiceImpl method findForMap.
@Override
public Map<String, String> findForMap(boolean pleaseSelect) throws ServiceException, Exception {
Map<String, String> dataMap = this.providedSelectZeroDataMap(pleaseSelect);
List<OlapCatalogVO> olapCatalogs = this.olapCatalogDAO.findForSimple();
for (OlapCatalogVO catalog : olapCatalogs) {
dataMap.put(catalog.getOid(), catalog.getId() + " - " + catalog.getName());
}
return dataMap;
}
use of com.netsteadfast.greenstep.vo.OlapCatalogVO in project bamboobsc by billchen198318.
the class AnalyticsCatalogSaveOrUpdateAction method save.
private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
if (StringUtils.isBlank(this.getFields().get("uploadOid"))) {
super.throwMessage("uploadOid", this.getText("MESSAGE.QCHARTS_PROG001D0004A_uploadOid_msg3"));
}
this.checkUploadCatalog();
OlapCatalogVO olapCatalog = new OlapCatalogVO();
this.transformFields2ValueObject(olapCatalog, new String[] { "id", "name", "description" });
DefaultResult<OlapCatalogVO> result = this.analyticsCatalogLogicService.create(olapCatalog, this.getFields().get("uploadOid"));
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
Aggregations