Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AF-1987: Create a client side version of all appformer gwt startup services #724

Merged
merged 9 commits into from
Jul 17, 2019
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
</exclusion>
</exclusions>
</dependency>

</dependencies>

</project>
8 changes: 7 additions & 1 deletion dashbuilder/dashbuilder-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@
<artifactId>uberfire-preferences-client</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-preferences-client-backend</artifactId>
<scope>provided</scope>
</dependency>

<!-- UberFire Security (Extension) -->
<dependency>
Expand All @@ -377,7 +382,7 @@
</dependency>
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-security-client</artifactId>
<artifactId>uberfire-security-client-backend</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -742,6 +747,7 @@
<compileSourcesArtifact>org.uberfire:uberfire-widgets-properties-editor-client</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-simple-docks-client</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-preferences-api</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-preferences-client-backend</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-preferences-client</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-preferences-ui-client</compileSourcesArtifact>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public Set<DashboardPerspectiveActivity> getDashboards() {
for (String activityId : activityBeansCache.getActivitiesById()) {

SyncBeanDef<Activity> activityDef = activityBeansCache.getActivity(activityId);
if (activityDef.getBeanClass().equals(DashboardPerspectiveActivity.class)) {
if (activityDef != null && activityDef.getBeanClass().equals(DashboardPerspectiveActivity.class)) {
activities.add((DashboardPerspectiveActivity) activityDef.getInstance());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ errai.marshalling.serializableTypes=org.dashbuilder.dataprovider.StaticProviderT
org.dashbuilder.dataset.sort.ColumnSort \
org.dashbuilder.dataset.sort.DataSetSort \
org.dashbuilder.dataset.sort.SortedList

32 changes: 32 additions & 0 deletions uberfire-api/src/main/java/org/uberfire/lifecycle/GetContent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
* 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.uberfire.lifecycle;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Use in method that returns a {@code @WorkbenchClientEditor} content.
*/
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface GetContent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add JavaDoc for this annotation?


}
32 changes: 32 additions & 0 deletions uberfire-api/src/main/java/org/uberfire/lifecycle/SetContent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
* 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.uberfire.lifecycle;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Use in method that sets a {@code @WorkbenchClientEditor} content.
*/
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface SetContent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add JavaDoc for this annotation?


}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public enum ActivityResourceType implements ResourceType {
PERSPECTIVE,
SCREEN,
EDITOR,
CLIENT_EDITOR,
POPUP,
SPLASH;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-security-client</artifactId>
<artifactId>uberfire-security-client-backend</artifactId>
<scope>provided</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
* 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.uberfire.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
*
* This annotation works like {@code @WorkbenchEditor}, and should be used for client side only editors.
*
* Classes annotated with this are considered WorkbenchParts that perform some
* "editor" function for the specified file-type.
* <p>
* At its simplest form the Class should implement
* {@code com.google.gwt.user.client.ui.IsWidget} (e.g. extend
* {@code com.google.gwt.user.client.ui.Composite}) and provide a method
* annotated with {@code @WorkbenchPartTitle}.
* </p>
* <p>
* Developers wishing to separate view from logic (perhaps by implementing the
* MVP pattern) can further provide a zero-argument method annotated with
* {@code @WorkbenchPartView} with return type
* {@code com.google.gwt.user.client.ui.IsWidget}.
* </p>
* <p>
* In this latter case the {@code @WorkbenchEditor} need not implement
* {@code com.google.gwt.user.client.ui.IsWidget}.
* </p>
* <p>
* WorkbechEditors can receive the following life-cycle calls:
* <ul>
* <li>{@code @OnStartup(org.drools.guvnor.vfs.Path)}</li>
* <li>{@code @OnOpen}</li>
* <li>{@code @OnFocus}</li>
* <li>{@code @OnLostFocus}</li>
* <li>{@code @OnMayClose}</li>
* <li>{@code @OnClose}</li>
* </p>
*/
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface WorkbenchClientEditor {

/**
* Identifier that should be unique within application.
*/
String identifier();

}
4 changes: 2 additions & 2 deletions uberfire-distro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
</dependency>
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-security-client</artifactId>
<artifactId>uberfire-security-client-backend</artifactId>
</dependency>
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-security-client</artifactId>
<artifactId>uberfire-security-client-backend</artifactId>
<classifier>sources</classifier>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!---->
<!--<inherits name="org.uberfire.UberfireClientAPI"/>-->
<!---->
<inherits name="org.uberfire.preferences.UberfirePreferencesClient"/>
<inherits name="org.uberfire.preferences.UberfirePreferencesClientBackend"/>

<!--<inherits name="org.uberfire.ext.preferences.UberfirePreferencesAPI"/>-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-security-client-backend</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-workbench-client</artifactId>
Expand Down
26 changes: 25 additions & 1 deletion uberfire-extensions/uberfire-wires/uberfire-wires-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@

<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-security-client</artifactId>
<artifactId>uberfire-security-client-backend</artifactId>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -367,6 +367,11 @@
<artifactId>uberfire-preferences-client</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-preferences-client-backend</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-preferences-processors</artifactId>
Expand Down Expand Up @@ -494,6 +499,20 @@
<artifactId>gwtbootstrap3</artifactId>
</dependency>

<!-- Uberfire SSH -->
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-ssh-api</artifactId>
</dependency>
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-ssh-client</artifactId>
</dependency>
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-ssh-backend</artifactId>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -537,6 +556,7 @@
<!-- UF-ext -->
<compileSourcesArtifact>org.uberfire:uberfire-preferences-api</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-preferences-client</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-preferences-client-backend</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-preferences-ui-client</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-runtime-plugins-api</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-runtime-plugins-client</compileSourcesArtifact>
Expand Down Expand Up @@ -566,6 +586,10 @@
<!-- Uberfire Experimentals -->
<compileSourcesArtifact>org.uberfire:uberfire-experimental-api</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-experimental-client</compileSourcesArtifact>

<compileSourcesArtifact>org.uberfire:uberfire-ssh-client</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-ssh-api</compileSourcesArtifact>

</compileSourcesArtifacts>
</configuration>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
<inherits name="org.uberfire.experimental.UberfireExperimentalAPI"/>
<inherits name="org.uberfire.experimental.UberfireExperimentalClient"/>

<inherits name="org.uberfire.ssh.UberfireSSHClient"/>

<!-- Specify the application specific style sheet. -->
<set-property name="user.agent" value="safari"/>
<stylesheet src='css/uberfire-showcase.css'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import javax.enterprise.context.ApplicationScoped;

import org.jboss.errai.common.client.dom.HTMLElement;
import org.jboss.errai.ioc.client.container.IOC;
import org.jboss.errai.ioc.client.container.SyncBeanManager;
import org.uberfire.client.mvp.PlaceManager;
Expand All @@ -32,12 +33,20 @@ public static void goTo(final String place) {
placeManager.goTo(new DefaultPlaceRequest(place));
}

public static void goTo(final String place,
final HTMLElement element) {
final SyncBeanManager beanManager = IOC.getBeanManager();
final PlaceManager placeManager = beanManager.lookupBean(PlaceManager.class).getInstance();
placeManager.goTo(place, element);
}

@Override
public void export() {
publish();
}

private native void publish() /*-{
$wnd.$goToPlace = @org.uberfire.client.exporter.PlaceManagerJSExporter::goTo(Ljava/lang/String;);
$wnd.$goToScreen = @org.uberfire.client.exporter.PlaceManagerJSExporter::goTo(Ljava/lang/String;Lorg/jboss/errai/common/client/dom/HTMLElement;);
}-*/;
}
5 changes: 5 additions & 0 deletions uberfire-packaging/uberfire-client-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
<artifactId>uberfire-backend-api</artifactId>
</dependency>

<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-security-client-backend</artifactId>
</dependency>

<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-workbench-client-backend</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@

<inherits name="org.uberfire.UberfireBackend"/>
<inherits name="org.uberfire.UberfireWorkbenchBackend"/>
<inherits name="org.uberfire.security.UberfireSecurityClientBackend" />

</module>
1 change: 1 addition & 0 deletions uberfire-preferences/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
<module>uberfire-preferences-backend</module>
<module>uberfire-preferences-client</module>
<module>uberfire-preferences-processors</module>
<module>uberfire-preferences-client-backend</module>
</modules>
</project>