itemResourceId = resourceHelper.getId(node.getParentNode()); Document resourceDescriptor = resourceHelper.getDescriptor(manifestHelper.getResourceForId(itemResourceId, this.archiveManifest)); if (resourceHelper.isFolder(resourceDescriptor) || ("item".equals(tag) && (XPathHelper.selectNodes("./item", node).size() > 0)) || ( "item".equals(tag) && isCompoundDocument(manifestHelper.getResourceForId(itemResourceId, archiveManifest),resourceDescriptor) )) { String folderTitle = getTitleForNode(node); if (isCompoundDocument(manifestHelper.getResourceForId(itemResourceId, archiveManifest),resourceDescriptor)) { if (wantsCompanionForCompoundDocument()) { priority++; branchOfImportables.add(getCompanionForCompoundDocument(resourceDescriptor, folder)); branchOfImportables.addAll(translateFromNodeToImportables(manifestHelper.getResourceForId(itemResourceId, archiveManifest), folderPath, priority, folder)); } else { List children = XPathHelper.selectNodes("./item", node); Node resourceNode = manifestHelper.getResourceForId(itemResourceId, this.archiveManifest); if (resourceNode != null) { if (parent == null) {
Node resourceNode; String targetType; List topLevelItems = manifestHelper.getTopLevelItemNodes(this.archiveManifest); for(Iterator i = topLevelItems.iterator(); i.hasNext(); ) { topLevelItem = (Node)i.next(); resourceNode = manifestHelper.getResourceForId(resourceId, this.archiveManifest); targetType = XPathHelper.getNodeValue("/COURSETOC/TARGETTYPE/@value", resourceHelper.getDescriptor(resourceNode)); if (!(("CONTENT".equals(targetType)) || ("STAFF_INFO").equals(targetType))) continue;
protected Collection getImportableItemsFromArchive(String pathToData) { Collection rv = new ArrayList(); Document manifest = this.archiveManifest; List itemNodes = manifestHelper.getTopLevelItemNodes(manifest); List resourceNodes = manifestHelper.getResourceNodes(manifest); Node resourceNode; // set up a Map of resource Nodes keyed on their identifier attribute for(Iterator i = resourceNodes.iterator(); i.hasNext();) { resourceNode = (Node) i.next(); resourceMap.put(resourceHelper.getId(resourceNode), resourceNode); } Node itemNode; int priority = 1; for(Iterator i = itemNodes.iterator(); i.hasNext(); ) { itemNode = (Node) i.next(); String title = itemHelper.getTitle(itemNode); rv.addAll(translateFromNodeToImportables(itemNode, "", priority, null)); priority++; } // the remainder of resources in the resourcesMap need to be processed Object[] remainingRes = resourceMap.values().toArray(); for (int i = 0;i < remainingRes.length; i++) { resourceNode = (Node)remainingRes[i]; rv.addAll(translateFromNodeToImportables(resourceNode, "",i+1, null)); resourceMap.remove(XPathHelper.getNodeValue("./attribute::identifier", resourceNode)); } return rv; }
itemResourceId = resourceHelper.getId(node.getParentNode()); Document resourceDescriptor = resourceHelper.getDescriptor(manifestHelper.getResourceForId(itemResourceId, this.archiveManifest)); if (resourceHelper.isFolder(resourceDescriptor) || ("item".equals(tag) && (XPathHelper.selectNodes("./item", node).size() > 0)) || ( "item".equals(tag) && isCompoundDocument(manifestHelper.getResourceForId(itemResourceId, archiveManifest),resourceDescriptor) )) { String folderTitle = getTitleForNode(node); if (isCompoundDocument(manifestHelper.getResourceForId(itemResourceId, archiveManifest),resourceDescriptor)) { if (wantsCompanionForCompoundDocument()) { priority++; branchOfImportables.add(getCompanionForCompoundDocument(resourceDescriptor, folder)); branchOfImportables.addAll(translateFromNodeToImportables(manifestHelper.getResourceForId(itemResourceId, archiveManifest), folderPath, priority, folder)); } else { List children = XPathHelper.selectNodes("./item", node); Node resourceNode = manifestHelper.getResourceForId(itemResourceId, this.archiveManifest); if (resourceNode != null) { if (parent == null) {
List topLevelItems = manifestHelper.getTopLevelItemNodes(this.archiveManifest); for(Iterator i = topLevelItems.iterator(); i.hasNext(); ) { topLevelItem = (Node)i.next();
ImportMetadata im; Node topLevelItem; List topLevelItems = manifestHelper.getTopLevelItemNodes(this.archiveManifest); for(Iterator i = topLevelItems.iterator(); i.hasNext(); ) { topLevelItem = (Node)i.next();
List topLevelItems = manifestHelper.getTopLevelItemNodes(this.archiveManifest); for(Iterator i = topLevelItems.iterator(); i.hasNext(); ) { topLevelItem = (Node)i.next();
protected Collection getImportableItemsFromArchive(String pathToData) { Collection rv = new ArrayList(); Document manifest = this.archiveManifest; List itemNodes = manifestHelper.getTopLevelItemNodes(manifest); List resourceNodes = manifestHelper.getResourceNodes(manifest); Node resourceNode; // set up a Map of resource Nodes keyed on their identifier attribute for(Iterator i = resourceNodes.iterator(); i.hasNext();) { resourceNode = (Node) i.next(); resourceMap.put(resourceHelper.getId(resourceNode), resourceNode); } Node itemNode; int priority = 1; for(Iterator i = itemNodes.iterator(); i.hasNext(); ) { itemNode = (Node) i.next(); String title = itemHelper.getTitle(itemNode); rv.addAll(translateFromNodeToImportables(itemNode, "", priority, null)); priority++; } // the remainder of resources in the resourcesMap need to be processed Object[] remainingRes = resourceMap.values().toArray(); for (int i = 0;i < remainingRes.length; i++) { resourceNode = (Node)remainingRes[i]; rv.addAll(translateFromNodeToImportables(resourceNode, "",i+1, null)); resourceMap.remove(XPathHelper.getNodeValue("./attribute::identifier", resourceNode)); } return rv; }
public String getDescription(Node itemNode) { String resourceId = XPathHelper.getNodeValue("./@identifierref", itemNode); Node resourceNode = manifestHelper.getResourceForId(resourceId, archiveManifest); return resourceHelper.getDescription(resourceNode); }
public String getDescription(Node itemNode) { String resourceId = XPathHelper.getNodeValue("./@identifierref", itemNode); Node resourceNode = manifestHelper.getResourceForId(resourceId, archiveManifest); return resourceHelper.getDescription(resourceNode); }
public String getDescription(Node itemNode) { String resourceId = XPathHelper.getNodeValue("./@identifierref", itemNode); Node resourceNode = manifestHelper.getResourceForId(resourceId, archiveManifest); return resourceHelper.getDescription(resourceNode); }
public String getDescription(Node itemNode) { String resourceId = XPathHelper.getNodeValue("./@identifierref", itemNode); Node resourceNode = manifestHelper.getResourceForId(resourceId, archiveManifest); return resourceHelper.getDescription(resourceNode); }