Changeset 31166 for main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CollectionGroups.java
- Timestamp:
- 2016-12-01T01:22:35+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.