use of com.netsteadfast.greenstep.po.hbm.BbWorkspaceLabel in project bamboobsc by billchen198318.
the class WorkspaceLogicServiceImpl method delete.
@ServiceMethodAuthority(type = { ServiceMethodType.DELETE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<Boolean> delete(String workspaceOid) throws ServiceException, Exception {
if (super.isBlank(workspaceOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
WorkspaceVO workspace = new WorkspaceVO();
workspace.setOid(workspaceOid);
DefaultResult<WorkspaceVO> oldResult = this.workspaceService.findObjectByOid(workspace);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
workspace = oldResult.getValue();
Map<String, Object> params = new HashMap<String, Object>();
params.put("spaceId", workspace.getSpaceId());
List<BbWorkspaceConfig> configs = this.workspaceConfigService.findListByParams(params);
List<BbWorkspaceLabel> labels = this.workspaceLabelService.findListByParams(params);
for (int i = 0; configs != null && i < configs.size(); i++) {
BbWorkspaceConfig config = configs.get(i);
this.workspaceConfigService.delete(config);
}
for (int i = 0; labels != null && i < labels.size(); i++) {
BbWorkspaceLabel label = labels.get(i);
this.workspaceLabelService.delete(label);
}
return workspaceService.deleteObject(workspace);
}
use of com.netsteadfast.greenstep.po.hbm.BbWorkspaceLabel in project bamboobsc by billchen198318.
the class WorkspaceUtils method setTitle.
private static void setTitle(BbWorkspaceConfig config, Map<String, Object> templateParameters) throws ServiceException, Exception {
Map<String, Object> params = new HashMap<String, Object>();
params.put("spaceId", config.getSpaceId());
params.put("position", config.getPosition());
List<BbWorkspaceLabel> labels = workspaceLabelService.findListByParams(params);
if (labels == null || labels.size() < 1) {
return;
}
for (BbWorkspaceLabel label : labels) {
templateParameters.put("title", label.getLabel());
}
}
Aggregations