Skip to content

Commit

Permalink
Ajout du contact
Browse files Browse the repository at this point in the history
  • Loading branch information
adriens committed Mar 3, 2018
1 parent 4805060 commit dd1ae16
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 107 deletions.
209 changes: 107 additions & 102 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,102 +1,107 @@
<?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>com.github.adriens.open.data</groupId>
<artifactId>cine-city-noumea-sdk</artifactId>
<version>1.5-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

<htmlunit.version>2.29</htmlunit.version>
<logback.version>1.2.3</logback.version>
<junit.version>4.12</junit.version>

<!-- Plugins versions -->
<maven-shade-plugin.version>3.0.0</maven-shade-plugin.version>


</properties>

<dependencies>

<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>${htmlunit.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
<configuration>

</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.github.adriens.cine.city.noumea.sdk.FilmsWrapper</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.github.adriens.cine.city.noumea.sdk.FilmsWrapper</mainClass>
<!--<arguments>
<argument></argument>
<argument></argument>
</arguments>
-->
</configuration>
</plugin>
</plugins>
</build>
</project>
<?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>com.github.adriens.open.data</groupId>
<artifactId>cine-city-noumea-sdk</artifactId>
<version>1.5</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

<htmlunit.version>2.29</htmlunit.version>
<logback.version>1.2.3</logback.version>
<junit.version>4.12</junit.version>

<!-- Plugins versions -->
<maven-shade-plugin.version>3.0.0</maven-shade-plugin.version>


</properties>

<dependencies>

<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>${htmlunit.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.11.1</version>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
<configuration>

</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.github.adriens.cine.city.noumea.sdk.FilmsWrapper</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.github.adriens.cine.city.noumea.sdk.FilmsWrapper</mainClass>
<!--<arguments>
<argument></argument>
<argument></argument>
</arguments>
-->
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.github.adriens.cine.city.noumea.sdk;

import java.net.MalformedURLException;
import java.net.URL;

/**
*
* @author salad74
*/
public class CinemaContact {

public static final String INFO_URL_GOOGLE_MAPS = "https://goo.gl/maps/UBuJxg13raT2";
public static final String INFO_TELEPHONE = "+687 29.20.20";
public static final String INFO_URL_WEBSITE = "http://www.cinecity.nc";
public static final String INFO_URL_FACEBOOK = "https://www.facebook.com/pages/Cin%C3%A9-City-NC/1955636754710969";


private final String adressePhysique = FilmsWrapper.INFO_ADRESSE_PHYSIQUE;
private final URL urlGoogleMaps;
private final String telephone = FilmsWrapper.INFO_TELEPHONE;
private final URL urlWebsite;
private final URL urlFacebook;

public CinemaContact() throws MalformedURLException {
this.urlGoogleMaps = new URL(FilmsWrapper.INFO_URL_GOOGLE_MAPS);
this.urlWebsite = new URL(FilmsWrapper.INFO_URL_WEBSITE);
this.urlFacebook = new URL(FilmsWrapper.INFO_URL_FACEBOOK);

}


}
26 changes: 22 additions & 4 deletions src/main/java/com/github/adriens/cine/city/noumea/sdk/Film.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
package com.github.adriens.cine.city.noumea.sdk;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.net.URL;

/**
Expand All @@ -28,13 +30,24 @@ public Film(URL cinecityFilmURL, String filmName, URL cinecityAfficheURL){
}

public String toString(){
if(getName() == null){

ObjectMapper mapper = new ObjectMapper();
try{
return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this);
}
catch(JsonProcessingException ex){
return ("{\"Film\": \"" + getName() + "\"}" );
}

}

/*if(getName() == null){
return "";
}
else{
return getName();
}
}
}*/

public URL getCinecityFilmURL() {
return cinecityFilmURL;
}
Expand All @@ -57,7 +70,12 @@ public String getName() {
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
if(name != null){
this.name = name;
}
else{
this.name = "";
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class FilmsWrapper {

public static final String URL_ROOT = "http://www.cinecity.nc/";
public static final String URL_ACCUEIL = "http://www.cinecity.nc/Home/Accueil/";
public static final String URL_CLASSEMENTS = "http://www.cinecity.nc/Cinecity/Classements";
public static final String URL_CLASSEMENTS = "http://www.cinecity.nc/Cinecity/Classements/";

public static final String INFO_ADRESSE_PHYSIQUE = "18 Rue de la Somme, Nouméa, New Caledonia";
public static final String INFO_URL_GOOGLE_MAPS = "https://goo.gl/maps/UBuJxg13raT2";
Expand Down

0 comments on commit dd1ae16

Please sign in to comment.