Skip to content

Commit 7feebe7

Browse files
authored
Merge pull request #414 from devgateway/develop
Develop into master
2 parents 74568f3 + 293178a commit 7feebe7

233 files changed

Lines changed: 8698 additions & 2499 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,25 @@ DG-toolkit is a package of several modules, among which forms and web are runnab
8787

8888
We are closely following the spring boot executable/fat jar documentation which provides an extremely nice way to run a jar as a linux system service. This works for both the old System V and the new systemd. You can find [the full Spring documentation here] (http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#deployment-service).
8989

90+
91+
## Start a new project with DG-Toolkit as the base
92+
93+
DG-Toolkit should be used as a template project, so as starting point for other projects. This should be done by forking the repository. Unfortunately Github denies forking of repositories inside the same organization, so @devgateway can own only one DG-Toolkit fork (the current one). A chat with Github support has not solved the problem, they used to have this functionality but have opted to disable it. Therefore one cannot use the FORK button on Github, but since Git is the back-end of Github, this does not mean you cannot fork it using git on your machine.
94+
95+
To fork DG-Toolkit you can simply create a new independent github repository, and after creation add a new remote on your machine. So you will have /origin/ that points to the new repo, and say dg-toolkit remote that points to the DG-Toolkit repo url. After this you should be able to merge from dg-toolkit remote to the origin remote, that is, you can take DG-Toolkit code and merge it over your existing empty project, thus you will get the DG-Toolkit tree inside your local project. This is much better than just copy-pasting the contents of DG-Toolkit. If you use remotes, you can later merge new fixes and features from DG-Toolkit back into your project, thus you keep your project up to date with fixes coming from DG-Toolkit.
96+
97+
## Contributing code back to DG-Toolkit
98+
99+
There are several ways in which this can be achieved:
100+
101+
### Forking DG-Tookit for a feature/fix development
102+
103+
The best and easiest is to fork DG-Toolkit for the sole purpose of developing a new module/feature/fix. You can very well use your own private github user space to do this and thus you can use the FORK button on the Ghihub page. After the fork you can commit all your new stuff to your copy of DG-Tooolkit then ask for a Pull Request of your code back into DG-Toolkit.
104+
105+
### Develop the contributions in an already forked project
106+
107+
Yes, it would be cool if we could develop the new contribution as part of your current project, which was forked some time ago from DG-Toolkit. It is possible but it is a bit trickier. You will not be able to merge your project back to DG-Toolkit, because this will bring all your project's custom code into DG-Toolkit, so basically the customized implementation the client has asked for, like all the dashboards and forms that it asked. That is undesirable.
108+
109+
One simple solution to this is to commit the changes you are willing to merge back to DG-Toolkit as atomic changes. That means that when you commit your files, you commit only those files that are related to that new feature and nothing else. For example let's suppose you want to develop a new search module that will use Lucene for indexing and you will like to merge this new module to DG-Toolkit. You should commit all the code that has to do with the search module in separate commits that do not contain other code, for example if the search module is also used in a dashboard page in your project, you will commit that linking in a separate commit , so keep the commits that target the module functionality separate.
110+
111+
Then, you can cherry-pick your project's branch over the dg-tookit remote branch. By doing so, you can pick what commits to apply and what to leave out and you will choose only the commits that implement the generic new module functionality and you will leave out the client-specific customizations that are not meant to be posted to DG-Toolkit

forms/forms.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
JAVA_OPTS="-Dspring.profiles.active=default -Djava.awt.headless=true -Xmx4096M -Dwicket.configuration=deployment -Dderby.optimizer.optimizeJoinOrder=false -Dspringfox.documentation.swagger.v2.host=website.url"

forms/pom.xml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
<properties>
3030
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3131
<java.version>1.8</java.version>
32-
<wicket.version>7.6.0</wicket.version>
33-
<wicket.bootstrap.version>0.10.11</wicket.bootstrap.version>
34-
<zt.zip.version>1.10</zt.zip.version>
32+
<wicket.version>7.7.0</wicket.version>
33+
<wicket.bootstrap.version>0.10.14</wicket.bootstrap.version>
34+
<zt.zip.version>1.11</zt.zip.version>
3535
<wicket.webjars.version>0.5.5</wicket.webjars.version>
3636
<closure.compiler.version>v20160822</closure.compiler.version>
3737
</properties>
@@ -94,7 +94,7 @@
9494

9595
<dependency>
9696
<groupId>org.springframework.boot</groupId>
97-
<artifactId>spring-boot-starter-jetty</artifactId>
97+
<artifactId>spring-boot-starter-tomcat</artifactId>
9898
</dependency>
9999

100100
<dependency>
@@ -156,12 +156,6 @@
156156
<version>${wicket.version}</version>
157157
</dependency>
158158

159-
<dependency>
160-
<groupId>com.googlecode.wicket-jquery-ui</groupId>
161-
<artifactId>wicket-jquery-ui</artifactId>
162-
<version>${wicket.version}</version>
163-
</dependency>
164-
165159
<dependency>
166160
<groupId>org.zeroturnaround</groupId>
167161
<artifactId>zt-zip</artifactId>
@@ -257,6 +251,26 @@
257251
</resources>
258252

259253
<plugins>
254+
255+
<!-- tag::plugin[] -->
256+
<plugin>
257+
<groupId>com.spotify</groupId>
258+
<artifactId>docker-maven-plugin</artifactId>
259+
<version>${docker-maven-plugin.version}</version>
260+
<configuration>
261+
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
262+
<dockerDirectory>src/main/docker</dockerDirectory>
263+
<resources>
264+
<resource>
265+
<targetPath>/</targetPath>
266+
<directory>${project.build.directory}</directory>
267+
<include>${project.build.finalName}.jar</include>
268+
</resource>
269+
</resources>
270+
</configuration>
271+
</plugin>
272+
<!-- end::plugin[] -->
273+
260274
<plugin>
261275
<groupId>org.apache.maven.plugins</groupId>
262276
<artifactId>maven-resources-plugin</artifactId>

forms/src/main/docker/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM frolvlad/alpine-oraclejdk8:slim
2+
VOLUME /tmp
3+
ADD forms-0.0.1-SNAPSHOT.jar app.jar
4+
RUN sh -c 'touch /app.jar'
5+
ENV JAVA_OPTS=""
6+
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]

