Search in sources :

Example 6 with OlapCatalogVO

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

Example 7 with OlapCatalogVO

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

Example 8 with OlapCatalogVO

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;
}
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 OlapCatalogVO

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

Example 10 with OlapCatalogVO

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

Aggregations

OlapCatalogVO (com.netsteadfast.greenstep.vo.OlapCatalogVO)10 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)5 OlapConfVO (com.netsteadfast.greenstep.vo.OlapConfVO)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