Search in sources :

Example 6 with OlapConfVO

use of com.netsteadfast.greenstep.vo.OlapConfVO 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;
}
Also used : OlapConfVO(com.netsteadfast.greenstep.vo.OlapConfVO) OlapCatalogVO(com.netsteadfast.greenstep.vo.OlapCatalogVO)

Example 7 with OlapConfVO

use of com.netsteadfast.greenstep.vo.OlapConfVO in project bamboobsc by billchen198318.

the class AnalyticsProcessAction 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;
}
Also used : OlapConfVO(com.netsteadfast.greenstep.vo.OlapConfVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 8 with OlapConfVO

use of com.netsteadfast.greenstep.vo.OlapConfVO 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;
}
Also used : OlapConfVO(com.netsteadfast.greenstep.vo.OlapConfVO) OlapCatalogVO(com.netsteadfast.greenstep.vo.OlapCatalogVO) File(java.io.File) ControllerException(com.netsteadfast.greenstep.base.exception.ControllerException) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) AuthorityException(com.netsteadfast.greenstep.base.exception.AuthorityException)

Example 9 with OlapConfVO

use of com.netsteadfast.greenstep.vo.OlapConfVO in project bamboobsc by billchen198318.

the class AnalyticsConfigSaveOrUpdateAction method save.

private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    OlapConfVO olapConf = new OlapConfVO();
    this.transformFields2ValueObject(olapConf, new String[] { "id", "name", "jdbcDrivers", "jdbcUrl", "description" });
    DefaultResult<OlapConfVO> result = this.analyticsConfigLogicService.create(olapConf);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : OlapConfVO(com.netsteadfast.greenstep.vo.OlapConfVO)

Aggregations

OlapConfVO (com.netsteadfast.greenstep.vo.OlapConfVO)9 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)5 OlapCatalogVO (com.netsteadfast.greenstep.vo.OlapCatalogVO)4 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)2 Transactional (org.springframework.transaction.annotation.Transactional)2 AuthorityException (com.netsteadfast.greenstep.base.exception.AuthorityException)1 ControllerException (com.netsteadfast.greenstep.base.exception.ControllerException)1 OlapMdxVO (com.netsteadfast.greenstep.vo.OlapMdxVO)1 File (java.io.File)1