Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exo4 #40

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Exo4 #40

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 11 additions & 1 deletion src/main/java/net/apispark/webapi/representation/Contact.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class Contact implements Serializable {
private String id;
private String firstName;
private String lastName;
private String gender;
private String avatar;
private Date birthday;
private Boolean active;
Expand All @@ -25,9 +26,18 @@ public Contact(String id, String firstName, String lastName, String avatar) {
this.firstName = firstName;
this.lastName = lastName;
this.avatar = avatar;

}

public String getId() {
public String getGender() {
return gender;
}

public void setGender(String gender) {
this.gender = gender;
}

public String getId() {
return id;
}

Expand Down
1 change: 1 addition & 0 deletions src/test/java/net/apispark/webapi/DummyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ public class DummyTest {
public void dummy_assertion() throws Exception {
Assert.assertThat("test is good", is(instanceOf(String.class)));
}

}
38 changes: 38 additions & 0 deletions src/test/java/net/apispark/webapi/db/ContactPersistenceTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package net.apispark.webapi.db;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.*;

import org.junit.Assert;
import org.junit.Test;

import net.apispark.webapi.representation.Contact;

public class ContactPersistenceTest {
@Test
public void TestId() throws Exception {
Contact contact= new Contact();
contact.setFirstName("mat");
Contact contactSaved = ContactPersistence.INSTANCE.addContact(contact);
Assert.assertThat(contactSaved, is(notNullValue()));

}
@Test
public void TestIdBis() throws Exception {
Contact contact= new Contact();
contact.setFirstName("mat");
Contact contactSaved = ContactPersistence.INSTANCE.addContact(contact);
Contact contactRecup = ContactPersistence.INSTANCE.getContact(contactSaved.getId());
Assert.assertThat(contactRecup.getId(), is(contactSaved.getId()));
}

@Test
public void Test3() throws Exception {
Contact contact= new Contact();
contact.setFirstName("mat");
Contact contactSaved = ContactPersistence.INSTANCE.addContact(contact);
Contact contactRecup = ContactPersistence.INSTANCE.getContact(contactSaved.getId());
Assert.assertThat(contactRecup.getId(), is(contactSaved.getId()));
}

}
5 changes: 5 additions & 0 deletions target/classes/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Manifest-Version: 1.0
Built-By: Mat
Build-Jdk: 1.8.0_60
Created-By: Maven Integration for Eclipse

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Generated by Maven Integration for Eclipse
#Wed Oct 26 14:33:18 CEST 2016
version=1.0.0-SNAPSHOT
groupId=net.apispark.webapi
m2e.projectName=cicd
m2e.projectLocation=C\:\\Users\\Mat\\Desktop\\TP_QualiteLogicielle\\material-contacts-apispark
artifactId=cicd
122 changes: 122 additions & 0 deletions target/classes/META-INF/maven/net.apispark.webapi/cicd/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>net.apispark.webapi</groupId>
<artifactId>cicd</artifactId>
<version>1.0.0-SNAPSHOT</version>

<properties>
<restlet-version>2.3.5</restlet-version>
<slf4j.version>1.7.12</slf4j.version>
<log4j.version>1.2.16</log4j.version>
</properties>

<repositories>
<repository>
<id>maven-restlet</id>
<name>Public online Restlet repository</name>
<url>http://maven.restlet.com</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.restlet.jse</groupId>
<artifactId>org.restlet</artifactId>
<version>${restlet-version}</version>
</dependency>

<dependency>
<groupId>org.restlet.jse</groupId>
<artifactId>org.restlet.ext.jackson</artifactId>
<version>${restlet-version}</version>
</dependency>

<dependency>
<groupId>org.restlet.jse</groupId>
<artifactId>org.restlet.ext.jetty</artifactId>
<version>${restlet-version}</version>
</dependency>

<!-- log -->

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>

<!-- tests -->

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>net.apispark.webapi.WebApiMain</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
8 changes: 8 additions & 0 deletions target/classes/log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Root logger
log4j.rootLogger=INFO, stdout

# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} - %p [%t] %c - %m%n
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions target/classes/static/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Material contacts with APISpark :honeybee:

The demo is [>> here <<](http://pgu.github.io/material-contacts-apispark/)

- the application is connected to an API, hosted on [APISpark](http://restlet.com/products/apispark/)
- the code is "forked" from [angular-material starter](https://github.com/angular/material-start)
- the SVG files come from
- [material design icons](https://github.com/google/material-design-icons)
- [iconmonstr](http://iconmonstr.com/)

![](contacts-material-apispark.gif)

Also, there is a standalone (without server) version [>> here <<](http://pgu.github.io/material-contacts/)

![](contacts-material-front-only.gif)

The design and concept come from [angular-material](https://github.com/angular/material-start). You can visit an online version [>> here <<](http://pgu.github.io/material-start/) from this [fork](https://github.com/pgu/material-start).
Binary file added target/classes/static/assets/apispark_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
136 changes: 136 additions & 0 deletions target/classes/static/assets/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
html, body {
font-family: 'Roboto', sans-serif;
font-size: 14px;
height: 100%;
margin: 0px;
padding: 0px;
}

/* Toolbar area */

.menu {
background-color: transparent;
border: none;
height: 38px;
margin: 16px;
width: 36px;
}

md-toolbar h1 {
margin: auto;
}

/* Sidenav area */

md-list .md-button {
color: inherit;
font-weight: 500;
text-align: left;
width: 100%;
}

/*md-list .md-button.selected {*/
/*color: rgb(33, 150, 243);*/
/*}*/

md-sidenav md-list {
padding: 0px 0px 8px 0px;
}

/* Primary content area */

#content {
padding-left: 40px;
padding-right: 40px;
padding-top: 5px;
}

#content .md-button.delete-contact {
background-color: transparent;
border: none;
width: 48px;
height: 48px;
margin: 8px auto 16px 0;
position: absolute;
top: 10px;
right: 25px;
}

#content .md-button.delete-contact > md-icon {
width: 36px;
height: 36px;
}

md-button.menuBtn > md-icon {
fill: white;
width: 24px;
height: 24px;
}

#content .md-button.delete-contact:active > md-icon {
background-color: #dadada;
border-radius: 75%;
padding: 4px;
transition: all 100ms ease-out 30ms;
}

#content img {
display: block;
height: auto;
max-width: 500px;
}

/* Utils */

.content-wrapper {
position: relative;
}

/* Typography support coming in 0.8.0 */

md-toolbar h1 {
font-size: 1.250em;
font-weight: 400;
}

.avatar {
position: relative;
width: 128px;
height: 128px;
border: 1px solid #ddd;
border-radius: 50%;
display: inline-block;
overflow: hidden;
margin: 0;
vertical-align: middle;
}

.wrap-avatar {
position: relative;
height: 128px;
width: 128px;
border: 1px solid transparent;
border-radius: 50%;
display: inline-block;
overflow: hidden;
margin: 0px;
vertical-align: middle;
zoom: 0.70;
transform: translateZ(0);
-webkit-transform: scale(0.70);
-moz-transform: scale(0.70);
}

md-bottom-sheet md-icon {
margin-right: 20px;
}

span.name {
font-weight: bold;
font-size: 1.1em;
padding-left: 5px;
}

[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
15 changes: 15 additions & 0 deletions target/classes/static/assets/svg/contact/add-contact.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading