Support Scriptlets #5531
Replies: 18 comments
-
A certain Alexi Sommerville promised me a workaround to this issue half a year ago (see attached mail). Is there any progress in this issue? We need "getByLoanAgentRole" to work in Specify7. |
Beta Was this translation helpful? Give feedback.
-
From @grantfitzsimmons:
|
Beta Was this translation helpful? Give feedback.
-
Add GetByLoanAgentRole to the list of scriplets |
Beta Was this translation helpful? Give feedback.
-
getByLoanAgentRole has been requested by RBGE as well. |
Beta Was this translation helpful? Give feedback.
-
Ben Ritchie from RBGE has mentioned again the importance of supporting these scriplets |
Beta Was this translation helpful? Give feedback.
-
Cornell Birds is waiting for |
Beta Was this translation helpful? Give feedback.
-
@grantfitzsimmons I made a workaround a year or so ago that I might be willing to dig up and share. |
Beta Was this translation helpful? Give feedback.
-
@FedorSteeman It would be super helpful if you could share that! |
Beta Was this translation helpful? Give feedback.
-
OK I uploaded some of the relevant app resources to our github, since we need them there anyway to control version history. https://github.com/NHMDenmark/DanSpecify/tree/master/App%20Resources/MSJN/Paleontology Please take a look at e.g. the "MSJN Loan Receipt.xml" file. At line 40, you will see it queries the aggregated field of all loanAgents:
At line 344-347 you will see the field expression that I used to tease out the agent from the "loanAgents" field. Depending on role, it will pick out the correct agent. It also inserts line breaks for the respective elements of the agent aggregated string, by replacing pipes and removes the role name that was added during aggregation. This is repeated for other roles at their respective positions.
I know it's a bit technical, but I hope you can figure this out and know how to add it to JasperReports (or directly to the XML). Of course, it's important that all roles are filled out, otherwise an error will be thrown. |
Beta Was this translation helpful? Give feedback.
-
@FedorSteeman I appreciate your solution! I think that's a really great way to approach it and something I will share with the team today. |
Beta Was this translation helpful? Give feedback.
-
This issue has been mentioned on Specify Community Forum. There might be relevant details there: https://discourse.specifysoftware.org/t/creating-reports-labels-in-specify-7-jaspersoft-studio/628/1 |
Beta Was this translation helpful? Give feedback.
-
This issue has been mentioned on Specify Community Forum. There might be relevant details there: |
Beta Was this translation helpful? Give feedback.
-
Reported by: University of Michigan |
Beta Was this translation helpful? Give feedback.
-
Since the server migration & Specify7 update for the Copenhagen site, we've been encouraging users to completely switch away from Specify6. However, the lack of support of Scriptlets, especially getByLoanAgentRole, is barring that. Is there any news on having these implemented, or shall I try to (painstakingly) apply the solution I came up with for the other institution (mentioned above)? |
Beta Was this translation helpful? Give feedback.
-
@FedorSteeman Unfortunately, we have not made significant progress in reimplementing or supporting all scriptlets in Specify 7. Specify 6 often performed additional queries when scriptlets were called to retrieve data that was not returned in the original associated query, and we have been primarily against this solution. We've used a solution similar to the scriptlet you provided as our current solution to avoid using the previous approach, though we intend to eventually make this more intuitive. At this time, further report and label system improvements are scheduled for next year, though we do not have an exact timeline planned at this time. |
Beta Was this translation helpful? Give feedback.
-
That is unfortunate to hear, because I am currently struggling to rewrite reports created in SpiReport for Specify6 and currently stuck with that. The trick I used by splitting and parsing aggregrated string contents is not entirely reliable and won't help me accessing other agent fields so I need something better than that. I have been experimenting with jasper report variables to pick out specific rows in the record set (like only those where loan agent role is something specific like "preparer". But because of the unusual way the report templates are set up, I cannot get this to work. Alternatively, I considered doing Specify7 API calls to get the loan's agent based on role, but not sure if that would work either. |
Beta Was this translation helpful? Give feedback.
-
I spent several hours trying to come up with a generic solution but I am facing the same issue as you. I'm going to discuss this issue further with the devs to come up with a real solution going forward as other users are similarly reliant on the scriptlet in Specify 6 to effectively build reports. |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to pull in more data in the original query atomically so we can more directly access things like agents of different roles? As of now the aggregate fields are the only possibility, but it's not very reliable to analyse these during execution of the report script. |
Beta Was this translation helpful? Give feedback.
-
The following scriptlets do not work in Sp7:
• aggregatePrepCounts
• aggregatePreps
• aggregatePreps
• buildLocalityString
• buildNameString
• degrees
• format
• formatDate
• formatDate
• formatDetermination
• formatFieldNo
• formatTaxonWithAuthors
• getAggregated
• getByLoanAgentRole
• getByRole
• getCollectors
• getCollectorsByCOIdNumWithAggregator
• getCollectorsWithAggregator
• getCurrentDate
• getCurrentDeterminationFullName
• getFirstCollector
• getSecondaryCollectors
• getTaxonNameWithAuthors
• getTypeStatus
• getTypeTaxon
• loanCategory
• locality
• localityBD
• sumPrepCounts
• toProperCase
Beta Was this translation helpful? Give feedback.
All reactions