Skip to content

Commit

Permalink
changed main IP address..
Browse files Browse the repository at this point in the history
minor cleanings..
  • Loading branch information
riccardodebenedictis committed Sep 19, 2018
1 parent 11c9f22 commit 3175b97
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private Context() {
} catch (IOException ex) {
LOG.log(Level.SEVERE, null, ex);
}
this.target = client.target("http://" + properties.getProperty("lecture-host", "localhost") + ":" + properties.getProperty("service-port", "8080")).path("LECTurE-WebApp-1.0").path("LECTurE");
this.target = client.target("http://" + properties.getProperty("lecture-host", "localhost") + ":" + properties.getProperty("service-port", "8080")).path("LECTurE").path("resources");
user.addListener((ObservableValue<? extends User> observable, User oldValue, User newValue) -> {
if (oldValue != null) {
// we clear the current data..
Expand Down Expand Up @@ -206,7 +206,7 @@ private Context() {
if (newValue != null) {
// we set up a new user..
try {
mqtt = new MqttClient("tcp://" + properties.getProperty("lecture-host", "localhost") + ":" + properties.getProperty("mqtt-port", "1883"), String.valueOf(newValue.id), new MemoryPersistence());
mqtt = new MqttClient("tcp://" + properties.getProperty("lecture-host", "localhost") + ":" + properties.getProperty("mqtt-port", "1884"), String.valueOf(newValue.id), new MemoryPersistence());
mqtt.setCallback(new MqttCallback() {
@Override
public void connectionLost(Throwable cause) {
Expand Down
4 changes: 2 additions & 2 deletions LECTurE-DesktopApp/src/main/resources/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

lecture-host=localhost
lecture-host=150.146.65.22
service-port=8080
mqtt-port=1883
mqtt-port=1884
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @author Riccardo De Benedictis
*/
@ApplicationPath("LECTurE")
@ApplicationPath("resources")
public class LECTurEApplication extends Application {

@Override
Expand Down
3 changes: 1 addition & 2 deletions LECTurE-WebApp/src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="LECTurE-PU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:app/jdbc/LECTurE-DataSource</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="create"/>
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
</properties>
</persistence-unit>
</persistence>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<description/>
</jdbc-resource>
<custom-resource res-type="java.util.Properties" jndi-name="java:app/config" factory-class="org.glassfish.resources.custom.factory.PropertiesFactory">
<property name="mqtt-host" value="192.168.67.128" />
<property name="mqtt-port" value="1883" />
<property name="mqtt-host" value="150.146.65.22" />
<property name="mqtt-port" value="1884" />
<property name="mqtt-server-id" value="LECTurE-Server" />
</custom-resource>
</resources>
2 changes: 1 addition & 1 deletion LECTurE-WebApp/src/main/webapp/WEB-INF/glassfish-web.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<context-root>/LECTurE-WebApp-1.0</context-root>
<context-root>LECTurE</context-root>
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
Expand Down
4 changes: 2 additions & 2 deletions LECTurE-WebApp/src/main/webapp/lecture.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$(document).ready(function () {
console.log("retrieving users..");
$.ajax({
url: "http://localhost:8080/LECTurE-WebApp-1.0/LECTurE/users"
url: "http://localhost:8080/LECTurE/resources/users"
}).then(function (users) {
console.log("found " + users.length + " users..");
document.getElementById("users_count").textContent = users.length;
Expand Down Expand Up @@ -60,7 +60,7 @@ $(document).ready(function () {
var user_id = users[i].id;
btn_del.onclick = function () {
$.ajax({
url: "http://localhost:8080/LECTurE-WebApp-1.0/LECTurE/users/" + user_id,
url: "http://localhost:8080/LECTurE/resources/users/" + user_id,
type: "DELETE"
}).then(function () {
tbdy.removeChild(tr);
Expand Down

0 comments on commit 3175b97

Please sign in to comment.