Search in sources :

Example 1 with CompomentsModel

use of com.netsteadfast.greenstep.compoments.CompomentsModel in project bamboobsc by billchen198318.

the class BaseWorkspaceCompoment method loadFromId.

@Override
public CompomentsModel loadFromId(String compomentId) throws ServiceException, Exception {
    if (StringUtils.isBlank(compomentId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    WorkspaceCompomentVO compoment = new WorkspaceCompomentVO();
    compoment.setCompId(compomentId);
    DefaultResult<WorkspaceCompomentVO> result = workspaceCompomentService.findByUK(compoment);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    compoment = result.getValue();
    CompomentsModel model = new CompomentsModel();
    this.setModel(model);
    model.setId(compoment.getCompId());
    model.setName(compoment.getName());
    model.setResource(this.getResource());
    model.setParameters(this.getParameters());
    model.setContent("");
    return model;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) WorkspaceCompomentVO(com.netsteadfast.greenstep.vo.WorkspaceCompomentVO) CompomentsModel(com.netsteadfast.greenstep.compoments.CompomentsModel)

Aggregations

ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)1 CompomentsModel (com.netsteadfast.greenstep.compoments.CompomentsModel)1 WorkspaceCompomentVO (com.netsteadfast.greenstep.vo.WorkspaceCompomentVO)1