Skip to content

Commit a89fb03

Browse files
authored
Merge pull request #1441 from parallaxinc/0.100
Release 0.100
2 parents f8077c5 + 7b25ad3 commit a89fb03

File tree

148 files changed

+6166
-24178
lines changed

Some content is hidden

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

148 files changed

+6166
-24178
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ build.properties
55
#################
66
# /src/main/**/logback.xml
77
nb*
8+
#
9+
# The JooQ package generates all of the classes referenced
10+
# by the BlocklyProp code to access database services.
11+
#
12+
# /src/main/java/com/parallax/server/blocklyprop/db/generated/*
13+
#
814

915
#################
1016
## NetBeans
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
22
* Add a description field to the project that supports HTML
33
*/
4-
ALTER TABLE project
4+
ALTER TABLE blocklyprop.project
55
ADD description_html LONGTEXT NULL AFTER description;

db-updates/0009-motd.sql

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Create a message of the day table
3+
*/
4+
5+
CREATE TABLE IF NOT EXISTS blocklyprop.motd
6+
(
7+
id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT,
8+
message_text VARCHAR(2000) NOT NULL,
9+
message_html VARCHAR(2000),
10+
notes VARCHAR(4000),
11+
enabled BOOLEAN DEFAULT FALSE NOT NULL,
12+
is_deleted BOOLEAN DEFAULT FALSE NOT NULL,
13+
enable_datetime DATETIME,
14+
disable_datetime DATETIME,
15+
create_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
16+
last_change_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
17+
) COMMENT 'Customer-facing alerts'
18+
ENGINE=InnoDB
19+
AUTO_INCREMENT=0
20+
DEFAULT CHARSET=utf8;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
/**
7+
* Author: J. Ewald
8+
* Created: Mar 20, 2018
9+
*
10+
* Add an active field to the project link table. This will allow a user to
11+
* enable/disable their shared project without destroying the shared project
12+
* key.
13+
*/
14+
15+
ALTER TABLE blocklyprop.project_sharing ADD active BIT DEFAULT 0 NULL AFTER sharekey;
16+
17+
/*
18+
* All of the current rows in the project_sharing table are active. Set the
19+
* active flag for all records to match that state.
20+
*/
21+
UPDATE blocklyprop.project_sharing
22+
SET active = true;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
7+
/**
8+
* Author: J. Ewald
9+
* Created: May 21, 2018
10+
*
11+
* Add an field to record the version of the block library that the was last
12+
* used to validate the project code block.This will allow the app to bypass
13+
* the block scanning routines each time a project is loaded, once it has been
14+
* scanned against the current block version.
15+
*/
16+
17+
ALTER TABLE blocklyprop.project ADD code_block_version SMALLINT DEFAULT 0 NOT NULL AFTER code;

pom.xml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
<files>
6161
<file>build.properties</file>
6262
</files>
63+
<properties combine.self="append" />
64+
<outputFile combine.self="append" />
6365
</configuration>
6466
</plugin>
6567

@@ -95,15 +97,22 @@
9597
<groupId>org.jooq</groupId>
9698
<artifactId>jooq-codegen-maven</artifactId>
9799
<version>${jooq-version}</version>
100+
98101
<!--
99-
<executions>
100-
<execution>
101-
<goals>
102-
<goal>generate</goal>
103-
</goals>
104-
</execution>
105-
</executions>
102+
Include the <execution> element to generate a new set of
103+
source files that represent the current state of the
104+
target database schema.
105+
<executions>
106+
<execution>
107+
<id>jooq-codegen</id>
108+
<phase>generate-sources</phase>
109+
<goals>
110+
<goal>generate</goal>
111+
</goals>
112+
</execution>
113+
</executions>
106114
-->
115+
107116
<dependencies>
108117
<dependency>
109118
<groupId>mysql</groupId>
@@ -119,7 +128,7 @@
119128
<user>${mysql.username}</user>
120129
<password>${mysql.password}</password>
121130
</jdbc>
122-
131+
123132
<generator>
124133
<name>org.jooq.util.DefaultGenerator</name>
125134
<database>
@@ -309,6 +318,14 @@
309318
<artifactId>guice-persist-jooq</artifactId>
310319
<version>0.1.2</version>
311320
</dependency>
321+
322+
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
323+
<dependency>
324+
<groupId>joda-time</groupId>
325+
<artifactId>joda-time</artifactId>
326+
<version>2.9.9</version>
327+
</dependency>
328+
312329
<!-- END JOOQ Dependencies -->
313330

314331
<!-- Dependencies for Shiro -->

src/main/java/com/parallax/server/blocklyprop/config/DaoModule.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66
package com.parallax.server.blocklyprop.config;
77