forms/src/main/java/org/devgateway/ocds/forms/wicket/page/edit/EditUserDashboardPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import org.devgateway.ocds.forms.wicket.providers.LabelPersistableJpaRepositoryTextChoiceProvider;
1919
import org.devgateway.ocds.persistence.dao.UserDashboard;
2020
import org.devgateway.ocds.persistence.repository.UserDashboardRepository;
21-
import org.devgateway.toolkit.forms.security.SecurityConstants;
21+
import org.devgateway.toolkit.web.security.SecurityConstants;
2222
import org.devgateway.toolkit.forms.wicket.components.form.Select2MultiChoiceBootstrapFormComponent;
2323
import org.devgateway.toolkit.forms.wicket.components.form.TextAreaFieldBootstrapFormComponent;
2424
import org.devgateway.toolkit.forms.wicket.components.form.TextFieldBootstrapFormComponent;

forms/src/main/java/org/devgateway/ocds/forms/wicket/page/list/ListAllDashboardsPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.devgateway.ocds.forms.wicket.page.edit.EditUserDashboardPage;
2525
import org.devgateway.ocds.persistence.dao.UserDashboard;
2626
import org.devgateway.ocds.persistence.repository.UserDashboardRepository;
27-
import org.devgateway.toolkit.forms.security.SecurityConstants;
27+
import org.devgateway.toolkit.web.security.SecurityConstants;
2828
import org.devgateway.toolkit.forms.wicket.page.lists.AbstractListPage;
2929
import org.wicketstuff.annotation.mount.MountPath;
3030

forms/src/main/java/org/devgateway/ocds/forms/wicket/page/list/ListMyDashboardsPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import org.apache.wicket.spring.injection.annot.SpringBean;
1717
import org.devgateway.ocds.forms.wicket.providers.PersonDashboardJpaRepositoryProvider;
1818
import org.devgateway.ocds.persistence.dao.UserDashboard;
19-
import org.devgateway.toolkit.forms.security.SecurityConstants;
19+
import org.devgateway.toolkit.web.security.SecurityConstants;
2020
import org.devgateway.toolkit.forms.wicket.providers.SortableJpaRepositoryDataProvider;
2121
import org.devgateway.toolkit.persistence.repository.PersonRepository;
2222
import org.wicketstuff.annotation.mount.MountPath;

forms/src/main/java/org/devgateway/ocds/forms/wicket/providers/PersonDashboardJpaRepositoryProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import org.devgateway.ocds.persistence.dao.UserDashboard;
1010
import org.devgateway.ocds.persistence.repository.UserDashboardRepository;
1111
import org.devgateway.toolkit.forms.WebConstants;
12-
import org.devgateway.toolkit.forms.security.SecurityUtil;
12+
import org.devgateway.toolkit.web.security.SecurityUtil;
1313
import org.devgateway.toolkit.forms.wicket.providers.SortableJpaRepositoryDataProvider;
1414
import org.devgateway.toolkit.persistence.repository.PersonRepository;
1515
import org.springframework.data.domain.Page;

forms/src/main/java/org/devgateway/toolkit/forms/WarInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import org.devgateway.toolkit.forms.wicket.FormsWebApplication;
1515
import org.springframework.boot.builder.SpringApplicationBuilder;
16-
import org.springframework.boot.context.web.SpringBootServletInitializer;
16+
import org.springframework.boot.web.support.SpringBootServletInitializer;
1717

1818
/**
1919
* Allows the app to deployed as Servlet 3.0 WAR

forms/src/main/java/org/devgateway/toolkit/forms/wicket/FormsWebApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private void configureBootstrap() {
141141
// The boostrap.css file is loaded as dependency in MainCss Instance
142142
// settings.setCssResourceReference(EmptyCss.INSTANCE);
143143

144-
settings.useCdnResources(true);
144+
settings.useCdnResources(false);
145145

146146
// use the default bootstrap theme
147147
Bootstrap.install(this, settings);

0 commit comments

Comments
 (0)