mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-13 07:10:03 +01:00
Fixed wrong usage of the word 'parse'
Reason: Parse means extracting information - In many cases the word was being used wrong (In Finnish 'parsia' means 'to patch together', which caused the wrong use) The word 'parse' replaced with 'build', 'create' or 'generate' where appropriate
This commit is contained in:
parent
b2cd332c9b
commit
a50576e6e9
@ -22,18 +22,7 @@ import java.util.TreeMap;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Container used to parse data for Server page.
|
||||
* <p>
|
||||
* Similar to InspectContainer, but can contain data for each player for a bigger Player data table.
|
||||
* <p>
|
||||
* Can contain values: addValue("Total Examples", 1) parses into ("Total Examples: 1")
|
||||
* Html: addHtml(key, "{@code <html>}") parses into ("{@code <html>}")
|
||||
* Tables: addTable(key, TableContainer) parses into ("{@code <table>...</table}")
|
||||
* Player Data for a big table: {@code addTableData("header", Map<UUID, value>)} parses a new column to Plugin data player table.
|
||||
* <p>
|
||||
* Has methods for adding icons to Strings:
|
||||
* getWithIcon("text", "cube") parses into {@code "<i class=\"fa fa-cube\"></i> text"}
|
||||
* getWithColoredIcon("text", "cube", "light-green") parses into {@code "<i class=\"col-light-green fa fa-cube\"></i> text"}
|
||||
* Container used to hold data for Server page.
|
||||
*
|
||||
* @author Rsl1122
|
||||
* @see TableContainer
|
||||
|
@ -23,15 +23,7 @@ import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* Container used to parse data for Inspect page.
|
||||
* <p>
|
||||
* Can contain values: addValue("Total Examples", 1) parses into ("Total Examples: 1")
|
||||
* Html: addHtml(key, "{@code <html>}") parses into ("{@code <html>}")
|
||||
* Tables: addTable(key, TableContainer) parses into ("{@code <table>...</table}")
|
||||
* <p>
|
||||
* Has methods for adding icons to Strings:
|
||||
* getWithIcon("text", "cube") parses into {@code "<i class=\"fa fa-cube\"></i> text"}
|
||||
* getWithColoredIcon("text", "cube", "light-green") parses into {@code "<i class=\"col-light-green fa fa-cube\"></i> text"}
|
||||
* Container used to hold data for Player page.
|
||||
*
|
||||
* @author Rsl1122
|
||||
* @see TableContainer
|
||||
@ -78,7 +70,7 @@ public class InspectContainer {
|
||||
}
|
||||
|
||||
for (Map.Entry<String, TableContainer> entry : tables.entrySet()) {
|
||||
parsed.append(entry.getValue().parseHtml());
|
||||
parsed.append(entry.getValue().buildHtml());
|
||||
}
|
||||
|
||||
return parsed.toString();
|
||||
|
@ -25,7 +25,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Container used for parsing Html tables.
|
||||
* Container used for creating Html tables.
|
||||
*
|
||||
* @author Rsl1122
|
||||
* @deprecated PluginData API has been deprecated - see https://github.com/plan-player-analytics/Plan/wiki/APIv5---DataExtension-API for new API.
|
||||
@ -44,7 +44,7 @@ public class TableContainer {
|
||||
/**
|
||||
* Constructor, call with super(...).
|
||||
*
|
||||
* @param header Required: example {@code new TableContainer("1st", "2nd"} parses into {@code <thead><tr><th>1st</th><th>2nd</th></tr></thead}.
|
||||
* @param header Required: example {@code new TableContainer("1st", "2nd"} turns into {@code <thead><tr><th>1st</th><th>2nd</th></tr></thead}.
|
||||
*/
|
||||
public TableContainer(String... header) {
|
||||
this.header = header;
|
||||
@ -62,7 +62,11 @@ public class TableContainer {
|
||||
this.values.add(values);
|
||||
}
|
||||
|
||||
public String parseHtml() {
|
||||
public String parsehtml() {
|
||||
return buildHtml();
|
||||
}
|
||||
|
||||
public String buildHtml() {
|
||||
return getTableHeader() +
|
||||
parseHeader() +
|
||||
parseBody() +
|
||||
|
@ -17,7 +17,7 @@
|
||||
package com.djrapitops.plan.delivery.export;
|
||||
|
||||
import com.djrapitops.plan.exceptions.ExportException;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.exceptions.connection.NotFoundException;
|
||||
import com.djrapitops.plan.identification.Server;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
@ -91,7 +91,7 @@ public class Exporter extends FileExporter {
|
||||
*
|
||||
* @param server Server which page is going to be exported
|
||||
* @return false if the page was not exported due to previous failure or is disabled in config.
|
||||
* @throws ExportException If the export failed due to IO, NotFound or ParseException.
|
||||
* @throws ExportException If the export failed due to IO, NotFound or GenerationException.
|
||||
*/
|
||||
public boolean exportServerPage(Server server) throws ExportException {
|
||||
UUID serverUUID = server.getUuid();
|
||||
@ -105,7 +105,7 @@ public class Exporter extends FileExporter {
|
||||
serverPageExporter.export(toDirectory, server);
|
||||
}
|
||||
return true;
|
||||
} catch (IOException | NotFoundException | ParseException e) {
|
||||
} catch (IOException | NotFoundException | GenerationException e) {
|
||||
failedServers.add(serverUUID);
|
||||
throw new ExportException("Failed to export server: " + server.getIdentifiableName() + " (Attempts disabled until next reload), " + e.toString(), e);
|
||||
}
|
||||
@ -135,7 +135,7 @@ public class Exporter extends FileExporter {
|
||||
* @param playerUUID UUID of the player.
|
||||
* @param playerName Name of the player.
|
||||
* @return false if the page was not exported due to config settings.
|
||||
* @throws ExportException If the export failed due to IO, NotFound or ParseException.
|
||||
* @throws ExportException If the export failed due to IO, NotFound or GenerationException.
|
||||
*/
|
||||
public boolean exportPlayerPage(UUID playerUUID, String playerName) throws ExportException {
|
||||
Path toDirectory = getPageExportDirectory();
|
||||
@ -144,7 +144,7 @@ public class Exporter extends FileExporter {
|
||||
try {
|
||||
playerPageExporter.export(toDirectory, playerUUID, playerName);
|
||||
return true;
|
||||
} catch (IOException | NotFoundException | ParseException e) {
|
||||
} catch (IOException | NotFoundException | GenerationException e) {
|
||||
throw new ExportException("Failed to export player: " + playerName + ", " + e.toString(), e);
|
||||
}
|
||||
}
|
||||
@ -156,7 +156,7 @@ public class Exporter extends FileExporter {
|
||||
try {
|
||||
playersPageExporter.export(toDirectory);
|
||||
return true;
|
||||
} catch (IOException | NotFoundException | ParseException e) {
|
||||
} catch (IOException | NotFoundException | GenerationException e) {
|
||||
throw new ExportException("Failed to export players page, " + e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import com.djrapitops.plan.delivery.webserver.RequestTarget;
|
||||
import com.djrapitops.plan.delivery.webserver.pages.json.RootJSONResolver;
|
||||
import com.djrapitops.plan.delivery.webserver.response.Response;
|
||||
import com.djrapitops.plan.delivery.webserver.response.errors.ErrorResponse;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.exceptions.connection.NotFoundException;
|
||||
import com.djrapitops.plan.exceptions.connection.WebException;
|
||||
import com.djrapitops.plan.identification.Server;
|
||||
@ -76,7 +76,7 @@ public class NetworkPageExporter extends FileExporter {
|
||||
exportPaths = new ExportPaths();
|
||||
}
|
||||
|
||||
public void export(Path toDirectory, Server server) throws IOException, NotFoundException, ParseException {
|
||||
public void export(Path toDirectory, Server server) throws IOException, NotFoundException, GenerationException {
|
||||
Database.State dbState = dbSystem.getDatabase().getState();
|
||||
if (dbState == Database.State.CLOSED || dbState == Database.State.CLOSING) return;
|
||||
|
||||
@ -86,7 +86,7 @@ public class NetworkPageExporter extends FileExporter {
|
||||
exportHtml(toDirectory);
|
||||
}
|
||||
|
||||
private void exportHtml(Path toDirectory) throws IOException, ParseException {
|
||||
private void exportHtml(Path toDirectory) throws IOException, GenerationException {
|
||||
Path to = toDirectory
|
||||
.resolve("network")
|
||||
.resolve("index.html");
|
||||
|
@ -22,7 +22,7 @@ import com.djrapitops.plan.delivery.webserver.RequestTarget;
|
||||
import com.djrapitops.plan.delivery.webserver.pages.json.RootJSONResolver;
|
||||
import com.djrapitops.plan.delivery.webserver.response.Response;
|
||||
import com.djrapitops.plan.delivery.webserver.response.errors.ErrorResponse;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.exceptions.connection.NotFoundException;
|
||||
import com.djrapitops.plan.exceptions.connection.WebException;
|
||||
import com.djrapitops.plan.settings.locale.Locale;
|
||||
@ -77,7 +77,7 @@ public class PlayerPageExporter extends FileExporter {
|
||||
exportPaths = new ExportPaths();
|
||||
}
|
||||
|
||||
public void export(Path toDirectory, UUID playerUUID, String playerName) throws IOException, NotFoundException, ParseException {
|
||||
public void export(Path toDirectory, UUID playerUUID, String playerName) throws IOException, NotFoundException, GenerationException {
|
||||
Database.State dbState = dbSystem.getDatabase().getState();
|
||||
if (dbState == Database.State.CLOSED || dbState == Database.State.CLOSING) return;
|
||||
if (!dbSystem.getDatabase().query(PlayerFetchQueries.isPlayerRegistered(playerUUID))) return;
|
||||
@ -91,7 +91,7 @@ public class PlayerPageExporter extends FileExporter {
|
||||
exportHtml(playerDirectory, playerUUID);
|
||||
}
|
||||
|
||||
private void exportHtml(Path playerDirectory, UUID playerUUID) throws IOException, ParseException, NotFoundException {
|
||||
private void exportHtml(Path playerDirectory, UUID playerUUID) throws IOException, GenerationException, NotFoundException {
|
||||
Path to = playerDirectory.resolve("index.html");
|
||||
|
||||
try {
|
||||
|
@ -22,7 +22,7 @@ import com.djrapitops.plan.delivery.webserver.RequestTarget;
|
||||
import com.djrapitops.plan.delivery.webserver.pages.json.RootJSONResolver;
|
||||
import com.djrapitops.plan.delivery.webserver.response.Response;
|
||||
import com.djrapitops.plan.delivery.webserver.response.errors.ErrorResponse;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.exceptions.connection.NotFoundException;
|
||||
import com.djrapitops.plan.exceptions.connection.WebException;
|
||||
import com.djrapitops.plan.identification.ServerInfo;
|
||||
@ -79,7 +79,7 @@ public class PlayersPageExporter extends FileExporter {
|
||||
exportPaths = new ExportPaths();
|
||||
}
|
||||
|
||||
public void export(Path toDirectory) throws IOException, NotFoundException, ParseException {
|
||||
public void export(Path toDirectory) throws IOException, NotFoundException, GenerationException {
|
||||
Database.State dbState = dbSystem.getDatabase().getState();
|
||||
if (dbState == Database.State.CLOSED || dbState == Database.State.CLOSING) return;
|
||||
|
||||
@ -89,7 +89,7 @@ public class PlayersPageExporter extends FileExporter {
|
||||
exportHtml(toDirectory);
|
||||
}
|
||||
|
||||
private void exportHtml(Path toDirectory) throws IOException, ParseException {
|
||||
private void exportHtml(Path toDirectory) throws IOException, GenerationException {
|
||||
Path to = toDirectory
|
||||
.resolve("players")
|
||||
.resolve("index.html");
|
||||
|
@ -22,7 +22,7 @@ import com.djrapitops.plan.delivery.webserver.RequestTarget;
|
||||
import com.djrapitops.plan.delivery.webserver.pages.json.RootJSONResolver;
|
||||
import com.djrapitops.plan.delivery.webserver.response.Response;
|
||||
import com.djrapitops.plan.delivery.webserver.response.errors.ErrorResponse;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.exceptions.connection.NotFoundException;
|
||||
import com.djrapitops.plan.exceptions.connection.WebException;
|
||||
import com.djrapitops.plan.identification.Server;
|
||||
@ -81,7 +81,7 @@ public class ServerPageExporter extends FileExporter {
|
||||
exportPaths = new ExportPaths();
|
||||
}
|
||||
|
||||
public void export(Path toDirectory, Server server) throws IOException, NotFoundException, ParseException {
|
||||
public void export(Path toDirectory, Server server) throws IOException, NotFoundException, GenerationException {
|
||||
Database.State dbState = dbSystem.getDatabase().getState();
|
||||
if (dbState == Database.State.CLOSED || dbState == Database.State.CLOSING) return;
|
||||
|
||||
@ -91,7 +91,7 @@ public class ServerPageExporter extends FileExporter {
|
||||
exportHtml(toDirectory, server);
|
||||
}
|
||||
|
||||
private void exportHtml(Path toDirectory, Server server) throws IOException, NotFoundException, ParseException {
|
||||
private void exportHtml(Path toDirectory, Server server) throws IOException, NotFoundException, GenerationException {
|
||||
UUID serverUUID = server.getUuid();
|
||||
Path to = toDirectory
|
||||
.resolve(serverInfo.getServer().isProxy() ? "server/" + toFileName(server.getName()) : "server")
|
||||
|
@ -71,19 +71,6 @@ public enum Html {
|
||||
this.html = html;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The HTML String
|
||||
*/
|
||||
public String parse() {
|
||||
return html;
|
||||
}
|
||||
|
||||
public static String separateWithDots(String... elements) {
|
||||
TextStringBuilder builder = new TextStringBuilder();
|
||||
builder.appendWithSeparators(elements, " • ");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes Minecraft color codes to HTML span elements with correct color class assignments.
|
||||
*
|
||||
@ -102,7 +89,7 @@ public enum Html {
|
||||
String splitWith = string.contains("§") ? "§" : "§";
|
||||
|
||||
for (Html html : replacer) {
|
||||
colorMap.put(Character.toLowerCase(html.name().charAt(6)), html.parse());
|
||||
colorMap.put(Character.toLowerCase(html.name().charAt(6)), html.create());
|
||||
colorMap.put('k', "");
|
||||
colorMap.put('l', "");
|
||||
colorMap.put('m', "");
|
||||
@ -151,6 +138,19 @@ public enum Html {
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public static String separateWithDots(String... elements) {
|
||||
TextStringBuilder builder = new TextStringBuilder();
|
||||
builder.appendWithSeparators(elements, " • ");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The HTML String
|
||||
*/
|
||||
public String create() {
|
||||
return html;
|
||||
}
|
||||
|
||||
private static void appendEndTags(StringBuilder result, int placedSpans) {
|
||||
for (int i = 0; i < placedSpans; i++) {
|
||||
result.append("</span>");
|
||||
@ -159,9 +159,9 @@ public enum Html {
|
||||
|
||||
/**
|
||||
* @param replacements The replacement Strings
|
||||
* @return The parsed HTML String
|
||||
* @return The HTML String
|
||||
*/
|
||||
public String parse(Serializable... replacements) {
|
||||
public String create(Serializable... replacements) {
|
||||
Map<String, Serializable> replaceMap = new HashMap<>();
|
||||
|
||||
for (int i = 0; i < replacements.length; i++) {
|
||||
|
@ -48,7 +48,7 @@ import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Factory with different JSON parsing placed to a single class.
|
||||
* Factory with different JSON creation methods placed to a single class.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@ -86,7 +86,7 @@ public class JSONFactory {
|
||||
|
||||
Database database = dbSystem.getDatabase();
|
||||
|
||||
return new PlayersTableJSONParser(
|
||||
return new PlayersTableJSONCreator(
|
||||
database.query(new ServerTablePlayersQuery(serverUUID, System.currentTimeMillis(), playtimeThreshold, xMostRecentPlayers)),
|
||||
database.query(new ExtensionServerPlayerDataTableQuery(serverUUID, xMostRecentPlayers)),
|
||||
openPlayerLinksInNewTab,
|
||||
@ -101,7 +101,7 @@ public class JSONFactory {
|
||||
|
||||
Database database = dbSystem.getDatabase();
|
||||
|
||||
return new PlayersTableJSONParser(
|
||||
return new PlayersTableJSONCreator(
|
||||
database.query(new NetworkTablePlayersQuery(System.currentTimeMillis(), playtimeThreshold, xMostRecentPlayers)),
|
||||
Collections.emptyMap(),
|
||||
openPlayerLinksInNewTab,
|
||||
|
@ -41,12 +41,12 @@ import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Parses JSON payload for /server-page Online Activity Overview tab.
|
||||
* Creates JSON payload for /server-page Online Activity Overview tab.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class OnlineActivityOverviewJSONParser implements ServerTabJSONParser<Map<String, Object>> {
|
||||
public class OnlineActivityOverviewJSONCreator implements ServerTabJSONCreator<Map<String, Object>> {
|
||||
|
||||
private final PlanConfig config;
|
||||
private final DBSystem dbSystem;
|
||||
@ -57,7 +57,7 @@ public class OnlineActivityOverviewJSONParser implements ServerTabJSONParser<Map
|
||||
private final TimeZone timeZone;
|
||||
|
||||
@Inject
|
||||
public OnlineActivityOverviewJSONParser(
|
||||
public OnlineActivityOverviewJSONCreator(
|
||||
PlanConfig config,
|
||||
DBSystem dbSystem,
|
||||
Formatters formatters
|
@ -38,12 +38,12 @@ import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Parses JSON payload for /server-page Performance tab.
|
||||
* Creates JSON payload for /server-page Performance tab.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class PerformanceJSONParser implements ServerTabJSONParser<Map<String, Object>> {
|
||||
public class PerformanceJSONCreator implements ServerTabJSONCreator<Map<String, Object>> {
|
||||
|
||||
private final PlanConfig config;
|
||||
private final Locale locale;
|
||||
@ -54,7 +54,7 @@ public class PerformanceJSONParser implements ServerTabJSONParser<Map<String, Ob
|
||||
private final Formatter<Double> percentageFormatter;
|
||||
|
||||
@Inject
|
||||
public PerformanceJSONParser(
|
||||
public PerformanceJSONCreator(
|
||||
PlanConfig config,
|
||||
Locale locale,
|
||||
DBSystem dbSystem,
|
@ -34,12 +34,12 @@ import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Parses JSON payload for /server-page Playerbase Overview tab.
|
||||
* Creates JSON payload for /server-page Playerbase Overview tab.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class PlayerBaseOverviewJSONParser implements ServerTabJSONParser<Map<String, Object>> {
|
||||
public class PlayerBaseOverviewJSONCreator implements ServerTabJSONCreator<Map<String, Object>> {
|
||||
|
||||
private final PlanConfig config;
|
||||
private final DBSystem dbSystem;
|
||||
@ -48,7 +48,7 @@ public class PlayerBaseOverviewJSONParser implements ServerTabJSONParser<Map<Str
|
||||
private final Formatter<Double> percentage;
|
||||
|
||||
@Inject
|
||||
public PlayerBaseOverviewJSONParser(
|
||||
public PlayerBaseOverviewJSONCreator(
|
||||
PlanConfig config,
|
||||
DBSystem dbSystem,
|
||||
Formatters formatters
|
@ -49,7 +49,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Singleton
|
||||
public class PlayerJSONParser {
|
||||
public class PlayerJSONCreator {
|
||||
|
||||
private final PlanConfig config;
|
||||
private final Locale locale;
|
||||
@ -63,7 +63,7 @@ public class PlayerJSONParser {
|
||||
private final Formatter<Long> year;
|
||||
|
||||
@Inject
|
||||
public PlayerJSONParser(
|
||||
public PlayerJSONCreator(
|
||||
PlanConfig config,
|
||||
Locale locale,
|
||||
Theme theme,
|
@ -34,13 +34,13 @@ import org.apache.commons.text.StringEscapeUtils;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Parsing utility for creating jQuery Datatables JSON for a Players Table.
|
||||
* Utility for creating jQuery Datatables JSON for a Players Table.
|
||||
* <p>
|
||||
* See https://www.datatables.net/manual/data/orthogonal-data#HTML-5 for sort kinds
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public class PlayersTableJSONParser {
|
||||
public class PlayersTableJSONCreator {
|
||||
|
||||
private final List<TablePlayer> players;
|
||||
private final List<ExtensionDescriptive> extensionDescriptives;
|
||||
@ -53,7 +53,7 @@ public class PlayersTableJSONParser {
|
||||
|
||||
private final Formatter<Double> decimalFormatter;
|
||||
|
||||
public PlayersTableJSONParser(
|
||||
public PlayersTableJSONCreator(
|
||||
List<TablePlayer> players,
|
||||
Map<UUID, ExtensionTabData> extensionData,
|
||||
// Settings
|
||||
@ -95,12 +95,12 @@ public class PlayersTableJSONParser {
|
||||
}
|
||||
|
||||
public String toJSONString() {
|
||||
String data = parseData();
|
||||
String columnHeaders = parseColumnHeaders();
|
||||
String data = createData();
|
||||
String columnHeaders = createColumnHeaders();
|
||||
return "{\"columns\":" + columnHeaders + ",\"data\":" + data + '}';
|
||||
}
|
||||
|
||||
private String parseData() {
|
||||
private String createData() {
|
||||
StringBuilder dataJSON = new StringBuilder("[");
|
||||
|
||||
int currentPlayerNumber = 0;
|
||||
@ -143,7 +143,7 @@ public class PlayersTableJSONParser {
|
||||
|
||||
Html link = openPlayerPageInNewTab ? Html.LINK_EXTERNAL : Html.LINK;
|
||||
|
||||
dataJSON.append(makeDataEntry(link.parse(url, StringUtils.replace(StringEscapeUtils.escapeHtml4(name), "\\", "\\\\")), "name")).append(',') // Backslashes escaped to prevent json errors
|
||||
dataJSON.append(makeDataEntry(link.create(url, StringUtils.replace(StringEscapeUtils.escapeHtml4(name), "\\", "\\\\")), "name")).append(',') // Backslashes escaped to prevent json errors
|
||||
.append(makeDataEntry(activityIndex.getValue(), activityString, "index")).append(',')
|
||||
.append(makeDataEntry(playtime, numberFormatters.get(FormatType.TIME_MILLISECONDS).apply(playtime), "playtime")).append(',')
|
||||
.append(makeDataEntry(loginTimes, "sessions")).append(',')
|
||||
@ -187,7 +187,7 @@ public class PlayersTableJSONParser {
|
||||
}
|
||||
}
|
||||
|
||||
private String parseColumnHeaders() {
|
||||
private String createColumnHeaders() {
|
||||
StringBuilder columnHeaders = new StringBuilder("[");
|
||||
|
||||
// Is the data for the column formatted
|
@ -28,19 +28,19 @@ import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Parses JSON payload for /server-page PvP and PvE tab.
|
||||
* Creates JSON payload for /server-page PvP and PvE tab.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class PvPPvEJSONParser implements ServerTabJSONParser<Map<String, Object>> {
|
||||
public class PvPPvEJSONCreator implements ServerTabJSONCreator<Map<String, Object>> {
|
||||
|
||||
private final DBSystem dbSystem;
|
||||
|
||||
private final Formatter<Double> decimals;
|
||||
|
||||
@Inject
|
||||
public PvPPvEJSONParser(
|
||||
public PvPPvEJSONCreator(
|
||||
DBSystem dbSystem,
|
||||
Formatters formatters
|
||||
) {
|
@ -43,12 +43,12 @@ import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Parses JSON payload for /server-page Server Overview tab.
|
||||
* Creates JSON payload for /server-page Server Overview tab.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class ServerOverviewJSONParser implements ServerTabJSONParser<Map<String, Object>> {
|
||||
public class ServerOverviewJSONCreator implements ServerTabJSONCreator<Map<String, Object>> {
|
||||
|
||||
private final Formatter<Long> day;
|
||||
private final PlanConfig config;
|
||||
@ -63,7 +63,7 @@ public class ServerOverviewJSONParser implements ServerTabJSONParser<Map<String,
|
||||
private final TimeZone timeZone;
|
||||
|
||||
@Inject
|
||||
public ServerOverviewJSONParser(
|
||||
public ServerOverviewJSONCreator(
|
||||
PlanConfig config,
|
||||
Locale locale,
|
||||
DBSystem dbSystem,
|
@ -20,11 +20,11 @@ import java.util.UUID;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Interface for different tab JSON parsers.
|
||||
* Interface using Server UUID for creating Objects that can be turned into JSON with Gson.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public interface ServerTabJSONParser<T> extends Function<UUID, T> {
|
||||
public interface ServerTabJSONCreator<T> extends Function<UUID, T> {
|
||||
|
||||
T createJSONAsMap(UUID serverUUID);
|
||||
|
@ -34,12 +34,12 @@ import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Parses JSON payload for /server-page Sessions tab.
|
||||
* Creates JSON payload for /server-page Sessions tab.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class SessionsOverviewJSONParser implements ServerTabJSONParser<Map<String, Object>> {
|
||||
public class SessionsOverviewJSONCreator implements ServerTabJSONCreator<Map<String, Object>> {
|
||||
|
||||
private final DBSystem dbSystem;
|
||||
|
||||
@ -47,7 +47,7 @@ public class SessionsOverviewJSONParser implements ServerTabJSONParser<Map<Strin
|
||||
private final Formatter<Double> percentage;
|
||||
|
||||
@Inject
|
||||
public SessionsOverviewJSONParser(
|
||||
public SessionsOverviewJSONCreator(
|
||||
DBSystem dbSystem,
|
||||
Formatters formatters
|
||||
) {
|
@ -55,7 +55,7 @@ import java.util.stream.Collectors;
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class GraphJSONParser {
|
||||
public class GraphJSONCreator {
|
||||
|
||||
private final PlanConfig config;
|
||||
private final Theme theme;
|
||||
@ -64,7 +64,7 @@ public class GraphJSONParser {
|
||||
private final TimeZone timeZone;
|
||||
|
||||
@Inject
|
||||
public GraphJSONParser(
|
||||
public GraphJSONCreator(
|
||||
PlanConfig config,
|
||||
Theme theme,
|
||||
DBSystem dbSystem,
|
@ -65,13 +65,13 @@ public class WorldPie extends PieWithDrilldown {
|
||||
Map<String, Object> drilldown = new HashMap<>();
|
||||
drilldown.put("name", worldAlias.getKey());
|
||||
drilldown.put("id", worldAlias.getKey());
|
||||
drilldown.put("data", parseGMTimesForWorld(worldAlias.getValue()));
|
||||
drilldown.put("data", createGMTimesForWorld(worldAlias.getValue()));
|
||||
drilldowns.add(drilldown);
|
||||
}
|
||||
return drilldowns;
|
||||
}
|
||||
|
||||
private List<List> parseGMTimesForWorld(GMTimes gmTimes) {
|
||||
private List<List> createGMTimesForWorld(GMTimes gmTimes) {
|
||||
List<List> data = new ArrayList<>();
|
||||
for (Map.Entry<String, Long> gmEntry : gmTimes.getTimes().entrySet()) {
|
||||
List gmList = Arrays.asList(gmEntry.getKey(), gmEntry.getValue());
|
||||
|
@ -40,12 +40,12 @@ import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Parses JSON payload for /network-page Network Overview tab.
|
||||
* Creates JSON payload for /network-page Network Overview tab.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class NetworkOverviewJSONParser implements NetworkTabJSONParser<Map<String, Object>> {
|
||||
public class NetworkOverviewJSONCreator implements NetworkTabJSONCreator<Map<String, Object>> {
|
||||
|
||||
private final Formatter<Long> day;
|
||||
private final PlanConfig config;
|
||||
@ -55,7 +55,7 @@ public class NetworkOverviewJSONParser implements NetworkTabJSONParser<Map<Strin
|
||||
private final Formatter<DateHolder> year;
|
||||
|
||||
@Inject
|
||||
public NetworkOverviewJSONParser(
|
||||
public NetworkOverviewJSONCreator(
|
||||
PlanConfig config,
|
||||
DBSystem dbSystem,
|
||||
ServerInfo serverInfo,
|
@ -34,12 +34,12 @@ import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Parses JSON payload for /network-page Playerbase Overview tab.
|
||||
* Creates JSON payload for /network-page Playerbase Overview tab.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class NetworkPlayerBaseOverviewJSONParser implements NetworkTabJSONParser<Map<String, Object>> {
|
||||
public class NetworkPlayerBaseOverviewJSONCreator implements NetworkTabJSONCreator<Map<String, Object>> {
|
||||
|
||||
private final PlanConfig config;
|
||||
private final DBSystem dbSystem;
|
||||
@ -48,7 +48,7 @@ public class NetworkPlayerBaseOverviewJSONParser implements NetworkTabJSONParser
|
||||
private final Formatter<Double> percentage;
|
||||
|
||||
@Inject
|
||||
public NetworkPlayerBaseOverviewJSONParser(
|
||||
public NetworkPlayerBaseOverviewJSONCreator(
|
||||
PlanConfig config,
|
||||
DBSystem dbSystem,
|
||||
Formatters formatters
|
@ -30,12 +30,12 @@ import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Parses JSON payload for /network-page Sessions tab.
|
||||
* Creates JSON payload for /network-page Sessions tab.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class NetworkSessionsOverviewJSONParser implements NetworkTabJSONParser<Map<String, Object>> {
|
||||
public class NetworkSessionsOverviewJSONCreator implements NetworkTabJSONCreator<Map<String, Object>> {
|
||||
|
||||
private final DBSystem dbSystem;
|
||||
|
||||
@ -43,7 +43,7 @@ public class NetworkSessionsOverviewJSONParser implements NetworkTabJSONParser<M
|
||||
private final Formatter<Double> percentage;
|
||||
|
||||
@Inject
|
||||
public NetworkSessionsOverviewJSONParser(
|
||||
public NetworkSessionsOverviewJSONCreator(
|
||||
DBSystem dbSystem,
|
||||
Formatters formatters
|
||||
) {
|
@ -19,11 +19,11 @@ package com.djrapitops.plan.delivery.rendering.json.network;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Interface for different tab JSON parsers.
|
||||
* Interface for different tab JSON creators.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public interface NetworkTabJSONParser<T> extends Supplier<T> {
|
||||
public interface NetworkTabJSONCreator<T> extends Supplier<T> {
|
||||
|
||||
T createJSONAsMap();
|
||||
|
@ -46,7 +46,7 @@ import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Html parsing for the Debug page.
|
||||
* Html String generator for /debug page.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@ -84,8 +84,8 @@ public class DebugPage implements Page {
|
||||
public String toHtml() {
|
||||
StringBuilder preContent = new StringBuilder();
|
||||
|
||||
String issueLink = Html.LINK_EXTERNAL.parse("https://github.com/Rsl1122/Plan-PlayerAnalytics/issues/new", "Create new issue on Github");
|
||||
String hastebinLink = Html.LINK_EXTERNAL.parse("https://hastebin.com/", "Create a new hastebin paste");
|
||||
String issueLink = Html.LINK_EXTERNAL.create("https://github.com/Rsl1122/Plan-PlayerAnalytics/issues/new", "Create new issue on Github");
|
||||
String hastebinLink = Html.LINK_EXTERNAL.create("https://hastebin.com/", "Create a new hastebin paste");
|
||||
|
||||
preContent.append("<p>")
|
||||
.append(Html.separateWithDots(issueLink, hastebinLink)).append("<br><br>")
|
||||
|
@ -21,7 +21,7 @@ import com.djrapitops.plan.delivery.formatting.Formatters;
|
||||
import com.djrapitops.plan.delivery.formatting.PlaceholderReplacer;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.extension.implementation.results.ExtensionData;
|
||||
import com.djrapitops.plan.extension.implementation.storage.queries.ExtensionServerDataQuery;
|
||||
import com.djrapitops.plan.identification.ServerInfo;
|
||||
@ -38,7 +38,7 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Html String parser for /network page.
|
||||
* Html String generator for /network page.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@ -72,7 +72,7 @@ public class NetworkPage implements Page {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toHtml() throws ParseException {
|
||||
public String toHtml() throws GenerationException {
|
||||
try {
|
||||
PlaceholderReplacer placeholders = new PlaceholderReplacer();
|
||||
|
||||
@ -105,7 +105,7 @@ public class NetworkPage implements Page {
|
||||
|
||||
return placeholders.apply(files.getCustomizableResourceOrDefault("web/network.html").asString());
|
||||
} catch (Exception e) {
|
||||
throw new ParseException(e);
|
||||
throw new GenerationException(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -16,14 +16,14 @@
|
||||
*/
|
||||
package com.djrapitops.plan.delivery.rendering.pages;
|
||||
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
|
||||
/**
|
||||
* Interface for parsing page HTML.
|
||||
* Interface for generating page HTML String.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public interface Page {
|
||||
|
||||
String toHtml() throws ParseException;
|
||||
String toHtml() throws GenerationException;
|
||||
}
|
@ -22,7 +22,7 @@ import com.djrapitops.plan.delivery.formatting.Formatter;
|
||||
import com.djrapitops.plan.delivery.formatting.Formatters;
|
||||
import com.djrapitops.plan.delivery.formatting.PlaceholderReplacer;
|
||||
import com.djrapitops.plan.delivery.rendering.html.Html;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.identification.ServerInfo;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.settings.theme.Theme;
|
||||
@ -34,7 +34,7 @@ import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Used for parsing Inspect page out of database data and the html.
|
||||
* Html String generator for /player page.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@ -76,18 +76,18 @@ public class PlayerPage implements Page {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toHtml() throws ParseException {
|
||||
public String toHtml() throws GenerationException {
|
||||
if (!player.getValue(PlayerKeys.REGISTERED).isPresent()) {
|
||||
throw new IllegalStateException("Player is not registered");
|
||||
}
|
||||
try {
|
||||
return parse(player);
|
||||
return createFor(player);
|
||||
} catch (Exception e) {
|
||||
throw new ParseException(e);
|
||||
throw new GenerationException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String parse(PlayerContainer player) throws IOException {
|
||||
public String createFor(PlayerContainer player) throws IOException {
|
||||
long now = System.currentTimeMillis();
|
||||
UUID playerUUID = player.getUnsafe(PlayerKeys.UUID);
|
||||
|
||||
@ -107,7 +107,7 @@ public class PlayerPage implements Page {
|
||||
placeholders.put("serverPieColors", theme.getValue(ThemeVal.GRAPH_SERVER_PREF_PIE));
|
||||
placeholders.put("firstDay", 1);
|
||||
|
||||
placeholders.put("backButton", (serverInfo.getServer().isProxy() ? Html.BACK_BUTTON_NETWORK : Html.BACK_BUTTON_SERVER).parse());
|
||||
placeholders.put("backButton", (serverInfo.getServer().isProxy() ? Html.BACK_BUTTON_NETWORK : Html.BACK_BUTTON_SERVER).create());
|
||||
|
||||
PlayerPluginTab pluginTabs = pageFactory.inspectPluginTabs(playerUUID);
|
||||
|
||||
|
@ -110,7 +110,7 @@ public class PlayerPluginTab implements Comparable<PlayerPluginTab> {
|
||||
String tabsElement;
|
||||
if (onlyGeneric) {
|
||||
ExtensionTabData genericTabData = datum.getTabs().get(0);
|
||||
tabsElement = parseContentHtml(genericTabData);
|
||||
tabsElement = buildContentHtml(genericTabData);
|
||||
} else {
|
||||
tabsElement = new TabsElement(
|
||||
datum.getTabs().stream().map(this::wrapToTabElementTab).toArray(TabsElement.Tab[]::new)
|
||||
@ -135,7 +135,7 @@ public class PlayerPluginTab implements Comparable<PlayerPluginTab> {
|
||||
|
||||
private TabsElement.Tab wrapToTabElementTab(ExtensionTabData tabData) {
|
||||
TabInformation tabInformation = tabData.getTabInformation();
|
||||
String tabContentHtml = parseContentHtml(tabData);
|
||||
String tabContentHtml = buildContentHtml(tabData);
|
||||
|
||||
String tabName = tabInformation.getTabName();
|
||||
return new TabsElement.Tab(tabName.isEmpty()
|
||||
@ -144,13 +144,13 @@ public class PlayerPluginTab implements Comparable<PlayerPluginTab> {
|
||||
tabContentHtml);
|
||||
}
|
||||
|
||||
private String parseContentHtml(ExtensionTabData tabData) {
|
||||
private String buildContentHtml(ExtensionTabData tabData) {
|
||||
TabInformation tabInformation = tabData.getTabInformation();
|
||||
|
||||
ElementOrder[] order = tabInformation.getTabElementOrder().orElse(ElementOrder.values());
|
||||
String values = parseValuesHtml(tabData);
|
||||
String values = buildValuesHtml(tabData);
|
||||
String valuesHtml = values.isEmpty() ? "" : "<div class=\"card-body\">" + values + "</div>";
|
||||
String tablesHtml = parseTablesHtml(tabData);
|
||||
String tablesHtml = buildTablesHtml(tabData);
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
@ -170,18 +170,18 @@ public class PlayerPluginTab implements Comparable<PlayerPluginTab> {
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private String parseTablesHtml(ExtensionTabData tabData) {
|
||||
private String buildTablesHtml(ExtensionTabData tabData) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (ExtensionTableData tableData : tabData.getTableData()) {
|
||||
if (tableData.isWideTable()) {
|
||||
hasWideTable = true;
|
||||
}
|
||||
builder.append(tableData.getHtmlTable().parseHtml());
|
||||
builder.append(tableData.getHtmlTable().buildHtml());
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private String parseValuesHtml(ExtensionTabData tabData) {
|
||||
private String buildValuesHtml(ExtensionTabData tabData) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String key : tabData.getValueOrder()) {
|
||||
tabData.getBoolean(key).ifPresent(data -> append(builder, data.getDescriptive(), data.getFormattedValue()));
|
||||
|
@ -17,7 +17,7 @@
|
||||
package com.djrapitops.plan.delivery.rendering.pages;
|
||||
|
||||
import com.djrapitops.plan.delivery.formatting.PlaceholderReplacer;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.identification.ServerInfo;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.settings.config.paths.PluginSettings;
|
||||
@ -26,7 +26,7 @@ import com.djrapitops.plan.storage.file.PlanFiles;
|
||||
import com.djrapitops.plan.version.VersionCheckSystem;
|
||||
|
||||
/**
|
||||
* Html String parser for /players page.
|
||||
* Html String generator for /players page.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@ -50,7 +50,7 @@ public class PlayersPage implements Page {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toHtml() throws ParseException {
|
||||
public String toHtml() throws GenerationException {
|
||||
try {
|
||||
PlaceholderReplacer placeholders = new PlaceholderReplacer();
|
||||
|
||||
@ -64,7 +64,7 @@ public class PlayersPage implements Page {
|
||||
|
||||
return placeholders.apply(files.getCustomizableResourceOrDefault("web/players.html").asString());
|
||||
} catch (Exception e) {
|
||||
throw new ParseException(e);
|
||||
throw new GenerationException(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -25,7 +25,7 @@ import com.djrapitops.plan.delivery.formatting.PlaceholderReplacer;
|
||||
import com.djrapitops.plan.delivery.rendering.html.Html;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.extension.implementation.results.ExtensionData;
|
||||
import com.djrapitops.plan.extension.implementation.storage.queries.ExtensionServerDataQuery;
|
||||
import com.djrapitops.plan.identification.Server;
|
||||
@ -45,7 +45,7 @@ import java.util.UUID;
|
||||
import static com.djrapitops.plan.delivery.domain.keys.AnalysisKeys.*;
|
||||
|
||||
/**
|
||||
* Used for parsing a Html String out of server.html.
|
||||
* Html String generator for /server page.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@ -81,7 +81,7 @@ public class ServerPage implements Page {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toHtml() throws ParseException {
|
||||
public String toHtml() throws GenerationException {
|
||||
PlaceholderReplacer placeholders = new PlaceholderReplacer();
|
||||
|
||||
UUID serverUUID = server.getUuid();
|
||||
@ -123,7 +123,7 @@ public class ServerPage implements Page {
|
||||
AVG_PING_COLOR, MAX_PING_COLOR, MIN_PING_COLOR
|
||||
);
|
||||
|
||||
placeholders.put("backButton", serverInfo.getServer().isProxy() ? Html.BACK_BUTTON_NETWORK.parse() : "");
|
||||
placeholders.put("backButton", serverInfo.getServer().isProxy() ? Html.BACK_BUTTON_NETWORK.create() : "");
|
||||
placeholders.put("version", versionCheckSystem.getUpdateButton().orElse(versionCheckSystem.getCurrentVersionButton()));
|
||||
placeholders.put("updateModal", versionCheckSystem.getUpdateModal());
|
||||
|
||||
@ -141,7 +141,7 @@ public class ServerPage implements Page {
|
||||
try {
|
||||
return placeholders.apply(files.getCustomizableResourceOrDefault("web/server.html").asString());
|
||||
} catch (IOException e) {
|
||||
throw new ParseException(e);
|
||||
throw new GenerationException(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -120,7 +120,7 @@ public class ServerPluginTabs {
|
||||
String tabsElement;
|
||||
if (onlyGeneric) {
|
||||
ExtensionTabData genericTabData = datum.getTabs().get(0);
|
||||
tabsElement = parseContentHtml(genericTabData);
|
||||
tabsElement = buildContentHtml(genericTabData);
|
||||
} else {
|
||||
tabsElement = new TabsElement(
|
||||
datum.getTabs().stream().map(this::wrapToTabElementTab).toArray(TabsElement.Tab[]::new)
|
||||
@ -144,7 +144,7 @@ public class ServerPluginTabs {
|
||||
String tabsElement;
|
||||
if (onlyGeneric) {
|
||||
ExtensionTabData genericTabData = datum.getTabs().get(0);
|
||||
tabsElement = parseContentHtml(genericTabData);
|
||||
tabsElement = buildContentHtml(genericTabData);
|
||||
} else {
|
||||
tabsElement = new TabsElement(
|
||||
datum.getTabs().stream().map(this::wrapToTabElementTab).toArray(TabsElement.Tab[]::new)
|
||||
@ -169,7 +169,7 @@ public class ServerPluginTabs {
|
||||
|
||||
private TabsElement.Tab wrapToTabElementTab(ExtensionTabData tabData) {
|
||||
TabInformation tabInformation = tabData.getTabInformation();
|
||||
String tabContentHtml = parseContentHtml(tabData);
|
||||
String tabContentHtml = buildContentHtml(tabData);
|
||||
|
||||
String tabName = tabInformation.getTabName();
|
||||
return new TabsElement.Tab(tabName.isEmpty()
|
||||
@ -178,13 +178,13 @@ public class ServerPluginTabs {
|
||||
tabContentHtml);
|
||||
}
|
||||
|
||||
private String parseContentHtml(ExtensionTabData tabData) {
|
||||
private String buildContentHtml(ExtensionTabData tabData) {
|
||||
TabInformation tabInformation = tabData.getTabInformation();
|
||||
|
||||
ElementOrder[] order = tabInformation.getTabElementOrder().orElse(ElementOrder.values());
|
||||
String values = parseValuesHtml(tabData);
|
||||
String values = buildValuesHtml(tabData);
|
||||
String valuesHtml = values.isEmpty() ? "" : "<div class=\"card-body\">" + values + "</div>";
|
||||
String tablesHtml = parseTablesHtml(tabData);
|
||||
String tablesHtml = buildTablesHtml(tabData);
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
@ -204,15 +204,15 @@ public class ServerPluginTabs {
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private String parseTablesHtml(ExtensionTabData tabData) {
|
||||
private String buildTablesHtml(ExtensionTabData tabData) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (ExtensionTableData tableData : tabData.getTableData()) {
|
||||
builder.append(tableData.getHtmlTable().parseHtml());
|
||||
builder.append(tableData.getHtmlTable().buildHtml());
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private String parseValuesHtml(ExtensionTabData tabData) {
|
||||
private String buildValuesHtml(ExtensionTabData tabData) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String key : tabData.getValueOrder()) {
|
||||
tabData.getBoolean(key).ifPresent(data -> append(builder, data.getDescriptive(), data.getFormattedValue()));
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package com.djrapitops.plan.delivery.webserver.pages.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.graphs.GraphJSONParser;
|
||||
import com.djrapitops.plan.delivery.rendering.json.graphs.GraphJSONCreator;
|
||||
import com.djrapitops.plan.delivery.webserver.Request;
|
||||
import com.djrapitops.plan.delivery.webserver.RequestTarget;
|
||||
import com.djrapitops.plan.delivery.webserver.auth.Authentication;
|
||||
@ -44,12 +44,12 @@ import java.util.UUID;
|
||||
public class GraphsJSONResolver implements PageResolver {
|
||||
|
||||
private final Identifiers identifiers;
|
||||
private final GraphJSONParser graphJSON;
|
||||
private final GraphJSONCreator graphJSON;
|
||||
|
||||
@Inject
|
||||
public GraphsJSONResolver(
|
||||
Identifiers identifiers,
|
||||
GraphJSONParser graphJSON
|
||||
GraphJSONCreator graphJSON
|
||||
) {
|
||||
this.identifiers = identifiers;
|
||||
this.graphJSON = graphJSON;
|
||||
|
@ -17,10 +17,10 @@
|
||||
package com.djrapitops.plan.delivery.webserver.pages.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.JSONFactory;
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkOverviewJSONParser;
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkPlayerBaseOverviewJSONParser;
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkSessionsOverviewJSONParser;
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkTabJSONParser;
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkOverviewJSONCreator;
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkPlayerBaseOverviewJSONCreator;
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkSessionsOverviewJSONCreator;
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkTabJSONCreator;
|
||||
import com.djrapitops.plan.delivery.webserver.RequestTarget;
|
||||
import com.djrapitops.plan.delivery.webserver.auth.Authentication;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
@ -42,21 +42,21 @@ public class NetworkJSONResolver extends CompositePageResolver {
|
||||
public NetworkJSONResolver(
|
||||
ResponseFactory responseFactory,
|
||||
JSONFactory jsonFactory,
|
||||
NetworkOverviewJSONParser networkOverviewJSONParser,
|
||||
NetworkPlayerBaseOverviewJSONParser playerBaseOverviewJSONParser,
|
||||
NetworkSessionsOverviewJSONParser sessionsOverviewJSONParser
|
||||
NetworkOverviewJSONCreator networkOverviewJSONCreator,
|
||||
NetworkPlayerBaseOverviewJSONCreator networkPlayerBaseOverviewJSONCreator,
|
||||
NetworkSessionsOverviewJSONCreator networkSessionsOverviewJSONCreator
|
||||
) {
|
||||
super(responseFactory);
|
||||
|
||||
registerPage("overview", DataID.SERVER_OVERVIEW, networkOverviewJSONParser);
|
||||
registerPage("playerbaseOverview", DataID.PLAYERBASE_OVERVIEW, playerBaseOverviewJSONParser);
|
||||
registerPage("sessionsOverview", DataID.SESSIONS_OVERVIEW, sessionsOverviewJSONParser);
|
||||
registerPage("overview", DataID.SERVER_OVERVIEW, networkOverviewJSONCreator);
|
||||
registerPage("playerbaseOverview", DataID.PLAYERBASE_OVERVIEW, networkPlayerBaseOverviewJSONCreator);
|
||||
registerPage("sessionsOverview", DataID.SESSIONS_OVERVIEW, networkSessionsOverviewJSONCreator);
|
||||
registerPage("servers", DataID.SERVERS, jsonFactory::serversAsJSONMaps);
|
||||
registerPage("pingTable", DataID.PING_TABLE, jsonFactory::pingPerGeolocation);
|
||||
}
|
||||
|
||||
private <T> void registerPage(String identifier, DataID dataID, NetworkTabJSONParser<T> tabJSONParser) {
|
||||
registerPage(identifier, new NetworkTabJSONResolver<>(dataID, tabJSONParser));
|
||||
private <T> void registerPage(String identifier, DataID dataID, NetworkTabJSONCreator<T> tabJSONCreator) {
|
||||
registerPage(identifier, new NetworkTabJSONResolver<>(dataID, tabJSONCreator));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package com.djrapitops.plan.delivery.webserver.pages.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkTabJSONParser;
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkTabJSONCreator;
|
||||
import com.djrapitops.plan.delivery.webserver.Request;
|
||||
import com.djrapitops.plan.delivery.webserver.RequestTarget;
|
||||
import com.djrapitops.plan.delivery.webserver.auth.Authentication;
|
||||
@ -37,16 +37,16 @@ import java.util.function.Supplier;
|
||||
public class NetworkTabJSONResolver<T> implements PageResolver {
|
||||
|
||||
private final DataID dataID;
|
||||
private final Supplier<T> jsonParser;
|
||||
private final Supplier<T> jsonCreator;
|
||||
|
||||
public NetworkTabJSONResolver(DataID dataID, NetworkTabJSONParser<T> jsonParser) {
|
||||
public NetworkTabJSONResolver(DataID dataID, NetworkTabJSONCreator<T> jsonCreator) {
|
||||
this.dataID = dataID;
|
||||
this.jsonParser = jsonParser;
|
||||
this.jsonCreator = jsonCreator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response resolve(Request request, RequestTarget target) {
|
||||
return JSONCache.getOrCache(dataID, () -> new JSONResponse(jsonParser.get()));
|
||||
return JSONCache.getOrCache(dataID, () -> new JSONResponse(jsonCreator.get()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,7 +17,7 @@
|
||||
package com.djrapitops.plan.delivery.webserver.pages.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.domain.WebUser;
|
||||
import com.djrapitops.plan.delivery.rendering.json.PlayerJSONParser;
|
||||
import com.djrapitops.plan.delivery.rendering.json.PlayerJSONCreator;
|
||||
import com.djrapitops.plan.delivery.webserver.Request;
|
||||
import com.djrapitops.plan.delivery.webserver.RequestTarget;
|
||||
import com.djrapitops.plan.delivery.webserver.auth.Authentication;
|
||||
@ -36,18 +36,18 @@ import java.util.UUID;
|
||||
public class PlayerJSONResolver implements PageResolver {
|
||||
|
||||
private final Identifiers identifiers;
|
||||
private final PlayerJSONParser jsonParser;
|
||||
private final PlayerJSONCreator jsonCreator;
|
||||
|
||||
@Inject
|
||||
public PlayerJSONResolver(Identifiers identifiers, PlayerJSONParser jsonParser) {
|
||||
public PlayerJSONResolver(Identifiers identifiers, PlayerJSONCreator jsonCreator) {
|
||||
this.identifiers = identifiers;
|
||||
this.jsonParser = jsonParser;
|
||||
this.jsonCreator = jsonCreator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response resolve(Request request, RequestTarget target) throws WebException {
|
||||
UUID playerUUID = identifiers.getPlayerUUID(target); // Can throw BadRequestException
|
||||
return new JSONResponse(jsonParser.createJSONAsMap(playerUUID));
|
||||
return new JSONResponse(jsonCreator.createJSONAsMap(playerUUID));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +35,7 @@ import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Performs parameter parsing for PvP kills JSON requests.
|
||||
* Resolves /v1/kills JSON requests.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
|
@ -46,13 +46,13 @@ public class RootJSONResolver extends CompositePageResolver {
|
||||
GraphsJSONResolver graphsJSONResolver,
|
||||
SessionsJSONResolver sessionsJSONResolver,
|
||||
PlayersTableJSONResolver playersTableJSONResolver,
|
||||
ServerOverviewJSONParser overviewJSONParser,
|
||||
OnlineActivityOverviewJSONParser onlineActivityOverviewJSONParser,
|
||||
SessionsOverviewJSONParser sessionsOverviewJSONParser,
|
||||
ServerOverviewJSONCreator serverOverviewJSONCreator,
|
||||
OnlineActivityOverviewJSONCreator onlineActivityOverviewJSONCreator,
|
||||
SessionsOverviewJSONCreator sessionsOverviewJSONCreator,
|
||||
PlayerKillsJSONResolver playerKillsJSONResolver,
|
||||
PvPPvEJSONParser pvPPvEJSONParser,
|
||||
PlayerBaseOverviewJSONParser playerBaseOverviewJSONParser,
|
||||
PerformanceJSONParser performanceJSONParser,
|
||||
PvPPvEJSONCreator pvPPvEJSONCreator,
|
||||
PlayerBaseOverviewJSONCreator playerBaseOverviewJSONCreator,
|
||||
PerformanceJSONCreator performanceJSONCreator,
|
||||
|
||||
PlayerJSONResolver playerJSONResolver,
|
||||
NetworkJSONResolver networkJSONResolver
|
||||
@ -66,19 +66,19 @@ public class RootJSONResolver extends CompositePageResolver {
|
||||
registerPage("pingTable", DataID.PING_TABLE, jsonFactory::pingPerGeolocation);
|
||||
registerPage("graph", graphsJSONResolver, 0);
|
||||
|
||||
registerPage("serverOverview", DataID.SERVER_OVERVIEW, overviewJSONParser);
|
||||
registerPage("onlineOverview", DataID.ONLINE_OVERVIEW, onlineActivityOverviewJSONParser);
|
||||
registerPage("sessionsOverview", DataID.SESSIONS_OVERVIEW, sessionsOverviewJSONParser);
|
||||
registerPage("playerVersus", DataID.PVP_PVE, pvPPvEJSONParser);
|
||||
registerPage("playerbaseOverview", DataID.PLAYERBASE_OVERVIEW, playerBaseOverviewJSONParser);
|
||||
registerPage("performanceOverview", DataID.PERFORMANCE_OVERVIEW, performanceJSONParser);
|
||||
registerPage("serverOverview", DataID.SERVER_OVERVIEW, serverOverviewJSONCreator);
|
||||
registerPage("onlineOverview", DataID.ONLINE_OVERVIEW, onlineActivityOverviewJSONCreator);
|
||||
registerPage("sessionsOverview", DataID.SESSIONS_OVERVIEW, sessionsOverviewJSONCreator);
|
||||
registerPage("playerVersus", DataID.PVP_PVE, pvPPvEJSONCreator);
|
||||
registerPage("playerbaseOverview", DataID.PLAYERBASE_OVERVIEW, playerBaseOverviewJSONCreator);
|
||||
registerPage("performanceOverview", DataID.PERFORMANCE_OVERVIEW, performanceJSONCreator);
|
||||
|
||||
registerPage("player", playerJSONResolver, 2);
|
||||
registerPage("network", networkJSONResolver, 0);
|
||||
}
|
||||
|
||||
private <T> void registerPage(String identifier, DataID dataID, ServerTabJSONParser<T> tabJSONParser) {
|
||||
registerPage(identifier, new ServerTabJSONResolver<>(dataID, identifiers, tabJSONParser), 0);
|
||||
private <T> void registerPage(String identifier, DataID dataID, ServerTabJSONCreator<T> tabJSONCreator) {
|
||||
registerPage(identifier, new ServerTabJSONResolver<>(dataID, identifiers, tabJSONCreator), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package com.djrapitops.plan.delivery.webserver.pages.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.ServerTabJSONParser;
|
||||
import com.djrapitops.plan.delivery.rendering.json.ServerTabJSONCreator;
|
||||
import com.djrapitops.plan.delivery.webserver.Request;
|
||||
import com.djrapitops.plan.delivery.webserver.RequestTarget;
|
||||
import com.djrapitops.plan.delivery.webserver.auth.Authentication;
|
||||
@ -41,22 +41,22 @@ public class ServerTabJSONResolver<T> implements PageResolver {
|
||||
|
||||
private final DataID dataID;
|
||||
private final Identifiers identifiers;
|
||||
private final Function<UUID, T> jsonParser;
|
||||
private final Function<UUID, T> jsonCreator;
|
||||
|
||||
public ServerTabJSONResolver(
|
||||
DataID dataID,
|
||||
Identifiers identifiers,
|
||||
ServerTabJSONParser<T> jsonParser
|
||||
ServerTabJSONCreator<T> jsonCreator
|
||||
) {
|
||||
this.dataID = dataID;
|
||||
this.identifiers = identifiers;
|
||||
this.jsonParser = jsonParser;
|
||||
this.jsonCreator = jsonCreator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response resolve(Request request, RequestTarget target) throws WebException {
|
||||
UUID serverUUID = identifiers.getServerUUID(target); // Can throw BadRequestException
|
||||
return JSONCache.getOrCache(dataID, serverUUID, () -> new JSONResponse(jsonParser.apply(serverUUID)));
|
||||
return JSONCache.getOrCache(dataID, serverUUID, () -> new JSONResponse(jsonCreator.apply(serverUUID)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +35,7 @@ import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Performs parameter parsing for Sessions JSON requests.
|
||||
* Resolves /v1/sessions JSON requests.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
|
@ -19,7 +19,7 @@ package com.djrapitops.plan.delivery.webserver.response;
|
||||
import com.djrapitops.plan.delivery.rendering.pages.PageFactory;
|
||||
import com.djrapitops.plan.delivery.webserver.response.errors.*;
|
||||
import com.djrapitops.plan.delivery.webserver.response.pages.*;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.exceptions.WebUserAuthException;
|
||||
import com.djrapitops.plan.exceptions.connection.NotFoundException;
|
||||
import com.djrapitops.plan.settings.locale.Locale;
|
||||
@ -67,15 +67,15 @@ public class ResponseFactory {
|
||||
try {
|
||||
return new DebugPageResponse(pageFactory.debugPage(), versionCheckSystem, files);
|
||||
} catch (IOException e) {
|
||||
return internalErrorResponse(e, "Failed to parse debug page");
|
||||
return internalErrorResponse(e, "Failed to generate debug page");
|
||||
}
|
||||
}
|
||||
|
||||
public Response playersPageResponse() {
|
||||
try {
|
||||
return new PlayersPageResponse(pageFactory.playersPage());
|
||||
} catch (ParseException e) {
|
||||
return internalErrorResponse(e, "Failed to parse players page");
|
||||
} catch (GenerationException e) {
|
||||
return internalErrorResponse(e, "Failed to generate players page");
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,16 +94,16 @@ public class ResponseFactory {
|
||||
public Response networkPageResponse() {
|
||||
try {
|
||||
return new PageResponse(pageFactory.networkPage());
|
||||
} catch (ParseException e) {
|
||||
return internalErrorResponse(e, "Failed to parse network page");
|
||||
} catch (GenerationException e) {
|
||||
return internalErrorResponse(e, "Failed to generate network page");
|
||||
}
|
||||
}
|
||||
|
||||
public Response serverPageResponse(UUID serverUUID) throws NotFoundException {
|
||||
try {
|
||||
return new PageResponse(pageFactory.serverPage(serverUUID));
|
||||
} catch (ParseException e) {
|
||||
return internalErrorResponse(e, "Failed to parse server page");
|
||||
} catch (GenerationException e) {
|
||||
return internalErrorResponse(e, "Failed to generate server page");
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ public class ResponseFactory {
|
||||
try {
|
||||
return new NotFoundResponse(message, versionCheckSystem, files);
|
||||
} catch (IOException e) {
|
||||
return internalErrorResponse(e, "Failed to parse 404 page");
|
||||
return internalErrorResponse(e, "Failed to generate 404 page");
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ public class ResponseFactory {
|
||||
try {
|
||||
return PromptAuthorizationResponse.getBasicAuthResponse(e, versionCheckSystem, files);
|
||||
} catch (IOException jarReadFailed) {
|
||||
return internalErrorResponse(e, "Failed to parse PromptAuthorizationResponse");
|
||||
return internalErrorResponse(e, "Failed to generate PromptAuthorizationResponse");
|
||||
}
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ public class ResponseFactory {
|
||||
try {
|
||||
return new ForbiddenResponse(message, versionCheckSystem, files);
|
||||
} catch (IOException e) {
|
||||
return internalErrorResponse(e, "Failed to parse ForbiddenResponse");
|
||||
return internalErrorResponse(e, "Failed to generate ForbiddenResponse");
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ public class ResponseFactory {
|
||||
try {
|
||||
return PromptAuthorizationResponse.getBasicAuthResponse(versionCheckSystem, files);
|
||||
} catch (IOException e) {
|
||||
return internalErrorResponse(e, "Failed to parse PromptAuthorizationResponse");
|
||||
return internalErrorResponse(e, "Failed to generate PromptAuthorizationResponse");
|
||||
}
|
||||
}
|
||||
|
||||
@ -203,8 +203,8 @@ public class ResponseFactory {
|
||||
return new PageResponse(pageFactory.playerPage(playerUUID));
|
||||
} catch (IllegalStateException e) {
|
||||
return playerNotFound404();
|
||||
} catch (ParseException e) {
|
||||
return internalErrorResponse(e, "Failed to parse player page");
|
||||
} catch (GenerationException e) {
|
||||
return internalErrorResponse(e, "Failed to generate player page");
|
||||
}
|
||||
}
|
||||
}
|
@ -36,7 +36,7 @@ public class InternalErrorResponse extends ErrorResponse {
|
||||
|
||||
StringBuilder paragraph = new StringBuilder();
|
||||
paragraph.append("Please report this issue here: ");
|
||||
paragraph.append(Html.LINK.parse("https://github.com/Rsl1122/Plan-PlayerAnalytics/issues", "Issues"));
|
||||
paragraph.append(Html.LINK.create("https://github.com/Rsl1122/Plan-PlayerAnalytics/issues", "Issues"));
|
||||
paragraph.append("<br><br><pre>");
|
||||
paragraph.append(e).append(" | ").append(cause);
|
||||
|
||||
|
@ -19,7 +19,7 @@ package com.djrapitops.plan.delivery.webserver.response.pages;
|
||||
import com.djrapitops.plan.delivery.rendering.pages.Page;
|
||||
import com.djrapitops.plan.delivery.webserver.response.Response;
|
||||
import com.djrapitops.plan.delivery.webserver.response.ResponseType;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
import com.djrapitops.plan.settings.locale.Locale;
|
||||
import com.djrapitops.plan.settings.theme.Theme;
|
||||
import com.googlecode.htmlcompressor.compressor.HtmlCompressor;
|
||||
@ -44,7 +44,7 @@ public class PageResponse extends Response {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public PageResponse(Page page) throws ParseException {
|
||||
public PageResponse(Page page) throws GenerationException {
|
||||
this(ResponseType.HTML);
|
||||
super.setHeader("HTTP/1.1 200 OK");
|
||||
setContent(page.toHtml());
|
||||
|
@ -17,14 +17,14 @@
|
||||
package com.djrapitops.plan.delivery.webserver.response.pages;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.pages.PlayersPage;
|
||||
import com.djrapitops.plan.exceptions.ParseException;
|
||||
import com.djrapitops.plan.exceptions.GenerationException;
|
||||
|
||||
/**
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public class PlayersPageResponse extends PageResponse {
|
||||
|
||||
public PlayersPageResponse(PlayersPage playersPage) throws ParseException {
|
||||
public PlayersPageResponse(PlayersPage playersPage) throws GenerationException {
|
||||
setHeader("HTTP/1.1 200 OK");
|
||||
setContent(playersPage.toHtml());
|
||||
}
|
||||
|
@ -21,9 +21,9 @@ package com.djrapitops.plan.exceptions;
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public class ParseException extends Exception {
|
||||
public class GenerationException extends Exception {
|
||||
|
||||
public ParseException(Throwable cause) {
|
||||
public GenerationException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
@ -41,7 +41,7 @@ public class ExtensionStringData implements DescribedExtensionData {
|
||||
|
||||
public String getFormattedValue() {
|
||||
String withColors = Html.swapColorCodesToSpan(value);
|
||||
return !playerName ? withColors : Html.LINK.parse("../player/" + Html.encodeToURL(value), withColors);
|
||||
return !playerName ? withColors : Html.LINK.create("../player/" + Html.encodeToURL(value), withColors);
|
||||
}
|
||||
|
||||
ExtensionStringData concatenate(ExtensionStringData other) {
|
||||
|
@ -37,7 +37,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query aggregated boolean values from player value table.
|
||||
|
@ -37,7 +37,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query aggregated boolean values from player value table.
|
||||
|
@ -35,7 +35,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query aggregated Group values from groups table.
|
||||
|
@ -38,7 +38,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query aggregated boolean values from player value table.
|
||||
|
@ -37,7 +37,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query aggregated boolean values from player value table.
|
||||
|
@ -31,7 +31,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Queries for information about DataExtensions stored in the database.
|
||||
|
@ -36,7 +36,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query all ExtensionData by Server UUIDs.
|
||||
|
@ -37,7 +37,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query player's Groups by Plugin ID inside ExtensionData objects.
|
||||
|
@ -36,7 +36,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query player tables from tableprovider table.
|
||||
|
@ -33,7 +33,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query ExtensionServerData of a server.
|
||||
|
@ -34,7 +34,7 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query Extension data of x most recent players on a server.
|
||||
|
@ -33,7 +33,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Query server tables from tableprovider table.
|
||||
|
@ -27,7 +27,7 @@ import com.djrapitops.plan.storage.database.transactions.ThrowawayTransaction;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Transaction to store an Icon to the database.
|
||||
|
@ -27,8 +27,8 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
|
||||
/**
|
||||
* Transaction to update command usage information in the database.
|
||||
|
@ -29,8 +29,8 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
|
||||
/**
|
||||
* Transaction for storing {@link TabInformation}s.
|
||||
|
@ -31,8 +31,8 @@ import java.sql.Types;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionProviderTable.*;
|
||||
|
||||
/**
|
||||
|
@ -31,8 +31,8 @@ import java.sql.Types;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionProviderTable.*;
|
||||
|
||||
/**
|
||||
|
@ -31,8 +31,8 @@ import java.sql.Types;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionProviderTable.*;
|
||||
|
||||
/**
|
||||
|
@ -32,8 +32,8 @@ import java.sql.Types;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionProviderTable.*;
|
||||
|
||||
/**
|
||||
|
@ -31,8 +31,8 @@ import java.sql.Types;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionProviderTable.*;
|
||||
|
||||
/**
|
||||
|
@ -32,8 +32,8 @@ import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionTableProviderTable.*;
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,7 @@ import java.sql.SQLException;
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Transaction to remove method results that correspond to {@link com.djrapitops.plan.extension.annotation.InvalidateMethod} annotations.
|
||||
|
@ -25,7 +25,7 @@ import com.djrapitops.plan.storage.database.transactions.ThrowawayTransaction;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Transaction to remove older results that violate an updated condition value.
|
||||
|
@ -28,7 +28,7 @@ import com.djrapitops.plan.storage.database.transactions.ThrowawayTransaction;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Transaction to remove older results that violate an updated condition value.
|
||||
|
@ -25,8 +25,8 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionPlayerValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -25,8 +25,8 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionPlayerValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Transaction to store method result of a {@link com.djrapitops.plan.extension.implementation.providers.GroupDataProvider}.
|
||||
|
@ -25,8 +25,8 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionPlayerValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -25,8 +25,8 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionPlayerValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -25,8 +25,8 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.AND;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionPlayerValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionPlayerTableValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,7 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionServerValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,7 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionServerValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,7 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionServerValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,7 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionServerValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,7 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionServerValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.tables.ExtensionServerTableValueTable.*;
|
||||
|
||||
/**
|
||||
|
@ -73,7 +73,7 @@ public class ConfigWriter {
|
||||
if (!directory.toRealPath().toFile().isDirectory()) {
|
||||
Files.createDirectories(directory);
|
||||
}
|
||||
Files.write(outputPath, parseLines(writing), StandardCharsets.UTF_8, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE);
|
||||
Files.write(outputPath, createLines(writing), StandardCharsets.UTF_8, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE);
|
||||
|
||||
writing.updateParent(storedParent);
|
||||
}
|
||||
@ -86,7 +86,7 @@ public class ConfigWriter {
|
||||
* @param writing ConfigNode to "write"
|
||||
* @return List of lines that would be written.
|
||||
*/
|
||||
public List<String> parseLines(ConfigNode writing) {
|
||||
public List<String> createLines(ConfigNode writing) {
|
||||
List<String> lines = new ArrayList<>();
|
||||
|
||||
dfsTreeTraverseLineResolve(writing, lines);
|
||||
|
@ -86,7 +86,7 @@ public class Locale extends HashMap<Lang, Message> {
|
||||
}
|
||||
|
||||
public String getString(Lang key, Serializable... values) {
|
||||
return get(key).parse(values);
|
||||
return get(key).toString(values);
|
||||
}
|
||||
|
||||
public String[] getArray(Lang key) {
|
||||
|
@ -37,7 +37,7 @@ public class Message {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String parse(Serializable... p) {
|
||||
public String toString(Serializable... p) {
|
||||
Verify.nullCheck(p);
|
||||
|
||||
Map<String, Serializable> replaceMap = new HashMap<>();
|
||||
@ -56,7 +56,7 @@ public class Message {
|
||||
}
|
||||
|
||||
public String[] toArray(Serializable... p) {
|
||||
return parse(p).split(content, '\\');
|
||||
return toString(p).split(content, '\\');
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -69,7 +69,9 @@ public enum ThemeVal {
|
||||
WORLD_MAP_HIGH("GraphColors.WorldMap_High", "#267f00"),
|
||||
WORLD_MAP_LOW("GraphColors.WorldMap_Low", "#EEFFEE"),
|
||||
|
||||
@Deprecated
|
||||
PARSED_SESSION_ACCORDION("ParsedElements.SessionAccordion", "teal"),
|
||||
@Deprecated
|
||||
PARSED_SERVER_ACCORDION("ParsedElements.ServerAccordion", "light-green");
|
||||
|
||||
private final String themePath;
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package com.djrapitops.plan.storage.database;
|
||||
|
||||
import com.djrapitops.plan.storage.database.sql.parsing.Sql;
|
||||
import com.djrapitops.plan.storage.database.sql.building.Sql;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -18,7 +18,7 @@ package com.djrapitops.plan.storage.database;
|
||||
|
||||
import com.djrapitops.plan.exceptions.database.DBInitException;
|
||||
import com.djrapitops.plan.storage.database.queries.Query;
|
||||
import com.djrapitops.plan.storage.database.sql.parsing.Sql;
|
||||
import com.djrapitops.plan.storage.database.sql.building.Sql;
|
||||
import com.djrapitops.plan.storage.database.transactions.Transaction;
|
||||
|
||||
import java.util.concurrent.Future;
|
||||
|
@ -29,7 +29,7 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.WHERE;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.WHERE;
|
||||
|
||||
/**
|
||||
* Static method class for single item store queries.
|
||||
|
@ -26,7 +26,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Static method class for queries that use large amount of memory.
|
||||
|
@ -26,7 +26,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Static method class for queries that count together counts for a player on a per server basis.
|
||||
|
@ -25,7 +25,7 @@ import java.sql.SQLException;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Static method class for queries that return information related to a single player.
|
||||
|
@ -26,7 +26,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Static method class for queries that count how many entries of particular kinds there are for a server.
|
||||
|
@ -28,7 +28,7 @@ import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Queries for Activity Index that attempts to gain insight into player activity levels.
|
||||
|
@ -31,7 +31,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Queries for Activity Index that attempts to gain insight into player activity levels.
|
||||
|
@ -18,7 +18,7 @@ package com.djrapitops.plan.storage.database.queries.analysis;
|
||||
|
||||
import com.djrapitops.plan.storage.database.queries.Query;
|
||||
import com.djrapitops.plan.storage.database.queries.QueryStatement;
|
||||
import com.djrapitops.plan.storage.database.sql.parsing.Sql;
|
||||
import com.djrapitops.plan.storage.database.sql.building.Sql;
|
||||
import com.djrapitops.plan.storage.database.sql.tables.SessionsTable;
|
||||
import com.djrapitops.plan.storage.database.sql.tables.UserInfoTable;
|
||||
import com.djrapitops.plan.storage.database.sql.tables.UsersTable;
|
||||
@ -28,7 +28,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Queries for server overview tab data.
|
||||
|
@ -21,7 +21,7 @@ import com.djrapitops.plan.gathering.domain.UserInfo;
|
||||
import com.djrapitops.plan.storage.database.queries.Query;
|
||||
import com.djrapitops.plan.storage.database.queries.QueryAllStatement;
|
||||
import com.djrapitops.plan.storage.database.queries.QueryStatement;
|
||||
import com.djrapitops.plan.storage.database.sql.parsing.Select;
|
||||
import com.djrapitops.plan.storage.database.sql.building.Select;
|
||||
import com.djrapitops.plan.storage.database.sql.tables.UserInfoTable;
|
||||
import com.djrapitops.plan.storage.database.sql.tables.UsersTable;
|
||||
|
||||
@ -33,7 +33,7 @@ import java.util.HashSet;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Queries for {@link BaseUser} objects.
|
||||
|
@ -28,7 +28,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import static com.djrapitops.plan.storage.database.sql.parsing.Sql.*;
|
||||
import static com.djrapitops.plan.storage.database.sql.building.Sql.*;
|
||||
|
||||
/**
|
||||
* Queries for {@link GeoInfo} objects.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user