Source Code Cross Referenced for IndexingViewBean.java in  » Portal » Open-Portal » com » sun » portal » search » admin » 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 » Portal » Open Portal » com.sun.portal.search.admin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
003:         * PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
004:         */
005:
006:        package com.sun.portal.search.admin;
007:
008:        import java.net.URL;
009:        import java.io.*;
010:        import java.lang.*;
011:        import java.util.*;
012:
013:        import com.sun.portal.search.robot.ProcessConfig;
014:        import com.sun.portal.search.admin.CSViewBeanBase; //import com.sun.portal.search.admin.cli.RobotController;
015:
016:        import javax.servlet.http.HttpServletRequest;
017:
018:        import com.iplanet.jato.RequestContext;
019:
020:        import com.iplanet.jato.view.event.DisplayEvent;
021:        import com.iplanet.jato.view.event.RequestInvocationEvent;
022:
023:        import com.iplanet.jato.view.html.*;
024:
025:        import com.iplanet.jato.view.View;
026:        import com.iplanet.jato.view.ViewBean;
027:        import com.iplanet.jato.view.ViewBeanBase;
028:
029:        import com.iplanet.jato.ViewBeanManager;
030:
031:        import com.iplanet.jato.model.ModelControlException;
032:
033:        //import com.iplanet.am.console.components.view.html.ParentagePath;
034:        import com.iplanet.am.console.components.view.html.IPlanetButton;
035:
036:        //import com.sun.portal.search.admin.model.PropertiesModel;
037:        //import com.sun.portal.search.admin.model.PropertiesModelImpl;
038:
039:        public class IndexingViewBean extends CSViewBeanBase {
040:            /**
041:             * constructor
042:             *
043:             * @param PageName  of this view bean
044:             * @param displayURL  default display URL
045:             */
046:            public IndexingViewBean() {
047:                super (PAGE_NAME);
048:                setDefaultDisplayURL(DEFAULT_DISPLAY_URL);
049:                registerChildren();
050:                filterConfigurator.readFilterToArray();
051:            }
052:
053:            /**
054:             * register child component
055:             */
056:            protected void registerChildren() {
057:                //
058:                // Indexing
059:                //
060:                registerChild(INDEXING_RADIO, RadioButtonGroup.class);
061:                registerChild(INDEXING_TEXT, TextField.class);
062:                //
063:                //  Document Converters
064:                //
065:                registerChild(DOC_LIST, ConverterListView.class);
066:                registerChild(CONTIMEOUT_TEXT, TextField.class);
067:                //
068:                //  Advanced
069:                //
070:                registerChild(EXTRACTTOC_CHECK, CheckBox.class);
071:                registerChild(EXTRACTMETA_CHECK, CheckBox.class);
072:                registerChild(ALLOW_NONEXIST_CLASS_CHECK, CheckBox.class);
073:
074:                registerChild(RESET_BUTTON, IPlanetButton.class);
075:                registerChild(SUBMIT_BUTTON, IPlanetButton.class);
076:
077:            }
078:
079:            /**
080:             * create child component
081:             *
082:             * @param name of component
083:             * @return child component
084:             */
085:            protected View createChild(String name) {
086:                View Headerchild = super .createChild(name);
087:                if (Headerchild != null)
088:                    return Headerchild;
089:                //
090:                // Indexing
091:                //
092:                if (name.equals(INDEXING_RADIO)) {
093:                    RadioButtonGroup child = new RadioButtonGroup(this ,
094:                            INDEXING_RADIO, "partial");
095:                    OptionList IndexingOptions = new OptionList(
096:                            getLocalizedStringArray(
097:                                    "robot.indexing.extraction.indexlistlabel",
098:                                    ","), getLocalizedStringArray(
099:                                    "robot.indexing.extraction.indexlistvalue",
100:                                    ","));
101:                    child.setOptions(IndexingOptions);
102:                    return child;
103:                }
104:                if (name.equals(INDEXING_TEXT)) {
105:                    return new TextField(this , INDEXING_TEXT, "");
106:                }
107:                //
108:                //  Document Converters
109:                //
110:                if (name.equals(DOC_LIST)) {
111:                    return new ConverterListView(this , DOC_LIST);
112:                }
113:                if (name.equals(CONTIMEOUT_TEXT)) {
114:                    return new TextField(this , CONTIMEOUT_TEXT, "");
115:                }
116:                //
117:                //  Advanced
118:                //
119:                if (name.equals(EXTRACTTOC_CHECK)) {
120:                    return new CheckBox(this , EXTRACTTOC_CHECK, "true",
121:                            "false", true);
122:                }
123:                if (name.equals(EXTRACTMETA_CHECK)) {
124:                    return new CheckBox(this , EXTRACTMETA_CHECK, "true",
125:                            "false", true);
126:                }
127:                if (name.equals(ALLOW_NONEXIST_CLASS_CHECK)) {
128:                    return new CheckBox(this , ALLOW_NONEXIST_CLASS_CHECK,
129:                            "true", "false", true);
130:                }
131:                if (name.equals(SUBMIT_BUTTON)) {
132:                    return new IPlanetButton(this , SUBMIT_BUTTON, "");
133:                }
134:                if (name.equals(RESET_BUTTON)) {
135:                    return new IPlanetButton(this , RESET_BUTTON, "");
136:                }
137:
138:                throw new IllegalArgumentException("Invalid child name ["
139:                        + name + "]");
140:            }
141:
142:            /** begin displaying page. we set the required information
143:             *
144:             * @param event   display event
145:             * @throws ModelControlException  if problem access value of component
146:             */
147:            public void beginDisplay(DisplayEvent event) {
148:                setPageEncoding();
149:                setDisplayFieldValue(SUBMIT_BUTTON,
150:                        getLocalizedString("submit.text"));
151:                setDisplayFieldValue(RESET_BUTTON,
152:                        getLocalizedString("reset.text"));
153:
154:                ProcessConfig processConf = CSConfig.getRobotConfig().processConf;
155:                // One ring from robot.conf
156:                //    filterConfigurator.readFilterToArray();
157:                // Strange interdependecies on the first two
158:                String bytesIndex = filterConfigurator.getFilterConfVars(
159:                        "Generate", "extract-full-text", "truncate", "0");
160:                if (bytesIndex.equals("0")) {
161:                    whichExtract = "full";
162:                    extractFirst = "";
163:                } else {
164:                    whichExtract = "partial";
165:                    extractFirst = bytesIndex;
166:                }
167:                this .setDisplayFieldValue(this .INDEXING_TEXT, extractFirst);
168:                this .setDisplayFieldValue(this .INDEXING_RADIO, whichExtract);
169:                this .setDisplayFieldValue(this .EXTRACTTOC_CHECK,
170:                        filterConfigurator.getFilterConfVars("Generate",
171:                                "extract-html-toc", "enable", "true"));
172:                this .setDisplayFieldValue(this .EXTRACTMETA_CHECK,
173:                        filterConfigurator.getFilterConfVars("Generate",
174:                                "extract-html-meta", "enable", "true"));
175:                // Converter Timeout
176:                String conv_timeout = (String) processConf
177:                        .get("convert-timeout");
178:                this .setDisplayFieldValue(this .CONTIMEOUT_TEXT, conv_timeout);
179:                String allowNonClass = (String) processConf
180:                        .get("allow-nonexist-classification");
181:                if (allowNonClass != null) {
182:                    if (!allowNonClass.equalsIgnoreCase("true")
183:                            && !allowNonClass.equalsIgnoreCase("yes")) {
184:                        setDisplayFieldValue(ALLOW_NONEXIST_CLASS_CHECK,
185:                                "false");
186:                    }
187:                }
188:
189:            }
190:
191:            public void handleSubmitButtonRequest(RequestInvocationEvent event)
192:                    throws ModelControlException {
193:
194:                // First update the converter wraiths
195:                ConverterListView child = (ConverterListView) this 
196:                        .getChild(this .DOC_LIST);
197:                child.updateData();
198:
199:                //   Then do the one thing to the robot.conf 
200:                ProcessConfig processConf = CSConfig.getRobotConfig().processConf;
201:                // Command Priviledges
202:                String conv_timeoutout = this 
203:                        .getDisplayFieldStringValue(this .CONTIMEOUT_TEXT);
204:                processConf.put("convert-timeout", conv_timeoutout);
205:                boolean allowNonClass = this 
206:                        .getDisplayFieldBooleanValue(ALLOW_NONEXIST_CLASS_CHECK);
207:                processConf.put("allow-nonexist-classification",
208:                        (allowNonClass ? "true" : "false"));
209:                // update robot.conf
210:                processConf.updateFile();
211:
212:                // Lastly, the very nasty filter.conf stuff. 
213:                //	filterConfigurator.readFilterToArray();
214:                // index extration text (2 places)
215:                String index_ext_txt = this 
216:                        .getDisplayFieldStringValue(this .INDEXING_TEXT);
217:                String index_radio_but = this 
218:                        .getDisplayFieldStringValue(this .INDEXING_RADIO);
219:                if (index_radio_but.equals("full")) {
220:                    index_ext_txt = "0"; //no limit 
221:                }
222:                filterConfigurator.setFilterConfVars("Generate",
223:                        "extract-full-text", "truncate", index_ext_txt);
224:                filterConfigurator.setFilterConfVars("Generate",
225:                        "extract-html-text", "truncate", index_ext_txt);
226:
227:                // Extract things
228:                String toc_tst = this 
229:                        .getDisplayFieldStringValue(this .EXTRACTTOC_CHECK);
230:                filterConfigurator.setFilterConfVars("Generate",
231:                        "extract-html-toc", "enable", toc_tst);
232:                String meta_tst = this 
233:                        .getDisplayFieldStringValue(this .EXTRACTMETA_CHECK);
234:                filterConfigurator.setFilterConfVars("Generate",
235:                        "extract-html-meta", "enable", meta_tst);
236:
237:                filterConfigurator.updateFilterConf();
238:
239:                this .forwardTo();
240:
241:            }
242:
243:            public void handleResetButtonRequest(RequestInvocationEvent event)
244:                    throws ModelControlException {
245:                clearPageSessionAttributes();
246:                forwardTo();
247:            }
248:
249:            String extractFirst = null;
250:            String whichExtract = null;
251:            String showMeta = "false";
252:            String showHtml = "false";
253:
254:            public static final String DEFAULT_DISPLAY_URL = "/ps/searchadmin/Indexing.jsp";
255:            public static final String PAGE_NAME = "Indexing";
256:            //
257:            // Indexing
258:            //
259:            public static final String INDEXING_RADIO = "IndexingRadio";
260:            public static final String INDEXING_TEXT = "IndexingText";
261:            //
262:            //  Document Converters
263:            //
264:
265:            public static final String DOC_LIST = "ConverterList";
266:            public static final String CONTIMEOUT_TEXT = "ConTimeOutText";
267:
268:            //
269:            //  Advanced
270:            //
271:            public static final String EXTRACTTOC_CHECK = "ExtractTOCCheck";
272:            public static final String EXTRACTMETA_CHECK = "ExtractMetaCheck";
273:            public static final String ALLOW_NONEXIST_CLASS_CHECK = "AllowNonexistClassCheck";
274:
275:            public static final String RESET_BUTTON = "ResetButton";
276:            public static final String SUBMIT_BUTTON = "SubmitButton";
277:
278:            // Option lists
279:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.