mirror of
https://github.com/octoleo/plantuml-server.git
synced 2025-01-03 05:00:14 +00:00
[TASK] SourceInformation replaced by PlantumlUtils
a more complete implementation
This commit is contained in:
parent
7d7bdca930
commit
39eab59226
@ -42,7 +42,7 @@ import net.sourceforge.plantuml.SourceStringReader;
|
|||||||
import net.sourceforge.plantuml.StringUtils;
|
import net.sourceforge.plantuml.StringUtils;
|
||||||
import net.sourceforge.plantuml.code.Transcoder;
|
import net.sourceforge.plantuml.code.Transcoder;
|
||||||
import net.sourceforge.plantuml.code.TranscoderUtil;
|
import net.sourceforge.plantuml.code.TranscoderUtil;
|
||||||
import net.sourceforge.plantuml.servlet.utility.SourceInformation;
|
import net.sourceforge.plantuml.api.PlantumlUtils;
|
||||||
import HTTPClient.CookieModule;
|
import HTTPClient.CookieModule;
|
||||||
import HTTPClient.HTTPConnection;
|
import HTTPClient.HTTPConnection;
|
||||||
import HTTPClient.HTTPResponse;
|
import HTTPClient.HTTPResponse;
|
||||||
@ -144,7 +144,7 @@ public class PlantUmlServlet extends HttpServlet {
|
|||||||
request.setAttribute("net.sourceforge.plantuml.servlet.encoded", encoded);
|
request.setAttribute("net.sourceforge.plantuml.servlet.encoded", encoded);
|
||||||
|
|
||||||
// check if an image map is necessary
|
// 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);
|
request.setAttribute("net.sourceforge.plantuml.servlet.mapneeded", Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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("[[");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -4,7 +4,6 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>NullOutputStream is used by the Map feature.</li>
|
<li>NullOutputStream is used by the Map feature.</li>
|
||||||
<li>UmlExtractor encapsulates the PlantUML library to decode the UML compressed source.</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>
|
</ul>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user