Source Code Cross Referenced for EditTextController.java in  » Project-Management » EmForce » ru » emdev » EmForge » web » bean » 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 » Project Management » EmForce » ru.emdev.EmForge.web.bean 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package ru.emdev.EmForge.web.bean;
002:
003:        import java.io.IOException;
004:
005:        import javax.faces.context.FacesContext;
006:        import javax.servlet.http.HttpServletRequest;
007:
008:        import org.apache.commons.lang.StringUtils;
009:        import org.jdom.JDOMException;
010:        import org.springframework.beans.factory.InitializingBean;
011:
012:        import ru.emdev.EmForge.wiki.WikiTextToXHTMLConverter;
013:        import ru.emdev.EmForge.wiki.web.bean.BaseWikiControllerImpl;
014:
015:        import com.ecyrd.jspwiki.WikiEngine;
016:        import com.ecyrd.jspwiki.htmltowiki.HtmlStringToWikiTranslator;
017:
018:        public class EditTextController implements  InitializingBean {
019:
020:            private WikiEngine m_wikiEngine;
021:            private String m_wikiText;
022:            private String m_htmlText;
023:            private String m_pageName;
024:
025:            /**
026:             * @param i_wikiEngine
027:             */
028:            public void setWikiEngine(WikiEngine i_wikiEngine) {
029:
030:                m_wikiEngine = i_wikiEngine;
031:            }
032:
033:            /**
034:             * @param i_text
035:             */
036:            public void setWikiText(String i_text) {
037:
038:                m_wikiText = i_text;
039:            }
040:
041:            /**
042:             * @return
043:             */
044:            public String getWikiText() {
045:
046:                return m_wikiText;
047:            }
048:
049:            /**
050:             * @return
051:             */
052:            public String getHtmlText() {
053:
054:                if (m_htmlText == null) {
055:                    m_htmlText = new WikiTextToXHTMLConverter(m_wikiEngine,
056:                            getPageName()).getAsString(FacesContext
057:                            .getCurrentInstance(), null, m_wikiText);
058:                }
059:
060:                return m_htmlText;
061:            }
062:
063:            /**
064:             * @param i_htmlText
065:             * @throws IOException
066:             * @throws JDOMException
067:             */
068:            public void setHtmlText(String i_htmlText) throws IOException,
069:                    JDOMException {
070:
071:                // convert html into wiki
072:
073:                m_wikiText = convertHtmlToWiki(i_htmlText);
074:            }
075:
076:            /**
077:             * @param pageName
078:             */
079:            public void setPageName(String pageName) {
080:
081:                if (StringUtils.isEmpty(pageName)
082:                        && StringUtils.isNotEmpty(m_pageName)) {
083:                    // do not change name in this case
084:                } else {
085:                    m_pageName = pageName;
086:                }
087:            }
088:
089:            /**
090:             * @return
091:             */
092:            public String getPageName() {
093:
094:                return m_pageName;
095:            }
096:
097:            /**
098:             * @param i_htmlText
099:             * @return
100:             * @throws IOException
101:             * @throws JDOMException
102:             */
103:            private String convertHtmlToWiki(String i_htmlText)
104:                    throws IOException, JDOMException {
105:
106:                return new HtmlStringToWikiTranslator().translate(i_htmlText);
107:            }
108:
109:            /**
110:             * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
111:             */
112:            public void afterPropertiesSet() throws Exception {
113:
114:                setPageName(getPageParam());
115:            }
116:
117:            /**
118:             * @return
119:             */
120:            protected String getPageParam() {
121:
122:                return getParam(BaseWikiControllerImpl.PAGE_PARAM_NAME);
123:            }
124:
125:            /**
126:             * @param i_paramName
127:             * @return
128:             */
129:            protected String getParam(String i_paramName) {
130:
131:                return ((HttpServletRequest) FacesContext.getCurrentInstance()
132:                        .getExternalContext().getRequest())
133:                        .getParameter(i_paramName);
134:            }
135:
136:            /**
137:             * @return
138:             */
139:            public String getFormattedWikiText() {
140:
141:                WikiTextToXHTMLConverter converter = new WikiTextToXHTMLConverter(
142:                        m_wikiEngine, getPageName());
143:
144:                return converter.getAsString(FacesContext.getCurrentInstance(),
145:                        null, m_wikiText);
146:            }
147:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.