Skip to content

Conversation

@neha0605
Copy link
Contributor

Due to browser security we can not allow users choosing the complete path but we are capturing the file and folder name.
In this PR I also removed the edit functionality.

@neha0605 neha0605 changed the base branch from master to dev May 22, 2024 03:54
@markkerzner markkerzner requested a review from Copilot October 29, 2025 23:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR separates case creation and editing into distinct views by introducing a dedicated editcase.jsp page. The refactoring simplifies the usercase.jsp to handle only case creation, while editcase.jsp manages case editing with pre-populated values. Additionally, the PR adds processing status tracking to cases with UI support for starting and monitoring processing jobs.

  • Separated case creation (usercase.jsp) and editing (editcase.jsp) into distinct views
  • Added ProcessingStatus enum and processing workflow with ProcessingController
  • Updated case listing to display processing status with action buttons
  • Refactored CaseController to route between create/edit views and simplified save logic

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/main/webapp/template/usercase.jsp Simplified to handle only case creation with basic form fields
src/main/webapp/template/editcase.jsp New file for editing existing cases with pre-populated values
src/main/webapp/template/listcases.jsp Added status column and processing action buttons
src/main/webapp/css/styles.css Added secondary action button styling
src/main/resources/tiles.xml Registered editcase view definition
src/main/resources/paContext.xml Registered ProcessingController bean and URL mapping
src/main/java/org/freeeed/search/web/model/ProcessingStatus.java New enum for case processing states
src/main/java/org/freeeed/search/web/model/Case.java Added status field to Case model
src/main/java/org/freeeed/search/web/controller/ProcessingController.java New controller for handling case processing actions
src/main/java/org/freeeed/search/web/controller/CaseController.java Refactored to route to create/edit views and simplified case save logic
src/main/java/org/freeeed/search/web/WebConstants.java Renamed constant from EDIT_PROJECT_PAGE to EDIT_CASE_PAGE

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

</span>
</td>
</tr>
<td><textarea class="form-control" name="description" placeholder="Project Descrition"></textarea></td>
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'Descrition' to 'Description'.

Suggested change
<td><textarea class="form-control" name="description" placeholder="Project Descrition"></textarea></td>
<td><textarea class="form-control" name="description" placeholder="Project Description"></textarea></td>

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +9
function disableButton(id) {
var button = document.getElementById('processButton' + id);
button.disabled = true;
button.innerText = 'Cancel Processing';
}
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function disableButton is defined but never called in this file or the diff. If this function is unused, consider removing it to avoid dead code.

Suggested change
function disableButton(id) {
var button = document.getElementById('processButton' + id);
button.disabled = true;
button.innerText = 'Cancel Processing';
}

Copilot uses AI. Check for mistakes.
Comment on lines +97 to 99
Long caseId = Long.parseLong(caseIdStr);
c = caseDao.findCase(caseId);
}
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential uncaught 'java.lang.NumberFormatException'.

Suggested change
Long caseId = Long.parseLong(caseIdStr);
c = caseDao.findCase(caseId);
}
try {
Long caseId = Long.parseLong(caseIdStr);
c = caseDao.findCase(caseId);
} catch (NumberFormatException e) {
errors.add("Invalid case ID format");
c = new Case();
}

Copilot uses AI. Check for mistakes.
if (caseIdStr == null) {
c = new Case();
} else {
Long caseId = Long.parseLong(caseIdStr);
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'caseId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.

Copilot uses AI. Check for mistakes.
if ("process".equals(action)) {
try {
String caseIdStr = (String) valueStack.get("id");
Long caseId = Long.parseLong(caseIdStr);
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'caseId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.

Suggested change
Long caseId = Long.parseLong(caseIdStr);
long caseId = Long.parseLong(caseIdStr);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants