1 16 package org.outerj.daisy.navigation.impl; 17 18 import org.outerj.daisy.repository.RepositoryException; 19 import org.outerj.daisy.repository.VariantKey; 20 import org.xml.sax.ContentHandler ; 21 import org.xml.sax.SAXException ; 22 import org.xml.sax.helpers.AttributesImpl ; 23 24 import java.util.List ; 25 import java.util.Map ; 26 27 public class ErrorNode implements Node { 28 private String message; 29 30 public ErrorNode(String message) { 31 this.message = message; 32 } 33 34 public void searchPath(String [] path, int pos, long branchId, long languageId, Node[] foundPath) throws RepositoryException { 35 } 37 38 public List searchDocument(VariantKey document) throws RepositoryException { 39 return null; 40 } 41 42 public void populateNodeLookupMap(Map map, String path) throws RepositoryException { 43 } 45 46 public boolean checkId(String id, long branchId, long languageId) { 47 return false; 48 } 49 50 public boolean isExpandable() throws RepositoryException { 51 return false; 52 } 53 54 public List getExpandedChildList() throws RepositoryException { 55 return null; 56 } 57 58 public void generateXml(ContentHandler contentHandler, Node[] activeNodePath, int pos, boolean contextualized, String path, long userId, long[] roleIds) throws RepositoryException, SAXException { 59 generateXml(contentHandler, 0, null, userId, roleIds); 60 } 61 62 public void generateXml(ContentHandler contentHandler, int depth, String path, long userId, long[] roleIds) throws RepositoryException, SAXException { 63 AttributesImpl attrs = new AttributesImpl (); 64 attrs.addAttribute("", "message", "message", "CDATA", message); 65 contentHandler.startElement(NAVIGATION_NS, "error", "error", attrs); 66 contentHandler.endElement(NAVIGATION_NS, "error", "error"); 67 } 68 69 public boolean isIdentifiable() { 70 return false; 71 } 72 73 public String getId() { 74 return null; 75 } 76 77 public boolean isVisible(long userId, long[] roleIds, Node[] activeNodePath, int activeNodePathPos) throws RepositoryException { 78 return true; 79 } 80 } 81 | Popular Tags |