Skip to content

Commit 403e36e

Browse files
authored
Merge pull request #1685 from parallaxinc/1.2
Release 1.2 v1.2.458
2 parents 37e321e + d2b10e5 commit 403e36e

File tree

68 files changed

+4386
-1097
lines changed

Some content is hidden

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

68 files changed

+4386
-1097
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ nb*
1212
# /src/main/java/com/parallax/server/blocklyprop/db/generated/*
1313
#
1414

15+
*.sh
16+
17+
1518
#################
1619
## NetBeans
1720
#################
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
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-
*/
61
/**
72
* Author: Jim Ewald
83
* Created: Aug 27, 2018
94
*
105
* Add a field to the project table to store a JSON encoded group of project
116
* settings.
7+
*
8+
* Add a field to the user profile to store JSON encoded settings related to
9+
* specific user.
1210
*/
1311

1412
ALTER TABLE blocklyprop.project ADD settings TEXT NULL;
13+
ALTER TABLE cloudsession.user ADD settings TEXT NULL;
14+
1515

pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,5 +549,12 @@
549549
<version>4.12</version>
550550
<scope>test</scope>
551551
</dependency>
552-
</dependencies>
552+
553+
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
554+
<dependency>
555+
<groupId>org.jetbrains</groupId>
556+
<artifactId>annotations</artifactId>
557+
<version>17.0.0</version>
558+
</dependency>
559+
</dependencies>
553560
</project>

src/main/java/com/parallax/server/blocklyprop/SessionData.java

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
/*
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.
2+
* Copyright (c) 2019 Parallax Inc.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
5+
* and associated documentation files (the “Software”), to deal in the Software without
6+
* restriction, including without limitation the rights to use, copy, modify, merge, publish,
7+
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
8+
* Software is furnished to do so, subject to the following conditions:
9+
*
10+
* The above copyright notice and this permission notice shall be included in all copies or
11+
* substantial portions of the Software.
12+
*
13+
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
* SOFTWARE.
520
*/
21+
622
package com.parallax.server.blocklyprop;
723

