Skip to content
Snippets Groups Projects
Commit bccef2b9 authored by Vincent Massol's avatar Vincent Massol
Browse files

XWIKI-9074: The syntax used to import office document is not configurable

* Update the "since" now that 10.11 has been released
* Add a test
parent 815c14b1
No related branches found
No related tags found
No related merge requests found
Showing
with 12 additions and 4 deletions
......@@ -314,7 +314,7 @@ public Map<TargetDocumentDescriptor, XDOMOfficeDocument> split(XDOMOfficeDocumen
* @param title title of the target wiki page or {@code null}
* @param append whether to append content if the target wiki page exists
* @return true if the operation completes successfully, false otherwise
* @since 10.11RC1
* @since 11.0RC1
*/
@Unstable
public boolean save(XDOMOfficeDocument doc, DocumentReference documentReference, DocumentReference parentReference,
......
......@@ -38,7 +38,7 @@ public interface CoreConfiguration
/**
* @return the default syntax to use for new documents
* @since 2.3M1
* @deprecated starting with 10.11RC1, use
* @deprecated starting with 11.0RC1, use
* {@link org.xwiki.rendering.configuration.ExtendedRenderingConfiguration#getDefaultContentSyntax()}
*/
@Deprecated
......
......@@ -70,7 +70,7 @@ public class DefaultCoreConfiguration implements CoreConfiguration
/**
* @see CoreConfiguration#getDefaultDocumentSyntax()
* @since 2.3M1
* @deprecated starting with 10.11RC1, use
* @deprecated starting with 11.0RC1, use
* {@link org.xwiki.rendering.configuration.ExtendedRenderingConfiguration#getDefaultContentSyntax()}
*/
@Override
......
......@@ -85,7 +85,7 @@ public interface ExtendedRenderingConfiguration
/**
* @return the default Syntax to use when creating new content (Documents, etc).
* @since 10.11RC1
* @since 11.0RC1
*/
@Unstable
default Syntax getDefaultContentSyntax()
......
......@@ -145,6 +145,7 @@ public Syntax getDefaultContentSyntax()
{
// TODO: Move the code from DefaultCoreConfiguration here and introduce a new property for it, for ex:
// rendering.defaultContentSyntax
// However keep supporting the old property for backward-compatibility reasons.
return this.coreConfiguration.getDefaultDocumentSyntax();
}
......
......@@ -197,4 +197,11 @@ public void getConfiguredAndDisabledSyntaxesWhenConfigXObjectExists() throws Exc
assertEquals(1, configuredSyntaxes.size());
assertTrue(configuredSyntaxes.contains(xwikiSyntax20));
}
@Test
public void getDefaultContentSyntax() throws Exception
{
CoreConfiguration coreConfiguration = componentManager.getInstance(CoreConfiguration.class);
when(coreConfiguration.getDefaultDocumentSyntax()).thenReturn(Syntax.XWIKI_2_1);
assertEquals(Syntax.XWIKI_2_1, this.defaultExtendedRenderingConfiguration.getDefaultContentSyntax());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment