jsf initial

merge-requests/119/head
Anton Romanov 5 years ago
parent a17dac55e2
commit 2cdec4bcda

@ -117,11 +117,12 @@ dependencies {
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7'
compile group: 'org.webjars', name: 'bootstrap', version: '4.1.0'
compile group: 'org.webjars', name: 'bootstrap-select', version: '1.13.3'
compile group: 'org.webjars', name: 'jquery', version: '3.3.1-1'
compile group: 'org.webjars.npm', name: 'jquery.easing', version: '1.4.1'
compile group: 'org.webjars', name: 'font-awesome', version: '4.7.0'
//primefaces
compile group: 'org.primefaces', name: 'primefaces', version: '7.0'
compile group: 'net.bootsfaces', name: 'bootsfaces', version: '1.4.2'
compile group: 'org.joinfaces', name: 'jsf-spring-boot-starter', version: '4.0.8'
compile group: 'org.javassist', name: 'javassist', version: '3.25.0-GA'
compile group: 'org.primefaces.themes', name: 'all-themes', version: '1.0.10'
compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.6.0'
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.6.0'
@ -132,4 +133,4 @@ dependencies {
testCompile group: 'org.seleniumhq.selenium', name: 'selenium-support', version: '3.3.1'
//testCompile group: 'com.google.guava', name: 'guava', version: '21.0'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
}
}

@ -1,7 +1,6 @@
package ru.ulstu.configuration;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@ -9,20 +8,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
public class MvcConfiguration implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/{articlename:\\w+}");
registry.addViewController("/admin/{articlename:\\w+}");
registry.addViewController("/papers/{articlename:\\w+}");
registry.addViewController("/grants/{articlename:\\w+}");
registry.addViewController("/conferences/{articlename:\\w+}");
registry.addViewController("/students/{articlename:\\w+}");
registry.addRedirectViewController("/", "/index");
registry.addRedirectViewController("/default", "/index");
}
registry.addRedirectViewController("/", "/index.xhtml");
registry.addRedirectViewController("/default", "/index.xhtml");
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry
.addResourceHandler("/webjars/**")
.addResourceLocations("/webjars/");
}
}

@ -0,0 +1,27 @@
package ru.ulstu.index.controller;
import ru.ulstu.index.model.Section;
import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Named;
import java.util.ArrayList;
import java.util.List;
@Named
@ViewScoped
public class IndexView {
private List<Section> sections = new ArrayList<>();
@PostConstruct
public void init() {
sections.add(new Section("Статьи", "papers.jpg"));
sections.add(new Section("Гранты", "grants.jpg"));
sections.add(new Section("Проекты", "projects.jpg"));
sections.add(new Section("Проекты", "projects.jpg"));
}
public List<Section> getSections() {
return sections;
}
}

@ -0,0 +1,27 @@
package ru.ulstu.index.model;
public class Section {
private String title;
private String image;
public Section(String title, String image) {
this.title = title;
this.image = image;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
}

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<h:head>
<title>Fuzzy logic</title>
<h:outputStylesheet name="css/style.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
</h:head>
<h:body>
<div class="ui-g">
<div class="ui-g-2"></div>
<div class="ui-g-8">
<div class="ui-fluid">
<ui:insert name="content">Content</ui:insert>
</div>
</div>
</div>
</h:body>
</html>

@ -0,0 +1,7 @@
.ui-picklist-list-wrapper {
width: 50% !important;
}
.ui-picklist-list {
width: 100% !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 KiB

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<ui:composition template="/basicTemplate.xhtml">
<ui:define name="content">
<p:dataGrid id="sections" var="section" value="#{indexView.sections}" columns="3" layout="grid"
style="text-align:center">
<p:panel id="pnl" header="#{section.title}" style="text-align:center;">
<h:panelGrid columns="1" style="width:100%;">
<p:graphicImage style="width:100%" name="img/main/#{section.image}"/>
</h:panelGrid>
</p:panel>
</p:dataGrid>
</ui:define>
</ui:composition>
</html>

@ -14,6 +14,9 @@ server.ssl.key-password=password
logging.level.ru.ulstu=DEBUG
#HtmlUnit
logging.level.com.gargoylesoftware.htmlunit=ERROR
#jsf
joinfaces.primefaces.theme=bootstrap
joinfaces.primefaces.font-awesome=true
# Mail Settings
spring.mail.host=smtp.yandex.ru
spring.mail.port=465

Loading…
Cancel
Save