public class LoadLibraryPresentation {
private static final Logger log = Red5LoggerFactory.getLogger(LoadLibraryPresentation.class, OpenmeetingsVariables.webAppRootKey);
public static LibraryPresentation parseLibraryFileToObject(File file){
try {
LibraryPresentation lPresentation = new LibraryPresentation();
SAXReader reader = new SAXReader();
Document document = reader.read( new FileInputStream(file) );
Element root = document.getRootElement();
for ( @SuppressWarnings("unchecked")
Iterator<Element> i = root.elementIterator(); i.hasNext(); ) {
Element item = i.next();
log.debug(item.getName());
String nodeVal = item.getName();
//LinkedHashMap<String,Object> subMap = new LinkedHashMap<String,Object>();
//subMap.put("name", nodeVal);
if (nodeVal.equals("originalDocument")){
lPresentation.setOriginalDocument(createListObjectLibraryByFileDocument(item));
} else if (nodeVal.equals("pdfDocument")){
lPresentation.setPdfDocument(createListObjectLibraryByFileDocument(item));
} else if (nodeVal.equals("swfDocument")){
lPresentation.setSwfDocument(createListObjectLibraryByFileDocument(item));
} else if (nodeVal.equals("thumbs")) {
lPresentation.setThumbs(createListObjectLibraryByFileDocumentThumbs(item));
} else {
throw new Exception("Unkown Library type: "+nodeVal);
}