JBoss Tools SVN: r3507 - in trunk/seam/plugins/org.jboss.tools.seam.ui: src/org/jboss/tools/seam/ui/preferences and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-10 10:50:21 -0400 (Mon, 10 Sep 2007)
New Revision: 3507
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CheckBoxFieldEditor.java
Log:
JBIDE-825 Added project property page Seam Settings.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-09-10 14:47:50 UTC (rev 3506)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-09-10 14:50:21 UTC (rev 3507)
@@ -336,6 +336,15 @@
</adapt>
</enabledWhen>
</page>
+
+ <page
+ name="Seam Settings"
+ class="org.jboss.tools.seam.ui.preferences.SeamSettingsPreferencePage"
+ id="org.jboss.tools.seam.ui.propertyPages.SeamSettingsPreferencePage">
+ <enabledWhen>
+ <adapt type="org.eclipse.core.resources.IProject"/>
+ </enabledWhen>
+ </page>
</extension>
<extension
point="org.eclipse.ui.perspectives">
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java 2007-09-10 14:47:50 UTC (rev 3506)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java 2007-09-10 14:50:21 UTC (rev 3507)
@@ -47,6 +47,8 @@
*/
SeamRuntimeListFieldEditor seamRuntimes
= new SeamRuntimeListFieldEditor("rtlist","Runtime List",new ArrayList<SeamRuntime>(Arrays.asList(SeamRuntimeManager.getInstance().getRuntimes())));
+
+ SeamRuntime initialDefault;
/**
*
@@ -77,6 +79,9 @@
GridLayout gl = new GridLayout(3,false);
root.setLayout(gl);
seamRuntimes.doFillIntoGrid(root);
+
+ initialDefault = SeamRuntimeManager.getInstance().getDefaultRuntime();
+
return root;
}
@@ -100,6 +105,9 @@
for (SeamRuntime rt : seamRuntimes.getAddedSeamRuntimes()) {
SeamRuntimeManager.getInstance().addRuntime(rt);
}
+ if(initialDefault != null && seamRuntimes.getDefaultSeamRuntime() != initialDefault) {
+ initialDefault.setDefault(false);
+ }
seamRuntimes.getDefaultSeamRuntime().setDefault(true);
SeamRuntimeManager.getInstance().save();
}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2007-09-10 14:50:21 UTC (rev 3507)
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.preferences;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.dialogs.PropertyPage;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
+import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.seam.ui.widget.editor.SwtFieldEditorFactory;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class SeamSettingsPreferencePage extends PropertyPage {
+ IProject project;
+
+ IFieldEditor seamEnablement;
+ IFieldEditor runtime;
+
+ public SeamSettingsPreferencePage() {
+ }
+
+ public void setElement(IAdaptable element) {
+ super.setElement(element);
+ project = (IProject)getElement().getAdapter(IProject.class);
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, false);
+ boolean hasSeamSupport = seamProject != null;
+ seamEnablement = SwtFieldEditorFactory.INSTANCE.createCheckboxEditor("Seam support", "Seam support", false);
+ seamEnablement.setValue(hasSeamSupport);
+
+ SeamRuntime[] rs = SeamRuntimeManager.getInstance().getRuntimes();
+ List<String> values = new ArrayList<String>();
+ String defaultValue = null;
+ for (int i = 0; i < rs.length; i++) {
+ values.add(rs[i].getName());
+ if(rs[i].isDefault()) defaultValue = rs[i].getName();
+ }
+ runtime = SwtFieldEditorFactory.INSTANCE.createComboEditor("Runtime", "Runtime", values, defaultValue);
+
+ List<IFieldEditor> editorOrder = new ArrayList<IFieldEditor>();
+ editorOrder.add(seamEnablement);
+ editorOrder.add(runtime);
+
+ if(hasSeamSupport) {
+ SeamRuntime current = seamProject.getRuntime();
+ if(current != null) runtime.setValue(current.getName());
+ } else {
+ if(defaultValue != null) runtime.setValue(defaultValue);
+ }
+
+ seamEnablement.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ Object value = evt.getNewValue();
+ if(value instanceof Boolean) {
+ boolean v = ((Boolean)value).booleanValue();
+ updateRuntimeEnablement(v);
+ validate();
+ }
+ }
+ });
+
+ runtime.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ validate();
+ }
+ });
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ int columnNumber = 1;
+ for (IFieldEditor fieldEditor : editorOrder) {
+ if(fieldEditor.getNumberOfControls()>columnNumber)
+ columnNumber=fieldEditor.getNumberOfControls();
+ }
+ GridLayout gl = new GridLayout(columnNumber, false);
+ gl.verticalSpacing = 5;
+ gl.marginTop = 3;
+ gl.marginLeft = 3;
+ gl.marginRight = 3;
+ composite.setLayout(gl);
+ for (IFieldEditor fieldEditor2 : editorOrder) {
+ fieldEditor2.doFillIntoGrid(composite);
+ }
+
+ runtime.setEditable(false);
+ if(!hasSeamSupport) {
+ updateRuntimeEnablement(false);
+ }
+
+ return composite;
+ }
+
+ public boolean performOk() {
+ if(getSeamSupport()) {
+ addSeamSupport();
+ changeRuntime();
+ } else {
+ removeSeamSupport();
+ }
+ return true;
+ }
+
+ private void updateRuntimeEnablement(boolean enabled) {
+ Object[] cs = runtime.getEditorControls();
+ for (int i = 0; i < cs.length; i++) {
+ if(cs[i] instanceof Control) {
+ ((Control)cs[i]).setEnabled(enabled);
+ }
+ }
+ }
+
+ private void removeSeamSupport() {
+ try {
+ EclipseResourceUtil.removeNatureFromProject(project, ISeamProject.NATURE_ID);
+ } catch (CoreException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ private void addSeamSupport() {
+ try {
+ EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
+ } catch (CoreException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ private void changeRuntime() {
+ String name = getRuntimeName();
+ SeamRuntime r = SeamRuntimeManager.getInstance().findRuntimeByName(name);
+ if(r == null) return;
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, false);
+ seamProject.setRuntime(r);
+ }
+
+ private boolean getSeamSupport() {
+ Object o = seamEnablement.getValue();
+ return o instanceof Boolean && ((Boolean)o).booleanValue();
+ }
+
+ private String getRuntimeName() {
+ return runtime.getValueAsString();
+ }
+
+ private void validate() {
+ //TODO
+ }
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CheckBoxFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CheckBoxFieldEditor.java 2007-09-10 14:47:50 UTC (rev 3506)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CheckBoxFieldEditor.java 2007-09-10 14:50:21 UTC (rev 3507)
@@ -64,6 +64,9 @@
CheckBoxField checkBoxFild= new CheckBoxField(parent);
checkBoxFild.addPropertyChangeListener(this);
checkBoxControl = checkBoxFild.getCheckBox();
+ if(getValue() instanceof Boolean) {
+ checkBoxFild.getCheckBox().setSelection(((Boolean)getValue()).booleanValue());
+ }
} else if(parent!=null) {
Assert.isTrue(checkBoxControl.getParent()==parent);
}
16 years, 9 months
JBoss Tools SVN: r3506 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-10 10:47:50 -0400 (Mon, 10 Sep 2007)
New Revision: 3506
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
JBIDE-825 Added project property page Seam Settings.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-09-10 14:37:05 UTC (rev 3505)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-09-10 14:47:50 UTC (rev 3506)
@@ -34,6 +34,13 @@
* @return
*/
public SeamRuntime getRuntime();
+
+ /**
+ *
+ * @param runtime
+ * @return
+ */
+ public void setRuntime(SeamRuntime runtime);
/**
* Returns list of scope objects for all scope types.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-09-10 14:37:05 UTC (rev 3505)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-09-10 14:47:50 UTC (rev 3506)
@@ -114,6 +114,12 @@
return runtime;
}
+ public void setRuntime(SeamRuntime runtime) {
+ if(this.runtime == runtime) return;
+ this.runtime = runtime;
+ storeRuntime();
+ }
+
/**
* Returns list of scope objects for all scope types.
* @return
16 years, 9 months
JBoss Tools SVN: r3505 - branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: ezheleznyakov
Date: 2007-09-10 10:37:05 -0400 (Mon, 10 Sep 2007)
New Revision: 3505
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-847
Code adjustment
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java 2007-09-10 12:46:29 UTC (rev 3504)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java 2007-09-10 14:37:05 UTC (rev 3505)
@@ -55,7 +55,6 @@
private static String STYLE = "style=";
private static String OPEN_BRACKET = "{";
-
private static String CLOSE_BRACKET = "}";
private static String SPACE = " ";
@@ -64,6 +63,14 @@
private static String EMPTY_STRING = "";
+ private static String HTML = "html";
+ private static String XHTML = "xhtml";
+ private static String XML = "xml";
+ private static String JAVA = "java";
+ private static String CPP = "cpp";
+ private static String GROOVY = "groovy";
+ private static String LZX = "lzx";
+
private nsIDOMDocument visualDocument;
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
@@ -133,16 +140,14 @@
HashMap<String, String> map = new HashMap<String, String>();
- if (highlightValue.equalsIgnoreCase("html")
- || highlightValue.equalsIgnoreCase("xhtml")
- || highlightValue.equalsIgnoreCase("lzx"))
- highlightValue = "xml";
- if (highlightValue.equalsIgnoreCase("groovy")) {
- highlightValue = "java";
- }
- if (highlightValue.equalsIgnoreCase("c++")) {
- highlightValue = "cpp";
- }
+ if (highlightValue.equalsIgnoreCase(HTML)
+ || highlightValue.equalsIgnoreCase(XHTML)
+ || highlightValue.equalsIgnoreCase(LZX))
+ highlightValue = XML;
+ if (highlightValue.equalsIgnoreCase(GROOVY))
+ highlightValue = JAVA;
+ if (highlightValue.equalsIgnoreCase("c++"))
+ highlightValue = CPP;
String sym = "." + highlightValue + "_";
@@ -202,7 +207,7 @@
* value of highlight attribute
* @return true of highlight value correct
*/
-
+
private boolean serchInSupportedTypes(String highlightValue) {
if (highlightValue == null)
@@ -262,7 +267,7 @@
* @param data
* The arbitrary data, built by a method <code>create</code>
* @param name
- * Atrribute name
+ * Attribute name
* @param value
* Attribute value
* @return <code>true</code> if it is required to re-create an element at
16 years, 9 months
JBoss Tools SVN: r3504 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2007-09-10 08:46:29 -0400 (Mon, 10 Sep 2007)
New Revision: 3504
Removed:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml.bak
Log:
the file is unnecessary
Deleted: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml.bak
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml.bak 2007-09-10 12:34:44 UTC (rev 3503)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml.bak 2007-09-10 12:46:29 UTC (rev 3504)
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="GettingStartedWithRHDS" xreflabel="GettingStartedWithRHDS">
- <?dbhtml filename="GettingStartedWithRHDS.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>Red Hat Developer Studio</keyword>
- <keyword>Eclipse</keyword>
- <keyword>Java</keyword>
- <keyword>Tomcat</keyword>
- </keywordset>
- </chapterinfo>
- <title>Getting Started with Red Hat Developer Studio</title>
- <section id="Installing">
- <?dbhtml filename="Installing.html"?>
-<title>Installing</title>
- <section id="Inst from down ver">
- <title>Installing from the downloaded version</title>
- <itemizedlist>
- <listitem>
- <para>Download the appropriate installation file for your platform from www.exadel.com/web/portal/download.</para>
- </listitem>
- <listitem>
- <para>Run install.jar and follow the instructions presented by the installation wizard.</para>
- </listitem>
- </itemizedlist>
-
- <figure>
- <title>Red Hat Developer Studio Installation Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/install.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Installation process includes all required platforms to run Red Hat Developer Studio:</para>
- <itemizedlist>
- <listitem>
- <para>Eclipse 3.2.2</para>
- </listitem>
- <listitem>
- <para>JBoss J2EE Application Server</para>
- <figure>
- <title>JBoss J2EE Application Server installing</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/install2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <note>The installer will install JBoss J2EE Application Server for running your applications if you select this option during the installation process.
- If you want to use a different server than ours, you can change the setting in Red Hat Developer Studio.</note>
- </listitem>
- </itemizedlist>
- </section>
- <section id="InstallingthroughTheUpdateSite">
- <?dbhtml filename="InstallingthroughTheUpdateSite.html"?>
- <title>Installing via update Site</title>
- TBD
- </section>
-
-
- </section>
- <section id="Upgrading">
- <?dbhtml filename="Upgrading.html"?>
- <title>Upgrading</title>
- <para>To upgrade, just uninstall your current version and install the new version.</para>
- </section>
- <section id="Uninstalling">
- <?dbhtml filename="Uninstalling.html"?>
- <title>Uninstalling</title>
-
- <para>Make sure Red Hat Developer Studio is not running.</para>
- <para>Uninstall your current version of Red Hat Developer Studio by running uninstaller.</para>
-
- </section>
- <section id="Subscription">
- <?dbhtml filename="Subscription.html"?>
- <title>Subscription</title>
- TBD
- </section>
- <section id="Support">
- <?dbhtml filename="Support.html"?>
- <title>Support</title>
- <para>If you have comments or questions, you can send them to
- <ulink url="mailto:support@exadel.com">support(a)exadel.com</ulink> or
- <ulink url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=258">Red Hat Developer Studio Forum</ulink>.</para>
- <para>When writing to support, please include the following information:</para>
- <itemizedlist>
- <listitem><para> Red Hat Developer Studio version</para></listitem>
- <listitem><para>Exact error message</para></listitem>
- <listitem><para>Exact steps you took to get the error</para></listitem>
- </itemizedlist>
- </section>
-<section id="FAQ">
- <?dbhtml filename="FAQ.html"?>
- <title>FAQ</title>
- <para>For easy reference to Red Hat Developer Studio related questions, our FAQ provides answers to our most "popular" questions.
- The sections of questions are organized by type. For further support, please contact support(a)exadel.com.</para>
- <section id="Before_Installing">
- <title>Before Installing, Tutorials, Examples, Readme Files</title>
- <para><emphasis role="bold">I'm looking for examples, do you have any?</emphasis></para>
- <para>Yes, simply go to our tutorials page</para>
- <para><emphasis role="bold">Where can I find the Red Hat Developer Studio readme file?</emphasis></para>
- <para>It's at http://www.exadel.com/web/portal/products/ReleaseNotes</para>
- <para><emphasis role="bold">Where can I find some documentation for Red Hat Developer Studio?</emphasis></para>
- <para>Try these resources:</para>
- <para>TBD</para>
- <para><emphasis role="bold">What version of Eclipse does Red Hat Developer Studio support?</emphasis></para>
- <para>Red Hat Developer Studio works with Eclipse 3.2.2 </para>
- </section>
- <section id="Downloading">
- <title>Downloading</title>
- <para><emphasis role="bold">Where can I download a copy of Red Hat Developer Studio?</emphasis></para>
- <para>Simply go TBD. </para>
- </section>
- <section id="Installation_Issues">
- <title>Installation Issues</title>
- <para><emphasis role="bold">Do I need to have JBoss server installed to run Red Hat Developer Studio?</emphasis></para>
- <para>No. Red Hat Developer Studio already comes bundled with JBoss server. We bundle it together so that you don't need to download any
- additional software and can test your application in a Web browser right away.</para>
- <para>If you want to use a different JBoss server installation, after installing, simply go to preferences and change the settings to point to another
- Jboss server installation.</para>
- <para>Red Hat Developer Stuiod works with any serlvet container, not just JBoss. For more information on deployment, please see the Deploying Your Application section.</para>
- <para><emphasis role="bold"> What third-party plug-ins are installed with RHDS?</emphasis></para>
- <para>Read the <link linkend="Installing">Installing</link> section.</para>
- </section>
- <section id="Importing_Projects">
- <title>Importing Projects</title>
- <para><emphasis role="bold">I have an existing Struts or JSF project. Can I open the project in RHDS?</emphasis></para>
- <para>Yes. Read the TBD</para>
- <para><emphasis role="bold">Can I import a .war file?</emphasis></para>
- <para>Yes. Read the TBD</para>
- </section>
- <section id="Troubleshooting">
- <title>Troubleshooting, Problems, Configuration, Error Messages</title>
- <para><emphasis role="bold">Is it possible to increase the performance of Eclipse after installing your product? My Eclipse now crawls.</emphasis></para>
- <para>By default, Eclipse allocates only 128 Mb of memory whatever physical memory you actually have installed. You can significantly increase performance
- if you allocate more memory. For example:</para>
- <para>eclipse.exe -vmargs -Xmx512M</para>
- <para><emphasis role="bold">How can I add my own tag library to the Red Hat Palette?</emphasis></para>
- <para>See Adding Tag Libraries in JBossJSFTools Guide</para>
- <para><emphasis role="bold">I see the Oracle ADF Faces component library tags in the Red Hat Palette, but I can't seem to find the libraries for ADF.
- How do I use this component library with RHDS?</emphasis></para>
- <para>See Adding Support for the Oracle ADF Components Library in the RHDS User Guide.</para>
-
- </section>
-</section>
-
-<section id="OtherRelevantResourcesOnTheTopic33">
-<?dbhtml filename="OtherRelevantResourcesOnTheTopic33.html"?>
-<title>Other relevant resources on the topic</title>
-<para>RHDS on JBoss: <ulink url="http://labs.jboss.com/rhdevstudio/">Red Hat Developer Studio</ulink></para>
-<para>Forum: <ulink url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=258">JBoss Forum</ulink></para>
-<para>Download: <ulink url="http://www.exadel.com/web/portal/download/esp35">RHDS Download</ulink></para>
-</section>
-</chapter>
-
16 years, 9 months
JBoss Tools SVN: r3503 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2007-09-10 08:34:44 -0400 (Mon, 10 Sep 2007)
New Revision: 3503
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml
Log:
http://jira.jboss.com/jira/browse/RHDS-149
code patten is fixed
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml 2007-09-10 10:27:27 UTC (rev 3502)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml 2007-09-10 12:34:44 UTC (rev 3503)
@@ -24,11 +24,11 @@
<listitem><para>Download and install the appropriate -compat RPM from JPackage <ulink url="ftp://jpackage.hmdc.harvard.edu/JPackage/1.7/generic/RPMS.non-free/">here</ulink>.
Please ensure you choose a matching version of the -compat package to the JDK you installed.</para></listitem>
<listitem><para>Create an environment variable that points to the JDK installation directory and call it JAVA_HOME. Add <emphasis>$JAVA_HOME/bin</emphasis> to the system path to be able to run java from the
- command line. You can do this by adding the following lines to the .bashrc file in your home directory.
+ command line. You can do this by adding the following lines to the .bashrc file in your home directory.</para>
<programlisting role="JAVA"><![CDATA[#In this example /usr/java/jdk1.5.0_11 is the JDK installation directory.
export JAVA_HOME=/usr/java/jdk1.5.0_11
export PATH=$PATH:$JAVA_HOME/bin]]></programlisting>
-</para></listitem>
+</listitem>
</itemizedlist>
<note>
<title>Note:</title>
16 years, 9 months
JBoss Tools SVN: r3502 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-09-10 06:27:27 -0400 (Mon, 10 Sep 2007)
New Revision: 3502
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/DirectoryBrowseField.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettings.java
Log:
the custom template directory can now be selected from either workspace or filesystem
http://jira.jboss.com/jira/browse/JBIDE-880
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2007-09-10 07:46:53 UTC (rev 3501)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2007-09-10 10:27:27 UTC (rev 3502)
@@ -208,6 +208,12 @@
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
final IResource resource = findMember( root, attributes.getOutputPath() );
final IResource templateres = findMember(root, attributes.getTemplatePath());
+ String templatePath = null;
+
+ if (new File(attributes.getTemplatePath()).exists())
+ {
+ templatePath = attributes.getTemplatePath();
+ }
/*if (!resource.exists() || !(resource instanceof IContainer) ) {
throwCoreException("Output directory \"" + configName + "\" does not exist.");
@@ -225,6 +231,7 @@
if (monitor.isCanceled())
return null;
+ final String finalTemplatePath = templatePath;
return (ArtifactCollector) cc.execute(new Command() {
private ArtifactCollector artifactCollector = new ArtifactCollector();
@@ -235,6 +242,8 @@
if(templateres!=null) {
templatePaths = new String[] { getLocation( templateres ).toOSString() }; // TODO: this should not be..should it ?
+ } else if (finalTemplatePath != null) {
+ templatePaths = new String[] { finalTemplatePath };
}
// Global properties
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettings.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettings.java 2007-09-10 07:46:53 UTC (rev 3501)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettings.java 2007-09-10 10:27:27 UTC (rev 3502)
@@ -21,6 +21,8 @@
*/
package org.hibernate.eclipse.launch;
+import java.io.File;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -82,7 +84,7 @@
private SelectionButtonDialogField autoManyToMany;
private SelectionButtonDialogField useOwnTemplates;
- private StringButtonDialogField templatedir;
+ private DirectoryBrowseField templatedir;
@@ -98,7 +100,7 @@
GridLayout layout = new GridLayout();
container.setLayout(layout);
- layout.numColumns = 3;
+ layout.numColumns = 4;
layout.verticalSpacing = 10;
consoleConfigurationName = new ComboDialogField(SWT.READ_ONLY);
@@ -131,17 +133,11 @@
outputdir.setLabelText("Output &directory:");
outputdir.setButtonLabel("&Browse...");
- templatedir = new StringButtonDialogField(new IStringButtonAdapter() {
- public void changeControlPressed(DialogField field) {
- IPath[] paths = DialogSelectionHelper.chooseFileEntries(getShell(), getTemplateDirectory(), new IPath[0], "Select template directory", "Choose directory containing custom templates", new String[0], false, true, false);
- if(paths!=null && paths.length==1) {
- templatedir.setText( ( (paths[0]).toOSString() ) );
- }
- }
- });
+ templatedir = new DirectoryBrowseField(null, null, "Select template directory", "Choose directory containing custom templates");
templatedir.setDialogFieldListener(fieldlistener);
templatedir.setLabelText("Template &directory:");
- templatedir.setButtonLabel("&Browse...");
+ templatedir.setFilesystemBrowseLabel("&Filesystem...");
+ templatedir.setWorkspaceBrowseLabel("&Workspace...");
packageName = new StringDialogField();
packageName.setDialogFieldListener(fieldlistener);
@@ -228,23 +224,23 @@
useOwnTemplates.attachDialogField(templatedir);
reverseengineer.attachDialogFields(new DialogField[] { packageName, preferRawCompositeIds, reverseEngineeringSettings, reverseEngineeringStrategy, autoManyToMany, autoVersioning });
- consoleConfigurationName.doFillIntoGrid(container, 3);
- Control[] controls = outputdir.doFillIntoGrid(container, 3);
+ consoleConfigurationName.doFillIntoGrid(container, 4);
+ Control[] controls = outputdir.doFillIntoGrid(container, 4);
// Hack to tell the text field to stretch!
( (GridData)controls[1].getLayoutData() ).grabExcessHorizontalSpace=true;
- reverseengineer.doFillIntoGrid(container, 3);
- packageName.doFillIntoGrid(container, 3);
- reverseEngineeringSettings.doFillIntoGrid(container, 3);
- reverseEngineeringStrategy.doFillIntoGrid(container, 3);
+ reverseengineer.doFillIntoGrid(container, 4);
+ packageName.doFillIntoGrid(container, 4);
+ reverseEngineeringSettings.doFillIntoGrid(container, 4);
+ reverseEngineeringStrategy.doFillIntoGrid(container, 4);
fillLabel(container);
- preferRawCompositeIds.doFillIntoGrid(container, 2);
+ preferRawCompositeIds.doFillIntoGrid(container, 3);
fillLabel(container);
- autoVersioning.doFillIntoGrid(container, 2);
+ autoVersioning.doFillIntoGrid(container, 3);
fillLabel(container);
- autoManyToMany.doFillIntoGrid(container, 2);
- useOwnTemplates.doFillIntoGrid(container, 3);
- controls = templatedir.doFillIntoGrid(container, 3);
+ autoManyToMany.doFillIntoGrid(container, 3);
+ useOwnTemplates.doFillIntoGrid(container, 4);
+ controls = templatedir.doFillIntoGrid(container, 4);
// Hack to tell the text field to stretch!
( (GridData)controls[1].getLayoutData() ).grabExcessHorizontalSpace=true;
@@ -268,7 +264,7 @@
return;
}
- String msg = checkDirectory(getOutputDirectory(), "output directory");
+ String msg = checkDirectory(getOutputDirectory(), "output directory", false);
if (msg!=null) {
updateStatus(msg);
@@ -292,7 +288,7 @@
}
if(useOwnTemplates.isSelected() ) {
- msg = checkDirectory(getTemplateDirectory(), "template directory");
+ msg = checkDirectory(getTemplateDirectory(), "template directory", true);
if (msg!=null) {
updateStatus(msg);
return;
@@ -331,7 +327,13 @@
- protected String checkDirectory(IPath path, String name) {
+ protected String checkDirectory(IPath path, String name, boolean checkFilesystem) {
+ if (checkFilesystem) {
+ if (path != null && new File(path.toOSString()).exists()) {
+ return null;
+ }
+ }
+
IResource res= ResourcesPlugin.getWorkspace().getRoot().findMember(path);
if (res != null) {
int resType= res.getType();
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/DirectoryBrowseField.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/DirectoryBrowseField.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/DirectoryBrowseField.java 2007-09-10 10:27:27 UTC (rev 3502)
@@ -0,0 +1,151 @@
+package org.hibernate.eclipse.launch;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.internal.ui.util.SWTUtil;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
+
+public class DirectoryBrowseField extends StringDialogField {
+
+ protected Button filesystemBrowse, workspaceBrowse;
+ protected String filesystemBrowseLabel, workspaceBrowseLabel;
+ protected IPath initialFilesystemPath, initialWorkspacePath;
+ protected String dialogTitle, dialogDescription;
+
+ public DirectoryBrowseField (IPath initialFilesystemPath, IPath initialWorkspacePath, String dialogTitle, String dialogDescription)
+ {
+ super();
+
+ filesystemBrowseLabel = "Filesystem...";
+ workspaceBrowseLabel = "Workspace..";
+
+ this.initialFilesystemPath = initialFilesystemPath;
+ this.initialWorkspacePath = initialWorkspacePath;
+ this.dialogTitle = dialogTitle;
+ this.dialogDescription = dialogDescription;
+ }
+
+ protected void updateEnableState() {
+ super.updateEnableState();
+ boolean enabled = isEnabled();
+
+ if (filesystemBrowse != null)
+ filesystemBrowse.setEnabled(enabled);
+ if (workspaceBrowse != null)
+ workspaceBrowse.setEnabled(enabled);
+ }
+
+ protected static GridData gridDataForButton(Button button, int span) {
+ GridData gd= new GridData();
+ gd.horizontalAlignment= GridData.FILL;
+ gd.grabExcessHorizontalSpace= false;
+ gd.horizontalSpan= span;
+ gd.widthHint = SWTUtil.getButtonWidthHint(button);
+ return gd;
+ }
+
+ public int getNumberOfControls() {
+ return 4;
+ }
+
+ public Control[] doFillIntoGrid(Composite parent, int columns) {
+ assertEnoughColumns(columns);
+
+ Label label = getLabelControl(parent);
+ label.setLayoutData(gridDataForLabel(1));
+
+ Text text = getTextControl(parent);
+ text.setLayoutData(gridDataForText(columns - 3));
+
+
+ Button filesystemButton = getFilesystemBrowseButton(parent);
+ filesystemButton.setLayoutData(gridDataForButton(filesystemButton, 1));
+ Button workspaceButton = getWorkspaceBrowseButton(parent);
+ filesystemButton.setLayoutData(gridDataForButton(workspaceButton, 1));
+
+ return new Control[] { label, text, filesystemButton, workspaceButton };
+ }
+
+ protected void browseFilesystem ()
+ {
+ DirectoryDialog dialog = new DirectoryDialog(filesystemBrowse.getShell());
+ dialog.setText(dialogTitle);
+ dialog.setMessage(dialogDescription);
+ if (initialFilesystemPath != null) {
+ dialog.setFilterPath(initialFilesystemPath.toOSString());
+ }
+
+ String dir = dialog.open();
+ if (dir != null)
+ {
+ setText(dir);
+ }
+ }
+
+ protected void browseWorkspace ()
+ {
+ IPath[] paths = DialogSelectionHelper.chooseFileEntries(filesystemBrowse.getShell(), initialWorkspacePath, new IPath[0], dialogTitle, dialogDescription, new String[0], false, true, false);
+ if(paths!=null && paths.length==1) {
+ setText(paths[0].toOSString());
+ }
+ }
+
+ public Button getFilesystemBrowseButton (Composite parent)
+ {
+ if (filesystemBrowse == null)
+ {
+ filesystemBrowse = new Button(parent, SWT.PUSH);
+ filesystemBrowse.setFont(parent.getFont());
+ filesystemBrowse.setText(filesystemBrowseLabel);
+ filesystemBrowse.setEnabled(isEnabled());
+ filesystemBrowse.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ browseFilesystem();
+ }
+ });
+ }
+
+ return filesystemBrowse;
+ }
+
+ public Button getWorkspaceBrowseButton (Composite parent)
+ {
+ if (workspaceBrowse == null)
+ {
+ workspaceBrowse = new Button(parent, SWT.PUSH);
+ workspaceBrowse.setFont(parent.getFont());
+ workspaceBrowse.setText(workspaceBrowseLabel);
+ workspaceBrowse.setEnabled(isEnabled());
+ workspaceBrowse.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ browseWorkspace();
+ }
+ });
+ }
+ return workspaceBrowse;
+ }
+
+ public void setFilesystemBrowseLabel(String filesystemBrowseLabel) {
+ this.filesystemBrowseLabel = filesystemBrowseLabel;
+ }
+
+ public void setWorkspaceBrowseLabel(String workspaceBrowseLabel) {
+ this.workspaceBrowseLabel = workspaceBrowseLabel;
+ }
+}
16 years, 9 months
JBoss Tools SVN: r3501 - branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2007-09-10 03:46:53 -0400 (Mon, 10 Sep 2007)
New Revision: 3501
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-744, some code adjustment
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-09-08 19:36:50 UTC (rev 3500)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-09-10 07:46:53 UTC (rev 3501)
@@ -1520,11 +1520,8 @@
}
nsIDOMElement getLastSelectedElement() {
- // TODO Max Areshkau figure out with last selected element
- //in mozilla user can select more than one element, but this
- //function can return only first element(think about this)
-
- return (nsIDOMElement) xulRunnerEditor.getSelection().getAnchorNode().queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ return xulRunnerEditor.getLastSelectedElement();
}
public void pushIncludeStack(VpeIncludeInfo includeInfo) {
16 years, 9 months
JBoss Tools SVN: r3500 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: juntao
Date: 2007-09-08 15:36:50 -0400 (Sat, 08 Sep 2007)
New Revision: 3500
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml
Log:
change seam chapter title
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml 2007-09-07 22:36:30 UTC (rev 3499)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml 2007-09-08 19:36:50 UTC (rev 3500)
@@ -1,426 +1,426 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="GetStartSeamGen" xreflabel="GetStartSeamGen">
- <?dbhtml filename="GetStartSeamGen.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>Red Hat Developer Studio</keyword>
- <keyword>Seam</keyword>
- <keyword>JBoss</keyword>
- </keywordset>
- </chapterinfo>
-
- <title>Write Your First Web Application</title>
-
- <para>The Red Hat Developer Studio provides sophisticated tools for enterprise applications. With the Red Hat Developer Studio, you can get started very quickly with a web prototype, and then scale up your application to include enterprise features (e.g., business processes, web services, etc.) using the same developer tools. It is a "scalable" RAD (Rapid Application Development) tool.</para>
-
- <para>A core element that makes the Red Hat Developer Studio "scalable" is the JBoss <property>Seam</property> framework. <property>Seam</property> is a fully featured application framework on top of Java EE 5. It is also one of the most popular enterprise Java framework today. <property>Seam</property> deeply integrates many other standard-based or open source frameworks (e.g., JSF, EJB3, JMS, Web Services, jBPM, JBoss Rules, Ajax4jsf, RichFaces, Facelets, Spring, iText, Quartz, TestNG etc.), and provides a single programming model for developers to "drive" those underlying frameworks via simple annotated POJOs (Plain Old Java Objects). It makes life easier for developers to tackle complex enterprise applications with many component frameworks.</para>
-
- <para>In this chapter, we will cover how to build a simple <property>Seam</property> web application in minutes with the Red Hat Developer Studio.</para>
-
- <section>
- <title>Create a Seam Project</title>
-
- <para>To create a new web application in <property>Seam</property>, select <emphasis>New > Project ... > Seam > Seam Web Project</emphasis>. You will be prompted to enter a name and a location directory for your new project. You will also be asked to choose a JBoss AS server to deploy the project. You must choose the JBoss AS 4.2.0 instance we had defined in the JBoss AS Server manager view.</para>
-
- <figure>
- <title>Create a Seam project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/SeamNewProj01.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Next, you will be asked to select the "features" you want to use in your project. This allows Red Hat Developer Studio to setup the appropriate tooling for your project. Since JBoss <property>Seam</property> integrates all popular Java EE frameworks, you can select any combination of technologies from the list. Here, for this project, we will select Dynamic Web Module, Java, Java Persistence (JPA), JavaServer Faces (JSF), and <property>Seam</property> Facet for a typical database-driven web application.</para>
-
- <figure>
- <title>Select toolings for the project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/SeamNewProj02.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>A dynamic web application contains both web pages and Java code. The wizard will ask you where you want to put those files. You can just leave the default values.</para>
-
- <figure>
- <title>Select directory names for web pages and Java files</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/SeamNewProj03.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
-
- <para>Now you need to define a connection profile and choose a database. If you have no connections yet you should create the one.</para>
- <orderedlist>
- <listitem><para>Click Next in the dialog "JPA Facet"</para></listitem>
- </orderedlist>
- <figure>
- <title>Select provider for JPA JARs</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/SeamNewProj04.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Since you selected JPA and JSF tooling support, the project needs to incorporate the JAR files for those frameworks on its classpath. In the next screen, 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>
- <orderedlist continuation="continues">
- <listitem><para>Check "Server Supplied JSF Implementation". We will use JSF implementation that comes with JBoss server</para></listitem>
- <listitem><para>Click Next</para></listitem>
- </orderedlist>
- <figure>
- <title>Define JSF Implementation</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/SeamNewProj044.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <orderedlist continuation="continues">
- <listitem><para>Click New button to create a new connection profile.</para></listitem>
- </orderedlist>
-
- <figure>
- <title>Create New Connection Profile</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/SeamNewProj045.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <orderedlist continuation="continues">
- <listitem><para>Give a name to your connection and some description. Click Next.</para></listitem>
- </orderedlist>
- <figure>
- <title>Give a name to connection profile</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/connectionprofile.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Now you need to specify driver and connection details.</para>
- <orderedlist continuation="continues">
- <listitem><para>Select Generic JDBC driver from the drop down list Click Next.</para></listitem>
- </orderedlist>
- <figure>
- <title>Select Driver</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/connectionprofile2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>A summary diallog will be prompted. Click Finish.</para>
-
- <figure>
- <title>Summary window</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/connectionprofile7.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The project setup wizard also asks you to configure how <property>Seam</property> generates code for the project. The <property>Seam</property> Home Folder should point to a valid <property>Seam</property> distribution. By default, it is set to the <property>Seam</property> distribution bundled in your Red Hat Developer Studio tool. For the deployment format, choose WAR deployment if you want to use POJOs for UI event handling and business logic; choose EAR deployment if you want to EJB3 beans for added features. In most web applications, the WAR deployment option would suffice. You should also enter Java packages for the entity beans (for database mapping) and session beans (for action handlers). All generated code will be placed in those packages. </para>
-
- <figure>
- <title>Enter Java packages for generated code</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/SeamNewProj06.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click on Finish to generate a project. The generated project contains all the necessary library JARs, XML configuration files, the ANT build script, as well as simple XHTML web pages and Java classes for the skeleton web application.</para>
-
-
- </section>
-
- <section>
- <title>Build and Deploy the Seam Application</title>
-
- <para>Once the application is generated, you can use the "Run on server" menu to build and deploy it into the JBoss AS runtime associated with the project. All you need is to start JBoss AS in the server manager, and load the browser at URL http://localhost:8080/MySeamProj/. You should see the following web page.</para>
-
- <figure>
- <title>The generated application in action</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/startedapplication.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>To make simple changes to the page, you just need to double click on the <emphasis>WebContent/home.xhtml file</emphasis> and edit it in the visual editor. Notice that the visual editor lets you both the XHTML code and the rendered page. The rendered view is designed to make it easy to find stuff in a complex XHTML page.</para>
-
- <figure>
- <title>Making changes in the visual editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/SeamJsfEditor.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Once you finished editing, save the file (<emphasis>File > Save</emphasis>), re-deploy the application, and reload the browser to see the changes.</para>
-
- <figure>
- <title>The front page is changed</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/xxxx.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <!-- Not yet ...
- <para>Notice that we do not need to re-build and re-deploy the application. Just save the edited page and reload the browser.</para>
- -->
-
- </section>
-
- <section>
- <title>Add a Web Page and an Action</title>
-
- <para>To add a new page and related UI action to the project, use the <emphasis>New > Other ... > Seam > Seam Form</emphasis> wizard. You are prompted to enter the name of the web page, the name for the <property>Seam</property> component that handles UI actions from the page, and UI action method name.</para>
-
- <figure>
- <title>New form for the application</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/xxxx.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The wizard generate a web page with a single text input field and an action button. Notice that the generated page uses layout/template.xhtml as a template. The template page provides the page header, footer, side menu, and CSS styles (see the template.xhtml for more details). The Simplepage.xhtml is assembled into the template when the Simplepage.seam URL is loaded.</para>
-
- <programlisting role="JSP"><![CDATA[
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- template="layout/template.xhtml">
-
-<ui:define name="body">
-
- <h1>Simplepage</h1>
- <p>Generated form page</p>
-
- <h:messages globalOnly="true" styleClass="message"/>
-
- <h:form id="simpleAction">
- <div class="dialog">
- <s:validateAll>
- <div class="prop">
- <span class="name">Value</span>
- <span class="value">
- <s:decorate>
- <h:inputText id="value" required="true"
- value="#{simpleAction.value}"/>
- </s:decorate>
- </span>
- </div>
- </s:validateAll>
- </div>
- <div class="actionButtons">
- <h:commandButton id="hello" value="hello"
- action="#{simpleAction.hello}"/>
- </div>
- </h:form>
-
-</ui:define>
-
-</ui:composition>
-]]></programlisting>
-
- <para>The #{simpleAction.value} notation on the web page maps to the "value" property in the backend component named "simpleAction", and the #{simpleAction.hello} notation indicates that the hello() method is called when the button is clicked on. Here is the "simpleAction" named backend <property>Seam</property> component generated by the wizard.</para>
-
- <programlisting role="JAVA"><![CDATA[
-@Name("simpleAction")
-public class SimpleAction {
-
- @Logger private Log log;
-
- @In
- FacesMessages facesMessages;
-
- private String value;
-
- //seam-gen method
- public String hello()
- {
- //implement your business logic here
- log.info("simpleAction.echo() action called with: #{simpleAction.value}");
- facesMessages.add("echo #{simpleAction.value}");
- return "success";
- }
-
- //add additional action methods
-
- @Length(max=10)
- public String getValue()
- {
- return value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
-}
-]]></programlisting>
-
- <para>Load the Simplepage.seam in the web browser. Type something in the text field and click on the "hello" button. A JSF message containing the input string is created by the SimpleAction.hello() method. The message is displayed on the page via the h:messages tag.</para>
-
- </section>
-
- <section>
- <title>Input Validation</title>
-
- <para>Notice that in the generated SimpleAction class, there is a @Length annotation to validate the input when the input string is bound to #{simpleAction.value}. To see how this works, enter a text string longer than 10 chars and click on the button. This is what you should see.</para>
-
- <figure>
- <title>The input validation in action</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/xxxx.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para><property>Seam</property> supports many different input validation annotations. To see an example, you can replace the @Length(max=10) annotation with the following. It would require the input string to have a first name and last name separated by a space. If the validation fails, the web page would print the customized error message.</para>
-
- <programlisting role="JAVA"><![CDATA[
-@NotNull
-@Pattern(regex="^[a-zA-Z.-]+ [a-zA-Z.-]+",
- message="Need a firstname and a lastname")
-public String getValue()
-{
- return value;
-}
-]]></programlisting>
-
- <para>Save the Java file, deploy the application, and reload the browser to see the new validation scheme in action.</para>
-
- <figure>
- <title>More input validation</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/xxxx.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
-
- <section>
- <title>Add a new UI Component</title>
-
- <para>Now, let's add a little more logic to the application. We will add a new boolean property to the action component. If it is set to true, the action would capitalize the input string and display it on the web page. The following code in the SimpleAction class implements the logic.</para>
-
- <programlisting role="JAVA"><![CDATA[
-@Name("simpleAction")
-public class SimpleAction {
-
- private boolean convertToCap;
-
- public boolean getConvertToCap () { return convertToCap; }
- public void setConvertToCap (boolean b) { convertToCap = b; }
-
- public String hello()
- {
- if (convertToCap) {
- value = value.toUpperCase ();
- }
- return null;
- }
- ... ...
-}
-]]></programlisting>
-
- <para>Next, on the web page, add the following line to display the value property on the simpleAction component. Notice that code completion is supported for the JSF EL expression.</para>
-
- <programlisting role="JSP"><![CDATA[
-<p><b>Hello, #{simpleAction.value}</b></p>
-]]></programlisting>
-
- <para>Finally, on the web page, we add a boolean selection box component. It is bound to the XXXX property on the backend component.</para>
-
- <programlisting role="JSP"><![CDATA[
-<h:selectBooleanCheckbox title="convertToCap"
- value="#{simpleAction.convertToCap}" />
-Capitalize the input?
-]]></programlisting>
-
- <para>Deploy the application and see it in action now.</para>
-
- <figure>
- <title>Add UI components and business logic</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/xxxx.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
-
- <section>
- <title>Add Security to the Application</title>
-
- <para>You have probably noticed that the web page template has a login link at the top of the page. You can use the <property>Seam</property> security framework to secure access to any web page or web action. You can implement the login logic in the XXXX method. In the following example, we just use hardcoded username and password. But you can easily change it to use database, LDAP or any other means.</para>
-
- <programlisting role="JAVA"><![CDATA[
-]]></programlisting>
-
- <para>Then, on the action method, you can use the XXXX annotation to specify that it is only invoked by authenticated users.</para>
-
- <programlisting role="JAVA"><![CDATA[
-]]></programlisting>
-
- <para>Now, re-deploy the application and try the XXXX button. The application redirects to the XXXX page asking for login credentials. The method is invoked after you successfully logged in.</para>
-
- <figure>
- <title>Access control for action methods</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/xxxx.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>We can also secure web pages. You can edit the XXXX file to put an access constraint on the XXXXX page.</para>
-
- <programlisting role="JSP"><![CDATA[
-]]></programlisting>
-
- <para>You can try to load the XXXX URL in the browser and it will redirect to ask for login.</para>
-
- </section>
-
-
-<section id="OtherRelevantResourcesOnTheTopic2">
-<?dbhtml filename="OtherRelevantResourcesOnTheTopic2.html"?>
-<title>Other relevant resources on the topic</title>
-<para>Seam on JBoss: <ulink url="http://www.jboss.com/products/seam">Seam Framework</ulink></para>
-
-<para>Ten Good Reasons to use Seam: <ulink url="http://www.jboss.com/products/seam/whyseam">Why Seam</ulink></para>
-<para>Getting Started: <ulink url="http://labs.jboss.com/jbossseam/gettingstarted">Getting Started with JBoss Seam</ulink></para>
-<para>Wiki: <ulink url="http://www.jboss.com/wiki/Wiki.jsp?page=JBossSeam">JBoss Wiki</ulink></para>
-<para>FAQ: <ulink url="http://labs.jboss.com/jbossseam/faq/index.html">JBoss Seam FAQ</ulink></para>
-<para>Downloads: <ulink url="http://labs.jboss.com/jbossseam/download">JBoss Seam Downloads</ulink></para>
-<para>Jira: <ulink url="http://jira.jboss.org/jira/browse/JBSEAM">Jira issue tracker</ulink></para>
-<para>Rules Framework: <ulink url="http://www.jboss.com/products/rules">JBoss Rules</ulink></para>
-</section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="GetStartSeamGen" xreflabel="GetStartSeamGen">
+ <?dbhtml filename="GetStartSeamGen.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>Red Hat Developer Studio</keyword>
+ <keyword>Seam</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Write Your First Seam Web Application</title>
+
+ <para>The Red Hat Developer Studio provides sophisticated tools for enterprise applications. With the Red Hat Developer Studio, you can get started very quickly with a web prototype, and then scale up your application to include enterprise features (e.g., business processes, web services, etc.) using the same developer tools. It is a "scalable" RAD (Rapid Application Development) tool.</para>
+
+ <para>A core element that makes the Red Hat Developer Studio "scalable" is the JBoss <property>Seam</property> framework. <property>Seam</property> is a fully featured application framework on top of Java EE 5. It is also one of the most popular enterprise Java framework today. <property>Seam</property> deeply integrates many other standard-based or open source frameworks (e.g., JSF, EJB3, JMS, Web Services, jBPM, JBoss Rules, Ajax4jsf, RichFaces, Facelets, Spring, iText, Quartz, TestNG etc.), and provides a single programming model for developers to "drive" those underlying frameworks via simple annotated POJOs (Plain Old Java Objects). It makes life easier for developers to tackle complex enterprise applications with many component frameworks.</para>
+
+ <para>In this chapter, we will cover how to build a simple <property>Seam</property> web application in minutes with the Red Hat Developer Studio.</para>
+
+ <section>
+ <title>Create a Seam Project</title>
+
+ <para>To create a new web application in <property>Seam</property>, select <emphasis>New > Project ... > Seam > Seam Web Project</emphasis>. You will be prompted to enter a name and a location directory for your new project. You will also be asked to choose a JBoss AS server to deploy the project. You must choose the JBoss AS 4.2.0 instance we had defined in the JBoss AS Server manager view.</para>
+
+ <figure>
+ <title>Create a Seam project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SeamNewProj01.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Next, you will be asked to select the "features" you want to use in your project. This allows Red Hat Developer Studio to setup the appropriate tooling for your project. Since JBoss <property>Seam</property> integrates all popular Java EE frameworks, you can select any combination of technologies from the list. Here, for this project, we will select Dynamic Web Module, Java, Java Persistence (JPA), JavaServer Faces (JSF), and <property>Seam</property> Facet for a typical database-driven web application.</para>
+
+ <figure>
+ <title>Select toolings for the project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SeamNewProj02.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>A dynamic web application contains both web pages and Java code. The wizard will ask you where you want to put those files. You can just leave the default values.</para>
+
+ <figure>
+ <title>Select directory names for web pages and Java files</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SeamNewProj03.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+
+ <para>Now you need to define a connection profile and choose a database. If you have no connections yet you should create the one.</para>
+ <orderedlist>
+ <listitem><para>Click Next in the dialog "JPA Facet"</para></listitem>
+ </orderedlist>
+ <figure>
+ <title>Select provider for JPA JARs</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SeamNewProj04.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Since you selected JPA and JSF tooling support, the project needs to incorporate the JAR files for those frameworks on its classpath. In the next screen, 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>
+ <orderedlist continuation="continues">
+ <listitem><para>Check "Server Supplied JSF Implementation". We will use JSF implementation that comes with JBoss server</para></listitem>
+ <listitem><para>Click Next</para></listitem>
+ </orderedlist>
+ <figure>
+ <title>Define JSF Implementation</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SeamNewProj044.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <orderedlist continuation="continues">
+ <listitem><para>Click New button to create a new connection profile.</para></listitem>
+ </orderedlist>
+
+ <figure>
+ <title>Create New Connection Profile</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SeamNewProj045.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <orderedlist continuation="continues">
+ <listitem><para>Give a name to your connection and some description. Click Next.</para></listitem>
+ </orderedlist>
+ <figure>
+ <title>Give a name to connection profile</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/connectionprofile.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Now you need to specify driver and connection details.</para>
+ <orderedlist continuation="continues">
+ <listitem><para>Select Generic JDBC driver from the drop down list Click Next.</para></listitem>
+ </orderedlist>
+ <figure>
+ <title>Select Driver</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/connectionprofile2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>A summary diallog will be prompted. Click Finish.</para>
+
+ <figure>
+ <title>Summary window</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/connectionprofile7.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The project setup wizard also asks you to configure how <property>Seam</property> generates code for the project. The <property>Seam</property> Home Folder should point to a valid <property>Seam</property> distribution. By default, it is set to the <property>Seam</property> distribution bundled in your Red Hat Developer Studio tool. For the deployment format, choose WAR deployment if you want to use POJOs for UI event handling and business logic; choose EAR deployment if you want to EJB3 beans for added features. In most web applications, the WAR deployment option would suffice. You should also enter Java packages for the entity beans (for database mapping) and session beans (for action handlers). All generated code will be placed in those packages. </para>
+
+ <figure>
+ <title>Enter Java packages for generated code</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SeamNewProj06.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on Finish to generate a project. The generated project contains all the necessary library JARs, XML configuration files, the ANT build script, as well as simple XHTML web pages and Java classes for the skeleton web application.</para>
+
+
+ </section>
+
+ <section>
+ <title>Build and Deploy the Seam Application</title>
+
+ <para>Once the application is generated, you can use the "Run on server" menu to build and deploy it into the JBoss AS runtime associated with the project. All you need is to start JBoss AS in the server manager, and load the browser at URL http://localhost:8080/MySeamProj/. You should see the following web page.</para>
+
+ <figure>
+ <title>The generated application in action</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/startedapplication.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>To make simple changes to the page, you just need to double click on the <emphasis>WebContent/home.xhtml file</emphasis> and edit it in the visual editor. Notice that the visual editor lets you both the XHTML code and the rendered page. The rendered view is designed to make it easy to find stuff in a complex XHTML page.</para>
+
+ <figure>
+ <title>Making changes in the visual editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/SeamJsfEditor.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Once you finished editing, save the file (<emphasis>File > Save</emphasis>), re-deploy the application, and reload the browser to see the changes.</para>
+
+ <figure>
+ <title>The front page is changed</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/xxxx.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <!-- Not yet ...
+ <para>Notice that we do not need to re-build and re-deploy the application. Just save the edited page and reload the browser.</para>
+ -->
+
+ </section>
+
+ <section>
+ <title>Add a Web Page and an Action</title>
+
+ <para>To add a new page and related UI action to the project, use the <emphasis>New > Other ... > Seam > Seam Form</emphasis> wizard. You are prompted to enter the name of the web page, the name for the <property>Seam</property> component that handles UI actions from the page, and UI action method name.</para>
+
+ <figure>
+ <title>New form for the application</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/xxxx.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The wizard generate a web page with a single text input field and an action button. Notice that the generated page uses layout/template.xhtml as a template. The template page provides the page header, footer, side menu, and CSS styles (see the template.xhtml for more details). The Simplepage.xhtml is assembled into the template when the Simplepage.seam URL is loaded.</para>
+
+ <programlisting role="JSP"><![CDATA[
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h1>Simplepage</h1>
+ <p>Generated form page</p>
+
+ <h:messages globalOnly="true" styleClass="message"/>
+
+ <h:form id="simpleAction">
+ <div class="dialog">
+ <s:validateAll>
+ <div class="prop">
+ <span class="name">Value</span>
+ <span class="value">
+ <s:decorate>
+ <h:inputText id="value" required="true"
+ value="#{simpleAction.value}"/>
+ </s:decorate>
+ </span>
+ </div>
+ </s:validateAll>
+ </div>
+ <div class="actionButtons">
+ <h:commandButton id="hello" value="hello"
+ action="#{simpleAction.hello}"/>
+ </div>
+ </h:form>
+
+</ui:define>
+
+</ui:composition>
+]]></programlisting>
+
+ <para>The #{simpleAction.value} notation on the web page maps to the "value" property in the backend component named "simpleAction", and the #{simpleAction.hello} notation indicates that the hello() method is called when the button is clicked on. Here is the "simpleAction" named backend <property>Seam</property> component generated by the wizard.</para>
+
+ <programlisting role="JAVA"><![CDATA[
+@Name("simpleAction")
+public class SimpleAction {
+
+ @Logger private Log log;
+
+ @In
+ FacesMessages facesMessages;
+
+ private String value;
+
+ //seam-gen method
+ public String hello()
+ {
+ //implement your business logic here
+ log.info("simpleAction.echo() action called with: #{simpleAction.value}");
+ facesMessages.add("echo #{simpleAction.value}");
+ return "success";
+ }
+
+ //add additional action methods
+
+ @Length(max=10)
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+}
+]]></programlisting>
+
+ <para>Load the Simplepage.seam in the web browser. Type something in the text field and click on the "hello" button. A JSF message containing the input string is created by the SimpleAction.hello() method. The message is displayed on the page via the h:messages tag.</para>
+
+ </section>
+
+ <section>
+ <title>Input Validation</title>
+
+ <para>Notice that in the generated SimpleAction class, there is a @Length annotation to validate the input when the input string is bound to #{simpleAction.value}. To see how this works, enter a text string longer than 10 chars and click on the button. This is what you should see.</para>
+
+ <figure>
+ <title>The input validation in action</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/xxxx.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para><property>Seam</property> supports many different input validation annotations. To see an example, you can replace the @Length(max=10) annotation with the following. It would require the input string to have a first name and last name separated by a space. If the validation fails, the web page would print the customized error message.</para>
+
+ <programlisting role="JAVA"><![CDATA[
+@NotNull
+@Pattern(regex="^[a-zA-Z.-]+ [a-zA-Z.-]+",
+ message="Need a firstname and a lastname")
+public String getValue()
+{
+ return value;
+}
+]]></programlisting>
+
+ <para>Save the Java file, deploy the application, and reload the browser to see the new validation scheme in action.</para>
+
+ <figure>
+ <title>More input validation</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/xxxx.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+ <section>
+ <title>Add a new UI Component</title>
+
+ <para>Now, let's add a little more logic to the application. We will add a new boolean property to the action component. If it is set to true, the action would capitalize the input string and display it on the web page. The following code in the SimpleAction class implements the logic.</para>
+
+ <programlisting role="JAVA"><![CDATA[
+@Name("simpleAction")
+public class SimpleAction {
+
+ private boolean convertToCap;
+
+ public boolean getConvertToCap () { return convertToCap; }
+ public void setConvertToCap (boolean b) { convertToCap = b; }
+
+ public String hello()
+ {
+ if (convertToCap) {
+ value = value.toUpperCase ();
+ }
+ return null;
+ }
+ ... ...
+}
+]]></programlisting>
+
+ <para>Next, on the web page, add the following line to display the value property on the simpleAction component. Notice that code completion is supported for the JSF EL expression.</para>
+
+ <programlisting role="JSP"><![CDATA[
+<p><b>Hello, #{simpleAction.value}</b></p>
+]]></programlisting>
+
+ <para>Finally, on the web page, we add a boolean selection box component. It is bound to the XXXX property on the backend component.</para>
+
+ <programlisting role="JSP"><![CDATA[
+<h:selectBooleanCheckbox title="convertToCap"
+ value="#{simpleAction.convertToCap}" />
+Capitalize the input?
+]]></programlisting>
+
+ <para>Deploy the application and see it in action now.</para>
+
+ <figure>
+ <title>Add UI components and business logic</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/xxxx.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+ <section>
+ <title>Add Security to the Application</title>
+
+ <para>You have probably noticed that the web page template has a login link at the top of the page. You can use the <property>Seam</property> security framework to secure access to any web page or web action. You can implement the login logic in the XXXX method. In the following example, we just use hardcoded username and password. But you can easily change it to use database, LDAP or any other means.</para>
+
+ <programlisting role="JAVA"><![CDATA[
+]]></programlisting>
+
+ <para>Then, on the action method, you can use the XXXX annotation to specify that it is only invoked by authenticated users.</para>
+
+ <programlisting role="JAVA"><![CDATA[
+]]></programlisting>
+
+ <para>Now, re-deploy the application and try the XXXX button. The application redirects to the XXXX page asking for login credentials. The method is invoked after you successfully logged in.</para>
+
+ <figure>
+ <title>Access control for action methods</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/xxxx.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>We can also secure web pages. You can edit the XXXX file to put an access constraint on the XXXXX page.</para>
+
+ <programlisting role="JSP"><![CDATA[
+]]></programlisting>
+
+ <para>You can try to load the XXXX URL in the browser and it will redirect to ask for login.</para>
+
+ </section>
+
+
+<section id="OtherRelevantResourcesOnTheTopic2">
+<?dbhtml filename="OtherRelevantResourcesOnTheTopic2.html"?>
+<title>Other relevant resources on the topic</title>
+<para>Seam on JBoss: <ulink url="http://www.jboss.com/products/seam">Seam Framework</ulink></para>
+
+<para>Ten Good Reasons to use Seam: <ulink url="http://www.jboss.com/products/seam/whyseam">Why Seam</ulink></para>
+<para>Getting Started: <ulink url="http://labs.jboss.com/jbossseam/gettingstarted">Getting Started with JBoss Seam</ulink></para>
+<para>Wiki: <ulink url="http://www.jboss.com/wiki/Wiki.jsp?page=JBossSeam">JBoss Wiki</ulink></para>
+<para>FAQ: <ulink url="http://labs.jboss.com/jbossseam/faq/index.html">JBoss Seam FAQ</ulink></para>
+<para>Downloads: <ulink url="http://labs.jboss.com/jbossseam/download">JBoss Seam Downloads</ulink></para>
+<para>Jira: <ulink url="http://jira.jboss.org/jira/browse/JBSEAM">Jira issue tracker</ulink></para>
+<para>Rules Framework: <ulink url="http://www.jboss.com/products/rules">JBoss Rules</ulink></para>
+</section>
+</chapter>
16 years, 9 months
JBoss Tools SVN: r3499 - trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-07 18:36:30 -0400 (Fri, 07 Sep 2007)
New Revision: 3499
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java
Log:
added ability to add folders as one path
(add folder: abc\def\ghi)
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java 2007-09-07 21:35:09 UTC (rev 3498)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java 2007-09-07 22:36:30 UTC (rev 3499)
@@ -289,12 +289,23 @@
int response = dialog.open();
if (response == Dialog.OK) {
- String folderName = dialog.getValue();
+ String[] folderPaths = dialog.getValue().split("[\\\\/]");
IArchiveNode selected = getSelectedNode();
+ IArchiveFolder current = null;
+ IArchiveFolder temp = null;
+
+ for(int i = folderPaths.length-1; i >= 0 ; i-- ) {
+ temp = ArchiveNodeFactory.createFolder();
+ temp.setName(folderPaths[i]);
+ if( current == null )
+ current = temp;
+ else {
+ temp.addChild(current);
+ current = temp;
+ }
+ }
- IArchiveFolder folder = ArchiveNodeFactory.createFolder();
- folder.setName(folderName);
- ArchivesModel.instance().attach(selected, folder, new NullProgressMonitor());
+ ArchivesModel.instance().attach(selected, current, new NullProgressMonitor());
}
}
16 years, 9 months
JBoss Tools SVN: r3498 - trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-07 17:35:09 -0400 (Fri, 07 Sep 2007)
New Revision: 3498
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java
Log:
Annoying error in context menu removed. (MB_ADDITIONS)
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java 2007-09-07 19:27:50 UTC (rev 3497)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java 2007-09-07 21:35:09 UTC (rev 3498)
@@ -4,6 +4,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
@@ -19,6 +20,7 @@
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;
import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
import org.jboss.ide.eclipse.archives.core.model.ArchiveNodeFactory;
@@ -85,6 +87,7 @@
private void createMenu () {
newPackageManager = new MenuManager(ArchivesUIMessages.ProjectPackagesView_newPackageMenu_label, NEW_PACKAGE_MENU_ID);
addNewPackageActions(newPackageManager);
+ newPackageManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
private void createContextMenu () {
16 years, 9 months