Dear Ricardo, So you mean that you're getting a list of all collections with the parentCommunity expand parameter like this?
https://dspacetest.cgiar.org/rest/collections?expand=parentCommunity In this example above I see that the response does not include parentCommunity data for each collection. If you change the null to expand on line 197 of CollectionsResource.java does it fix the problem? If so, then you should definitely file a bug on Jira and make a pull request. That's a good find! Cheers, On Wed, May 26, 2021 at 12:08 AM Ricardo Campos <[email protected]> wrote: > Hi, Alan. > > Thanks for your reply. > > There is a difference between your call to rest and mine. While you ask > for a specific collection - you give an collection uuid in the url -, I'm > asking a list of all collections in the repository. In terms of the java > code, you call "getCollection" while I call "getCollection*s"*. In you > case, the the call to the Collection class includes the expand parameter. > Maybe the fact getCollections asks for a list of collections would have > been the reason why the code for all collections does not refer to expand, > i'd say on purpose: to minimize, to shorten the answer. The problem is that > if you have the list of all collections you could find many of them with > the same name, making impossible to identify which is which, if you > understand me. I'd try to have the parent community name with collection > name in order to make this identification unique, if possible (you could > still have "homonimes" until a certain level). > > Thanks again. > > > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> > Livre > de vírus. www.avast.com > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>. > <#m_2311080036561454480_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > Em ter., 25 de mai. de 2021 às 03:29, Alan Orth <[email protected]> > escreveu: > >> Dear Ricardo, >> >> I don't understand the logic around that code block in >> CollectionsResource.java, but I'm on DSpace 6.3 as well and I can use >> expand on a collection to get the parent community, for example: >> >> >> https://dspacetest.cgiar.org/rest/collections/8ea4b611-1f59-4d4e-b78d-a9921a72cfe7?expand=parentCommunity >> >> Were you doing something differently? You can check the git log for that >> file to see its history. >> >> Cheers, >> >> On Tue, May 18, 2021 at 11:25 PM [email protected] < >> [email protected]> wrote: >> >>> Hi, >>> >>> For some time now, I've been trying to get the parent Community for when >>> reading the collections through the Rest API. >>> >>> Today I finally went to the source code and found, in >>> CollectionsResource.java the line >>> >>> Collection collection = new >>> org.dspace.rest.common.Collection(dspaceCollection, servletContext, >>> *null*, context, limit, offset); >>> >>> I wish to know why the parameter expand is set to null. I changed to expand >>> (a string passed to the function getCollections) and it seems to work >>> as expected. >>> >>> As I think no code is made without a reason, I feel insecure to let it >>> modified without further notice or advice. >>> >>> Any help is welcome. >>> >>> Thanks, >>> >>> Ricardo >>> >>> -- >>> All messages to this mailing list should adhere to the Code of Conduct: >>> https://duraspace.org/about/policies/code-of-conduct/ >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "DSpace Technical Support" 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-tech/35842b5e-f6a9-4d40-944b-32035503f47fn%40googlegroups.com >>> <https://groups.google.com/d/msgid/dspace-tech/35842b5e-f6a9-4d40-944b-32035503f47fn%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> >> >> -- >> Alan Orth >> [email protected] >> https://picturingjordan.com >> https://englishbulgaria.net >> https://mjanja.ch >> > -- Alan Orth [email protected] https://picturingjordan.com https://englishbulgaria.net https://mjanja.ch -- 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 Technical Support" 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-tech/CAKKdN4UaAS_maEd_%2B9Oq2zK7LuWwwznPnpkZCjyTpAupQWXKzQ%40mail.gmail.com.
