Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
87cd872
[CITE-162] Implemented a new View Modal for Giles uploaded and Extracted
Charishma0249 Oct 8, 2021
5fe4766
[CITE-162] Formatted indentations
Charishma0249 Oct 8, 2021
25b280b
[CITE-162] Formatted Indentations
Charishma0249 Oct 8, 2021
2584f67
[CITE-162] Formatted indentations
Charishma0249 Oct 8, 2021
54d6bb2
[CITE-162] Addressed review comments
Charishma0249 Feb 24, 2022
c3f4775
[CITE-162] Removed console logs
Charishma0249 Mar 3, 2022
d206620
[CITE-162]Addressed review comments
Charishma0249 Mar 10, 2022
0079897
[CITE-162]Fixed Indentation issues
Charishma0249 Mar 10, 2022
257461b
[CITE-162] Fixed Indentation issues
Charishma0249 Mar 10, 2022
fbb42c8
[CITE-162] Fixed indentation issues
Charishma0249 Mar 10, 2022
0794729
[CITE-162] Address review comments
Charishma0249 Mar 22, 2022
ae1b349
[CITE-162] Addressed review comments
Charishma0249 Mar 24, 2022
9648981
[CITE-162] Address review comments
Charishma0249 Mar 24, 2022
7e5f725
[CITE-162] Addressed review comments-Added boundary padding,reduced gaps
Charishma0249 Mar 24, 2022
b0badff
[CITE-162] Fixing indentation issues
Charishma0249 Mar 25, 2022
96a31a3
[CITE-162] Fix searching for multiple upload files
Charishma0249 Apr 12, 2022
26363fb
[CITE-162]Addressed review comments - Fixed content type issue
Charishma0249 Apr 21, 2022
895c16f
[CITE-162]Address code refactor issues
Charishma0249 Apr 22, 2022
1d8cedc
[CITE-162] Address code refactors
Charishma0249 May 6, 2022
afcd193
[CITE-162] Addressed review comments - Used streams to check the fileId
Charishma0249 May 24, 2022
9e528b7
[CITE-162] Addressed review comments - add comments
Charishma0249 May 24, 2022
72b8d47
[CITE-162] Fix indentations
Charishma0249 May 24, 2022
e28c1b3
[CITE-162] Fixing indentations
Charishma0249 May 24, 2022
ae166de
[CITE-162] Fixing indentations
Charishma0249 May 24, 2022
51c9bc1
[CITE-162] Addressing review comments
Charishma0249 Sep 20, 2022
984b615
[CITE-162]Address review comments
Charishma0249 Sep 23, 2022
218d26a
[CITE-162] Addressing review comments
Charishma0249 Sep 27, 2022
4c00e01
[CITE-162] Addressing review comments
Charishma0249 Sep 29, 2022
e6a471c
[CITE-162] Addressing review comments
Charishma0249 Oct 4, 2022
006b6f4
[CITE-162] Address review comments
Charishma0249 Oct 7, 2022
4672273
[CITE-162] Address review comments
Charishma0249 Oct 11, 2022
8db3efc
[CITE-162] Addressing review comments - code clean up
Charishma0249 Nov 8, 2022
e99d13d
[CITE-162] Addressing review comments
Charishma0249 Nov 10, 2022
02b3370
[CITE-162] Addressing review comments
Charishma0249 Nov 22, 2022
2328453
[CITE-162] Addressing review comments
Charishma0249 Nov 23, 2022
14fa940
[CITE-162] Addressing review comments
Charishma0249 Nov 24, 2022
c965f81
[CITE-162] Addressing review comments
Charishma0249 Nov 29, 2022
3f15692
[CITE-162] Addressing review comments
Charishma0249 Dec 1, 2022
a789c5b
[CITE-162] Addressing review comments
Charishma0249 Dec 9, 2022
b6eba77
[CITE-162] Addressing review comments
Charishma0249 Dec 9, 2022
dd3554a
Merge branch 'develop' into story/CITE-162
diya17 Sep 22, 2023
09730c9
[CITE-162] Changes to UI and API change
diya17 Sep 28, 2023
9a3df54
[GECO-162] Changing to stream
diya17 Sep 29, 2023
9e5e88c
[CITE-162] Removing fileId check
diya17 Oct 3, 2023
bd7d499
[CITE-162] Update to controller and view
diya17 Oct 5, 2023
1b2955a
[CITE:162] Fix duplication issue and files interleaving with upload m…
diya17 Oct 6, 2023
df3b383
[CITE-162] Making controller changes
diya17 Apr 19, 2024
28fdb53
Merge branch 'develop' into story/CITE-162
rajvi-patel-22 Aug 22, 2025
bc2e321
[CITE-162] Uncomment showfile function
rajvi-patel-22 Aug 27, 2025
4ec23db
[CITE-162] Update giles document controller
rajvi-patel-22 Aug 29, 2025
9691892
[CITE-162] Add citation validations
rajvi-patel-22 Aug 29, 2025
b1d3a9b
[CITE-162] Fix file not found errors in GilesDocumentController
rajvi-patel-22 Sep 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class GilesDocumentController {
public void get(HttpServletResponse response, @PathVariable String itemId, @PathVariable String fileId, Authentication authentication) {

ICitation citation = citationManager.getCitation(itemId);
Optional<IGilesUpload> uploadOptional = citation.getGilesUploads().stream().filter(u -> u.getUploadedFile() != null).filter(g -> g.getUploadedFile().getId().equals(fileId)).findFirst();
Optional<IGilesUpload> uploadOptional = citation.getGilesUploads().stream().filter(u -> u.getUploadedFile() != null).filter(g -> g.getUploadedFile().getId().equals(fileId) || g.getExtractedText().getId().equals(fileId) || g.getPages().stream().filter(p -> p!=null).anyMatch(a -> a.getImage().getId().equals(fileId) || a.getText().getId().equals(fileId) || a.getOcr().getId().equals(fileId) || a.getAdditionalFiles().stream().filter(f -> f!=null).anyMatch(f -> f.getId().equals(fileId)))).findFirst();
Copy link
Member

Choose a reason for hiding this comment

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

at the minimum this line needs to be reformatted (it's way too long). Even better would be to rewrite it so it's clearer what it does.

if (!uploadOptional.isPresent()) {
response.setStatus(org.apache.http.HttpStatus.SC_NOT_FOUND);
return;
Expand Down
93 changes: 89 additions & 4 deletions citesphere/src/main/webapp/WEB-INF/views/auth/group/item.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
});

$(document).ready(function(){

$("#uploadFileIcon").click(function() {

$("#uploadFileModal").modal('show');
});

Expand Down Expand Up @@ -75,8 +76,40 @@
$('.btn-nav').each(function() {
$(this).attr("href", $(this).attr("href") + "&" + queryParams);
})

$(".view-link").click(function() {
var item = $(this).parent()
showFiles('viewUpload', item[0]);

});
});

function showFiles(modalName, item) {

var uploadItem = $(item);
var modalNameLCase = modalName.toLowerCase();
Copy link
Member

Choose a reason for hiding this comment

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

indentation


$("#uploadedFileName").attr('href', uploadItem.attr("upload-href"));
$("#uploadedFileName").text(uploadItem.attr("data-"+modalNameLCase+"-uploadedFile-filename"));

$("#extractedFileName").attr('href', uploadItem.attr("extractedText-href"));
$("#extractedFileName").text(uploadItem.attr("data-"+modalNameLCase+"-extractedText-filename"));
$(uploadItem).children().each(function() {
$(this).children().each(function() {
$('.modal-body ul').append('<li class="list-group-item"><i class="icon-giles"></i><a href="'+ $(this).attr("image-href")+'">'+$(this).attr("data-"+modalNameLCase+"-image-filename")+'</a></li>');
$('.modal-body ul').append('<li class="list-group-item"><i class="icon-giles"></i><a href="'+ $(this).attr("pageText-href")+'">'+$(this).attr("data-"+modalNameLCase+"-pageText-filename")+'</a></li>');
$('.modal-body ul').append('<li class="list-group-item"><i class="icon-giles"></i><a href="'+ $(this).attr("pageOcr-href")+'">'+$(this).attr("data-"+modalNameLCase+"-pageOcr-filename")+'</a></li>');
$(this).children().each(function() {
$(this).children().each(function() {
$('.modal-body ul').append('<li class="list-group-item"><i class="icon-giles"></i><a href="'+ $(this).attr("additionalFiles-href")+'">'+$(this).attr("data-"+modalNameLCase+"-additionalFiles-filename")+'</a></li>');
})
})
})
})

$("#"+modalNameLCase+"Modal").modal('show');
}

</script>
</head>

Expand Down Expand Up @@ -329,19 +362,71 @@ <h2 style="margin-top: 0">
<h3 style="margin-top: 0">Files</h3>

<ul class="list-group" >
<li class="list-group-item" th:each="upload:${citation.gilesUploads}">
<li class="list-group-item" th:each="upload, status:${citation.gilesUploads}">
<i class="icon-giles"></i>

<span th:if="${upload.uploadedFile?.filename}">
<a th:href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${upload.uploadedFile?.id}|}">[[${upload.uploadedFile?.filename}]]</a>
<span th:id="|upload${status.index}|" class="upload-item" th:data-viewupload-uploadId="${upload.uploadId}" th:upload-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${upload.uploadedFile?.id}|}" th:data-viewupload-uploadedFile-filename="${upload.uploadedFile?.filename}" th:extractedText-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${upload.extractedText?.id}|}" th:data-viewupload-extractedText-filename="${upload.extractedText?.filename}" >

