1 /* 2 * Copyright 2012 Oracle Corporation. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.fatwire.gst.foundation.navigation; 17 18 import java.util.Collection; 19 20 import com.fatwire.assetapi.query.Query; 21 22 /** 23 * @author Dolf Dijkstra 24 * @since August 2012 25 * 26 */ 27 public interface NavigationService { 28 29 /** 30 * 31 * @param depth the maximum number of levels to retrieve 32 * @return the NavigationNodes for the page by this name. 33 */ 34 Collection<NavigationNode> getRootNodesForSite(int depth); 35 36 /** 37 * @param site 38 * @param depth the maximum number of levels to retrieve 39 * @return the NavigationNodes for the page by this name. 40 */ 41 Collection<NavigationNode> getRootNodesForSite(String site, int depth); 42 43 /** 44 * @param site 45 * @param depth the maximum number of levels to retrieve 46 * @param linkAttribute 47 * @return 48 */ 49 Collection<NavigationNode> getRootNodesForSite(String site, int depth, String linkAttribute); 50 51 /** 52 * @param pagename the name of the Page asset 53 * @return the NavigationNode for the page by this name. 54 */ 55 NavigationNode getNodeByName(String pagename, int depth); 56 57 /** 58 * @param site 59 * @param pagename the name of the Page asset 60 * @param depth the maximum number of levels to retrieve 61 * @return the NavigationNode for the page by this name. 62 */ 63 NavigationNode getNodeByName(String site, String pagename, int depth); 64 65 /** 66 * @param site 67 * @param pagename the name of the Page asset 68 * @param depth the maximum number of levels to retrieve 69 * @param linkAttribute 70 * 71 * @return the NavigationNode for the page by this name. 72 */ 73 NavigationNode getNodeByName(String site, String pagename, int depth, String linkAttribute); 74 75 /** 76 * Retrieves the NavigationNodes for the Page with the name 77 * <tt>pagename</tt> and in the current site. 78 * 79 * @param pagename the name of the Page asset 80 * @param depth the maximum number of levels to retrieve 81 * @param linkAttribute 82 * 83 * @return the NavigationNode for the page by this name. 84 */ 85 NavigationNode getNodeByName(String pagename, int depth, String linkAttribute); 86 87 /** 88 * @param query the asset query, needs to return Page assets 89 * @param depth the maximum number of levels to retrieve 90 * @param linkAttribute 91 * @return the NavigationNode for the page by this name. 92 */ 93 NavigationNode getNodeByQuery(Query query, int depth, String linkAttribute); 94 95 }