Skip to content

Commit 088d17e

Browse files
committed
- Initial commit
1 parent 5190d8c commit 088d17e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1566
-0
lines changed

Diff for: .gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
target/
2+
!.mvn/wrapper/maven-wrapper.jar
3+
4+
### STS ###
5+
.apt_generated
6+
.classpath
7+
.factorypath
8+
.project
9+
.settings
10+
.springBeans
11+
12+
### IntelliJ IDEA ###
13+
.idea
14+
*.iws
15+
*.iml
16+
*.ipr
17+
18+
### NetBeans ###
19+
nbproject/private/
20+
build/
21+
nbbuild/
22+
dist/
23+
nbdist/
24+
.nb-gradle/
25+
26+
target/

Diff for: pom.xml

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
<?xml version="1.0"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
5+
<modelVersion>4.0.0</modelVersion>
6+
<groupId>br.org.soujava</groupId>
7+
<artifactId>soujava-rio-cms</artifactId>
8+
<name>CMS do SouJava Site</name>
9+
<description>Sistema de Gerenciamento de Conteúdo do site SouJava{RIO}, utilizando solução desktop híbrida.</description>
10+
<version>0.0.1</version>
11+
12+
<organization>
13+
<name>SouJava - Sociedade de Usuários de Java</name>
14+
<url>http://soujava.org.br</url>
15+
</organization>
16+
<build>
17+
<plugins>
18+
<plugin>
19+
<artifactId>maven-compiler-plugin</artifactId>
20+
<version>3.5.1</version>
21+
<configuration>
22+
<source>1.8</source>
23+
<target>1.8</target>
24+
</configuration>
25+
</plugin>
26+
<plugin>
27+
<groupId>com.zenjava</groupId>
28+
<artifactId>javafx-maven-plugin</artifactId>
29+
<version>8.8.3</version>
30+
<configuration>
31+
<vendor>SouJava</vendor>
32+
<!-- executable JAR file is built by default (not optional at this stage) -->
33+
<mainClass>br.org.soujava.CmsApplication</mainClass>
34+
<needShortcut>true</needShortcut>
35+
<needMenu>true</needMenu>
36+
<allPermissions>true</allPermissions>
37+
<title>CMS - SouJava Site{RIO}</title>
38+
<!-- optionally build webstart bundle -->
39+
<webstart>
40+
<requiresAllPermissions>true</requiresAllPermissions>
41+
</webstart>
42+
43+
<!-- optionally build native installers -->
44+
<!-- <nativeInstallers /> -->
45+
<!-- <certDomain>soujava-rio.github.io</certDomain> <certOrgUnit>SouJava</certOrgUnit>
46+
<certOrg>SouJava - Rio</certOrg> <certState>Rio de Janeiro</certState> <certCountry>BR</certCountry>
47+
<keyStoreAlias>cms-soujava-site</keyStoreAlias> <keyStorePassword>S0uJ@v@</keyStorePassword>
48+
<keyPassword>S0uJ@v@R10</keyPassword> <keyStoreType>jks</keyStoreType> <overwriteKeyStore>false</overwriteKeyStore> -->
49+
<keyStoreAlias>cms-soujava-site</keyStoreAlias>
50+
<keyStorePassword>S0uJ@v@</keyStorePassword>
51+
<keyPassword>S0uJ@v@R10</keyPassword>
52+
</configuration>
53+
<executions>
54+
55+
<!-- <execution> <id>create-keystore</id> <phase>package</phase> <goals>
56+
<goal>build-keystore</goal> </goals> </execution> -->
57+
<execution>
58+
<id>create-jfxjar</id>
59+
<phase>package</phase>
60+
<goals>
61+
<goal>build-jar</goal>
62+
</goals>
63+
</execution>
64+
<execution>
65+
<id>create-web</id>
66+
<phase>package</phase>
67+
<goals>
68+
<goal>build-web</goal>
69+
</goals>
70+
</execution>
71+
</executions>
72+
</plugin>
73+
74+
</plugins>
75+
</build>
76+
<dependencies>
77+
78+
<dependency>
79+
<groupId>io.undertow</groupId>
80+
<artifactId>undertow-core</artifactId>
81+
<version>1.4.20.Final</version>
82+
</dependency>
83+
<dependency>
84+
<groupId>io.undertow</groupId>
85+
<artifactId>undertow-servlet</artifactId>
86+
<version>1.4.20.Final</version>
87+
</dependency>
88+
<dependency>
89+
<groupId>org.glassfish.jersey.core</groupId>
90+
<artifactId>jersey-server</artifactId>
91+
<version>2.26</version>
92+
</dependency>
93+
<dependency>
94+
<groupId>org.glassfish.jersey.ext.cdi</groupId>
95+
<artifactId>jersey-cdi1x</artifactId>
96+
<version>2.26</version>
97+
</dependency>
98+
<dependency>
99+
<groupId>org.glassfish.jersey.media</groupId>
100+
<artifactId>jersey-media-json-jackson</artifactId>
101+
<version>2.26</version>
102+
</dependency>
103+
<dependency>
104+
<groupId>org.glassfish.jersey.containers</groupId>
105+
<artifactId>jersey-container-servlet-core</artifactId>
106+
<version>2.26</version>
107+
</dependency>
108+
<dependency>
109+
<groupId>org.glassfish.jersey.ext</groupId>
110+
<artifactId>jersey-bean-validation</artifactId>
111+
<version>2.26</version>
112+
</dependency>
113+
<dependency>
114+
<groupId>com.fasterxml.jackson.core</groupId>
115+
<artifactId>jackson-core</artifactId>
116+
<version>2.6.1</version>
117+
</dependency>
118+
<dependency>
119+
<groupId>com.fasterxml.jackson.core</groupId>
120+
<artifactId>jackson-annotations</artifactId>
121+
<version>2.6.1</version>
122+
</dependency>
123+
<dependency>
124+
<groupId>com.fasterxml.jackson.core</groupId>
125+
<artifactId>jackson-databind</artifactId>
126+
<version>2.6.1</version>
127+
</dependency>
128+
<dependency>
129+
<groupId>org.jboss.weld</groupId>
130+
<artifactId>weld-core</artifactId>
131+
<version>2.2.14.Final</version>
132+
</dependency>
133+
<dependency>
134+
<groupId>org.jboss.weld.servlet</groupId>
135+
<artifactId>weld-servlet-core</artifactId>
136+
<version>2.2.14.Final</version>
137+
</dependency>
138+
<dependency>
139+
<groupId>org.projectlombok</groupId>
140+
<artifactId>lombok</artifactId>
141+
<version>1.16.16</version>
142+
<scope>provided</scope>
143+
</dependency>
144+
</dependencies>
145+
<scm>
146+
<url>https://github.com/SouJava-Rio/soujava-rio-cms.git</url>
147+
</scm>
148+
</project>

Diff for: src/main/deploy/icon.png

911 Bytes
Loading

Diff for: src/main/deploy/keystore.jks

2.21 KB
Binary file not shown.

Diff for: src/main/deploy/splash.png

911 Bytes
Loading

Diff for: src/main/java/br/org/soujava/CmsApplication.java

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
package br.org.soujava;
2+
3+
4+
import static io.undertow.servlet.Servlets.listener;
5+
import static io.undertow.servlet.Servlets.servlet;
6+
7+
import javax.servlet.ServletException;
8+
9+
import org.glassfish.jersey.servlet.ServletContainer;
10+
import org.jboss.weld.environment.servlet.Listener;
11+
12+
import br.org.soujava.integration.jersey.JerseyApp;
13+
import io.undertow.Handlers;
14+
import io.undertow.Undertow;
15+
import io.undertow.server.handlers.PathHandler;
16+
import io.undertow.servlet.Servlets;
17+
import io.undertow.servlet.api.DeploymentInfo;
18+
import io.undertow.servlet.api.DeploymentManager;
19+
import javafx.application.Application;
20+
import javafx.beans.value.ChangeListener;
21+
import javafx.beans.value.ObservableValue;
22+
import javafx.concurrent.Worker.State;
23+
import javafx.geometry.HPos;
24+
import javafx.geometry.Rectangle2D;
25+
import javafx.geometry.VPos;
26+
import javafx.scene.Scene;
27+
import javafx.scene.layout.Region;
28+
import javafx.scene.web.WebEngine;
29+
import javafx.scene.web.WebView;
30+
import javafx.stage.Screen;
31+
import javafx.stage.Stage;
32+
/**
33+
* Classe Principal do CMS
34+
*
35+
* @author arruda
36+
*
37+
*/
38+
public class CmsApplication extends Application {
39+
40+
private static Undertow server;
41+
42+
public static void main(String[] args) throws Exception {
43+
launch(args);
44+
}
45+
46+
public void start(Stage stage) throws Exception {
47+
Screen screen = Screen.getPrimary();
48+
Rectangle2D bounds = screen.getVisualBounds();
49+
50+
stage.setX(bounds.getMinX());
51+
stage.setY(bounds.getMinY());
52+
stage.setWidth(bounds.getWidth());
53+
stage.setHeight(bounds.getHeight());
54+
55+
Scene scene = new Scene(new Browser(stage));
56+
57+
stage.setTitle("CMS - SouJava Site");
58+
stage.setScene(scene);
59+
stage.show();
60+
}
61+
62+
63+
public static void stopContainer(){
64+
server.stop();
65+
}
66+
67+
public static void startContainer(int port) throws ServletException {
68+
DeploymentInfo servletBuilder = Servlets.deployment();
69+
70+
servletBuilder
71+
.setClassLoader(Application.class.getClassLoader())
72+
.setContextPath("/")
73+
.setDeploymentName("cms-soujava-site.war")
74+
.addListeners(listener(Listener.class))
75+
.addServlets(servlet("jerseyServlet", ServletContainer.class)
76+
.setLoadOnStartup(1)
77+
.addInitParam("javax.ws.rs.Application", JerseyApp.class.getName())
78+
.addMapping("/api/*"));
79+
80+
DeploymentManager manager = Servlets.defaultContainer().addDeployment(servletBuilder);
81+
manager.deploy();
82+
PathHandler path = Handlers.path(Handlers.redirect("/"))
83+
.addPrefixPath("/", manager.start());
84+
85+
server =
86+
Undertow
87+
.builder()
88+
.addHttpListener(port, "localhost")
89+
.setHandler(path)
90+
.build();
91+
92+
server.start();
93+
}
94+
}
95+
96+
class Browser extends Region {
97+
final WebView browser = new WebView();
98+
final WebEngine webEngine = browser.getEngine();
99+
final Stage stage;
100+
101+
public Browser(Stage stage) {
102+
103+
this.stage = stage;
104+
105+
// load the web page
106+
webEngine.load(Browser.class.getResource("/WEB-VIEW/index.html").toExternalForm());
107+
108+
// Update the stage title when a new web page title is available
109+
110+
webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<State>() {
111+
112+
public void changed(ObservableValue<? extends State> ov, State oldState, State newState){
113+
114+
if (newState == State.SUCCEEDED){
115+
116+
// stage.setTitle(webEngine.getLocation());
117+
118+
stage.setTitle(webEngine.getTitle());
119+
}
120+
}
121+
});
122+
123+
// add the web view to the scene
124+
getChildren().add(browser);
125+
126+
}
127+
128+
@Override
129+
protected void layoutChildren() {
130+
double w = getWidth();
131+
double h = getHeight();
132+
layoutInArea(browser, 0, 0, w, h, 0, HPos.CENTER, VPos.CENTER);
133+
}
134+
135+
@Override
136+
protected double computePrefWidth(double height) {
137+
return 900;
138+
}
139+
140+
@Override
141+
protected double computePrefHeight(double width) {
142+
return 600;
143+
}
144+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package br.org.soujava.api.producers;
2+
3+
import java.io.IOException;
4+
import java.util.HashMap;
5+
import java.util.Map;
6+
import java.util.ResourceBundle;
7+
8+
import javax.enterprise.context.ApplicationScoped;
9+
import javax.enterprise.inject.Produces;
10+
import javax.enterprise.inject.spi.InjectionPoint;
11+
12+
import org.glassfish.jersey.internal.util.Property;
13+
14+
import com.fasterxml.jackson.databind.ObjectMapper;
15+
16+
import br.org.soujava.integration.jersey.ObjectMapperFactory;
17+
18+
/**
19+
* @author Gabriel Francisco - [email protected]
20+
*/
21+
public class ApplicationProducer {
22+
23+
@Produces
24+
public ObjectMapper objectMapper() {
25+
return ObjectMapperFactory.get();
26+
}
27+
28+
29+
// @Produces
30+
// @Property(value = "")
31+
// public String property(@InjectableProperties Map<String, String> properties, InjectionPoint injectionPoint){
32+
// final Property property = injectionPoint.getAnnotated().getAnnotation(Property.class);
33+
// return properties.get(property.value());
34+
// }
35+
//
36+
// @ApplicationScoped
37+
// @Produces
38+
// @InjectableProperties
39+
// public Map<String, String> properties() throws IOException {
40+
// Map<String, String> map = new HashMap<>();
41+
// final ResourceBundle bundle = ResourceBundle.getBundle("application");
42+
// bundle.keySet().forEach(key -> map.put(key, bundle.getString(key)));
43+
// return map;
44+
// }
45+
}

Diff for: src/main/java/br/org/soujava/domain/Slide.java

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package br.org.soujava.domain;
2+
3+
import lombok.Builder;
4+
import lombok.Data;
5+
6+
/**
7+
* Slide of the Website SouJava
8+
*
9+
* @author Fernando Arruda - [email protected]
10+
*
11+
*/
12+
@Data
13+
@Builder
14+
public class Slide {
15+
16+
private String id;
17+
private String title;
18+
private String description;
19+
private boolean disabled;
20+
private int order;
21+
22+
}

0 commit comments

Comments
 (0)