Changeset 1449
- Timestamp:
- 06/28/11 12:14:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/pages/ResourceLinkPanel.java
r1194 r1449 71 71 private String getNameFromLink(String resourceLink) { 72 72 String result = resourceLink; 73 if (resourceLink != null) { 74 if (resourceLink.startsWith(FacetConstants.HANDLE_PREFIX)) { 75 try { 76 String handle = resourceLink.substring(FacetConstants.HANDLE_PREFIX.length()); 77 HandleValue values[] = new HandleResolver().resolveHandle(handle, new String[] { "URL" }, null); 78 for (HandleValue handleValue : values) { 79 String url = handleValue.getDataAsString(); 80 int index = url.lastIndexOf('/'); 81 if (index != -1) { 82 String name = url.substring(index + 1).trim(); 83 if (name.length() > 1) { 84 result = name + " (" + resourceLink + ")"; 85 } 86 break; 87 } 88 } 89 } catch (HandleException e) { 90 LOG.warn("Error trying to get the name of the handle", e); 91 } 92 } 93 } 73 // HandleResolver does not work at the moment on the clarin server see http://trac.clarin.eu/ticket/136, Disabled it for the release. 74 // if (resourceLink != null) { 75 // if (resourceLink.startsWith(FacetConstants.HANDLE_PREFIX)) { 76 // try { 77 // String handle = resourceLink.substring(FacetConstants.HANDLE_PREFIX.length()); 78 // HandleResolver handleResolver = new HandleResolver(); 79 // handleResolver.setTcpTimeout(5000);//5 secs, default is one minute 80 // HandleValue values[] = handleResolver.resolveHandle(handle, new String[] { "URL" }, null); 81 // 82 // for (HandleValue handleValue : values) { 83 // String url = handleValue.getDataAsString(); 84 // int index = url.lastIndexOf('/'); 85 // if (index != -1) { 86 // String name = url.substring(index + 1).trim(); 87 // if (name.length() > 1) { 88 // result = name + " (" + resourceLink + ")"; 89 // } 90 // break; 91 // } 92 // } 93 // } catch (HandleException e) { 94 // LOG.warn("Error trying to get the name of the handle", e); 95 // } 96 // } 97 // } 98 94 99 return result; 95 100 }
Note: See TracChangeset
for help on using the changeset viewer.