use of com.netsteadfast.greenstep.vo.OlapConfVO 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.OlapConfVO 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.OlapConfVO in project bamboobsc by billchen198318.
the class AnalyticsMDXLogicServiceImpl method loadOlapConfig.
private OlapConfVO loadOlapConfig(String oid) throws ServiceException, Exception {
OlapConfVO conf = new OlapConfVO();
conf.setOid(oid);
DefaultResult<OlapConfVO> result = this.olapConfService.findObjectByOid(conf);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
conf = result.getValue();
return conf;
}
use of com.netsteadfast.greenstep.vo.OlapConfVO in project bamboobsc by billchen198318.
the class AnalyticsConfigSaveOrUpdateAction method update.
private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
OlapConfVO olapConf = new OlapConfVO();
this.transformFields2ValueObject(olapConf, new String[] { "oid", "id", "name", "jdbcDrivers", "jdbcUrl", "description" });
DefaultResult<OlapConfVO> result = this.analyticsConfigLogicService.update(olapConf);
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.OlapConfVO in project bamboobsc by billchen198318.
the class AnalyticsConfigSaveOrUpdateAction method delete.
private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
OlapConfVO olapConf = new OlapConfVO();
this.transformFields2ValueObject(olapConf, new String[] { "oid" });
DefaultResult<Boolean> result = this.analyticsConfigLogicService.delete(olapConf);
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null && result.getValue()) {
this.success = IS_YES;
}
}
Aggregations