Search in sources :

Example 1 with SysFormTemplateVO

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

the class SystemFormUtils method findTemplate.

public static SysFormTemplateVO findTemplate(String templateId) throws ServiceException, Exception {
    SysFormTemplateVO template = new SysFormTemplateVO();
    template.setTplId(templateId);
    DefaultResult<SysFormTemplateVO> result = sysFormTemplateService.findByUK(template);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    template = result.getValue();
    //this.writePage(template);		
    return template;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysFormTemplateVO(com.netsteadfast.greenstep.vo.SysFormTemplateVO)

Example 2 with SysFormTemplateVO

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

the class SystemFormTemplateSaveOrUpdateAction method updateContent.

private void updateContent() throws ControllerException, AuthorityException, ServiceException, Exception {
    SysFormTemplateVO template = new SysFormTemplateVO();
    this.transformFields2ValueObject(template, new String[] { "oid" });
    DefaultResult<SysFormTemplateVO> result = this.systemFormLogicService.updateTemplateContentOnly(template, this.getFields().get("content"));
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : SysFormTemplateVO(com.netsteadfast.greenstep.vo.SysFormTemplateVO)

Example 3 with SysFormTemplateVO

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

the class SystemFormTemplateSaveOrUpdateAction method delete.

private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
    SysFormTemplateVO template = new SysFormTemplateVO();
    this.transformFields2ValueObject(template, new String[] { "oid" });
    DefaultResult<Boolean> result = this.systemFormLogicService.deleteTemplate(template);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null && result.getValue()) {
        this.success = IS_YES;
    }
}
Also used : SysFormTemplateVO(com.netsteadfast.greenstep.vo.SysFormTemplateVO)

Example 4 with SysFormTemplateVO

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

the class SystemFormLogicServiceImpl method create.

@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysFormVO> create(SysFormVO form, String templateOid) throws ServiceException, Exception {
    if (null == form || super.isBlank(form.getFormId()) || super.isNoSelectId(templateOid)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    super.setStringValueMaxLength(form, "description", MAX_DESCRIPTION_LENGTH);
    SysFormTemplateVO template = this.findTemplate(templateOid);
    form.setTemplateId(template.getTplId());
    return this.sysFormService.saveObject(form);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysFormTemplateVO(com.netsteadfast.greenstep.vo.SysFormTemplateVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with SysFormTemplateVO

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

the class SystemFormLogicServiceImpl method findTemplate.

private SysFormTemplateVO findTemplate(String templateOid) throws ServiceException, Exception {
    SysFormTemplateVO template = new SysFormTemplateVO();
    template.setOid(templateOid);
    DefaultResult<SysFormTemplateVO> result = this.sysFormTemplateService.findObjectByOid(template);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    return result.getValue();
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysFormTemplateVO(com.netsteadfast.greenstep.vo.SysFormTemplateVO)

Aggregations

SysFormTemplateVO (com.netsteadfast.greenstep.vo.SysFormTemplateVO)11 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)6 SysFormVO (com.netsteadfast.greenstep.vo.SysFormVO)3 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)2 Transactional (org.springframework.transaction.annotation.Transactional)2 File (java.io.File)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1