Skip to content

Commit d3ceab1

Browse files
authored
Merge pull request #220 from devgateway/develop
Merge develop into master for 1.0.0
2 parents 0241cc9 + d4f6899 commit d3ceab1

174 files changed

Lines changed: 3137 additions & 644 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.

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ npm-debug.log
1212
.idea
1313
rebel.xml
1414
/logs/
15+
/forms/nbactions.xml
16+
/nb-configuration.xml
17+
/forms/nb-configuration.xml
18+
/persistence-mongodb/nb-configuration.xml
19+
/forms/.rebel.xml.bak
20+
/persistence/nb-configuration.xml
21+
/web/nb-configuration.xml
22+
/ui/nb-configuration.xml

forms/pom.xml

Lines changed: 4 additions & 4 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.4.0</wicket.version>
33-
<wicket.bootstrap.version>0.10.8</wicket.bootstrap.version>
34-
<zt.zip.version>1.9</zt.zip.version>
32+
<wicket.version>7.5.0</wicket.version>
33+
<wicket.bootstrap.version>0.10.11</wicket.bootstrap.version>
34+
<zt.zip.version>1.10</zt.zip.version>
3535
<wicket.webjars.version>0.5.5</wicket.webjars.version>
3636
<closure.compiler.version>v20160822</closure.compiler.version>
3737
</properties>
@@ -231,7 +231,7 @@
231231
<dependency>
232232
<groupId>org.apache.poi</groupId>
233233
<artifactId>poi</artifactId>
234-
<version>${poi.version}</version>
234+
<version>${pentaho.poi.version}</version>
235235
</dependency>
236236
</dependencies>
237237

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html xmlns:wicket="http://wicket.apache.org">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>EditUserDashboardPage</title>
6+
</head>
7+
<body>
8+
<wicket:extend>
9+
<div wicket:id="name"></div>
10+
<div wicket:id="formUrlEncodedBody"></div>
11+
<div wicket:id="users"></div>
12+
<div wicket:id="defaultDashboardUsers"></div>
13+
</wicket:extend>
14+
</body>
15+
</html>
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2016 Development Gateway, Inc and others.
3+
*
4+
* All rights reserved. This program and the accompanying materials
5+
* are made available under the terms of the MIT License (MIT)
6+
* which accompanies this distribution, and is available at
7+
* https://opensource.org/licenses/MIT
8+
*
9+
* Contributors:
10+
* Development Gateway - initial API and implementation
11+
*******************************************************************************/
12+
package org.devgateway.ocds.forms.wicket.page.edit;
13+
14+
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
15+
import org.apache.wicket.request.mapper.parameter.PageParameters;
16+
import org.apache.wicket.spring.injection.annot.SpringBean;
17+
import org.devgateway.ocds.forms.wicket.page.list.ListAllDashboardsPage;
18+
import org.devgateway.ocds.forms.wicket.providers.LabelPersistableJpaRepositoryTextChoiceProvider;
19+
import org.devgateway.ocds.persistence.dao.UserDashboard;
20+
import org.devgateway.ocds.persistence.repository.UserDashboardRepository;
21+
import org.devgateway.toolkit.forms.security.SecurityConstants;
22+
import org.devgateway.toolkit.forms.wicket.components.form.Select2MultiChoiceBootstrapFormComponent;
23+
import org.devgateway.toolkit.forms.wicket.components.form.TextAreaFieldBootstrapFormComponent;
24+
import org.devgateway.toolkit.forms.wicket.components.form.TextFieldBootstrapFormComponent;
25+
import org.devgateway.toolkit.forms.wicket.page.edit.AbstractEditPage;
26+
import org.devgateway.toolkit.persistence.dao.Person;
27+
import org.devgateway.toolkit.persistence.repository.PersonRepository;
28+
import org.wicketstuff.annotation.mount.MountPath;
29+
30+
@AuthorizeInstantiation(SecurityConstants.Roles.ROLE_ADMIN)
31+
@MountPath("/editUserDashboard")
32+
public class EditUserDashboardPage extends AbstractEditPage<UserDashboard> {
33+
34+
private static final long serialVersionUID = -6069250112046118104L;
35+
36+
@Override
37+
protected UserDashboard newInstance() {
38+
return new UserDashboard();
39+
}
40+
41+
@SpringBean
42+
private UserDashboardRepository userDashboardRepository;
43+
44+
@SpringBean
45+
private PersonRepository personRepository;
46+
47+
public EditUserDashboardPage(final PageParameters parameters) {
48+
super(parameters);
49+
this.jpaRepository = userDashboardRepository;
50+
this.listPageClass = ListAllDashboardsPage.class;
51+
52+
}
53+
54+
@Override
55+
protected void onInitialize() {
56+
super.onInitialize();
57+
58+
TextFieldBootstrapFormComponent<String> name = new TextFieldBootstrapFormComponent<>("name");
59+
name.required();
60+
editForm.add(name);
61+
62+
TextAreaFieldBootstrapFormComponent<String> formUrlEncodedBody =
63+
new TextAreaFieldBootstrapFormComponent<>("formUrlEncodedBody");
64+
formUrlEncodedBody.required();
65+
formUrlEncodedBody.getField().setEnabled(false);
66+
editForm.add(formUrlEncodedBody);
67+
68+
Select2MultiChoiceBootstrapFormComponent<Person> defaultDashboardUsers =
69+
new Select2MultiChoiceBootstrapFormComponent<>("defaultDashboardUsers",
70+
new LabelPersistableJpaRepositoryTextChoiceProvider<>(personRepository));
71+
defaultDashboardUsers.setEnabled(false);
72+
editForm.add(defaultDashboardUsers);
73+
74+
Select2MultiChoiceBootstrapFormComponent<Person> users =
75+
new Select2MultiChoiceBootstrapFormComponent<>("users",
76+
new LabelPersistableJpaRepositoryTextChoiceProvider<>(personRepository));
77+
editForm.add(users);
78+
79+
80+
}
81+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
###############################################################################
2+
# Copyright (c) 2015 Development Gateway, Inc and others.
3+
#
4+
# All rights reserved. This program and the accompanying materials
5+
# are made available under the terms of the MIT License (MIT)
6+
# which accompanies this distribution, and is available at
7+
# https://opensource.org/licenses/MIT
8+
#
9+
# Contributors:
10+
# Development Gateway - initial API and implementation
11+
###############################################################################
12+
page.title=Edit User Dashboard
13+
name.label=Name
14+
formUrlEncodedBody.label=Filter body
15+
formUrlEncodedBody.help=This is a list of saved filters from the UI and cannot be edited here.
16+
defaultDashboardUsers.label=Default Dashboard For Users
17+
defaultDashboardUsers.help=This is a user setting and can be changed from the User form
18+
users.label=Assigned Users
19+
delete_error_message=Cannot delete this dashboard. It is assigned as the default dashboard for at least one user.\
20+
Please assign a different default dashboard for the assigned users or select no default dashboard, and then try the delete again.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!DOCTYPE html>
2+
<html xmlns:wicket="http://wicket.apache.org">
3+
<body>
4+
<wicket:extend>
5+
<button wicket:id="view">View</button>
6+
</wicket:extend>
7+
</body>
8+
</html>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2016 Development Gateway, Inc and others.
3+
*
4+
* All rights reserved. This program and the accompanying materials
5+
* are made available under the terms of the MIT License (MIT)
6+
* which accompanies this distribution, and is available at
7+
* https://opensource.org/licenses/MIT
8+
*
9+
* Contributors:
10+
* Development Gateway - initial API and implementation
11+
*******************************************************************************/
12+
package org.devgateway.ocds.forms.wicket.page.list;
13+
14+
import de.agilecoders.wicket.core.markup.html.bootstrap.button.BootstrapExternalLink;
15+
import de.agilecoders.wicket.core.markup.html.bootstrap.button.Buttons;
16+
import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesomeIconType;
17+
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
18+
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
19+
import org.apache.wicket.model.IModel;
20+
import org.apache.wicket.model.Model;
21+
import org.apache.wicket.model.StringResourceModel;
22+
import org.apache.wicket.request.mapper.parameter.PageParameters;
23+
import org.apache.wicket.spring.injection.annot.SpringBean;
24+
import org.devgateway.ocds.forms.wicket.page.edit.EditUserDashboardPage;
25+
import org.devgateway.ocds.persistence.dao.UserDashboard;
26+
import org.devgateway.ocds.persistence.repository.UserDashboardRepository;
27+
import org.devgateway.toolkit.forms.security.SecurityConstants;
28+
import org.devgateway.toolkit.forms.wicket.page.lists.AbstractListPage;
29+
import org.wicketstuff.annotation.mount.MountPath;
30+
31+
@AuthorizeInstantiation(SecurityConstants.Roles.ROLE_ADMIN)
32+
@MountPath(value = "/listAllDashboards")
33+
public class ListAllDashboardsPage extends AbstractListPage<UserDashboard> {
34+
35+
/**
36+
*
37+
*/
38+
private static final long serialVersionUID = -324298525712620234L;
39+
@SpringBean
40+
protected UserDashboardRepository userDashboardRepository;
41+
42+
public class DashboardsActionPanel extends ActionPanel {
43+
44+
/**
45+
* @param id
46+
* @param model
47+
*/
48+
public DashboardsActionPanel(String id, IModel<UserDashboard> model) {
49+
super(id, model);
50+
51+
UserDashboard entity = (UserDashboard) this.getDefaultModelObject();
52+
53+
BootstrapExternalLink viewLink = new BootstrapExternalLink("view", Model.of("ui/index.html?dashboardId="
54+
+ entity.getId()), Buttons.Type.Danger) {
55+
};
56+
viewLink.setLabel(new StringResourceModel("view", ListAllDashboardsPage.this, null));
57+
viewLink.setIconType(FontAwesomeIconType.eye).setSize(Buttons.Size.Small);
58+
add(viewLink);
59+
60+
}
61+
}
62+
63+
public ListAllDashboardsPage(final PageParameters pageParameters) {
64+
super(pageParameters);
65+
this.jpaRepository = userDashboardRepository;
66+
this.editPageClass = EditUserDashboardPage.class;
67+
columns.add(new PropertyColumn<UserDashboard, String>(
68+
new Model<String>((new StringResourceModel("name", ListAllDashboardsPage.this, null)).getString()),
69+
"name", "name"));
70+
columns.add(new PropertyColumn<UserDashboard, String>(new Model<String>(
71+
(new StringResourceModel("defaultDashboardUsers", ListAllDashboardsPage.this, null)).getString()),
72+
"defaultDashboardUsers", "defaultDashboardUsers"));
73+
74+
columns.add(new PropertyColumn<UserDashboard, String>(new Model<String>(
75+
(new StringResourceModel("users", ListAllDashboardsPage.this, null)).getString()),
76+
"users", "users"));
77+
78+
}
79+
80+
@Override
81+
protected void onInitialize() {
82+
super.onInitialize();
83+
84+
editPageLink.setVisibilityAllowed(false);
85+
}
86+
87+
@Override
88+
public ActionPanel getActionPanel(String id, IModel<UserDashboard> model) {
89+
return new DashboardsActionPanel(id, model);
90+
}
91+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
###############################################################################
2+
# Copyright (c) 2015 Development Gateway, Inc and others.
3+
#
4+
# All rights reserved. This program and the accompanying materials
5+
# are made available under the terms of the MIT License (MIT)
6+
# which accompanies this distribution, and is available at
7+
# https://opensource.org/licenses/MIT
8+
#
9+
# Contributors:
10+
# Development Gateway - initial API and implementation
11+
###############################################################################
12+
page.title=All Dashboards
13+
name=Name
14+
defaultDashboardUsers=Default Dashboard For Users
15+
users=Users
16+
view=View
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2016 Development Gateway, Inc and others.
3+
*
4+
* All rights reserved. This program and the accompanying materials
5+
* are made available under the terms of the MIT License (MIT)
6+
* which accompanies this distribution, and is available at
7+
* https://opensource.org/licenses/MIT
8+
*
9+
* Contributors:
10+
* Development Gateway - initial API and implementation
11+
*******************************************************************************/
12+
package org.devgateway.ocds.forms.wicket.page.list;
13+
14+
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
15+
import org.apache.wicket.request.mapper.parameter.PageParameters;
16+
import org.apache.wicket.spring.injection.annot.SpringBean;
17+
import org.devgateway.ocds.forms.wicket.providers.PersonDashboardJpaRepositoryProvider;
18+
import org.devgateway.ocds.persistence.dao.UserDashboard;
19+
import org.devgateway.toolkit.forms.security.SecurityConstants;
20+
import org.devgateway.toolkit.forms.wicket.providers.SortableJpaRepositoryDataProvider;
21+
import org.devgateway.toolkit.persistence.repository.PersonRepository;
22+
import org.wicketstuff.annotation.mount.MountPath;
23+
24+
@AuthorizeInstantiation(SecurityConstants.Roles.ROLE_PROCURING_ENTITY)
25+
@MountPath(value = "/listMyDashboards")
26+
public class ListMyDashboardsPage extends ListAllDashboardsPage {
27+
28+
/**
29+
*
30+
*/
31+
private static final long serialVersionUID = 8105049572554654046L;
32+
33+
@SpringBean
34+
private PersonRepository personRepository;
35+
36+
37+
@Override
38+
public SortableJpaRepositoryDataProvider<UserDashboard> getProvider() {
39+
return new PersonDashboardJpaRepositoryProvider(userDashboardRepository, personRepository);
40+
}
41+
42+
public ListMyDashboardsPage(final PageParameters pageParameters) {
43+
super(pageParameters);
44+
}
45+
46+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
###############################################################################
2+
# Copyright (c) 2015 Development Gateway, Inc and others.
3+
#
4+
# All rights reserved. This program and the accompanying materials
5+
# are made available under the terms of the MIT License (MIT)
6+
# which accompanies this distribution, and is available at
7+
# https://opensource.org/licenses/MIT
8+
#
9+
# Contributors:
10+
# Development Gateway - initial API and implementation
11+
###############################################################################
12+
page.title=My Dashboards

0 commit comments

Comments
 (0)