Skip to content

Commit

Permalink
reverted unused methods. issue #2623
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Oct 27, 2024
1 parent c716cb9 commit 113880c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -996,13 +996,10 @@ public void removeOptionGroup(String id) {
}

private String getTypedFolderName(int templateType) {
switch(templateType) {
case SystemManagementLocal.TEMPLATE_TYPE_HEAD:
return "letterheads";
case SystemManagementLocal.TEMPLATE_TYPE_EMAIL:
return "emailtemplates";
default:
return "templates";
if (templateType == SystemManagementRemote.TEMPLATE_TYPE_HEAD) {
return "letterheads";
} else {
return "templates";
}
}

Expand Down Expand Up @@ -2552,44 +2549,4 @@ public List<ImportLogEntry> importSheets(byte[] odsData, List<String> sheetNames
return importer.importSheets(sheetNames, dryRun);

}

// eMail Templates
@Override
public String getTemplateContent(int templateType, String folder, String templateName) throws Exception {
String localBaseDir = this.getTemplatesBaseDir(templateType, folder);
String templatePath = localBaseDir + File.separator + templateName;

File templateFile = new File(templatePath);
if (!templateFile.exists()) {
throw new Exception("Template not found: " + templatePath);
}

return new String(ServerFileUtils.readFile(templateFile), "UTF-8");
}

@Override
public String fillPlaceholdersInContent(String content, HashMap<String, Object> placeholders) throws Exception {
if (content == null || placeholders == null) {
return content;
}

String result = content;
for (Map.Entry<String, Object> entry : placeholders.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();

if (value != null) {
if (!key.startsWith("{{")) {
key = "{{" + key;
}
if (!key.endsWith("}}")) {
key = key + "}}";
}

result = result.replace(key, value.toString());
}
}

return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ public interface SystemManagementLocal {

public static final int TEMPLATE_TYPE_BODY=10;
public static final int TEMPLATE_TYPE_HEAD=20;
public static final int TEMPLATE_TYPE_EMAIL=30;

public String getServerVersion();
public void statusMail(String subject, String body);
Expand Down Expand Up @@ -736,9 +735,4 @@ public interface SystemManagementLocal {

DocumentNameTemplate getDefaultDocumentNameTemplate() throws Exception;

String getTemplateContent(int templateType, String folder, String templateName) throws Exception;

String fillPlaceholdersInContent(String content, HashMap<String, Object> placeholders) throws Exception;


}

0 comments on commit 113880c

Please sign in to comment.