Projects Controller

@RestController
@RequestMapping(path = "BASE_EQUINOX_ENDPOINT + USERS_KEY + "/{" + IDENTIFIER_KEY + "}/" + PROJECTS_KEY" )
open class ProjectsController : DefaultPandoroController

The ProjectsController class is useful to manage all the project operations

Author

N7ghtm4r3 - Tecknobit

See also

EquinoxController

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
protected open var jsonHelper: JsonHelper
Link copied to clipboard
protected val mantis: Mantis
Link copied to clipboard
protected open var me: T
Link copied to clipboard
Link copied to clipboard
@Autowired
private open var projectsHelper: ProjectsHelper
projectsHelper instance to manage the projects database operations
Link copied to clipboard
open var resourcesProvider: ResourcesProvider
Link copied to clipboard
val RESPONSE_SUCCESSFUL_MESSAGE: String = "operation_executed_successfully_key"
Link copied to clipboard
protected open var serverProtector: ServerProtector
Link copied to clipboard
protected open var usersRepository: R
Link copied to clipboard
val WRONG_CHANGE_NOTES_ERROR_MESSAGE: String = "wrong_change_notes_list_key"
WRONG_CHANGE_NOTES_ERROR_MESSAGE message to use when the change notes list is not valid
Link copied to clipboard
val WRONG_PROCEDURE_MESSAGE: String = "wrong_procedure_key"
Link copied to clipboard
val WRONG_PROJECT_DESCRIPTION_ERROR_MESSAGE: String = "wrong_project_description_key"
WRONG_PROJECT_DESCRIPTION_ERROR_MESSAGE message to use when the description of the project is not a valid description
Link copied to clipboard
val WRONG_PROJECT_NAME_ERROR_MESSAGE: String = "wrong_project_name_key"
WRONG_PROJECT_NAME_ERROR_MESSAGE message to use when the name of the project is not a valid name
Link copied to clipboard
val WRONG_PROJECT_NAME_EXISTS_ERROR_MESSAGE: String = "project_name_already_exists_key"
WRONG_PROJECT_NAME_EXISTS_ERROR_MESSAGE message to use when the name of the project is already used
Link copied to clipboard
val WRONG_PROJECT_REPOSITORY_ERROR_MESSAGE: String = "wrong_project_repository_key"
WRONG_PROJECT_REPOSITORY_ERROR_MESSAGE message to use when the repository of the project is not valid
Link copied to clipboard
val WRONG_PROJECT_VERSION_ERROR_MESSAGE: String = "wrong_project_version_key"
WRONG_PROJECT_VERSION_ERROR_MESSAGE message to use when the version of the project is not valid
val WRONG_PUBLISH_UPDATE_REQUEST_ERROR_MESSAGE: String = "wrong_publish_update_request_key"
WRONG_PUBLISH_UPDATE_REQUEST_ERROR_MESSAGE message to use when a request to publish an update is not valid
Link copied to clipboard
val WRONG_START_UPDATE_REQUEST_ERROR_MESSAGE: String = "wrong_development_update_request_key"
WRONG_START_UPDATE_REQUEST_ERROR_MESSAGE message to use when a request to start an update is not valid
val WRONG_UPDATE_TARGET_VERSION_ERROR_MESSAGE: String = "wrong_target_version_key"
WRONG_UPDATE_TARGET_VERSION_ERROR_MESSAGE message to use when the target version of an update is not valid
val WRONG_UPDATE_TARGET_VERSION_EXISTS_ERROR_MESSAGE: String = "update_version_already_exists_key"
WRONG_UPDATE_TARGET_VERSION_EXISTS_ERROR_MESSAGE message to use when the version of an update is already used

Functions

