Source Code Cross Referenced for NavigationLookupResult.java in  » Content-Management-System » daisy » org » outerj » daisy » navigation » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » daisy » org.outerj.daisy.navigation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004 Outerthought bvba and Schaubroeck nv
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.outerj.daisy.navigation;
017:
018:        import org.outerx.daisy.x10Navigationspec.NavigationLookupResultDocument;
019:        import org.outerj.daisy.repository.VariantKey;
020:
021:        /**
022:         * Encapsulates information about the result of a navigation tree lookup.
023:         * Either the lookup matched a document node in which case the variantKey
024:         * field will identify that document, and the navigationPath
025:         * field will contain the corresponding path in the navigation tree (the
026:         * same as the one provided when doing the lookup).
027:         *
028:         * <p>If the lookup matched
029:         * a group node or the lookup didn't match but the path ended on a document
030:         * ID and the document is found at another location in the tree of one
031:         * of the lookup variants, the redirect field will be true, the navigationPath
032:         * field will contain the path to where to redirect, and the lookupAlternativeName
033:         * will contain the name of the lookupAlternative which matched.
034:         *
035:         * <p>If the lookup didn't match and the path ended on a document ID but
036:         * the document ID does not occur in the tree, then the redirect field will
037:         * be false, the navigationPath will contain an empty string and the variantKey
038:         * field will contain a variant key with that document ID and the branch
039:         * and language of the navigation tree document.
040:         *
041:         * <p>In all other cases, the notFound field will be true.
042:         */
043:        public class NavigationLookupResult {
044:            private VariantKey variantKey = null;
045:            private String lookupAlternativeName;
046:            private String navigationPath;
047:            private boolean redirect;
048:            private boolean notFound;
049:
050:            private NavigationLookupResult() {
051:            }
052:
053:            public static NavigationLookupResult createMatchResult(
054:                    VariantKey variantKey, String navigationPath) {
055:                NavigationLookupResult lookupResult = new NavigationLookupResult();
056:                lookupResult.variantKey = variantKey;
057:                lookupResult.navigationPath = navigationPath;
058:                lookupResult.redirect = false;
059:                return lookupResult;
060:            }
061:
062:            public static NavigationLookupResult createRedirectResult(
063:                    String lookupAlternativeName, String navigationPath,
064:                    VariantKey variantKey) {
065:                NavigationLookupResult lookupResult = new NavigationLookupResult();
066:                lookupResult.lookupAlternativeName = lookupAlternativeName;
067:                lookupResult.navigationPath = navigationPath;
068:                lookupResult.redirect = true;
069:                lookupResult.variantKey = variantKey;
070:                return lookupResult;
071:            }
072:
073:            public static NavigationLookupResult createNotFoundResult() {
074:                NavigationLookupResult lookupResult = new NavigationLookupResult();
075:                lookupResult.notFound = true;
076:                return lookupResult;
077:            }
078:
079:            public static NavigationLookupResult createFromXml(
080:                    NavigationLookupResultDocument.NavigationLookupResult resultXml) {
081:                NavigationLookupResult lookupResult = new NavigationLookupResult();
082:                if (resultXml.isSetNotFound())
083:                    lookupResult.notFound = resultXml.getNotFound();
084:                if (resultXml.isSetRedirect())
085:                    lookupResult.redirect = resultXml.getRedirect();
086:                if (resultXml.isSetDocumentId()) {
087:                    lookupResult.variantKey = new VariantKey(resultXml
088:                            .getDocumentId(), resultXml.getBranchId(),
089:                            resultXml.getLanguageId());
090:                }
091:                if (resultXml.isSetPath())
092:                    lookupResult.navigationPath = resultXml.getPath();
093:                if (resultXml.isSetLookupAlternativeName())
094:                    lookupResult.lookupAlternativeName = resultXml
095:                            .getLookupAlternativeName();
096:
097:                return lookupResult;
098:            }
099:
100:            public VariantKey getVariantKey() {
101:                return variantKey;
102:            }
103:
104:            public String getNavigationPath() {
105:                return navigationPath;
106:            }
107:
108:            public boolean isRedirect() {
109:                return redirect;
110:            }
111:
112:            public boolean isNotFound() {
113:                return notFound;
114:            }
115:
116:            public String getLookupAlternativeName() {
117:                return lookupAlternativeName;
118:            }
119:
120:            public NavigationLookupResultDocument getXml() {
121:                NavigationLookupResultDocument resultDocument = NavigationLookupResultDocument.Factory
122:                        .newInstance();
123:                NavigationLookupResultDocument.NavigationLookupResult resultXml = resultDocument
124:                        .addNewNavigationLookupResult();
125:
126:                if (notFound)
127:                    resultXml.setNotFound(true);
128:                if (redirect)
129:                    resultXml.setRedirect(true);
130:                if (variantKey != null) {
131:                    resultXml.setDocumentId(variantKey.getDocumentId());
132:                    resultXml.setBranchId(variantKey.getBranchId());
133:                    resultXml.setLanguageId(variantKey.getLanguageId());
134:                }
135:                if (navigationPath != null)
136:                    resultXml.setPath(navigationPath);
137:                if (lookupAlternativeName != null)
138:                    resultXml.setLookupAlternativeName(lookupAlternativeName);
139:
140:                return resultDocument;
141:            }
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.