From fcaf637431fee2cdd5ccab79b6de1edf44bac777 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 3 Aug 2015 15:13:14 +1200 Subject: Remove files and update readme --- .../model/ApplicationSettingsProperties.java | 30 --------- .../web/client/model/BaseAsyncCallback.java | 32 ---------- .../web/client/model/BaseStoreHandlers.java | 73 ---------------------- src/org/traccar/web/client/model/DataService.java | 62 ------------------ .../traccar/web/client/model/DataServiceAsync.java | 60 ------------------ .../traccar/web/client/model/DeviceProperties.java | 37 ----------- .../traccar/web/client/model/EnumKeyProvider.java | 13 ---- .../web/client/model/PositionProperties.java | 48 -------------- src/org/traccar/web/client/model/StateItem.java | 31 --------- .../web/client/model/StateItemProperties.java | 17 ----- src/org/traccar/web/client/model/StateReader.java | 50 --------------- .../traccar/web/client/model/UserProperties.java | 34 ---------- .../web/client/model/UserSettingsProperties.java | 50 --------------- 13 files changed, 537 deletions(-) delete mode 100644 src/org/traccar/web/client/model/ApplicationSettingsProperties.java delete mode 100644 src/org/traccar/web/client/model/BaseAsyncCallback.java delete mode 100644 src/org/traccar/web/client/model/BaseStoreHandlers.java delete mode 100644 src/org/traccar/web/client/model/DataService.java delete mode 100644 src/org/traccar/web/client/model/DataServiceAsync.java delete mode 100644 src/org/traccar/web/client/model/DeviceProperties.java delete mode 100644 src/org/traccar/web/client/model/EnumKeyProvider.java delete mode 100644 src/org/traccar/web/client/model/PositionProperties.java delete mode 100644 src/org/traccar/web/client/model/StateItem.java delete mode 100644 src/org/traccar/web/client/model/StateItemProperties.java delete mode 100644 src/org/traccar/web/client/model/StateReader.java delete mode 100644 src/org/traccar/web/client/model/UserProperties.java delete mode 100644 src/org/traccar/web/client/model/UserSettingsProperties.java (limited to 'src/org/traccar/web/client/model') diff --git a/src/org/traccar/web/client/model/ApplicationSettingsProperties.java b/src/org/traccar/web/client/model/ApplicationSettingsProperties.java deleted file mode 100644 index b30572e..0000000 --- a/src/org/traccar/web/client/model/ApplicationSettingsProperties.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) - * - * 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 - * - * http://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. - */ -package org.traccar.web.client.model; - -import org.traccar.web.shared.model.ApplicationSettings; - -import com.sencha.gxt.core.client.ValueProvider; -import com.sencha.gxt.data.shared.ModelKeyProvider; -import com.sencha.gxt.data.shared.PropertyAccess; - -public interface ApplicationSettingsProperties extends PropertyAccess { - - ModelKeyProvider id(); - - ValueProvider registrationEnabled(); - -} diff --git a/src/org/traccar/web/client/model/BaseAsyncCallback.java b/src/org/traccar/web/client/model/BaseAsyncCallback.java deleted file mode 100644 index cb0c479..0000000 --- a/src/org/traccar/web/client/model/BaseAsyncCallback.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) - * - * 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 - * - * http://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. - */ -package org.traccar.web.client.model; - -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.sencha.gxt.widget.core.client.box.AlertMessageBox; - -public class BaseAsyncCallback implements AsyncCallback { - - @Override - public void onFailure(Throwable caught) { - new AlertMessageBox("Error", "Remote procedure call error").show(); - } - - @Override - public void onSuccess(T result) { - } - -} diff --git a/src/org/traccar/web/client/model/BaseStoreHandlers.java b/src/org/traccar/web/client/model/BaseStoreHandlers.java deleted file mode 100644 index f34ff3a..0000000 --- a/src/org/traccar/web/client/model/BaseStoreHandlers.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) - * - * 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 - * - * http://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. - */ -package org.traccar.web.client.model; - -import com.sencha.gxt.data.shared.event.StoreAddEvent; -import com.sencha.gxt.data.shared.event.StoreClearEvent; -import com.sencha.gxt.data.shared.event.StoreDataChangeEvent; -import com.sencha.gxt.data.shared.event.StoreFilterEvent; -import com.sencha.gxt.data.shared.event.StoreHandlers; -import com.sencha.gxt.data.shared.event.StoreRecordChangeEvent; -import com.sencha.gxt.data.shared.event.StoreRemoveEvent; -import com.sencha.gxt.data.shared.event.StoreSortEvent; -import com.sencha.gxt.data.shared.event.StoreUpdateEvent; - -public class BaseStoreHandlers implements StoreHandlers { - - @Override - public void onAdd(StoreAddEvent event) { - onAnything(); - } - - @Override - public void onRemove(StoreRemoveEvent event) { - onAnything(); - } - - @Override - public void onFilter(StoreFilterEvent event) { - onAnything(); - } - - @Override - public void onClear(StoreClearEvent event) { - onAnything(); - } - - @Override - public void onUpdate(StoreUpdateEvent event) { - onAnything(); - } - - @Override - public void onDataChange(StoreDataChangeEvent event) { - onAnything(); - } - - @Override - public void onRecordChange(StoreRecordChangeEvent event) { - onAnything(); - } - - @Override - public void onSort(StoreSortEvent event) { - onAnything(); - } - - public void onAnything() { - } - -} diff --git a/src/org/traccar/web/client/model/DataService.java b/src/org/traccar/web/client/model/DataService.java deleted file mode 100644 index a693b6e..0000000 --- a/src/org/traccar/web/client/model/DataService.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) - * - * 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 - * - * http://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. - */ -package org.traccar.web.client.model; - -import java.util.Date; -import java.util.List; - -import org.traccar.web.shared.model.ApplicationSettings; -import org.traccar.web.shared.model.Device; -import org.traccar.web.shared.model.Position; -import org.traccar.web.shared.model.User; - -import com.google.gwt.user.client.rpc.RemoteService; -import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; - -@RemoteServiceRelativePath("dataService") -public interface DataService extends RemoteService { - - User authenticated() throws IllegalStateException; - - User login(String login, String password); - - boolean logout(); - - User register(String login, String password); - - List getUsers(); - - User addUser(User user); - - User updateUser(User user); - - User removeUser(User user); - - List getDevices(); - - Device addDevice(Device device); - - Device updateDevice(Device device); - - Device removeDevice(Device device); - - List getPositions(Device device, Date from, Date to); - - List getLatestPositions(); - - ApplicationSettings updateApplicationSettings(ApplicationSettings applicationSettings); - -} diff --git a/src/org/traccar/web/client/model/DataServiceAsync.java b/src/org/traccar/web/client/model/DataServiceAsync.java deleted file mode 100644 index b183063..0000000 --- a/src/org/traccar/web/client/model/DataServiceAsync.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) - * - * 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 - * - * http://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. - */ -package org.traccar.web.client.model; - -import java.util.Date; -import java.util.List; - -import org.traccar.web.shared.model.ApplicationSettings; -import org.traccar.web.shared.model.Device; -import org.traccar.web.shared.model.Position; -import org.traccar.web.shared.model.User; - -import com.google.gwt.user.client.rpc.AsyncCallback; - -public interface DataServiceAsync { - - void authenticated(AsyncCallback callback); - - void login(String login, String password, AsyncCallback callback); - - void logout(AsyncCallback callback); - - void register(String login, String password, AsyncCallback callback); - - void getUsers(AsyncCallback> callback); - - void addUser(User user, AsyncCallback callback); - - void updateUser(User user, AsyncCallback callback); - - void removeUser(User user, AsyncCallback callback); - - void getDevices(AsyncCallback> callback); - - void addDevice(Device device, AsyncCallback callback); - - void updateDevice(Device device, AsyncCallback callback); - - void removeDevice(Device device, AsyncCallback callback); - - void getLatestPositions(AsyncCallback> callback); - - void getPositions(Device device, Date from, Date to, AsyncCallback> callback); - - void updateApplicationSettings(ApplicationSettings applicationSettings, AsyncCallback callback); - -} diff --git a/src/org/traccar/web/client/model/DeviceProperties.java b/src/org/traccar/web/client/model/DeviceProperties.java deleted file mode 100644 index 35f946a..0000000 --- a/src/org/traccar/web/client/model/DeviceProperties.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) - * - * 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 - * - * http://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. - */ -package org.traccar.web.client.model; - -import org.traccar.web.shared.model.Device; - -import com.google.gwt.editor.client.Editor.Path; -import com.sencha.gxt.core.client.ValueProvider; -import com.sencha.gxt.data.shared.LabelProvider; -import com.sencha.gxt.data.shared.ModelKeyProvider; -import com.sencha.gxt.data.shared.PropertyAccess; - -public interface DeviceProperties extends PropertyAccess { - - ModelKeyProvider id(); - - ValueProvider uniqueId(); - - ValueProvider name(); - - @Path("name") - LabelProvider label(); - -} diff --git a/src/org/traccar/web/client/model/EnumKeyProvider.java b/src/org/traccar/web/client/model/EnumKeyProvider.java deleted file mode 100644 index c41d420..0000000 --- a/src/org/traccar/web/client/model/EnumKeyProvider.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.traccar.web.client.model; - -import com.sencha.gxt.data.shared.ModelKeyProvider; - - -public class EnumKeyProvider> implements ModelKeyProvider { - - @Override - public String getKey(T item) { - return String.valueOf(item.ordinal()); - } - -} diff --git a/src/org/traccar/web/client/model/PositionProperties.java b/src/org/traccar/web/client/model/PositionProperties.java deleted file mode 100644 index 86ab532..0000000 --- a/src/org/traccar/web/client/model/PositionProperties.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) - * - * 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 - * - * http://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. - */ -package org.traccar.web.client.model; - -import java.util.Date; - -import org.traccar.web.shared.model.Position; - -import com.sencha.gxt.core.client.ValueProvider; -import com.sencha.gxt.data.shared.ModelKeyProvider; -import com.sencha.gxt.data.shared.PropertyAccess; - -public interface PositionProperties extends PropertyAccess { - - ModelKeyProvider id(); - - ValueProvider time(); - - ValueProvider valid(); - - ValueProvider latitude(); - - ValueProvider longitude(); - - ValueProvider altitude(); - - ValueProvider speed(); - - ValueProvider course(); - - ValueProvider power(); - - ValueProvider address(); - -} diff --git a/src/org/traccar/web/client/model/StateItem.java b/src/org/traccar/web/client/model/StateItem.java deleted file mode 100644 index 651d2a2..0000000 --- a/src/org/traccar/web/client/model/StateItem.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.traccar.web.client.model; - - -public class StateItem { - - public StateItem(String name, String value) { - this.name = name; - this.value = value; - } - - private String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - private String value; - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - -} diff --git a/src/org/traccar/web/client/model/StateItemProperties.java b/src/org/traccar/web/client/model/StateItemProperties.java deleted file mode 100644 index e3700a5..0000000 --- a/src/org/traccar/web/client/model/StateItemProperties.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.traccar.web.client.model; - -import com.google.gwt.editor.client.Editor.Path; -import com.sencha.gxt.core.client.ValueProvider; -import com.sencha.gxt.data.shared.ModelKeyProvider; -import com.sencha.gxt.data.shared.PropertyAccess; - -public interface StateItemProperties extends PropertyAccess { - - @Path("name") - ModelKeyProvider id(); - - ValueProvider name(); - - ValueProvider value(); - -} diff --git a/src/org/traccar/web/client/model/StateReader.java b/src/org/traccar/web/client/model/StateReader.java deleted file mode 100644 index 10ed980..0000000 --- a/src/org/traccar/web/client/model/StateReader.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.traccar.web.client.model; - -import java.util.LinkedList; -import java.util.List; - -import org.traccar.web.client.ApplicationContext; -import org.traccar.web.shared.model.Position; - -import com.google.gwt.xml.client.Node; -import com.google.gwt.xml.client.NodeList; -import com.google.gwt.xml.client.XMLParser; - -public class StateReader { - - private static String toString(Object object) { - if (object != null) { - return object.toString(); - } - return null; - } - - public static List getState(Position position) { - List state = new LinkedList(); - - state.add(new StateItem("valid", toString(position.getValid()))); - state.add(new StateItem("time", ApplicationContext.getInstance().getFormatterUtil().getTimeFormat().format(position.getTime()))); - state.add(new StateItem("latitude", toString(position.getLatitude()))); - state.add(new StateItem("longitude", toString(position.getLongitude()))); - state.add(new StateItem("altitude", toString(position.getAltitude()))); - state.add(new StateItem("speed", ApplicationContext.getInstance().getFormatterUtil().getSpeedFormat().format(position.getSpeed()))); - state.add(new StateItem("course", toString(position.getCourse()))); - state.add(new StateItem("power", toString(position.getPower()))); - state.add(new StateItem("address", position.getAddress())); - - String other = position.getOther(); - if (other != null) { - try { - NodeList nodes = XMLParser.parse(other).getFirstChild().getChildNodes(); - for (int i = 0; i < nodes.getLength(); i++) { - Node node = nodes.item(i); - state.add(new StateItem(node.getNodeName(), node.getFirstChild().getNodeValue())); - } - } catch (Exception error) { - } - } - - return state; - } - -} diff --git a/src/org/traccar/web/client/model/UserProperties.java b/src/org/traccar/web/client/model/UserProperties.java deleted file mode 100644 index cba2996..0000000 --- a/src/org/traccar/web/client/model/UserProperties.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) - * - * 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 - * - * http://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. - */ -package org.traccar.web.client.model; - -import org.traccar.web.shared.model.User; - -import com.sencha.gxt.core.client.ValueProvider; -import com.sencha.gxt.data.shared.ModelKeyProvider; -import com.sencha.gxt.data.shared.PropertyAccess; - -public interface UserProperties extends PropertyAccess { - - ModelKeyProvider id(); - - ValueProvider login(); - - ValueProvider password(); - - ValueProvider admin(); - -} diff --git a/src/org/traccar/web/client/model/UserSettingsProperties.java b/src/org/traccar/web/client/model/UserSettingsProperties.java deleted file mode 100644 index dad7111..0000000 --- a/src/org/traccar/web/client/model/UserSettingsProperties.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) - * - * 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 - * - * http://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. - */ -package org.traccar.web.client.model; - -import org.traccar.web.shared.model.UserSettings; -import org.traccar.web.shared.model.UserSettings.SpeedUnit; - -import com.sencha.gxt.core.client.ValueProvider; -import com.sencha.gxt.data.shared.LabelProvider; -import com.sencha.gxt.data.shared.ModelKeyProvider; -import com.sencha.gxt.data.shared.PropertyAccess; - -public interface UserSettingsProperties extends PropertyAccess { - - ModelKeyProvider id(); - - ValueProvider speedUnit(); - - public static class SpeedUnitLabelProvider implements LabelProvider { - - @Override - public String getLabel(SpeedUnit item) { - switch (item) { - case kilometersPerHour: - return "km/h"; - case knots: - return "knots"; - case milesPerHour: - return "mph"; - default: - return null; - } - } - - } - -} -- cgit v1.2.3