KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > navigation > impl > Node


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
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 org.outerj.daisy.navigation.impl;
17
18 import org.outerj.daisy.repository.VariantKey;
19 import org.outerj.daisy.repository.RepositoryException;
20 import org.xml.sax.ContentHandler JavaDoc;
21 import org.xml.sax.SAXException JavaDoc;
22
23 import java.util.List JavaDoc;
24 import java.util.Map JavaDoc;
25
26 public interface Node {
27     /**
28      *
29      * @param path the path we're looking for, each array element contains an id
30      * @param pos the current position in the array
31      * @param branchId
32      * @param languageId
33      * @param foundPath as the corresponding path nodes are found, they should be assigned
34      */

35     void searchPath(String JavaDoc[] path, int pos, long branchId, long languageId, Node[] foundPath) throws RepositoryException;
36
37     List JavaDoc searchDocument(VariantKey document) throws RepositoryException;
38
39     /**
40      * Nodes representing documents should add themselves to the map, using as
41      * key a VariantKey object and as value
42      * a String object representing the navigation tree path. A node should not
43      * add itself to the map if there is already another mapping for its document ID
44      * in the map.
45      */

46     void populateNodeLookupMap(Map JavaDoc map, String JavaDoc path) throws RepositoryException;
47
48     /**
49      * Returns true if the id of this node equals the specified id.
50      */

51     boolean checkId(String JavaDoc id, long branchId, long languageId) throws RepositoryException;
52
53     /**
54      * Returns true for expandable nodes, these are nodes which themselves
55      * are not a part of the generated navigation tree, but are replaced by
56      * one or more other nodes.
57      */

58     boolean isExpandable() throws RepositoryException;
59
60     /**
61      * Returns a list of the child nodes for which the nodes for which
62      * {@link #isExpandable()} returns true are not included, but instead
63      * replaced by their children (recursively). This includes both
64      * visible and non-visible nodes.
65      */

66     List JavaDoc getExpandedChildList() throws RepositoryException;
67
68     void generateXml(ContentHandler JavaDoc contentHandler, Node[] activeNodePath, int pos, boolean contextualized,
69             String JavaDoc path, long userId, long[] roleIds) throws RepositoryException, SAXException JavaDoc;
70
71     /**
72      * Generates a full, non-contextualized navigation tree up to the specified depth.
73      * Specify a depth of -1 to get the full tree.
74      */

75     void generateXml(ContentHandler JavaDoc contentHandler, int depth, String JavaDoc path, long userId, long[] roleIds) throws RepositoryException, SAXException JavaDoc;
76
77     /**
78      * Returns true if this node has an ID and will generate a corresponding node in
79      * the output tree.
80      */

81     boolean isIdentifiable() throws RepositoryException;
82
83     /**
84      * Returns the id of this node, only works when {@link #isIdentifiable()} returns true,
85      * otherwise throws an UnsupportedOperationException.
86      */

87     String JavaDoc getId() throws RepositoryException;
88
89     /**
90      * Returns true if this node or any of its chilren would produce a visible node in the
91      * generated navigation tree.
92      *
93      * @param activeNodePath this parameter can be null (if there is not active node path)
94      */

95     boolean isVisible(long userId, long[] roleIds, Node[] activeNodePath, int activeNodePathPos) throws RepositoryException;
96
97     public static final String JavaDoc NAVIGATION_NS = "http://outerx.org/daisy/1.0#navigation";
98 }
99
Popular Tags