diff --git a/xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/XWiki10DocumentTitleDisplayer.java b/xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/XWiki10DocumentTitleDisplayer.java deleted file mode 100644 index db0a4c00dbf6af11d3812ce961a1f8659cc91acc..0000000000000000000000000000000000000000 --- a/xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/XWiki10DocumentTitleDisplayer.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * See the NOTICE file distributed with this work for additional - * information regarding copyright ownership. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.xwiki.display.internal; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.inject.Named; -import javax.inject.Singleton; - -import org.xwiki.bridge.DocumentModelBridge; -import org.xwiki.component.annotation.Component; -import org.xwiki.rendering.block.XDOM; - -/** - * Overwrites {@link DocumentTitleDisplayer} for XWiki 1.0 syntax. - * - * @version $Id$ - * @since 3.2M3 - */ -@Component -@Named("title/xwiki/1.0") -@Singleton -public class XWiki10DocumentTitleDisplayer extends DocumentTitleDisplayer -{ - /** - * Regular expression for finding the first level 1 or 2 heading in the document content, to be used as the document - * title. - */ - private static final Pattern HEADING_PATTERN_10 = Pattern.compile("^\\s*+1(?:\\.1)?\\s++(.++)$", Pattern.MULTILINE); - - @Override - protected XDOM extractTitleFromContent(DocumentModelBridge document, DocumentDisplayerParameters parameters) - { - String title = ""; - Matcher matcher = HEADING_PATTERN_10.matcher(document.getContent()); - if (matcher.find()) { - title = matcher.group(1).trim(); - } - - if (!title.isEmpty()) { - return parseTitle(evaluateTitle(title, document.getDocumentReference(), parameters)); - } - - return null; - } -} diff --git a/xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/resources/META-INF/components.txt b/xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/resources/META-INF/components.txt index 2f58a23b6fe50cff2d7ec3563e8fad659ad02294..acefdf2cae0412a07ea63d2793ab4b696605bc08 100644 --- a/xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/resources/META-INF/components.txt +++ b/xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/resources/META-INF/components.txt @@ -3,4 +3,3 @@ org.xwiki.display.internal.DefaultDisplayConfiguration org.xwiki.display.internal.DefaultDocumentDisplayer org.xwiki.display.internal.DocumentContentDisplayer org.xwiki.display.internal.DocumentTitleDisplayer -org.xwiki.display.internal.XWiki10DocumentTitleDisplayer \ No newline at end of file