Skip to content

Commit

Permalink
Cleanup comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rajkowski committed Jul 2, 2024
1 parent 6502b8b commit cdc6a1b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,12 @@ public static boolean execute(Properties templateEngineProperties) throws Except
LOG.info("Images: " + imageList.size());
for (Image image : imageList) {
// For example: assets/img/20200310012940-74/example-hero-fade.jpg
// @todo refactor for file.separator
File sourceImage = new File(fileLibraryPath, image.getFileServerPath());
if (!sourceImage.exists()) {
LOG.warn("File not found: " + sourceImage);
continue;
}
// @todo refactor for file.separator
File targetImage = new File(sitePath,
"/assets/img/" + image.getWebPath() + "-" + image.getId() + "/" + image.getFilename());
File targetImage = new File(sitePath, "/assets/img/" + image.getWebPath() + "-" + image.getId() + "/" + image.getFilename());
if (!targetImage.exists()) {
FileUtils.copyFile(sourceImage, targetImage);
}
Expand Down Expand Up @@ -292,10 +289,11 @@ public static boolean exportMetadata(WebPage webPage, File webPagesPath, File we
return true;
}

/** Render the web page, save its HTML file and optional stylesheet file */
public static int exportWebPage(WebPage webPage, File sitePath, File webAppPath) throws Exception {

// Render the page and widgets
LOG.info("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
LOG.debug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
String htmlPage = PageTemplateEngine.render(webPage, webAppPath);
if (htmlPage == null) {
LOG.warn("No content found for " + webPage.getLink());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*/
public class WebPageMetadataCommand {

/** Describes the webpage */
public static String getJSON(WebPage webPage, Stylesheet stylesheet, String webFileRoot, int contentLength) {
// Output the web page meta-data json
String webPageTitle = StringUtils.defaultString(webPage.getTitle());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class PageRequest implements Serializable {
private Map<String, ArrayList<String>> headers = Collections.synchronizedMap(new CaseInsensitiveMap<String, ArrayList<String>>());
private Map<String, String[]> parameterMap = null;
private Map<String, Object> attributeMap = new ConcurrentHashMap<>();
// private HttpServletRequest request = null;

public PageRequest(HttpServletRequest request) {
this.method = request.getMethod();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ public static String render(WebPage webPage, File webAppPath) {
UserSession userSession = new UserSession();
userSession.login(user);

// PageRequest pageRequest = new PageRequest(pageRenderInfo);

// Generate a static web page
Page pageRef = WebPageXmlLayoutCommand.retrievePageForRequest(webPage, webPage.getLink());
if (pageRef == null) {
Expand Down Expand Up @@ -295,9 +293,9 @@ public static String render(WebPage webPage, File webAppPath) {
// Load the properties
Map<String, String> systemPropertyMap = LoadSitePropertyCommand.loadAsMap("system");
Map<String, String> sitePropertyMap = LoadSitePropertyCommand.loadAsMap("site");
// sitePropertyMap.put("site.login", "false");
// sitePropertyMap.put("site.cart", "false");
// sitePropertyMap.put("site.registrations", "false");
sitePropertyMap.put("site.login", "false");
sitePropertyMap.put("site.cart", "false");
sitePropertyMap.put("site.registrations", "false");
Map<String, String> themePropertyMap = LoadSitePropertyCommand.loadAsMap("theme");
Map<String, String> socialPropertyMap = LoadSitePropertyCommand.loadAsMap("social");
Map<String, String> analyticsPropertyMap = LoadSitePropertyCommand.loadAsMap("analytics");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<!--/* CMS Platform Template, 2024 */-->
<!-- @todo validate page, finish data attributes -->
<!--/* @todo validate page, finish data attributes */-->
<h4 th:if="${not #strings.isEmpty(title)}">
<i th:if="${not #strings.isEmpty(icon)}" class="fa" th:classappend="${icon}"></i>
[[${title}]]
</h4>
<div class="platform-content-container">
<div class="orbit" th:classappend="${carouselClass}" role="region" data-orbit th:attr="aria-label=${carouselTitle}">

[[${dataOptions}]]

<!--/* [[${dataOptions}]] */-->
<div class="orbit-wrapper">
<div th:if="${#strings.equals(showControls, 'true') and #arrays.length(cardList) gt 1}" class="orbit-controls">
<button th:if="${#strings.equals(showLeftControl, 'true')}" class="orbit-previous"><span class="show-for-sr">Previous Slide</span>&#9664;&#xFE0E;</button>
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/html-templates/cms/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="platform-menu-container" style="position: relative;">
<span th:if="${not #strings.isEmpty(title)}" class="menu-title padding-left-15" th:text="${title}">Title</span>
<ul th:id="${menuId}" class="dropdown menu" th:classappend="${menuClass}" data-dropdown-menu>
<!-- <ul class="menu vertical"> --> <!-- when a new link['container'] -->
<!--/* <ul class="menu vertical"> --> <!-- when a new link['container'] */-->
<li th:each="link, status : ${linkList}" th:class="${link['active']} ? 'active'">
<a th:if="${#strings.equals(link['type'], 'cart')}" id="menu-item-cart" th:href="${#strings.concat(ctx, '/cart')}" title="Your Shopping Cart is Empty"><i class="fa-solid fa-bag-shopping"></i></a>
<hr th:if="${#strings.equals(link['divider'], 'true')}" style="margin: .01rem auto;" />
Expand All @@ -12,6 +12,6 @@
<i th:if="${not #strings.isEmpty(link['icon'])}" class="fa-solid" th:classappend="${link['icon']}"></i> [[${link['name']}]]
</a>
</li>
<!-- </ul> -->
<!--/* </ul> */-->
</ul>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@

package com.simisinc.platform.presentation.controller;

import com.simisinc.platform.domain.model.User;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import javax.servlet.http.HttpServletRequest;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import com.simisinc.platform.domain.model.User;

/**
* @author matt rajkowski
Expand Down

0 comments on commit cdc6a1b

Please sign in to comment.