Link copied to clipboard
@PutMapping(path = ""/{" + PROJECT_IDENTIFIER_KEY + "}" + UPDATES_PATH + "{" + UPDATE_IDENTIFIER_KEY + "}" + ADD_CHANGE_NOTE_ENDPOINT", headers = [] )
open fun addChangeNote(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String, @PathVariable(value = "update_id") updateId: String, @RequestBody payload: Map<String, String>): String
Method to add a change note to an update
Link copied to clipboard
@PostMapping(headers = [] )
open fun addProject(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @ModelAttribute payload: ProjectDTO): String
Method to add a new project
Link copied to clipboard
@DeleteMapping(path = "/{" + PROJECT_IDENTIFIER_KEY + "}" + UPDATES_PATH + "{" + UPDATE_IDENTIFIER_KEY + "}/" + NOTES_KEY + "/{" + NOTE_IDENTIFIER_KEY + "}", headers = [] )
open fun deleteChangeNote(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String, @PathVariable(value = "update_id") updateId: String, @PathVariable(value = "note_id") noteId: String): String
Method to delete a change note
Link copied to clipboard
@DeleteMapping(path = "/{" + PROJECT_IDENTIFIER_KEY + "}", headers = [] )
open fun deleteProject(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String): String
Method to delete a project
Link copied to clipboard
@DeleteMapping(path = "/{" + PROJECT_IDENTIFIER_KEY + "}" + UPDATES_PATH + "{" + UPDATE_IDENTIFIER_KEY + "}", headers = [] )
open fun deleteUpdate(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String, @PathVariable(value = "update_id") updateId: String): String
Method to delete an update
Link copied to clipboard
@PatchMapping(path = "/{" + PROJECT_IDENTIFIER_KEY + "}" + UPDATES_PATH + "{" + UPDATE_IDENTIFIER_KEY + "}/" + NOTES_KEY + "/{" + NOTE_IDENTIFIER_KEY + "}", headers = [] )
open fun editChangeNote(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String, @PathVariable(value = "update_id") updateId: String, @PathVariable(value = "note_id") noteId: String, @RequestBody payload: Map<String, String>): String
Method to edit an existing change note of an update
Link copied to clipboard
@PostMapping(path = "/{" + PROJECT_IDENTIFIER_KEY + "}", headers = [] )
open fun editProject(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String, @ModelAttribute payload: ProjectDTO): String
Method to edit an existing project
Link copied to clipboard
protected open fun failedResponse(error: String): String
Link copied to clipboard
Link copied to clipboard
@GetMapping(path = "/authored", headers = [] )
open fun <T> getAuthoredProjects(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String): T
Method to get the authored projects list
Link copied to clipboard
@GetMapping(path = "/in_development", headers = [] )
open fun <T> getInDevelopmentProjects(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @RequestParam(name = "page", defaultValue = "0", required = false) page: Int, @RequestParam(name = "pageSize", defaultValue = "10", required = false) pageSize: Int, @RequestParam(name = "filters", defaultValue = "", required = false) filters: Set<String>): T
Method to get a IN_DEVELOPMENT projects list
Link copied to clipboard
@GetMapping(path = "/{" + PROJECT_IDENTIFIER_KEY + "}", headers = [] )
open fun <T> getProject(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String): T
Method to get a single project
Link copied to clipboard
@GetMapping(headers = [] )
open fun <T> getProjects(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @RequestParam(name = "page", defaultValue = "0", required = false) page: Int, @RequestParam(name = "pageSize", defaultValue = "10", required = false) pageSize: Int, @RequestParam(name = "filters", defaultValue = "", required = false) filters: Set<String>): T
Method to get a projects list
Link copied to clipboard
open fun initEquinoxEnvironment(storagePath: String, saveMessage: String, context: Class<out Any>, args: Array<String>, customSubDirectories: Array<String>)
Link copied to clipboard
protected open fun isMe(id: String, token: String): Boolean
Link copied to clipboard
protected open fun <V> loadJsonHelper(payload: Map<String, V>)
Link copied to clipboard
private open fun manageChangeNote(id: String, token: String, projectId: String, updateId: String, noteId: String, ope: String): String
Method to manage a change note
Link copied to clipboard
private open fun manageUpdateStatus(id: String, token: String, projectId: String, updateId: String, isPublishing: Boolean): String
Method to manage the status of an update
Link copied to clipboard
@PatchMapping(path = ""/{" + PROJECT_IDENTIFIER_KEY + "}" + UPDATES_PATH + "{" + UPDATE_IDENTIFIER_KEY + "}/" + NOTES_KEY + "/{" + NOTE_IDENTIFIER_KEY + "}" + MARK_CHANGE_NOTE_AS_DONE_ENDPOINT", headers = [] )
open fun markChangeNoteAsDone(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String, @PathVariable(value = "update_id") updateId: String, @PathVariable(value = "note_id") noteId: String): String
Method to mark a change note as done
Link copied to clipboard
@PatchMapping(path = ""/{" + PROJECT_IDENTIFIER_KEY + "}" + UPDATES_PATH + "{" + UPDATE_IDENTIFIER_KEY + "}/" + NOTES_KEY + "/{" + NOTE_IDENTIFIER_KEY + "}" + MARK_CHANGE_NOTE_AS_TODO_ENDPOINT", headers = [] )
open fun markChangeNoteAsToDo(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String, @PathVariable(value = "update_id") updateId: String, @PathVariable(value = "note_id") noteId: String): String
Method to mark a change note as to-do
Link copied to clipboard
@PatchMapping(path = ""/{" + PROJECT_IDENTIFIER_KEY + "}" + UPDATES_PATH + "{" + UPDATE_IDENTIFIER_KEY + "}" + PUBLISH_UPDATE_ENDPOINT", headers = [] )
open fun publishUpdate(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String, @PathVariable(value = "update_id") updateId: String): String
Method to publish an update of a project
Link copied to clipboard
@PostMapping(path = ""/{" + PROJECT_IDENTIFIER_KEY + "}" + UPDATES_PATH + SCHEDULE_UPDATE_ENDPOINT", headers = [] )
open fun scheduleUpdate(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String, @RequestBody payload: Map<String, Any>): String
Method to schedule an update for a project
Link copied to clipboard
@PatchMapping(path = ""/{" + PROJECT_IDENTIFIER_KEY + "}" + UPDATES_PATH + "{" + UPDATE_IDENTIFIER_KEY + "}" + START_UPDATE_ENDPOINT", headers = [] )
open fun startUpdate(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "project_id") projectId: String, @PathVariable(value = "update_id") updateId: String): String
Method to start an update of a project
Link copied to clipboard
protected open fun successResponse(): String
protected open fun <V> successResponse(value: V): HashMap<String, V>
Link copied to clipboard
private open fun workWithProject(id: String, token: String, payload: ProjectDTO, projectId: String): String
Method to add or edit a project