Skip to content

Commit

Permalink
Merged all GWT modules into one because you can't cast the same jsint…
Browse files Browse the repository at this point in the history
…erop class across module boundaries in JS, merged manager:shared sub-project into model, moved manager:client to top-level client sub-project
  • Loading branch information
Christian Bauer committed Jan 8, 2018
1 parent f6e0b1b commit 97d9ed6
Show file tree
Hide file tree
Showing 1,584 changed files with 2,752 additions and 2,740 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ bower_components/
console/iOS/DerivedData console/iOS/DerivedData
console/iOS/Pods console/iOS/Pods


manager/client/src/main/webapp/gwt/ client/src/main/webapp/gwt/
manager/client/.externalToolBuilders/ client/.externalToolBuilders/
manager/.factorypath manager/.factorypath


# Ignore build/runtime only data # Ignore build/runtime only data
Expand Down
15 changes: 7 additions & 8 deletions manager/client/build.gradle → client/build.gradle
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
evaluationDependsOn(resolveProject(":manager:shared").path) evaluationDependsOn(resolveProject(":model").path)


apply plugin: "java" apply plugin: "java"
apply plugin: "distribution" apply plugin: "distribution"
Expand All @@ -9,7 +9,7 @@ configurations {


dependencies { dependencies {


compile resolveProject(":manager:shared") compile resolveProject(":model")


// TODO Deprecate this and remove all usages // TODO Deprecate this and remove all usages
compile "com.google.gwt:gwt-elemental:$gwtVersion" compile "com.google.gwt:gwt-elemental:$gwtVersion"
Expand Down Expand Up @@ -39,7 +39,6 @@ task compileGwt(dependsOn: classes, type: JavaExec) {
inputs.files(sourceSets.main.java.srcDirs).skipWhenEmpty() inputs.files(sourceSets.main.java.srcDirs).skipWhenEmpty()
inputs.dir sourceSets.main.output.resourcesDir inputs.dir sourceSets.main.output.resourcesDir
inputs.dir(resolveProject(":model").sourceSets.main.java.srcDirs[0]).skipWhenEmpty() inputs.dir(resolveProject(":model").sourceSets.main.java.srcDirs[0]).skipWhenEmpty()
inputs.dir(resolveProject(":manager:shared").sourceSets.main.java.srcDirs[0]).skipWhenEmpty()
outputs.dir gwtOutputDir outputs.dir gwtOutputDir


doFirst { doFirst {
Expand Down Expand Up @@ -89,13 +88,13 @@ task compileGwt(dependsOn: classes, type: JavaExec) {
*/ */


args = [ args = [
"org.openremote.components.Components", "org.openremote.manager.Manager", "org.openremote.app.App", // The production GWT modules "org.openremote.app.App", // The production GWT modules
"-war", gwtOutputDir, "-war", gwtOutputDir,
"-logLevel", "ERROR", "-logLevel", "ERROR",
"-localWorkers", "2", "-localWorkers", "2",
"-extra", gwtExtraDir, "-extra", gwtExtraDir,
"-generateJsInteropExports", "-generateJsInteropExports",
"-style", "PRETTY" "-style", "OBFUSCATED"
] ]
} }


Expand Down Expand Up @@ -136,15 +135,15 @@ task gwtSuperDev(dependsOn: classes, type: JavaExec) {
-X[no]closureFormattedOutput EXPERIMENTAL: Enables Javascript output suitable for post-compilation by Closure Compiler (defaults to OFF) -X[no]closureFormattedOutput EXPERIMENTAL: Enables Javascript output suitable for post-compilation by Closure Compiler (defaults to OFF)
*/ */
args = [ args = [
"org.openremote.components.Components", "org.openremote.manager.ManagerDev", "org.openremote.app.App", // Note: Different module for dev mode! "org.openremote.app.AppDev", // Note: Different module for dev mode!
"-workDir", gwtWorkDir, "-workDir", gwtWorkDir,
"-launcherDir", gwtLauncherDir, "-launcherDir", gwtLauncherDir,
"-src", resolveProject(":model").sourceSets.main.java.srcDirs[0], // Help code server detect source changes "-src", resolveProject(":model").sourceSets.main.java.srcDirs[0], // Help code server detect source changes
"-src", resolveProject(":manager:shared").sourceSets.main.java.srcDirs[0], // Help code server detect source changes
"-logLevel", "INFO", "-logLevel", "INFO",
"-noincremental", "-noincremental",
"-noprecompile", "-noprecompile",
"-generateJsInteropExports", "-generateJsInteropExports",
"-style", "PRETTY",
"-bindAddress", "0.0.0.0" // Careful! The code server listens on all interfaces!, "-bindAddress", "0.0.0.0" // Careful! The code server listens on all interfaces!,


] ]
Expand All @@ -153,7 +152,7 @@ task gwtSuperDev(dependsOn: classes, type: JavaExec) {
} }


installDist { installDist {
dependsOn resolveTask(":manager:client:src:main:webapp:installDist") dependsOn resolveTask(":client:src:main:webapp:installDist")
} }


distributions { distributions {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
/* /*
* Copyright 2016, OpenRemote Inc. * Copyright 2017, OpenRemote Inc.
* *
* See the CONTRIBUTORS.txt file in the distribution for a * See the CONTRIBUTORS.txt file in the distribution for a
* full listing of individual contributors. * full listing of individual contributors.
Expand All @@ -17,22 +17,34 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.openremote.manager.client; package org.openremote.app.client;


import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;


import java.util.logging.Logger; import java.util.logging.Logger;


public class ManagerEntryPoint implements com.google.gwt.core.client.EntryPoint { public class AppEntryPoint implements com.google.gwt.core.client.EntryPoint {


private static final Logger LOG = Logger.getLogger(ManagerEntryPoint.class.getName()); private static final Logger LOG = Logger.getLogger(AppEntryPoint.class.getName());


protected final ManagerGinjector injector = GWT.create(ManagerGinjector.class); protected final ManagerGinjector injector = GWT.create(ManagerGinjector.class);


@Override @Override
public void onModuleLoad() { public void onModuleLoad() {
LOG.info("Manager GWT entry point"); LOG.info("App GWT module loaded");
dispatchLoadedEvent();
}

protected void startManager() {
injector.getAppController().start(); injector.getAppController().start();
} }


public native void dispatchLoadedEvent() /*-{
$wnd.addEventListener("StartManager", function() {
this.@org.openremote.app.client.AppEntryPoint::startManager()();
}.bind(this));
$wnd.dispatchEvent(new CustomEvent("AppLoaded"));
}-*/;

} }
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,11 @@
package org.openremote.components.client; package org.openremote.app.client;


import jsinterop.annotations.JsPackage; import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty; import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType; import jsinterop.annotations.JsType;
import org.openremote.model.http.RequestParams; import org.openremote.model.http.RequestParams;
import org.openremote.model.interop.Consumer;
import org.openremote.model.interop.Runnable;


/** /**
* The singleton of {@code <or-app-security>}. * The singleton of {@code <or-app-security>}.
Expand All @@ -19,8 +21,8 @@ public interface AppSecurity {


String getFullName(); String getFullName();


@JsProperty(name = "tenant") @JsProperty
String getAuthenticatedRealm(); String getRealm();


void logout(); void logout();


Expand All @@ -34,8 +36,14 @@ public interface AppSecurity {


boolean isUserTenantAdminEnabled(); boolean isUserTenantAdminEnabled();


void setCredentialsOnRequestParams(RequestParams requestParams); /**
* Sets credentials on request params, this can happen asynchronously.
*/
void authorizeRequestParams(RequestParams requestParams, Runnable onComplete);


String setCredentialsOnUrl(String serviceUrl); /**
* Sets credentials on URL, this can happen asynchronously.
*/
void authorizeUrl(String serviceUrl, Consumer<String> onComplete);


} }
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,25 +17,23 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.openremote.manager.client; package org.openremote.app.client;


import com.google.gwt.place.shared.PlaceController; import com.google.gwt.place.shared.PlaceController;
import com.google.gwt.place.shared.PlaceHistoryMapper; import com.google.gwt.place.shared.PlaceHistoryMapper;
import org.openremote.components.client.AppSecurity; import org.openremote.app.client.OpenRemoteApp;
import org.openremote.components.client.style.WidgetStyle; import org.openremote.app.client.style.WidgetStyle;
import org.openremote.manager.client.i18n.ManagerMessages; import org.openremote.app.client.i18n.ManagerMessages;
import org.openremote.manager.client.service.EventService; import org.openremote.app.client.service.EventService;
import org.openremote.model.event.bus.EventBus; import org.openremote.model.event.bus.EventBus;
import org.openremote.components.client.rest.RequestService;


/** /**
* Bundle all typically needed dependencies of activities/presenters, so * Bundle all typically needed dependencies of activities/presenters, so
* only one thing can be injected into constructors. * only one thing can be injected into constructors.
*/ */
public interface Environment { public interface Environment {


static Environment create(AppSecurity appSecurity, static Environment create(OpenRemoteApp app,
RequestService requestService,
EventService eventService, EventService eventService,
PlaceController placeController, PlaceController placeController,
PlaceHistoryMapper placeHistoryMapper, PlaceHistoryMapper placeHistoryMapper,
Expand All @@ -45,13 +43,8 @@ static Environment create(AppSecurity appSecurity,
return new Environment() { return new Environment() {


@Override @Override
public AppSecurity getAppSecurity() { public OpenRemoteApp getApp() {
return appSecurity; return app;
}

@Override
public RequestService getRequestService() {
return requestService;
} }


@Override @Override
Expand Down Expand Up @@ -86,9 +79,7 @@ public WidgetStyle getWidgetStyle() {
}; };
} }


AppSecurity getAppSecurity(); OpenRemoteApp getApp();

RequestService getRequestService();


PlaceController getPlaceController(); PlaceController getPlaceController();


Expand Down
Loading

0 comments on commit 97d9ed6

Please sign in to comment.