[xwiki-devs] [Proposal] Add new API to ModelConfiguration to get the default syntax
Hi, I'd like to add: public interface ModelConfiguration { … Syntax getDefaultSyntax(); } And the configuration key would be: model.defaultSyntax=xwiki/2.1 This also means deprecating CoreConfiguration.getDefaultDocumentSyntax() in oldcore The goal is to have a clean way for getting the default syntax for documents for example without having to use oldcore. I need this to fix http://jira.xwiki.org/browse/XWIKI-9074 for example. WDYT? Thanks -Vincent
On 04/26/2013 09:57 AM, Vincent Massol wrote:
Hi,
I'd like to add:
public interface ModelConfiguration { … Syntax getDefaultSyntax(); }
And the configuration key would be: model.defaultSyntax=xwiki/2.1
This also means deprecating CoreConfiguration.getDefaultDocumentSyntax() in oldcore
The goal is to have a clean way for getting the default syntax for documents for example without having to use oldcore.
I need this to fix http://jira.xwiki.org/browse/XWIKI-9074 for example.
WDYT?
I'm not sure the ModelConfiguration is the right place to add this. For me, syntaxes are closer to rendering than to the data model, although I agree that it's a property that affects the content of documents more than it does the rendering engine. My main concern is that so far there isn't any other method in the whole model module that deals with syntaxes, so this would be the first thing that ties the model to the XWiki rendering engine. -- Sergiu Dumitriu http://purl.org/net/sergiu
On Fri, Apr 26, 2013 at 4:56 PM, Sergiu Dumitriu <sergiu@xwiki.org> wrote:
On 04/26/2013 09:57 AM, Vincent Massol wrote:
Hi,
I'd like to add:
public interface ModelConfiguration { … Syntax getDefaultSyntax(); }
And the configuration key would be: model.defaultSyntax=xwiki/2.1
This also means deprecating CoreConfiguration.getDefaultDocumentSyntax() in oldcore
The goal is to have a clean way for getting the default syntax for documents for example without having to use oldcore.
I need this to fix http://jira.xwiki.org/browse/XWIKI-9074 for example.
WDYT?
I'm not sure the ModelConfiguration is the right place to add this. For me, syntaxes are closer to rendering than to the data model, although I agree that it's a property that affects the content of documents more than it does the rendering engine.
My main concern is that so far there isn't any other method in the whole model module that deals with syntaxes, so this would be the first thing that ties the model to the XWiki rendering engine.
Same as Sergiu, I'm not sure if that's the right module but it's not stronger than a -0.
-- Sergiu Dumitriu http://purl.org/net/sergiu _______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On Apr 26, 2013, at 4:56 PM, Sergiu Dumitriu <sergiu@xwiki.org> wrote:
On 04/26/2013 09:57 AM, Vincent Massol wrote:
Hi,
I'd like to add:
public interface ModelConfiguration { … Syntax getDefaultSyntax(); }
And the configuration key would be: model.defaultSyntax=xwiki/2.1
This also means deprecating CoreConfiguration.getDefaultDocumentSyntax() in oldcore
The goal is to have a clean way for getting the default syntax for documents for example without having to use oldcore.
I need this to fix http://jira.xwiki.org/browse/XWIKI-9074 for example.
WDYT?
I'm not sure the ModelConfiguration is the right place to add this. For me, syntaxes are closer to rendering than to the data model, although I agree that it's a property that affects the content of documents more than it does the rendering engine.
My main concern is that so far there isn't any other method in the whole model module that deals with syntaxes, so this would be the first thing that ties the model to the XWiki rendering engine.
In the new model I have this class for example: public class Content { private final String text; private final Syntax syntax; public Content(String text, Syntax syntax) { this.text = text; this.syntax = syntax; } public String getText() { return this.text; } public Syntax getSyntax() { return this.syntax; } … We only have 2 choices: * Store the content in a syntax-independent way (ie xml for example) * Store the content as the user entered it and associate it with the syntax used by the user So far we've always said that we wanted to store as the user entered it, in his syntax. I don't see why we would change this. But if we do, we can always deprecate. ATM the syntax is part of the model so it makes sense to me to have this here. Thanks -Vincent
On 08/01/2013 10:05 AM, Vincent Massol wrote:
On Apr 26, 2013, at 4:56 PM, Sergiu Dumitriu <sergiu@xwiki.org> wrote:
On 04/26/2013 09:57 AM, Vincent Massol wrote:
Hi,
I'd like to add:
public interface ModelConfiguration { … Syntax getDefaultSyntax(); }
And the configuration key would be: model.defaultSyntax=xwiki/2.1
This also means deprecating CoreConfiguration.getDefaultDocumentSyntax() in oldcore
The goal is to have a clean way for getting the default syntax for documents for example without having to use oldcore.
I need this to fix http://jira.xwiki.org/browse/XWIKI-9074 for example.
WDYT?
I'm not sure the ModelConfiguration is the right place to add this. For me, syntaxes are closer to rendering than to the data model, although I agree that it's a property that affects the content of documents more than it does the rendering engine.
My main concern is that so far there isn't any other method in the whole model module that deals with syntaxes, so this would be the first thing that ties the model to the XWiki rendering engine.
In the new model I have this class for example:
public class Content { private final String text;
private final Syntax syntax;
public Content(String text, Syntax syntax) { this.text = text; this.syntax = syntax; }
public String getText() { return this.text; }
public Syntax getSyntax() { return this.syntax; } …
We only have 2 choices: * Store the content in a syntax-independent way (ie xml for example) * Store the content as the user entered it and associate it with the syntax used by the user
So far we've always said that we wanted to store as the user entered it, in his syntax. I don't see why we would change this.
But if we do, we can always deprecate. ATM the syntax is part of the model so it makes sense to me to have this here.
Thanks -Vincent
+1 for adding ModelConfiguration.getDefaultSyntax() -- Sergiu Dumitriu http://purl.org/net/sergiu
participants (4)
-
Sergiu Dumitriu -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol