Changeset 33768 for main/trunk/greenstone3/src
- Timestamp:
- 2019-12-09T11:26:23+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraServiceProxy.java
r32429 r33768 1 1 /* 2 * ServiceRack.java2 * FedoraServiceProxy.java 3 3 * Copyright (C) 2002 New Zealand Digital Library, http://www.nzdl.org 4 4 * … … 742 742 } 743 743 744 /* //process method for stylesheet requests745 protected Element processFormat(Element request) {} */746 747 /* returns the service list for the subclass */748 /* protected Element getServiceList(String lang) {749 // for now, it is static and has no language stuff750 return (Element) this.short_service_info.cloneNode(true);751 }*/752 744 753 745 /** returns a specific service description */ … … 766 758 } 767 759 768 /** overloaded version for no args case */ 769 protected String getTextString(String key, String lang) { 770 return getTextString(key, lang, null, null); 771 } 772 773 protected String getTextString(String key, String lang, String dictionary) { 774 return getTextString(key, lang, dictionary, null); 775 } 776 protected String getTextString(String key, String lang, String [] args) { 777 return getTextString(key, lang, null, args); 778 } 779 780 /** getTextString - retrieves a language specific text string for the given 781 key and locale, from the specified resource_bundle (dictionary) 782 */ 783 protected String getTextString(String key, String lang, String dictionary, String[] args) { 784 785 // we want to use the collection class loader in case there are coll specific files 786 if (dictionary != null) { 787 // just try the one specified dictionary 788 Dictionary dict = new Dictionary(dictionary, lang, this.class_loader); 789 String result = dict.get(key, args); 790 if (result == null) { // not found 791 return "_"+key+"_"; 792 } 793 return result; 794 } 795 796 // now we try class names for dictionary names 797 String class_name = this.getClass().getName(); 798 class_name = class_name.substring(class_name.lastIndexOf('.')+1); 799 Dictionary dict = new Dictionary(class_name, lang, this.class_loader); 800 String result = dict.get(key, args); 801 if (result != null) { 802 return result; 803 } 804 805 // we have to try super classes 806 Class c = this.getClass().getSuperclass(); 807 while (result == null && c != null) { 808 class_name = c.getName(); 809 class_name = class_name.substring(class_name.lastIndexOf('.')+1); 810 if (class_name.equals("ServiceRack")) { 811 // this is as far as we go 812 break; 813 } 814 dict = new Dictionary(class_name, lang, this.class_loader); 815 result = dict.get(key, args); 816 c = c.getSuperclass(); 817 } 818 if (result == null) { 819 return "_"+key+"_"; 820 } 821 return result; 822 823 } 824 825 protected String getMetadataNameText(String key, String lang) { 826 827 String properties_name = "metadata_names"; 828 Dictionary dict = new Dictionary(properties_name, lang); 829 830 String result = dict.get(key); 831 if (result == null) { // not found 832 return null; 833 } 834 return result; 835 } 760 836 761 837 762 public static class BasicTextMacroResolver extends MacroResolver {
Note:
See TracChangeset
for help on using the changeset viewer.