Conversation
…pe method to MachineGeneratedContentService
…egate Pdf action to ResultObjectActionMenu
|
|
||
| if (!textTypeNode.isMissingNode()) { | ||
| String textType = textTypeNode.asText(); | ||
| if (RESULT_HANDWRITTEN_PRINT.equalsIgnoreCase(textType) |
There was a problem hiding this comment.
There are 3 other possible values: N/A, PRINTED, and TYPED. N/A should probably not return a type, but all the others should make it through.
|
|
||
| AggregatePdfAction.prototype.isValidTarget = function(target) { | ||
| return target.isSelected() && target.isEnabled() && $.inArray("editResourceType", target.metadata.permissions) != -1 | ||
| && "Folder" == target.getMetadata().type; |
There was a problem hiding this comment.
We should also be able to run this one Work objects
| if (!isContentRoot && $.inArray('destroy', metadata.permissions) != -1) { | ||
| items["destroy"] = {name : 'Destroy', disabled : !resultObject.isDeleted}; | ||
| } | ||
| if (metadata.type === 'Folder' && $.inArray('reindex', metadata.permissions) != -1) { |
There was a problem hiding this comment.
This should be available to works as well
| } | ||
|
|
||
| var aggregatePdfForm = aggregatePdfTemplate(); | ||
| this.dialog = $("<div class='containingDialog'>" + aggregatePdfForm + "</div>"); |
There was a problem hiding this comment.
I believe there is a confirmation dialogue option that we could use instead of creating a new form, you could check the "Reindex" or "Destroy" actions to see how those work
|
|
||
| Map<String, Object> result = new HashMap<>(); | ||
| var agent = AgentPrincipalsImpl.createFromThread(); | ||
| result.put("action", "generate aggregate PDF"); |
There was a problem hiding this comment.
| result.put("action", "generate aggregate PDF"); | |
| result.put("action", "generate aggregate PDFs"); |
| assertTrue(cmd.contains("pdf4u")); | ||
| assertTrue(FilenameUtils.getBaseName(cmd.get(3)).startsWith(PARENT_UUID)); | ||
| assertEquals(RESULT_HANDWRITTEN_CURSIVE, cmd.get(9)); | ||
| assertEquals(List.of(RESULT_HANDWRITTEN_CURSIVE).toString(), cmd.get(9)); |
There was a problem hiding this comment.
this is expecting the parameter to have value [HANDWRITTEN_CURSIVE], but that seems pretty unusual for passing a list into a CLI, I would expect it to be a comma delimited list like HANDWRITTEN_CURSIVE,PRINTED
| return target.isSelected() && target.isEnabled() && $.inArray("editResourceType", target.metadata.permissions) != -1 | ||
| && "Folder" == target.getMetadata().type; | ||
| return target.isSelected() && target.isEnabled() | ||
| && $.inArray("reindex", target.metadata.permissions) !== -1 |
There was a problem hiding this comment.
I checked in with Anna about who should have permission to run this workflow. I think we should switch back to editResourceType (here and in AggregatePdfProcessor). Reindex and Run Enhancements are only available to admins, but she suggested that canManager role be able to trigger this workflow.
| } | ||
|
|
||
| return textTypeList; | ||
| return textTypeList.stream().map(Object::toString).collect(Collectors.joining(",")); |
There was a problem hiding this comment.
I would suggest having the service return a List of paths still, and serializing it into a string where it needs to be a string for presenting it to the user. Returning a list of Paths is cleaner and more usable programmatically.
https://unclibrary.atlassian.net/browse/BXC-5550
extractTextTypemethod toMachineGeneratedContentServiceto retrieve thetextTypegetTextTypesmethod to useextractTextTypeAggregatePdfControllerAggregate PDFaction toResultObjectActionMenu