modules/core/domain/pom.xml | 61 --- modules/core/domain/src/main/java/org/rhq/core/RHQDomain.gwt.xml | 18 - modules/core/domain/src/main/java/org/rhq/core/client/RHQDomain.java | 31 - modules/core/domain/src/main/java/org/rhq/core/public/RHQDomain.css | 7 modules/core/domain/src/main/java/org/rhq/core/public/RHQDomain.html | 10 modules/core/domain/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java | 172 ---------- modules/enterprise/gui/coregui/pom.xml | 11 modules/enterprise/gui/coregui/src/main/java/org/rhq/core/RHQDomain.gwt.xml | 15 modules/enterprise/gui/coregui/src/main/java/org/rhq/core/client/RHQDomain.java | 31 + modules/enterprise/gui/coregui/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java | 172 ++++++++++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 2 modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopComponent.java | 2 12 files changed, 242 insertions(+), 290 deletions(-)
New commits: commit 26dfcd67680366513e1820bd18219a614437fb88 Author: Lukas Krejci lkrejci@redhat.com Date: Tue Oct 5 17:34:16 2010 +0200
Removing the dependency on GWT from the core/domain. The RHQDomain GWT module is now defined within the coregui and pulls the sources from the core/domain during the build.
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index 0806490..d033ae3 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -219,27 +219,6 @@ <version>2.8.1</version> <scope>test</scope> </dependency> - - - <dependency> - <groupId>com.google.gwt</groupId> - <artifactId>gwt-user</artifactId> - <version>2.0.3</version> - </dependency> - - <dependency> - <groupId>com.google.gwt</groupId> - <artifactId>gwt-dev</artifactId> - <version>2.0.3</version> - <scope>provided</scope> - </dependency> - - <!--<dependency> - <groupId>com.smartgwt</groupId> - <artifactId>smartgwt</artifactId> - <version>2.0</version> - </dependency>--> - </dependencies>
<build> @@ -265,32 +244,20 @@
<plugins>
- <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>gwt-maven-plugin</artifactId> - <version>1.2</version> - - <configuration> - <noServer>true</noServer> - <inplace>false</inplace> - <logLevel>INFO</logLevel> - <extraJvmArgs>-Xmx512m</extraJvmArgs> - <localWorkers>2</localWorkers> - <draftCompile>true</draftCompile> - <buildOutputDirectory>target/gwtclasses</buildOutputDirectory> - <hostedWebapp>target/hostedwar</hostedWebapp> - <debugSuspend>false</debugSuspend> - </configuration> - - <executions> - <execution> - <goals> - <goal>compile</goal> - </goals> - </execution> - </executions> - </plugin> - + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>2.1.2</version> + <executions> + <execution> + <id>attach-sources</id> + <phase>verify</phase> + <goals> + <goal>jar-no-fork</goal> + </goals> + </execution> + </executions> + </plugin>
<plugin> <artifactId>maven-surefire-plugin</artifactId> diff --git a/modules/core/domain/src/main/java/org/rhq/core/RHQDomain.gwt.xml b/modules/core/domain/src/main/java/org/rhq/core/RHQDomain.gwt.xml deleted file mode 100644 index a9a94a9..0000000 --- a/modules/core/domain/src/main/java/org/rhq/core/RHQDomain.gwt.xml +++ /dev/null @@ -1,18 +0,0 @@ -<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN" - "http://google-web-toolkit.googlecode.com/svn/releases/1.6/distro-source/core/src/gwt-module.dtd"> -<module> - - <inherits name='com.google.gwt.user.User'/> - - <entry-point class='org.rhq.core.client.RHQDomain'/> - - <source path="client"/> - <source path="domain"/> - - - <!--<generate-with class="org.rhq.core.rebind.RecordBuilderGenerator"> - <when-type-assignable class="org.rhq.core.domain.util.Recordizable"/> - </generate-with>--> - - -</module> \ No newline at end of file diff --git a/modules/core/domain/src/main/java/org/rhq/core/client/RHQDomain.java b/modules/core/domain/src/main/java/org/rhq/core/client/RHQDomain.java deleted file mode 100644 index 9669149..0000000 --- a/modules/core/domain/src/main/java/org/rhq/core/client/RHQDomain.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.rhq.core.client; - -import com.google.gwt.core.client.EntryPoint; -import com.google.gwt.user.client.ui.*; - -public class RHQDomain implements EntryPoint { - public void onModuleLoad() { - } -} diff --git a/modules/core/domain/src/main/java/org/rhq/core/public/RHQDomain.css b/modules/core/domain/src/main/java/org/rhq/core/public/RHQDomain.css deleted file mode 100644 index a111f82..0000000 --- a/modules/core/domain/src/main/java/org/rhq/core/public/RHQDomain.css +++ /dev/null @@ -1,7 +0,0 @@ -body { - background-color: white; - color: black; - font-family: Arial, sans-serif; - font-size: small; - margin: 8px; -} diff --git a/modules/core/domain/src/main/java/org/rhq/core/public/RHQDomain.html b/modules/core/domain/src/main/java/org/rhq/core/public/RHQDomain.html deleted file mode 100644 index 3878eb5..0000000 --- a/modules/core/domain/src/main/java/org/rhq/core/public/RHQDomain.html +++ /dev/null @@ -1,10 +0,0 @@ -<html> -<head> - <title>RHQDomain Application</title> - <link rel="stylesheet" href="RHQDomain.css"> -</head> -<body> -<script type="text/javascript" language="javascript" src="org.rhq.core.RHQDomain.nocache.js"></script> -<h1>RHQDomain Application</h1> -</body> -</html> diff --git a/modules/core/domain/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java b/modules/core/domain/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java deleted file mode 100644 index ca6a5ab..0000000 --- a/modules/core/domain/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.core.rebind; - -import com.google.gwt.core.ext.Generator; -import com.google.gwt.core.ext.GeneratorContext; -import com.google.gwt.core.ext.TreeLogger; -import com.google.gwt.core.ext.UnableToCompleteException; -import com.google.gwt.core.ext.typeinfo.JClassType; -import com.google.gwt.core.ext.typeinfo.JField; -import com.google.gwt.core.ext.typeinfo.NotFoundException; -import com.google.gwt.core.ext.typeinfo.TypeOracle; -import com.google.gwt.user.rebind.ClassSourceFileComposerFactory; -import com.google.gwt.user.rebind.SourceWriter; - -import javax.persistence.Entity; - -import java.io.PrintWriter; - - -/** - * This is the start to a rebinder for our domain entities to allow for the - * easy generation of Smart's Record objecgts. I have not yet gotten this working. - * - * - * @author Greg Hinkle - */ -public class RecordBuilderGenerator extends Generator { - - - - - protected TreeLogger logger; - private String packageName; - private String qualifiedStubClassName; - private JClassType requestedClass; - private String simpleStubClassName; - private SourceWriter sourceWriter; - private TypeOracle typeOracle; - - /** - * Create a new type that satisfies the rebind request. - */ - @Override - public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException { - - System.out.println("classType " + typeName); - - if (!init(logger, context, typeName)) { - return null; - } - - writeSource(); - sourceWriter.commit(logger); - - return qualifiedStubClassName; - } - - protected JClassType getRequestedClass() { - return requestedClass; - } - - protected SourceWriter getSourceWriter() { - return sourceWriter; - } - - protected TypeOracle getTypeOracle() { - return typeOracle; - } - - @SuppressWarnings("unused") - protected void writeSource() throws UnableToCompleteException { - - - - JField[] fields = requestedClass.getFields(); - - writeBuildRecordMethod(fields, sourceWriter); - } - - /** - * Gets the name of the native stub class. - */ - private String getSimpleStubClassName(JClassType baseClass) { - return "__" + baseClass.getSimpleSourceName() + "_RecordBuilder"; - } - - private SourceWriter getSourceWriter(TreeLogger logger, GeneratorContext ctx, - String packageName, String className, String superclassName) { - - PrintWriter printWriter = ctx.tryCreate(logger, packageName, className); - if (printWriter == null) { - return null; - } - - ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory( - packageName, className); - - composerFactory.setSuperclass(superclassName); - - return composerFactory.createSourceWriter(ctx, printWriter); - } - - private boolean init(TreeLogger logger, GeneratorContext context, - String typeName) throws UnableToCompleteException { - this.logger = logger; - typeOracle = context.getTypeOracle(); - assert typeOracle != null; - - try { - requestedClass = typeOracle.getType(typeName); - } catch (NotFoundException e) { - logger.log( - TreeLogger.ERROR, - "Could not find type '" - + typeName - + "'; please see the log, as this usually indicates a previous error ", - e); - throw new UnableToCompleteException(); - } - - if (requestedClass.getAnnotation(Entity.class) == null) { - System.out.println("Not an entity: " + typeName); - return false; - } - - System.out.println("$$$$$$$$Making a record builder for: "+ typeName); - - // Get the stub class name, and see if its source file exists. - // - simpleStubClassName = getSimpleStubClassName(requestedClass); - packageName = requestedClass.getPackage().getName(); - qualifiedStubClassName = packageName + "." + simpleStubClassName; - - sourceWriter = getSourceWriter(logger, context, packageName, - simpleStubClassName, requestedClass.getQualifiedSourceName()); - - return sourceWriter != null; - } - - private void writeBuildRecordMethod(JField[] fields, SourceWriter sw) { - sw.println(); - sw.println("protected final com.smartgwt.client.data.Record buildRecord(" + requestedClass.getQualifiedSourceName() + " entity) throws Throwable {"); - sw.indent(); - - sw.println("com.smartgwt.client.data.Record record = new com.smartgwt.client.data.Record();"); - - for (JField field :fields) { - sw.println("record.setAttribute("" + field.getName() + "", " + field.getName() + ");"); - } - sw.println("return record;"); - sw.outdent(); - sw.println("}"); - } - -} diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index 21dd681..c24aa4f 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -63,8 +63,7 @@ <scope>provided</scope> <!-- by rhq.ear --> </dependency> - - + <!-- =============== 3rd Party Deps =============== -->
<dependency> @@ -80,6 +79,13 @@ <scope>provided</scope> </dependency>
+ <dependency> + <groupId>com.google.gwt</groupId> + <artifactId>gwt-dev</artifactId> + <scope>provided</scope> + <version>${gwt.version}</version> + </dependency> + <!--<dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-incubator</artifactId> @@ -253,6 +259,7 @@ <debugSuspend>false</debugSuspend> <servicePattern>**/gwt/*GWTService.java</servicePattern> <i18nMessagesBundle>org.rhq.enterprise.gui.coregui.client.Messages</i18nMessagesBundle> + <compileSourcesArtifacts>org.rhq:rhq-core-domain</compileSourcesArtifacts> </configuration>
<executions> diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/RHQDomain.gwt.xml b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/RHQDomain.gwt.xml new file mode 100644 index 0000000..4d702c2 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/RHQDomain.gwt.xml @@ -0,0 +1,15 @@ +<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN" + "http://google-web-toolkit.googlecode.com/svn/releases/1.6/distro-source/core/src/gwt-module.dtd"> +<module> + <inherits name='com.google.gwt.user.User'/> + + <entry-point class='org.rhq.core.client.RHQDomain'/> + + <source path="client"/> + <source path="domain"/> + + <!--<generate-with class="org.rhq.core.rebind.RecordBuilderGenerator"> + <when-type-assignable class="org.rhq.core.domain.util.Recordizable"/> + </generate-with>--> + +</module> \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/client/RHQDomain.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/client/RHQDomain.java new file mode 100644 index 0000000..9669149 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/client/RHQDomain.java @@ -0,0 +1,31 @@ +/* + * RHQ Management Platform + * Copyright (C) 2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.core.client; + +import com.google.gwt.core.client.EntryPoint; +import com.google.gwt.user.client.ui.*; + +public class RHQDomain implements EntryPoint { + public void onModuleLoad() { + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java new file mode 100644 index 0000000..ca6a5ab --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java @@ -0,0 +1,172 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.core.rebind; + +import com.google.gwt.core.ext.Generator; +import com.google.gwt.core.ext.GeneratorContext; +import com.google.gwt.core.ext.TreeLogger; +import com.google.gwt.core.ext.UnableToCompleteException; +import com.google.gwt.core.ext.typeinfo.JClassType; +import com.google.gwt.core.ext.typeinfo.JField; +import com.google.gwt.core.ext.typeinfo.NotFoundException; +import com.google.gwt.core.ext.typeinfo.TypeOracle; +import com.google.gwt.user.rebind.ClassSourceFileComposerFactory; +import com.google.gwt.user.rebind.SourceWriter; + +import javax.persistence.Entity; + +import java.io.PrintWriter; + + +/** + * This is the start to a rebinder for our domain entities to allow for the + * easy generation of Smart's Record objecgts. I have not yet gotten this working. + * + * + * @author Greg Hinkle + */ +public class RecordBuilderGenerator extends Generator { + + + + + protected TreeLogger logger; + private String packageName; + private String qualifiedStubClassName; + private JClassType requestedClass; + private String simpleStubClassName; + private SourceWriter sourceWriter; + private TypeOracle typeOracle; + + /** + * Create a new type that satisfies the rebind request. + */ + @Override + public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException { + + System.out.println("classType " + typeName); + + if (!init(logger, context, typeName)) { + return null; + } + + writeSource(); + sourceWriter.commit(logger); + + return qualifiedStubClassName; + } + + protected JClassType getRequestedClass() { + return requestedClass; + } + + protected SourceWriter getSourceWriter() { + return sourceWriter; + } + + protected TypeOracle getTypeOracle() { + return typeOracle; + } + + @SuppressWarnings("unused") + protected void writeSource() throws UnableToCompleteException { + + + + JField[] fields = requestedClass.getFields(); + + writeBuildRecordMethod(fields, sourceWriter); + } + + /** + * Gets the name of the native stub class. + */ + private String getSimpleStubClassName(JClassType baseClass) { + return "__" + baseClass.getSimpleSourceName() + "_RecordBuilder"; + } + + private SourceWriter getSourceWriter(TreeLogger logger, GeneratorContext ctx, + String packageName, String className, String superclassName) { + + PrintWriter printWriter = ctx.tryCreate(logger, packageName, className); + if (printWriter == null) { + return null; + } + + ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory( + packageName, className); + + composerFactory.setSuperclass(superclassName); + + return composerFactory.createSourceWriter(ctx, printWriter); + } + + private boolean init(TreeLogger logger, GeneratorContext context, + String typeName) throws UnableToCompleteException { + this.logger = logger; + typeOracle = context.getTypeOracle(); + assert typeOracle != null; + + try { + requestedClass = typeOracle.getType(typeName); + } catch (NotFoundException e) { + logger.log( + TreeLogger.ERROR, + "Could not find type '" + + typeName + + "'; please see the log, as this usually indicates a previous error ", + e); + throw new UnableToCompleteException(); + } + + if (requestedClass.getAnnotation(Entity.class) == null) { + System.out.println("Not an entity: " + typeName); + return false; + } + + System.out.println("$$$$$$$$Making a record builder for: "+ typeName); + + // Get the stub class name, and see if its source file exists. + // + simpleStubClassName = getSimpleStubClassName(requestedClass); + packageName = requestedClass.getPackage().getName(); + qualifiedStubClassName = packageName + "." + simpleStubClassName; + + sourceWriter = getSourceWriter(logger, context, packageName, + simpleStubClassName, requestedClass.getQualifiedSourceName()); + + return sourceWriter != null; + } + + private void writeBuildRecordMethod(JField[] fields, SourceWriter sw) { + sw.println(); + sw.println("protected final com.smartgwt.client.data.Record buildRecord(" + requestedClass.getQualifiedSourceName() + " entity) throws Throwable {"); + sw.indent(); + + sw.println("com.smartgwt.client.data.Record record = new com.smartgwt.client.data.Record();"); + + for (JField field :fields) { + sw.println("record.setAttribute("" + field.getName() + "", " + field.getName() + ");"); + } + sw.println("return record;"); + sw.outdent(); + sw.println("}"); + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index 040fc16..8096fcf 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@ -5,7 +5,7 @@
<inherits name='com.google.gwt.user.User'/> <inherits name='com.google.gwt.i18n.I18N'/> - <inherits name='org.rhq.core.RHQDomain'/> + <inherits name='org.rhq.core.RHQDomain'/>
<inherits name='com.smartgwt.SmartGwt' /> <inherits name="com.smartgwt.tools.SmartGwtTools"/> diff --git a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopComponent.java b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopComponent.java index a568de9..848d560 100644 --- a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopComponent.java +++ b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopComponent.java @@ -18,8 +18,6 @@ */ package org.rhq.plugins.hadoop;
-import com.google.gwt.user.client.ui.ResizeComposite; - import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; import org.rhq.core.pluginapi.inventory.ResourceComponent;
rhq-commits@lists.fedorahosted.org