Re: [xwiki-devs] [xwiki-notifications] r13873 - in sandbox/xwiki-plugin-officeimporter/src: main/java/com/xpn/xwiki/plugin/officeimporter main/java/com/xpn/xwiki/plugin/officeimporter/core main/java/com/xpn/xwiki/plugin/officeimporter/filters test/ja
Hi Vincent, Ok, will revert those changes. Btw, why I tried to use static methods instead of separate classes is because those classes seemed to be doing very little. I mean those classes were utilized like, <code> new TagRemoveFilter().doFilter(document); new UnderlineLinkFilter().filter(document); new XWikiSyntaxEscapeFilter().doFilter(document); new ImageTagFilter().doFilter(document); new PinLiFilter().doFilter(document); new EmptyLinkFilter().doFilter(document); </code> That's all. Something didn't look right to me. And also it seems to clutter the functionality into a lots of tiny classes. Thanks. - Asiri
Asiri Rathnayake wrote:
Hi Vincent,
Ok, will revert those changes.
Btw, why I tried to use static methods instead of separate classes is because those classes seemed to be doing very little. I mean those classes were utilized like,
<code> new TagRemoveFilter().doFilter(document); new UnderlineLinkFilter().filter(document); new XWikiSyntaxEscapeFilter().doFilter(document); new ImageTagFilter().doFilter(document); new PinLiFilter().doFilter(document); new EmptyLinkFilter().doFilter(document); </code>
That's all. Something didn't look right to me. And also it seems to clutter the functionality into a lots of tiny classes.
Listing implementations is wrong. Why not use components? -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Oct 28, 2008, at 6:14 PM, Sergiu Dumitriu wrote:
Asiri Rathnayake wrote:
Hi Vincent,
Ok, will revert those changes.
Btw, why I tried to use static methods instead of separate classes is because those classes seemed to be doing very little. I mean those classes were utilized like,
<code> new TagRemoveFilter().doFilter(document); new UnderlineLinkFilter().filter(document); new XWikiSyntaxEscapeFilter().doFilter(document); new ImageTagFilter().doFilter(document); new PinLiFilter().doFilter(document); new EmptyLinkFilter().doFilter(document); </code>
That's all. Something didn't look right to me. And also it seems to clutter the functionality into a lots of tiny classes.
Listing implementations is wrong. Why not use components?
This would give the ability for anyone using the office importer to plug new filters if it's required for some reasons. Thanks -Vincent
Vincent Massol wrote:
On Oct 28, 2008, at 6:14 PM, Sergiu Dumitriu wrote:
Asiri Rathnayake wrote:
Hi Vincent,
Ok, will revert those changes.
Btw, why I tried to use static methods instead of separate classes is because those classes seemed to be doing very little. I mean those classes were utilized like,
<code> new TagRemoveFilter().doFilter(document); new UnderlineLinkFilter().filter(document); new XWikiSyntaxEscapeFilter().doFilter(document); new ImageTagFilter().doFilter(document); new PinLiFilter().doFilter(document); new EmptyLinkFilter().doFilter(document); </code>
That's all. Something didn't look right to me. And also it seems to clutter the functionality into a lots of tiny classes.
Listing implementations is wrong. Why not use components?
This would give the ability for anyone using the office importer to plug new filters if it's required for some reasons.
Also, why doFilter(doc) and not just filter(doc)? -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Tue, Oct 28, 2008 at 10:52 PM, Sergiu Dumitriu <[email protected]> wrote:
Vincent Massol wrote:
On Oct 28, 2008, at 6:14 PM, Sergiu Dumitriu wrote:
Asiri Rathnayake wrote:
Hi Vincent,
Ok, will revert those changes.
Btw, why I tried to use static methods instead of separate classes is because those classes seemed to be doing very little. I mean those classes were utilized like,
<code> new TagRemoveFilter().doFilter(document); new UnderlineLinkFilter().filter(document); new XWikiSyntaxEscapeFilter().doFilter(document); new ImageTagFilter().doFilter(document); new PinLiFilter().doFilter(document); new EmptyLinkFilter().doFilter(document); </code>
That's all. Something didn't look right to me. And also it seems to clutter the functionality into a lots of tiny classes.
Listing implementations is wrong. Why not use components?
This would give the ability for anyone using the office importer to plug new filters if it's required for some reasons.
Also, why doFilter(doc) and not just filter(doc)?
Yes it is filter(). The doFilter() was reverted. Thanks. - Asiri
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Oct 28, 2008, at 6:19 PM, Vincent Massol wrote:
On Oct 28, 2008, at 6:14 PM, Sergiu Dumitriu wrote:
Asiri Rathnayake wrote:
Hi Vincent,
Ok, will revert those changes.
Btw, why I tried to use static methods instead of separate classes is because those classes seemed to be doing very little. I mean those classes were utilized like,
<code> new TagRemoveFilter().doFilter(document); new UnderlineLinkFilter().filter(document); new XWikiSyntaxEscapeFilter().doFilter(document); new ImageTagFilter().doFilter(document); new PinLiFilter().doFilter(document); new EmptyLinkFilter().doFilter(document); </code>
That's all. Something didn't look right to me. And also it seems to clutter the functionality into a lots of tiny classes.
Listing implementations is wrong. Why not use components?
This would give the ability for anyone using the office importer to plug new filters if it's required for some reasons.
Just one note. Making them components is possible (possibly overkill although it might be good, I'm not sure). However what's important is that you don't do the new *Filter() at every run. There should a singleton component that has an initialization method (Initializable) and that registers them once and for all. Thanks -Vincent
participants (3)
-
Asiri Rathnayake -
Sergiu Dumitriu -
Vincent Massol