KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > htmlparser > HtmlParserService


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12
//
13
package org.jahia.services.htmlparser;
14
15 import java.util.Iterator JavaDoc;
16 import java.util.Vector JavaDoc;
17
18 import org.jahia.engines.EngineMessages;
19 import org.jahia.exceptions.JahiaException;
20 import org.jahia.services.JahiaService;
21 import org.jahia.settings.SettingsBean;
22
23 /**
24  *
25  * <p>Title: Html parsing service </p>
26  * <p>Description: </p>
27  * <p>Copyright: Copyright (c) 2002</p>
28  * <p>Company: </p>
29  * @author Khue Nguyen
30  * @version 1.0
31  */

32 public abstract class HtmlParserService extends JahiaService
33 {
34
35     /**
36      *
37      * @return SettingsBean
38      */

39     public abstract SettingsBean getSettingsBean();
40
41     /**
42      * Return a parser no regard to a specific site.
43      *
44      * @return
45      */

46     public abstract HtmlParser getParser();
47
48     /**
49      * Return a parser for a given site.
50      *
51      * @param siteId
52      * @return
53      */

54     public abstract HtmlParser getParser(int siteId);
55
56     /**
57      * Parse an input document, checkout html markups integrity,
58      * remove unwanted markups.
59      *
60      * Using default parser and default setting
61      *
62      * @param inputString
63      * @param DOMVisitors
64      * @return
65      */

66     public abstract String JavaDoc parse(String JavaDoc inputString, Vector JavaDoc DOMVisitors);
67
68     /**
69      * Parse an input document, checkout html markups integrity,
70      * remove unwanted markups.
71      * Using parser defined and configured for the given site
72      *
73      * @param inputString
74      * @param DOMVisitors
75      * @param siteId
76      * @return
77      */

78     public abstract String JavaDoc parse(String JavaDoc inputString, Vector JavaDoc DOMVisitors,
79                                  int siteId);
80
81     /**
82      * Return all markup definitions
83      *
84      * @return
85      */

86     public abstract Iterator JavaDoc getMarkupDefinitions();
87
88     /**
89      * Return a markup definition
90      *
91      * @return
92      */

93     public abstract MarkupDefinition getMarkupDefinition(int id);
94
95     /**
96      * Return a markup definition looking at the name
97      *
98      * @return
99      */

100     public abstract MarkupDefinition getMarkupDefinition(String JavaDoc markupName);
101
102     /**
103      * Save the state of an markup definition
104      *
105      * @param markupDefinition
106      */

107     public abstract void saveMarkupDefinition(MarkupDefinition markupDefinition)
108     throws JahiaException;
109
110     /**
111      * Remove a markup definition
112      *
113      * @param id
114      */

115     public abstract void removeMarkupDefinition(int id)
116     throws JahiaException;
117
118     /**
119      * Return all markup settings
120      *
121      * @return
122      */

123     public abstract Iterator JavaDoc getMarkupSettings();
124
125     /**
126      * Return the markup settings of a given type
127      *
128      * @param type
129      * @return
130      */

131     public abstract Iterator JavaDoc getMarkupSettings(String JavaDoc type);
132
133     /**
134      * Return the markup settings for a given site including those defined for all
135      * sites.
136      *
137      * @param siteId
138      * @return
139      */

140     public abstract Iterator JavaDoc getMarkupSettings(int siteId);
141
142     /**
143      * Return a markup setting
144      *
145      * @return
146      */

147     public abstract MarkupSetting getMarkupSetting(int id);
148
149     /**
150      * Save the state of an HtmlMarkupSetting
151      *
152      * @param markupSetting
153      */

154     public abstract void saveMarkupSetting(MarkupSetting markupSetting)
155     throws JahiaException;
156
157     /**
158      * Remove a markup setting
159      *
160      * @param id
161      */

162     public abstract void removeMarkupSetting(int id)
163     throws JahiaException;
164
165     /**
166      * Return a vector of registered HtmlDOMVisitors
167      *
168      * @param siteId
169      * @return
170      */

171     public abstract Vector JavaDoc getHtmlDOMVisitors(int siteId)
172     throws JahiaException;
173
174     /**
175      * Check if there is any html parsing errors
176      *
177      * @param value String, the result of a previous Html parsing
178      * @return EngineMessages
179      */

180     public abstract EngineMessages checkTextParsingErrors(String JavaDoc value);
181
182 }
183
184
Popular Tags