Dear Tim,

Thanks for the information regarding the Service class. I searched the 
codebase and found examples that use the HandleService class. One example 
that is closest to my needs is the SuggestServlet also known as the Item 
Recommendation feature. Unfortunately, that feature is for the JSP 
interface. Changing my 5x code from DSpaceObject dso = 
HandleManager.resolveToObject(context, handle) into DSpaceObject dso = 
handleService.resolveToObject(context, handle), I get the Page not found 
error. Migrating my code to be 6x compatible is not so trivial to me. 
Looking at other examples is so overwhelming and daunting to me since I'm 
not a Java programmer. Most of my customizations are mostly based on 
existing code that I have little grasp of and I seldom touch the underlying 
Java code.

This is one of my customizations that I really need to upgrade to DSpace 
version 6. Since our repository contains more metadata-only items than 
items with restricted bitstreams, this feature is used more compared to the 
request a copy feature. Unfortunately for me, my skill set is not enough to 
upgrade my working 5x code to 6x code. Even though I offered a bounty for 
my question in SO hoping that it will draw more attention, it is not a 
guarantee that someone will post an answer for it. I'm at loss now on how 
to solve this and so would like to ask from this list for any help.

Thanks in advance.
Euler

On Friday, May 8, 2020 at 11:31:18 PM UTC+8, Tim Donohue wrote:
>
> Hi Euler,
>
> In DSpace 6, we had a larger API refactor.  So, most "Manager" style 
> classes were replaced with a Service class.  Therefore, the HandleManager 
> is now a HandleService. 
>
> Here's the interface: 
> https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-api/src/main/java/org/dspace/handle/service/HandleService.java
>
> And here's the implementation: 
> https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-api/src/main/java/org/dspace/handle/HandleServiceImpl.java
>
> And here's just one example of how it can be used similarly: 
> https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-api/src/main/java/org/dspace/checker/HandleDispatcher.java#L83
>   
> If you search the codebase though, you'll find many many more examples.
>
> Tim
> ------------------------------
> *From:* dspac...@googlegroups.com <javascript:> <dspac...@googlegroups.com 
> <javascript:>> on behalf of euler <esn...@seafdec.org.ph <javascript:>>
> *Sent:* Friday, May 8, 2020 10:16 AM
> *To:* DSpace Technical Support <dspac...@googlegroups.com <javascript:>>
> *Subject:* [dspace-tech] HandleManager in DSpace 6? 
>  
> Dear All, 
>
> I would like to ask for your help regarding the HandleManager class in 
> DSpace version 5. I posted a question about this in SO 
> <https://stackoverflow.com/q/61585459/1919069> [1] but unfortunately, I 
> got no responses. It seems the HandleManager class no longer exists in 
> DSpace 6. I used HandleManager previously on a modified FeedbackForm to 
> extract the handle and other metadata from an item.
>
>     String handle = parameters.getParameter("handle","unknown");
>     DSpaceObject dso = HandleManager.resolveToObject(context, handle);
>
>     if (!(dso instanceof Item)) {
>         return;
>     }
>     Request request = ObjectModelHelper.getRequest(objectModel);
>
>     Item item = (Item) dso;
>
>
>     // Build the item viewer division.
>     Division documentdelivery = body.addInteractiveDivision(
> "DocumentDelivery-form",
>             contextPath + "/documentdelivery/" + parameters.getParameter(
> "handle","unknown"), Division.METHOD_POST,"primary");
>
> Can somebody help me with how to extract the handle (and other metadata) 
> of the referring page based on DSpace 6x? [2] I always get the "Page not 
> found" when I try to access 
> http://example.com/documentdelivery/123456789/1234 coming from 
> http://example.com/handle/123456789/1234. I have been trying many 
> combinations but I did not get what I want. I'm working on this for almost 
> a week now and this is the only part of my customization that stopped me 
> from upgrading our production server into version 6.4.
>
> Any help would be greatly appreciated! Thanks in advance!
> euler
>
> [1] https://stackoverflow.com/q/61585459/1919069
> [2] https://stackoverflow.com/q/26064830/1919069
>
> -- 
> All messages to this mailing list should adhere to the DuraSpace 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 dspac...@googlegroups.com <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dspace-tech/63405fb2-3563-4ca1-8a2b-ac87561ec6db%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dspace-tech/63405fb2-3563-4ca1-8a2b-ac87561ec6db%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
All messages to this mailing list should adhere to the DuraSpace 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 dspace-tech+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/ddac8def-71b7-43e0-8250-562f1e59bb1d%40googlegroups.com.

Reply via email to