JBoss Tools SVN: r22416 - in trunk/jst/tests/org.jboss.tools.jst.text.ext.test: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-05-28 15:17:47 -0400 (Fri, 28 May 2010)
New Revision: 22416
Added:
trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/JsfExtAllTests.java
Removed:
trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/CommonExtAllTests.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.text.ext.test/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.text.ext.test/build.properties
trunk/jst/tests/org.jboss.tools.jst.text.ext.test/pom.xml
Log:
https://jira.jboss.org/browse/JBDS-1202 problems running tests
fixed:
- manifest errors
- project import errors
this tests should be moved to jsf component to work under tycho
Modified: trunk/jst/tests/org.jboss.tools.jst.text.ext.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.text.ext.test/META-INF/MANIFEST.MF 2010-05-28 16:15:05 UTC (rev 22415)
+++ trunk/jst/tests/org.jboss.tools.jst.text.ext.test/META-INF/MANIFEST.MF 2010-05-28 19:17:47 UTC (rev 22416)
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.jboss.tools.jsp.text.ext.test
+Bundle-SymbolicName: org.jboss.tools.jst.text.ext.test
Bundle-Version: 3.1.0.qualifier
Require-Bundle: org.jboss.tools.common.text.ext,
org.junit,
@@ -15,7 +15,6 @@
org.eclipse.jface.text,
org.jboss.tools.common.model.ui
Export-Package: org.jboss.tools.jst.text.ext.test
-Bundle-ClassPath: common-text-ext-test.jar
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/jst/tests/org.jboss.tools.jst.text.ext.test/build.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.text.ext.test/build.properties 2010-05-28 16:15:05 UTC (rev 22415)
+++ trunk/jst/tests/org.jboss.tools.jst.text.ext.test/build.properties 2010-05-28 19:17:47 UTC (rev 22416)
@@ -1,10 +1,15 @@
-output.. = bin/
-bin.includes = META-INF/,\
- projects/,\
- common-text-ext-test.jar,\
- plugin.properties
-source.common-text-ext-test.jar = src/
+bin.includes = projects/,\
+ META-INF/,\
+ plugin.properties,\
+ .
src.includes = projects/,\
src/,\
+ plugin.properties,\
+ build.properties,\
META-INF/,\
- build.properties
+ .project,\
+ .classpath
+source.. = src/
+jars.compile.order = .
+source.. = src/
+output.. = bin/
Modified: trunk/jst/tests/org.jboss.tools.jst.text.ext.test/pom.xml
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.text.ext.test/pom.xml 2010-05-28 16:15:05 UTC (rev 22415)
+++ trunk/jst/tests/org.jboss.tools.jst.text.ext.test/pom.xml 2010-05-28 19:17:47 UTC (rev 22416)
@@ -8,7 +8,7 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.jsp.text.ext.test</artifactId>
+ <artifactId>org.jboss.tools.jst.text.ext.test</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
</project>
Deleted: trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/CommonExtAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/CommonExtAllTests.java 2010-05-28 16:15:05 UTC (rev 22415)
+++ trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/CommonExtAllTests.java 2010-05-28 19:17:47 UTC (rev 22416)
@@ -1,22 +0,0 @@
-package org.jboss.tools.jst.text.ext.test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.jboss.tools.test.util.ProjectImportTestSetup;
-
-
-public class CommonExtAllTests {
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for default package");
- //$JUnit-BEGIN$
-
- suite.addTest(new ProjectImportTestSetup(new TestSuite(OpenOnsTest.class),
- "org.jboss.tools.common.text.ext.test",
- new String[]{"projects/HiperlinksTestProject"},
- new String[]{"HiperlinksTestProject"}));
-
- //$JUnit-END$
- return suite;
- }
-}
Copied: trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/JsfExtAllTests.java (from rev 22415, trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/CommonExtAllTests.java)
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/JsfExtAllTests.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/JsfExtAllTests.java 2010-05-28 19:17:47 UTC (rev 22416)
@@ -0,0 +1,22 @@
+package org.jboss.tools.jst.text.ext.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
+
+public class JsfExtAllTests {
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for default package");
+ //$JUnit-BEGIN$
+
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(OpenOnsTest.class),
+ "org.jboss.tools.jst.text.ext.test",
+ new String[]{"projects/HiperlinksTestProject"},
+ new String[]{"HiperlinksTestProject"}));
+
+ //$JUnit-END$
+ return suite;
+ }
+}
Property changes on: trunk/jst/tests/org.jboss.tools.jst.text.ext.test/src/org/jboss/tools/jst/text/ext/test/JsfExtAllTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 7 months
JBoss Tools SVN: r22415 - in trunk: product and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-28 12:15:05 -0400 (Fri, 28 May 2010)
New Revision: 22415
Added:
trunk/product/
trunk/product/jbds4.product
trunk/product/pom.xml
trunk/product/product-pom.xml
Log:
initial commit of product build using tycho (incomplete; fails to find jbt examples plugin)
Added: trunk/product/jbds4.product
===================================================================
--- trunk/product/jbds4.product (rev 0)
+++ trunk/product/jbds4.product 2010-05-28 16:15:05 UTC (rev 22415)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="JBoss Developer Studio" uid="com.jboss.developer.studio" id="org.eclipse.platform.ide" application="org.eclipse.ui.ide.workbench" version="4.0.0.qualifier" useFeatures="true" includeLaunchers="true">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+ </launcherArgs>
+
+ <windowImages/>
+
+ <launcher name="jbds">
+ <solaris/>
+ <win useIco="false">
+ <bmp/>
+ </win>
+ </launcher>
+
+ <vm>
+ <linux>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</linux>
+ <macos>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</macos>
+ <solaris>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</solaris>
+ <windows>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</windows>
+ </vm>
+
+ <plugins>
+ </plugins>
+
+ <features>
+ <feature id="org.jboss.tools.xulrunner.feature" version="1.9.1.2_v201003050540R"/>
+ <feature id="org.eclipse.rcp" version="3.6.0.v20100201-9GAcFGCFq7Lo_y4ElaEbOXNc"/>
+ <feature id="org.eclipse.pde" version="3.6.0.v20090930-7b7kFHlFEx2XkxZQja7HFJ3"/>
+ <feature id="org.eclipse.jdt" version="3.6.0.v20100308-1800-7z8XFRBFMTdeDrqFpIInkeg45027"/>
+ </features>
+
+
+</product>
Added: trunk/product/pom.xml
===================================================================
--- trunk/product/pom.xml (rev 0)
+++ trunk/product/pom.xml 2010-05-28 16:15:05 UTC (rev 22415)
@@ -0,0 +1,19 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>product</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <modules>
+ <module>features</module>
+ <module>plugins</module>
+ </modules>
+</project>
+
\ No newline at end of file
Added: trunk/product/product-pom.xml
===================================================================
--- trunk/product/product-pom.xml (rev 0)
+++ trunk/product/product-pom.xml 2010-05-28 16:15:05 UTC (rev 22415)
@@ -0,0 +1,85 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <!--
+ First, build the JBT plugins:
+ cd ~/trunk; mvn clean install
+ or
+ cd ~/trunk; ant
+
+ Next, run this to create RCP product from available plugins + .product definition file
+ cd ~/trunk/build; mvn clean package
+
+
+[Software being installed: com.jboss.jbds.project.examples 3.0.0.qualifier, Missing requirement: com.jboss.jbds.project.examples 3.0.0.qualifier requires 'bundle org.jboss.tools.project.examples 0.0.0' but it could not be found]
+
+ -->
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>product</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+
+ <!-- FIXME: should this be eclipse-plugin or pom? Move .product file into com.jboss.jbds.product plugin? -->
+ <packaging>pom</packaging>
+ <modules>
+ <module>plugins</module>
+ <module>features</module>
+ </modules>
+ <build>
+ <finalName>${project.artifactId}_${project.version}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-packaging-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <id>product-export</id>
+ <goals>
+ <goal>product-export</goal>
+ </goals>
+ <configuration>
+ <productConfigurationFile>jbds4.product
+ </productConfigurationFile>
+ <environments>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>macosx</os>
+ <ws>carbon</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86_64</arch>
+ </environment>
+ </environments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
14 years, 7 months
JBoss Tools SVN: r22414 - branches/3.2.helios/esb/tests/org.jboss.tools.esb.project.core.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-05-28 12:08:44 -0400 (Fri, 28 May 2010)
New Revision: 22414
Modified:
branches/3.2.helios/esb/tests/org.jboss.tools.esb.project.core.test/META-INF/MANIFEST.MF
Log:
ESB manifest errors in 3.2.helios
Modified: branches/3.2.helios/esb/tests/org.jboss.tools.esb.project.core.test/META-INF/MANIFEST.MF
===================================================================
--- branches/3.2.helios/esb/tests/org.jboss.tools.esb.project.core.test/META-INF/MANIFEST.MF 2010-05-28 15:50:37 UTC (rev 22413)
+++ branches/3.2.helios/esb/tests/org.jboss.tools.esb.project.core.test/META-INF/MANIFEST.MF 2010-05-28 16:08:44 UTC (rev 22414)
@@ -6,13 +6,11 @@
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.junit;bundle-version="3.8.2",
- org.jboss.tools.tests,
org.jboss.tools.esb.project.core;bundle-version="1.0.0",
org.eclipse.wst.common.project.facet.core;bundle-version="1.4.0",
org.eclipse.wst.server.core;bundle-version="1.1.101",
org.eclipse.core.resources;bundle-version="3.5.0",
org.eclipse.core.runtime;bundle-version="3.5.0",
- org.jboss.tools.common.test;bundle-version="2.0.0",
org.eclipse.jdt.core;bundle-version="3.5.0",
org.jboss.ide.eclipse.as.core;bundle-version="1.0.0",
org.eclipse.jdt.launching;bundle-version="3.5.0",
@@ -21,4 +19,5 @@
org.eclipse.jst.common.frameworks;bundle-version="1.1.300",
org.eclipse.core.commands;bundle-version="3.5.0",
org.eclipse.jst.j2ee;bundle-version="1.1.300",
- org.jboss.ide.eclipse.as.classpath.core;bundle-version="2.1.0"
+ org.jboss.ide.eclipse.as.classpath.core;bundle-version="2.1.0",
+ org.jboss.tools.tests;bundle-version="3.1.0"
14 years, 7 months
JBoss Tools SVN: r22413 - in trunk/cdi: plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-05-28 11:50:37 -0400 (Fri, 28 May 2010)
New Revision: 22413
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointListHyperlink.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6386
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-05-28 15:18:20 UTC (rev 22412)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-05-28 15:50:37 UTC (rev 22413)
@@ -77,7 +77,7 @@
* @param beans
* @param element
*/
- public static IInjectionPoint findInjectionPoint(Set<IBean> beans, IJavaElement element) {
+ public static IInjectionPoint findInjectionPoint(Set<IBean> beans, IJavaElement element, int position) {
if (!(element instanceof IField) && (element instanceof IMethod) && (element instanceof ILocalVariable)) {
return null;
}
@@ -86,17 +86,17 @@
Set<IInjectionPoint> injectionPoints = bean.getInjectionPoints();
for (IInjectionPoint iPoint : injectionPoints) {
if (element instanceof IField && iPoint instanceof IInjectionPointField) {
- if (((IInjectionPointField) iPoint).getField() != null && ((IInjectionPointField) iPoint).getField().equals(element)) {
+ if (((IInjectionPointField) iPoint).getField() != null && ((IInjectionPointField) iPoint).getField().equals(element))
return iPoint;
- }
- } else if (element instanceof IMethod && iPoint instanceof IInjectionPointMethod) {
- if (((IInjectionPointMethod) iPoint).getMethod() != null && ((IInjectionPointMethod) iPoint).getMethod().equals(element)) {
+ } else if (element instanceof IMethod && iPoint instanceof IInjectionPointMethod && position == 0) {
+ if (((IInjectionPointMethod) iPoint).getMethod() != null && ((IInjectionPointMethod) iPoint).getMethod().equals(element))
return iPoint;
- }
}else if(element instanceof ILocalVariable && iPoint instanceof IInjectionPointParameter){
- if (((IInjectionPointParameter) iPoint).getName().equals(element.getElementName())) {
+ if (((IInjectionPointParameter) iPoint).getName().equals(element.getElementName()))
return iPoint;
- }
+ }else if(iPoint instanceof IInjectionPointParameter && position != 0){
+ if(iPoint.getStartPosition() <= position && (iPoint.getStartPosition()+iPoint.getLength()) >= position)
+ return iPoint;
}
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2010-05-28 15:18:20 UTC (rev 22412)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2010-05-28 15:50:37 UTC (rev 22413)
@@ -11,18 +11,17 @@
package org.jboss.tools.cdi.text.ext.hyperlink;
import java.util.ArrayList;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IAnnotatable;
-import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.ICodeAssist;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.ILocalVariable;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.ResolvedBinaryType;
+import org.eclipse.jdt.internal.core.ResolvedSourceType;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
import org.eclipse.jdt.internal.ui.text.JavaWordFinder;
@@ -32,10 +31,13 @@
import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.ui.texteditor.ITextEditor;
-import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.CDIUtil;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.text.ext.CDIExtensionsPlugin;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
public class InjectedPointHyperlinkDetector extends AbstractHyperlinkDetector{
@@ -72,8 +74,8 @@
if(file == null)
return null;
-
- if(CDICorePlugin.getCDI(file.getProject(), true) == null)
+ CDICoreNature cdiNature = CDICorePlugin.getCDI(file.getProject(), true);
+ if(cdiNature == null)
return null;
IJavaElement[] elements = null;
@@ -85,18 +87,20 @@
ArrayList<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
for (IJavaElement element : elements) {
-
- if(element instanceof IType){
- if(CDIConstants.INJECT_ANNOTATION_TYPE_NAME.equals(((IType) element).getFullyQualifiedName())){
- ICompilationUnit cUnit = (ICompilationUnit)input;
- element = cUnit.getElementAt(wordRegion.getOffset());
- if(element == null)
- continue;
+ int position = 0;
+ if(element instanceof ResolvedSourceType || element instanceof ResolvedBinaryType){
+ ICompilationUnit cUnit = (ICompilationUnit)input;
+ element = cUnit.getElementAt(wordRegion.getOffset());
+ if(element == null)
+ continue;
+
+ if(element instanceof IMethod){
+ position = offset;
}
}
- if(findAnnotation(element)){
- hyperlinks.add(new InjectedPointListHyperlink(file, textViewer, wordRegion, element, document));
+ if(findInjectedBeans(cdiNature, element, position, file)){
+ hyperlinks.add(new InjectedPointListHyperlink(file, textViewer, wordRegion, element, position, document));
}
}
@@ -109,42 +113,24 @@
return null;
}
- private IMember findMember(IJavaElement element){
- IJavaElement elem = element;
- while(elem != null){
- if(elem instanceof IMember)
- return (IMember)elem;
- elem = elem.getParent();
+ private boolean findInjectedBeans(CDICoreNature nature, IJavaElement element, int offset, IFile file){
+ ICDIProject cdiProject = nature.getDelegate();
+
+ if(cdiProject == null){
+ return false;
}
- return null;
- }
-
- private boolean findAnnotation(IJavaElement element){
- if(element instanceof IAnnotatable){
- IAnnotatable annotatable = (IAnnotatable) element;
- IType type = null;
- if(element instanceof IMember){
- type = ((IMember)element).getDeclaringType();
- try{
- IAnnotation[] annotations = annotatable.getAnnotations();
- for(IAnnotation annotation : annotations){
- if(annotation != null && annotation.getElementName() != null && CDIConstants.INJECT_ANNOTATION_TYPE_NAME.equals(EclipseJavaUtil.resolveType(type, annotation.getElementName())))
- return true;
- }
- }catch (JavaModelException jme) {
- CDIExtensionsPlugin.log(jme);
- }
- }else if(element instanceof ILocalVariable){
- IMember member = findMember(element);
- if(member == null)
- return false;
- type = member.getDeclaringType();
- return true;
- }
-
+
+ Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+
+ IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element, offset);
+ if(injectionPoint == null){
+ return false;
}
+
+ Set<IBean> resultBeanSet = cdiProject.getBeans(injectionPoint);
+ if(resultBeanSet.size() > 0)
+ return true;
+
return false;
-
}
-
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointListHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointListHyperlink.java 2010-05-28 15:18:20 UTC (rev 22412)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointListHyperlink.java 2010-05-28 15:50:37 UTC (rev 22413)
@@ -33,19 +33,20 @@
public class InjectedPointListHyperlink extends AbstractHyperlink{
private IFile file;
private IJavaElement element;
+ private int position;
private IRegion region;
private ITextViewer viewer;
private static MultipleHyperlinkPresenter mhp = new MultipleHyperlinkPresenter(new RGB(0, 0, 255));
private static boolean installed = false;
- public InjectedPointListHyperlink(IFile file, ITextViewer viewer, IRegion region, IJavaElement element, IDocument document){
+ public InjectedPointListHyperlink(IFile file, ITextViewer viewer, IRegion region, IJavaElement element, int position, IDocument document){
this.file = file;
this.element = element;
+ this.position = position;
this.region = region;
this.viewer = viewer;
setDocument(document);
-
}
@@ -71,7 +72,7 @@
Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
- IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element);
+ IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element, position);
if(injectionPoint == null){
openFileFailed();
return;
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2010-05-28 15:18:20 UTC (rev 22412)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2010-05-28 15:50:37 UTC (rev 22413)
@@ -19,6 +19,7 @@
public void testInjectedPointHyperlinkDetector() throws Exception {
ArrayList<Region> regionList = new ArrayList<Region>();
regionList.add(new Region(115, 6)); // Inject
+ regionList.add(new Region(133, 6)); // Logger
regionList.add(new Region(140, 6)); // logger
regionList.add(new Region(196, 6)); // logger
regionList.add(new Region(250, 6)); // logger
@@ -28,9 +29,10 @@
public void testInjectedProducerMethodParametersHyperlinkDetector() throws Exception {
ArrayList<Region> regionList = new ArrayList<Region>();
+ regionList.add(new Region(552, 3)); // Foo
+ regionList.add(new Region(556, 3)); // Foo
+ regionList.add(new Region(567, 3)); // Foo
regionList.add(new Region(571, 5)); // order
- regionList.add(new Region(659, 3));
- regionList.add(new Region(695, 3));
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/CustomProducerImpl.java", regionList, new InjectedPointHyperlinkDetector());
}
@@ -47,9 +49,9 @@
public void testInjectedConstructorParametersHyperlinkDetector() throws Exception {
ArrayList<Region> regionList = new ArrayList<Region>();
regionList.add(new Region(880, 6));
+ regionList.add(new Region(894, 3)); // Fox
regionList.add(new Region(898, 3));
- regionList.add(new Region(950, 6));
- regionList.add(new Region(967, 7));
+ regionList.add(new Region(975, 3));
regionList.add(new Region(979, 3));
regionList.add(new Region(1017, 3));
@@ -59,9 +61,9 @@
public void testInjectedInitializerParametersHyperlinkDetector() throws Exception {
ArrayList<Region> regionList = new ArrayList<Region>();
regionList.add(new Region(880, 6));
+ regionList.add(new Region(894, 3)); // Fox
regionList.add(new Region(898, 3));
- regionList.add(new Region(945, 6));
- regionList.add(new Region(967, 4));
+ regionList.add(new Region(972, 3));
regionList.add(new Region(976, 3));
regionList.add(new Region(1014, 3));
14 years, 7 months
JBoss Tools SVN: r22412 - in trunk/as/tests/org.jboss.ide.eclipse.as.test: projectPieces and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-05-28 11:18:20 -0400 (Fri, 28 May 2010)
New Revision: 22412
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/mvel2.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTZippedDeploymentTester.java
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java
Log:
JBIDE-6320 - test case added
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF 2010-05-28 13:59:47 UTC (rev 22411)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF 2010-05-28 15:18:20 UTC (rev 22412)
@@ -16,7 +16,7 @@
org.eclipse.wst.common.project.facet.ui,
org.eclipse.debug.core,
org.eclipse.jdt.launching,
- org.eclipse.jst.jee;bundle-version="1.0.100",
+ org.eclipse.jst.jee,
org.eclipse.jst.server.core;bundle-version="1.1.0",
org.jboss.tools.jmx.core.test,
org.jboss.ide.eclipse.as.ui;bundle-version="1.0.0",
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/mvel2.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/mvel2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java 2010-05-28 13:59:47 UTC (rev 22411)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java 2010-05-28 15:18:20 UTC (rev 22412)
@@ -93,7 +93,7 @@
return getFileLocation("/projects/" + name);
}
- protected File getFileLocation(String path) throws CoreException {
+ public static File getFileLocation(String path) throws CoreException {
Bundle bundle = Platform.getBundle(BUNDLE_NAME);
URL url = null;
try {
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTZippedDeploymentTester.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTZippedDeploymentTester.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTZippedDeploymentTester.java 2010-05-28 15:18:20 UTC (rev 22412)
@@ -0,0 +1,290 @@
+package org.jboss.ide.eclipse.as.test.publishing.v2;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.ExtensionManager;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
+import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.publishing.AbstractDeploymentTest;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+import org.jboss.ide.eclipse.as.test.util.wtp.JavaEEFacetConstants;
+import org.jboss.ide.eclipse.as.test.util.wtp.OperationTestCase;
+import org.jboss.ide.eclipse.as.test.util.wtp.ProjectCreationUtil;
+import org.jboss.ide.eclipse.as.test.util.wtp.ProjectUtility;
+import org.jboss.tools.test.util.JobUtils;
+
+public class JSTZippedDeploymentTester extends TestCase {
+
+ IProject project;
+ IServer server;
+ final String MODULE_NAME = "newModule";
+ final String CONTENT_DIR = "contentDirS";
+ final String TEXT_FILE = "test.txt";
+ final IPath CONTENT_TEXT_FILE = new Path(CONTENT_DIR).append(TEXT_FILE);
+ public void setUp() throws Exception {
+ project = createProject();
+ server = createServer();
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ ServerAttributeHelper helper = new ServerAttributeHelper(server, wc);
+ helper.setAttribute(IDeployableServer.ZIP_DEPLOYMENTS_PREF, true);
+ server = wc.save(true, new NullProgressMonitor());
+ }
+
+ public void tearDown() throws Exception {
+ ServerRuntimeUtils.deleteAllServers();
+ ServerRuntimeUtils.deleteAllRuntimes();
+ ProjectUtility.deleteAllProjects();
+ clearStateLocation();
+ }
+
+ protected IProject createProject() throws Exception {
+ IDataModel dm = ProjectCreationUtil.getEARDataModel(MODULE_NAME, CONTENT_DIR, null, null, JavaEEFacetConstants.EAR_5, false);
+ OperationTestCase.runAndVerify(dm);
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(MODULE_NAME);
+ assertTrue(p.exists());
+
+ File srcFile = AbstractDeploymentTest.getFileLocation("projectPieces/mvel2.jar");
+ IPath contentDir = p.getFolder(CONTENT_DIR).getLocation();
+ File destFile = new File(contentDir.toFile(), "mvel2.jar");
+ FileUtil.fileSafeCopy(srcFile, destFile);
+ p.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ return p;
+ }
+
+ protected IServer createServer() throws CoreException {
+ IPath state = ASTest.getDefault().getStateLocation();
+ IPath deploy = state.append("testDeployments").append("deploy");
+ IPath tmpDeploy = state.append("testDeployments").append("tmpDeploy");
+ return createServer(deploy.toOSString(), tmpDeploy.toOSString());
+ }
+
+ protected void clearStateLocation() {
+ IPath state = ASTest.getDefault().getStateLocation();
+ if( state.toFile().exists()) {
+ File[] children = state.toFile().listFiles();
+ for( int i = 0; i < children.length; i++ ) {
+ FileUtil.safeDelete(children[i]);
+ }
+ }
+ }
+
+ protected String getDeployRoot(IServer server) {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ return ds.getDeployFolder();
+ }
+
+ protected IServer createServer(String deployLocation, String tempDeployLocation) throws CoreException {
+ IRuntimeType rt = ServerCore.findRuntimeType("org.jboss.ide.eclipse.as.runtime.stripped");
+ IRuntimeWorkingCopy wc = rt.createRuntime("testRuntime", null);
+ wc.setLocation(ASTest.getDefault().getStateLocation());
+ IRuntime runtime = wc.save(true, null);
+ IServerType st = ServerCore.findServerType("org.jboss.ide.eclipse.as.systemCopyServer");
+ ServerWorkingCopy swc = (ServerWorkingCopy) st.createServer("testServer", null, null);
+ swc.setServerConfiguration(null);
+ swc.setName("testServer");
+ swc.setRuntime(runtime);
+ swc.setAttribute(DeployableServer.DEPLOY_DIRECTORY, deployLocation);
+ swc.setAttribute(DeployableServer.TEMP_DEPLOY_DIRECTORY, tempDeployLocation);
+ IServer server = swc.save(true, null);
+ return server;
+ }
+
+ protected IStatus publish() throws CoreException {
+ return server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
+ }
+
+ protected void addModule(IModule module) throws CoreException {
+ IServerWorkingCopy copy = server.createWorkingCopy();
+ copy.modifyModules(new IModule[]{module}, new IModule[0], new NullProgressMonitor());
+ server = copy.save(false, new NullProgressMonitor());
+ }
+
+ protected void removeModule(IModule module) throws CoreException {
+ IServerWorkingCopy copy = server.createWorkingCopy();
+ copy.modifyModules(new IModule[]{}, new IModule[] {module}, new NullProgressMonitor());
+ server = copy.save(false, new NullProgressMonitor());
+ }
+
+ protected void verifyJSTZippedPublisher(IModule[] module) {
+ IJBossServerPublisher publisher = ExtensionManager
+ .getDefault().getPublisher(server, module, "local");
+ assertTrue(publisher.getClass().getName().contains("WTPZippedPublisher"));
+ }
+
+ public int countFiles(File root) {
+ int count = 0;
+ if( !root.isDirectory() )
+ return 1;
+ File[] children = root.listFiles();
+ for( int i = 0; i < children.length; i++ )
+ count += countFiles(children[i]);
+ return count;
+ }
+
+ public int countAllResources(File root) {
+ int count = 0;
+ if( !root.isDirectory() )
+ return 1;
+ File[] children = root.listFiles();
+ for( int i = 0; i < children.length; i++ )
+ count += countFiles(children[i]);
+ return 1 + count;
+ }
+
+
+
+ protected void setContents(IFile file, int val) throws IOException , CoreException{
+ setContents(file, "" + val);
+ }
+
+ protected void setContents(IFile file, String val) throws IOException , CoreException{
+ if( !file.exists())
+ file.create(new ByteArrayInputStream((val).getBytes()), false, null);
+ else
+ file.setContents(new ByteArrayInputStream((val).getBytes()), false, false, new NullProgressMonitor());
+ try {
+ Thread.sleep(2000);
+ } catch( InterruptedException ie) {}
+ JobUtils.waitForIdle();
+ }
+
+ protected void assertContents(IFile file, int val) throws IOException, CoreException {
+ assertContents(file, "" + val);
+ }
+
+ protected void assertContents(IFile file, String val) throws IOException, CoreException {
+ String contents = getContents(file);
+ assertEquals(val, contents);
+ }
+
+ protected void assertContents(File file, int val) throws IOException, CoreException {
+ assertContents(file, "" + val);
+ }
+
+ protected void assertContents(File file, String val) throws IOException, CoreException {
+ String contents = getContents(file);
+ assertEquals(val, contents);
+ }
+
+ protected String getContents(IFile file) throws IOException, CoreException {
+ BufferedInputStream bis = new BufferedInputStream(file.getContents());
+ int l = (int)file.getLocation().toFile().length();
+ byte[] bs = new byte[l];
+ l = bis.read(bs, 0, l);
+ bis.close();
+ return new String(bs);
+ }
+
+ public static byte[] getBytesFromFile(File file) throws IOException {
+ InputStream is = new FileInputStream(file);
+ byte[] bytes = new byte[(int)file.length()];
+ int offset = 0;
+ int numRead = 0;
+ while (offset < bytes.length
+ && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
+ offset += numRead;
+ }
+ is.close();
+ return bytes;
+ }
+
+ static public String getContents(File aFile) throws IOException {
+ return new String(getBytesFromFile(aFile));
+ }
+
+
+ public void testMain() throws CoreException, IOException {
+ IModule[] mods = ServerUtil.getModules(project);
+ IModule mod = null;
+ // find hte right module ugh
+ for( int i = 0; i < mods.length && mod == null; i++ ) {
+ if( mods[i].getModuleType().getId().equals("jst.ear"))
+ mod = mods[i];
+ }
+ assertNotNull(mod);
+ IModule[] module = new IModule[] { mod };
+ verifyJSTZippedPublisher(module);
+ addModule(mod);
+ publish();
+ IPath projLoc = project.getLocation();
+ System.out.println(projLoc);
+ IPath deployRoot = new Path(getDeployRoot(server));
+ IPath zipped = deployRoot.append(MODULE_NAME + ".ear");
+ assertTrue(zipped.toFile().exists());
+ assertTrue(zipped.toFile().isFile());
+ IPath unzip1 = ASTest.getDefault().getStateLocation().append("unzip1");
+ IPath unzip2 = ASTest.getDefault().getStateLocation().append("unzip2");
+ unzipFile(zipped,unzip1);
+ assertTrue(unzip1.toFile().list().length == 1);
+ unzipFile(unzip1.append("mvel2.jar"), unzip2);
+ assertTrue(unzip2.toFile().list().length > 1);
+ System.out.println("end");
+ }
+
+
+ public static void unzipFile(IPath zipped, IPath toLoc) {
+ toLoc.toFile().mkdirs();
+ final int BUFFER = 2048;
+ try {
+ BufferedOutputStream dest = null;
+ FileInputStream fis = new
+ FileInputStream(zipped.toFile());
+ ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
+ ZipEntry entry;
+ while((entry = zis.getNextEntry()) != null) {
+ int count;
+ byte data[] = new byte[BUFFER];
+ // write the files to the disk
+ toLoc.append(entry.getName()).toFile().getParentFile().mkdirs();
+ if( !toLoc.append(entry.getName()).toFile().exists()) {
+ FileOutputStream fos = new FileOutputStream(toLoc.append(entry.getName()).toOSString());
+ dest = new BufferedOutputStream(fos, BUFFER);
+ while ((count = zis.read(data, 0, BUFFER)) != -1) {
+ dest.write(data, 0, count);
+ }
+ dest.flush();
+ dest.close();
+ }
+ }
+ zis.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
14 years, 7 months
JBoss Tools SVN: r22411 - in trunk/documentation/guides/GettingStartedGuide/en-US: images/first_seam and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2010-05-28 09:59:47 -0400 (Fri, 28 May 2010)
New Revision: 22411
Modified:
trunk/documentation/guides/GettingStartedGuide/en-US/first_seam.xml
trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam13.png
trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam3.png
trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam5.png
trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam8.png
Log:
nomsg
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/first_seam.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en-US/first_seam.xml 2010-05-28 13:11:43 UTC (rev 22410)
+++ trunk/documentation/guides/GettingStartedGuide/en-US/first_seam.xml 2010-05-28 13:59:47 UTC (rev 22411)
@@ -1,820 +1,828 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="first_seam" xreflabel="first_seam">
- <?dbhtml filename="first_seam.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>JBoss Developer Studio</keyword>
- <keyword>Seam</keyword>
- <keyword>JBoss</keyword>
- </keywordset>
- </chapterinfo>
- <title>Write Your First Project with JBoss Developer Studio</title>
- <para>This chapter is a set of hands-on labs. You get step-by-step information about how the JBoss
- Developer Studio can be used during the development process.</para>
- <section id="create_seam_application">
- <title>Create a Seam Application</title>
- <para>In this section you get to know how to create a Seam project in JBDS, how to start the
- server and what a structure your project has after creating.</para>
- <section id="start_dev_db">
- <title>Start Development Database</title>
- <para>Before opening the JBoss Developer studio you need to download and start <ulink
- url="http://docs.jboss.org/tools/resources/GSG_database.zip">Workshop Database</ulink>
- .</para>
- <para>To start the database just run <property>./runDBServer.sh</property> or <property
- >runDBServer.bat</property> from the database directory.</para>
- <para>The end result should be a console window that looks like:</para>
- <figure>
- <title>Starting DataBase</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="create_deploy_seam">
- <title>Create and deploy Seam Web Project</title>
- <para>Minimize the terminal window and run the <property>JBoss Developer Studio</property>
- from Applications Menu or from the desktop icon.</para>
- <para>First of all you get the Workspace Launcher. Change the default workspace location if
- it's needed. Click on <property>Ok</property>. </para>
- <figure>
- <title>Workspace Launcher Dialog</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>After startup, you see the welcome page. You could read how to work with welcome pages
- in <link linkend="Welcome">previous</link> chapter. Now select <property>Create
- New...</property> icon and then press on <property>Create Seam Project</property>
- link.</para>
- <para>The <property>New Seam Project wizard</property> is started. You need to enter a name
- (e.g., "workshop") and a location directory for your new project. The wizard has
- an option for selecting the actual Server (and not just WTP runtime) that will be used for
- the project. This allows the wizard to correctly identify where the needed datasource and
- driver libraries need to go.</para>
- <figure>
- <title>New Seam Project Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>All settings are already specified here, you can just modify the Configuration. Click on
- the <emphasis>
- <property>Modify...</property>
- </emphasis> button to configure your custom facets pattern:</para>
- <figure id="ProjectFacetsSpecifyingScreen">
- <title>Project Facets Specifying</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>On the whole the dialog allows to select the "features" you want to use in your project.
- Doing this <property>JBoss Developer Studio</property> setups the appropriate tooling for
- your project. Since JBoss Seam integrates all popular Java EE frameworks, you can select any
- combination of technologies from the list. Here, for the default configuration, Dynamic Web
- Module, Java, JavaServer Faces (JSF), and Seam Facet are already selected for a typical
- database-driven web application. The default project facets should suffice.</para>
- <para>In the <property>Project Facets</property> form you can also bring up server runtimes
- panel by clicking <property> Runtimes</property> tab on the right corner. This panel shows
- available server runtimes.</para>
- <figure>
- <title>Runtimes Selecting</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click on <emphasis>
- <property>Ok</property>
- </emphasis> and then <emphasis>
- <property>Next</property>
- </emphasis> to proceed further.</para>
- <para>A dynamic web application contains both web pages and <property>Java</property> code.
- The next wizard will ask you where you want to store Java files.</para>
- <figure>
- <title>Java Build Path</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam5a.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Following page provides you <property>Web Module Settings</property> .You can just leave
- the default values or choose another folder.</para>
- <figure>
- <title>Web Module Settings</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam6.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>On the next form, you will be able to select where those library JARs come from. The
- easiest is just to select the JARs provided by the JBoss AS runtime associated with this
- project. That is why it is important to chose the right JBoss AS 4.2 runtime in the project
- setup window.</para>
- <itemizedlist>
- <listitem>
- <para>Select <emphasis>
- <property>Library Provided by Target Runtime</property>
- </emphasis> as <property>Type</property> of <property>JSF Implementation
- Library</property>. We will use the JSF implementation that comes with JBoss
- server.</para>
- </listitem>
- <listitem>
- <para>Click <emphasis>
- <property>Next</property>
- </emphasis></para>
- </listitem>
- </itemizedlist>
- <figure>
- <title>JSF Capabilities Adding</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam7.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Next wizard step needs more settings that previous. Let's start with <property
- >General</property> section.</para>
- <para>Leave the default Seam runtime and check a WAR deployment.</para>
- <figure>
- <title>Seam Facet Setting</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam8.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Next <property>Database</property> section is a little tricky. The <property>Connection
- Profile</property> needs to be edited so that the new project works properly with the
- external HSQLDB server. By default the project wizard tries to use the JBoss embedded
- HSQLDB, but the tutorial uses an external database to replicate a more real world
- development scenario. Click on <property>Edit</property> to modify the Connection
- Profile.</para>
- <figure>
- <title>DataBase Setting</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam8_1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Select <property>HSQLDB Profile Properties</property>. Make sure the Database location
- is set to <emphasis>
- <property>hsql://localhost:1701</property>
- </emphasis></para>
- <figure>
- <title>JDBC Connection Properties</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam9.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Try click on <property>Test Connection</property> button. It probably won’t work. This
- happens if the hsql jdbc driver is not exactly the same. This can be worked around by
- modifying the HSQLDB database driver settings. To modify the settings, click the Edit Driver Definition Driver(
- <inlinemediaobject><imageobject>
- <imagedata fileref="images/first_seam/first_seam9_1.png"/>
- </imageobject>
- </inlinemediaobject>) .</para>
- <para>The proper Driver JAR File should be listed under <property>Jar List</property>. Select
- the hsqldb.jar file found in the jbdevstudio/jboss-eap/jboss-as/common/lib/ directory and
- click <property>Ok</property>.</para>
- <figure>
- <title>Driver Details</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam10.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Now, the <property>Test Connection</property> should succeed. After testing the
- connection, click <emphasis><property>Ok</property></emphasis>.</para>
- <figure>
- <title>Connection Testing</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam12.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>You can leave the <property>Code Generation</property> section as is. It refers to Java
- packages in which the generated code will be placed.</para>
- <figure>
- <title>Code Generation Setting</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam13.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click on <property>Finish</property> button. Now, there should be a new Seam project
- called “workshop” listed in Package Explorer view.</para>
- <figure>
- <title>"worskhop" Project in the Package Explorer</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam14.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="start_JBossAS">
- <title>Start JBoss Application Server</title>
- <para>The complete information on how to manage JBoss AS from JBoss Developer Studio you can
- read in a <link linkend="manage">corresponding chapter</link>.</para>
- <para>Now you just need to start the server by clicking on the Start the server icon (
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam15.png"/>
- </imageobject>
- </inlinemediaobject> ) in the <property>Servers</property>.</para>
- <para>Then run the project by selecting the project and use <emphasis><property>Run As... >
- Run on Server</property>.</emphasis></para>
- <note>
- <title>Note:</title>
- <para>If the project does not show up, then you can use a normal browser and use <emphasis>
- <property>http://localhost:8080/workshop/home.seam</property>
- </emphasis> as the url.</para>
- </note>
- <para>Your project looks like this:</para>
- <figure>
- <title>"workshop" Project Started</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam16.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="workshop_code_overview">
- <title>Workshop Project Code Overview</title>
- <para>Now let's examine the project and its structure. Go back to the Package Explorer view in
- JBoss Developer Studio.</para>
- <para>It seems like it's not much for project but this shell application contains a login
- screen with default login logic, a menu template that can be further modified, and other
- layout templates.</para>
- <para>It's important to note that the business logic will reside in the <emphasis>
- <property>src/hot</property>
- </emphasis> folder, by default. And, the package naming conventions that were used in
- <property>New Seam project wizard</property> could have been changed to something
- different from <emphasis>
- <property>org.domain.workshop.session</property>. </emphasis> Also, notice that there is a
- default <property>Authenticator. java</property> file. This is where custom security logic
- can be added. Seam has a nice declarative security model that we will explore in a bit more
- detail later on. The <emphasis>
- <property>src/main</property>
- </emphasis> folder is a model directory. It stores the project's JPA entity
- beans.</para>
- <figure>
- <title>Project Structure</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam17.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The view tier of the application is also important. Seam uses facelets and there is a
- built-in facelets GUI editor that has some nice WYSIWYG and component drag/drop
- functionality. Try this out by opening <property>home.xhtml</property> from <property
- >WebContent</property> folder.</para>
- <figure>
- <title>Facelets GUI Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam18.png" scale="85"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Notice that the templates reside in the <emphasis>
- <property>WebContent/layout</property>
- </emphasis> folder. There is a stylesheet in the <emphasis>
- <property>WebContent/stylesheet</property>
- </emphasis> folder. There is also a login and default error page. The Facelet editor will be
- explored in more detail later in the lab.</para>
- <para>The project already has a datasource that was created per the Seam project wizard
- database settings. And, obviously all of the Seam specific configuration files and JAR
- dependencies are included and placed in the proper locations. On last noteworthy line item
- is related to the build script. There isn’t a build script because the Eclipse WTP(Web Tools
- Project) plugin is used to publish web application changes. As you can see, JBoss Developer
- Studio is removing a great deal of complexity from the enterprise Java project
- setup/deployment process. The end result is a developer that is writing code, not spending
- days/weeks trying to figure out how to get a decent development environment and project
- build process.</para>
- </section>
- </section>
- <section id="seam_action_dev">
- <title>Seam Action Development</title>
- <para>Now, it’s time to write some code. The good news is that JBoss Developer Studio can also
- help out in this respect. In this section, we will create a new Seam Action POJO and facelet
- with some custom business logic and some GUI changes.</para>
- <section id="create_seam_action">
- <title>Create a New Seam Action</title>
- <para>Go to main menu bar and click on <emphasis>
- <property>File > New > New Seam Action</property>
- </emphasis> to start the New Seam Action wizard.</para>
- <para>Specify a <property>Seam component name</property> (e.g., "myAction"). The
- other properties will be auto-completed for you so there is no need to change them. Click on
- <property>Finish</property>.</para>
- <figure>
- <title>New Seam Action Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam19.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Now, open the <property>MyAction.java</property> file and replace the
- "myAction" method with this logic:</para>
- <programlisting><![CDATA[public void myAction() {
-Calendar cal = Calendar.getInstance();
-log.info("myAction.myAction() action called");
-facesMessages.add("MyAction Executed on:" + cal.getTime());
-}]]></programlisting>
- <para>You also need to import the <property>java.util.Calendar</property> class by clicking
- <emphasis><property>CTRL + Shift + O</property>.</emphasis></para>
- </section>
- <section id="test_seam_action">
- <title>Test Seam Action</title>
- <para>The new action can be tested by browsing the workshop-test project. JBoss Developer
- Studio has already created a TestNG test case for you.</para>
- <figure>
- <title>"workshop-test" Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam20.png" scale="85"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The test case simulates a Seam component/method execution for the <property
- >MyAction.myAction()</property> logic.</para>
- <para>To run the test case, right click on <property>MyActionTest.xml</property> and click
- <emphasis>
- <property>Run As > TestNG Suite</property>
- </emphasis> or use the <property>Run As...</property> toolbar shortcut as shown
- below.</para>
- <figure>
- <title>TestNG Running</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam21.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>With any luck, the test case will pass. Look at the TestNG view.</para>
- <figure>
- <title>TestNG Results</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam22.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Now, it’s safe to test the new Seam Action in a web browser. The fastest way to do that
- is to right click on <property>myAction.xhtml</property> and use <emphasis>
- <property>Run As... > Run On Server</property>
- </emphasis> which will show the appropriate url in the browser. Alternatively you can
- manually enter <emphasis>
- <property>http://localhost:8080/workshop/myAction.seam</property>
- </emphasis> into a browser.</para>
- <figure>
- <title>Seam Action in a Web Browser</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam23.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="modify_seam_action">
- <title>Modify Seam Action User Interface</title>
- <para>Browse to <emphasis>
- <property>http://localhost:8080/workshop/myAction.seam</property>
- </emphasis> and click on <property>myAction</property>. This executes the “myAction” method.
- This looks pretty good, but we could make this page look a little better.</para>
- <para>Open <emphasis>
- <property>WebContent/myAction.xhtml</property>
- </emphasis> in JBoss Developer Studio to use the nice facelets editor.</para>
- <figure>
- <title>Open Seam Action with Editor </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam24.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Right click on the "myAction!" button in the visual part of editor and select
- <property><h:commandButton> Attributes</property>.</para>
- <figure>
- <title>Seam Action Editing</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam25.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Change the <property>value</property> of the button to something different. If desired,
- you can change any other text on the page. Then, type <emphasis>
- <property>CTRL + S</property>
- </emphasis> to save the facelet.</para>
- <figure>
- <title>Attributes Dialog</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam26.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Refresh <emphasis>
- <property>http://localhost:8080/workshop/myAction.seam</property>
- </emphasis> and now you should see your changes.</para>
- <para>Notice that you did not have to publish the application. JBoss Developer Studio
- auto-published it for you.</para>
- <figure>
- <title>Seam Action Is Modified</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam27.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
- <section id="declarative_security">
- <title>Declarative Security</title>
- <para>In this section you will see how it’s easy to secure the facelets and facelet components
- in Seam. Let’s go ahead and secure the action button, then we will secure the entire
- page.</para>
- <section id="edit_login">
- <title>Edit Login Authentication Logic</title>
- <para>There is a class called <property>Authenticator.java</property>. The login page will
- execute the <property>Authenticator.authenticate()</property> method by default, so we’ll
- start by adding some custom login logic.</para>
- <para>Open <property>Authenticator.java</property> in JBoss Developer Studio and replace the
- <property>authenticate()</property> method with this code:</para>
- <programlisting><![CDATA[public boolean authenticate()
-{
- if ("admin".equals(credentials.getUsername()))
- {
- identity.addRole("admin");
- return true;
- }
- return false;
-}]]></programlisting>
- </section>
- <section id="secure_seam_page">
- <title>Secure Seam Page Component</title>
- <para>Open <property>myAction.xhtml</property> and add a new secured command button:</para>
- <programlisting><![CDATA[<h:commandButton id="myActionSecured"
-value="Secured Action Button"
-action="#{myAction.myAction}"
-rendered="#{s:hasRole('admin')}"/>]]></programlisting>
- <para>Refresh <emphasis>
- <property>http://localhost:8080/workshop/myAction.seam</property>
- </emphasis> If you are not logged in you will only see one button. If you are logged in,
- there will be two buttons.</para>
- <figure>
- <title>One Button on a Page</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam28.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The secured button is not visible because the user isn’t logged in as <property
- >"admin"</property>.</para>
- <figure>
- <title>Secured Button is Visible</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam29.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The user is logged in as <property>"admin"</property>. Securing components is
- easy but securing pages is pretty simple as well. </para>
- <para>Open <emphasis>
- <property>WebContent/WEB-INF/pages.xml</property>
- </emphasis>. Then add this markup directly underneath the <pages> element:</para>
- <programlisting><![CDATA[<page view-id="/myAction.xhtml" login-required="true"/>]]></programlisting>
- <para>Refresh <emphasis>
- <property>http://localhost:8080/workshop/myAction.seam</property>
- </emphasis> If you are not logged in you will get bounced back to the login page.</para>
- <figure>
- <title>Login Page</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam30.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Thus, if you enter login credentials for the <property>"admin"</property>
- user, you will be re-directed to the secured page and secured component. If you enter
- different login credentials, page access will be granted, but the secured component will not
- be displayed.</para>
- <para>Congratulations! You have secured your new action both at the facelet component and page
- level. You also added custom authentication logic to the login action.</para>
- </section>
- </section>
- <section id="browsing_workshop_db">
- <title>Browsing Workshop Database</title>
- <para>In this section you get to know how to use the workshop database that was started at the
- beginning of the lab.</para>
- <section id="database_connectivity">
- <title>Database Connectivity Setup</title>
- <para>The workshop data can be browsed inside of JBoss Developer Studio.</para>
- <para>To open the Data Source Explorer, click on <emphasis><property>Window > Open Perspective
- > Other > Database Development</property>.</emphasis></para>
- <para>In the Data Source Explorer, expand a <property>Databases</property> node and select a
- <property>Default</property> database. Right click on it, select <property
- >Connect</property> from the context menu.</para>
- <figure>
- <title>Data Source Explorer</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam31.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="browsing_workshop_db2">
- <title>Browse Workshop Database</title>
- <para>Then in the current view, drill down to the <property>CUSTOMERS</property> table.</para>
- <figure>
- <title>"CUSTOMERS" Table</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam32.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Right click on <property>CUSTOMERS</property>, select <emphasis>
- <property>Data > Sample Contents</property>
- </emphasis> to view the data in the table.</para>
- <para>There should be a SQL Results view on the workbench, but it could be hidden. Click on
- the <property>"Result1"</property> tab in the right side and you should see the
- data in the CUSTOMERS table.</para>
- <figure>
- <title>SQL Results View</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam33.png" scale="92"/>
- </imageobject>
- </mediaobject>
- </figure>
- <note>
- <title>Note:</title>
- <para>If you can’t find the SQL Results view tab, click on <emphasis><property>Window > Show
- View > Other > SQL Development > SQL Results</property>.</emphasis></para>
- </note>
- <para>Congratulations! You just connected to the workshop database and queried the content
- using Database Explorer tools.</para>
- </section>
- </section>
- <section id="db_programming">
- <title>Database Programming</title>
- <para>Now, it’s time to reverse engineer the workshop database into a fully functioning Seam
- CRUD(Create Read Update Delete) application.</para>
- <section id="reverse_engineer_crud">
- <title>Reverse Engineer CRUD from a Running Database</title>
- <para>In <property>JBoss Developer Studio</property>, switch to <property>Seam
- perspective</property>, and then right-click the project and select <emphasis><property
- >New > Seam Generate Entities</property>.</emphasis></para>
- <para>"workshop" project in the <property>Seam Generate Entities wizard</property>
- will be selected automatically. There is no need to change something more, click <emphasis>
- <property>Next</property>
- </emphasis> to proceed further.</para>
- <figure>
- <title>Generate Seam Entities</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam34.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>On the next page use the <emphasis>
- <property>Include</property>
- </emphasis> button to include all the tables from the database and click <emphasis>
- <property>Finish</property>.</emphasis></para>
- <figure>
- <title>Selecting Tables</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam34a.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>After running the Generate Entities action, you will see new <emphasis>
- <property>org.domain.workshop.entity</property>
- </emphasis> classes. These classes represent insert/update/delete/query logic.</para>
- <figure>
- <title>org.domain.workshop.entity Classes</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam35.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>There are also <emphasis>
- <property>org.domain.workshop.entity</property>
- </emphasis> package that contains the JPA classes. These are the entity beans that are
- mapped to database tables.Note,that you can use Seam refactoring tools with Seam components.
- Read more about it in <ulink
- url="http://download.jboss.org/jbosstools/nightly-docs/en/seam/html_single/ind..."
- >Seam refactoring tools chapter</ulink> of Seam Dev Tools Reference Guide.</para>
- <para>Last, but not least, there are facelets for all of the CRUD screens. The best way to get
- a feel for the generated code is to open a browser and play around with the application. Go
- to <emphasis>
- <property>http://localhost:8080/workshop</property>
- </emphasis> and insert/update/delete/query a few records. There is quite a bit of AJAX in
- this application, but which we will explore further later on in the lab. For now, take note
- of the page tabs, required field logic and data table sorting in the list pages. </para>
- <figure>
- <title>CustomersList.xhtml in the Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam36.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Congratulations! You now have a fully functioning CRUD application that is already AJAX
- enabled.</para>
- </section>
- <section id="use_hibernate_tools">
- <title>Use Hibernate Tools to Query Data via JPA</title>
- <para>Now, it's time to write some JPA queries using the Hibernate perspective in
- <property>JBoss Developer Studio</property>.</para>
- <para>In the upper right corner of the workbench there is a small icon (see the figure below),
- click on it and choose <property>Hibernate</property>.</para>
- <figure>
- <title>Hibernate Perspective</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam37.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Look at the Hibernate Configurations view. In the "workshop" project, drill
- down on the <property>Session Factory</property> and notice that the JPA entities/attributes
- are listed in a nice tree view.</para>
- <figure>
- <title>Hibernate Configurations View</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam38.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Right click on the <property>Session Factory</property> and select <property>HQL
- Editor</property>. This will open a JPA query scratch pad window.</para>
- <para>Write your query and click on the "Hibernate Dynamic SQL Preview" tab. You
- should see the SQL that will be executed if this JPA query is run.</para>
- <figure>
- <title>JPA Query Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam39.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Run the query by clicking on the green run icon.</para>
- <para>The results are listed in the "Hibernate Query Result" tab. There is a
- "Properties" tab in the workbench that can be used to see a specific JPA result.
- These results represent the JPA objects because our query did not specify column
- names.</para>
- <figure>
- <title>Hibernate Query Result View</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam40.png" scale="80"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The query can be refined, and take note that there is nice code completion in the JPA
- query editor.</para>
- <figure>
- <title>Code Completion</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam41.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>A refined query will return results that are more ResultSet oriented. Notice the join
- logic that JPA supports.</para>
- <figure>
- <title>The Hibernate Query Result</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam42.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>There was no need to specify an <property>Employees</property> table in the <property
- >from</property> part of the JPA query because JPA supports reference traversal via Java
- class attribute references. Not only are JPA and HQL queries fully supported, but Criteria
- based queries can also be written in the Criteria Editor. You should spend some time
- tinkering with different queries and possibly Criteria based queries, even though the
- instructions are not provided in this lab.</para>
- <figure>
- <title>Criteria Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam43.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="use_hibernate_to_vizualize">
- <title>Use Hibernate Tools to visualize the Data Model</title>
- <para>Now, it’s time to view the data model for the workshop database.</para>
- <para>In the Hibernate Configurations view, select "workshop" project and expand the
- <property>Configuration</property> node. Select the <property>Customers</property> entity,
- right click on it, choose <property>Open Mapping Diagram</property>.</para>
- <figure>
- <title>Mapping Diagram Opening</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam44.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>You see a Diagram tab for the CUSTOMERS table and any tables that have FK references.
- This is a handy way to view the data model and JPA mappings. Now, you’ve got access to
- something that the Erwin Data Modeler can’t do.</para>
- <figure>
- <title>Diagram Tab</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam45.png" scale="80"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
- <section id="rich_components">
- <title>Rich Components</title>
- <para>This lab will conclude with one last AJAX twist. In this section we add a RichFaces
- <property>inputNumberSlider</property> to the Order Details edit screen.</para>
- <section id="add_richfaces">
- <title>Add a Richfaces component to the CRUD Application</title>
- <para>Switch to Seam perspective, open <emphasis>
- <property>WebContent/OrderdetailsEdit.xhtml</property>
- </emphasis> in JBoss Developer Studio.</para>
- <para>Change the form field values using the visual editor. Seam has generated the form field
- names that match the database column names. This is not ideal for business users.</para>
- <figure>
- <title>Form Fields Editing</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam46.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Also, replace the QTY Ordered input field with a <property>inputNumberSlider</property>.
- You can use the JBoss Developer Studio palette or right click on the form and insert the
- RichFaces component.</para>
- <figure>
- <title>Insert RichFaces Component from Context Menu</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam47.png" scale="85"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>One the last option is to use the source view and manually copy the inputNumberSlider
- markup listed below:</para>
- <programlisting><![CDATA[<rich:inputNumberSlider id="quantityOrdered" required="true"
- value="#{orderdetailsHome.instance.quantityordered}"/>]]></programlisting>
- <figure>
- <title>Manually coping Source Code</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam48.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The end result is an edit page that has better form labels and a new RichFaces
- control.</para>
- <figure>
- <title>The Result Page</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/first_seam/first_seam49.png" scale="85"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Congratulations! You have completed the JBoss Developer Studio lab.</para>
- </section>
- </section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="first_seam" xreflabel="first_seam">
+ <?dbhtml filename="first_seam.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Seam</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>Write Your First Project with JBoss Developer Studio</title>
+ <para>This chapter is a set of hands-on labs. You get step-by-step information about how the JBoss
+ Developer Studio can be used during the development process.</para>
+ <section id="create_seam_application">
+ <title>Create a Seam Application</title>
+ <para>In this section you get to know how to create a Seam project in JBDS, how to start the
+ server and what a structure your project has after creating.</para>
+ <section id="start_dev_db">
+ <title>Start Development Database</title>
+ <para>Before opening the JBoss Developer studio you need to download and start <ulink
+ url="http://docs.jboss.org/tools/resources/GSG_database.zip">Workshop Database</ulink>
+ .</para>
+ <para>To start the database just run <property>./runDBServer.sh</property> or <property
+ >runDBServer.bat</property> from the database directory.</para>
+ <para>The end result should be a console window that looks like:</para>
+ <figure>
+ <title>Starting DataBase</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="create_deploy_seam">
+ <title>Create and deploy Seam Web Project</title>
+ <para>Minimize the terminal window and run the <property>JBoss Developer Studio</property>
+ from Applications Menu or from the desktop icon.</para>
+ <para>First of all you get the Workspace Launcher. Change the default workspace location if
+ it's needed. Click on <property>Ok</property>. </para>
+ <figure>
+ <title>Workspace Launcher Dialog</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>After startup, you see the welcome page. You could read how to work with welcome pages
+ in <link linkend="Welcome">previous</link> chapter. Now select <property>Create
+ New...</property> icon and then press on <property>Create Seam Project</property>
+ link.</para>
+ <para>The <property>New Seam Project wizard</property> is started. You need to enter a name
+ (e.g., "workshop") and a location directory for your new project. The wizard has
+ an option for selecting the actual Server (and not just WTP runtime) that will be used for
+ the project. This allows the wizard to correctly identify where the needed datasource and
+ driver libraries need to go.</para>
+ <figure>
+ <title>New Seam Project Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>All settings are already specified here, you can just modify the Configuration. Click on
+ the <emphasis>
+ <property>Modify...</property>
+ </emphasis> button to configure your custom facets pattern:</para>
+ <figure id="ProjectFacetsSpecifyingScreen">
+ <title>Project Facets Specifying</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On the whole the dialog allows to select the "features" you want to use in your project.
+ Doing this <property>JBoss Developer Studio</property> setups the appropriate tooling for
+ your project. Since JBoss Seam integrates all popular Java EE frameworks, you can select any
+ combination of technologies from the list. Here, for the default configuration, Dynamic Web
+ Module, Java, JavaServer Faces (JSF), and Seam Facet are already selected for a typical
+ database-driven web application. The default project facets should suffice.</para>
+ <para>In the <property>Project Facets</property> form you can also bring up server runtimes
+ panel by clicking <property> Runtimes</property> tab on the right corner. This panel shows
+ available server runtimes.</para>
+ <figure>
+ <title>Runtimes Selecting</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on <emphasis>
+ <property>Ok</property>
+ </emphasis> and then <emphasis>
+ <property>Next</property>
+ </emphasis> to proceed further.</para>
+ <para>A dynamic web application contains both web pages and <property>Java</property> code.
+ The next wizard will ask you where you want to store Java files.</para>
+ <figure>
+ <title>Java Build Path</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam5a.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Following page provides you <property>Web Module Settings</property> .You can just leave
+ the default values or choose another folder.</para>
+ <figure>
+ <title>Web Module Settings</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On the next form, you will be able to select where those library JARs come from. The
+ easiest is just to select the JARs provided by the JBoss AS runtime associated with this
+ project. That is why it is important to chose the right JBoss AS 4.2 runtime in the project
+ setup window.</para>
+ <itemizedlist>
+ <listitem>
+ <para>Select <emphasis>
+ <property>Library Provided by Target Runtime</property>
+ </emphasis> as <property>Type</property> of <property>JSF Implementation
+ Library</property>. We will use the JSF implementation that comes with JBoss
+ server.</para>
+ </listitem>
+ <listitem>
+ <para>Click <emphasis>
+ <property>Next</property>
+ </emphasis></para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>JSF Capabilities Adding</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam7.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Next wizard step needs more settings that previous. Let's start with <property
+ >General</property> section.</para>
+ <para>Leave the default Seam runtime and check a WAR deployment.</para>
+ <figure>
+ <title>Seam Facet Setting</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam8.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Next <property>Database</property> section is a little tricky. The <property>Connection
+ Profile</property> needs to be edited so that the new project works properly with the
+ external HSQLDB server. By default the project wizard tries to use the JBoss embedded
+ HSQLDB, but the tutorial uses an external database to replicate a more real world
+ development scenario. Click on <property>Edit</property> to modify the Connection
+ Profile.</para>
+ <figure>
+ <title>DataBase Setting</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam8_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Select <property>HSQLDB Profile Properties</property>. Make sure the Database location
+ is set to <emphasis>
+ <property>hsql://localhost:1701</property>
+ </emphasis></para>
+ <figure>
+ <title>JDBC Connection Properties</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam9.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Try click on <property>Test Connection</property> button. It probably won’t work. This
+ happens if the hsql jdbc driver is not exactly the same. This can be worked around by
+ modifying the HSQLDB database driver settings. To modify the settings, click the Edit Driver Definition Driver(
+ <inlinemediaobject><imageobject>
+ <imagedata fileref="images/first_seam/first_seam9_1.png"/>
+ </imageobject>
+ </inlinemediaobject>) .</para>
+ <para>The proper Driver JAR File should be listed under <property>Jar List</property>. Select
+ the hsqldb.jar file found in the jbdevstudio/jboss-eap/jboss-as/common/lib/ directory and
+ click <property>Ok</property>.</para>
+ <figure>
+ <title>Driver Details</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam10.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Now, the <property>Test Connection</property> should succeed. After testing the
+ connection, click <emphasis><property>Ok</property></emphasis>.</para>
+ <figure>
+ <title>Connection Testing</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam12.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>You can leave the <property>Code Generation</property> section as is. It refers to Java
+ packages in which the generated code will be placed.</para>
+
+ <figure>
+ <title>Code Generation Setting</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam13.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <tip>
+ <title>Tip:</title>
+ <para>If you want to name your web project "MyProject-war" note that the Test project name should not be "MyProject-war-test",
+ it should be "MyProject-test".</para>
+ </tip>
+
+ <para>Click on <property>Finish</property> button. Now, there should be a new Seam project
+ called “workshop” listed in Package Explorer view.</para>
+ <figure>
+ <title>"worskhop" Project in the Package Explorer</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam14.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="start_JBossAS">
+ <title>Start JBoss Application Server</title>
+ <para>The complete information on how to manage JBoss AS from JBoss Developer Studio you can
+ read in a <link linkend="manage">corresponding chapter</link>.</para>
+ <para>Now you just need to start the server by clicking on the Start the server icon (
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam15.png"/>
+ </imageobject>
+ </inlinemediaobject> ) in the <property>Servers</property>.</para>
+ <para>Then run the project by selecting the project and use <emphasis><property>Run As... >
+ Run on Server</property>.</emphasis></para>
+ <note>
+ <title>Note:</title>
+ <para>If the project does not show up, then you can use a normal browser and use <emphasis>
+ <property>http://localhost:8080/workshop/home.seam</property>
+ </emphasis> as the url.</para>
+ </note>
+ <para>Your project looks like this:</para>
+ <figure>
+ <title>"workshop" Project Started</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam16.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="workshop_code_overview">
+ <title>Workshop Project Code Overview</title>
+ <para>Now let's examine the project and its structure. Go back to the Package Explorer view in
+ JBoss Developer Studio.</para>
+ <para>It seems like it's not much for project but this shell application contains a login
+ screen with default login logic, a menu template that can be further modified, and other
+ layout templates.</para>
+ <para>It's important to note that the business logic will reside in the <emphasis>
+ <property>src/hot</property>
+ </emphasis> folder, by default. And, the package naming conventions that were used in
+ <property>New Seam project wizard</property> could have been changed to something
+ different from <emphasis>
+ <property>org.domain.workshop.session</property>. </emphasis> Also, notice that there is a
+ default <property>Authenticator. java</property> file. This is where custom security logic
+ can be added. Seam has a nice declarative security model that we will explore in a bit more
+ detail later on. The <emphasis>
+ <property>src/main</property>
+ </emphasis> folder is a model directory. It stores the project's JPA entity
+ beans.</para>
+ <figure>
+ <title>Project Structure</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam17.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The view tier of the application is also important. Seam uses facelets and there is a
+ built-in facelets GUI editor that has some nice WYSIWYG and component drag/drop
+ functionality. Try this out by opening <property>home.xhtml</property> from <property
+ >WebContent</property> folder.</para>
+ <figure>
+ <title>Facelets GUI Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam18.png" scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Notice that the templates reside in the <emphasis>
+ <property>WebContent/layout</property>
+ </emphasis> folder. There is a stylesheet in the <emphasis>
+ <property>WebContent/stylesheet</property>
+ </emphasis> folder. There is also a login and default error page. The Facelet editor will be
+ explored in more detail later in the lab.</para>
+ <para>The project already has a datasource that was created per the Seam project wizard
+ database settings. And, obviously all of the Seam specific configuration files and JAR
+ dependencies are included and placed in the proper locations. On last noteworthy line item
+ is related to the build script. There isn’t a build script because the Eclipse WTP(Web Tools
+ Project) plugin is used to publish web application changes. As you can see, JBoss Developer
+ Studio is removing a great deal of complexity from the enterprise Java project
+ setup/deployment process. The end result is a developer that is writing code, not spending
+ days/weeks trying to figure out how to get a decent development environment and project
+ build process.</para>
+ </section>
+ </section>
+ <section id="seam_action_dev">
+ <title>Seam Action Development</title>
+ <para>Now, it’s time to write some code. The good news is that JBoss Developer Studio can also
+ help out in this respect. In this section, we will create a new Seam Action POJO and facelet
+ with some custom business logic and some GUI changes.</para>
+ <section id="create_seam_action">
+ <title>Create a New Seam Action</title>
+ <para>Go to main menu bar and click on <emphasis>
+ <property>File > New > New Seam Action</property>
+ </emphasis> to start the New Seam Action wizard.</para>
+ <para>Specify a <property>Seam component name</property> (e.g., "myAction"). The
+ other properties will be auto-completed for you so there is no need to change them. Click on
+ <property>Finish</property>.</para>
+ <figure>
+ <title>New Seam Action Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam19.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Now, open the <property>MyAction.java</property> file and replace the
+ "myAction" method with this logic:</para>
+ <programlisting><![CDATA[public void myAction() {
+Calendar cal = Calendar.getInstance();
+log.info("myAction.myAction() action called");
+facesMessages.add("MyAction Executed on:" + cal.getTime());
+}]]></programlisting>
+ <para>You also need to import the <property>java.util.Calendar</property> class by clicking
+ <emphasis><property>CTRL + Shift + O</property>.</emphasis></para>
+ </section>
+ <section id="test_seam_action">
+ <title>Test Seam Action</title>
+ <para>The new action can be tested by browsing the workshop-test project. JBoss Developer
+ Studio has already created a TestNG test case for you.</para>
+ <figure>
+ <title>"workshop-test" Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam20.png" scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The test case simulates a Seam component/method execution for the <property
+ >MyAction.myAction()</property> logic.</para>
+ <para>To run the test case, right click on <property>MyActionTest.xml</property> and click
+ <emphasis>
+ <property>Run As > TestNG Suite</property>
+ </emphasis> or use the <property>Run As...</property> toolbar shortcut as shown
+ below.</para>
+ <figure>
+ <title>TestNG Running</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam21.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>With any luck, the test case will pass. Look at the TestNG view.</para>
+ <figure>
+ <title>TestNG Results</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam22.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Now, it’s safe to test the new Seam Action in a web browser. The fastest way to do that
+ is to right click on <property>myAction.xhtml</property> and use <emphasis>
+ <property>Run As... > Run On Server</property>
+ </emphasis> which will show the appropriate url in the browser. Alternatively you can
+ manually enter <emphasis>
+ <property>http://localhost:8080/workshop/myAction.seam</property>
+ </emphasis> into a browser.</para>
+ <figure>
+ <title>Seam Action in a Web Browser</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam23.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="modify_seam_action">
+ <title>Modify Seam Action User Interface</title>
+ <para>Browse to <emphasis>
+ <property>http://localhost:8080/workshop/myAction.seam</property>
+ </emphasis> and click on <property>myAction</property>. This executes the “myAction” method.
+ This looks pretty good, but we could make this page look a little better.</para>
+ <para>Open <emphasis>
+ <property>WebContent/myAction.xhtml</property>
+ </emphasis> in JBoss Developer Studio to use the nice facelets editor.</para>
+ <figure>
+ <title>Open Seam Action with Editor </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam24.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Right click on the "myAction!" button in the visual part of editor and select
+ <property><h:commandButton> Attributes</property>.</para>
+ <figure>
+ <title>Seam Action Editing</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam25.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Change the <property>value</property> of the button to something different. If desired,
+ you can change any other text on the page. Then, type <emphasis>
+ <property>CTRL + S</property>
+ </emphasis> to save the facelet.</para>
+ <figure>
+ <title>Attributes Dialog</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam26.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Refresh <emphasis>
+ <property>http://localhost:8080/workshop/myAction.seam</property>
+ </emphasis> and now you should see your changes.</para>
+ <para>Notice that you did not have to publish the application. JBoss Developer Studio
+ auto-published it for you.</para>
+ <figure>
+ <title>Seam Action Is Modified</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam27.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ </section>
+ <section id="declarative_security">
+ <title>Declarative Security</title>
+ <para>In this section you will see how it’s easy to secure the facelets and facelet components
+ in Seam. Let’s go ahead and secure the action button, then we will secure the entire
+ page.</para>
+ <section id="edit_login">
+ <title>Edit Login Authentication Logic</title>
+ <para>There is a class called <property>Authenticator.java</property>. The login page will
+ execute the <property>Authenticator.authenticate()</property> method by default, so we’ll
+ start by adding some custom login logic.</para>
+ <para>Open <property>Authenticator.java</property> in JBoss Developer Studio and replace the
+ <property>authenticate()</property> method with this code:</para>
+ <programlisting><![CDATA[public boolean authenticate()
+{
+ if ("admin".equals(credentials.getUsername()))
+ {
+ identity.addRole("admin");
+ return true;
+ }
+ return false;
+}]]></programlisting>
+ </section>
+ <section id="secure_seam_page">
+ <title>Secure Seam Page Component</title>
+ <para>Open <property>myAction.xhtml</property> and add a new secured command button:</para>
+ <programlisting><![CDATA[<h:commandButton id="myActionSecured"
+value="Secured Action Button"
+action="#{myAction.myAction}"
+rendered="#{s:hasRole('admin')}"/>]]></programlisting>
+ <para>Refresh <emphasis>
+ <property>http://localhost:8080/workshop/myAction.seam</property>
+ </emphasis> If you are not logged in you will only see one button. If you are logged in,
+ there will be two buttons.</para>
+ <figure>
+ <title>One Button on a Page</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam28.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The secured button is not visible because the user isn’t logged in as <property
+ >"admin"</property>.</para>
+ <figure>
+ <title>Secured Button is Visible</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam29.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The user is logged in as <property>"admin"</property>. Securing components is
+ easy but securing pages is pretty simple as well. </para>
+ <para>Open <emphasis>
+ <property>WebContent/WEB-INF/pages.xml</property>
+ </emphasis>. Then add this markup directly underneath the <pages> element:</para>
+ <programlisting><![CDATA[<page view-id="/myAction.xhtml" login-required="true"/>]]></programlisting>
+ <para>Refresh <emphasis>
+ <property>http://localhost:8080/workshop/myAction.seam</property>
+ </emphasis> If you are not logged in you will get bounced back to the login page.</para>
+ <figure>
+ <title>Login Page</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam30.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Thus, if you enter login credentials for the <property>"admin"</property>
+ user, you will be re-directed to the secured page and secured component. If you enter
+ different login credentials, page access will be granted, but the secured component will not
+ be displayed.</para>
+ <para>Congratulations! You have secured your new action both at the facelet component and page
+ level. You also added custom authentication logic to the login action.</para>
+ </section>
+ </section>
+ <section id="browsing_workshop_db">
+ <title>Browsing Workshop Database</title>
+ <para>In this section you get to know how to use the workshop database that was started at the
+ beginning of the lab.</para>
+ <section id="database_connectivity">
+ <title>Database Connectivity Setup</title>
+ <para>The workshop data can be browsed inside of JBoss Developer Studio.</para>
+ <para>To open the Data Source Explorer, click on <emphasis><property>Window > Open Perspective
+ > Other > Database Development</property>.</emphasis></para>
+ <para>In the Data Source Explorer, expand a <property>Databases</property> node and select a
+ <property>Default</property> database. Right click on it, select <property
+ >Connect</property> from the context menu.</para>
+ <figure>
+ <title>Data Source Explorer</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam31.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="browsing_workshop_db2">
+ <title>Browse Workshop Database</title>
+ <para>Then in the current view, drill down to the <property>CUSTOMERS</property> table.</para>
+ <figure>
+ <title>"CUSTOMERS" Table</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam32.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Right click on <property>CUSTOMERS</property>, select <emphasis>
+ <property>Data > Sample Contents</property>
+ </emphasis> to view the data in the table.</para>
+ <para>There should be a SQL Results view on the workbench, but it could be hidden. Click on
+ the <property>"Result1"</property> tab in the right side and you should see the
+ data in the CUSTOMERS table.</para>
+ <figure>
+ <title>SQL Results View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam33.png" scale="92"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <note>
+ <title>Note:</title>
+ <para>If you can’t find the SQL Results view tab, click on <emphasis><property>Window > Show
+ View > Other > SQL Development > SQL Results</property>.</emphasis></para>
+ </note>
+ <para>Congratulations! You just connected to the workshop database and queried the content
+ using Database Explorer tools.</para>
+ </section>
+ </section>
+ <section id="db_programming">
+ <title>Database Programming</title>
+ <para>Now, it’s time to reverse engineer the workshop database into a fully functioning Seam
+ CRUD(Create Read Update Delete) application.</para>
+ <section id="reverse_engineer_crud">
+ <title>Reverse Engineer CRUD from a Running Database</title>
+ <para>In <property>JBoss Developer Studio</property>, switch to <property>Seam
+ perspective</property>, and then right-click the project and select <emphasis><property
+ >New > Seam Generate Entities</property>.</emphasis></para>
+ <para>"workshop" project in the <property>Seam Generate Entities wizard</property>
+ will be selected automatically. There is no need to change something more, click <emphasis>
+ <property>Next</property>
+ </emphasis> to proceed further.</para>
+ <figure>
+ <title>Generate Seam Entities</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam34.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On the next page use the <emphasis>
+ <property>Include</property>
+ </emphasis> button to include all the tables from the database and click <emphasis>
+ <property>Finish</property>.</emphasis></para>
+ <figure>
+ <title>Selecting Tables</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam34a.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>After running the Generate Entities action, you will see new <emphasis>
+ <property>org.domain.workshop.entity</property>
+ </emphasis> classes. These classes represent insert/update/delete/query logic.</para>
+ <figure>
+ <title>org.domain.workshop.entity Classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam35.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>There are also <emphasis>
+ <property>org.domain.workshop.entity</property>
+ </emphasis> package that contains the JPA classes. These are the entity beans that are
+ mapped to database tables.Note,that you can use Seam refactoring tools with Seam components.
+ Read more about it in <ulink
+ url="http://download.jboss.org/jbosstools/nightly-docs/en/seam/html_single/ind..."
+ >Seam refactoring tools chapter</ulink> of Seam Dev Tools Reference Guide.</para>
+ <para>Last, but not least, there are facelets for all of the CRUD screens. The best way to get
+ a feel for the generated code is to open a browser and play around with the application. Go
+ to <emphasis>
+ <property>http://localhost:8080/workshop</property>
+ </emphasis> and insert/update/delete/query a few records. There is quite a bit of AJAX in
+ this application, but which we will explore further later on in the lab. For now, take note
+ of the page tabs, required field logic and data table sorting in the list pages. </para>
+ <figure>
+ <title>CustomersList.xhtml in the Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam36.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Congratulations! You now have a fully functioning CRUD application that is already AJAX
+ enabled.</para>
+ </section>
+ <section id="use_hibernate_tools">
+ <title>Use Hibernate Tools to Query Data via JPA</title>
+ <para>Now, it's time to write some JPA queries using the Hibernate perspective in
+ <property>JBoss Developer Studio</property>.</para>
+ <para>In the upper right corner of the workbench there is a small icon (see the figure below),
+ click on it and choose <property>Hibernate</property>.</para>
+ <figure>
+ <title>Hibernate Perspective</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam37.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Look at the Hibernate Configurations view. In the "workshop" project, drill
+ down on the <property>Session Factory</property> and notice that the JPA entities/attributes
+ are listed in a nice tree view.</para>
+ <figure>
+ <title>Hibernate Configurations View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam38.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Right click on the <property>Session Factory</property> and select <property>HQL
+ Editor</property>. This will open a JPA query scratch pad window.</para>
+ <para>Write your query and click on the "Hibernate Dynamic SQL Preview" tab. You
+ should see the SQL that will be executed if this JPA query is run.</para>
+ <figure>
+ <title>JPA Query Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam39.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Run the query by clicking on the green run icon.</para>
+ <para>The results are listed in the "Hibernate Query Result" tab. There is a
+ "Properties" tab in the workbench that can be used to see a specific JPA result.
+ These results represent the JPA objects because our query did not specify column
+ names.</para>
+ <figure>
+ <title>Hibernate Query Result View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam40.png" scale="80"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The query can be refined, and take note that there is nice code completion in the JPA
+ query editor.</para>
+ <figure>
+ <title>Code Completion</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam41.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>A refined query will return results that are more ResultSet oriented. Notice the join
+ logic that JPA supports.</para>
+ <figure>
+ <title>The Hibernate Query Result</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam42.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>There was no need to specify an <property>Employees</property> table in the <property
+ >from</property> part of the JPA query because JPA supports reference traversal via Java
+ class attribute references. Not only are JPA and HQL queries fully supported, but Criteria
+ based queries can also be written in the Criteria Editor. You should spend some time
+ tinkering with different queries and possibly Criteria based queries, even though the
+ instructions are not provided in this lab.</para>
+ <figure>
+ <title>Criteria Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam43.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="use_hibernate_to_vizualize">
+ <title>Use Hibernate Tools to visualize the Data Model</title>
+ <para>Now, it’s time to view the data model for the workshop database.</para>
+ <para>In the Hibernate Configurations view, select "workshop" project and expand the
+ <property>Configuration</property> node. Select the <property>Customers</property> entity,
+ right click on it, choose <property>Open Mapping Diagram</property>.</para>
+ <figure>
+ <title>Mapping Diagram Opening</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam44.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>You see a Diagram tab for the CUSTOMERS table and any tables that have FK references.
+ This is a handy way to view the data model and JPA mappings. Now, you’ve got access to
+ something that the Erwin Data Modeler can’t do.</para>
+ <figure>
+ <title>Diagram Tab</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam45.png" scale="80"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ </section>
+ <section id="rich_components">
+ <title>Rich Components</title>
+ <para>This lab will conclude with one last AJAX twist. In this section we add a RichFaces
+ <property>inputNumberSlider</property> to the Order Details edit screen.</para>
+ <section id="add_richfaces">
+ <title>Add a Richfaces component to the CRUD Application</title>
+ <para>Switch to Seam perspective, open <emphasis>
+ <property>WebContent/OrderdetailsEdit.xhtml</property>
+ </emphasis> in JBoss Developer Studio.</para>
+ <para>Change the form field values using the visual editor. Seam has generated the form field
+ names that match the database column names. This is not ideal for business users.</para>
+ <figure>
+ <title>Form Fields Editing</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam46.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Also, replace the QTY Ordered input field with a <property>inputNumberSlider</property>.
+ You can use the JBoss Developer Studio palette or right click on the form and insert the
+ RichFaces component.</para>
+ <figure>
+ <title>Insert RichFaces Component from Context Menu</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam47.png" scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>One the last option is to use the source view and manually copy the inputNumberSlider
+ markup listed below:</para>
+ <programlisting><![CDATA[<rich:inputNumberSlider id="quantityOrdered" required="true"
+ value="#{orderdetailsHome.instance.quantityordered}"/>]]></programlisting>
+ <figure>
+ <title>Manually coping Source Code</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam48.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The end result is an edit page that has better form labels and a new RichFaces
+ control.</para>
+ <figure>
+ <title>The Result Page</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/first_seam/first_seam49.png" scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Congratulations! You have completed the JBoss Developer Studio lab.</para>
+ </section>
+ </section>
+</chapter>
\ No newline at end of file
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam13.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam3.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam5.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam8.png
===================================================================
(Binary files differ)
14 years, 7 months
JBoss Tools SVN: r22410 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-05-28 09:11:43 -0400 (Fri, 28 May 2010)
New Revision: 22410
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java
Log:
https://jira.jboss.org/browse/JBIDE-6387
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java 2010-05-28 12:15:51 UTC (rev 22409)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java 2010-05-28 13:11:43 UTC (rev 22410)
@@ -84,7 +84,8 @@
String[] ps = ((IMethod)context).getTypeParameterSignatures();
for (int i = 0; i < ps.length; i++) {
String t = ps[i];
- if(t.endsWith(":")) t = t.substring(0, t.length() - 1);
+ int cp = t.indexOf(":");
+ if(cp > 0) t = t.substring(0, cp);
t = "Q" + t + ";";
if(t.equals(result.getSignature())) {
cache.put(key, result);
14 years, 7 months
JBoss Tools SVN: r22409 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: messages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-05-28 08:15:51 -0400 (Fri, 28 May 2010)
New Revision: 22409
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6287 , update.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2010-05-28 10:59:31 UTC (rev 22408)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2010-05-28 12:15:51 UTC (rev 22409)
@@ -30,7 +30,11 @@
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
@@ -467,13 +471,26 @@
@Override
public void run() {
/*
- * Externalize strings action
- * Show a dialog to add properties key and value
+ * Externalize strings action .
+ * Show a dialog to add properties key and value.
+ * When selection is correct show the dialog
+ * otherwise show warning message.
*/
- ExternalizeStringsDialog dlg = new ExternalizeStringsDialog(
- PlatformUI.getWorkbench().getDisplay().getActiveShell(),
- controller);
- dlg.open();
+ ISelection sel = controller.getSourceEditor().getSelectionProvider().getSelection();
+ if ((sel instanceof TextSelection)
+ && (sel instanceof IStructuredSelection)
+ && (((IStructuredSelection) sel).size() == 1)) {
+ ExternalizeStringsDialog dlg = new ExternalizeStringsDialog(
+ PlatformUI.getWorkbench().getDisplay().getActiveShell(),
+ controller);
+ dlg.open();
+ } else {
+ MessageDialog.openWarning(
+ PlatformUI.getWorkbench().getDisplay().getActiveShell(),
+ VpeUIMessages.EXTRNALIZE_STRINGS_DIALOG_TITLE,
+ VpeUIMessages.EXTRNALIZE_STRINGS_DIALOG_WRONG_SELECTION);
+ }
+
}
};
externalizeStringsAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-05-28 10:59:31 UTC (rev 22408)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-05-28 12:15:51 UTC (rev 22409)
@@ -168,6 +168,7 @@
public static String EXTRNALIZE_STRINGS_DIALOG_PROPS_STRINGS_GROUP;
public static String EXTRNALIZE_STRINGS_DIALOG_PROPS_FILES_GROUP;
public static String EXTRNALIZE_STRINGS_DIALOG_INITIALIZATION_ERROR;
+ public static String EXTRNALIZE_STRINGS_DIALOG_WRONG_SELECTION;
public static String COULD_NOT_OPEN_VPE_RESOURCES_DIALOG;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-05-28 10:59:31 UTC (rev 22408)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-05-28 12:15:51 UTC (rev 22409)
@@ -156,6 +156,7 @@
EXTRNALIZE_STRINGS_DIALOG_PROPS_STRINGS_GROUP=Externalize strings
EXTRNALIZE_STRINGS_DIALOG_PROPS_FILES_GROUP=Handle properties file
EXTRNALIZE_STRINGS_DIALOG_INITIALIZATION_ERROR=Could not initialize externalization dialog!
+EXTRNALIZE_STRINGS_DIALOG_WRONG_SELECTION=Wrong selection! Please select correct string.
# Other messages
CANNOT_LOAD_TAGLIBS_FROM_PAGE_CONTEXT=Cannot load taglibs from PageContext!
14 years, 7 months
JBoss Tools SVN: r22408 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-05-28 06:59:31 -0400 (Fri, 28 May 2010)
New Revision: 22408
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
Log:
https://jira.jboss.org/browse/JBIDE-6380
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2010-05-28 10:49:17 UTC (rev 22407)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2010-05-28 10:59:31 UTC (rev 22408)
@@ -433,6 +433,8 @@
for (IQualifierDeclaration d: ds) {
if(d.getQualifier() != null && d.getQualifier().getInheritedDeclaration() != null) {
result.add(d);
+ } else if(isSpecializing()) {
+ result.add(d);
}
}
return result;
14 years, 7 months
JBoss Tools SVN: r22407 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-05-28 06:49:17 -0400 (Fri, 28 May 2010)
New Revision: 22407
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6287 , update.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-05-28 10:34:46 UTC (rev 22406)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-05-28 10:49:17 UTC (rev 22407)
@@ -148,7 +148,7 @@
# Externalize Strings Dialog
EXTRNALIZE_STRINGS_DIALOG_TITLE=Externalize Strings Dialog
EXTRNALIZE_STRINGS_DIALOG_DESCRIPTION=Externalize your strings via properties file
-EXTRNALIZE_STRINGS_DIALOG_TEXT_STRING=Text sting:
+EXTRNALIZE_STRINGS_DIALOG_TEXT_STRING=Text string:
EXTRNALIZE_STRINGS_DIALOG_PROPERTIES_KEY=Properties key:
EXTRNALIZE_STRINGS_DIALOG_PROPERTIES_VALUE=Properties value:
EXTRNALIZE_STRINGS_DIALOG_PROPERTIES_FILE=Properties file:
14 years, 7 months