response.setUrl(formatUrl(serverRootUrl, RestUrls.URL_GROUP_MEMBERSHIP, groupId, userId));
return response;
}
public ModelResponse createModelResponse(Model model, String serverRootUrl) {
ModelResponse response = new ModelResponse();
response.setCategory(model.getCategory());
response.setCreateTime(model.getCreateTime());
response.setId(model.getId());
response.setKey(model.getKey());
response.setLastUpdateTime(model.getLastUpdateTime());
response.setMetaInfo(model.getMetaInfo());
response.setName(model.getName());
response.setDeploymentId(model.getDeploymentId());
response.setVersion(model.getVersion());
response.setTenantId(model.getTenantId());
response.setUrl(formatUrl(serverRootUrl, RestUrls.URL_MODEL, model.getId()));
if(model.getDeploymentId() != null) {
response.setDeploymentUrl(formatUrl(serverRootUrl, RestUrls.URL_DEPLOYMENT, model.getDeploymentId()));
}
if(model.hasEditorSource()) {
response.setSourceUrl(formatUrl(serverRootUrl, RestUrls.URL_MODEL_SOURCE, model.getId()));
}
if(model.hasEditorSourceExtra()) {
response.setSourceExtraUrl(formatUrl(serverRootUrl, RestUrls.URL_MODEL_SOURCE_EXTRA, model.getId()));
}
return response;
}