Hi Ben, Your use case is unclear to me. DSpace 7 already has some of these features and it's unclear if you are asking for something else.
In DSpace 7, there is already a way to determine if an Item has a file attached. If you perform a search, you'll see a "Has Files" filter which allows you to filter the search by Items that have (or do not have) files attached. You can see this behavior on our demo site, e.g. here's a search for "test": https://demo.dspace.org/search?query=test Once you click on Item, *all* the files (regardless of format) are already displayed as download links. DSpace 7 doesn't have a way to limit the files shown to just PDF, but you could reorder the files so the PDF is displayed first. Or you could move extra files to a different bundle (only files in the "ORIGINAL" bundle are displayed by default). I'm not sure if this aligns with your use case. If it doesn't you should describe your use case in more details. It is possible though that you would need to modify the code in DSpace 7 to align with your use case (not sure). Tim On Friday, August 25, 2023 at 9:58:04 AM UTC-5 Ben Parkes wrote: > *From: *Ben Parkes <[email protected]> > *Date: *Friday, 25 August 2023 at 15:55 > *To: *DSpace Community <[email protected]> > *Subject: *Check if item has file in search results list > > Hello, > > > > I am working on an instance of DSpace 7.6 and I have a use case where I am > required to display if an item has a file/bitstream attached to it and, if > yes, display a download link to that file/bitstream. In all cases the > file/bitstream will be a pdf file. > > > > I had implemented this previously in 6.x by getting the bitstream info > (<xsl:variable name=”bitstreaminfo” > select=”util:getBitstreamInfo($handle)/>) then checking if the metsDoc > string contains “pdf” (<xsl:when test="normalize-space($bitstreaminfo)">) > and creating a download link if the Boolean returns true. > > > > I am curious if there is a way to do something similar in the new Angular > frontend? I am in the process of upgrading the repository and the client > would like to retain all the previous functionality. > > > > Thanks, > > Ben > > > > ____________________________ > > Ben Parkes > > Digital Library Software Developer > > Digital Library, Library & University Collections, University of Edinburgh > > Argyle House, Lady Lawson Street, Edinburgh EH3 9DR > > Pronouns: He, him, his > > > The University of Edinburgh is a charitable body, registered in Scotland, > with registration number SC005336. Is e buidheann carthannais a th’ ann an > Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336. > -- All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx --- You received this message because you are subscribed to the Google Groups "DSpace Community" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-community/47e40843-7bd7-4fc2-8da8-0889d9a89e32n%40googlegroups.com.