88
import com.google.inject.AbstractModule;
9+
910
import com.parallax.server.blocklyprop.db.dao.ProjectDao;
1011
import com.parallax.server.blocklyprop.db.dao.ProjectSharingDao;
1112
import com.parallax.server.blocklyprop.db.dao.SessionDao;
1213
import com.parallax.server.blocklyprop.db.dao.UserDao;
14+
import com.parallax.server.blocklyprop.db.dao.MotdDao;
15+
1316
import com.parallax.server.blocklyprop.db.dao.impl.ProjectDaoImpl;
1417
import com.parallax.server.blocklyprop.db.dao.impl.ProjectSharingDaoImpl;
1518
import com.parallax.server.blocklyprop.db.dao.impl.SessionDaoImpl;
1619
import com.parallax.server.blocklyprop.db.dao.impl.UserDaoImpl;
20+
import com.parallax.server.blocklyprop.db.dao.impl.MotdDaoImpl;
1721

1822

1923
/**
@@ -44,6 +48,7 @@ protected void configure() {
4448
bind(UserDao.class).to(UserDaoImpl.class);
4549
bind(SessionDao.class).to(SessionDaoImpl.class);
4650
bind(ProjectSharingDao.class).to(ProjectSharingDaoImpl.class);
51+
bind(MotdDao.class).to(MotdDaoImpl.class);
4752
}
4853

4954
}

src/main/java/com/parallax/server/blocklyprop/config/ServletsModule.java

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package com.parallax.server.blocklyprop.config;
77

88
import com.google.inject.servlet.ServletModule;
9+
910
import com.parallax.server.blocklyprop.servlets.AuthenticationServlet;
1011
import com.parallax.server.blocklyprop.servlets.PrivacyPolicyServlet;
1112
import com.parallax.server.blocklyprop.servlets.ConfirmRequestServlet;
@@ -32,6 +33,8 @@
3233
import com.parallax.server.blocklyprop.servlets.TextileLibrariesServlet;
3334
import com.parallax.server.blocklyprop.servlets.TextileLicenseServlet;
3435

36+
import com.parallax.server.blocklyprop.servlets.MessageOfTheDayServlet;
37+
3538
/**
3639
* Map each URI to a class that will handle the request
3740
*
@@ -41,29 +44,68 @@ public class ServletsModule extends ServletModule {
4144

4245
@Override
4346
protected void configureServlets() {
47+
// Verify the app is alive
4448
serve("/ping").with(PingServlet.class);
49+
50+
51+
// Return the active Message of the Day, if one is active
52+
// This is currently throwing a NPE
53+
serve("/motd").with(MessageOfTheDayServlet.class);
4554

55+
56+
// Authentication service
57+
// TODO: Verify that this is used somewhere.The IDE says that
58+
// there are no references to it in the app.
4659
serve("/authenticate").with(AuthenticationServlet.class);
4760

48-
serve("/project").with(ProjectServlet.class);
49-
61+
5062
// Register a new user account
5163
serve("/register").with(RegisterServlet.class);
5264

65+
66+
// User profile
5367
serve("/profile").with(ProfileServlet.class);
5468

69+
70+
// Confirm user account from email URL
5571
serve("/confirmrequest").with(ConfirmRequestServlet.class);
72+
73+
74+
// Confirm account registration request. Not sure how this is different
75+
// than the confirmrequest uri.
76+
// ---------------------------------------------------------------------
5677
serve("/confirm").with(ConfirmServlet.class);
57-
78+
79+
80+
// Reset password request via email
5881
serve("/resetrequest").with(PasswordResetRequestServlet.class);
82+
83+
84+
// Reset user account password via the UI
85+
// ---------------------------------------------------------------------
5986
serve("/reset").with(PasswordResetServlet.class);
6087

88+
89+
// Manage project details
90+
serve("/project").with(ProjectServlet.class);
91+
92+
93+
//Create a new project record
6194
serve("/createproject").with(ProjectCreationServlet.class);
95+
96+
97+
// Maintain a publicly accessible URI for any specific projet
6298
serve("/projectlink").with(ProjectLinkServlet.class);
99+
100+
101+
// Load a project into the canvas
63102
serve("/projecteditor").with(ProjectEditorServlet.class);
64103

104+
105+
// Get public attributes of a user's profile
65106
serve("/public/profile").with(PublicProfileServlet.class);
66107

108+
67109
// Textile pages
68110
serve("/index", "/").with(TextileIndexServlet.class);
69111
serve("/public/license").with(TextileLicenseServlet.class);

src/main/java/com/parallax/server/blocklyprop/config/SetupConfig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.google.inject.Guice;
1010
import com.google.inject.Injector;
1111
import com.google.inject.servlet.GuiceServletContextListener;
12+
1213
import com.parallax.server.blocklyprop.SessionData;
1314
import com.parallax.server.blocklyprop.jsp.Properties;
1415
import com.parallax.server.blocklyprop.monitoring.Monitor;
@@ -32,8 +33,14 @@
3233
*/
3334
public class SetupConfig extends GuiceServletContextListener {
3435

36+
/**
37+
* Application-specific configuration options
38+
*/
3539
private Configuration configuration;
3640

41+
/**
42+
* Application logging connector
43+
*/
3744
private final Logger LOG = LoggerFactory.getLogger(SetupConfig.class);
3845

3946
@Override

0 commit comments

Comments
 (0)