dlf
This commit is contained in:
parent
459ed5fdbf
commit
3bcee5d0b8
@ -41,17 +41,31 @@ public class SureopsService {
|
|||||||
+ PRJ_NAME;
|
+ PRJ_NAME;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
String index = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + " <title>Welcome</title>\n" + "</head>\n"
|
// String index = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + " <title>Welcome</title>\n" + "</head>\n"
|
||||||
+ "<body>\n" + " <h1>Welcome to the Web App</h1>\n" + " <ul>\n"
|
// + "<body>\n" + " <h1>Welcome to the Web App</h1>\n" + " <ul>\n"
|
||||||
+ " <li><a href=\"home.html\">Home Page</a></li>\n" + " </ul>\n" + "</body>\n" + "</html>";
|
// + " <li><a href=\"home.html\">Home Page</a></li>\n" + " </ul>\n" + "</body>\n" + "</html>";
|
||||||
|
|
||||||
String filename = "index.html";
|
// String filename = "index.html";
|
||||||
fileHelper.createFile(folderPath, filename, index);
|
// fileHelper.createFile(folderPath, filename, index);
|
||||||
|
|
||||||
|
String startindex = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + " <title>Welcome</title>\n" + "</head>\n"
|
||||||
|
+ "<body>\n";
|
||||||
|
|
||||||
|
String endindex = "</body>\n" + "</html>";
|
||||||
|
|
||||||
for (Map.Entry<String, String> entry : pageHtmlMap.entrySet()) {
|
for (Map.Entry<String, String> entry : pageHtmlMap.entrySet()) {
|
||||||
|
|
||||||
String pageName = entry.getKey().trim().replaceAll("\\s+", "_") + ".html"; // remove spaces from name
|
String pageName = entry.getKey().trim().replaceAll("\\s+", "_") + ".html"; // remove spaces from name
|
||||||
String htmlContent = entry.getValue();
|
String htmlContent = entry.getValue();
|
||||||
|
|
||||||
|
if (pageName.equalsIgnoreCase("home.html")) {
|
||||||
|
|
||||||
|
pageName = "index.html";
|
||||||
|
|
||||||
|
htmlContent = startindex + " \n" + htmlContent + endindex;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
fileHelper.createFile(folderPath, pageName, htmlContent);
|
fileHelper.createFile(folderPath, pageName, htmlContent);
|
||||||
i++;
|
i++;
|
||||||
System.out.println(i + " file created ");
|
System.out.println(i + " file created ");
|
||||||
|
|||||||
@ -20,13 +20,13 @@ public interface Design_lbraryRepository extends JpaRepository<Design_lbrary, In
|
|||||||
@Query(value = "select * from design_lbrary where created_by=?1", nativeQuery = true)
|
@Query(value = "select * from design_lbrary where created_by=?1", nativeQuery = true)
|
||||||
Page<Design_lbrary> findAll(Pageable page, Long creayedBy);
|
Page<Design_lbrary> findAll(Pageable page, Long creayedBy);
|
||||||
|
|
||||||
@Query(value = "SELECT * from design_lbrary WHERE templatetype=:operation_type && uitype=:fieldtype limit 1", nativeQuery = true)
|
@Query(value = "SELECT * from design_lbrary WHERE active=:active && templatetype=:operation_type && uitype=:fieldtype limit 1", nativeQuery = true)
|
||||||
Design_lbrary getallByHeaderIdAndFieldType(@Param("operation_type") String operation_type,
|
Design_lbrary getallByHeaderIdAndFieldType(@Param("active") boolean active,
|
||||||
@Param("fieldtype") String fieldtype);
|
@Param("operation_type") String operation_type, @Param("fieldtype") String fieldtype);
|
||||||
|
|
||||||
@Query(value = "SELECT * FROM design_lbrary " + "WHERE templatetype = :operation_type "
|
@Query(value = "SELECT * FROM design_lbrary " + "WHERE active=:active && templatetype = :operation_type "
|
||||||
+ "AND LOWER(uitype) LIKE CONCAT(LOWER(:fieldtype), '%')", nativeQuery = true)
|
+ "AND LOWER(uitype) LIKE CONCAT(LOWER(:fieldtype), '%')", nativeQuery = true)
|
||||||
List<Design_lbrary> getallFlfLine(@Param("operation_type") String operationType,
|
List<Design_lbrary> getallFlfLine(@Param("active") boolean active, @Param("operation_type") String operationType,
|
||||||
@Param("fieldtype") String fieldtype);
|
@Param("fieldtype") String fieldtype);
|
||||||
|
|
||||||
@Query(value = "select * from design_lbrary WHERE id BETWEEN :startId AND :endId", nativeQuery = true)
|
@Query(value = "select * from design_lbrary WHERE id BETWEEN :startId AND :endId", nativeQuery = true)
|
||||||
|
|||||||
@ -127,7 +127,7 @@ public class Design_lbraryService {
|
|||||||
|
|
||||||
// GET LINE BY header id, operation type, field type
|
// GET LINE BY header id, operation type, field type
|
||||||
public Design_lbrary getflflinerandom(String operationType, String fieldType) {
|
public Design_lbrary getflflinerandom(String operationType, String fieldType) {
|
||||||
List<Design_lbrary> flf = designLibraryRepository.getallFlfLine(operationType.toLowerCase().trim(),
|
List<Design_lbrary> flf = designLibraryRepository.getallFlfLine(true, operationType.toLowerCase().trim(),
|
||||||
fieldType.toLowerCase().trim());
|
fieldType.toLowerCase().trim());
|
||||||
|
|
||||||
if (flf == null || flf.isEmpty()) {
|
if (flf == null || flf.isEmpty()) {
|
||||||
@ -141,8 +141,8 @@ public class Design_lbraryService {
|
|||||||
|
|
||||||
// GET LINE BY header id, operation type, field type
|
// GET LINE BY header id, operation type, field type
|
||||||
public Design_lbrary getLinestraight(String operationType, String fieldType) {
|
public Design_lbrary getLinestraight(String operationType, String fieldType) {
|
||||||
Design_lbrary flf = designLibraryRepository.getallByHeaderIdAndFieldType(operationType.toLowerCase().trim(),
|
Design_lbrary flf = designLibraryRepository.getallByHeaderIdAndFieldType(true,
|
||||||
fieldType.toLowerCase().trim());
|
operationType.toLowerCase().trim(), fieldType.toLowerCase().trim());
|
||||||
|
|
||||||
if (flf == null) {
|
if (flf == null) {
|
||||||
return null; // ya throw new RuntimeException("No data found");
|
return null; // ya throw new RuntimeException("No data found");
|
||||||
@ -153,7 +153,7 @@ public class Design_lbraryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Design_lbrary> listOfTemplate(String operationType, String fieldType) {
|
public List<Design_lbrary> listOfTemplate(String operationType, String fieldType) {
|
||||||
List<Design_lbrary> flf = designLibraryRepository.getallFlfLine(operationType.toLowerCase().trim(),
|
List<Design_lbrary> flf = designLibraryRepository.getallFlfLine(true, operationType.toLowerCase().trim(),
|
||||||
fieldType.toLowerCase().trim());
|
fieldType.toLowerCase().trim());
|
||||||
|
|
||||||
if (flf == null || flf.isEmpty()) {
|
if (flf == null || flf.isEmpty()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user