use of org.eclipse.sw360.datahandler.common.SW360Utils.printName in project sw360portal by sw360.
the class ModerationDatabaseHandler method createRequest.
public RequestStatus createRequest(Project project, User user, Boolean isDeleteRequest) {
Project dbproject;
try {
dbproject = projectDatabaseHandler.getProjectById(project.getId(), user);
} catch (SW360Exception e) {
log.error("Could not get original project from database. Could not generate moderation request.", e);
return RequestStatus.FAILURE;
}
// Define moderators
Set<String> moderators = getProjectModerators(dbproject);
ModerationRequest request = createStubRequest(user, isDeleteRequest, project.getId(), moderators);
// Set meta-data
request.setDocumentType(DocumentType.PROJECT);
request.setDocumentName(SW360Utils.printName(dbproject));
// Fill the request
ModerationRequestGenerator generator = new ProjectModerationRequestGenerator();
request = generator.setAdditionsAndDeletions(request, project, dbproject);
addOrUpdate(request, user);
return RequestStatus.SENT_TO_MODERATOR;
}
Aggregations