Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target/
/new/IF3110-03-Simple-Blog-Service/nbproject/private/
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: sh target/bin/webapp
19 changes: 19 additions & 0 deletions nb-configuration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.hint.j2eeVersion>1.7-web</netbeans.hint.j2eeVersion>
<org-netbeans-modules-maven-jaxws._5f_C_5f_simpleblog>http://localhost:8080/IF3110-03-Simple-Blog-Service/simpleblog?wsdl</org-netbeans-modules-maven-jaxws._5f_C_5f_simpleblog>
</properties>
</project-shared-configuration>
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
191 changes: 191 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<?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.mycompany</groupId>
<artifactId>IF3110-03-Simple-Blog-Service</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>IF3110-03-Simple-Blog-Service</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>webservices-rt</artifactId>
<version>1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.firebase</groupId>
<artifactId>firebase-client-android</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>8.0.0.RC0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>8.0.0.RC0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.4-1</version>
</dependency>

<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId>
<version>2.4.2</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-security</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-continuation</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
</exclusion>
</exclusions>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<directory>src</directory>
<targetPath>WEB-INF</targetPath>
<includes>
<include>jax-ws-catalog.xml</include>
<include>wsdl/**</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlFiles>
<wsdlFile>localhost_8080/IF3110-03-Simple-Blog-Service/simpleblog.wsdl</wsdlFile>
</wsdlFiles>
<wsdlLocation>http://localhost:8080/IF3110-03-Simple-Blog-Service/simpleblog?wsdl</wsdlLocation>
<staleFile>${project.build.directory}/jaxws/stale/simpleblog.stale</staleFile>
</configuration>
<id>wsimport-generate-simpleblog</id>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>webservices-api</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<configuration>
<sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
<xnocompile>true</xnocompile>
<verbose>true</verbose>
<extension>true</extension>
<catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
</configuration>
</plugin>
</plugins>
</build>

</project>
5 changes: 5 additions & 0 deletions src/jax-ws-catalog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
<system systemId="file:/C:/Users/TOSHIBA/Documents/RAMA/KULIAH/Semester%207/WBD/IF3110-03-Simple-Blog-Service/simpleblog.wsdl" uri="wsdl/simpleblog.wsdl"/>
<system systemId="http://localhost:8080/IF3110-03-Simple-Blog-Service/simpleblog?wsdl" uri="wsdl/localhost_8080/IF3110-03-Simple-Blog-Service/simpleblog.wsdl"/>
</catalog>
39 changes: 39 additions & 0 deletions src/main/java/org/chamerling/heroku/jetty/JettyServer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.chamerling.heroku.jetty;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
public class JettyServer {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
String webappDirLocation = "src/main/webapp/";

//The port that we should run on can be set into an environment variable
//Look for that variable and default to 8080 if it isn't there.
String webPort = System.getenv("PORT");
if(webPort == null || webPort.isEmpty()) {
webPort = "9191";
}

Server server = new Server(Integer.valueOf(webPort));
WebAppContext root = new WebAppContext();

root.setContextPath("/");
root.setDescriptor(webappDirLocation+"/WEB-INF/web.xml");
root.setResourceBase(webappDirLocation);

//Parent loader priority is a class loader setting that Jetty accepts.
//By default Jetty will behave like most web containers in that it will
//allow your application to replace non-server libraries that are part of the
//container. Setting parent loader priority to true changes this behavior.
//Read more here: http://wiki.eclipse.org/Jetty/Reference/Jetty_Classloading
root.setParentLoaderPriority(true);

server.setHandler(root);

server.start();
server.join();
}

}
18 changes: 18 additions & 0 deletions src/main/java/org/chamerling/heroku/service/HelloService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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 org.chamerling.heroku.service;

import javax.jws.WebService;

/**
* @author chamerling
*
*/
@WebService
public interface HelloService {

String sayHi(String input);
}
20 changes: 20 additions & 0 deletions src/main/java/org/chamerling/heroku/service/HelloServiceImpl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 org.chamerling.heroku.service;

/**
* @author chamerling
*
*/
public class HelloServiceImpl implements HelloService {

@Override
public String sayHi(String input) {
System.out.println("Hello invoked : " + input);
return String.format("Hello '%s'", input);
}

}
64 changes: 64 additions & 0 deletions src/main/java/paket/Comment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* 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 paket;

/**
*
* @author Mario
*/
public class Comment {

String tanggal, konten, email, nama;
Integer id, post_id;

public Integer getPost_id() {
return post_id;
}

public void setPost_id(Integer post_id) {
this.post_id = post_id;
}

public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public String getTanggal() {
return tanggal;
}

public void setTanggal(String tanggal) {
this.tanggal = tanggal;
}

public String getKonten() {
return konten;
}

public void setKonten(String konten) {
this.konten = konten;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public String getNama() {
return nama;
}

public void setNama(String nama) {
this.nama = nama;
}
}
Loading