Changeset 31166
- Timestamp:
- 2016-12-01T01:22:35+13:00 (6 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/gsdl3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/PageAction.java
r30836 r31166 160 160 info_response.appendChild(doc.importNode(group_list, true)); 161 161 } 162 Element path_list = (Element) GSXML.getChildByTagName(group_info_response, 163 GSXML.PATH_ELEM + GSXML.LIST_MODIFIER); 164 if (path_list != null) { 165 info_response.appendChild(doc.importNode(path_list, true)); 166 } 162 167 // Send message to groupInfoType Services 163 168 } else { -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CollectionGroups.java
r31109 r31166 173 173 } 174 174 175 } 176 177 178 175 } else { 176 Element groupDescription = getPathInfo(groupPath); 177 if (groupContent != null){ 178 result.appendChild(doc.importNode(groupDescription, true)); 179 } 180 } 179 181 } 180 182 … … 298 300 299 301 } 302 private Element getPathInfo(String path) { 303 304 if (hierarchy == null || groupDesc == null) { 305 return null; 306 } 307 308 Document doc = XMLConverter.newDOM(); 309 310 if (path == null) { 311 path = ""; 312 } 313 String[] pathSteps = path.split("/"); 314 315 Element pathInfo = doc.createElement(GSXML.PATH_ELEM + GSXML.LIST_MODIFIER); 316 317 String currentPath = ""; 318 for (int i = 0; i < pathSteps.length; i++) { 319 if (!pathSteps[i].isEmpty()) { 320 currentPath += "/" + pathSteps[i]; 321 Element pathStepDescription = getGroupDescription(pathSteps[i]); 322 if (pathStepDescription != null){ 323 pathStepDescription.setAttribute(GSXML.POSITION_ATT, String.valueOf(i)); 324 pathStepDescription.setAttribute(GSXML.PATH_ATT, currentPath); 325 pathInfo.appendChild(doc.importNode(pathStepDescription, true)); 326 } 327 } 328 } 329 330 return pathInfo; 331 } 300 332 301 333 } -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
r30831 r31166 82 82 public static final String FORMAT_STRING_ELEM = "formatString"; 83 83 public static final String EXTRA_METADATA = "extraMetadata"; 84 public static final String PATH_ELEM = "path"; 84 85 85 86 //config file elems … … 162 163 public static final String HIDDEN_ATT = "hidden"; 163 164 public static final String FACET_ATT = "facet"; 165 public static final String PATH_ATT = "path"; 164 166 165 167 // document stuff
Note:
See TracChangeset
for help on using the changeset viewer.