Search in sources :

Example 6 with SysFormMethodVO

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

the class SystemFormMethodSaveOrUpdateAction method update.

private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    SysFormMethodVO method = new SysFormMethodVO();
    method.setExpression(this.getFields().get("expression").getBytes());
    this.transformFields2ValueObject(method, new String[] { "oid", "name", "resultType", "type", "description" });
    DefaultResult<SysFormMethodVO> result = this.systemFormLogicService.updateMethod(method, this.getFields().get("formOid"));
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : SysFormMethodVO(com.netsteadfast.greenstep.vo.SysFormMethodVO)

Example 7 with SysFormMethodVO

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

the class SystemFormMethodSaveOrUpdateAction method copy2Upload.

private void copy2Upload() throws ControllerException, AuthorityException, ServiceException, Exception {
    SysFormMethodVO formMethod = new SysFormMethodVO();
    this.transformFields2ValueObject(formMethod, new String[] { "oid" });
    DefaultResult<SysFormMethodVO> result = this.sysFormMethodService.findObjectByOid(formMethod);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    formMethod = result.getValue();
    this.uploadOid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, formMethod.getExpression(), formMethod.getFormId() + "_" + formMethod.getName() + "." + formMethod.getType());
    this.message = SysMessageUtil.get(GreenStepSysMsgConstants.INSERT_SUCCESS);
    this.success = IS_YES;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysFormMethodVO(com.netsteadfast.greenstep.vo.SysFormMethodVO)

Example 8 with SysFormMethodVO

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

the class SystemFormMethodSaveOrUpdateAction method updateExpression.

private void updateExpression() throws ControllerException, AuthorityException, ServiceException, Exception {
    String expression = this.getFields().get("expression");
    if (StringUtils.isBlank(expression)) {
        super.throwMessage("Expression is required!");
    }
    SysFormMethodVO formMethod = new SysFormMethodVO();
    this.transformFields2ValueObject(formMethod, new String[] { "oid" });
    DefaultResult<SysFormMethodVO> result = this.systemFormLogicService.updateMethodExpressionOnly(formMethod, expression);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : SysFormMethodVO(com.netsteadfast.greenstep.vo.SysFormMethodVO)

Aggregations

SysFormMethodVO (com.netsteadfast.greenstep.vo.SysFormMethodVO)8 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)4 AuthorityException (com.netsteadfast.greenstep.base.exception.AuthorityException)1 ControllerException (com.netsteadfast.greenstep.base.exception.ControllerException)1 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)1 SystemForm (com.netsteadfast.greenstep.base.model.SystemForm)1 SysFormVO (com.netsteadfast.greenstep.vo.SysFormVO)1 JSON (org.apache.struts2.json.annotations.JSON)1 Transactional (org.springframework.transaction.annotation.Transactional)1