824
import com.google.inject.servlet.SessionScoped;
@@ -13,15 +29,21 @@
1329
* User session details.
1430
*
1531
* This class contains the fields used to manage the client's session with
16-
* the application.
32+
* the application. The @SessionScoped decorator will enforce a single
33+
* instance per session.
1734
*
1835
* @author Michel
1936
*/
2037
@SessionScoped
2138
public class SessionData implements Serializable {
2239

40+
// A cloud session user profile object
2341
private User user;
42+
43+
// A cloud session user profile primary key ID
2444
private Long idUser;
45+
46+
// A locale string for this user
2547
private String locale;
2648

2749
/**
@@ -54,6 +76,11 @@ public void setLocale(String locale) {
5476
this.locale = locale;
5577
}
5678

79+
/**
80+
* Override the default toString method to enumerate all fields
81+
*
82+
* @return string representation of SessionData fields
83+
*/
5784
@Override
5885
public String toString() {
5986
return "SessionData{" + "user=" + user + ", idUser=" + idUser + ", locale=" + locale + '}';
Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
/*
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.
2+
* Copyright (c) 2019 Parallax Inc.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
5+
* and associated documentation files (the “Software”), to deal in the Software without
6+
* restriction, including without limitation the rights to use, copy, modify, merge, publish,
7+
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
8+
* Software is furnished to do so, subject to the following conditions:
9+
*
10+
* The above copyright notice and this permission notice shall be included in all copies or
11+
* substantial portions of the Software.
12+
*
13+
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
* SOFTWARE.
520
*/
21+
622
package com.parallax.server.blocklyprop;
723

824
/**
25+
* Enumberate possible sort orders for project listings
926
*
1027
* @author Michel
1128
*/
1229
public enum TableOrder {
13-
1430
asc,
1531
desc
16-
1732
}
Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
/*
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.
2+
* Copyright (c) 2019 Parallax Inc.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
5+
* and associated documentation files (the “Software”), to deal in the Software without
6+
* restriction, including without limitation the rights to use, copy, modify, merge, publish,
7+
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
8+
* Software is furnished to do so, subject to the following conditions:
9+
*
10+
* The above copyright notice and this permission notice shall be included in all copies or
11+
* substantial portions of the Software.
12+
*
13+
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
* SOFTWARE.
520
*/
21+
622
package com.parallax.server.blocklyprop;
723

824
import com.parallax.server.blocklyprop.db.generated.Tables;
925
import com.parallax.server.blocklyprop.db.generated.tables.records.ProjectRecord;
1026
import org.jooq.TableField;
1127

1228
/**
29+
* A list of the possible fields on which to sort project data
1330
*
1431
* @author Michel
1532
*/
@@ -21,14 +38,14 @@ public enum TableSort {
2138
user(Tables.PROJECT.ID_USER),
2239
modified(Tables.PROJECT.MODIFIED);
2340

41+
// Map this enum to a Field in the JooQ ProjectRecord class
2442
private final TableField<ProjectRecord, ?> field;
2543

26-
private TableSort(TableField<ProjectRecord, ?> field) {
44+
TableSort(TableField<ProjectRecord, ?> field) {
2745
this.field = field;
2846
}
2947

3048
public TableField<ProjectRecord, ?> getField() {
3149
return field;
3250
}
33-
3451
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@
2525
import com.parallax.server.blocklyprop.rest.RestMotd;
2626
import com.parallax.server.blocklyprop.rest.RestProfile;
2727
import com.parallax.server.blocklyprop.rest.RestProject;
28+
import com.parallax.server.blocklyprop.rest.RestV2Project;
2829
import com.parallax.server.blocklyprop.rest.RestSharedProject;
2930
import com.parallax.server.blocklyprop.rest.RestUser;
31+
3032
import com.sun.jersey.guice.JerseyServletModule;
3133
import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;
34+
3235
import javax.ws.rs.ext.MessageBodyReader;
3336
import javax.ws.rs.ext.MessageBodyWriter;
3437
import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
@@ -45,6 +48,8 @@ protected void configureServlets() {
4548
bind(RestCompile.class);
4649
bind(RestUser.class);
4750
bind(RestProject.class);
51+
bind(RestV2Project.class);
52+
4853
bind(RestSharedProject.class);
4954
bind(RestProfile.class);
5055
bind(RestMotd.class);

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
import com.parallax.server.blocklyprop.servlets.PrivacyPolicyServlet;
2828
import com.parallax.server.blocklyprop.servlets.ConfirmRequestServlet;
2929
import com.parallax.server.blocklyprop.servlets.ConfirmServlet;
30-
import com.parallax.server.blocklyprop.servlets.HelpSearchServlet;
31-
import com.parallax.server.blocklyprop.servlets.HelpServlet;
3230
import com.parallax.server.blocklyprop.servlets.NewOAuthUserServlet;
3331
import com.parallax.server.blocklyprop.servlets.OAuthGoogleServlet;
3432
import com.parallax.server.blocklyprop.servlets.PasswordResetRequestServlet;
@@ -130,9 +128,6 @@ protected void configureServlets() {
130128
serve("/public/clientinstructions").with(TextileClientInstructionsServlet.class);
131129
serve("/public/changelog").with(TextileChangeLogServlet.class);
132130

133-
// Help
134-
serve("/public/help").with(HelpServlet.class);
135-
serve("/public/helpsearch").with(HelpSearchServlet.class);
136131

137132
// OAuth
138133
serve("/oauth/newuser").with(NewOAuthUserServlet.class);

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

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018 Parallax Inc.
2+
* Copyright (c) 2019 Parallax Inc.
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
55
* and associated documentation files (the “Software”), to deal in the Software without
@@ -26,12 +26,12 @@
2626
import com.google.inject.Injector;
2727
import com.google.inject.servlet.GuiceServletContextListener;
2828

29-
import com.parallax.server.blocklyprop.SessionData;
3029
import com.parallax.server.blocklyprop.jsp.Properties;
3130
import com.parallax.server.blocklyprop.monitoring.Monitor;
32-
import com.parallax.server.blocklyprop.utils.HelpFileInitializer;
31+
3332
import java.sql.Driver;
3433
import java.sql.DriverManager;
34+
import java.sql.SQLException;
3535
import java.util.Enumeration;
3636
import javax.servlet.ServletContextEvent;
3737
import org.apache.commons.configuration.Configuration;
@@ -40,8 +40,6 @@
4040
import org.slf4j.Logger;
4141
import org.slf4j.LoggerFactory;
4242

43-
// import java.sql.SQLException;
44-
// import ch.qos.logback.classic.LoggerContext;
4543

4644

4745
/**
@@ -50,16 +48,18 @@
5048
*/
5149
public class SetupConfig extends GuiceServletContextListener {
5250

53-
/**
54-
* Application-specific configuration options
55-
*/
51+
// Application logging connector
52+
private final Logger LOG = LoggerFactory.getLogger(SetupConfig.class);
53+
54+
// Application-specific configuration options
5655
private Configuration configuration;
57-
56+
57+
5858
/**
59-
* Application logging connector
59+
* Create a Guice injector object
60+
*
61+
* @return a Guice injector object
6062
*/
61-
private final Logger LOG = LoggerFactory.getLogger(SetupConfig.class);
62-
6363
@Override
6464
protected Injector getInjector() {
6565
readConfiguration();
@@ -68,12 +68,12 @@ protected Injector getInjector() {
6868

6969
@Override
7070
protected void configure() {
71+
72+
LOG.info("Binding Configuration class");
7173
bind(Configuration.class).toInstance(configuration);
7274

73-
bind(SessionData.class);
7475
bind(Properties.class).asEagerSingleton();
7576

76-
bind(HelpFileInitializer.class).asEagerSingleton();
7777
bind(Monitor.class).asEagerSingleton();
7878

7979
// Configure the backend data store
@@ -85,7 +85,6 @@ protected void configure() {
8585
install(new ServletsModule());
8686
install(new RestModule());
8787
}
88-
8988
});
9089
}
9190

@@ -123,26 +122,16 @@ public void contextDestroyed(ServletContextEvent servletContextEvent) {
123122
// This manually deregisters JDBC driver, which prevents Tomcat 7 from
124123
// complaining about memory leaks into this class
125124

126-
/*
127125
while (drivers.hasMoreElements()) {
128126
Driver driver = drivers.nextElement();
129127
try {
130128
DriverManager.deregisterDriver(driver);
131-
LOG.info("deregistering jdbc driver: {}",driver);
129+
LOG.info("Deregister the jdbc driver: {}",driver);
132130
} catch (SQLException sqlE) {
133-
LOG.error("Error deregistering driver %s", driver);
131+
LOG.error("Unable to deregister the jdbc driver {}", driver.toString());
134132
LOG.error("{}", sqlE.getSQLState());
135133
}
136-
137-
}
138-
139-
// Shut down the loggers. Assume SLF4J is bound to logback-classic
140-
// in the current environment
141-
LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
142-
if (loggerContext != null) {
143-
loggerContext.stop();
144134
}
145-
*/
146135
}
147136

148137
}

0 commit comments

Comments
 (0)