use of com.netsteadfast.greenstep.base.exception.ControllerException in project bamboobsc by billchen198318.
the class CommonUploadFileAction method loadNames.
private void loadNames() throws ControllerException, AuthorityException, ServiceException, IOException, Exception {
if (StringUtils.isBlank(this.uploadOid)) {
throw new ControllerException("Upload oid is required!");
}
DefaultResult<SysUploadVO> result = this.sysUploadService.findForNoByteContent(this.uploadOid);
if (result.getValue() == null) {
this.message = result.getSystemMessage().getValue();
return;
}
SysUploadVO uploadData = result.getValue();
this.fileName = super.defaultString(uploadData.getFileName()).trim();
this.showName = super.defaultString(uploadData.getShowName()).trim();
//this.showName = StringEscapeUtils.escapeEcmaScript( this.showName );
//this.showName = StringEscapeUtils.escapeHtml4( this.showName );
this.showName = this.showName.replaceAll("'", "’").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
this.success = IS_YES;
this.message = "load success!";
if (YesNo.YES.equals(uploadData.getIsFile())) {
@SuppressWarnings("unused") File dataFile = UploadSupportUtils.getRealFile(uploadData.getOid());
this.fileExist = YesNo.YES;
dataFile = null;
} else {
this.fileExist = YesNo.YES;
}
}
use of com.netsteadfast.greenstep.base.exception.ControllerException in project bamboobsc by billchen198318.
the class CommonOrgChartAction method loadOrgChartData.
@SuppressWarnings("unchecked")
private void loadOrgChartData(String selfOid) throws ControllerException, AuthorityException, ServiceException, Exception {
String oid = super.defaultString(this.getFields().get("oid")).trim();
if (!StringUtils.isBlank(selfOid)) {
oid = selfOid;
}
if (StringUtils.isBlank(oid)) {
throw new ControllerException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
String jsonData = new String(UploadSupportUtils.getDataBytes(oid));
ObjectMapper mapper = new ObjectMapper();
this.rootData = mapper.readValue(jsonData, HashMap.class);
}
use of com.netsteadfast.greenstep.base.exception.ControllerException in project bamboobsc by billchen198318.
the class StrategyMapManagementAction method loadRecord.
private void loadRecord() throws ControllerException, ServiceException, Exception {
if (StringUtils.isBlank(this.visionOid) || super.isNoSelectId(this.visionOid)) {
throw new ControllerException(this.getText("MESSAGE.BSC_PROG002D0007Q_vision"));
}
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("strategyMapItemsForRecChain", context);
this.setPageMessage(resultObj.getMessage());
if (resultObj.getValue() instanceof StrategyMapItemsVO) {
this.divItems = ((StrategyMapItemsVO) resultObj.getValue()).getDiv();
this.cssItems = ((StrategyMapItemsVO) resultObj.getValue()).getCss();
this.conItems = ((StrategyMapItemsVO) resultObj.getValue()).getCon();
}
}
use of com.netsteadfast.greenstep.base.exception.ControllerException in project bamboobsc by billchen198318.
the class StrategyMapManagementAction method loadNew.
private void loadNew() throws ControllerException, ServiceException, Exception {
if (StringUtils.isBlank(this.visionOid) || super.isNoSelectId(this.visionOid)) {
throw new ControllerException(this.getText("MESSAGE.BSC_PROG002D0007Q_vision"));
}
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("strategyMapItemsForNewChain", context);
this.setPageMessage(resultObj.getMessage());
if (resultObj.getValue() instanceof StrategyMapItemsVO) {
this.divItems = ((StrategyMapItemsVO) resultObj.getValue()).getDiv();
this.cssItems = ((StrategyMapItemsVO) resultObj.getValue()).getCss();
}
}
use of com.netsteadfast.greenstep.base.exception.ControllerException 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;
}
Aggregations