1 16 package org.outerj.daisy.navigation.impl; 17 18 import org.outerj.daisy.navigation.*; 19 import org.outerj.daisy.repository.Repository; 20 import org.outerj.daisy.repository.RepositoryException; 21 import org.outerj.daisy.repository.VariantKey; 22 import org.xml.sax.ContentHandler ; 23 import org.xml.sax.SAXException ; 24 25 29 public class NavigationManagerImpl implements NavigationManager { 30 private Repository repository; 31 private CommonNavigationManager commonNavigationManager; 32 33 public NavigationManagerImpl(Repository repository, CommonNavigationManager commonNavigationManager) { 34 this.repository = repository; 35 this.commonNavigationManager = commonNavigationManager; 36 } 37 38 public void generateNavigationTree(ContentHandler contentHandler, NavigationParams navigationParams, 39 VariantKey activeDocument, boolean handleErrors) throws NavigationException, SAXException { 40 commonNavigationManager.generateNavigationTree(contentHandler, navigationParams, activeDocument, 41 handleErrors, repository.getUserId(), repository.getActiveRoleIds()); 42 } 43 44 public void generatePreviewNavigationTree(ContentHandler contentHandler, String navigationTreeXml, 45 long branchId, long languageId) throws NavigationException, SAXException { 46 commonNavigationManager.generatePreviewNavigationTree(contentHandler, navigationTreeXml, branchId, languageId, 47 repository.getUserId(), repository.getActiveRoleIds()); 48 } 49 50 public NavigationLookupResult lookup(String navigationPath, long requestedBranchId, long requestedLanguageId, LookupAlternative[] lookupAlternatives) throws RepositoryException { 51 return commonNavigationManager.lookup(navigationPath, requestedBranchId, requestedLanguageId, lookupAlternatives, repository.getUserId(), repository.getActiveRoleIds()); 52 } 53 54 public String reverseLookup(VariantKey document, VariantKey navigationDoc, NavigationVersionMode versionMode) throws RepositoryException { 55 return commonNavigationManager.reverseLookup(document, navigationDoc, versionMode); 56 } 57 58 public String reverseLookup(VariantKey document, VariantKey navigationDoc) throws RepositoryException { 59 return commonNavigationManager.reverseLookup(document, navigationDoc, NavigationVersionMode.LIVE); 60 } 61 } 62 | Popular Tags |