-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from HU-SD-SV2PRFED-studenten-2021/development
Merge to main
- Loading branch information
Showing
80 changed files
with
5,013 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/* | ||
* Copyright 2007-present the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import java.net.*; | ||
import java.io.*; | ||
import java.nio.channels.*; | ||
import java.util.Properties; | ||
|
||
public class MavenWrapperDownloader { | ||
|
||
private static final String WRAPPER_VERSION = "0.5.6"; | ||
/** | ||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. | ||
*/ | ||
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" | ||
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; | ||
|
||
/** | ||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to | ||
* use instead of the default one. | ||
*/ | ||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = | ||
".mvn/wrapper/maven-wrapper.properties"; | ||
|
||
/** | ||
* Path where the maven-wrapper.jar will be saved to. | ||
*/ | ||
private static final String MAVEN_WRAPPER_JAR_PATH = | ||
".mvn/wrapper/maven-wrapper.jar"; | ||
|
||
/** | ||
* Name of the property which should be used to override the default download url for the wrapper. | ||
*/ | ||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; | ||
|
||
public static void main(String args[]) { | ||
System.out.println("- Downloader started"); | ||
File baseDirectory = new File(args[0]); | ||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); | ||
|
||
// If the maven-wrapper.properties exists, read it and check if it contains a custom | ||
// wrapperUrl parameter. | ||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); | ||
String url = DEFAULT_DOWNLOAD_URL; | ||
if(mavenWrapperPropertyFile.exists()) { | ||
FileInputStream mavenWrapperPropertyFileInputStream = null; | ||
try { | ||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); | ||
Properties mavenWrapperProperties = new Properties(); | ||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); | ||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); | ||
} catch (IOException e) { | ||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); | ||
} finally { | ||
try { | ||
if(mavenWrapperPropertyFileInputStream != null) { | ||
mavenWrapperPropertyFileInputStream.close(); | ||
} | ||
} catch (IOException e) { | ||
// Ignore ... | ||
} | ||
} | ||
} | ||
System.out.println("- Downloading from: " + url); | ||
|
||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); | ||
if(!outputFile.getParentFile().exists()) { | ||
if(!outputFile.getParentFile().mkdirs()) { | ||
System.out.println( | ||
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); | ||
} | ||
} | ||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); | ||
try { | ||
downloadFileFromURL(url, outputFile); | ||
System.out.println("Done"); | ||
System.exit(0); | ||
} catch (Throwable e) { | ||
System.out.println("- Error downloading"); | ||
e.printStackTrace(); | ||
System.exit(1); | ||
} | ||
} | ||
|
||
private static void downloadFileFromURL(String urlString, File destination) throws Exception { | ||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { | ||
String username = System.getenv("MVNW_USERNAME"); | ||
char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); | ||
Authenticator.setDefault(new Authenticator() { | ||
@Override | ||
protected PasswordAuthentication getPasswordAuthentication() { | ||
return new PasswordAuthentication(username, password); | ||
} | ||
}); | ||
} | ||
URL website = new URL(urlString); | ||
ReadableByteChannel rbc; | ||
rbc = Channels.newChannel(website.openStream()); | ||
FileOutputStream fos = new FileOutputStream(destination); | ||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); | ||
fos.close(); | ||
rbc.close(); | ||
} | ||
|
||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: java $JAVA_OPTS -Dserver.port=$PORT -jar target/*.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Billy HBO-I Boekenkast — V2B-2 | ||
Welcome to the Billy project. | ||
## Setup | ||
First you need to set up the database user, the spring configuration expects to login with the following user: | ||
```sql | ||
CREATE USER "groep2" WITH CREATEDB PASSWORD 'groep2-password'; | ||
``` | ||
Next the database needs to be created, for that you can use this script: | ||
```sql | ||
CREATE DATABASE "v2b2-prfed" OWNER "groep2"; | ||
``` | ||
|
||
## Git strategy | ||
For this project we used three branches: | ||
### Main | ||
This is the main branch, every release gets merged into this branch. | ||
### Development | ||
Every feature branch eventually gets merged into this branch and every pull happens from this branch. | ||
### Feature | ||
These are branches made for specific features, they are based on the development branch and when the feature is fully implemented this branch gets merged with development and deleted. | ||
|
||
## Update log: | ||
## v3.0 | ||
### User stories | ||
This iteration we worked on three user stories: | ||
#### As a system administrator, I want the wiki to have version control, so I can see who edited what. | ||
This was divided into a few issues: | ||
- Adding a user to an article | ||
- Displaying the user on the article | ||
#### As a system administrator, I want the ability to rollback to previous versions, so no information is lost. | ||
This was divided into a few issues: | ||
- Adding a table on every article's history tab | ||
- Getting the history of an article and filling the table | ||
- Adding a button that changes the article back to that state | ||
#### As a user, I want to be able to search the wiki, so I can quickly find the information I need. | ||
This was divided into a few issues: | ||
- Creating a request that gets you all article titles | ||
- Creating a search suggestion bar | ||
### Other issues | ||
There was another issue we worked on for this iteration. It was related to adding information to the database: | ||
- Adding a button that shows a popup for creating an article | ||
## v2.0 | ||
### User stories | ||
This iteration we worked on four user stories: | ||
#### As a user, I want the wiki to be divided into the matrix of categories, so the information I am looking for is findable. | ||
This was divided into a few issues: | ||
- Saving articles into the backend database | ||
- Adding matrix categories to the wiki | ||
#### As a user, I want to be able to edit the wiki, so I can update and add information. | ||
This was divided into a few issues: | ||
- Wireframe Edit modal | ||
- HTML Edit modal | ||
- CSS Edit modal | ||
- JS Edit modal | ||
#### As a system administrator, I want that only registered users are able to edit the wiki, so there are no unwanted edits. | ||
This was divided into a few issues: | ||
- Add a check before the editing process to see if the user is allowed to edit | ||
#### As a user, I want to be able to turn on accessibility mode, so I can still get information with a disability. | ||
This was divided into a few issues: | ||
- Add three buttons for changing the font size | ||
- Adding functionality to those buttons | ||
- Add dark mode | ||
### Other issues | ||
There were some other issues we worked on for this iteration. They were related to the creation and accessibility of information: | ||
- Setup of Heroku | ||
- Dummydata for the database | ||
|
||
## v1.0 | ||
### User stories | ||
This iteration we worked on two user stories: | ||
#### As guest, I want to be able to see the wiki, so I can read the information that is in it. | ||
This was divided into a few issues: | ||
- Wireframe Indexpage | ||
- HTML Indexpage | ||
- CSS Indexpage | ||
- JS Indexpage | ||
#### As user, I want to be able to log in, so I can add my knowledge to the wiki. | ||
This was divided into a few issues: | ||
- Wireframe Loginpage | ||
- HTML Loginpage | ||
- CSS Loginpage | ||
- JS Loginpage | ||
### Other issues | ||
There were some other issues we worked on for this iteration. They were related to the startup of the project: | ||
- Creation of the database | ||
- Spring backend setup |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.