You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by "Stefano Bagnara (JIRA)" <mi...@james.apache.org> on 2010/03/15 00:17:27 UTC
[jira] Created: (MIME4J-175) Introduce a
MessageBuilderFactory/MessageBuilder along the lines of
DocumentBuilderFactory
Introduce a MessageBuilderFactory/MessageBuilder along the lines of DocumentBuilderFactory
------------------------------------------------------------------------------------------
Key: MIME4J-175
URL: https://issues.apache.org/jira/browse/MIME4J-175
Project: JAMES Mime4j
Issue Type: Improvement
Components: dom
Affects Versions: 0.6
Reporter: Stefano Bagnara
Assignee: Stefano Bagnara
Fix For: 0.7
This factory will support using the dom interfaces without knowledge of the "message" package.
Implementing a simple java SPI for the factory will let us to decouple "dom" from "message" and leave more future extensibility.
Then we'll have to add body/fields creation methods to Message.
Message should be traversable and alterable directly from the api.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MIME4J-175) Introduce a
MessageBuilderFactory/MessageBuilder along the lines of
DocumentBuilderFactory
Posted by "Norman Maurer (JIRA)" <mi...@james.apache.org>.
[ https://issues.apache.org/jira/browse/MIME4J-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846391#action_12846391 ]
Norman Maurer commented on MIME4J-175:
--------------------------------------
I like the idea ! Go ahead :)
> Introduce a MessageBuilderFactory/MessageBuilder along the lines of DocumentBuilderFactory
> ------------------------------------------------------------------------------------------
>
> Key: MIME4J-175
> URL: https://issues.apache.org/jira/browse/MIME4J-175
> Project: JAMES Mime4j
> Issue Type: Improvement
> Components: dom
> Affects Versions: 0.6
> Reporter: Stefano Bagnara
> Assignee: Stefano Bagnara
> Fix For: 0.7
>
>
> This factory will support using the dom interfaces without knowledge of the "message" package.
> Implementing a simple java SPI for the factory will let us to decouple "dom" from "message" and leave more future extensibility.
> Then we'll have to add body/fields creation methods to Message.
> Message should be traversable and alterable directly from the api.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MIME4J-175) Introduce a
MessageBuilderFactory/MessageBuilder along the lines of
DocumentBuilderFactory
Posted by "Stefano Bagnara (JIRA)" <mi...@james.apache.org>.
[ https://issues.apache.org/jira/browse/MIME4J-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845163#action_12845163 ]
Stefano Bagnara commented on MIME4J-175:
----------------------------------------
I skipped javadocs by purpose because I thought similarity with the well known DocumentBuilder stuff would suffice by now. If we agree the MessageBuilder method I'm proposing is OK then I will also add javadocs and refactor the samples.
> Introduce a MessageBuilderFactory/MessageBuilder along the lines of DocumentBuilderFactory
> ------------------------------------------------------------------------------------------
>
> Key: MIME4J-175
> URL: https://issues.apache.org/jira/browse/MIME4J-175
> Project: JAMES Mime4j
> Issue Type: Improvement
> Components: dom
> Affects Versions: 0.6
> Reporter: Stefano Bagnara
> Assignee: Stefano Bagnara
> Fix For: 0.7
>
>
> This factory will support using the dom interfaces without knowledge of the "message" package.
> Implementing a simple java SPI for the factory will let us to decouple "dom" from "message" and leave more future extensibility.
> Then we'll have to add body/fields creation methods to Message.
> Message should be traversable and alterable directly from the api.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MIME4J-175) Introduce a
MessageBuilderFactory/MessageBuilder along the lines of
DocumentBuilderFactory
Posted by "Stefano Bagnara (JIRA)" <mi...@james.apache.org>.
[ https://issues.apache.org/jira/browse/MIME4J-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12860594#action_12860594 ]
Stefano Bagnara commented on MIME4J-175:
----------------------------------------
Added MimeEntityConfig and MutableBodyDescriptorFactory attributes to the factory so that the behaviour of the parser can be changed without dealing with mime4j implementation (.message. package) classes.
Maybe we should expose (at least some of) the MimeEntityConfig properties as Factory/Builder properties, instead of relying on MimeEntityConfig attribute.
I mean
MessageBuilderFactory factory = MessageBuilderFactory.newInstance();
factory.setFeature("strictParsing", true);
factory.setFeature("countLineNumbers", true);
factory.setFeature("malformedHeaderStartsBody", true);
factory.setProperty("maxHeaderLen", 1000);
factory.setProperty("headlessParsing", "multipart/form-data");
as a second step we could expose them as direct properties:
factory.setStrictParsing(true);
factory.setMaxHeaderLen(1000);
factory.setHeadlessParsing("multipart/form-data");
This issue goal is to start a new layer of API with controlled compatibility, so I think I would start with setFeature/setProperty and before 1.0 we will define what features define direct methods instead of generic "feature/attribute/property" support.
> Introduce a MessageBuilderFactory/MessageBuilder along the lines of DocumentBuilderFactory
> ------------------------------------------------------------------------------------------
>
> Key: MIME4J-175
> URL: https://issues.apache.org/jira/browse/MIME4J-175
> Project: JAMES Mime4j
> Issue Type: Improvement
> Components: dom
> Affects Versions: 0.6
> Reporter: Stefano Bagnara
> Assignee: Stefano Bagnara
> Fix For: 0.7
>
>
> This factory will support using the dom interfaces without knowledge of the "message" package.
> Implementing a simple java SPI for the factory will let us to decouple "dom" from "message" and leave more future extensibility.
> Then we'll have to add body/fields creation methods to Message.
> Message should be traversable and alterable directly from the api.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MIME4J-175) Introduce a
MessageBuilderFactory/MessageBuilder along the lines of
DocumentBuilderFactory
Posted by "Stefano Bagnara (JIRA)" <mi...@james.apache.org>.
[ https://issues.apache.org/jira/browse/MIME4J-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845156#action_12845156 ]
Stefano Bagnara commented on MIME4J-175:
----------------------------------------
I committed a first draft similar to what DocumentBuilderFactory/DocumentBuilder do.
If you like the idea then we should extend this to support real world use cases:
1) Use of custom StorageProvider (maybe a generic setFeature(String key, Object value) in the MessageBuilderFactory).
2) Behaviour configuration (DecodeMonitor and MimeEntityConfig stuff exposed in the MessageBuilderFactory).
3) Message abstract class should expose methods to create bodies and fields.
Furthermore we could move the ServiceLoader util to a lower package and use that also for the Parser and for the StorageProvider selection.
WDYT?
> Introduce a MessageBuilderFactory/MessageBuilder along the lines of DocumentBuilderFactory
> ------------------------------------------------------------------------------------------
>
> Key: MIME4J-175
> URL: https://issues.apache.org/jira/browse/MIME4J-175
> Project: JAMES Mime4j
> Issue Type: Improvement
> Components: dom
> Affects Versions: 0.6
> Reporter: Stefano Bagnara
> Assignee: Stefano Bagnara
> Fix For: 0.7
>
>
> This factory will support using the dom interfaces without knowledge of the "message" package.
> Implementing a simple java SPI for the factory will let us to decouple "dom" from "message" and leave more future extensibility.
> Then we'll have to add body/fields creation methods to Message.
> Message should be traversable and alterable directly from the api.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MIME4J-175) Introduce a
MessageBuilderFactory/MessageBuilder along the lines of
DocumentBuilderFactory
Posted by "Stefano Bagnara (JIRA)" <mi...@james.apache.org>.
[ https://issues.apache.org/jira/browse/MIME4J-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845161#action_12845161 ]
Stefano Bagnara commented on MIME4J-175:
----------------------------------------
The same pattern could be used to obtain the FieldParser (so to remove direct DefaultFieldParser.parse calls)
Also we could use the same logic and create a MessageParserFactory/MessageParser so that we can use MessageBuilder+MessageParser to build a message from a stream.
> Introduce a MessageBuilderFactory/MessageBuilder along the lines of DocumentBuilderFactory
> ------------------------------------------------------------------------------------------
>
> Key: MIME4J-175
> URL: https://issues.apache.org/jira/browse/MIME4J-175
> Project: JAMES Mime4j
> Issue Type: Improvement
> Components: dom
> Affects Versions: 0.6
> Reporter: Stefano Bagnara
> Assignee: Stefano Bagnara
> Fix For: 0.7
>
>
> This factory will support using the dom interfaces without knowledge of the "message" package.
> Implementing a simple java SPI for the factory will let us to decouple "dom" from "message" and leave more future extensibility.
> Then we'll have to add body/fields creation methods to Message.
> Message should be traversable and alterable directly from the api.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MIME4J-175) Introduce a
MessageBuilderFactory/MessageBuilder along the lines of
DocumentBuilderFactory
Posted by "Stefano Bagnara (JIRA)" <mi...@james.apache.org>.
[ https://issues.apache.org/jira/browse/MIME4J-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845160#action_12845160 ]
Stefano Bagnara commented on MIME4J-175:
----------------------------------------
The same pattern could be used to obtain the FieldParser (so to remove direct DefaultFieldParser.parse calls)
Also we could use the same logic and create a MessageParserFactory/MessageParser so that we can use MessageBuilder+MessageParser to build a message from a stream.
> Introduce a MessageBuilderFactory/MessageBuilder along the lines of DocumentBuilderFactory
> ------------------------------------------------------------------------------------------
>
> Key: MIME4J-175
> URL: https://issues.apache.org/jira/browse/MIME4J-175
> Project: JAMES Mime4j
> Issue Type: Improvement
> Components: dom
> Affects Versions: 0.6
> Reporter: Stefano Bagnara
> Assignee: Stefano Bagnara
> Fix For: 0.7
>
>
> This factory will support using the dom interfaces without knowledge of the "message" package.
> Implementing a simple java SPI for the factory will let us to decouple "dom" from "message" and leave more future extensibility.
> Then we'll have to add body/fields creation methods to Message.
> Message should be traversable and alterable directly from the api.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.