<th:block th:each="pages, status:${upload.pages}">
<span class="page-item">
<span th:id="|pages${status.index}|" class="page-item" th:data-viewupload-uploadId="${upload.uploadId}" th:image-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${pages.image?.id}|}" th:data-viewupload-image-filename="${pages.image?.filename}" th:pageText-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${pages.text?.id}|}" th:data-viewupload-pageText-filename="${pages.text?.filename}" th:pageOcr-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${pages.ocr?.id}|}" th:data-viewupload-pageOcr-filename="${pages.ocr?.filename}" >

<th:block th:each="additionalFiles, status:${pages.additionalFiles}">
<span class="additional-item" th:if="${additionalFiles?.filename}">
<span th:id="|additionalFiles${status.index}|" class="additional-item" th:data-viewupload-uploadId="${upload.uploadId}" th:additionalFiles-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${additionalFiles?.id}|}" th:data-viewupload-additionalFiles-filename="${additionalFiles?.filename}" >
</span>
</span>
</th:block>
</span>
</span>
</th:block>
<a class="view-link">[[${upload.uploadedFile?.filename}]]</a>
</span>
</span>
<span th:unless="${upload.documentStatus != null && (upload.documentStatus != T(edu.asu.diging.citesphere.model.bib.GilesStatus).SUBMITTED || T(edu.asu.diging.citesphere.model.bib.GilesStatus).NEW)}">
File is being processed... ([[${upload.progressId}]])
</span>
<span th:if="${upload.documentStatus == T(edu.asu.diging.citesphere.model.bib.GilesStatus).FAILED}" class="label label-danger">Failed [[${upload.progressId}]]</span>
<span th:if="${upload.documentStatus == T(edu.asu.diging.citesphere.model.bib.GilesStatus).NEW}" class="label label-default">In Queue</span>
<span th:if="${upload.documentStatus == T(edu.asu.diging.citesphere.model.bib.GilesStatus).SUBMITTED}" class="label label-default">Processing</span>
</li>


</li>
</ul>

<div class="modal fade" id="viewuploadModal"
tabIndex="-1" role="dialog"
aria-labelledby="viewUploadModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="viewUploadModal">
Files uploaded to and extracted by Giles
</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<ul class="list-group" >
<li class="list-group-item" >
<i class="icon-giles"></i>
<a id="uploadedFileName"> </a>
</li>
<li class="list-group-item">
<i class="icon-giles"></i>
<a id="extractedFileName"> </a>
</li>
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"> Close </button>
</div>
</div>
</div>
</div>

</div>

</div>
Expand Down