1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2024-12-22 08:48:54 +00:00

[TASK] SourceInformation replaced by PlantumlUtils

a more complete implementation
This commit is contained in:
Maxime Sinclair 2013-08-26 10:42:01 +02:00
parent 7d7bdca930
commit 39eab59226
3 changed files with 2 additions and 43 deletions

View File

@ -42,7 +42,7 @@ import net.sourceforge.plantuml.SourceStringReader;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.code.Transcoder;
import net.sourceforge.plantuml.code.TranscoderUtil;
import net.sourceforge.plantuml.servlet.utility.SourceInformation;
import net.sourceforge.plantuml.api.PlantumlUtils;
import HTTPClient.CookieModule;
import HTTPClient.HTTPConnection;
import HTTPClient.HTTPResponse;
@ -144,7 +144,7 @@ public class PlantUmlServlet extends HttpServlet {
request.setAttribute("net.sourceforge.plantuml.servlet.encoded", encoded);
// check if an image map is necessary
if (text != null && SourceInformation.containsLink(text)) {
if (text != null && PlantumlUtils.hasCMapData(text)) {
request.setAttribute("net.sourceforge.plantuml.servlet.mapneeded", Boolean.TRUE);
}

View File

@ -1,40 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.sourceforge.net
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML 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 General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*/
package net.sourceforge.plantuml.servlet.utility;
/**
* Utility class giving information about a diagram based on its source description.
*/
public class SourceInformation {
/*
* Check if there is a link ([[url]]) in the source of the diagram.
* @param source the full textual representation of a diagram
* @return true if there is at least one link
*/
public static boolean containsLink(String source) {
// TODO build a better implementation
return source.contains("[[");
}
}

View File

@ -4,7 +4,6 @@
<ul>
<li>NullOutputStream is used by the Map feature.</li>
<li>UmlExtractor encapsulates the PlantUML library to decode the UML compressed source.</li>
<li>SourceInformation extracts useful information from the full textual source.</li>
</ul>
</body>
</html>