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

XWIKI-21077: Moved the autotag plugin to XWiki Attic

parent f7bf656a
No related branches found
No related tags found
No related merge requests found
......@@ -145,7 +145,6 @@
<module>xwiki-platform-application</module>
<module>xwiki-platform-appwithinminutes</module>
<module>xwiki-platform-attachment</module>
<module>xwiki-platform-autotag</module>
<module>xwiki-platform-bridge</module>
<module>xwiki-platform-captcha</module>
<module>xwiki-platform-chart</module>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
* 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-core</artifactId>
<version>15.6-SNAPSHOT</version>
</parent>
<artifactId>xwiki-platform-autotag</artifactId>
<name>XWiki Platform - AutoTag plugin</name>
<description>A deprecated plugin which extracts a set of tags from a text.</description>
<properties>
<!-- Name to display by the Extension Manager -->
<xwiki.extension.name>AutoTag Plugin</xwiki.extension.name>
<xwiki.jacoco.instructionRatio>0.00</xwiki.jacoco.instructionRatio>
</properties>
<dependencies>
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-oldcore</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- Apply the Checkstyle configurations defined in the top level pom.xml file -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<!-- Specify the "default" execution id so that the "blocker" one is always executed -->
<id>default</id>
<configuration>
<excludes>
com/xpn/xwiki/plugin/autotag/FrenchStemmer.java
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
/*
* 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 com.xpn.xwiki.plugin.autotag;
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.plugin.PluginApi;
/**
* Plugin which extracts a set of tags from a text.
*
* @version $Id$
* @deprecated the plugin technology is deprecated, consider rewriting as components
*/
@Deprecated
public class AutoTagPluginAPI extends PluginApi<AutoTagPlugin>
{
/**
* API constructor. The API must know the plugin object it wraps, and the request context.
*
* @param plugin The wrapped plugin object.
* @param context Context of the request.
*/
public AutoTagPluginAPI(AutoTagPlugin plugin, XWikiContext context)
{
super(plugin, context);
}
/**
* Analyze a piece of text, and extract the most common words into a "tag cloud". In detail, this splits the text
* into tokens, counts how many times each token appears in the text, removes the "stop-words", joins together words
* from the same root (stemming), and prepares an HTML tag cloud which can be printed in the response.
*
* @param text the text to analyze
* @param lang the language in which the text is written, {@code 0} for French or {@code 1} for English
* @return the resulting TagCloud with all the analyzed data, including the HTML tag cloud
*/
public TagCloud generateTagCloud(String text, int lang)
{
return getProtectedPlugin().generateTagCloud(text, lang);
}
/**
* Analyze a piece of text, and extract the most common words into a "tag cloud". In detail, this splits the text
* into tokens, counts how many times each token appears in the text, removes the "stop-words", joins together words
* from the same root (stemming), and prepares an HTML tag cloud which can be printed in the response.
*
* @param text the text to analyze
* @param lang the language in which the text is written, one of {@code en} or {@code fr}
* @return the resulting TagCloud with all the analyzed data, including the HTML tag cloud
*/
public TagCloud generateTagCloud(String text, String lang)
{
return getProtectedPlugin().generateTagCloud(text, getProtectedPlugin().getLanguageConstant(lang));
}
}
/*
* 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 com.xpn.xwiki.plugin.autotag;
import org.xwiki.xml.XMLUtils;
/**
* Data structure used by the {@link AutoTagPlugin}, holding information about a particular tag, or a frequent word
* appearing in a collection of documents.
*
* @version $Id$
* @deprecated the entire Autotag plugin is deprecated, along with its data structures
*/
@Deprecated
public class Tag implements Comparable<Tag>
{
/** The keyword represented by this object. */
private String name;
/** The visual size of this tag in the HTML {@link TagCloud}. */
private long size;
/**
* Default constructor, specifying both the keyword and its target size.
*
* @param tagName the keyword that's represented
* @param tagSize the tag size
*/
public Tag(String tagName, long tagSize)
{
this.size = tagSize;
this.name = tagName;
}
/**
* Get the HTML markup to represent this tag in a {@link TagCloud}.
*
* @return HTML markup
*/
public String getHtml()
{
return "<a class=\"f" + this.size + "\">" + XMLUtils.escapeElementText(this.name) + "</a> ";
}
@Override
public int compareTo(Tag o)
{
return -o.name.compareTo(this.name);
}
}
/*
* 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 com.xpn.xwiki.plugin.autotag;
import java.util.Map;
import java.util.Set;
/**
* Data structure used by the {@link AutoTagPlugin}, holding information about a collection of tags appearing the most
* in a collection of documents.
*
* @version $Id$
* @deprecated the entire Autotag plugin is deprecated, along with its data structures
*/
@Deprecated
public class TagCloud
{
/** The text from which to extract tags. */
private String text;
/** The represented text, split into a sequence of words (tokens). */
private String[] wordList;
/** Words and their frequency, i.e. how many times they appear in the text. */
private Map<String, Integer> countedWordMap;
/** Word frequencies grouped based on their common stem. */
private Map<String, Map<String, Integer>> stemmedWordMap;
/** Lead words and their frequencies, i.e. how many times they appear in the text. */
private Map<String, Integer> stemmedWordFreqMap;
/** The extracted tags. */
private Set<Tag> tags;
/**
* Get the HTML markup to represent this tag cloud.
*
* @return HTML markup
*/
public String getHtml()
{
StringBuilder result = new StringBuilder();
for (Tag t : this.tags) {
result.append(t.getHtml());
}
return result.toString();
}
/**
* @return the analyzed text
* @see #text
*/
public String getText()
{
return this.text;
}
/**
* @param text the text to analyze
* @see #text
*/
public void setText(String text)
{
this.text = text;
}
/**
* @return the tokenized text
* @see #wordList
*/
public String[] getWordList()
{
return this.wordList;
}
/**
* @param wordList the tokenized text
* @see #wordList
*/
public void setWordList(String[] wordList)
{
this.wordList = wordList;
}
/**
* @return map of {@code token->number of appearances} count for each token present in the text
* @see #countedWordMap
*/
public Map<String, Integer> getCountedWordMap()
{
return this.countedWordMap;
}
/**
* @param countedWordMap map of {@code token->number of appearances} count for each token present in the text
* @see #countedWordMap
*/
public void setCountedWordMap(Map<String, Integer> countedWordMap)
{
this.countedWordMap = countedWordMap;
}
/**
* @return token groups
* @see #stemmedWordMap
*/
public Map<String, Map<String, Integer>> getStemmedWordMap()
{
return this.stemmedWordMap;
}
/**
* @param stemmedWordMap token groups
* @see #stemmedWordMap
*/
public void setStemmedWordMap(Map<String, Map<String, Integer>> stemmedWordMap)
{
this.stemmedWordMap = stemmedWordMap;
}
/**
* @return map of lead words and their frequencies
* @see #stemmedWordFreqMap
*/
public Map<String, Integer> getStemmedWordFreqMap()
{
return this.stemmedWordFreqMap;
}
/**
* @param stemmedWordFreqMap map of lead words and their frequencies
* @see #stemmedWordFreqMap
*/
public void setStemmedWordFreqMap(Map<String, Integer> stemmedWordFreqMap)
{
this.stemmedWordFreqMap = stemmedWordFreqMap;
}
/**
* @return the set of extracted tags
* @see #tags
*/
public Set<Tag> getTags()
{
return this.tags;
}
/**
* @param tags the set of extracted tags
* @see #tags
*/
public void setTags(Set<Tag> tags)
{
this.tags = tags;
}
}
......@@ -800,7 +800,6 @@
**/objects/StringListProperty.java,
**/pdf/impl/PdfExportImpl.java,
**/pdf/impl/PdfURLFactory.java,
**/plugin/autotag/FrenchStemmer.java,
**/plugin/mail/MailPluginApi.java,
**/plugin/mail/MailPlugin.java,
**/plugin/packaging/DocumentFilter.java,
......
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