use of com.netsteadfast.greenstep.vo.OlapCatalogVO in project bamboobsc by billchen198318.
the class AnalyticsMDXLogicServiceImpl method update.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<OlapMdxVO> update(OlapMdxVO olapMdx, String configOid, String catalogOid) throws ServiceException, Exception {
if (null == olapMdx || super.isNoSelectId(configOid) || super.isNoSelectId(catalogOid) || super.isBlank(olapMdx.getName()) || super.isBlank(olapMdx.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<OlapMdxVO> oldResult = this.olapMdxService.findObjectByOid(olapMdx);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
// 查資料是否存在
OlapConfVO config = this.loadOlapConfig(configOid);
// 查資料是否存在
OlapCatalogVO catalog = this.loadOlapCatalog(catalogOid);
olapMdx.setConfOid(config.getOid());
olapMdx.setCatalogOid(catalog.getOid());
if (olapMdx.getName().equals(oldResult.getValue().getName()) && !olapMdx.getOid().equals(oldResult.getValue().getOid())) {
// 存在別筆資料但UK相同 , 所以不能 UPDATE
throw new ServiceException("Please change another name!");
}
oldResult.getValue().setExpression(null);
// 先把BLOB 資料清掉
this.olapMdxService.updateObject(oldResult.getValue());
return this.olapMdxService.updateObject(olapMdx);
}
use of com.netsteadfast.greenstep.vo.OlapCatalogVO in project bamboobsc by billchen198318.
the class AnalyticsMDXLogicServiceImpl method create.
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<OlapMdxVO> create(OlapMdxVO olapMdx, String configOid, String catalogOid) throws ServiceException, Exception {
if (null == olapMdx || super.isNoSelectId(configOid) || super.isNoSelectId(catalogOid) || super.isBlank(olapMdx.getName())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
// 查資料是否存在
OlapConfVO config = this.loadOlapConfig(configOid);
// 查資料是否存在
OlapCatalogVO catalog = this.loadOlapCatalog(catalogOid);
olapMdx.setConfOid(config.getOid());
olapMdx.setCatalogOid(catalog.getOid());
return this.olapMdxService.saveObject(olapMdx);
}
use of com.netsteadfast.greenstep.vo.OlapCatalogVO in project bamboobsc by billchen198318.
the class AnalyticsMDXLogicServiceImpl 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 AnalyticsCatalogSaveOrUpdateAction method update.
private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
this.checkUploadCatalog();
OlapCatalogVO olapCatalog = new OlapCatalogVO();
this.transformFields2ValueObject(olapCatalog, new String[] { "oid", "id", "name", "description" });
DefaultResult<OlapCatalogVO> result = this.analyticsCatalogLogicService.update(olapCatalog, this.getFields().get("uploadOid"));
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.OlapCatalogVO in project bamboobsc by billchen198318.
the class AnalyticsProcessAction method rendererHtml.
private void rendererHtml(File catalogFile) throws ControllerException, AuthorityException, ServiceException, Exception {
this.content = "";
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());
this.content = Pivot4JUtils.rendererHtml(mondrianUrl, this.getFields().get("expression"), showDimensionTitle, showParentMembers);
this.message = this.getText("MESSAGE.QCHARTS_PROG002D0002Q_msg1") + super.getHtmlBr();
this.success = IS_YES;
}
Aggregations