Skip to content

Commit

Permalink
Integration of Uberfire 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
manstis committed Jul 16, 2013
1 parent 577bea1 commit d095d9e
Show file tree
Hide file tree
Showing 23 changed files with 468 additions and 107 deletions.
Expand Up @@ -18,6 +18,7 @@

import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.enterprise.inject.Produces;
import javax.inject.Singleton;
Expand All @@ -34,18 +35,41 @@ public class IdentityFactory {
public void onStartup() {
identity = new Identity() {

@Override
public String getName() {
return "jcr2vfs-migration";
}

@Override
public List<Role> getRoles() {
return Collections.emptyList();
}

@Override
public boolean hasRole( Role role ) {
return true;
}

@Override
public Map<String, String> getProperties() {
return Collections.emptyMap();
}

@Override
public void aggregateProperty( String name,
String value ) {
}

@Override
public void removeProperty( String name ) {
}

@Override
public String getProperty( String name,
String defaultValue ) {
return null;
}

};
}

Expand Down
Expand Up @@ -25,6 +25,7 @@
import javax.inject.Singleton;
import java.util.Collections;
import java.util.List;
import java.util.Map;

@Singleton
@Alternative
Expand All @@ -36,18 +37,41 @@ public class TestIdentityFactory {
public void onStartup() {
identity = new Identity() {

@Override
public String getName() {
return "jcr2vfs-migration";
return "userName";
}

@Override
public List<Role> getRoles() {
return Collections.emptyList();
}

@Override
public boolean hasRole( Role role ) {
return true;
}

@Override
public Map<String, String> getProperties() {
return Collections.emptyMap();
}

@Override
public void aggregateProperty( String name,
String value ) {
}

@Override
public void removeProperty( String name ) {
}

@Override
public String getProperty( String name,
String defaultValue ) {
return null;
}

};
}

Expand Down
Expand Up @@ -16,14 +16,15 @@

package org.drools.workbench.screens.drltext.backend.server;

import org.uberfire.security.Identity;
import org.uberfire.security.Role;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.enterprise.inject.Produces;
import javax.inject.Singleton;
import java.util.Collections;
import java.util.List;

import org.uberfire.security.Identity;
import org.uberfire.security.Role;

@Singleton
public class TestIdentityFactory {
Expand All @@ -34,18 +35,41 @@ public class TestIdentityFactory {
public void onStartup() {
identity = new Identity() {

@Override
public String getName() {
return "jcr2vfs-migration";
return "userName";
}

@Override
public List<Role> getRoles() {
return Collections.emptyList();
}

@Override
public boolean hasRole( Role role ) {
return true;
}

@Override
public Map<String, String> getProperties() {
return Collections.emptyMap();
}

@Override
public void aggregateProperty( String name,
String value ) {
}

@Override
public void removeProperty( String name ) {
}

@Override
public String getProperty( String name,
String defaultValue ) {
return null;
}

};
}

Expand Down
Expand Up @@ -16,14 +16,15 @@

package org.drools.workbench.screens.dtablexls.backend.server;

import org.uberfire.security.Identity;
import org.uberfire.security.Role;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.enterprise.inject.Produces;
import javax.inject.Singleton;
import java.util.Collections;
import java.util.List;

import org.uberfire.security.Identity;
import org.uberfire.security.Role;

@Singleton
public class TestIdentityFactory {
Expand All @@ -34,18 +35,41 @@ public class TestIdentityFactory {
public void onStartup() {
identity = new Identity() {

@Override
public String getName() {
return "jcr2vfs-migration";
return "userName";
}

@Override
public List<Role> getRoles() {
return Collections.emptyList();
}

@Override
public boolean hasRole( Role role ) {
return true;
}

@Override
public Map<String, String> getProperties() {
return Collections.emptyMap();
}

@Override
public void aggregateProperty( String name,
String value ) {
}

@Override
public void removeProperty( String name ) {
}

@Override
public String getProperty( String name,
String defaultValue ) {
return null;
}

};
}

Expand Down
10 changes: 8 additions & 2 deletions drools-wb-webapp/pom.xml
Expand Up @@ -394,6 +394,11 @@
</dependency>

<!-- UberFire -->
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-js</artifactId>
</dependency>

<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-security-api</artifactId>
Expand Down Expand Up @@ -577,7 +582,7 @@
<artifactId>gwt-maven-plugin</artifactId>
<configuration>
<module>org.drools.workbench.FastCompiledDroolsWorkbench</module>
<logLevel>INFO</logLevel>
<logLevel>DEBUG</logLevel>
<compileSourcesArtifacts>

<!-- Guvnor -->
Expand Down Expand Up @@ -655,6 +660,7 @@
<compileSourcesArtifact>org.kie.commons:kie-nio2-model</compileSourcesArtifact>

<!-- UberFire -->
<compileSourcesArtifact>org.uberfire:uberfire-js</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-security-api</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-security-client</compileSourcesArtifact>
<compileSourcesArtifact>org.uberfire:uberfire-client-api</compileSourcesArtifact>
Expand All @@ -664,7 +670,7 @@

</compileSourcesArtifacts>
<runTarget>org.drools.workbench.DroolsWorkbench/DroolsWorkbench.html</runTarget>
<extraJvmArgs>-Xmx2048m -XX:MaxPermSize=256m</extraJvmArgs>
<extraJvmArgs>-Xmx2048m -XX:MaxPermSize=256m -Xss1M</extraJvmArgs>
<!--<logLevel>DEBUG</logLevel>-->
<server>org.jboss.errai.cdi.server.gwt.JettyLauncher</server>
<!-- drools-compiler has dependency on org.eclipse.jdt.core.compiler:ecj:jar:3.5.1:compile, see http://code.google.com/p/google-web-toolkit/issues/detail?id=4479 -->
Expand Down
Expand Up @@ -137,7 +137,7 @@ public void execute( final String term ) {
.endMenu()
.build();

menubar.aggregateWorkbenchMenus( menus );
menubar.addMenus( menus );
}

private List<MenuItem> getPerspectives() {
Expand Down
@@ -0,0 +1,29 @@
package org.drools.workbench.client.navbar;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import org.uberfire.client.workbench.Header;
import org.uberfire.client.workbench.widgets.menu.WorkbenchMenuBarPresenter;

import static java.lang.Integer.*;

@ApplicationScoped
public class AppNavBar
extends Composite implements Header {

@Inject
private WorkbenchMenuBarPresenter menuBarPresenter;

@Override
public Widget asWidget() {
return menuBarPresenter.getView().asWidget();
}

@Override
public int getOrder() {
return 0;
}
}
@@ -0,0 +1,48 @@
/*
* Copyright 2012 JBoss Inc
*
* 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.drools.workbench.client.navbar;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Widget;
import org.uberfire.client.workbench.Header;

import static java.lang.Integer.*;

@ApplicationScoped
public class ComplementNavAreaPresenter implements Header {

public interface View extends IsWidget {

}

@Inject
public View view;

@Override
public int getOrder() {
return MAX_VALUE;
}

@Override
public Widget asWidget() {
return view.asWidget();
}

}

0 comments on commit d095d9e

Please sign in to comment.